{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./app/webpack/javascripts/lib/helpers.js","webpack:///./app/webpack/javascripts/application/shop/basket-button-animator.js","webpack:///./app/webpack/packs/application/shop-content.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","Helpers","cb","document","readyState","addEventListener","array","callback","scope","length","el","className","classList","add","hasClass","remove","replace","RegExp","toggle","classes","split","existingIndex","indexOf","splice","push","join","contains","RegEx","test","debounce","func","wait","immediate","timeout","context","this","args","arguments","clearTimeout","setTimeout","apply","BasketButtonAnimator","selector","forms","querySelectorAll","forEach","form","event","button","currentTarget","querySelector","span","childNodes","data","getAttribute","setAttribute","disabled","ready"],"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,EAAQ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,WACxBiC,EAAOpC,UAAUC,IAAI,SACrBmC,EAAOQ,UAAW,EAClBL,EAAKD,cAAc,WAAWK,aAAa,aAAc,cAEzDhB,YAAW,WACTS,EAAOQ,UAAW,EAClBR,EAAOpC,UAAUG,OAAO,SACxBoC,EAAKD,cAAc,WAAWK,aAAa,aAAc,gBACzDJ,EAAKC,WAAW,GAAGC,KAAOL,EAAOM,aAAa,0BAC7C,aC9BXrD,IAAQwD,OAAM,WACZ,IAAIhB,EAAqB,CAAEC,SAAU","file":"js/application/shop-content-422f4dc3b6b877ae8f73.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 = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 712);\n","class Helpers {\n static ready(cb) {\n if (document.readyState !== 'loading') {\n cb();\n } else {\n document.addEventListener('DOMContentLoaded', cb);\n }\n }\n\n static forEach(array, callback, scope) {\n for (let i = 0; i < array.length; i += 1) {\n callback.call(scope, array[i], i); // passes back stuff we need\n }\n }\n\n // https://davidwalsh.name/javascript-debounce-function\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n static debounce = (func, wait, immediate) => {\n let timeout;\n\n return function() {\n const context = this;\n const args = arguments;\n\n clearTimeout(timeout);\n\n timeout = setTimeout(function() {\n timeout = null;\n\n if (!immediate) {\n func.apply(context, args)\n }\n }, wait);\n\n if (immediate && !timeout) {\n func.apply(context, args);\n }\n };\n };\n\n static addClass(el, className) {\n if (el.classList) {\n el.classList.add(className);\n } else if (!Helpers.hasClass(el, className)) {\n el.className += ` ${className}`;\n }\n }\n\n static removeClass(el, className) {\n if (el.classList) {\n el.classList.remove(className);\n } else {\n el.className = el.className.replace(new RegExp(`\\\\b${className}\\\\b`, 'g'), '');\n }\n }\n\n static toggleClass(el, className) {\n if (el.classList) {\n el.classList.toggle(className);\n } else {\n let classes = el.className.split(' ');\n let existingIndex = classes.indexOf(className);\n\n if (existingIndex >= 0) {\n classes.splice(existingIndex, 1);\n } else {\n classes.push(className);\n }\n\n el.className = classes.join(' ');\n }\n }\n\n static hasClass(el, className) {\n return el.classList ? el.classList.contains(className) : new RegEx(`\\\\b${className}\\\\b`).test(el.className);\n // return this object so we can chain methods\n // TODO: SOLVE THE PROBLEM OF RETURNING THIS AFTER RETURNING THE hasClass\n // return this;\n }\n}\n\nexport default Helpers;\n","import Helpers from '../../lib/helpers';\n\nclass BasketButtonAnimator {\n constructor({ selector }) {\n const forms = document.querySelectorAll(selector);\n\n if (forms.length <= 0) { return; }\n\n Helpers.forEach(forms, (form) => {\n form.addEventListener('ajax:before', (event) => {\n const button = event.currentTarget.querySelector('button');\n const span = button.querySelector('span');\n\n span.childNodes[2].data = button.getAttribute('data-js-text-spinner');\n button.classList.remove('added');\n button.classList.add('loading');\n span.querySelector('svg use').setAttribute('xlink:href', '#svg--loader');\n });\n\n form.addEventListener('ajax:success', (event) => {\n const button = event.currentTarget.querySelector('button');\n const span = button.querySelector('span');\n\n span.childNodes[2].data = button.getAttribute('data-js-text-complete');\n button.classList.remove('loading');\n button.classList.add('added');\n button.disabled = true;\n span.querySelector('svg use').setAttribute('xlink:href', '#svg--tick');\n\n setTimeout(() => {\n button.disabled = false;\n button.classList.remove('added');\n span.querySelector('svg use').setAttribute('xlink:href', '#svg--basket');\n span.childNodes[2].data = button.getAttribute('data-js-text-initial');\n }, 1500);\n });\n });\n }\n}\n\nexport default BasketButtonAnimator;\n","import Helpers from '../../javascripts/lib/helpers';\nimport BasketButtonAnimator\n from '../../javascripts/application/shop/basket-button-animator';\n\nHelpers.ready(() => {\n new BasketButtonAnimator({ selector: '[data-js-add-to-basket]' });\n});\n"],"sourceRoot":""}