{"version":3,"sources":["webpack://[name]/./src/js/components/CarouselComponent.js","webpack://[name]/./src/js/abstracts/BaseCarousel.js"],"names":["CarouselComponent","_BaseCarousel","element","_this","_classCallCheck","_callSuper","mount","$el","$options","_inherits","_createClass","BaseCarousel","_BaseComponent","key","get","type","startAt","perView","focusAt","gap","autoplay","hoverpause","keyboard","bound","swipeThreshold","dragThreshold","perTouch","touchRatio","touchAngle","animationDuration","rewind","rewindDuration","animationTimingFunc","throttle","direction","peek","breakpoints","classes","ltr","rtl","slider","carousel","swipeable","dragging","cloneSlide","activeNav","activeSlide","disabledArrow","value","options","conf","_objectSpread","this","BASE_CONF","glide","Glide","on","updateArrows","updateSlides","selector","dispatchEvent","CustomEvent","detail","querySelectorAll","forEach","item","index","style","display","length","parseInt","settings","Array","from","visible","classList","glideTrack","querySelector","slideHeight","outerHeight","height","el","offsetHeight","window","getComputedStyle","marginTop","marginBottom","BaseComponent"],"mappings":"keAAqD,IAEhCA,EAAiB,SAAAC,GACpC,SAAAD,EAAYE,GAAS,IAAAC,EAEiB,OAFjBC,IAAA,KAAAJ,IACnBG,EAAAE,EAAA,KAAAL,EAAA,CAAME,KACDI,MAAMH,EAAKI,IAAKJ,EAAKK,UAAUL,EACrC,OAAAM,IAAAT,EAAAC,GAAAS,IAAAV,GAJmC,C,OAASW,I,0+BCEH,IAEvBA,EAAY,SAAAC,GA8M/B,SAAAD,EAAYT,GAAS,OAAAE,IAAA,KAAAO,GAAAN,EAAA,KAAAM,EAAA,CACbT,IACP,OAAAO,IAAAE,EAAAC,GAAAF,IAAAC,EAAA,EAAAE,IAAA,YAAAC,IA/MD,WACE,MAAO,CAULC,KAAM,SAONC,QAAS,EAOTC,QAAS,EAWTC,QAAS,EAOTC,IAAK,GAOLC,UAAU,EAOVC,YAAY,EAOZC,UAAU,EAUVC,OAAO,EAOPC,eAAgB,GAOhBC,cAAe,GAOfC,UAAU,EAOVC,WAAY,GAOZC,WAAY,GAOZC,kBAAmB,IAOnBC,QAAQ,E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,IAAA,oBAAAmC,MAED,SAAkBM,GAChB,IAAIsB,EAAatB,EAAMK,SAASkB,cAAc,iBAE1CC,GADc1B,KAAK2B,YAAYH,GACjBxB,KAAK2B,YAAYzB,EAAMK,SAASkB,cAAc,2BAC5DC,IAAgBF,IAClBA,EAAWT,MAAMa,OAASF,KAE7B,CAAAjE,IAAA,cAAAmC,MAED,SAAYiC,GACV,GAAKA,EAAL,CACA,IAAID,EAASC,EAAGC,aACZf,EAAQgB,OAAOC,iBAAiBH,GAGpC,OADAD,GAAUV,SAASH,EAAMkB,UAAW,IAAMf,SAASH,EAAMmB,aAAc,SAjR1C,C,OAASC","file":"js/component-CarouselComponent-js.chunks.js","sourcesContent":["import BaseCarousel from '../abstracts/BaseCarousel';\n\nexport default class CarouselComponent extends BaseCarousel {\n  constructor(element) {\n    super(element);\n    this.mount(this.$el, this.$options);\n  }\n}\n","//import '@glidejs/glide/src/assets/sass/glide.core.scss';\n//import '@glidejs/glide/src/assets/sass/glide.theme.scss';\nimport Glide from '@glidejs/glide';\n// import Glide from './glide.esm';\nimport BaseComponent from './BaseComponent';\n\nexport default class BaseCarousel extends BaseComponent {\n  get BASE_CONF() {\n    return {\n      /**\n       * Type of the movement.\n       *\n       * Available types:\n       * `slider` - Rewinds slider to the start/end when it reaches the first or last slide.\n       * `carousel` - Changes slides without starting over when it reaches the first or last slide.\n       *\n       * @type {String}\n       */\n      type: 'slider',\n\n      /**\n       * Start at specific slide number defined with zero-based index.\n       *\n       * @type {Number}\n       */\n      startAt: 0,\n\n      /**\n       * A number of slides visible on the single viewport.\n       *\n       * @type {Number}\n       */\n      perView: 1,\n\n      /**\n       * Focus currently active slide at a specified position in the track.\n       *\n       * Available inputs:\n       * `center` - Current slide will be always focused at the center of a track.\n       * `0,1,2,3...` - Current slide will be focused on the specified zero-based index.\n       *\n       * @type {String|Number}\n       */\n      focusAt: 0,\n\n      /**\n       * A size of the gap added between slides.\n       *\n       * @type {Number}\n       */\n      gap: 10,\n\n      /**\n       * Change slides after a specified interval. Use `false` for turning off autoplay.\n       *\n       * @type {Number|Boolean}\n       */\n      autoplay: false,\n\n      /**\n       * Stop autoplay on mouseover event.\n       *\n       * @type {Boolean}\n       */\n      hoverpause: true,\n\n      /**\n       * Allow for changing slides with left and right keyboard arrows.\n       *\n       * @type {Boolean}\n       */\n      keyboard: true,\n\n      /**\n       * Stop running `perView` number of slides from the end. Use this\n       * option if you don't want to have an empty space after\n       * a slider. Works only with `slider` type and a\n       * non-centered `focusAt` setting.\n       *\n       * @type {Boolean}\n       */\n      bound: false,\n\n      /**\n       * Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping.\n       *\n       * @type {Number|Boolean}\n       */\n      swipeThreshold: 15,\n\n      /**\n       * Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging.\n       *\n       * @type {Number|Boolean}\n       */\n      dragThreshold: 10,\n\n      /**\n       * A maximum number of slides to which movement will be made on swiping or dragging. Use `false` for unlimited.\n       *\n       * @type {Number|Boolean}\n       */\n      perTouch: false,\n\n      /**\n       * Moving distance ratio of the slides on a swiping and dragging.\n       *\n       * @type {Number}\n       */\n      touchRatio: 0.5,\n\n      /**\n       * Angle required to activate slides moving on swiping or dragging.\n       *\n       * @type {Number}\n       */\n      touchAngle: 45,\n\n      /**\n       * Duration of the animation in milliseconds.\n       *\n       * @type {Number}\n       */\n      animationDuration: 600,\n\n      /**\n       * Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end.\n       *\n       * @type {Boolean}\n       */\n      rewind: false,\n\n      /**\n       * Duration of the rewinding animation of the `slider` type in milliseconds.\n       *\n       * @type {Number}\n       */\n      rewindDuration: 1000,\n\n      /**\n       * Easing function for the animation.\n       *\n       * @type {String}\n       */\n      animationTimingFunc: 'cubic-bezier(.165, .840, .440, 1)',\n\n      /**\n       * Throttle costly events at most once per every wait milliseconds.\n       *\n       * @type {Number}\n       */\n      throttle: 10,\n\n      /**\n       * Moving direction mode.\n       *\n       * Available inputs:\n       * - 'ltr' - left to right movement,\n       * - 'rtl' - right to left movement.\n       *\n       * @type {String}\n       */\n      direction: 'ltr',\n\n      /**\n       * The distance value of the next and previous viewports which\n       * have to peek in the current view. Accepts number and\n       * pixels as a string. Left and right peeking can be\n       * set up separately with a directions object.\n       *\n       * For example:\n       * `100` - Peek 100px on the both sides.\n       * { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side.\n       *\n       * @type {Number|String|Object}\n       */\n      peek: 0,\n\n      /**\n       * Collection of options applied at specified media breakpoints.\n       * For example: display two slides per view under 800px.\n       * `{\n       *   '800px': {\n       *     perView: 2\n       *   }\n       * }`\n       */\n      breakpoints: {},\n\n      /**\n       * Collection of internally used HTML classes.\n       *\n       * @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object\n       * @type {Object}\n       */\n      classes: {\n        direction: {\n          ltr: 'glide--ltr',\n          rtl: 'glide--rtl'\n        },\n        slider: 'glide--slider',\n        carousel: 'glide--carousel',\n        swipeable: 'glide--swipeable',\n        dragging: 'glide--dragging',\n        cloneSlide: 'glide__slide--clone',\n        activeNav: 'glide__bullet--active',\n        activeSlide: 'glide__slide--active',\n        disabledArrow: 'glide__arrow--disabled'\n      }\n    };\n  }\n\n  constructor(element) {\n    super(element);\n  }\n\n  mount(element, options) {\n    let self = this;\n    const conf = { ...this.BASE_CONF, ...options };\n    let glide = new Glide(element, conf);\n\n    glide.on('build.after', () => {\n      this.updateArrows(glide);\n      this.updateSlides(glide);\n      // this.updateTrackHeight(glide); PITTI20-128\n\n      glide.selector.dispatchEvent(new CustomEvent('glide.build.after', {\n        detail: {\n          'glide': glide\n        }\n      }));\n    });\n\n    glide.on('run.after', () => {\n      this.updateArrows(glide);\n      this.updateSlides(glide);\n      // this.updateTrackHeight(glide); PITTI20-128\n    });\n\n    glide.mount();\n  }\n\n  // https://github.com/glidejs/glide/issues/307\n  updateArrows(glide) {\n    glide.selector.querySelectorAll('.glide__arrow').forEach((item, index) => {\n      switch (index) {\n        case 0:\n          item.style.display = (glide.index > 0) ? '': 'none';\n          break;\n        case 1:\n          const length = glide.selector.querySelectorAll('.glide__slide').length;\n          item.style.display = (glide.index < length - parseInt(glide.settings.perView)) ? '': 'none';\n          break;\n      }\n    });\n  }\n\n  // https://github.com/glidejs/glide/issues/303\n  updateSlides(glide) {\n    Array.from(glide.selector.querySelectorAll('.glide__slide')).forEach((item, index) => {\n      const visible = glide.index <= index && index < (glide.index + parseInt(glide.settings.perView));\n      item.classList[visible ? 'add' : 'remove']('glide__slide--visible');\n    })\n  }\n\n  updateTrackHeight(glide) {\n    var glideTrack = glide.selector.querySelector('.glide__track');\n    var trackHeight = this.outerHeight(glideTrack);\n    var slideHeight = this.outerHeight(glide.selector.querySelector('.glide__slide--active'));\n    if (slideHeight !== glideTrack) {\n      glideTrack.style.height = slideHeight;\n    }\n  }\n\n  outerHeight(el) {\n    if (!el) return;\n    var height = el.offsetHeight;\n    var style = window.getComputedStyle(el);\n\n    height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n    return height;\n  }\n}\n"],"sourceRoot":""}