{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/packs/cards_helper.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","setBackButton","card","frame","cardInterface","document","querySelector","addEventListener","parentNode","appendChild","setAttribute","remove","querySelectorAll","forEach","version","createElement","returnUrl","window","location","protocol","host","createIFrame","id","isFirstTime","isBroken","innerText","replaceChild","style","display","setBrokenCardInterface","fullscreenButton","swichMode","setFullscreenButton","setCardInterface","addOnloadEvent","customClick","createEvent","initMouseEvent","setTimeout","contentDocument","dispatchEvent","addIFrame"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,qBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,kBA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C/Da,IACCpB,EAAMoC,gBAAgBjC,cAAc,2BAA2BkC,cAAcL,GAC7EZ,GAAc,IAGlBW,EAAe/B,EAAOD,KAE3B,KA9DHgC,CAAe/B,EAAOD,EAAMqB,GAjBOkB,CAAWvC,EAAMC,OAFhDoB","file":"js/cards_helper-e55d728004ec80224ee1.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/blog/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 123);\n","document.querySelectorAll('.embed-card-wrapper, .card-preview_frame').forEach(card => {\n const version = card.id\n const frame = createIFrame(version)\n let isFirstTime\n document.querySelector('.blog-container').setAttribute(\"class\", \"card-preview-container\")\n card.addEventListener('click', ()=>addIFrame (card, frame, isFirstTime))\n})\n\nfunction createIFrame(version) {\n const frame = document.createElement(\"IFRAME\");\n const returnUrl = window.location.protocol + \"//\" + window.location.host + '/blog/cards/' + version\n frame.setAttribute(\"src\", returnUrl);\n frame.setAttribute(\"id\", \"card-frame\");\n frame.setAttribute(\"class\", \"card-preview_frame\")\n frame.setAttribute(\"style\", \" border:none; padding:0; display: flex\")\n return frame\n}\n\nfunction addIFrame(card, frame, isFirstTime) {\n const isBroken = document.querySelector(\"#isBroken\").innerText\n card.parentNode.replaceChild(frame, card);\n (isBroken === 'true') ? setBrokenCardInterface(card, frame) : setCardInterface(card, frame);\n addOnloadEvent(frame, card, isFirstTime)\n}\n\nfunction setCardInterface(card, frame) {\n const cardInterface = document.querySelector('.card-interface')\n cardInterface.setAttribute(\"style\", \"display: block;\")\n setBackButton(card, frame, cardInterface)\n setFullscreenButton(frame, cardInterface)\n}\n\nfunction setBrokenCardInterface(card, frame) {\n const cardInterface = document.querySelector('.card-interface')\n cardInterface.setAttribute(\"style\", \"width: 100%;; display: block;\")\n setBackButton(card, frame, cardInterface)\n frame.parentNode.setAttribute(\"style\", \"z-index: 1; position: fixed; background: white; height: 100vh; top: 0; left:0; right:0;\")\n document.querySelector('.fullscreen-button').style.display = 'none'\n}\n\nfunction setBackButton(card, frame, cardInterface) {\n const backButton = document.querySelector('.back-button')\n backButton.addEventListener('click', ()=>{\n frame.parentNode.appendChild(card)\n frame.parentNode.setAttribute(\"style\", \"display: block; border:none; padding:0\")\n frame.remove()\n cardInterface.setAttribute(\"style\", \"display: none; border:none; padding:0;\")\n document.querySelector('.buttons-wrapper').setAttribute(\"style\", \"\")\n })\n}\n\nfunction setFullscreenButton(frame, cardInterface) {\n const fullscreenButton = document.querySelector('.fullscreen-button')\n if(fullscreenButton.style.display === 'none'){\n fullscreenButton.setAttribute('style', \"\")\n }\n fullscreenButton.addEventListener('click', ()=>{\n swichMode(frame, fullscreenButton, cardInterface)\n })\n\n}\n\nfunction swichMode(frame, fullscreenButton, cardInterface){\n frame.parentNode.setAttribute(\"style\", \"z-index: 1; position: fixed; background: white; height: 100vh; top: 0; left:0; right:0;\")\n cardInterface.setAttribute(\"style\", \"width: 100%; display: block;\")\n fullscreenButton.setAttribute(\"style\", \"display: none;\")\n document.querySelector('.buttons-wrapper').setAttribute(\"style\", \"right: 50px\")\n frame.setAttribute(\"style\", \" border:none; padding:0; display: flex;\")\n}\n\nfunction addOnloadEvent(frame, card, isFirstTime){\n let customClick = document.createEvent('MouseEvents')\n customClick.initMouseEvent('mousedown', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n\n setTimeout (()=> {\n if(frame.contentDocument.querySelector('.play-button, .btn_play')){\n frame.contentDocument.querySelector('html').setAttribute(\"style\", 'overflow-x: hidden;')\n if(isFirstTime){\n frame.contentDocument.querySelector('.play-button, .btn_play').dispatchEvent(customClick)\n isFirstTime = false\n }\n }else{\n addOnloadEvent(frame, card)\n }\n }, 250)\n}\n"],"sourceRoot":""}