{"version":3,"file":"front.js","sources":["../../sources/javascripts/front/utilities/utilities.js","../../node_modules/mdn-polyfills/NodeList.prototype.forEach.js","../../sources/javascripts/front/components/toggler/Toggler.js","../../sources/javascripts/front/components/navigation/Navigation.js","../../node_modules/promise-polyfill/src/finally.js","../../node_modules/promise-polyfill/src/allSettled.js","../../node_modules/promise-polyfill/src/index.js","../../node_modules/promise-polyfill/src/polyfill.js","../../node_modules/whatwg-fetch/fetch.js","../../node_modules/url-search-params-polyfill/index.js","../../sources/javascripts/front/components/search/Search.js","../../sources/javascripts/front/components/header/Header.js","../../node_modules/ssr-window/ssr-window.esm.js","../../sources/javascripts/front/components/header/lifecycle.js","../../node_modules/mdn-polyfills/Number.isNaN.js","../../node_modules/dom7/dom7.esm.js","../../node_modules/swiper/esm/utils/dom.js","../../node_modules/swiper/esm/utils/get-support.js","../../node_modules/swiper/esm/utils/get-device.js","../../node_modules/swiper/esm/utils/get-browser.js","../../node_modules/swiper/esm/utils/utils.js","../../node_modules/swiper/esm/modules/resize/resize.js","../../node_modules/swiper/esm/modules/observer/observer.js","../../node_modules/swiper/esm/components/core/events/onTouchStart.js","../../node_modules/swiper/esm/components/core/events/onTouchMove.js","../../node_modules/swiper/esm/components/core/events/onTouchEnd.js","../../node_modules/swiper/esm/components/core/events/onResize.js","../../node_modules/swiper/esm/components/core/events/onClick.js","../../node_modules/swiper/esm/components/core/events/onScroll.js","../../node_modules/swiper/esm/components/core/events/index.js","../../node_modules/swiper/esm/components/core/defaults.js","../../node_modules/swiper/esm/components/core/core-class.js","../../node_modules/swiper/esm/components/core/modular.js","../../node_modules/swiper/esm/components/core/events-emitter.js","../../node_modules/swiper/esm/components/core/update/index.js","../../node_modules/swiper/esm/components/core/update/updateSize.js","../../node_modules/swiper/esm/components/core/update/updateSlides.js","../../node_modules/swiper/esm/components/core/update/updateAutoHeight.js","../../node_modules/swiper/esm/components/core/update/updateSlidesOffset.js","../../node_modules/swiper/esm/components/core/update/updateSlidesProgress.js","../../node_modules/swiper/esm/components/core/update/updateProgress.js","../../node_modules/swiper/esm/components/core/update/updateSlidesClasses.js","../../node_modules/swiper/esm/components/core/update/updateActiveIndex.js","../../node_modules/swiper/esm/components/core/update/updateClickedSlide.js","../../node_modules/swiper/esm/components/core/translate/index.js","../../node_modules/swiper/esm/components/core/translate/getTranslate.js","../../node_modules/swiper/esm/components/core/translate/setTranslate.js","../../node_modules/swiper/esm/components/core/translate/minTranslate.js","../../node_modules/swiper/esm/components/core/translate/maxTranslate.js","../../node_modules/swiper/esm/components/core/translate/translateTo.js","../../node_modules/swiper/esm/components/core/transition/index.js","../../node_modules/swiper/esm/components/core/transition/setTransition.js","../../node_modules/swiper/esm/components/core/transition/transitionStart.js","../../node_modules/swiper/esm/components/core/transition/transitionEnd.js","../../node_modules/swiper/esm/components/core/slide/index.js","../../node_modules/swiper/esm/components/core/slide/slideTo.js","../../node_modules/swiper/esm/components/core/slide/slideToLoop.js","../../node_modules/swiper/esm/components/core/slide/slideNext.js","../../node_modules/swiper/esm/components/core/slide/slidePrev.js","../../node_modules/swiper/esm/components/core/slide/slideReset.js","../../node_modules/swiper/esm/components/core/slide/slideToClosest.js","../../node_modules/swiper/esm/components/core/slide/slideToClickedSlide.js","../../node_modules/swiper/esm/components/core/loop/index.js","../../node_modules/swiper/esm/components/core/loop/loopCreate.js","../../node_modules/swiper/esm/components/core/loop/loopFix.js","../../node_modules/swiper/esm/components/core/loop/loopDestroy.js","../../node_modules/swiper/esm/components/core/grab-cursor/index.js","../../node_modules/swiper/esm/components/core/grab-cursor/setGrabCursor.js","../../node_modules/swiper/esm/components/core/grab-cursor/unsetGrabCursor.js","../../node_modules/swiper/esm/components/core/manipulation/index.js","../../node_modules/swiper/esm/components/core/manipulation/appendSlide.js","../../node_modules/swiper/esm/components/core/manipulation/prependSlide.js","../../node_modules/swiper/esm/components/core/manipulation/addSlide.js","../../node_modules/swiper/esm/components/core/manipulation/removeSlide.js","../../node_modules/swiper/esm/components/core/manipulation/removeAllSlides.js","../../node_modules/swiper/esm/components/core/breakpoints/index.js","../../node_modules/swiper/esm/components/core/breakpoints/setBreakpoint.js","../../node_modules/swiper/esm/components/core/breakpoints/getBreakpoint.js","../../node_modules/swiper/esm/components/core/check-overflow/index.js","../../node_modules/swiper/esm/components/core/classes/index.js","../../node_modules/swiper/esm/components/core/classes/addClasses.js","../../node_modules/swiper/esm/components/core/classes/removeClasses.js","../../node_modules/swiper/esm/components/core/images/index.js","../../node_modules/swiper/esm/components/core/images/loadImage.js","../../node_modules/swiper/esm/components/core/images/preloadImages.js","../../node_modules/swiper/esm/components/navigation/navigation.js","../../node_modules/swiper/esm/components/pagination/pagination.js","../../node_modules/swiper/esm/components/autoplay/autoplay.js","../../sources/javascripts/front/components/carousel/Carousel.js","../../sources/javascripts/front/components/carousel/lifecycle.js","../../sources/javascripts/front/components/accordion/Accordion.js","../../sources/javascripts/front/components/accordion/lifecycle.js","../../sources/javascripts/front/components/tablist/Tablist.js","../../sources/javascripts/front/components/tablist/lifecycle.js","../../node_modules/mdn-polyfills/CustomEvent.js","../../sources/javascripts/front/components/filter/Filter.js","../../sources/javascripts/front/components/filter/lifecycle.js","../../node_modules/iframe-resizer/js/iframeResizer.js","../../sources/javascripts/front/components/iframe/Iframe.js","../../sources/javascripts/front/components/iframe/lifecycle.js","../../sources/javascripts/front/components/slider/Slider.js","../../node_modules/vanilla-marquee/dist/vanilla-marquee.js","../../sources/javascripts/front/components/slider/lifecycle.js","../../sources/javascripts/front/components/marquee/Marquee.js","../../sources/javascripts/front/components/marquee/lifecycle.js","../../sources/javascripts/front/components/footer/Footer.js","../../sources/javascripts/front/components/footer/lifecycle.js","../../sources/javascripts/front/components/contact/Contact.js","../../sources/javascripts/front/components/contact/lifecycle.js","../../sources/javascripts/front/components/map/Map.js","../../sources/javascripts/front/components/map/lifecycle.js"],"sourcesContent":["export function debounce(callback, delay) {\n let timer;\n return (...args) => {\n const context = this;\n clearTimeout(timer);\n timer = setTimeout(() => {\n callback.apply(context, args);\n }, delay);\n };\n}\n","window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(o,t){t=t||window;for(var i=0;i {\n if (toggler.target !== e.detail.toggler.target && toggler.expanded) {\n toggler.hide();\n }\n });\n this.toggler = e.detail.toggler.element;\n this.element.dispatchEvent(new CustomEvent(\"navigation:update\"));\n }\n\n mount() {\n this.element.querySelectorAll('[data-navigation-toggler]').forEach((element) => {\n const target = document.getElementById(element.dataset.navigationToggler);\n const toggler = new Toggler(element, target, true);\n this.togglers.push(toggler);\n\n element.addEventListener('toggler:hide', this.handleTogglerHide);\n element.addEventListener('toggler:show', this.handleTogglerShow);\n\n toggler.mount();\n });\n }\n\n unmount() {\n this.togglers.forEach((toggler) => {\n toggler.element.removeEventListener('toggler:hide', this.handleTogglerHide);\n toggler.element.removeEventListener('toggler:show', this.handleTogglerShow);\n toggler.unmount();\n });\n\n this.togglers = [];\n }\n}\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","import Promise from './index';\nimport promiseFinally from './finally';\nimport allSettled from './allSettled';\n\n/** @suppress {undefinedVars} */\nvar globalNS = (function() {\n // the only reliable means to get the global object is\n // `Function('return this')()`\n // However, this causes CSP violations in Chrome apps.\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('unable to locate global object');\n})();\n\n// Expose the polyfill if Promise is undefined or set to a\n// non-function value. The latter can be due to a named HTMLElement\n// being exposed by browsers for legacy reasons.\n// https://github.com/taylorhakes/promise-polyfill/issues/114\nif (typeof globalNS['Promise'] !== 'function') {\n globalNS['Promise'] = Promise;\n} else if (!globalNS.Promise.prototype['finally']) {\n globalNS.Promise.prototype['finally'] = promiseFinally;\n} else if (!globalNS.Promise.allSettled) {\n globalNS.Promise.allSettled = allSettled;\n}\n","var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : ''\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n","/**\n *\n *\n * @author Jerry Bendy \n * @licence MIT\n *\n */\n\n(function(self) {\n 'use strict';\n\n var nativeURLSearchParams = (function() {\n // #41 Fix issue in RN\n try {\n if (self.URLSearchParams && (new self.URLSearchParams('foo=bar')).get('foo') === 'bar') {\n return self.URLSearchParams;\n }\n } catch (e) {}\n return null;\n })(),\n isSupportObjectConstructor = nativeURLSearchParams && (new nativeURLSearchParams({a: 1})).toString() === 'a=1',\n // There is a bug in safari 10.1 (and earlier) that incorrectly decodes `%2B` as an empty space and not a plus.\n decodesPlusesCorrectly = nativeURLSearchParams && (new nativeURLSearchParams('s=%2B').get('s') === '+'),\n __URLSearchParams__ = \"__URLSearchParams__\",\n // Fix bug in Edge which cannot encode ' &' correctly\n encodesAmpersandsCorrectly = nativeURLSearchParams ? (function() {\n var ampersandTest = new nativeURLSearchParams();\n ampersandTest.append('s', ' &');\n return ampersandTest.toString() === 's=+%26';\n })() : true,\n prototype = URLSearchParamsPolyfill.prototype,\n iterable = !!(self.Symbol && self.Symbol.iterator);\n\n if (nativeURLSearchParams && isSupportObjectConstructor && decodesPlusesCorrectly && encodesAmpersandsCorrectly) {\n return;\n }\n\n\n /**\n * Make a URLSearchParams instance\n *\n * @param {object|string|URLSearchParams} search\n * @constructor\n */\n function URLSearchParamsPolyfill(search) {\n search = search || \"\";\n\n // support construct object with another URLSearchParams instance\n if (search instanceof URLSearchParams || search instanceof URLSearchParamsPolyfill) {\n search = search.toString();\n }\n this [__URLSearchParams__] = parseToDict(search);\n }\n\n\n /**\n * Appends a specified key/value pair as a new search parameter.\n *\n * @param {string} name\n * @param {string} value\n */\n prototype.append = function(name, value) {\n appendTo(this [__URLSearchParams__], name, value);\n };\n\n /**\n * Deletes the given search parameter, and its associated value,\n * from the list of all search parameters.\n *\n * @param {string} name\n */\n prototype['delete'] = function(name) {\n delete this [__URLSearchParams__] [name];\n };\n\n /**\n * Returns the first value associated to the given search parameter.\n *\n * @param {string} name\n * @returns {string|null}\n */\n prototype.get = function(name) {\n var dict = this [__URLSearchParams__];\n return this.has(name) ? dict[name][0] : null;\n };\n\n /**\n * Returns all the values association with a given search parameter.\n *\n * @param {string} name\n * @returns {Array}\n */\n prototype.getAll = function(name) {\n var dict = this [__URLSearchParams__];\n return this.has(name) ? dict [name].slice(0) : [];\n };\n\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n *\n * @param {string} name\n * @returns {boolean}\n */\n prototype.has = function(name) {\n return hasOwnProperty(this [__URLSearchParams__], name);\n };\n\n /**\n * Sets the value associated to a given search parameter to\n * the given value. If there were several values, delete the\n * others.\n *\n * @param {string} name\n * @param {string} value\n */\n prototype.set = function set(name, value) {\n this [__URLSearchParams__][name] = ['' + value];\n };\n\n /**\n * Returns a string containg a query string suitable for use in a URL.\n *\n * @returns {string}\n */\n prototype.toString = function() {\n var dict = this[__URLSearchParams__], query = [], i, key, name, value;\n for (key in dict) {\n name = encode(key);\n for (i = 0, value = dict[key]; i < value.length; i++) {\n query.push(name + '=' + encode(value[i]));\n }\n }\n return query.join('&');\n };\n\n // There is a bug in Safari 10.1 and `Proxy`ing it is not enough.\n var forSureUsePolyfill = !decodesPlusesCorrectly;\n var useProxy = (!forSureUsePolyfill && nativeURLSearchParams && !isSupportObjectConstructor && self.Proxy);\n /*\n * Apply polifill to global object and append other prototype into it\n */\n Object.defineProperty(self, 'URLSearchParams', {\n value: (useProxy ?\n // Safari 10.0 doesn't support Proxy, so it won't extend URLSearchParams on safari 10.0\n new Proxy(nativeURLSearchParams, {\n construct: function(target, args) {\n return new target((new URLSearchParamsPolyfill(args[0]).toString()));\n }\n }) :\n URLSearchParamsPolyfill)\n });\n\n var USPProto = self.URLSearchParams.prototype;\n\n USPProto.polyfill = true;\n\n /**\n *\n * @param {function} callback\n * @param {object} thisArg\n */\n USPProto.forEach = USPProto.forEach || function(callback, thisArg) {\n var dict = parseToDict(this.toString());\n Object.getOwnPropertyNames(dict).forEach(function(name) {\n dict[name].forEach(function(value) {\n callback.call(thisArg, value, name, this);\n }, this);\n }, this);\n };\n\n /**\n * Sort all name-value pairs\n */\n USPProto.sort = USPProto.sort || function() {\n var dict = parseToDict(this.toString()), keys = [], k, i, j;\n for (k in dict) {\n keys.push(k);\n }\n keys.sort();\n\n for (i = 0; i < keys.length; i++) {\n this['delete'](keys[i]);\n }\n for (i = 0; i < keys.length; i++) {\n var key = keys[i], values = dict[key];\n for (j = 0; j < values.length; j++) {\n this.append(key, values[j]);\n }\n }\n };\n\n /**\n * Returns an iterator allowing to go through all keys of\n * the key/value pairs contained in this object.\n *\n * @returns {function}\n */\n USPProto.keys = USPProto.keys || function() {\n var items = [];\n this.forEach(function(item, name) {\n items.push(name);\n });\n return makeIterator(items);\n };\n\n /**\n * Returns an iterator allowing to go through all values of\n * the key/value pairs contained in this object.\n *\n * @returns {function}\n */\n USPProto.values = USPProto.values || function() {\n var items = [];\n this.forEach(function(item) {\n items.push(item);\n });\n return makeIterator(items);\n };\n\n /**\n * Returns an iterator allowing to go through all key/value\n * pairs contained in this object.\n *\n * @returns {function}\n */\n USPProto.entries = USPProto.entries || function() {\n var items = [];\n this.forEach(function(item, name) {\n items.push([name, item]);\n });\n return makeIterator(items);\n };\n\n\n if (iterable) {\n USPProto[self.Symbol.iterator] = USPProto[self.Symbol.iterator] || USPProto.entries;\n }\n\n\n function encode(str) {\n var replace = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'\\(\\)~]|%20|%00/g, function(match) {\n return replace[match];\n });\n }\n\n function decode(str) {\n return str\n .replace(/[ +]/g, '%20')\n .replace(/(%[a-f0-9]{2})+/ig, function(match) {\n return decodeURIComponent(match);\n });\n }\n\n function makeIterator(arr) {\n var iterator = {\n next: function() {\n var value = arr.shift();\n return {done: value === undefined, value: value};\n }\n };\n\n if (iterable) {\n iterator[self.Symbol.iterator] = function() {\n return iterator;\n };\n }\n\n return iterator;\n }\n\n function parseToDict(search) {\n var dict = {};\n\n if (typeof search === \"object\") {\n // if `search` is an array, treat it as a sequence\n if (isArray(search)) {\n for (var i = 0; i < search.length; i++) {\n var item = search[i];\n if (isArray(item) && item.length === 2) {\n appendTo(dict, item[0], item[1]);\n } else {\n throw new TypeError(\"Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements\");\n }\n }\n\n } else {\n for (var key in search) {\n if (search.hasOwnProperty(key)) {\n appendTo(dict, key, search[key]);\n }\n }\n }\n\n } else {\n // remove first '?'\n if (search.indexOf(\"?\") === 0) {\n search = search.slice(1);\n }\n\n var pairs = search.split(\"&\");\n for (var j = 0; j < pairs.length; j++) {\n var value = pairs [j],\n index = value.indexOf('=');\n\n if (-1 < index) {\n appendTo(dict, decode(value.slice(0, index)), decode(value.slice(index + 1)));\n\n } else {\n if (value) {\n appendTo(dict, decode(value), '');\n }\n }\n }\n }\n\n return dict;\n }\n\n function appendTo(dict, name, value) {\n var val = typeof value === 'string' ? value : (\n value !== null && value !== undefined && typeof value.toString === 'function' ? value.toString() : JSON.stringify(value)\n );\n\n // #47 Prevent using `hasOwnProperty` as a property name\n if (hasOwnProperty(dict, name)) {\n dict[name].push(val);\n } else {\n dict[name] = [val];\n }\n }\n\n function isArray(val) {\n return !!val && '[object Array]' === Object.prototype.toString.call(val);\n }\n\n function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }\n\n})(typeof global !== 'undefined' ? global : (typeof window !== 'undefined' ? window : this));\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport 'promise-polyfill/src/polyfill';\nimport 'whatwg-fetch';\nimport 'url-search-params-polyfill';\nimport { debounce } from '../../utilities/utilities';\n\nexport default class Search {\n\n constructor(element) {\n this.element = element;\n this.form = this.element.querySelector('[data-search-form]');\n this.input = this.element.querySelector('[data-search-input]');\n this.results = this.element.querySelector('[data-search-results]');\n this.theme = this.form.dataset.searchTheme;\n\n this.handleDebouncedKeyUp = debounce(this.handleDebouncedKeyUp.bind(this), 300);\n }\n\n handleDebouncedKeyUp(e) {\n // const formData = new FormData(this.form);\n // formData.append('format', 'json');\n // formData.append('theme', this.theme);\n // const params = new URLSearchParams(formData).toString();\n\n const params = `${this.input.name}=${this.input.value}&format=json&theme=${this.theme}`;\n\n const init = {\n method: this.form.method,\n headers: {\n 'Content-Type': 'application/json'\n },\n cache: 'default',\n };\n\n if (this.input.value !== \"\") {\n window.fetch(`${this.form.action}?${params}`, init)\n .then((response) => {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n\n return response.json();\n })\n .then((json) => {\n this.showResults(json);\n })\n .catch((error) => {\n console.error(error);\n });\n } else {\n this.results.innerHTML = '';\n }\n }\n\n generateResultsLine(data) {\n let html = `
  • `;\n html += `${data.post_title}`;\n\n if (Object.prototype.hasOwnProperty.call(data, 'theme')) {\n html += ` ${data.theme.name}`;\n }\n\n html += ``;\n html += `
  • `;\n return html;\n }\n\n generateResults(data, id) {\n let html = `
    `;\n html += `

    ${data.name} (${data.total})

    `;\n html += `
      `;\n\n data.results.forEach((result) => {\n html += this.generateResultsLine(result);\n });\n\n html += `
    `;\n html += `

    Tous les résultats${ id !== 'others' ? ` ${data.name}` : ''}

    `;\n html += `
    `;\n return html;\n }\n\n showResults(json) {\n let atLeastOneResult = false;\n let html = ``;\n\n Object.keys(json).forEach((key) => {\n if (json[key].results.length > 0) {\n atLeastOneResult = true;\n html += this.generateResults(json[key], key);\n }\n });\n\n if (!atLeastOneResult) {\n html = `

    Aucun résultat pour cette recherche.

    `;\n }\n\n this.results.innerHTML = html;\n }\n\n mount() {\n this.input.addEventListener('keyup', this.handleDebouncedKeyUp);\n }\n\n unmount() {\n this.input.removeEventListener('keyup', this.handleDebouncedKeyUp);\n }\n}\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport { debounce } from '../../utilities/utilities';\nimport Toggler from '../toggler/Toggler';\nimport Navigation from '../navigation/Navigation';\nimport Search from '../search/Search';\n\nexport default class Header {\n\n constructor(element) {\n this.element = element;\n this.top = this.element.querySelector('#header-top');\n this.main = this.element.querySelector('#header-main');\n this.navigationTogglers = [];\n this.searchTogglers = [];\n this.tmp = 0;\n this.navigation = null\n this.navigationToggler = null;\n this.search = null;\n this.searchToggler = null;\n this.hasOverlay = false;\n this.countOverlay = 0;\n\n this.handleSearchHide = this.handleSearchHide.bind(this);\n this.handleSearchShow = this.handleSearchShow.bind(this);\n this.handleNavigationHide = this.handleNavigationHide.bind(this);\n this.handleNavigationShow = this.handleNavigationShow.bind(this);\n this.handleNavigationUpdate = this.handleNavigationUpdate.bind(this);\n this.handleScroll = this.handleScroll.bind(this);\n this.handleDebouncedResize = debounce(this.handleDebouncedResize.bind(this), 100);\n }\n\n handleNavigationHide() {\n this.navigation.togglers.forEach((toggler) => {\n toggler.hide(true);\n });\n\n this.navigationToggler.focus();\n this.navigationToggler = null;\n this.update();\n }\n\n handleNavigationShow(e) {\n this.navigationToggler = e.detail.toggler.element;\n this.update();\n }\n\n handleNavigationUpdate() {\n this.update();\n }\n\n handleSearchHide(e) {\n this.searchToggler.focus();\n this.searchToggler = null;\n this.update();\n }\n\n handleSearchShow(e) {\n this.searchToggler = e.detail.toggler.element;\n this.search.input.focus();\n this.update();\n }\n\n handleScroll() {\n document.documentElement.style.setProperty('--header-effective-height', `${this.element.offsetHeight + this.element.getBoundingClientRect().y }px`);\n }\n\n handleDebouncedResize() {\n if (this.tmp !== this.element.offsetWidth) {\n\n if (this.top) {\n document.documentElement.style.setProperty('--header-top-height', `${this.top.offsetHeight}px`);\n }\n document.documentElement.style.setProperty('--header-main-height', `${this.main.offsetHeight}px`);\n document.documentElement.style.setProperty('--header-height', `${this.element.offsetHeight}px`);\n\n this.navigationTogglers.forEach((toggler) => {\n const isTogglable = window.getComputedStyle(toggler.element).getPropertyValue('display') !== 'none';\n\n if (toggler.mounted !== isTogglable) {\n if (isTogglable) {\n toggler.mount();\n } else {\n toggler.unmount();\n }\n }\n });\n\n this.tmp = this.element.offsetWidth;\n }\n }\n\n update() {\n const isSearchHidden = this.search.element.getAttribute('aria-hidden') === 'true';\n let isNavigationHasTogglerExpanded = false;\n\n this.navigation.togglers.forEach((toggler) => {\n if (!toggler.target.contains(toggler.element)) {\n isNavigationHasTogglerExpanded = toggler.expanded === true ? true : isNavigationHasTogglerExpanded;\n }\n });\n\n if ((!isSearchHidden || isNavigationHasTogglerExpanded ) && !this.hasOverlay) {\n document.body.classList.add('has-overlay');\n this.hasOverlay = true;\n } else if ((isSearchHidden && !isNavigationHasTogglerExpanded ) && this.hasOverlay) {\n document.body.classList.remove('has-overlay');\n this.hasOverlay = false;\n }\n }\n\n mount() {\n this.element.querySelectorAll('[data-header-toggler=\"navigation\"]').forEach((element) => {\n const target = document.getElementById(element.dataset.headerToggler);\n const toggler = new Toggler(element, target);\n this.navigationTogglers.push(toggler);\n element.addEventListener('toggler:hide', this.handleNavigationHide);\n element.addEventListener('toggler:show', this.handleNavigationShow);\n\n if (window.getComputedStyle(element).getPropertyValue('display') !== 'none') {\n toggler.mount();\n }\n });\n\n const nav = this.element.querySelector('#navigation');\n if (nav) {\n this.navigation = new Navigation(nav);\n this.navigation.element.addEventListener('navigation:update', this.handleNavigationUpdate);\n this.navigation.mount();\n }\n\n const search = this.element.querySelector('#search');\n if (search) {\n this.search = new Search(search);\n this.element.querySelectorAll('[data-header-toggler=\"search\"]').forEach((element) => {\n const target = document.getElementById(element.dataset.headerToggler);\n const toggler = new Toggler(element, target, true);\n this.searchTogglers.push(toggler);\n toggler.mount();\n\n element.addEventListener('toggler:hide', this.handleSearchHide);\n element.addEventListener('toggler:show', this.handleSearchShow);\n });\n this.search.mount();\n }\n\n window.addEventListener('resize', this.handleDebouncedResize);\n window.addEventListener('scroll', this.handleScroll);\n this.handleDebouncedResize();\n this.handleScroll();\n }\n\n unmount() {\n window.removeEventListener('resize', this.handleDebouncedResize);\n window.removeEventListener('scroll', this.handleScroll);\n\n this.navigation.unmount();\n this.navigation.element.removeEventListener('navigation:update', this.handleNavigationUpdate);\n this.navigationTogglers.forEach((toggler) => {\n toggler.element.removeEventListener('toggler:hide', this.handleNavigationHide);\n toggler.element.removeEventListener('toggler:show', this.handleNavigationShow);\n toggler.unmount();\n });\n\n this.search.unmount();\n this.searchTogglers.forEach((toggler) => {\n toggler.element.removeEventListener('toggler:hide', this.handleSearchHide);\n toggler.element.removeEventListener('toggler:show', this.handleSearchShow);\n toggler.unmount();\n });\n }\n}\n","/**\n * SSR Window 3.0.0-alpha.4\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2020, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: May 20, 2020\n */\n/* eslint-disable no-param-reassign */\nfunction isObject(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n 'constructor' in obj &&\n obj.constructor === Object);\n}\nfunction extend(target, src) {\n if (target === void 0) { target = {}; }\n if (src === void 0) { src = {}; }\n Object.keys(src).forEach(function (key) {\n if (typeof target[key] === 'undefined')\n target[key] = src[key];\n else if (isObject(src[key]) &&\n isObject(target[key]) &&\n Object.keys(src[key]).length > 0) {\n extend(target[key], src[key]);\n }\n });\n}\n\nvar ssrDocument = {\n body: {},\n addEventListener: function () { },\n removeEventListener: function () { },\n activeElement: {\n blur: function () { },\n nodeName: '',\n },\n querySelector: function () {\n return null;\n },\n querySelectorAll: function () {\n return [];\n },\n getElementById: function () {\n return null;\n },\n createEvent: function () {\n return {\n initEvent: function () { },\n };\n },\n createElement: function () {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute: function () { },\n getElementsByTagName: function () {\n return [];\n },\n };\n },\n createElementNS: function () {\n return {};\n },\n importNode: function () {\n return null;\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: '',\n },\n};\nfunction getDocument() {\n var doc = typeof document !== 'undefined' ? document : {};\n extend(doc, ssrDocument);\n return doc;\n}\n\nvar ssrWindow = {\n document: ssrDocument,\n navigator: {\n userAgent: '',\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: '',\n },\n history: {\n replaceState: function () { },\n pushState: function () { },\n go: function () { },\n back: function () { },\n },\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener: function () { },\n removeEventListener: function () { },\n getComputedStyle: function () {\n return {\n getPropertyValue: function () {\n return '';\n },\n };\n },\n Image: function () { },\n Date: function () { },\n screen: {},\n setTimeout: function () { },\n clearTimeout: function () { },\n matchMedia: function () {\n return {};\n },\n requestAnimationFrame: function (callback) {\n if (typeof setTimeout === 'undefined') {\n callback();\n return null;\n }\n return setTimeout(callback, 0);\n },\n cancelAnimationFrame: function (id) {\n if (typeof setTimeout === 'undefined') {\n return;\n }\n clearTimeout(id);\n },\n};\nfunction getWindow() {\n var win = typeof window !== 'undefined' ? window : {};\n extend(win, ssrWindow);\n return win;\n}\n\nexport { extend, getDocument, getWindow, ssrDocument, ssrWindow };\n","import Header from './Header';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const headerElement = document.getElementById('header');\n if (headerElement) {\n const header = new Header(headerElement);\n header.mount();\n }\n});\n","Number.isNaN=Number.isNaN||function(N){return N!=N};\n","/**\n * Dom7 3.0.0-alpha.9\n * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API\n * https://framework7.io/docs/dom7.html\n *\n * Copyright 2020, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: August 25, 2020\n */\nimport { getWindow, getDocument } from 'ssr-window';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/* eslint-disable no-proto */\nfunction makeReactive(obj) {\n var proto = obj.__proto__;\n Object.defineProperty(obj, '__proto__', {\n get: function get() {\n return proto;\n },\n set: function set(value) {\n proto.__proto__ = value;\n }\n });\n}\n\nvar Dom7 = /*#__PURE__*/function (_Array) {\n _inheritsLoose(Dom7, _Array);\n\n function Dom7(items) {\n var _this;\n\n _this = _Array.call.apply(_Array, [this].concat(items)) || this;\n makeReactive(_assertThisInitialized(_this));\n return _this;\n }\n\n return Dom7;\n}( /*#__PURE__*/_wrapNativeSuper(Array));\n\nfunction arrayFlat(arr) {\n if (arr === void 0) {\n arr = [];\n }\n\n var res = [];\n arr.forEach(function (el) {\n if (Array.isArray(el)) {\n res.push.apply(res, arrayFlat(el));\n } else {\n res.push(el);\n }\n });\n return res;\n}\nfunction arrayFilter(arr, callback) {\n return Array.prototype.filter.call(arr, callback);\n}\nfunction arrayUnique(arr) {\n var uniqueArray = [];\n\n for (var i = 0; i < arr.length; i += 1) {\n if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);\n }\n\n return uniqueArray;\n}\nfunction toCamelCase(string) {\n return string.toLowerCase().replace(/-(.)/g, function (match, group) {\n return group.toUpperCase();\n });\n}\n\nfunction qsa(selector, context) {\n if (typeof selector !== 'string') {\n return [selector];\n }\n\n var a = [];\n var res = context.querySelectorAll(selector);\n\n for (var i = 0; i < res.length; i += 1) {\n a.push(res[i]);\n }\n\n return a;\n}\n\nfunction $(selector, context) {\n var window = getWindow();\n var document = getDocument();\n var arr = [];\n\n if (!context && selector instanceof Dom7) {\n return selector;\n }\n\n if (!selector) {\n return new Dom7(arr);\n }\n\n if (typeof selector === 'string') {\n var html = selector.trim();\n\n if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {\n var toCreate = 'div';\n if (html.indexOf(' 0;\n }).length > 0;\n}\n\nfunction attr(attrs, value) {\n if (arguments.length === 1 && typeof attrs === 'string') {\n // Get attr\n if (this[0]) return this[0].getAttribute(attrs);\n return undefined;\n } // Set attrs\n\n\n for (var i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i].setAttribute(attrs, value);\n } else {\n // Object\n for (var attrName in attrs) {\n this[i][attrName] = attrs[attrName];\n this[i].setAttribute(attrName, attrs[attrName]);\n }\n }\n }\n\n return this;\n}\n\nfunction removeAttr(attr) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].removeAttribute(attr);\n }\n\n return this;\n}\n\nfunction prop(props, value) {\n if (arguments.length === 1 && typeof props === 'string') {\n // Get prop\n if (this[0]) return this[0][props];\n } else {\n // Set props\n for (var i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i][props] = value;\n } else {\n // Object\n for (var propName in props) {\n this[i][propName] = props[propName];\n }\n }\n }\n\n return this;\n }\n\n return this;\n}\n\nfunction data(key, value) {\n var el;\n\n if (typeof value === 'undefined') {\n el = this[0];\n if (!el) return undefined; // Get value\n\n if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {\n return el.dom7ElementDataStorage[key];\n }\n\n var dataKey = el.getAttribute(\"data-\" + key);\n\n if (dataKey) {\n return dataKey;\n }\n\n return undefined;\n } // Set value\n\n\n for (var i = 0; i < this.length; i += 1) {\n el = this[i];\n if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};\n el.dom7ElementDataStorage[key] = value;\n }\n\n return this;\n}\n\nfunction removeData(key) {\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {\n el.dom7ElementDataStorage[key] = null;\n delete el.dom7ElementDataStorage[key];\n }\n }\n}\n\nfunction dataset() {\n var el = this[0];\n if (!el) return undefined;\n var dataset = {}; // eslint-disable-line\n\n if (el.dataset) {\n for (var dataKey in el.dataset) {\n dataset[dataKey] = el.dataset[dataKey];\n }\n } else {\n for (var i = 0; i < el.attributes.length; i += 1) {\n var _attr = el.attributes[i];\n\n if (_attr.name.indexOf('data-') >= 0) {\n dataset[toCamelCase(_attr.name.split('data-')[1])] = _attr.value;\n }\n }\n }\n\n for (var key in dataset) {\n if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;\n }\n\n return dataset;\n}\n\nfunction val(value) {\n if (typeof value === 'undefined') {\n // get value\n var el = this[0];\n if (!el) return undefined;\n\n if (el.multiple && el.nodeName.toLowerCase() === 'select') {\n var values = [];\n\n for (var i = 0; i < el.selectedOptions.length; i += 1) {\n values.push(el.selectedOptions[i].value);\n }\n\n return values;\n }\n\n return el.value;\n } // set value\n\n\n for (var _i = 0; _i < this.length; _i += 1) {\n var _el = this[_i];\n\n if (Array.isArray(value) && _el.multiple && _el.nodeName.toLowerCase() === 'select') {\n for (var j = 0; j < _el.options.length; j += 1) {\n _el.options[j].selected = value.indexOf(_el.options[j].value) >= 0;\n }\n } else {\n _el.value = value;\n }\n }\n\n return this;\n}\n\nfunction value(value) {\n return this.val(value);\n}\n\nfunction transform(transform) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.transform = transform;\n }\n\n return this;\n}\n\nfunction transition(duration) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.transition = typeof duration !== 'string' ? duration + \"ms\" : duration;\n }\n\n return this;\n}\n\nfunction on() {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n var eventType = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventType = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n if (!capture) capture = false;\n\n function handleLiveEvent(e) {\n var target = e.target;\n if (!target) return;\n var eventData = e.target.dom7EventData || [];\n\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n\n if ($(target).is(targetSelector)) listener.apply(target, eventData);else {\n var _parents = $(target).parents(); // eslint-disable-line\n\n\n for (var k = 0; k < _parents.length; k += 1) {\n if ($(_parents[k]).is(targetSelector)) listener.apply(_parents[k], eventData);\n }\n }\n }\n\n function handleEvent(e) {\n var eventData = e && e.target ? e.target.dom7EventData || [] : [];\n\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n\n listener.apply(this, eventData);\n }\n\n var events = eventType.split(' ');\n var j;\n\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (!targetSelector) {\n for (j = 0; j < events.length; j += 1) {\n var event = events[j];\n if (!el.dom7Listeners) el.dom7Listeners = {};\n if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];\n el.dom7Listeners[event].push({\n listener: listener,\n proxyListener: handleEvent\n });\n el.addEventListener(event, handleEvent, capture);\n }\n } else {\n // Live events\n for (j = 0; j < events.length; j += 1) {\n var _event = events[j];\n if (!el.dom7LiveListeners) el.dom7LiveListeners = {};\n if (!el.dom7LiveListeners[_event]) el.dom7LiveListeners[_event] = [];\n\n el.dom7LiveListeners[_event].push({\n listener: listener,\n proxyListener: handleLiveEvent\n });\n\n el.addEventListener(_event, handleLiveEvent, capture);\n }\n }\n }\n\n return this;\n}\n\nfunction off() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n var eventType = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventType = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n if (!capture) capture = false;\n var events = eventType.split(' ');\n\n for (var i = 0; i < events.length; i += 1) {\n var event = events[i];\n\n for (var j = 0; j < this.length; j += 1) {\n var el = this[j];\n var handlers = void 0;\n\n if (!targetSelector && el.dom7Listeners) {\n handlers = el.dom7Listeners[event];\n } else if (targetSelector && el.dom7LiveListeners) {\n handlers = el.dom7LiveListeners[event];\n }\n\n if (handlers && handlers.length) {\n for (var k = handlers.length - 1; k >= 0; k -= 1) {\n var handler = handlers[k];\n\n if (listener && handler.listener === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (!listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n }\n }\n }\n }\n }\n\n return this;\n}\n\nfunction once() {\n var dom = this;\n\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n var eventName = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventName = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n function onceHandler() {\n for (var _len8 = arguments.length, eventArgs = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n eventArgs[_key8] = arguments[_key8];\n }\n\n listener.apply(this, eventArgs);\n dom.off(eventName, targetSelector, onceHandler, capture);\n\n if (onceHandler.dom7proxy) {\n delete onceHandler.dom7proxy;\n }\n }\n\n onceHandler.dom7proxy = listener;\n return dom.on(eventName, targetSelector, onceHandler, capture);\n}\n\nfunction trigger() {\n var window = getWindow();\n\n for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {\n args[_key9] = arguments[_key9];\n }\n\n var events = args[0].split(' ');\n var eventData = args[1];\n\n for (var i = 0; i < events.length; i += 1) {\n var event = events[i];\n\n for (var j = 0; j < this.length; j += 1) {\n var el = this[j];\n\n if (window.CustomEvent) {\n var evt = new window.CustomEvent(event, {\n detail: eventData,\n bubbles: true,\n cancelable: true\n });\n el.dom7EventData = args.filter(function (data, dataIndex) {\n return dataIndex > 0;\n });\n el.dispatchEvent(evt);\n el.dom7EventData = [];\n delete el.dom7EventData;\n }\n }\n }\n\n return this;\n}\n\nfunction transitionEnd(callback) {\n var dom = this;\n\n function fireCallBack(e) {\n if (e.target !== this) return;\n callback.call(this, e);\n dom.off('transitionend', fireCallBack);\n }\n\n if (callback) {\n dom.on('transitionend', fireCallBack);\n }\n\n return this;\n}\n\nfunction animationEnd(callback) {\n var dom = this;\n\n function fireCallBack(e) {\n if (e.target !== this) return;\n callback.call(this, e);\n dom.off('animationend', fireCallBack);\n }\n\n if (callback) {\n dom.on('animationend', fireCallBack);\n }\n\n return this;\n}\n\nfunction width() {\n var window = getWindow();\n\n if (this[0] === window) {\n return window.innerWidth;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('width'));\n }\n\n return null;\n}\n\nfunction outerWidth(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n var _styles = this.styles();\n\n return this[0].offsetWidth + parseFloat(_styles.getPropertyValue('margin-right')) + parseFloat(_styles.getPropertyValue('margin-left'));\n }\n\n return this[0].offsetWidth;\n }\n\n return null;\n}\n\nfunction height() {\n var window = getWindow();\n\n if (this[0] === window) {\n return window.innerHeight;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('height'));\n }\n\n return null;\n}\n\nfunction outerHeight(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n var _styles2 = this.styles();\n\n return this[0].offsetHeight + parseFloat(_styles2.getPropertyValue('margin-top')) + parseFloat(_styles2.getPropertyValue('margin-bottom'));\n }\n\n return this[0].offsetHeight;\n }\n\n return null;\n}\n\nfunction offset() {\n if (this.length > 0) {\n var window = getWindow();\n var document = getDocument();\n var el = this[0];\n var box = el.getBoundingClientRect();\n var body = document.body;\n var clientTop = el.clientTop || body.clientTop || 0;\n var clientLeft = el.clientLeft || body.clientLeft || 0;\n var scrollTop = el === window ? window.scrollY : el.scrollTop;\n var scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: box.top + scrollTop - clientTop,\n left: box.left + scrollLeft - clientLeft\n };\n }\n\n return null;\n}\n\nfunction hide() {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.display = 'none';\n }\n\n return this;\n}\n\nfunction show() {\n var window = getWindow();\n\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.style.display === 'none') {\n el.style.display = '';\n }\n\n if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') {\n // Still not visible\n el.style.display = 'block';\n }\n }\n\n return this;\n}\n\nfunction styles() {\n var window = getWindow();\n if (this[0]) return window.getComputedStyle(this[0], null);\n return {};\n}\n\nfunction css(props, value) {\n var window = getWindow();\n var i;\n\n if (arguments.length === 1) {\n if (typeof props === 'string') {\n // .css('width')\n if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);\n } else {\n // .css({ width: '100px' })\n for (i = 0; i < this.length; i += 1) {\n for (var _prop in props) {\n this[i].style[_prop] = props[_prop];\n }\n }\n\n return this;\n }\n }\n\n if (arguments.length === 2 && typeof props === 'string') {\n // .css('width', '100px')\n for (i = 0; i < this.length; i += 1) {\n this[i].style[props] = value;\n }\n\n return this;\n }\n\n return this;\n}\n\nfunction each(callback) {\n if (!callback) return this;\n this.forEach(function (el, index) {\n callback.apply(el, [el, index]);\n });\n return this;\n}\n\nfunction filter(callback) {\n var result = arrayFilter(this, callback);\n return $(result);\n}\n\nfunction html(html) {\n if (typeof html === 'undefined') {\n return this[0] ? this[0].innerHTML : null;\n }\n\n for (var i = 0; i < this.length; i += 1) {\n this[i].innerHTML = html;\n }\n\n return this;\n}\n\nfunction text(text) {\n if (typeof text === 'undefined') {\n return this[0] ? this[0].textContent.trim() : null;\n }\n\n for (var i = 0; i < this.length; i += 1) {\n this[i].textContent = text;\n }\n\n return this;\n}\n\nfunction is(selector) {\n var window = getWindow();\n var document = getDocument();\n var el = this[0];\n var compareWith;\n var i;\n if (!el || typeof selector === 'undefined') return false;\n\n if (typeof selector === 'string') {\n if (el.matches) return el.matches(selector);\n if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n compareWith = $(selector);\n\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n\n return false;\n }\n\n if (selector === document) {\n return el === document;\n }\n\n if (selector === window) {\n return el === window;\n }\n\n if (selector.nodeType || selector instanceof Dom7) {\n compareWith = selector.nodeType ? [selector] : selector;\n\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n\n return false;\n }\n\n return false;\n}\n\nfunction index() {\n var child = this[0];\n var i;\n\n if (child) {\n i = 0; // eslint-disable-next-line\n\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n\n return i;\n }\n\n return undefined;\n}\n\nfunction eq(index) {\n if (typeof index === 'undefined') return this;\n var length = this.length;\n\n if (index > length - 1) {\n return $([]);\n }\n\n if (index < 0) {\n var returnIndex = length + index;\n if (returnIndex < 0) return $([]);\n return $([this[returnIndex]]);\n }\n\n return $([this[index]]);\n}\n\nfunction append() {\n var newChild;\n var document = getDocument();\n\n for (var k = 0; k < arguments.length; k += 1) {\n newChild = k < 0 || arguments.length <= k ? undefined : arguments[k];\n\n for (var i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n var tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n\n while (tempDiv.firstChild) {\n this[i].appendChild(tempDiv.firstChild);\n }\n } else if (newChild instanceof Dom7) {\n for (var j = 0; j < newChild.length; j += 1) {\n this[i].appendChild(newChild[j]);\n }\n } else {\n this[i].appendChild(newChild);\n }\n }\n }\n\n return this;\n}\n\nfunction appendTo(parent) {\n $(parent).append(this);\n return this;\n}\n\nfunction prepend(newChild) {\n var document = getDocument();\n var i;\n var j;\n\n for (i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n var tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n\n for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {\n this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);\n }\n } else if (newChild instanceof Dom7) {\n for (j = 0; j < newChild.length; j += 1) {\n this[i].insertBefore(newChild[j], this[i].childNodes[0]);\n }\n } else {\n this[i].insertBefore(newChild, this[i].childNodes[0]);\n }\n }\n\n return this;\n}\n\nfunction prependTo(parent) {\n $(parent).prepend(this);\n return this;\n}\n\nfunction insertBefore(selector) {\n var before = $(selector);\n\n for (var i = 0; i < this.length; i += 1) {\n if (before.length === 1) {\n before[0].parentNode.insertBefore(this[i], before[0]);\n } else if (before.length > 1) {\n for (var j = 0; j < before.length; j += 1) {\n before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);\n }\n }\n }\n}\n\nfunction insertAfter(selector) {\n var after = $(selector);\n\n for (var i = 0; i < this.length; i += 1) {\n if (after.length === 1) {\n after[0].parentNode.insertBefore(this[i], after[0].nextSibling);\n } else if (after.length > 1) {\n for (var j = 0; j < after.length; j += 1) {\n after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);\n }\n }\n }\n}\n\nfunction next(selector) {\n if (this.length > 0) {\n if (selector) {\n if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {\n return $([this[0].nextElementSibling]);\n }\n\n return $([]);\n }\n\n if (this[0].nextElementSibling) return $([this[0].nextElementSibling]);\n return $([]);\n }\n\n return $([]);\n}\n\nfunction nextAll(selector) {\n var nextEls = [];\n var el = this[0];\n if (!el) return $([]);\n\n while (el.nextElementSibling) {\n var _next = el.nextElementSibling; // eslint-disable-line\n\n if (selector) {\n if ($(_next).is(selector)) nextEls.push(_next);\n } else nextEls.push(_next);\n\n el = _next;\n }\n\n return $(nextEls);\n}\n\nfunction prev(selector) {\n if (this.length > 0) {\n var el = this[0];\n\n if (selector) {\n if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {\n return $([el.previousElementSibling]);\n }\n\n return $([]);\n }\n\n if (el.previousElementSibling) return $([el.previousElementSibling]);\n return $([]);\n }\n\n return $([]);\n}\n\nfunction prevAll(selector) {\n var prevEls = [];\n var el = this[0];\n if (!el) return $([]);\n\n while (el.previousElementSibling) {\n var _prev = el.previousElementSibling; // eslint-disable-line\n\n if (selector) {\n if ($(_prev).is(selector)) prevEls.push(_prev);\n } else prevEls.push(_prev);\n\n el = _prev;\n }\n\n return $(prevEls);\n}\n\nfunction siblings(selector) {\n return this.nextAll(selector).add(this.prevAll(selector));\n}\n\nfunction parent(selector) {\n var parents = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n if (this[i].parentNode !== null) {\n if (selector) {\n if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);\n } else {\n parents.push(this[i].parentNode);\n }\n }\n }\n\n return $(parents);\n}\n\nfunction parents(selector) {\n var parents = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n var _parent = this[i].parentNode; // eslint-disable-line\n\n while (_parent) {\n if (selector) {\n if ($(_parent).is(selector)) parents.push(_parent);\n } else {\n parents.push(_parent);\n }\n\n _parent = _parent.parentNode;\n }\n }\n\n return $(parents);\n}\n\nfunction closest(selector) {\n var closest = this; // eslint-disable-line\n\n if (typeof selector === 'undefined') {\n return $([]);\n }\n\n if (!closest.is(selector)) {\n closest = closest.parents(selector).eq(0);\n }\n\n return closest;\n}\n\nfunction find(selector) {\n var foundElements = [];\n\n for (var i = 0; i < this.length; i += 1) {\n var found = this[i].querySelectorAll(selector);\n\n for (var j = 0; j < found.length; j += 1) {\n foundElements.push(found[j]);\n }\n }\n\n return $(foundElements);\n}\n\nfunction children(selector) {\n var children = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n var childNodes = this[i].children;\n\n for (var j = 0; j < childNodes.length; j += 1) {\n if (!selector || $(childNodes[j]).is(selector)) {\n children.push(childNodes[j]);\n }\n }\n }\n\n return $(children);\n}\n\nfunction remove() {\n for (var i = 0; i < this.length; i += 1) {\n if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);\n }\n\n return this;\n}\n\nfunction detach() {\n return this.remove();\n}\n\nfunction add() {\n var dom = this;\n var i;\n var j;\n\n for (var _len10 = arguments.length, els = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {\n els[_key10] = arguments[_key10];\n }\n\n for (i = 0; i < els.length; i += 1) {\n var toAdd = $(els[i]);\n\n for (j = 0; j < toAdd.length; j += 1) {\n dom.push(toAdd[j]);\n }\n }\n\n return dom;\n}\n\nfunction empty() {\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.nodeType === 1) {\n for (var j = 0; j < el.childNodes.length; j += 1) {\n if (el.childNodes[j].parentNode) {\n el.childNodes[j].parentNode.removeChild(el.childNodes[j]);\n }\n }\n\n el.textContent = '';\n }\n }\n\n return this;\n}\n\nfunction scrollTo() {\n var window = getWindow();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var left = args[0],\n top = args[1],\n duration = args[2],\n easing = args[3],\n callback = args[4];\n\n if (args.length === 4 && typeof easing === 'function') {\n callback = easing;\n left = args[0];\n top = args[1];\n duration = args[2];\n callback = args[3];\n easing = args[4];\n }\n\n if (typeof easing === 'undefined') easing = 'swing';\n return this.each(function animate() {\n var el = this;\n var currentTop;\n var currentLeft;\n var maxTop;\n var maxLeft;\n var newTop;\n var newLeft;\n var scrollTop; // eslint-disable-line\n\n var scrollLeft; // eslint-disable-line\n\n var animateTop = top > 0 || top === 0;\n var animateLeft = left > 0 || left === 0;\n\n if (typeof easing === 'undefined') {\n easing = 'swing';\n }\n\n if (animateTop) {\n currentTop = el.scrollTop;\n\n if (!duration) {\n el.scrollTop = top;\n }\n }\n\n if (animateLeft) {\n currentLeft = el.scrollLeft;\n\n if (!duration) {\n el.scrollLeft = left;\n }\n }\n\n if (!duration) return;\n\n if (animateTop) {\n maxTop = el.scrollHeight - el.offsetHeight;\n newTop = Math.max(Math.min(top, maxTop), 0);\n }\n\n if (animateLeft) {\n maxLeft = el.scrollWidth - el.offsetWidth;\n newLeft = Math.max(Math.min(left, maxLeft), 0);\n }\n\n var startTime = null;\n if (animateTop && newTop === currentTop) animateTop = false;\n if (animateLeft && newLeft === currentLeft) animateLeft = false;\n\n function render(time) {\n if (time === void 0) {\n time = new Date().getTime();\n }\n\n if (startTime === null) {\n startTime = time;\n }\n\n var progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n var easeProgress = easing === 'linear' ? progress : 0.5 - Math.cos(progress * Math.PI) / 2;\n var done;\n if (animateTop) scrollTop = currentTop + easeProgress * (newTop - currentTop);\n if (animateLeft) scrollLeft = currentLeft + easeProgress * (newLeft - currentLeft);\n\n if (animateTop && newTop > currentTop && scrollTop >= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n\n if (animateTop && newTop < currentTop && scrollTop <= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n\n if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n\n if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n\n if (done) {\n if (callback) callback();\n return;\n }\n\n if (animateTop) el.scrollTop = scrollTop;\n if (animateLeft) el.scrollLeft = scrollLeft;\n window.requestAnimationFrame(render);\n }\n\n window.requestAnimationFrame(render);\n });\n} // scrollTop(top, duration, easing, callback) {\n\n\nfunction scrollTop() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var top = args[0],\n duration = args[1],\n easing = args[2],\n callback = args[3];\n\n if (args.length === 3 && typeof easing === 'function') {\n top = args[0];\n duration = args[1];\n callback = args[2];\n easing = args[3];\n }\n\n var dom = this;\n\n if (typeof top === 'undefined') {\n if (dom.length > 0) return dom[0].scrollTop;\n return null;\n }\n\n return dom.scrollTo(undefined, top, duration, easing, callback);\n}\n\nfunction scrollLeft() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var left = args[0],\n duration = args[1],\n easing = args[2],\n callback = args[3];\n\n if (args.length === 3 && typeof easing === 'function') {\n left = args[0];\n duration = args[1];\n callback = args[2];\n easing = args[3];\n }\n\n var dom = this;\n\n if (typeof left === 'undefined') {\n if (dom.length > 0) return dom[0].scrollLeft;\n return null;\n }\n\n return dom.scrollTo(left, undefined, duration, easing, callback);\n}\n\nfunction animate(initialProps, initialParams) {\n var window = getWindow();\n var els = this;\n var a = {\n props: Object.assign({}, initialProps),\n params: Object.assign({\n duration: 300,\n easing: 'swing' // or 'linear'\n\n /* Callbacks\n begin(elements)\n complete(elements)\n progress(elements, complete, remaining, start, tweenValue)\n */\n\n }, initialParams),\n elements: els,\n animating: false,\n que: [],\n easingProgress: function easingProgress(easing, progress) {\n if (easing === 'swing') {\n return 0.5 - Math.cos(progress * Math.PI) / 2;\n }\n\n if (typeof easing === 'function') {\n return easing(progress);\n }\n\n return progress;\n },\n stop: function stop() {\n if (a.frameId) {\n window.cancelAnimationFrame(a.frameId);\n }\n\n a.animating = false;\n a.elements.each(function (el) {\n var element = el;\n delete element.dom7AnimateInstance;\n });\n a.que = [];\n },\n done: function done(complete) {\n a.animating = false;\n a.elements.each(function (el) {\n var element = el;\n delete element.dom7AnimateInstance;\n });\n if (complete) complete(els);\n\n if (a.que.length > 0) {\n var que = a.que.shift();\n a.animate(que[0], que[1]);\n }\n },\n animate: function animate(props, params) {\n if (a.animating) {\n a.que.push([props, params]);\n return a;\n }\n\n var elements = []; // Define & Cache Initials & Units\n\n a.elements.each(function (el, index) {\n var initialFullValue;\n var initialValue;\n var unit;\n var finalValue;\n var finalFullValue;\n if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a;\n elements[index] = {\n container: el\n };\n Object.keys(props).forEach(function (prop) {\n initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');\n initialValue = parseFloat(initialFullValue);\n unit = initialFullValue.replace(initialValue, '');\n finalValue = parseFloat(props[prop]);\n finalFullValue = props[prop] + unit;\n elements[index][prop] = {\n initialFullValue: initialFullValue,\n initialValue: initialValue,\n unit: unit,\n finalValue: finalValue,\n finalFullValue: finalFullValue,\n currentValue: initialValue\n };\n });\n });\n var startTime = null;\n var time;\n var elementsDone = 0;\n var propsDone = 0;\n var done;\n var began = false;\n a.animating = true;\n\n function render() {\n time = new Date().getTime();\n var progress;\n var easeProgress; // let el;\n\n if (!began) {\n began = true;\n if (params.begin) params.begin(els);\n }\n\n if (startTime === null) {\n startTime = time;\n }\n\n if (params.progress) {\n // eslint-disable-next-line\n params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), startTime + params.duration - time < 0 ? 0 : startTime + params.duration - time, startTime);\n }\n\n elements.forEach(function (element) {\n var el = element;\n if (done || el.done) return;\n Object.keys(props).forEach(function (prop) {\n if (done || el.done) return;\n progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);\n easeProgress = a.easingProgress(params.easing, progress);\n var _el$prop = el[prop],\n initialValue = _el$prop.initialValue,\n finalValue = _el$prop.finalValue,\n unit = _el$prop.unit;\n el[prop].currentValue = initialValue + easeProgress * (finalValue - initialValue);\n var currentValue = el[prop].currentValue;\n\n if (finalValue > initialValue && currentValue >= finalValue || finalValue < initialValue && currentValue <= finalValue) {\n el.container.style[prop] = finalValue + unit;\n propsDone += 1;\n\n if (propsDone === Object.keys(props).length) {\n el.done = true;\n elementsDone += 1;\n }\n\n if (elementsDone === elements.length) {\n done = true;\n }\n }\n\n if (done) {\n a.done(params.complete);\n return;\n }\n\n el.container.style[prop] = currentValue + unit;\n });\n });\n if (done) return; // Then call\n\n a.frameId = window.requestAnimationFrame(render);\n }\n\n a.frameId = window.requestAnimationFrame(render);\n return a;\n }\n };\n\n if (a.elements.length === 0) {\n return els;\n }\n\n var animateInstance;\n\n for (var i = 0; i < a.elements.length; i += 1) {\n if (a.elements[i].dom7AnimateInstance) {\n animateInstance = a.elements[i].dom7AnimateInstance;\n } else a.elements[i].dom7AnimateInstance = a;\n }\n\n if (!animateInstance) {\n animateInstance = a;\n }\n\n if (initialProps === 'stop') {\n animateInstance.stop();\n } else {\n animateInstance.animate(a.props, a.params);\n }\n\n return els;\n}\n\nfunction stop() {\n var els = this;\n\n for (var i = 0; i < els.length; i += 1) {\n if (els[i].dom7AnimateInstance) {\n els[i].dom7AnimateInstance.stop();\n }\n }\n}\n\nvar noTrigger = 'resize scroll'.split(' ');\n\nfunction shortcut(name) {\n function eventHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[0] === 'undefined') {\n for (var i = 0; i < this.length; i += 1) {\n if (noTrigger.indexOf(name) < 0) {\n if (name in this[i]) this[i][name]();else {\n $(this[i]).trigger(name);\n }\n }\n }\n\n return this;\n }\n\n return this.on.apply(this, [name].concat(args));\n }\n\n return eventHandler;\n}\n\nvar click = shortcut('click');\nvar blur = shortcut('blur');\nvar focus = shortcut('focus');\nvar focusin = shortcut('focusin');\nvar focusout = shortcut('focusout');\nvar keyup = shortcut('keyup');\nvar keydown = shortcut('keydown');\nvar keypress = shortcut('keypress');\nvar submit = shortcut('submit');\nvar change = shortcut('change');\nvar mousedown = shortcut('mousedown');\nvar mousemove = shortcut('mousemove');\nvar mouseup = shortcut('mouseup');\nvar mouseenter = shortcut('mouseenter');\nvar mouseleave = shortcut('mouseleave');\nvar mouseout = shortcut('mouseout');\nvar mouseover = shortcut('mouseover');\nvar touchstart = shortcut('touchstart');\nvar touchend = shortcut('touchend');\nvar touchmove = shortcut('touchmove');\nvar resize = shortcut('resize');\nvar scroll = shortcut('scroll');\n\nexport default $;\nexport { $, add, addClass, animate, animationEnd, append, appendTo, attr, blur, change, children, click, closest, css, data, dataset, detach, each, empty, eq, filter, find, focus, focusin, focusout, hasClass, height, hide, html, index, insertAfter, insertBefore, is, keydown, keypress, keyup, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, next, nextAll, off, offset, on, once, outerHeight, outerWidth, parent, parents, prepend, prependTo, prev, prevAll, prop, remove, removeAttr, removeClass, removeData, resize, scroll, scrollLeft, scrollTo, scrollTop, show, siblings, stop, styles, submit, text, toggleClass, touchend, touchmove, touchstart, transform, transition, transitionEnd, trigger, val, value, width };\n","import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, styles, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, filter, remove } from 'dom7';\nvar Methods = {\n addClass: addClass,\n removeClass: removeClass,\n hasClass: hasClass,\n toggleClass: toggleClass,\n attr: attr,\n removeAttr: removeAttr,\n transform: transform,\n transition: transition,\n on: on,\n off: off,\n trigger: trigger,\n transitionEnd: transitionEnd,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n styles: styles,\n offset: offset,\n css: css,\n each: each,\n html: html,\n text: text,\n is: is,\n index: index,\n eq: eq,\n append: append,\n prepend: prepend,\n next: next,\n nextAll: nextAll,\n prev: prev,\n prevAll: prevAll,\n parent: parent,\n parents: parents,\n closest: closest,\n find: find,\n children: children,\n filter: filter,\n remove: remove\n};\nObject.keys(Methods).forEach(function (methodName) {\n $.fn[methodName] = Methods[methodName];\n});\nexport default $;","import { getWindow, getDocument } from 'ssr-window';\nvar support;\n\nfunction calcSupport() {\n var window = getWindow();\n var document = getDocument();\n return {\n touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),\n pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,\n observer: function checkObserver() {\n return 'MutationObserver' in window || 'WebkitMutationObserver' in window;\n }(),\n passiveListener: function checkPassiveListener() {\n var supportsPassive = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n // eslint-disable-next-line\n get: function get() {\n supportsPassive = true;\n }\n });\n window.addEventListener('testPassiveListener', null, opts);\n } catch (e) {// No support\n }\n\n return supportsPassive;\n }(),\n gestures: function checkGestures() {\n return 'ongesturestart' in window;\n }()\n };\n}\n\nfunction getSupport() {\n if (!support) {\n support = calcSupport();\n }\n\n return support;\n}\n\nexport { getSupport };","import { getWindow } from 'ssr-window';\nimport { getSupport } from './get-support';\nvar device;\n\nfunction calcDevice(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n userAgent = _ref.userAgent;\n\n var support = getSupport();\n var window = getWindow();\n var platform = window.navigator.platform;\n var ua = userAgent || window.navigator.userAgent;\n var device = {\n ios: false,\n android: false\n };\n var screenWidth = window.screen.width;\n var screenHeight = window.screen.height;\n var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/); // eslint-disable-line\n\n var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n var iphone = !ipad && ua.match(/(iPhone\\sOS|iOS)\\s([\\d_]+)/);\n var windows = platform === 'Win32';\n var macos = platform === 'MacIntel'; // iPadOs 13 fix\n\n var iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];\n\n if (!ipad && macos && support.touch && iPadScreens.indexOf(screenWidth + \"x\" + screenHeight) >= 0) {\n ipad = ua.match(/(Version)\\/([\\d.]+)/);\n if (!ipad) ipad = [0, 1, '13_0_0'];\n macos = false;\n } // Android\n\n\n if (android && !windows) {\n device.os = 'android';\n device.android = true;\n }\n\n if (ipad || iphone || ipod) {\n device.os = 'ios';\n device.ios = true;\n } // Export object\n\n\n return device;\n}\n\nfunction getDevice(overrides) {\n if (overrides === void 0) {\n overrides = {};\n }\n\n if (!device) {\n device = calcDevice(overrides);\n }\n\n return device;\n}\n\nexport { getDevice };","import { getWindow } from 'ssr-window';\nvar browser;\n\nfunction calcBrowser() {\n var window = getWindow();\n\n function isSafari() {\n var ua = window.navigator.userAgent.toLowerCase();\n return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;\n }\n\n return {\n isEdge: !!window.navigator.userAgent.match(/Edge/g),\n isSafari: isSafari(),\n isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)\n };\n}\n\nfunction getBrowser() {\n if (!browser) {\n browser = calcBrowser();\n }\n\n return browser;\n}\n\nexport { getBrowser };","import { getWindow } from 'ssr-window';\n\nfunction deleteProps(obj) {\n var object = obj;\n Object.keys(object).forEach(function (key) {\n try {\n object[key] = null;\n } catch (e) {// no getter for object\n }\n\n try {\n delete object[key];\n } catch (e) {// something got wrong\n }\n });\n}\n\nfunction nextTick(callback, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n\n return setTimeout(callback, delay);\n}\n\nfunction now() {\n return Date.now();\n}\n\nfunction getTranslate(el, axis) {\n if (axis === void 0) {\n axis = 'x';\n }\n\n var window = getWindow();\n var matrix;\n var curTransform;\n var transformMatrix;\n var curStyle = window.getComputedStyle(el, null);\n\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(function (a) {\n return a.replace(',', '.');\n }).join(', ');\n } // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n\n\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n\n return curTransform || 0;\n}\n\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;\n}\n\nfunction extend() {\n var to = Object(arguments.length <= 0 ? undefined : arguments[0]);\n\n for (var i = 1; i < arguments.length; i += 1) {\n var nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];\n\n if (nextSource !== undefined && nextSource !== null) {\n var keysArray = Object.keys(Object(nextSource));\n\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n extend(to[nextKey], nextSource[nextKey]);\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n extend(to[nextKey], nextSource[nextKey]);\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n\n return to;\n}\n\nfunction bindModuleMethods(instance, obj) {\n Object.keys(obj).forEach(function (key) {\n if (isObject(obj[key])) {\n Object.keys(obj[key]).forEach(function (subKey) {\n if (typeof obj[key][subKey] === 'function') {\n obj[key][subKey] = obj[key][subKey].bind(instance);\n }\n });\n }\n\n instance[key] = obj[key];\n });\n}\n\nexport { deleteProps, nextTick, now, getTranslate, isObject, extend, bindModuleMethods };","import { getWindow } from 'ssr-window';\nimport { extend } from '../../utils/utils';\nexport default {\n name: 'resize',\n create: function create() {\n var swiper = this;\n extend(swiper, {\n resize: {\n resizeHandler: function resizeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('beforeResize');\n swiper.emit('resize');\n },\n orientationChangeHandler: function orientationChangeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('orientationchange');\n }\n }\n });\n },\n on: {\n init: function init(swiper) {\n var window = getWindow(); // Emit resize\n\n window.addEventListener('resize', swiper.resize.resizeHandler); // Emit orientationchange\n\n window.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n },\n destroy: function destroy(swiper) {\n var window = getWindow();\n window.removeEventListener('resize', swiper.resize.resizeHandler);\n window.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n }\n }\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport { getWindow } from 'ssr-window';\nimport { bindModuleMethods } from '../../utils/utils';\nvar Observer = {\n attach: function attach(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var window = getWindow();\n var swiper = this;\n var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n var observer = new ObserverFunc(function (mutations) {\n // The observerUpdate event should only be triggered\n // once despite the number of mutations. Additional\n // triggers are redundant and are very costly\n if (mutations.length === 1) {\n swiper.emit('observerUpdate', mutations[0]);\n return;\n }\n\n var observerUpdate = function observerUpdate() {\n swiper.emit('observerUpdate', mutations[0]);\n };\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(observerUpdate);\n } else {\n window.setTimeout(observerUpdate, 0);\n }\n });\n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n swiper.observer.observers.push(observer);\n },\n init: function init() {\n var swiper = this;\n if (!swiper.support.observer || !swiper.params.observer) return;\n\n if (swiper.params.observeParents) {\n var containerParents = swiper.$el.parents();\n\n for (var i = 0; i < containerParents.length; i += 1) {\n swiper.observer.attach(containerParents[i]);\n }\n } // Observe container\n\n\n swiper.observer.attach(swiper.$el[0], {\n childList: swiper.params.observeSlideChildren\n }); // Observe wrapper\n\n swiper.observer.attach(swiper.$wrapperEl[0], {\n attributes: false\n });\n },\n destroy: function destroy() {\n var swiper = this;\n swiper.observer.observers.forEach(function (observer) {\n observer.disconnect();\n });\n swiper.observer.observers = [];\n }\n};\nexport default {\n name: 'observer',\n params: {\n observer: false,\n observeParents: false,\n observeSlideChildren: false\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n observer: _extends(_extends({}, Observer), {}, {\n observers: []\n })\n });\n },\n on: {\n init: function init(swiper) {\n swiper.observer.init();\n },\n destroy: function destroy(swiper) {\n swiper.observer.destroy();\n }\n }\n};","import { getWindow, getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport { extend, now } from '../../../utils/utils';\nexport default function onTouchStart(event) {\n var swiper = this;\n var document = getDocument();\n var window = getWindow();\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return;\n }\n\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n var $targetEl = $(e.target);\n\n if (params.touchEventsTarget === 'wrapper') {\n if (!$targetEl.closest(swiper.wrapperEl).length) return;\n }\n\n data.isTouchEvent = e.type === 'touchstart';\n if (!data.isTouchEvent && 'which' in e && e.which === 3) return;\n if (!data.isTouchEvent && 'button' in e && e.button > 0) return;\n if (data.isTouched && data.isMoved) return; // change target el for shadow root componenet\n\n var swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';\n\n if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) {\n $targetEl = $(event.path[0]);\n }\n\n if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : \".\" + params.noSwipingClass)[0]) {\n swiper.allowClick = true;\n return;\n }\n\n if (params.swipeHandler) {\n if (!$targetEl.closest(params.swipeHandler)[0]) return;\n }\n\n touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n var startX = touches.currentX;\n var startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore\n\n var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;\n var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;\n\n if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.screen.width - edgeSwipeThreshold)) {\n return;\n }\n\n extend(data, {\n isTouched: true,\n isMoved: false,\n allowTouchCallbacks: true,\n isScrolling: undefined,\n startMoving: undefined\n });\n touches.startX = startX;\n touches.startY = startY;\n data.touchStartTime = now();\n swiper.allowClick = true;\n swiper.updateSize();\n swiper.swipeDirection = undefined;\n if (params.threshold > 0) data.allowThresholdMove = false;\n\n if (e.type !== 'touchstart') {\n var preventDefault = true;\n if ($targetEl.is(data.formElements)) preventDefault = false;\n\n if (document.activeElement && $(document.activeElement).is(data.formElements) && document.activeElement !== $targetEl[0]) {\n document.activeElement.blur();\n }\n\n var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;\n\n if (params.touchStartForcePreventDefault || shouldPreventDefault) {\n e.preventDefault();\n }\n }\n\n swiper.emit('touchStart', e);\n}","import { getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport { extend, now } from '../../../utils/utils';\nexport default function onTouchMove(event) {\n var document = getDocument();\n var swiper = this;\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches,\n rtl = swiper.rtlTranslate;\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n\n if (!data.isTouched) {\n if (data.startMoving && data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n\n return;\n }\n\n if (data.isTouchEvent && e.type !== 'touchmove') return;\n var targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);\n var pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;\n var pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;\n\n if (e.preventedByNestedSwiper) {\n touches.startX = pageX;\n touches.startY = pageY;\n return;\n }\n\n if (!swiper.allowTouchMove) {\n // isMoved = true;\n swiper.allowClick = false;\n\n if (data.isTouched) {\n extend(touches, {\n startX: pageX,\n startY: pageY,\n currentX: pageX,\n currentY: pageY\n });\n data.touchStartTime = now();\n }\n\n return;\n }\n\n if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {\n if (swiper.isVertical()) {\n // Vertical\n if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {\n data.isTouched = false;\n data.isMoved = false;\n return;\n }\n } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {\n return;\n }\n }\n\n if (data.isTouchEvent && document.activeElement) {\n if (e.target === document.activeElement && $(e.target).is(data.formElements)) {\n data.isMoved = true;\n swiper.allowClick = false;\n return;\n }\n }\n\n if (data.allowTouchCallbacks) {\n swiper.emit('touchMove', e);\n }\n\n if (e.targetTouches && e.targetTouches.length > 1) return;\n touches.currentX = pageX;\n touches.currentY = pageY;\n var diffX = touches.currentX - touches.startX;\n var diffY = touches.currentY - touches.startY;\n if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold) return;\n\n if (typeof data.isScrolling === 'undefined') {\n var touchAngle;\n\n if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {\n data.isScrolling = false;\n } else {\n // eslint-disable-next-line\n if (diffX * diffX + diffY * diffY >= 25) {\n touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;\n data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;\n }\n }\n }\n\n if (data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n\n if (typeof data.startMoving === 'undefined') {\n if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {\n data.startMoving = true;\n }\n }\n\n if (data.isScrolling) {\n data.isTouched = false;\n return;\n }\n\n if (!data.startMoving) {\n return;\n }\n\n swiper.allowClick = false;\n\n if (!params.cssMode && e.cancelable) {\n e.preventDefault();\n }\n\n if (params.touchMoveStopPropagation && !params.nested) {\n e.stopPropagation();\n }\n\n if (!data.isMoved) {\n if (params.loop) {\n swiper.loopFix();\n }\n\n data.startTranslate = swiper.getTranslate();\n swiper.setTransition(0);\n\n if (swiper.animating) {\n swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');\n }\n\n data.allowMomentumBounce = false; // Grab Cursor\n\n if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(true);\n }\n\n swiper.emit('sliderFirstMove', e);\n }\n\n swiper.emit('sliderMove', e);\n data.isMoved = true;\n var diff = swiper.isHorizontal() ? diffX : diffY;\n touches.diff = diff;\n diff *= params.touchRatio;\n if (rtl) diff = -diff;\n swiper.swipeDirection = diff > 0 ? 'prev' : 'next';\n data.currentTranslate = diff + data.startTranslate;\n var disableParentSwiper = true;\n var resistanceRatio = params.resistanceRatio;\n\n if (params.touchReleaseOnEdges) {\n resistanceRatio = 0;\n }\n\n if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + Math.pow(-swiper.minTranslate() + data.startTranslate + diff, resistanceRatio);\n } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - Math.pow(swiper.maxTranslate() - data.startTranslate - diff, resistanceRatio);\n }\n\n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n } // Directions locks\n\n\n if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n\n if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n } // Threshold\n\n\n if (params.threshold > 0) {\n if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {\n if (!data.allowThresholdMove) {\n data.allowThresholdMove = true;\n touches.startX = touches.currentX;\n touches.startY = touches.currentY;\n data.currentTranslate = data.startTranslate;\n touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;\n return;\n }\n } else {\n data.currentTranslate = data.startTranslate;\n return;\n }\n }\n\n if (!params.followFinger || params.cssMode) return; // Update active index in free mode\n\n if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n if (params.freeMode) {\n // Velocity\n if (data.velocities.length === 0) {\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],\n time: data.touchStartTime\n });\n }\n\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],\n time: now()\n });\n } // Update progress\n\n\n swiper.updateProgress(data.currentTranslate); // Update translate\n\n swiper.setTranslate(data.currentTranslate);\n}","import { now, nextTick } from '../../../utils/utils';\nexport default function onTouchEnd(event) {\n var swiper = this;\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches,\n rtl = swiper.rtlTranslate,\n $wrapperEl = swiper.$wrapperEl,\n slidesGrid = swiper.slidesGrid,\n snapGrid = swiper.snapGrid;\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n\n if (data.allowTouchCallbacks) {\n swiper.emit('touchEnd', e);\n }\n\n data.allowTouchCallbacks = false;\n\n if (!data.isTouched) {\n if (data.isMoved && params.grabCursor) {\n swiper.setGrabCursor(false);\n }\n\n data.isMoved = false;\n data.startMoving = false;\n return;\n } // Return Grab Cursor\n\n\n if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(false);\n } // Time diff\n\n\n var touchEndTime = now();\n var timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click\n\n if (swiper.allowClick) {\n swiper.updateClickedSlide(e);\n swiper.emit('tap click', e);\n\n if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {\n swiper.emit('doubleTap doubleClick', e);\n }\n }\n\n data.lastClickTime = now();\n nextTick(function () {\n if (!swiper.destroyed) swiper.allowClick = true;\n });\n\n if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n var currentPos;\n\n if (params.followFinger) {\n currentPos = rtl ? swiper.translate : -swiper.translate;\n } else {\n currentPos = -data.currentTranslate;\n }\n\n if (params.cssMode) {\n return;\n }\n\n if (params.freeMode) {\n if (currentPos < -swiper.minTranslate()) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n if (currentPos > -swiper.maxTranslate()) {\n if (swiper.slides.length < snapGrid.length) {\n swiper.slideTo(snapGrid.length - 1);\n } else {\n swiper.slideTo(swiper.slides.length - 1);\n }\n\n return;\n }\n\n if (params.freeModeMomentum) {\n if (data.velocities.length > 1) {\n var lastMoveEvent = data.velocities.pop();\n var velocityEvent = data.velocities.pop();\n var distance = lastMoveEvent.position - velocityEvent.position;\n var time = lastMoveEvent.time - velocityEvent.time;\n swiper.velocity = distance / time;\n swiper.velocity /= 2;\n\n if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {\n swiper.velocity = 0;\n } // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n\n\n if (time > 150 || now() - lastMoveEvent.time > 300) {\n swiper.velocity = 0;\n }\n } else {\n swiper.velocity = 0;\n }\n\n swiper.velocity *= params.freeModeMomentumVelocityRatio;\n data.velocities.length = 0;\n var momentumDuration = 1000 * params.freeModeMomentumRatio;\n var momentumDistance = swiper.velocity * momentumDuration;\n var newPosition = swiper.translate + momentumDistance;\n if (rtl) newPosition = -newPosition;\n var doBounce = false;\n var afterBouncePosition;\n var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;\n var needsLoopFix;\n\n if (newPosition < swiper.maxTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition + swiper.maxTranslate() < -bounceAmount) {\n newPosition = swiper.maxTranslate() - bounceAmount;\n }\n\n afterBouncePosition = swiper.maxTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.maxTranslate();\n }\n\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (newPosition > swiper.minTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition - swiper.minTranslate() > bounceAmount) {\n newPosition = swiper.minTranslate() + bounceAmount;\n }\n\n afterBouncePosition = swiper.minTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.minTranslate();\n }\n\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (params.freeModeSticky) {\n var nextSlide;\n\n for (var j = 0; j < snapGrid.length; j += 1) {\n if (snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n }\n\n if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {\n newPosition = snapGrid[nextSlide];\n } else {\n newPosition = snapGrid[nextSlide - 1];\n }\n\n newPosition = -newPosition;\n }\n\n if (needsLoopFix) {\n swiper.once('transitionEnd', function () {\n swiper.loopFix();\n });\n } // Fix duration\n\n\n if (swiper.velocity !== 0) {\n if (rtl) {\n momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);\n } else {\n momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);\n }\n\n if (params.freeModeSticky) {\n // If freeModeSticky is active and the user ends a swipe with a slow-velocity\n // event, then durations can be 20+ seconds to slide one (or zero!) slides.\n // It's easy to see this when simulating touch with mouse events. To fix this,\n // limit single-slide swipes to the default slide duration. This also has the\n // nice side effect of matching slide speed if the user stopped moving before\n // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.\n // For faster swipes, also apply limits (albeit higher ones).\n var moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);\n var currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];\n\n if (moveDistance < currentSlideSize) {\n momentumDuration = params.speed;\n } else if (moveDistance < 2 * currentSlideSize) {\n momentumDuration = params.speed * 1.5;\n } else {\n momentumDuration = params.speed * 2.5;\n }\n }\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n }\n\n if (params.freeModeMomentumBounce && doBounce) {\n swiper.updateProgress(afterBouncePosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n swiper.animating = true;\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;\n swiper.emit('momentumBounce');\n swiper.setTransition(params.speed);\n setTimeout(function () {\n swiper.setTranslate(afterBouncePosition);\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }, 0);\n });\n } else if (swiper.velocity) {\n swiper.updateProgress(newPosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n\n if (!swiper.animating) {\n swiper.animating = true;\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }\n } else {\n swiper.updateProgress(newPosition);\n }\n\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n }\n\n if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n return;\n } // Find current slide\n\n\n var stopIndex = 0;\n var groupSize = swiper.slidesSizesGrid[0];\n\n for (var i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {\n var _increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n\n if (typeof slidesGrid[i + _increment] !== 'undefined') {\n if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + _increment]) {\n stopIndex = i;\n groupSize = slidesGrid[i + _increment] - slidesGrid[i];\n }\n } else if (currentPos >= slidesGrid[i]) {\n stopIndex = i;\n groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];\n }\n } // Find current slide size\n\n\n var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;\n var increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n\n if (timeDiff > params.longSwipesMs) {\n // Long touches\n if (!params.longSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n if (swiper.swipeDirection === 'next') {\n if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n\n if (swiper.swipeDirection === 'prev') {\n if (ratio > 1 - params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n } else {\n // Short swipes\n if (!params.shortSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n var isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);\n\n if (!isNavButtonTarget) {\n if (swiper.swipeDirection === 'next') {\n swiper.slideTo(stopIndex + increment);\n }\n\n if (swiper.swipeDirection === 'prev') {\n swiper.slideTo(stopIndex);\n }\n } else if (e.target === swiper.navigation.nextEl) {\n swiper.slideTo(stopIndex + increment);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n}","export default function onResize() {\n var swiper = this;\n var params = swiper.params,\n el = swiper.el;\n if (el && el.offsetWidth === 0) return; // Breakpoints\n\n if (params.breakpoints) {\n swiper.setBreakpoint();\n } // Save locks\n\n\n var allowSlideNext = swiper.allowSlideNext,\n allowSlidePrev = swiper.allowSlidePrev,\n snapGrid = swiper.snapGrid; // Disable locks on resize\n\n swiper.allowSlideNext = true;\n swiper.allowSlidePrev = true;\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateSlidesClasses();\n\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {\n swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n swiper.autoplay.run();\n } // Return locks after resize\n\n\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n\n if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n}","export default function onClick(e) {\n var swiper = this;\n\n if (!swiper.allowClick) {\n if (swiper.params.preventClicks) e.preventDefault();\n\n if (swiper.params.preventClicksPropagation && swiper.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}","export default function onScroll() {\n var swiper = this;\n var wrapperEl = swiper.wrapperEl,\n rtlTranslate = swiper.rtlTranslate;\n swiper.previousTranslate = swiper.translate;\n\n if (swiper.isHorizontal()) {\n if (rtlTranslate) {\n swiper.translate = wrapperEl.scrollWidth - wrapperEl.offsetWidth - wrapperEl.scrollLeft;\n } else {\n swiper.translate = -wrapperEl.scrollLeft;\n }\n } else {\n swiper.translate = -wrapperEl.scrollTop;\n } // eslint-disable-next-line\n\n\n if (swiper.translate === -0) swiper.translate = 0;\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n var newProgress;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;\n }\n\n if (newProgress !== swiper.progress) {\n swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, false);\n}","import { getDocument } from 'ssr-window';\nimport onTouchStart from './onTouchStart';\nimport onTouchMove from './onTouchMove';\nimport onTouchEnd from './onTouchEnd';\nimport onResize from './onResize';\nimport onClick from './onClick';\nimport onScroll from './onScroll';\nvar dummyEventAttached = false;\n\nfunction dummyEventListener() {}\n\nfunction attachEvents() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n touchEvents = swiper.touchEvents,\n el = swiper.el,\n wrapperEl = swiper.wrapperEl,\n device = swiper.device,\n support = swiper.support;\n swiper.onTouchStart = onTouchStart.bind(swiper);\n swiper.onTouchMove = onTouchMove.bind(swiper);\n swiper.onTouchEnd = onTouchEnd.bind(swiper);\n\n if (params.cssMode) {\n swiper.onScroll = onScroll.bind(swiper);\n }\n\n swiper.onClick = onClick.bind(swiper);\n var capture = !!params.nested; // Touch Events\n\n if (!support.touch && support.pointerEvents) {\n el.addEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.addEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.addEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (support.touch) {\n var passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.addEventListener(touchEvents.move, swiper.onTouchMove, support.passiveListener ? {\n passive: false,\n capture: capture\n } : capture);\n el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n\n if (touchEvents.cancel) {\n el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n\n if (!dummyEventAttached) {\n document.addEventListener('touchstart', dummyEventListener);\n dummyEventAttached = true;\n }\n }\n\n if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {\n el.addEventListener('mousedown', swiper.onTouchStart, false);\n document.addEventListener('mousemove', swiper.onTouchMove, capture);\n document.addEventListener('mouseup', swiper.onTouchEnd, false);\n }\n } // Prevent Links Clicks\n\n\n if (params.preventClicks || params.preventClicksPropagation) {\n el.addEventListener('click', swiper.onClick, true);\n }\n\n if (params.cssMode) {\n wrapperEl.addEventListener('scroll', swiper.onScroll);\n } // Resize handler\n\n\n if (params.updateOnWindowResize) {\n swiper.on(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);\n } else {\n swiper.on('observerUpdate', onResize, true);\n }\n}\n\nfunction detachEvents() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n touchEvents = swiper.touchEvents,\n el = swiper.el,\n wrapperEl = swiper.wrapperEl,\n device = swiper.device,\n support = swiper.support;\n var capture = !!params.nested; // Touch Events\n\n if (!support.touch && support.pointerEvents) {\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (support.touch) {\n var passiveListener = touchEvents.start === 'onTouchStart' && support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n\n if (touchEvents.cancel) {\n el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n }\n\n if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {\n el.removeEventListener('mousedown', swiper.onTouchStart, false);\n document.removeEventListener('mousemove', swiper.onTouchMove, capture);\n document.removeEventListener('mouseup', swiper.onTouchEnd, false);\n }\n } // Prevent Links Clicks\n\n\n if (params.preventClicks || params.preventClicksPropagation) {\n el.removeEventListener('click', swiper.onClick, true);\n }\n\n if (params.cssMode) {\n wrapperEl.removeEventListener('scroll', swiper.onScroll);\n } // Resize handler\n\n\n swiper.off(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize);\n}\n\nexport default {\n attachEvents: attachEvents,\n detachEvents: detachEvents\n};","export default {\n init: true,\n direction: 'horizontal',\n touchEventsTarget: 'container',\n initialSlide: 0,\n speed: 300,\n cssMode: false,\n updateOnWindowResize: true,\n nested: false,\n // Overrides\n width: null,\n height: null,\n //\n preventInteractionOnTransition: false,\n // ssr\n userAgent: null,\n url: null,\n // To support iOS's swipe-to-go-back gesture (when being used in-app).\n edgeSwipeDetection: false,\n edgeSwipeThreshold: 20,\n // Free mode\n freeMode: false,\n freeModeMomentum: true,\n freeModeMomentumRatio: 1,\n freeModeMomentumBounce: true,\n freeModeMomentumBounceRatio: 1,\n freeModeMomentumVelocityRatio: 1,\n freeModeSticky: false,\n freeModeMinimumVelocity: 0.02,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide',\n // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n // Breakpoints\n breakpoints: undefined,\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerColumnFill: 'column',\n slidesPerGroup: 1,\n slidesPerGroupSkip: 0,\n centeredSlides: false,\n centeredSlidesBounds: false,\n slidesOffsetBefore: 0,\n // in px\n slidesOffsetAfter: 0,\n // in px\n normalizeSlideIndex: true,\n centerInsufficientSlides: false,\n // Disable swiper and hide navigation when container not overflow\n watchOverflow: false,\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n allowTouchMove: true,\n threshold: 0,\n touchMoveStopPropagation: false,\n touchStartPreventDefault: true,\n touchStartForcePreventDefault: false,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Progress\n watchSlidesProgress: false,\n watchSlidesVisibility: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // Images\n preloadImages: true,\n updateOnImagesReady: true,\n // loop\n loop: false,\n loopAdditionalSlides: 0,\n loopedSlides: null,\n loopFillGroupWithBlank: false,\n loopPreventsSlide: true,\n // Swiping/no swiping\n allowSlidePrev: true,\n allowSlideNext: true,\n swipeHandler: null,\n // '.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n noSwipingSelector: null,\n // Passive Listeners\n passiveListeners: true,\n // NS\n containerModifierClass: 'swiper-container-',\n // NEW\n slideClass: 'swiper-slide',\n slideBlankClass: 'swiper-slide-invisible-blank',\n slideActiveClass: 'swiper-slide-active',\n slideDuplicateActiveClass: 'swiper-slide-duplicate-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideDuplicateClass: 'swiper-slide-duplicate',\n slideNextClass: 'swiper-slide-next',\n slideDuplicateNextClass: 'swiper-slide-duplicate-next',\n slidePrevClass: 'swiper-slide-prev',\n slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',\n wrapperClass: 'swiper-wrapper',\n // Callbacks\n runCallbacksOnInit: true,\n // Internals\n _emitClasses: false\n};","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/* eslint no-param-reassign: \"off\" */\nimport $ from '../../utils/dom';\nimport { extend, now, deleteProps } from '../../utils/utils';\nimport { getSupport } from '../../utils/get-support';\nimport { getDevice } from '../../utils/get-device';\nimport { getBrowser } from '../../utils/get-browser';\nimport Resize from '../../modules/resize/resize';\nimport Observer from '../../modules/observer/observer';\nimport modular from './modular';\nimport eventsEmitter from './events-emitter';\nimport update from './update/index';\nimport translate from './translate/index';\nimport transition from './transition/index';\nimport slide from './slide/index';\nimport loop from './loop/index';\nimport grabCursor from './grab-cursor/index';\nimport manipulation from './manipulation/index';\nimport events from './events/index';\nimport breakpoints from './breakpoints/index';\nimport classes from './classes/index';\nimport images from './images/index';\nimport checkOverflow from './check-overflow/index';\nimport defaults from './defaults';\nvar prototypes = {\n modular: modular,\n eventsEmitter: eventsEmitter,\n update: update,\n translate: translate,\n transition: transition,\n slide: slide,\n loop: loop,\n grabCursor: grabCursor,\n manipulation: manipulation,\n events: events,\n breakpoints: breakpoints,\n checkOverflow: checkOverflow,\n classes: classes,\n images: images\n};\nvar extendedDefaults = {};\n\nvar Swiper = /*#__PURE__*/function () {\n function Swiper() {\n var el;\n var params;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {\n params = args[0];\n } else {\n el = args[0];\n params = args[1];\n }\n\n if (!params) params = {};\n params = extend({}, params);\n if (el && !params.el) params.el = el; // Swiper Instance\n\n var swiper = this;\n swiper.support = getSupport();\n swiper.device = getDevice({\n userAgent: params.userAgent\n });\n swiper.browser = getBrowser();\n swiper.eventsListeners = {};\n swiper.eventsAnyListeners = [];\n\n if (typeof swiper.modules === 'undefined') {\n swiper.modules = {};\n }\n\n Object.keys(swiper.modules).forEach(function (moduleName) {\n var module = swiper.modules[moduleName];\n\n if (module.params) {\n var moduleParamName = Object.keys(module.params)[0];\n var moduleParams = module.params[moduleParamName];\n if (typeof moduleParams !== 'object' || moduleParams === null) return;\n if (!(moduleParamName in params && 'enabled' in moduleParams)) return;\n\n if (params[moduleParamName] === true) {\n params[moduleParamName] = {\n enabled: true\n };\n }\n\n if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {\n params[moduleParamName].enabled = true;\n }\n\n if (!params[moduleParamName]) params[moduleParamName] = {\n enabled: false\n };\n }\n }); // Extend defaults with modules params\n\n var swiperParams = extend({}, defaults);\n swiper.useParams(swiperParams); // Extend defaults with passed params\n\n swiper.params = extend({}, swiperParams, extendedDefaults, params);\n swiper.originalParams = extend({}, swiper.params);\n swiper.passedParams = extend({}, params); // add event listeners\n\n if (swiper.params && swiper.params.on) {\n Object.keys(swiper.params.on).forEach(function (eventName) {\n swiper.on(eventName, swiper.params.on[eventName]);\n });\n }\n\n if (swiper.params && swiper.params.onAny) {\n swiper.onAny(swiper.params.onAny);\n } // Save Dom lib\n\n\n swiper.$ = $; // Find el\n\n var $el = $(swiper.params.el);\n el = $el[0];\n\n if (!el) {\n return undefined;\n }\n\n if ($el.length > 1) {\n var swipers = [];\n $el.each(function (containerEl) {\n var newParams = extend({}, params, {\n el: containerEl\n });\n swipers.push(new Swiper(newParams));\n });\n return swipers;\n }\n\n el.swiper = swiper; // Find Wrapper\n\n var $wrapperEl;\n\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n $wrapperEl = $(el.shadowRoot.querySelector(\".\" + swiper.params.wrapperClass)); // Children needs to return slot items\n\n $wrapperEl.children = function (options) {\n return $el.children(options);\n };\n } else {\n $wrapperEl = $el.children(\".\" + swiper.params.wrapperClass);\n } // Extend Swiper\n\n\n extend(swiper, {\n $el: $el,\n el: el,\n $wrapperEl: $wrapperEl,\n wrapperEl: $wrapperEl[0],\n // Classes\n classNames: [],\n // Slides\n slides: $(),\n slidesGrid: [],\n snapGrid: [],\n slidesSizesGrid: [],\n // isDirection\n isHorizontal: function isHorizontal() {\n return swiper.params.direction === 'horizontal';\n },\n isVertical: function isVertical() {\n return swiper.params.direction === 'vertical';\n },\n // RTL\n rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',\n rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),\n wrongRTL: $wrapperEl.css('display') === '-webkit-box',\n // Indexes\n activeIndex: 0,\n realIndex: 0,\n //\n isBeginning: true,\n isEnd: false,\n // Props\n translate: 0,\n previousTranslate: 0,\n progress: 0,\n velocity: 0,\n animating: false,\n // Locks\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n // Touch Events\n touchEvents: function touchEvents() {\n var touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];\n var desktop = ['mousedown', 'mousemove', 'mouseup'];\n\n if (swiper.support.pointerEvents) {\n desktop = ['pointerdown', 'pointermove', 'pointerup'];\n }\n\n swiper.touchEventsTouch = {\n start: touch[0],\n move: touch[1],\n end: touch[2],\n cancel: touch[3]\n };\n swiper.touchEventsDesktop = {\n start: desktop[0],\n move: desktop[1],\n end: desktop[2]\n };\n return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;\n }(),\n touchEventsData: {\n isTouched: undefined,\n isMoved: undefined,\n allowTouchCallbacks: undefined,\n touchStartTime: undefined,\n isScrolling: undefined,\n currentTranslate: undefined,\n startTranslate: undefined,\n allowThresholdMove: undefined,\n // Form elements to match\n formElements: 'input, select, option, textarea, button, video, label',\n // Last click time\n lastClickTime: now(),\n clickTimeout: undefined,\n // Velocities\n velocities: [],\n allowMomentumBounce: undefined,\n isTouchEvent: undefined,\n startMoving: undefined\n },\n // Clicks\n allowClick: true,\n // Touches\n allowTouchMove: swiper.params.allowTouchMove,\n touches: {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n },\n // Images\n imagesToLoad: [],\n imagesLoaded: 0\n }); // Install Modules\n\n swiper.useModules();\n swiper.emit('_swiper'); // Init\n\n if (swiper.params.init) {\n swiper.init();\n } // Return app instance\n\n\n return swiper;\n }\n\n var _proto = Swiper.prototype;\n\n _proto.emitContainerClasses = function emitContainerClasses() {\n var swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n var classes = swiper.el.className.split(' ').filter(function (className) {\n return className.indexOf('swiper-container') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;\n });\n swiper.emit('_containerClasses', classes.join(' '));\n };\n\n _proto.getSlideClasses = function getSlideClasses(slideEl) {\n var swiper = this;\n return slideEl.className.split(' ').filter(function (className) {\n return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;\n }).join(' ');\n };\n\n _proto.emitSlidesClasses = function emitSlidesClasses() {\n var swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n swiper.slides.each(function (slideEl) {\n var classNames = swiper.getSlideClasses(slideEl);\n swiper.emit('_slideClass', slideEl, classNames);\n });\n };\n\n _proto.slidesPerViewDynamic = function slidesPerViewDynamic() {\n var swiper = this;\n var params = swiper.params,\n slides = swiper.slides,\n slidesGrid = swiper.slidesGrid,\n swiperSize = swiper.size,\n activeIndex = swiper.activeIndex;\n var spv = 1;\n\n if (params.centeredSlides) {\n var slideSize = slides[activeIndex].swiperSlideSize;\n var breakLoop;\n\n for (var i = activeIndex + 1; i < slides.length; i += 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n\n for (var _i = activeIndex - 1; _i >= 0; _i -= 1) {\n if (slides[_i] && !breakLoop) {\n slideSize += slides[_i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n } else {\n for (var _i2 = activeIndex + 1; _i2 < slides.length; _i2 += 1) {\n if (slidesGrid[_i2] - slidesGrid[activeIndex] < swiperSize) {\n spv += 1;\n }\n }\n }\n\n return spv;\n };\n\n _proto.update = function update() {\n var swiper = this;\n if (!swiper || swiper.destroyed) return;\n var snapGrid = swiper.snapGrid,\n params = swiper.params; // Breakpoints\n\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n\n function setTranslate() {\n var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;\n var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());\n swiper.setTranslate(newTranslate);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n var translated;\n\n if (swiper.params.freeMode) {\n setTranslate();\n\n if (swiper.params.autoHeight) {\n swiper.updateAutoHeight();\n }\n } else {\n if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {\n translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n translated = swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n\n if (!translated) {\n setTranslate();\n }\n }\n\n if (params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n\n swiper.emit('update');\n };\n\n _proto.changeDirection = function changeDirection(newDirection, needUpdate) {\n if (needUpdate === void 0) {\n needUpdate = true;\n }\n\n var swiper = this;\n var currentDirection = swiper.params.direction;\n\n if (!newDirection) {\n // eslint-disable-next-line\n newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';\n }\n\n if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {\n return swiper;\n }\n\n swiper.$el.removeClass(\"\" + swiper.params.containerModifierClass + currentDirection).addClass(\"\" + swiper.params.containerModifierClass + newDirection);\n swiper.emitContainerClasses();\n swiper.params.direction = newDirection;\n swiper.slides.each(function (slideEl) {\n if (newDirection === 'vertical') {\n slideEl.style.width = '';\n } else {\n slideEl.style.height = '';\n }\n });\n swiper.emit('changeDirection');\n if (needUpdate) swiper.update();\n return swiper;\n };\n\n _proto.init = function init() {\n var swiper = this;\n if (swiper.initialized) return;\n swiper.emit('beforeInit'); // Set breakpoint\n\n if (swiper.params.breakpoints) {\n swiper.setBreakpoint();\n } // Add Classes\n\n\n swiper.addClasses(); // Create loop\n\n if (swiper.params.loop) {\n swiper.loopCreate();\n } // Update size\n\n\n swiper.updateSize(); // Update slides\n\n swiper.updateSlides();\n\n if (swiper.params.watchOverflow) {\n swiper.checkOverflow();\n } // Set Grab Cursor\n\n\n if (swiper.params.grabCursor) {\n swiper.setGrabCursor();\n }\n\n if (swiper.params.preloadImages) {\n swiper.preloadImages();\n } // Slide To Initial Slide\n\n\n if (swiper.params.loop) {\n swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);\n } else {\n swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);\n } // Attach events\n\n\n swiper.attachEvents(); // Init Flag\n\n swiper.initialized = true; // Emit\n\n swiper.emit('init');\n swiper.emit('afterInit');\n };\n\n _proto.destroy = function destroy(deleteInstance, cleanStyles) {\n if (deleteInstance === void 0) {\n deleteInstance = true;\n }\n\n if (cleanStyles === void 0) {\n cleanStyles = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n $el = swiper.$el,\n $wrapperEl = swiper.$wrapperEl,\n slides = swiper.slides;\n\n if (typeof swiper.params === 'undefined' || swiper.destroyed) {\n return null;\n }\n\n swiper.emit('beforeDestroy'); // Init Flag\n\n swiper.initialized = false; // Detach events\n\n swiper.detachEvents(); // Destroy loop\n\n if (params.loop) {\n swiper.loopDestroy();\n } // Cleanup styles\n\n\n if (cleanStyles) {\n swiper.removeClasses();\n $el.removeAttr('style');\n $wrapperEl.removeAttr('style');\n\n if (slides && slides.length) {\n slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');\n }\n }\n\n swiper.emit('destroy'); // Detach emitter events\n\n Object.keys(swiper.eventsListeners).forEach(function (eventName) {\n swiper.off(eventName);\n });\n\n if (deleteInstance !== false) {\n swiper.$el[0].swiper = null;\n deleteProps(swiper);\n }\n\n swiper.destroyed = true;\n return null;\n };\n\n Swiper.extendDefaults = function extendDefaults(newDefaults) {\n extend(extendedDefaults, newDefaults);\n };\n\n Swiper.installModule = function installModule(module) {\n if (!Swiper.prototype.modules) Swiper.prototype.modules = {};\n var name = module.name || Object.keys(Swiper.prototype.modules).length + \"_\" + now();\n Swiper.prototype.modules[name] = module;\n };\n\n Swiper.use = function use(module) {\n if (Array.isArray(module)) {\n module.forEach(function (m) {\n return Swiper.installModule(m);\n });\n return Swiper;\n }\n\n Swiper.installModule(module);\n return Swiper;\n };\n\n _createClass(Swiper, null, [{\n key: \"extendedDefaults\",\n get: function get() {\n return extendedDefaults;\n }\n }, {\n key: \"defaults\",\n get: function get() {\n return defaults;\n }\n }]);\n\n return Swiper;\n}();\n\nObject.keys(prototypes).forEach(function (prototypeGroup) {\n Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) {\n Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];\n });\n});\nSwiper.use([Resize, Observer]);\nexport default Swiper;","import { extend } from '../../utils/utils';\nexport default {\n useParams: function useParams(instanceParams) {\n var instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach(function (moduleName) {\n var module = instance.modules[moduleName]; // Extend params\n\n if (module.params) {\n extend(instanceParams, module.params);\n }\n });\n },\n useModules: function useModules(modulesParams) {\n if (modulesParams === void 0) {\n modulesParams = {};\n }\n\n var instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach(function (moduleName) {\n var module = instance.modules[moduleName];\n var moduleParams = modulesParams[moduleName] || {}; // Add event listeners\n\n if (module.on && instance.on) {\n Object.keys(module.on).forEach(function (moduleEventName) {\n instance.on(moduleEventName, module.on[moduleEventName]);\n });\n } // Module create callback\n\n\n if (module.create) {\n module.create.bind(instance)(moduleParams);\n }\n });\n }\n};","/* eslint-disable no-underscore-dangle */\nexport default {\n on: function on(events, handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n var method = priority ? 'unshift' : 'push';\n events.split(' ').forEach(function (event) {\n if (!self.eventsListeners[event]) self.eventsListeners[event] = [];\n self.eventsListeners[event][method](handler);\n });\n return self;\n },\n once: function once(events, handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n\n function onceHandler() {\n self.off(events, onceHandler);\n\n if (onceHandler.__emitterProxy) {\n delete onceHandler.__emitterProxy;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n handler.apply(self, args);\n }\n\n onceHandler.__emitterProxy = handler;\n return self.on(events, onceHandler, priority);\n },\n onAny: function onAny(handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n var method = priority ? 'unshift' : 'push';\n\n if (self.eventsAnyListeners.indexOf(handler) < 0) {\n self.eventsAnyListeners[method](handler);\n }\n\n return self;\n },\n offAny: function offAny(handler) {\n var self = this;\n if (!self.eventsAnyListeners) return self;\n var index = self.eventsAnyListeners.indexOf(handler);\n\n if (index >= 0) {\n self.eventsAnyListeners.splice(index, 1);\n }\n\n return self;\n },\n off: function off(events, handler) {\n var self = this;\n if (!self.eventsListeners) return self;\n events.split(' ').forEach(function (event) {\n if (typeof handler === 'undefined') {\n self.eventsListeners[event] = [];\n } else if (self.eventsListeners[event]) {\n self.eventsListeners[event].forEach(function (eventHandler, index) {\n if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {\n self.eventsListeners[event].splice(index, 1);\n }\n });\n }\n });\n return self;\n },\n emit: function emit() {\n var self = this;\n if (!self.eventsListeners) return self;\n var events;\n var data;\n var context;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (typeof args[0] === 'string' || Array.isArray(args[0])) {\n events = args[0];\n data = args.slice(1, args.length);\n context = self;\n } else {\n events = args[0].events;\n data = args[0].data;\n context = args[0].context || self;\n }\n\n data.unshift(context);\n var eventsArray = Array.isArray(events) ? events : events.split(' ');\n eventsArray.forEach(function (event) {\n if (self.eventsAnyListeners && self.eventsAnyListeners.length) {\n self.eventsAnyListeners.forEach(function (eventHandler) {\n eventHandler.apply(context, [event].concat(data));\n });\n }\n\n if (self.eventsListeners && self.eventsListeners[event]) {\n var handlers = [];\n self.eventsListeners[event].forEach(function (eventHandler) {\n handlers.push(eventHandler);\n });\n handlers.forEach(function (eventHandler) {\n eventHandler.apply(context, data);\n });\n }\n });\n return self;\n }\n};","import updateSize from './updateSize';\nimport updateSlides from './updateSlides';\nimport updateAutoHeight from './updateAutoHeight';\nimport updateSlidesOffset from './updateSlidesOffset';\nimport updateSlidesProgress from './updateSlidesProgress';\nimport updateProgress from './updateProgress';\nimport updateSlidesClasses from './updateSlidesClasses';\nimport updateActiveIndex from './updateActiveIndex';\nimport updateClickedSlide from './updateClickedSlide';\nexport default {\n updateSize: updateSize,\n updateSlides: updateSlides,\n updateAutoHeight: updateAutoHeight,\n updateSlidesOffset: updateSlidesOffset,\n updateSlidesProgress: updateSlidesProgress,\n updateProgress: updateProgress,\n updateSlidesClasses: updateSlidesClasses,\n updateActiveIndex: updateActiveIndex,\n updateClickedSlide: updateClickedSlide\n};","import { extend } from '../../../utils/utils';\nexport default function updateSize() {\n var swiper = this;\n var width;\n var height;\n var $el = swiper.$el;\n\n if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {\n width = swiper.params.width;\n } else {\n width = $el[0].clientWidth;\n }\n\n if (typeof swiper.params.height !== 'undefined' && swiper.params.width !== null) {\n height = swiper.params.height;\n } else {\n height = $el[0].clientHeight;\n }\n\n if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {\n return;\n } // Subtract paddings\n\n\n width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10);\n height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10);\n if (Number.isNaN(width)) width = 0;\n if (Number.isNaN(height)) height = 0;\n extend(swiper, {\n width: width,\n height: height,\n size: swiper.isHorizontal() ? width : height\n });\n}","import { getWindow } from 'ssr-window';\nimport { extend } from '../../../utils/utils';\nexport default function updateSlides() {\n var swiper = this;\n var window = getWindow();\n var params = swiper.params;\n var $wrapperEl = swiper.$wrapperEl,\n swiperSize = swiper.size,\n rtl = swiper.rtlTranslate,\n wrongRTL = swiper.wrongRTL;\n var isVirtual = swiper.virtual && params.virtual.enabled;\n var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;\n var slides = $wrapperEl.children(\".\" + swiper.params.slideClass);\n var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;\n var snapGrid = [];\n var slidesGrid = [];\n var slidesSizesGrid = [];\n\n function slidesForMargin(slideEl, slideIndex) {\n if (!params.cssMode) return true;\n\n if (slideIndex === slides.length - 1) {\n return false;\n }\n\n return true;\n }\n\n var offsetBefore = params.slidesOffsetBefore;\n\n if (typeof offsetBefore === 'function') {\n offsetBefore = params.slidesOffsetBefore.call(swiper);\n }\n\n var offsetAfter = params.slidesOffsetAfter;\n\n if (typeof offsetAfter === 'function') {\n offsetAfter = params.slidesOffsetAfter.call(swiper);\n }\n\n var previousSnapGridLength = swiper.snapGrid.length;\n var previousSlidesGridLength = swiper.snapGrid.length;\n var spaceBetween = params.spaceBetween;\n var slidePosition = -offsetBefore;\n var prevSlideSize = 0;\n var index = 0;\n\n if (typeof swiperSize === 'undefined') {\n return;\n }\n\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;\n }\n\n swiper.virtualSize = -spaceBetween; // reset margins\n\n if (rtl) slides.css({\n marginLeft: '',\n marginTop: ''\n });else slides.css({\n marginRight: '',\n marginBottom: ''\n });\n var slidesNumberEvenToRows;\n\n if (params.slidesPerColumn > 1) {\n if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {\n slidesNumberEvenToRows = slidesLength;\n } else {\n slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;\n }\n\n if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);\n }\n } // Calc slides\n\n\n var slideSize;\n var slidesPerColumn = params.slidesPerColumn;\n var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;\n var numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);\n\n for (var i = 0; i < slidesLength; i += 1) {\n slideSize = 0;\n var slide = slides.eq(i);\n\n if (params.slidesPerColumn > 1) {\n // Set slides order\n var newSlideOrderIndex = void 0;\n var column = void 0;\n var row = void 0;\n\n if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {\n var groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));\n var slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;\n var columnsInGroup = groupIndex === 0 ? params.slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);\n row = Math.floor(slideIndexInGroup / columnsInGroup);\n column = slideIndexInGroup - row * columnsInGroup + groupIndex * params.slidesPerGroup;\n newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;\n slide.css({\n '-webkit-box-ordinal-group': newSlideOrderIndex,\n '-moz-box-ordinal-group': newSlideOrderIndex,\n '-ms-flex-order': newSlideOrderIndex,\n '-webkit-order': newSlideOrderIndex,\n order: newSlideOrderIndex\n });\n } else if (params.slidesPerColumnFill === 'column') {\n column = Math.floor(i / slidesPerColumn);\n row = i - column * slidesPerColumn;\n\n if (column > numFullColumns || column === numFullColumns && row === slidesPerColumn - 1) {\n row += 1;\n\n if (row >= slidesPerColumn) {\n row = 0;\n column += 1;\n }\n }\n } else {\n row = Math.floor(i / slidesPerRow);\n column = i - row * slidesPerRow;\n }\n\n slide.css(\"margin-\" + (swiper.isHorizontal() ? 'top' : 'left'), row !== 0 && params.spaceBetween && params.spaceBetween + \"px\");\n }\n\n if (slide.css('display') === 'none') continue; // eslint-disable-line\n\n if (params.slidesPerView === 'auto') {\n var slideStyles = window.getComputedStyle(slide[0], null);\n var currentTransform = slide[0].style.transform;\n var currentWebKitTransform = slide[0].style.webkitTransform;\n\n if (currentTransform) {\n slide[0].style.transform = 'none';\n }\n\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = 'none';\n }\n\n if (params.roundLengths) {\n slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);\n } else {\n // eslint-disable-next-line\n if (swiper.isHorizontal()) {\n var width = parseFloat(slideStyles.getPropertyValue('width') || 0);\n var paddingLeft = parseFloat(slideStyles.getPropertyValue('padding-left') || 0);\n var paddingRight = parseFloat(slideStyles.getPropertyValue('padding-right') || 0);\n var marginLeft = parseFloat(slideStyles.getPropertyValue('margin-left') || 0);\n var marginRight = parseFloat(slideStyles.getPropertyValue('margin-right') || 0);\n var boxSizing = slideStyles.getPropertyValue('box-sizing');\n\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = width + marginLeft + marginRight;\n } else {\n var _slide$ = slide[0],\n clientWidth = _slide$.clientWidth,\n offsetWidth = _slide$.offsetWidth;\n slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);\n }\n } else {\n var height = parseFloat(slideStyles.getPropertyValue('height') || 0);\n var paddingTop = parseFloat(slideStyles.getPropertyValue('padding-top') || 0);\n var paddingBottom = parseFloat(slideStyles.getPropertyValue('padding-bottom') || 0);\n var marginTop = parseFloat(slideStyles.getPropertyValue('margin-top') || 0);\n var marginBottom = parseFloat(slideStyles.getPropertyValue('margin-bottom') || 0);\n\n var _boxSizing = slideStyles.getPropertyValue('box-sizing');\n\n if (_boxSizing && _boxSizing === 'border-box') {\n slideSize = height + marginTop + marginBottom;\n } else {\n var _slide$2 = slide[0],\n clientHeight = _slide$2.clientHeight,\n offsetHeight = _slide$2.offsetHeight;\n slideSize = height + paddingTop + paddingBottom + marginTop + marginBottom + (offsetHeight - clientHeight);\n }\n }\n }\n\n if (currentTransform) {\n slide[0].style.transform = currentTransform;\n }\n\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = currentWebKitTransform;\n }\n\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n } else {\n slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n\n if (slides[i]) {\n if (swiper.isHorizontal()) {\n slides[i].style.width = slideSize + \"px\";\n } else {\n slides[i].style.height = slideSize + \"px\";\n }\n }\n }\n\n if (slides[i]) {\n slides[i].swiperSlideSize = slideSize;\n }\n\n slidesSizesGrid.push(slideSize);\n\n if (params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n } else {\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n\n swiper.virtualSize += slideSize + spaceBetween;\n prevSlideSize = slideSize;\n index += 1;\n }\n\n swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;\n var newSlidesGrid;\n\n if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {\n $wrapperEl.css({\n width: swiper.virtualSize + params.spaceBetween + \"px\"\n });\n }\n\n if (params.setWrapperSize) {\n if (swiper.isHorizontal()) $wrapperEl.css({\n width: swiper.virtualSize + params.spaceBetween + \"px\"\n });else $wrapperEl.css({\n height: swiper.virtualSize + params.spaceBetween + \"px\"\n });\n }\n\n if (params.slidesPerColumn > 1) {\n swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;\n swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;\n if (swiper.isHorizontal()) $wrapperEl.css({\n width: swiper.virtualSize + params.spaceBetween + \"px\"\n });else $wrapperEl.css({\n height: swiper.virtualSize + params.spaceBetween + \"px\"\n });\n\n if (params.centeredSlides) {\n newSlidesGrid = [];\n\n for (var _i = 0; _i < snapGrid.length; _i += 1) {\n var slidesGridItem = snapGrid[_i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[_i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);\n }\n\n snapGrid = newSlidesGrid;\n }\n } // Remove last grid elements depending on width\n\n\n if (!params.centeredSlides) {\n newSlidesGrid = [];\n\n for (var _i2 = 0; _i2 < snapGrid.length; _i2 += 1) {\n var _slidesGridItem = snapGrid[_i2];\n if (params.roundLengths) _slidesGridItem = Math.floor(_slidesGridItem);\n\n if (snapGrid[_i2] <= swiper.virtualSize - swiperSize) {\n newSlidesGrid.push(_slidesGridItem);\n }\n }\n\n snapGrid = newSlidesGrid;\n\n if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {\n snapGrid.push(swiper.virtualSize - swiperSize);\n }\n }\n\n if (snapGrid.length === 0) snapGrid = [0];\n\n if (params.spaceBetween !== 0) {\n if (swiper.isHorizontal()) {\n if (rtl) slides.filter(slidesForMargin).css({\n marginLeft: spaceBetween + \"px\"\n });else slides.filter(slidesForMargin).css({\n marginRight: spaceBetween + \"px\"\n });\n } else slides.filter(slidesForMargin).css({\n marginBottom: spaceBetween + \"px\"\n });\n }\n\n if (params.centeredSlides && params.centeredSlidesBounds) {\n var allSlidesSize = 0;\n slidesSizesGrid.forEach(function (slideSizeValue) {\n allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n allSlidesSize -= params.spaceBetween;\n var maxSnap = allSlidesSize - swiperSize;\n snapGrid = snapGrid.map(function (snap) {\n if (snap < 0) return -offsetBefore;\n if (snap > maxSnap) return maxSnap + offsetAfter;\n return snap;\n });\n }\n\n if (params.centerInsufficientSlides) {\n var _allSlidesSize = 0;\n slidesSizesGrid.forEach(function (slideSizeValue) {\n _allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n _allSlidesSize -= params.spaceBetween;\n\n if (_allSlidesSize < swiperSize) {\n var allSlidesOffset = (swiperSize - _allSlidesSize) / 2;\n snapGrid.forEach(function (snap, snapIndex) {\n snapGrid[snapIndex] = snap - allSlidesOffset;\n });\n slidesGrid.forEach(function (snap, snapIndex) {\n slidesGrid[snapIndex] = snap + allSlidesOffset;\n });\n }\n }\n\n extend(swiper, {\n slides: slides,\n snapGrid: snapGrid,\n slidesGrid: slidesGrid,\n slidesSizesGrid: slidesSizesGrid\n });\n\n if (slidesLength !== previousSlidesLength) {\n swiper.emit('slidesLengthChange');\n }\n\n if (snapGrid.length !== previousSnapGridLength) {\n if (swiper.params.watchOverflow) swiper.checkOverflow();\n swiper.emit('snapGridLengthChange');\n }\n\n if (slidesGrid.length !== previousSlidesGridLength) {\n swiper.emit('slidesGridLengthChange');\n }\n\n if (params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateSlidesOffset();\n }\n}","export default function updateAutoHeight(speed) {\n var swiper = this;\n var activeSlides = [];\n var newHeight = 0;\n var i;\n\n if (typeof speed === 'number') {\n swiper.setTransition(speed);\n } else if (speed === true) {\n swiper.setTransition(swiper.params.speed);\n } // Find slides currently in view\n\n\n if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {\n if (swiper.params.centeredSlides) {\n swiper.visibleSlides.each(function (slide) {\n activeSlides.push(slide);\n });\n } else {\n for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {\n var index = swiper.activeIndex + i;\n if (index > swiper.slides.length) break;\n activeSlides.push(swiper.slides.eq(index)[0]);\n }\n }\n } else {\n activeSlides.push(swiper.slides.eq(swiper.activeIndex)[0]);\n } // Find new height from highest slide in view\n\n\n for (i = 0; i < activeSlides.length; i += 1) {\n if (typeof activeSlides[i] !== 'undefined') {\n var height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n } // Update Height\n\n\n if (newHeight) swiper.$wrapperEl.css('height', newHeight + \"px\");\n}","export default function updateSlidesOffset() {\n var swiper = this;\n var slides = swiper.slides;\n\n for (var i = 0; i < slides.length; i += 1) {\n slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;\n }\n}","import $ from '../../../utils/dom';\nexport default function updateSlidesProgress(translate) {\n if (translate === void 0) {\n translate = this && this.translate || 0;\n }\n\n var swiper = this;\n var params = swiper.params;\n var slides = swiper.slides,\n rtl = swiper.rtlTranslate;\n if (slides.length === 0) return;\n if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();\n var offsetCenter = -translate;\n if (rtl) offsetCenter = translate; // Visible Slides\n\n slides.removeClass(params.slideVisibleClass);\n swiper.visibleSlidesIndexes = [];\n swiper.visibleSlides = [];\n\n for (var i = 0; i < slides.length; i += 1) {\n var slide = slides[i];\n var slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + params.spaceBetween);\n\n if (params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) {\n var slideBefore = -(offsetCenter - slide.swiperSlideOffset);\n var slideAfter = slideBefore + swiper.slidesSizesGrid[i];\n var isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;\n\n if (isVisible) {\n swiper.visibleSlides.push(slide);\n swiper.visibleSlidesIndexes.push(i);\n slides.eq(i).addClass(params.slideVisibleClass);\n }\n }\n\n slide.progress = rtl ? -slideProgress : slideProgress;\n }\n\n swiper.visibleSlides = $(swiper.visibleSlides);\n}","import { extend } from '../../../utils/utils';\nexport default function updateProgress(translate) {\n var swiper = this;\n\n if (typeof translate === 'undefined') {\n var multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line\n\n translate = swiper && swiper.translate && swiper.translate * multiplier || 0;\n }\n\n var params = swiper.params;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n var progress = swiper.progress,\n isBeginning = swiper.isBeginning,\n isEnd = swiper.isEnd;\n var wasBeginning = isBeginning;\n var wasEnd = isEnd;\n\n if (translatesDiff === 0) {\n progress = 0;\n isBeginning = true;\n isEnd = true;\n } else {\n progress = (translate - swiper.minTranslate()) / translatesDiff;\n isBeginning = progress <= 0;\n isEnd = progress >= 1;\n }\n\n extend(swiper, {\n progress: progress,\n isBeginning: isBeginning,\n isEnd: isEnd\n });\n if (params.watchSlidesProgress || params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);\n\n if (isBeginning && !wasBeginning) {\n swiper.emit('reachBeginning toEdge');\n }\n\n if (isEnd && !wasEnd) {\n swiper.emit('reachEnd toEdge');\n }\n\n if (wasBeginning && !isBeginning || wasEnd && !isEnd) {\n swiper.emit('fromEdge');\n }\n\n swiper.emit('progress', progress);\n}","export default function updateSlidesClasses() {\n var swiper = this;\n var slides = swiper.slides,\n params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex,\n realIndex = swiper.realIndex;\n var isVirtual = swiper.virtual && params.virtual.enabled;\n slides.removeClass(params.slideActiveClass + \" \" + params.slideNextClass + \" \" + params.slidePrevClass + \" \" + params.slideDuplicateActiveClass + \" \" + params.slideDuplicateNextClass + \" \" + params.slideDuplicatePrevClass);\n var activeSlide;\n\n if (isVirtual) {\n activeSlide = swiper.$wrapperEl.find(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + activeIndex + \"\\\"]\");\n } else {\n activeSlide = slides.eq(activeIndex);\n } // Active classes\n\n\n activeSlide.addClass(params.slideActiveClass);\n\n if (params.loop) {\n // Duplicate to all looped slides\n if (activeSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]\").addClass(params.slideDuplicateActiveClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]\").addClass(params.slideDuplicateActiveClass);\n }\n } // Next Slide\n\n\n var nextSlide = activeSlide.nextAll(\".\" + params.slideClass).eq(0).addClass(params.slideNextClass);\n\n if (params.loop && nextSlide.length === 0) {\n nextSlide = slides.eq(0);\n nextSlide.addClass(params.slideNextClass);\n } // Prev Slide\n\n\n var prevSlide = activeSlide.prevAll(\".\" + params.slideClass).eq(0).addClass(params.slidePrevClass);\n\n if (params.loop && prevSlide.length === 0) {\n prevSlide = slides.eq(-1);\n prevSlide.addClass(params.slidePrevClass);\n }\n\n if (params.loop) {\n // Duplicate to all looped slides\n if (nextSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + nextSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicateNextClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + nextSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicateNextClass);\n }\n\n if (prevSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + prevSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicatePrevClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + prevSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicatePrevClass);\n }\n }\n\n swiper.emitSlidesClasses();\n}","import { extend } from '../../../utils/utils';\nexport default function updateActiveIndex(newActiveIndex) {\n var swiper = this;\n var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n var slidesGrid = swiper.slidesGrid,\n snapGrid = swiper.snapGrid,\n params = swiper.params,\n previousIndex = swiper.activeIndex,\n previousRealIndex = swiper.realIndex,\n previousSnapIndex = swiper.snapIndex;\n var activeIndex = newActiveIndex;\n var snapIndex;\n\n if (typeof activeIndex === 'undefined') {\n for (var i = 0; i < slidesGrid.length; i += 1) {\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {\n activeIndex = i;\n } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {\n activeIndex = i + 1;\n }\n } else if (translate >= slidesGrid[i]) {\n activeIndex = i;\n }\n } // Normalize slideIndex\n\n\n if (params.normalizeSlideIndex) {\n if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;\n }\n }\n\n if (snapGrid.indexOf(translate) >= 0) {\n snapIndex = snapGrid.indexOf(translate);\n } else {\n var skip = Math.min(params.slidesPerGroupSkip, activeIndex);\n snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);\n }\n\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n\n if (activeIndex === previousIndex) {\n if (snapIndex !== previousSnapIndex) {\n swiper.snapIndex = snapIndex;\n swiper.emit('snapIndexChange');\n }\n\n return;\n } // Get real index\n\n\n var realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);\n extend(swiper, {\n snapIndex: snapIndex,\n realIndex: realIndex,\n previousIndex: previousIndex,\n activeIndex: activeIndex\n });\n swiper.emit('activeIndexChange');\n swiper.emit('snapIndexChange');\n\n if (previousRealIndex !== realIndex) {\n swiper.emit('realIndexChange');\n }\n\n if (swiper.initialized || swiper.params.runCallbacksOnInit) {\n swiper.emit('slideChange');\n }\n}","import $ from '../../../utils/dom';\nexport default function updateClickedSlide(e) {\n var swiper = this;\n var params = swiper.params;\n var slide = $(e.target).closest(\".\" + params.slideClass)[0];\n var slideFound = false;\n\n if (slide) {\n for (var i = 0; i < swiper.slides.length; i += 1) {\n if (swiper.slides[i] === slide) slideFound = true;\n }\n }\n\n if (slide && slideFound) {\n swiper.clickedSlide = slide;\n\n if (swiper.virtual && swiper.params.virtual.enabled) {\n swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);\n } else {\n swiper.clickedIndex = $(slide).index();\n }\n } else {\n swiper.clickedSlide = undefined;\n swiper.clickedIndex = undefined;\n return;\n }\n\n if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {\n swiper.slideToClickedSlide();\n }\n}","import getTranslate from './getTranslate';\nimport setTranslate from './setTranslate';\nimport minTranslate from './minTranslate';\nimport maxTranslate from './maxTranslate';\nimport translateTo from './translateTo';\nexport default {\n getTranslate: getTranslate,\n setTranslate: setTranslate,\n minTranslate: minTranslate,\n maxTranslate: maxTranslate,\n translateTo: translateTo\n};","import { getTranslate } from '../../../utils/utils';\nexport default function getSwiperTranslate(axis) {\n if (axis === void 0) {\n axis = this.isHorizontal() ? 'x' : 'y';\n }\n\n var swiper = this;\n var params = swiper.params,\n rtl = swiper.rtlTranslate,\n translate = swiper.translate,\n $wrapperEl = swiper.$wrapperEl;\n\n if (params.virtualTranslate) {\n return rtl ? -translate : translate;\n }\n\n if (params.cssMode) {\n return translate;\n }\n\n var currentTranslate = getTranslate($wrapperEl[0], axis);\n if (rtl) currentTranslate = -currentTranslate;\n return currentTranslate || 0;\n}","export default function setTranslate(translate, byController) {\n var swiper = this;\n var rtl = swiper.rtlTranslate,\n params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n wrapperEl = swiper.wrapperEl,\n progress = swiper.progress;\n var x = 0;\n var y = 0;\n var z = 0;\n\n if (swiper.isHorizontal()) {\n x = rtl ? -translate : translate;\n } else {\n y = translate;\n }\n\n if (params.roundLengths) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n if (params.cssMode) {\n wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;\n } else if (!params.virtualTranslate) {\n $wrapperEl.transform(\"translate3d(\" + x + \"px, \" + y + \"px, \" + z + \"px)\");\n }\n\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress\n\n var newProgress;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (translate - swiper.minTranslate()) / translatesDiff;\n }\n\n if (newProgress !== progress) {\n swiper.updateProgress(translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, byController);\n}","export default function minTranslate() {\n return -this.snapGrid[0];\n}","export default function maxTranslate() {\n return -this.snapGrid[this.snapGrid.length - 1];\n}","export default function translateTo(translate, speed, runCallbacks, translateBounds, internal) {\n if (translate === void 0) {\n translate = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (translateBounds === void 0) {\n translateBounds = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n wrapperEl = swiper.wrapperEl;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n\n var minTranslate = swiper.minTranslate();\n var maxTranslate = swiper.maxTranslate();\n var newTranslate;\n if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress\n\n swiper.updateProgress(newTranslate);\n\n if (params.cssMode) {\n var isH = swiper.isHorizontal();\n\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n var _wrapperEl$scrollTo;\n\n wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = -newTranslate, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n }\n }\n\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(newTranslate);\n\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionEnd');\n }\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(newTranslate);\n\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionStart');\n }\n\n if (!swiper.animating) {\n swiper.animating = true;\n\n if (!swiper.onTranslateToWrapperTransitionEnd) {\n swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n swiper.onTranslateToWrapperTransitionEnd = null;\n delete swiper.onTranslateToWrapperTransitionEnd;\n\n if (runCallbacks) {\n swiper.emit('transitionEnd');\n }\n };\n }\n\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n }\n }\n\n return true;\n}","import setTransition from './setTransition';\nimport transitionStart from './transitionStart';\nimport transitionEnd from './transitionEnd';\nexport default {\n setTransition: setTransition,\n transitionStart: transitionStart,\n transitionEnd: transitionEnd\n};","export default function setTransition(duration, byController) {\n var swiper = this;\n\n if (!swiper.params.cssMode) {\n swiper.$wrapperEl.transition(duration);\n }\n\n swiper.emit('setTransition', duration, byController);\n}","export default function transitionStart(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n params = swiper.params,\n previousIndex = swiper.previousIndex;\n if (params.cssMode) return;\n\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n\n var dir = direction;\n\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n\n swiper.emit('transitionStart');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionStart');\n return;\n }\n\n swiper.emit('slideChangeTransitionStart');\n\n if (dir === 'next') {\n swiper.emit('slideNextTransitionStart');\n } else {\n swiper.emit('slidePrevTransitionStart');\n }\n }\n}","export default function transitionEnd(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n previousIndex = swiper.previousIndex,\n params = swiper.params;\n swiper.animating = false;\n if (params.cssMode) return;\n swiper.setTransition(0);\n var dir = direction;\n\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n\n swiper.emit('transitionEnd');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionEnd');\n return;\n }\n\n swiper.emit('slideChangeTransitionEnd');\n\n if (dir === 'next') {\n swiper.emit('slideNextTransitionEnd');\n } else {\n swiper.emit('slidePrevTransitionEnd');\n }\n }\n}","import slideTo from './slideTo';\nimport slideToLoop from './slideToLoop';\nimport slideNext from './slideNext';\nimport slidePrev from './slidePrev';\nimport slideReset from './slideReset';\nimport slideToClosest from './slideToClosest';\nimport slideToClickedSlide from './slideToClickedSlide';\nexport default {\n slideTo: slideTo,\n slideToLoop: slideToLoop,\n slideNext: slideNext,\n slidePrev: slidePrev,\n slideReset: slideReset,\n slideToClosest: slideToClosest,\n slideToClickedSlide: slideToClickedSlide\n};","export default function slideTo(index, speed, runCallbacks, internal) {\n if (index === void 0) {\n index = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (typeof index !== 'number' && typeof index !== 'string') {\n throw new Error(\"The 'index' argument cannot have type other than 'number' or 'string'. [\" + typeof index + \"] given.\");\n }\n\n if (typeof index === 'string') {\n /**\n * The `index` argument converted from `string` to `number`.\n * @type {number}\n */\n var indexAsNumber = parseInt(index, 10);\n /**\n * Determines whether the `index` argument is a valid `number`\n * after being converted from the `string` type.\n * @type {boolean}\n */\n\n var isValidNumber = isFinite(indexAsNumber);\n\n if (!isValidNumber) {\n throw new Error(\"The passed-in 'index' (string) couldn't be converted to 'number'. [\" + index + \"] given.\");\n } // Knowing that the converted `index` is a valid number,\n // we can update the original argument's value.\n\n\n index = indexAsNumber;\n }\n\n var swiper = this;\n var slideIndex = index;\n if (slideIndex < 0) slideIndex = 0;\n var params = swiper.params,\n snapGrid = swiper.snapGrid,\n slidesGrid = swiper.slidesGrid,\n previousIndex = swiper.previousIndex,\n activeIndex = swiper.activeIndex,\n rtl = swiper.rtlTranslate,\n wrapperEl = swiper.wrapperEl;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n\n var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);\n var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n\n if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {\n swiper.emit('beforeSlideChangeStart');\n }\n\n var translate = -snapGrid[snapIndex]; // Update progress\n\n swiper.updateProgress(translate); // Normalize slideIndex\n\n if (params.normalizeSlideIndex) {\n for (var i = 0; i < slidesGrid.length; i += 1) {\n if (-Math.floor(translate * 100) >= Math.floor(slidesGrid[i] * 100)) {\n slideIndex = i;\n }\n }\n } // Directions locks\n\n\n if (swiper.initialized && slideIndex !== activeIndex) {\n if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {\n return false;\n }\n\n if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {\n if ((activeIndex || 0) !== slideIndex) return false;\n }\n }\n\n var direction;\n if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index\n\n if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {\n swiper.updateActiveIndex(slideIndex); // Update Height\n\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n\n swiper.updateSlidesClasses();\n\n if (params.effect !== 'slide') {\n swiper.setTranslate(translate);\n }\n\n if (direction !== 'reset') {\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n }\n\n return false;\n }\n\n if (params.cssMode) {\n var isH = swiper.isHorizontal();\n var t = -translate;\n\n if (rtl) {\n t = wrapperEl.scrollWidth - wrapperEl.offsetWidth - t;\n }\n\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n var _wrapperEl$scrollTo;\n\n wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = t, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n }\n }\n\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n\n if (!swiper.animating) {\n swiper.animating = true;\n\n if (!swiper.onSlideToWrapperTransitionEnd) {\n swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n swiper.onSlideToWrapperTransitionEnd = null;\n delete swiper.onSlideToWrapperTransitionEnd;\n swiper.transitionEnd(runCallbacks, direction);\n };\n }\n\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n }\n }\n\n return true;\n}","export default function slideToLoop(index, speed, runCallbacks, internal) {\n if (index === void 0) {\n index = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var newIndex = index;\n\n if (swiper.params.loop) {\n newIndex += swiper.loopedSlides;\n }\n\n return swiper.slideTo(newIndex, speed, runCallbacks, internal);\n}","/* eslint no-unused-vars: \"off\" */\nexport default function slideNext(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n animating = swiper.animating;\n var increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;\n\n if (params.loop) {\n if (animating && params.loopPreventsSlide) return false;\n swiper.loopFix(); // eslint-disable-next-line\n\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n\n return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n}","/* eslint no-unused-vars: \"off\" */\nexport default function slidePrev(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n animating = swiper.animating,\n snapGrid = swiper.snapGrid,\n slidesGrid = swiper.slidesGrid,\n rtlTranslate = swiper.rtlTranslate;\n\n if (params.loop) {\n if (animating && params.loopPreventsSlide) return false;\n swiper.loopFix(); // eslint-disable-next-line\n\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n\n var translate = rtlTranslate ? swiper.translate : -swiper.translate;\n\n function normalize(val) {\n if (val < 0) return -Math.floor(Math.abs(val));\n return Math.floor(val);\n }\n\n var normalizedTranslate = normalize(translate);\n var normalizedSnapGrid = snapGrid.map(function (val) {\n return normalize(val);\n });\n var currentSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];\n var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];\n\n if (typeof prevSnap === 'undefined' && params.cssMode) {\n snapGrid.forEach(function (snap) {\n if (!prevSnap && normalizedTranslate >= snap) prevSnap = snap;\n });\n }\n\n var prevIndex;\n\n if (typeof prevSnap !== 'undefined') {\n prevIndex = slidesGrid.indexOf(prevSnap);\n if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;\n }\n\n return swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n}","/* eslint no-unused-vars: \"off\" */\nexport default function slideReset(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);\n}","/* eslint no-unused-vars: \"off\" */\nexport default function slideToClosest(speed, runCallbacks, internal, threshold) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (threshold === void 0) {\n threshold = 0.5;\n }\n\n var swiper = this;\n var index = swiper.activeIndex;\n var skip = Math.min(swiper.params.slidesPerGroupSkip, index);\n var snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);\n var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n\n if (translate >= swiper.snapGrid[snapIndex]) {\n // The current translate is on or after the current snap index, so the choice\n // is between the current index and the one after it.\n var currentSnap = swiper.snapGrid[snapIndex];\n var nextSnap = swiper.snapGrid[snapIndex + 1];\n\n if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {\n index += swiper.params.slidesPerGroup;\n }\n } else {\n // The current translate is before the current snap index, so the choice\n // is between the current index and the one before it.\n var prevSnap = swiper.snapGrid[snapIndex - 1];\n var _currentSnap = swiper.snapGrid[snapIndex];\n\n if (translate - prevSnap <= (_currentSnap - prevSnap) * threshold) {\n index -= swiper.params.slidesPerGroup;\n }\n }\n\n index = Math.max(index, 0);\n index = Math.min(index, swiper.slidesGrid.length - 1);\n return swiper.slideTo(index, speed, runCallbacks, internal);\n}","import $ from '../../../utils/dom';\nimport { nextTick } from '../../../utils/utils';\nexport default function slideToClickedSlide() {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl;\n var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;\n var slideToIndex = swiper.clickedIndex;\n var realIndex;\n\n if (params.loop) {\n if (swiper.animating) return;\n realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);\n\n if (params.centeredSlides) {\n if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {\n swiper.loopFix();\n slideToIndex = $wrapperEl.children(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]:not(.\" + params.slideDuplicateClass + \")\").eq(0).index();\n nextTick(function () {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else if (slideToIndex > swiper.slides.length - slidesPerView) {\n swiper.loopFix();\n slideToIndex = $wrapperEl.children(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]:not(.\" + params.slideDuplicateClass + \")\").eq(0).index();\n nextTick(function () {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else {\n swiper.slideTo(slideToIndex);\n }\n}","import loopCreate from './loopCreate';\nimport loopFix from './loopFix';\nimport loopDestroy from './loopDestroy';\nexport default {\n loopCreate: loopCreate,\n loopFix: loopFix,\n loopDestroy: loopDestroy\n};","import { getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nexport default function loopCreate() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl; // Remove duplicated slides\n\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass).remove();\n var slides = $wrapperEl.children(\".\" + params.slideClass);\n\n if (params.loopFillGroupWithBlank) {\n var blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;\n\n if (blankSlidesNum !== params.slidesPerGroup) {\n for (var i = 0; i < blankSlidesNum; i += 1) {\n var blankNode = $(document.createElement('div')).addClass(params.slideClass + \" \" + params.slideBlankClass);\n $wrapperEl.append(blankNode);\n }\n\n slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n }\n\n if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;\n swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));\n swiper.loopedSlides += params.loopAdditionalSlides;\n\n if (swiper.loopedSlides > slides.length) {\n swiper.loopedSlides = slides.length;\n }\n\n var prependSlides = [];\n var appendSlides = [];\n slides.each(function (el, index) {\n var slide = $(el);\n\n if (index < swiper.loopedSlides) {\n appendSlides.push(el);\n }\n\n if (index < slides.length && index >= slides.length - swiper.loopedSlides) {\n prependSlides.push(el);\n }\n\n slide.attr('data-swiper-slide-index', index);\n });\n\n for (var _i = 0; _i < appendSlides.length; _i += 1) {\n $wrapperEl.append($(appendSlides[_i].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n\n for (var _i2 = prependSlides.length - 1; _i2 >= 0; _i2 -= 1) {\n $wrapperEl.prepend($(prependSlides[_i2].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n}","export default function loopFix() {\n var swiper = this;\n swiper.emit('beforeLoopFix');\n var activeIndex = swiper.activeIndex,\n slides = swiper.slides,\n loopedSlides = swiper.loopedSlides,\n allowSlidePrev = swiper.allowSlidePrev,\n allowSlideNext = swiper.allowSlideNext,\n snapGrid = swiper.snapGrid,\n rtl = swiper.rtlTranslate;\n var newIndex;\n swiper.allowSlidePrev = true;\n swiper.allowSlideNext = true;\n var snapTranslate = -snapGrid[activeIndex];\n var diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding\n\n if (activeIndex < loopedSlides) {\n newIndex = slides.length - loopedSlides * 3 + activeIndex;\n newIndex += loopedSlides;\n var slideChanged = swiper.slideTo(newIndex, 0, false, true);\n\n if (slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n } else if (activeIndex >= slides.length - loopedSlides) {\n // Fix For Positive Oversliding\n newIndex = -slides.length + activeIndex + loopedSlides;\n newIndex += loopedSlides;\n\n var _slideChanged = swiper.slideTo(newIndex, 0, false, true);\n\n if (_slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n }\n\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n swiper.emit('loopFix');\n}","export default function loopDestroy() {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params,\n slides = swiper.slides;\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \",.\" + params.slideClass + \".\" + params.slideBlankClass).remove();\n slides.removeAttr('data-swiper-slide-index');\n}","import setGrabCursor from './setGrabCursor';\nimport unsetGrabCursor from './unsetGrabCursor';\nexport default {\n setGrabCursor: setGrabCursor,\n unsetGrabCursor: unsetGrabCursor\n};","export default function setGrabCursor(moving) {\n var swiper = this;\n if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;\n var el = swiper.el;\n el.style.cursor = 'move';\n el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';\n el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';\n el.style.cursor = moving ? 'grabbing' : 'grab';\n}","export default function unsetGrabCursor() {\n var swiper = this;\n\n if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {\n return;\n }\n\n swiper.el.style.cursor = '';\n}","import appendSlide from './appendSlide';\nimport prependSlide from './prependSlide';\nimport addSlide from './addSlide';\nimport removeSlide from './removeSlide';\nimport removeAllSlides from './removeAllSlides';\nexport default {\n appendSlide: appendSlide,\n prependSlide: prependSlide,\n addSlide: addSlide,\n removeSlide: removeSlide,\n removeAllSlides: removeAllSlides\n};","export default function appendSlide(slides) {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params;\n\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.append(slides[i]);\n }\n } else {\n $wrapperEl.append(slides);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n}","export default function prependSlide(slides) {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex;\n\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n var newActiveIndex = activeIndex + 1;\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.prepend(slides[i]);\n }\n\n newActiveIndex = activeIndex + slides.length;\n } else {\n $wrapperEl.prepend(slides);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n swiper.slideTo(newActiveIndex, 0, false);\n}","export default function addSlide(index, slides) {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params,\n activeIndex = swiper.activeIndex;\n var activeIndexBuffer = activeIndex;\n\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n\n var baseLength = swiper.slides.length;\n\n if (index <= 0) {\n swiper.prependSlide(slides);\n return;\n }\n\n if (index >= baseLength) {\n swiper.appendSlide(slides);\n return;\n }\n\n var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;\n var slidesBuffer = [];\n\n for (var i = baseLength - 1; i >= index; i -= 1) {\n var currentSlide = swiper.slides.eq(i);\n currentSlide.remove();\n slidesBuffer.unshift(currentSlide);\n }\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var _i = 0; _i < slides.length; _i += 1) {\n if (slides[_i]) $wrapperEl.append(slides[_i]);\n }\n\n newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;\n } else {\n $wrapperEl.append(slides);\n }\n\n for (var _i2 = 0; _i2 < slidesBuffer.length; _i2 += 1) {\n $wrapperEl.append(slidesBuffer[_i2]);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}","export default function removeSlide(slidesIndexes) {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex;\n var activeIndexBuffer = activeIndex;\n\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n\n var newActiveIndex = activeIndexBuffer;\n var indexToRemove;\n\n if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {\n for (var i = 0; i < slidesIndexes.length; i += 1) {\n indexToRemove = slidesIndexes[i];\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n }\n\n newActiveIndex = Math.max(newActiveIndex, 0);\n } else {\n indexToRemove = slidesIndexes;\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}","export default function removeAllSlides() {\n var swiper = this;\n var slidesIndexes = [];\n\n for (var i = 0; i < swiper.slides.length; i += 1) {\n slidesIndexes.push(i);\n }\n\n swiper.removeSlide(slidesIndexes);\n}","import setBreakpoint from './setBreakpoint';\nimport getBreakpoint from './getBreakpoint';\nexport default {\n setBreakpoint: setBreakpoint,\n getBreakpoint: getBreakpoint\n};","import { extend } from '../../../utils/utils';\nexport default function setBreakpoint() {\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n initialized = swiper.initialized,\n _swiper$loopedSlides = swiper.loopedSlides,\n loopedSlides = _swiper$loopedSlides === void 0 ? 0 : _swiper$loopedSlides,\n params = swiper.params,\n $el = swiper.$el;\n var breakpoints = params.breakpoints;\n if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters\n\n var breakpoint = swiper.getBreakpoint(breakpoints);\n\n if (breakpoint && swiper.currentBreakpoint !== breakpoint) {\n var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;\n\n if (breakpointOnlyParams) {\n ['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach(function (param) {\n var paramValue = breakpointOnlyParams[param];\n if (typeof paramValue === 'undefined') return;\n\n if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {\n breakpointOnlyParams[param] = 'auto';\n } else if (param === 'slidesPerView') {\n breakpointOnlyParams[param] = parseFloat(paramValue);\n } else {\n breakpointOnlyParams[param] = parseInt(paramValue, 10);\n }\n });\n }\n\n var breakpointParams = breakpointOnlyParams || swiper.originalParams;\n var wasMultiRow = params.slidesPerColumn > 1;\n var isMultiRow = breakpointParams.slidesPerColumn > 1;\n\n if (wasMultiRow && !isMultiRow) {\n $el.removeClass(params.containerModifierClass + \"multirow \" + params.containerModifierClass + \"multirow-column\");\n swiper.emitContainerClasses();\n } else if (!wasMultiRow && isMultiRow) {\n $el.addClass(params.containerModifierClass + \"multirow\");\n\n if (breakpointParams.slidesPerColumnFill === 'column') {\n $el.addClass(params.containerModifierClass + \"multirow-column\");\n }\n\n swiper.emitContainerClasses();\n }\n\n var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;\n var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);\n\n if (directionChanged && initialized) {\n swiper.changeDirection();\n }\n\n extend(swiper.params, breakpointParams);\n extend(swiper, {\n allowTouchMove: swiper.params.allowTouchMove,\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev\n });\n swiper.currentBreakpoint = breakpoint;\n swiper.emit('_beforeBreakpoint', breakpointParams);\n\n if (needsReLoop && initialized) {\n swiper.loopDestroy();\n swiper.loopCreate();\n swiper.updateSlides();\n swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);\n }\n\n swiper.emit('breakpoint', breakpointParams);\n }\n}","import { getWindow } from 'ssr-window';\nexport default function getBreakpoints(breakpoints) {\n var window = getWindow(); // Get breakpoint for window width\n\n if (!breakpoints) return undefined;\n var breakpoint = false;\n var points = Object.keys(breakpoints).map(function (point) {\n if (typeof point === 'string' && point.indexOf('@') === 0) {\n var minRatio = parseFloat(point.substr(1));\n var value = window.innerHeight * minRatio;\n return {\n value: value,\n point: point\n };\n }\n\n return {\n value: point,\n point: point\n };\n });\n points.sort(function (a, b) {\n return parseInt(a.value, 10) - parseInt(b.value, 10);\n });\n\n for (var i = 0; i < points.length; i += 1) {\n var _points$i = points[i],\n point = _points$i.point,\n value = _points$i.value;\n\n if (value <= window.innerWidth) {\n breakpoint = point;\n }\n }\n\n return breakpoint || 'max';\n}","function checkOverflow() {\n var swiper = this;\n var params = swiper.params;\n var wasLocked = swiper.isLocked;\n var lastSlidePosition = swiper.slides.length > 0 && params.slidesOffsetBefore + params.spaceBetween * (swiper.slides.length - 1) + swiper.slides[0].offsetWidth * swiper.slides.length;\n\n if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {\n swiper.isLocked = lastSlidePosition <= swiper.size;\n } else {\n swiper.isLocked = swiper.snapGrid.length === 1;\n }\n\n swiper.allowSlideNext = !swiper.isLocked;\n swiper.allowSlidePrev = !swiper.isLocked; // events\n\n if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');\n\n if (wasLocked && wasLocked !== swiper.isLocked) {\n swiper.isEnd = false;\n if (swiper.navigation) swiper.navigation.update();\n }\n}\n\nexport default {\n checkOverflow: checkOverflow\n};","import addClasses from './addClasses';\nimport removeClasses from './removeClasses';\nexport default {\n addClasses: addClasses,\n removeClasses: removeClasses\n};","export default function addClasses() {\n var swiper = this;\n var classNames = swiper.classNames,\n params = swiper.params,\n rtl = swiper.rtl,\n $el = swiper.$el,\n device = swiper.device;\n var suffixes = [];\n suffixes.push('initialized');\n suffixes.push(params.direction);\n\n if (params.freeMode) {\n suffixes.push('free-mode');\n }\n\n if (params.autoHeight) {\n suffixes.push('autoheight');\n }\n\n if (rtl) {\n suffixes.push('rtl');\n }\n\n if (params.slidesPerColumn > 1) {\n suffixes.push('multirow');\n\n if (params.slidesPerColumnFill === 'column') {\n suffixes.push('multirow-column');\n }\n }\n\n if (device.android) {\n suffixes.push('android');\n }\n\n if (device.ios) {\n suffixes.push('ios');\n }\n\n if (params.cssMode) {\n suffixes.push('css-mode');\n }\n\n suffixes.forEach(function (suffix) {\n classNames.push(params.containerModifierClass + suffix);\n });\n $el.addClass(classNames.join(' '));\n swiper.emitContainerClasses();\n}","export default function removeClasses() {\n var swiper = this;\n var $el = swiper.$el,\n classNames = swiper.classNames;\n $el.removeClass(classNames.join(' '));\n swiper.emitContainerClasses();\n}","import loadImage from './loadImage';\nimport preloadImages from './preloadImages';\nexport default {\n loadImage: loadImage,\n preloadImages: preloadImages\n};","import { getWindow } from 'ssr-window';\nimport $ from '../../../utils/dom';\nexport default function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {\n var window = getWindow();\n var image;\n\n function onReady() {\n if (callback) callback();\n }\n\n var isPicture = $(imageEl).parent('picture')[0];\n\n if (!isPicture && (!imageEl.complete || !checkForComplete)) {\n if (src) {\n image = new window.Image();\n image.onload = onReady;\n image.onerror = onReady;\n\n if (sizes) {\n image.sizes = sizes;\n }\n\n if (srcset) {\n image.srcset = srcset;\n }\n\n if (src) {\n image.src = src;\n }\n } else {\n onReady();\n }\n } else {\n // image already loaded...\n onReady();\n }\n}","export default function preloadImages() {\n var swiper = this;\n swiper.imagesToLoad = swiper.$el.find('img');\n\n function onReady() {\n if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;\n if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;\n\n if (swiper.imagesLoaded === swiper.imagesToLoad.length) {\n if (swiper.params.updateOnImagesReady) swiper.update();\n swiper.emit('imagesReady');\n }\n }\n\n for (var i = 0; i < swiper.imagesToLoad.length; i += 1) {\n var imageEl = swiper.imagesToLoad[i];\n swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);\n }\n}","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport $ from '../../utils/dom';\nimport { extend, bindModuleMethods } from '../../utils/utils';\nvar Navigation = {\n update: function update() {\n // Update Navigation Buttons\n var swiper = this;\n var params = swiper.params.navigation;\n if (swiper.params.loop) return;\n var _swiper$navigation = swiper.navigation,\n $nextEl = _swiper$navigation.$nextEl,\n $prevEl = _swiper$navigation.$prevEl;\n\n if ($prevEl && $prevEl.length > 0) {\n if (swiper.isBeginning) {\n $prevEl.addClass(params.disabledClass);\n } else {\n $prevEl.removeClass(params.disabledClass);\n }\n\n $prevEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n }\n\n if ($nextEl && $nextEl.length > 0) {\n if (swiper.isEnd) {\n $nextEl.addClass(params.disabledClass);\n } else {\n $nextEl.removeClass(params.disabledClass);\n }\n\n $nextEl[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n }\n },\n onPrevClick: function onPrevClick(e) {\n var swiper = this;\n e.preventDefault();\n if (swiper.isBeginning && !swiper.params.loop) return;\n swiper.slidePrev();\n },\n onNextClick: function onNextClick(e) {\n var swiper = this;\n e.preventDefault();\n if (swiper.isEnd && !swiper.params.loop) return;\n swiper.slideNext();\n },\n init: function init() {\n var swiper = this;\n var params = swiper.params.navigation;\n if (!(params.nextEl || params.prevEl)) return;\n var $nextEl;\n var $prevEl;\n\n if (params.nextEl) {\n $nextEl = $(params.nextEl);\n\n if (swiper.params.uniqueNavElements && typeof params.nextEl === 'string' && $nextEl.length > 1 && swiper.$el.find(params.nextEl).length === 1) {\n $nextEl = swiper.$el.find(params.nextEl);\n }\n }\n\n if (params.prevEl) {\n $prevEl = $(params.prevEl);\n\n if (swiper.params.uniqueNavElements && typeof params.prevEl === 'string' && $prevEl.length > 1 && swiper.$el.find(params.prevEl).length === 1) {\n $prevEl = swiper.$el.find(params.prevEl);\n }\n }\n\n if ($nextEl && $nextEl.length > 0) {\n $nextEl.on('click', swiper.navigation.onNextClick);\n }\n\n if ($prevEl && $prevEl.length > 0) {\n $prevEl.on('click', swiper.navigation.onPrevClick);\n }\n\n extend(swiper.navigation, {\n $nextEl: $nextEl,\n nextEl: $nextEl && $nextEl[0],\n $prevEl: $prevEl,\n prevEl: $prevEl && $prevEl[0]\n });\n },\n destroy: function destroy() {\n var swiper = this;\n var _swiper$navigation2 = swiper.navigation,\n $nextEl = _swiper$navigation2.$nextEl,\n $prevEl = _swiper$navigation2.$prevEl;\n\n if ($nextEl && $nextEl.length) {\n $nextEl.off('click', swiper.navigation.onNextClick);\n $nextEl.removeClass(swiper.params.navigation.disabledClass);\n }\n\n if ($prevEl && $prevEl.length) {\n $prevEl.off('click', swiper.navigation.onPrevClick);\n $prevEl.removeClass(swiper.params.navigation.disabledClass);\n }\n }\n};\nexport default {\n name: 'navigation',\n params: {\n navigation: {\n nextEl: null,\n prevEl: null,\n hideOnClick: false,\n disabledClass: 'swiper-button-disabled',\n hiddenClass: 'swiper-button-hidden',\n lockClass: 'swiper-button-lock'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n navigation: _extends({}, Navigation)\n });\n },\n on: {\n init: function init(swiper) {\n swiper.navigation.init();\n swiper.navigation.update();\n },\n toEdge: function toEdge(swiper) {\n swiper.navigation.update();\n },\n fromEdge: function fromEdge(swiper) {\n swiper.navigation.update();\n },\n destroy: function destroy(swiper) {\n swiper.navigation.destroy();\n },\n click: function click(swiper, e) {\n var _swiper$navigation3 = swiper.navigation,\n $nextEl = _swiper$navigation3.$nextEl,\n $prevEl = _swiper$navigation3.$prevEl;\n\n if (swiper.params.navigation.hideOnClick && !$(e.target).is($prevEl) && !$(e.target).is($nextEl)) {\n var isHidden;\n\n if ($nextEl) {\n isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);\n } else if ($prevEl) {\n isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);\n }\n\n if (isHidden === true) {\n swiper.emit('navigationShow');\n } else {\n swiper.emit('navigationHide');\n }\n\n if ($nextEl) {\n $nextEl.toggleClass(swiper.params.navigation.hiddenClass);\n }\n\n if ($prevEl) {\n $prevEl.toggleClass(swiper.params.navigation.hiddenClass);\n }\n }\n }\n }\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport $ from '../../utils/dom';\nimport { extend, bindModuleMethods } from '../../utils/utils';\nvar Pagination = {\n update: function update() {\n // Render || Update Pagination bullets/items\n var swiper = this;\n var rtl = swiper.rtl;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n var $el = swiper.pagination.$el; // Current/Total\n\n var current;\n var total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n\n if (swiper.params.loop) {\n current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);\n\n if (current > slidesLength - 1 - swiper.loopedSlides * 2) {\n current -= slidesLength - swiper.loopedSlides * 2;\n }\n\n if (current > total - 1) current -= total;\n if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current;\n } else if (typeof swiper.snapIndex !== 'undefined') {\n current = swiper.snapIndex;\n } else {\n current = swiper.activeIndex || 0;\n } // Types\n\n\n if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {\n var bullets = swiper.pagination.bullets;\n var firstIndex;\n var lastIndex;\n var midIndex;\n\n if (params.dynamicBullets) {\n swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);\n $el.css(swiper.isHorizontal() ? 'width' : 'height', swiper.pagination.bulletSize * (params.dynamicMainBullets + 4) + \"px\");\n\n if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {\n swiper.pagination.dynamicBulletIndex += current - swiper.previousIndex;\n\n if (swiper.pagination.dynamicBulletIndex > params.dynamicMainBullets - 1) {\n swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;\n } else if (swiper.pagination.dynamicBulletIndex < 0) {\n swiper.pagination.dynamicBulletIndex = 0;\n }\n }\n\n firstIndex = current - swiper.pagination.dynamicBulletIndex;\n lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);\n midIndex = (lastIndex + firstIndex) / 2;\n }\n\n bullets.removeClass(params.bulletActiveClass + \" \" + params.bulletActiveClass + \"-next \" + params.bulletActiveClass + \"-next-next \" + params.bulletActiveClass + \"-prev \" + params.bulletActiveClass + \"-prev-prev \" + params.bulletActiveClass + \"-main\");\n\n if ($el.length > 1) {\n bullets.each(function (bullet) {\n var $bullet = $(bullet);\n var bulletIndex = $bullet.index();\n\n if (bulletIndex === current) {\n $bullet.addClass(params.bulletActiveClass);\n }\n\n if (params.dynamicBullets) {\n if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {\n $bullet.addClass(params.bulletActiveClass + \"-main\");\n }\n\n if (bulletIndex === firstIndex) {\n $bullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n }\n\n if (bulletIndex === lastIndex) {\n $bullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n }\n });\n } else {\n var $bullet = bullets.eq(current);\n var bulletIndex = $bullet.index();\n $bullet.addClass(params.bulletActiveClass);\n\n if (params.dynamicBullets) {\n var $firstDisplayedBullet = bullets.eq(firstIndex);\n var $lastDisplayedBullet = bullets.eq(lastIndex);\n\n for (var i = firstIndex; i <= lastIndex; i += 1) {\n bullets.eq(i).addClass(params.bulletActiveClass + \"-main\");\n }\n\n if (swiper.params.loop) {\n if (bulletIndex >= bullets.length - params.dynamicMainBullets) {\n for (var _i = params.dynamicMainBullets; _i >= 0; _i -= 1) {\n bullets.eq(bullets.length - _i).addClass(params.bulletActiveClass + \"-main\");\n }\n\n bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(params.bulletActiveClass + \"-prev\");\n } else {\n $firstDisplayedBullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n $lastDisplayedBullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n } else {\n $firstDisplayedBullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n $lastDisplayedBullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n }\n }\n\n if (params.dynamicBullets) {\n var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);\n var bulletsOffset = (swiper.pagination.bulletSize * dynamicBulletsLength - swiper.pagination.bulletSize) / 2 - midIndex * swiper.pagination.bulletSize;\n var offsetProp = rtl ? 'right' : 'left';\n bullets.css(swiper.isHorizontal() ? offsetProp : 'top', bulletsOffset + \"px\");\n }\n }\n\n if (params.type === 'fraction') {\n $el.find(\".\" + params.currentClass).text(params.formatFractionCurrent(current + 1));\n $el.find(\".\" + params.totalClass).text(params.formatFractionTotal(total));\n }\n\n if (params.type === 'progressbar') {\n var progressbarDirection;\n\n if (params.progressbarOpposite) {\n progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';\n } else {\n progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';\n }\n\n var scale = (current + 1) / total;\n var scaleX = 1;\n var scaleY = 1;\n\n if (progressbarDirection === 'horizontal') {\n scaleX = scale;\n } else {\n scaleY = scale;\n }\n\n $el.find(\".\" + params.progressbarFillClass).transform(\"translate3d(0,0,0) scaleX(\" + scaleX + \") scaleY(\" + scaleY + \")\").transition(swiper.params.speed);\n }\n\n if (params.type === 'custom' && params.renderCustom) {\n $el.html(params.renderCustom(swiper, current + 1, total));\n swiper.emit('paginationRender', $el[0]);\n } else {\n swiper.emit('paginationUpdate', $el[0]);\n }\n\n $el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n },\n render: function render() {\n // Render Container\n var swiper = this;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n var $el = swiper.pagination.$el;\n var paginationHTML = '';\n\n if (params.type === 'bullets') {\n var numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n\n for (var i = 0; i < numberOfBullets; i += 1) {\n if (params.renderBullet) {\n paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);\n } else {\n paginationHTML += \"<\" + params.bulletElement + \" class=\\\"\" + params.bulletClass + \"\\\">\";\n }\n }\n\n $el.html(paginationHTML);\n swiper.pagination.bullets = $el.find(\".\" + params.bulletClass);\n }\n\n if (params.type === 'fraction') {\n if (params.renderFraction) {\n paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);\n } else {\n paginationHTML = \"\" + ' / ' + (\"\");\n }\n\n $el.html(paginationHTML);\n }\n\n if (params.type === 'progressbar') {\n if (params.renderProgressbar) {\n paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);\n } else {\n paginationHTML = \"\";\n }\n\n $el.html(paginationHTML);\n }\n\n if (params.type !== 'custom') {\n swiper.emit('paginationRender', swiper.pagination.$el[0]);\n }\n },\n init: function init() {\n var swiper = this;\n var params = swiper.params.pagination;\n if (!params.el) return;\n var $el = $(params.el);\n if ($el.length === 0) return;\n\n if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) {\n $el = swiper.$el.find(params.el);\n }\n\n if (params.type === 'bullets' && params.clickable) {\n $el.addClass(params.clickableClass);\n }\n\n $el.addClass(params.modifierClass + params.type);\n\n if (params.type === 'bullets' && params.dynamicBullets) {\n $el.addClass(\"\" + params.modifierClass + params.type + \"-dynamic\");\n swiper.pagination.dynamicBulletIndex = 0;\n\n if (params.dynamicMainBullets < 1) {\n params.dynamicMainBullets = 1;\n }\n }\n\n if (params.type === 'progressbar' && params.progressbarOpposite) {\n $el.addClass(params.progressbarOppositeClass);\n }\n\n if (params.clickable) {\n $el.on('click', \".\" + params.bulletClass, function onClick(e) {\n e.preventDefault();\n var index = $(this).index() * swiper.params.slidesPerGroup;\n if (swiper.params.loop) index += swiper.loopedSlides;\n swiper.slideTo(index);\n });\n }\n\n extend(swiper.pagination, {\n $el: $el,\n el: $el[0]\n });\n },\n destroy: function destroy() {\n var swiper = this;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var $el = swiper.pagination.$el;\n $el.removeClass(params.hiddenClass);\n $el.removeClass(params.modifierClass + params.type);\n if (swiper.pagination.bullets) swiper.pagination.bullets.removeClass(params.bulletActiveClass);\n\n if (params.clickable) {\n $el.off('click', \".\" + params.bulletClass);\n }\n }\n};\nexport default {\n name: 'pagination',\n params: {\n pagination: {\n el: null,\n bulletElement: 'span',\n clickable: false,\n hideOnClick: false,\n renderBullet: null,\n renderProgressbar: null,\n renderFraction: null,\n renderCustom: null,\n progressbarOpposite: false,\n type: 'bullets',\n // 'bullets' or 'progressbar' or 'fraction' or 'custom'\n dynamicBullets: false,\n dynamicMainBullets: 1,\n formatFractionCurrent: function formatFractionCurrent(number) {\n return number;\n },\n formatFractionTotal: function formatFractionTotal(number) {\n return number;\n },\n bulletClass: 'swiper-pagination-bullet',\n bulletActiveClass: 'swiper-pagination-bullet-active',\n modifierClass: 'swiper-pagination-',\n // NEW\n currentClass: 'swiper-pagination-current',\n totalClass: 'swiper-pagination-total',\n hiddenClass: 'swiper-pagination-hidden',\n progressbarFillClass: 'swiper-pagination-progressbar-fill',\n progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',\n clickableClass: 'swiper-pagination-clickable',\n // NEW\n lockClass: 'swiper-pagination-lock'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n pagination: _extends({\n dynamicBulletIndex: 0\n }, Pagination)\n });\n },\n on: {\n init: function init(swiper) {\n swiper.pagination.init();\n swiper.pagination.render();\n swiper.pagination.update();\n },\n activeIndexChange: function activeIndexChange(swiper) {\n if (swiper.params.loop) {\n swiper.pagination.update();\n } else if (typeof swiper.snapIndex === 'undefined') {\n swiper.pagination.update();\n }\n },\n snapIndexChange: function snapIndexChange(swiper) {\n if (!swiper.params.loop) {\n swiper.pagination.update();\n }\n },\n slidesLengthChange: function slidesLengthChange(swiper) {\n if (swiper.params.loop) {\n swiper.pagination.render();\n swiper.pagination.update();\n }\n },\n snapGridLengthChange: function snapGridLengthChange(swiper) {\n if (!swiper.params.loop) {\n swiper.pagination.render();\n swiper.pagination.update();\n }\n },\n destroy: function destroy(swiper) {\n swiper.pagination.destroy();\n },\n click: function click(swiper, e) {\n if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && swiper.pagination.$el.length > 0 && !$(e.target).hasClass(swiper.params.pagination.bulletClass)) {\n var isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);\n\n if (isHidden === true) {\n swiper.emit('paginationShow');\n } else {\n swiper.emit('paginationHide');\n }\n\n swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);\n }\n }\n }\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\n/* eslint no-underscore-dangle: \"off\" */\nimport { getDocument } from 'ssr-window';\nimport { nextTick, bindModuleMethods } from '../../utils/utils';\nvar Autoplay = {\n run: function run() {\n var swiper = this;\n var $activeSlideEl = swiper.slides.eq(swiper.activeIndex);\n var delay = swiper.params.autoplay.delay;\n\n if ($activeSlideEl.attr('data-swiper-autoplay')) {\n delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;\n }\n\n clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.timeout = nextTick(function () {\n var autoplayResult;\n\n if (swiper.params.autoplay.reverseDirection) {\n if (swiper.params.loop) {\n swiper.loopFix();\n autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.isBeginning) {\n autoplayResult = swiper.slidePrev(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n autoplayResult = swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else {\n swiper.autoplay.stop();\n }\n } else if (swiper.params.loop) {\n swiper.loopFix();\n autoplayResult = swiper.slideNext(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.isEnd) {\n autoplayResult = swiper.slideNext(swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else if (!swiper.params.autoplay.stopOnLastSlide) {\n autoplayResult = swiper.slideTo(0, swiper.params.speed, true, true);\n swiper.emit('autoplay');\n } else {\n swiper.autoplay.stop();\n }\n\n if (swiper.params.cssMode && swiper.autoplay.running) swiper.autoplay.run();else if (autoplayResult === false) {\n swiper.autoplay.run();\n }\n }, delay);\n },\n start: function start() {\n var swiper = this;\n if (typeof swiper.autoplay.timeout !== 'undefined') return false;\n if (swiper.autoplay.running) return false;\n swiper.autoplay.running = true;\n swiper.emit('autoplayStart');\n swiper.autoplay.run();\n return true;\n },\n stop: function stop() {\n var swiper = this;\n if (!swiper.autoplay.running) return false;\n if (typeof swiper.autoplay.timeout === 'undefined') return false;\n\n if (swiper.autoplay.timeout) {\n clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.timeout = undefined;\n }\n\n swiper.autoplay.running = false;\n swiper.emit('autoplayStop');\n return true;\n },\n pause: function pause(speed) {\n var swiper = this;\n if (!swiper.autoplay.running) return;\n if (swiper.autoplay.paused) return;\n if (swiper.autoplay.timeout) clearTimeout(swiper.autoplay.timeout);\n swiper.autoplay.paused = true;\n\n if (speed === 0 || !swiper.params.autoplay.waitForTransition) {\n swiper.autoplay.paused = false;\n swiper.autoplay.run();\n } else {\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.autoplay.onTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);\n }\n },\n onVisibilityChange: function onVisibilityChange() {\n var swiper = this;\n var document = getDocument();\n\n if (document.visibilityState === 'hidden' && swiper.autoplay.running) {\n swiper.autoplay.pause();\n }\n\n if (document.visibilityState === 'visible' && swiper.autoplay.paused) {\n swiper.autoplay.run();\n swiper.autoplay.paused = false;\n }\n },\n onTransitionEnd: function onTransitionEnd(e) {\n var swiper = this;\n if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;\n if (e.target !== swiper.$wrapperEl[0]) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.autoplay.onTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);\n swiper.autoplay.paused = false;\n\n if (!swiper.autoplay.running) {\n swiper.autoplay.stop();\n } else {\n swiper.autoplay.run();\n }\n }\n};\nexport default {\n name: 'autoplay',\n params: {\n autoplay: {\n enabled: false,\n delay: 3000,\n waitForTransition: true,\n disableOnInteraction: true,\n stopOnLastSlide: false,\n reverseDirection: false\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n autoplay: _extends(_extends({}, Autoplay), {}, {\n running: false,\n paused: false\n })\n });\n },\n on: {\n init: function init(swiper) {\n if (swiper.params.autoplay.enabled) {\n swiper.autoplay.start();\n var document = getDocument();\n document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);\n }\n },\n beforeTransitionStart: function beforeTransitionStart(swiper, speed, internal) {\n if (swiper.autoplay.running) {\n if (internal || !swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.pause(speed);\n } else {\n swiper.autoplay.stop();\n }\n }\n },\n sliderFirstMove: function sliderFirstMove(swiper) {\n if (swiper.autoplay.running) {\n if (swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.stop();\n } else {\n swiper.autoplay.pause();\n }\n }\n },\n touchEnd: function touchEnd(swiper) {\n if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {\n swiper.autoplay.run();\n }\n },\n destroy: function destroy(swiper) {\n if (swiper.autoplay.running) {\n swiper.autoplay.stop();\n }\n\n var document = getDocument();\n document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);\n }\n }\n};","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport 'mdn-polyfills/Number.isNaN';\nimport Swiper, { Pagination, Autoplay } from 'swiper';\n\nexport default class Carousel {\n constructor(element) {\n this.element = element;\n this.slides = this.element.querySelectorAll('[data-carousel-slide]');\n this.swiperElement = this.element.querySelector('[data-carousel-swiper]');\n this.pagination = this.element.querySelector('[data-carousel-pagination]');\n this.settings = {\n autoplay: { delay: 4000 },\n pagination: {\n el: this.pagination,\n clickable: true,\n renderBullet: function (index, className) {\n return ``;\n },\n },\n slidesPerView: 'auto',\n };\n this.swiper;\n this.panels;\n\n this.handleMouseEnter = this.handleMouseEnter.bind(this);\n this.handleMouseLeave = this.handleMouseLeave.bind(this);\n }\n\n handleMouseEnter() {\n this.swiper.autoplay.stop();\n }\n\n handleMouseLeave() {\n this.swiper.autoplay.start();\n }\n\n mount() {\n Swiper.use([Pagination, Autoplay]);\n this.swiper = new Swiper(this.swiperElement, this.settings);\n this.panels = this.element.querySelectorAll('[data-carousel-panel]');\n\n this.panels.forEach((panel) => {\n panel.addEventListener('mouseenter', this.handleMouseEnter);\n panel.addEventListener('mouseleave', this.handleMouseLeave);\n });\n }\n\n unmount() {\n this.panels.forEach((panel) => {\n panel.removeEventListener('mouseenter', this.handleMouseEnter);\n panel.removeEventListener('mouseleave', this.handleMouseLeave);\n });\n\n this.panels = null;\n\n this.destroy(this.swiper, true);\n }\n}\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport Carousel from './Carousel';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const carousels = document.querySelectorAll('[data-carousel]');\n if (!carousels.length) {\n return;\n }\n carousels.forEach((element) => {\n const carousel = new Carousel(element);\n\n if (carousel.slides.length > 1) {\n carousel.mount();\n }\n });\n});\n","import 'mdn-polyfills/NodeList.prototype.forEach';\n\n/**\n * Accordion Element based on WAI-ARIA Practices\n * https://www.w3.org/TR/wai-aria-practices-1.1/examples/accordion/accordion.html\n */\n\nexport default class Accordion {\n constructor(element) {\n this.element = element;\n this.controls = this.element.querySelectorAll('[data-accordion-control]');\n this.current = null;\n\n this.handleSummaryClick = this.handleSummaryClick.bind(this);\n this.handleSummaryKeydown = this.handleSummaryKeydown.bind(this);\n }\n\n /**\n * @param {HTMLElement} control\n */\n deactivate(control) {\n const id = control.dataset.accordionControl;\n const target = document.getElementById(id);\n control.setAttribute('aria-expanded', 'false');\n control.removeAttribute('aria-disabled');\n target.setAttribute('hidden', '');\n this.current = null;\n }\n\n /**\n * @param {HTMLElement} control\n */\n activate(control) {\n const id = control.dataset.accordionControl;\n const target = document.getElementById(id);\n control.setAttribute('aria-expanded', 'true');\n control.setAttribute('aria-disabled', '');\n target.removeAttribute('hidden');\n this.current = control;\n }\n\n handleSummaryClick(e) {\n e.preventDefault();\n\n if (this.current === e.currentTarget) {\n this.deactivate(this.current);\n } else {\n if (e.currentTarget.getAttribute('aria-disabled') === null) {\n if (this.current) {\n this.deactivate(this.current);\n }\n this.activate(e.currentTarget);\n }\n }\n }\n\n handleSummaryKeydown(e) {\n let index = null;\n\n if (e.key === 'ArrowDown' || e.key === 'Down') {\n e.preventDefault();\n // eslint-disable-next-line max-len\n index = (e.currentTarget === this.controls[this.controls.length - 1]) ? 0 : Array.prototype.indexOf.call(this.controls, e.currentTarget) + 1;\n } else if (e.key === 'ArrowUp' || e.key === 'Up') {\n e.preventDefault();\n // eslint-disable-next-line max-len\n index = (e.currentTarget === this.controls[0]) ? this.controls.length - 1 : Array.prototype.indexOf.call(this.controls, e.currentTarget) - 1;\n } else if (e.key === 'Home') {\n index = 0;\n } else if (e.key === 'End') {\n index = this.controls.length - 1;\n }\n\n if (index !== null) {\n e.preventDefault();\n this.deactivate(e.currentTarget);\n this.activate(this.controls[index]);\n this.current.focus();\n }\n }\n\n mount() {\n this.controls.forEach((control) => {\n const id = control.getAttribute('data-accordion-control');\n const target = document.getElementById(id);\n\n control.setAttribute('id', `control-${id}`);\n control.setAttribute('aria-controls', id);\n control.setAttribute('aria-expanded', 'false');\n target.setAttribute('role', 'region');\n target.setAttribute('aria-labelledby', `control-${id}`);\n target.setAttribute('hidden', '');\n\n control.addEventListener('click', this.handleSummaryClick);\n control.addEventListener('keydown', this.handleSummaryKeydown);\n });\n }\n\n unmount() {\n this.element.removeAttribute('role');\n\n this.controls.forEach((control) => {\n const id = control.getAttribute('data-accordion-control');\n const target = document.getElementById(id);\n\n control.removeAttribute('id');\n control.removeAttribute('aria-controls');\n control.removeAttribute('aria-expanded');\n control.removeAttribute('aria-disabled');\n target.removeAttribute('role');\n target.removeAttribute('aria-labelledby');\n target.removeAttribute('hidden');\n\n control.removeEventListener('click', this.handleSummaryClick);\n control.removeEventListener('keydown', this.handleSummaryKeydown);\n });\n\n this.current = null;\n }\n}\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport Accordion from './Accordion';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const accordions = document.querySelectorAll('[data-accordion]');\n if (!accordions.length) {\n return;\n }\n accordions.forEach((element) => {\n const accordion = new Accordion(element);\n accordion.mount();\n });\n});\n","import 'mdn-polyfills/NodeList.prototype.forEach';\n\n/**\n * Tablist Element based on WAI-ARIA Practices\n * https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html\n */\n\nexport default class Tablist {\n constructor(element) {\n this.element = element;\n this.tabs = element.querySelectorAll('[data-tablist-target]');\n this.current = null;\n\n this.handleTabClick = this.handleTabClick.bind(this);\n this.handleTabKeyup = this.handleTabKeyup.bind(this);\n this.handleTabKeydown = this.handleTabKeydown.bind(this);\n }\n\n /**\n * @param {HTMLElement} tab\n */\n deactivate(tab) {\n const id = tab.getAttribute('aria-controls');\n const tabpanel = document.getElementById(id);\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n tabpanel.setAttribute('hidden', 'hidden');\n this.current = null;\n }\n\n /**\n * @param {HTMLElement} tab\n */\n activate(tab) {\n const id = tab.getAttribute('aria-controls');\n const tabpanel = document.getElementById(id);\n tab.setAttribute('aria-selected', 'true');\n tab.setAttribute('tabindex', '0');\n tabpanel.removeAttribute('hidden');\n this.current = tab;\n }\n\n handleTabClick(e) {\n e.preventDefault();\n this.deactivate(this.current);\n this.activate(e.currentTarget);\n }\n\n handleTabKeyup(e) {\n let index = null;\n\n if (e.key === 'ArrowRight' || e.key === 'Right') {\n e.preventDefault();\n index = (e.currentTarget === this.tabs[this.tabs.length - 1]) ? 0 : Array.prototype.indexOf.call(this.tabs, e.currentTarget) + 1;\n } else if (e.key === 'ArrowLeft' || e.key === 'Left') {\n e.preventDefault();\n index = (e.currentTarget === this.tabs[0]) ? this.tabs.length - 1 : Array.prototype.indexOf.call(this.tabs, e.currentTarget) - 1;\n }\n\n if (index !== null) {\n this.deactivate(e.currentTarget);\n this.activate(this.tabs[index]);\n this.current.focus();\n }\n }\n\n handleTabKeydown(e) {\n let index = null;\n\n if (e.key === 'Home') {\n index = 0;\n } else if (e.key === 'End') {\n index = this.tabs.length - 1;\n }\n\n if (index !== null) {\n e.preventDefault();\n this.deactivate(e.currentTarget);\n this.activate(this.tabs[index]);\n this.current.focus();\n }\n }\n\n mount() {\n this.current = this.tabs['0'];\n this.element.setAttribute('role', 'tablist');\n\n this.tabs.forEach((tab) => {\n const id = tab.getAttribute('data-tablist-target');\n const tabpanel = document.getElementById(id);\n\n if (tab.getAttribute('aria-selected') === 'true') {\n this.current = tab;\n }\n\n tab.setAttribute('id', `tab-${id}`);\n tab.setAttribute('role', 'tab');\n tab.setAttribute('aria-selected', 'false');\n tab.setAttribute('tabindex', '-1');\n tab.setAttribute('aria-controls', id);\n tabpanel.setAttribute('role', 'tabpanel');\n tabpanel.setAttribute('aria-labelledby', `tab-${id}`);\n tabpanel.setAttribute('hidden', 'hidden');\n tabpanel.setAttribute('tabindex', '0');\n\n tab.addEventListener('click', this.handleTabClick);\n tab.addEventListener('keyup', this.handleTabKeyup);\n tab.addEventListener('keydown', this.handleTabKeydown);\n });\n\n this.activate(this.current);\n this.element.classList.add('is-mounted');\n }\n\n unmount() {\n this.element.removeAttribute('role');\n\n this.tabs.forEach((tab) => {\n const id = tab.getAttribute('data-tablist-target');\n const tabpanel = document.getElementById(id);\n\n tab.removeAttribute('id');\n tab.removeAttribute('role');\n tab.removeAttribute('aria-selected');\n tab.removeAttribute('tabindex');\n tab.removeAttribute('aria-controls');\n tabpanel.removeAttribute('role');\n tabpanel.removeAttribute('aria-labelledby');\n tabpanel.removeAttribute('hidden');\n tabpanel.removeAttribute('tabindex');\n\n tab.removeEventListener('click', this.handleTabClick);\n tab.removeEventListener('keyup', this.handleTabKeyup);\n tab.removeEventListener('keydown', this.handleTabKeydown);\n });\n\n this.current = null;\n this.element.classList.remove('is-mounted');\n }\n}\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport Tablist from './Tablist';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const tablists = document.querySelectorAll('[data-tablist]');\n if (!tablists.length) {\n return;\n }\n tablists.forEach((element) => {\n const tablist = new Tablist(element);\n tablist.mount();\n });\n});\n","!function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent(\"CustomEvent\");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}\"function\"!=typeof window.CustomEvent&&(t.prototype=window.Event.prototype,window.CustomEvent=t)}();\n","import 'mdn-polyfills/CustomEvent';\nimport 'mdn-polyfills/NodeList.prototype.forEach';\nimport Toggler from '../toggler/Toggler';\n\nexport default class Filter {\n constructor(element) {\n this.element = element;\n this.control = this.element.querySelector('[data-filter-control]');\n this.target = document.getElementById(this.control.dataset.filterControl);\n this.toggler = new Toggler(this.control, this.target, true);\n this.inputs = this.target.querySelectorAll('[data-filter-input]');\n this.clear = this.element.querySelector('[data-filter-clear]');\n this.count = this.control.dataset.filterControl ? parseInt(this.control.dataset.filterControl) : 0;\n\n this.handleClear = this.handleClear.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(e) {\n this.updateCount();\n }\n\n handleClear() {\n this.inputs.forEach((input) => {\n input.checked = false;\n });\n this.updateCount();\n }\n\n updateCount() {\n this.count = 0;\n\n this.inputs.forEach((input) => {\n if (input.checked) {\n this.count += 1;\n }\n });\n\n this.control.dataset.filterCount = this.count;\n }\n\n mount() {\n this.toggler.mount();\n\n this.inputs.forEach((input) => {\n input.addEventListener('change', this.handleChange);\n });\n\n if (this.clear) {\n this.clear.addEventListener('click', this.handleClear);\n }\n }\n\n unmount() {\n this.toggler.unmount();\n\n this.inputs.forEach((input) => {\n input.removeEventListener('change', this.handleChange);\n });\n\n if (this.clear) {\n this.clear.removeEventListener('click', this.handleClear);\n }\n }\n}\n","import 'mdn-polyfills/NodeList.prototype.forEach';\nimport Filter from './Filter';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n const filters = document.querySelectorAll('[data-filter]');\n if (!filters.length) {\n return;\n }\n filters.forEach((element) => {\n const filter = new Filter(element);\n filter.mount();\n });\n});\n","/*\n * File: iframeResizer.js\n * Desc: Force iframes to size to content.\n * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.\n * Doc: https://github.com/davidjbradshaw/iframe-resizer\n * Author: David J. Bradshaw - dave@bradshaw.net\n * Contributor: Jure Mav - jure.mav@gmail.com\n * Contributor: Reed Dadoune - reed@dadoune.com\n */\n\n// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names\n;(function (undefined) {\n if (typeof window === 'undefined') return // don't run for server side render\n\n var count = 0,\n logEnabled = false,\n hiddenCheckEnabled = false,\n msgHeader = 'message',\n msgHeaderLen = msgHeader.length,\n msgId = '[iFrameSizer]', // Must match iframe msg ID\n msgIdLen = msgId.length,\n pagePosition = null,\n requestAnimationFrame = window.requestAnimationFrame,\n resetRequiredMethods = {\n max: 1,\n scroll: 1,\n bodyScroll: 1,\n documentElementScroll: 1\n },\n settings = {},\n timer = null,\n defaults = {\n autoResize: true,\n bodyBackground: null,\n bodyMargin: null,\n bodyMarginV1: 8,\n bodyPadding: null,\n checkOrigin: true,\n inPageLinks: false,\n enablePublicMethods: true,\n heightCalculationMethod: 'bodyOffset',\n id: 'iFrameResizer',\n interval: 32,\n log: false,\n maxHeight: Infinity,\n maxWidth: Infinity,\n minHeight: 0,\n minWidth: 0,\n resizeFrom: 'parent',\n scrolling: false,\n sizeHeight: true,\n sizeWidth: false,\n warningTimeout: 5000,\n tolerance: 0,\n widthCalculationMethod: 'scroll',\n onClose: function () {\n return true\n },\n onClosed: function () {},\n onInit: function () {},\n onMessage: function () {\n warn('onMessage function not defined')\n },\n onResized: function () {},\n onScroll: function () {\n return true\n }\n }\n\n function getMutationObserver() {\n return (\n window.MutationObserver ||\n window.WebKitMutationObserver ||\n window.MozMutationObserver\n )\n }\n\n function addEventListener(el, evt, func) {\n el.addEventListener(evt, func, false)\n }\n\n function removeEventListener(el, evt, func) {\n el.removeEventListener(evt, func, false)\n }\n\n function setupRequestAnimationFrame() {\n var vendors = ['moz', 'webkit', 'o', 'ms']\n var x\n\n // Remove vendor prefixing if prefixed and break early if not\n for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {\n requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']\n }\n\n if (!requestAnimationFrame) {\n log('setup', 'RequestAnimationFrame not supported')\n } else {\n // Firefox extension content-scripts have a globalThis object that is not the same as window.\n // Binding `requestAnimationFrame` to window allows the function to work and prevents errors\n // being thrown when run in that context, and should be a no-op in every other context.\n requestAnimationFrame = requestAnimationFrame.bind(window)\n }\n }\n\n function getMyID(iframeId) {\n var retStr = 'Host page: ' + iframeId\n\n if (window.top !== window.self) {\n if (window.parentIFrame && window.parentIFrame.getId) {\n retStr = window.parentIFrame.getId() + ': ' + iframeId\n } else {\n retStr = 'Nested host page: ' + iframeId\n }\n }\n\n return retStr\n }\n\n function formatLogHeader(iframeId) {\n return msgId + '[' + getMyID(iframeId) + ']'\n }\n\n function isLogEnabled(iframeId) {\n return settings[iframeId] ? settings[iframeId].log : logEnabled\n }\n\n function log(iframeId, msg) {\n output('log', iframeId, msg, isLogEnabled(iframeId))\n }\n\n function info(iframeId, msg) {\n output('info', iframeId, msg, isLogEnabled(iframeId))\n }\n\n function warn(iframeId, msg) {\n output('warn', iframeId, msg, true)\n }\n\n function output(type, iframeId, msg, enabled) {\n if (true === enabled && 'object' === typeof window.console) {\n // eslint-disable-next-line no-console\n console[type](formatLogHeader(iframeId), msg)\n }\n }\n\n function iFrameListener(event) {\n function resizeIFrame() {\n function resize() {\n setSize(messageData)\n setPagePosition(iframeId)\n on('onResized', messageData)\n }\n\n ensureInRange('Height')\n ensureInRange('Width')\n\n syncResize(resize, messageData, 'init')\n }\n\n function processMsg() {\n var data = msg.substr(msgIdLen).split(':')\n var height = data[1] ? parseInt(data[1], 10) : 0\n var iframe = settings[data[0]] && settings[data[0]].iframe\n var compStyle = getComputedStyle(iframe)\n\n return {\n iframe: iframe,\n id: data[0],\n height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),\n width: data[2],\n type: data[3]\n }\n }\n\n function getPaddingEnds(compStyle) {\n if (compStyle.boxSizing !== 'border-box') {\n return 0\n }\n var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0\n var bot = compStyle.paddingBottom\n ? parseInt(compStyle.paddingBottom, 10)\n : 0\n return top + bot\n }\n\n function getBorderEnds(compStyle) {\n if (compStyle.boxSizing !== 'border-box') {\n return 0\n }\n var top = compStyle.borderTopWidth\n ? parseInt(compStyle.borderTopWidth, 10)\n : 0\n var bot = compStyle.borderBottomWidth\n ? parseInt(compStyle.borderBottomWidth, 10)\n : 0\n return top + bot\n }\n\n function ensureInRange(Dimension) {\n var max = Number(settings[iframeId]['max' + Dimension]),\n min = Number(settings[iframeId]['min' + Dimension]),\n dimension = Dimension.toLowerCase(),\n size = Number(messageData[dimension])\n\n log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max)\n\n if (size < min) {\n size = min\n log(iframeId, 'Set ' + dimension + ' to min value')\n }\n\n if (size > max) {\n size = max\n log(iframeId, 'Set ' + dimension + ' to max value')\n }\n\n messageData[dimension] = '' + size\n }\n\n function isMessageFromIFrame() {\n function checkAllowedOrigin() {\n function checkList() {\n var i = 0,\n retCode = false\n\n log(\n iframeId,\n 'Checking connection is from allowed list of origins: ' +\n checkOrigin\n )\n\n for (; i < checkOrigin.length; i++) {\n if (checkOrigin[i] === origin) {\n retCode = true\n break\n }\n }\n return retCode\n }\n\n function checkSingle() {\n var remoteHost = settings[iframeId] && settings[iframeId].remoteHost\n log(iframeId, 'Checking connection is from: ' + remoteHost)\n return origin === remoteHost\n }\n\n return checkOrigin.constructor === Array ? checkList() : checkSingle()\n }\n\n var origin = event.origin,\n checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin\n\n if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {\n throw new Error(\n 'Unexpected message received from: ' +\n origin +\n ' for ' +\n messageData.iframe.id +\n '. Message was: ' +\n event.data +\n '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'\n )\n }\n\n return true\n }\n\n function isMessageForUs() {\n return (\n msgId === ('' + msg).substr(0, msgIdLen) &&\n msg.substr(msgIdLen).split(':')[0] in settings\n ) // ''+Protects against non-string msg\n }\n\n function isMessageFromMetaParent() {\n // Test if this message is from a parent above us. This is an ugly test, however, updating\n // the message format would break backwards compatibity.\n var retCode = messageData.type in { true: 1, false: 1, undefined: 1 }\n\n if (retCode) {\n log(iframeId, 'Ignoring init message from meta parent page')\n }\n\n return retCode\n }\n\n function getMsgBody(offset) {\n return msg.substr(msg.indexOf(':') + msgHeaderLen + offset)\n }\n\n function forwardMsgFromIFrame(msgBody) {\n log(\n iframeId,\n 'onMessage passed: {iframe: ' +\n messageData.iframe.id +\n ', message: ' +\n msgBody +\n '}'\n )\n on('onMessage', {\n iframe: messageData.iframe,\n message: JSON.parse(msgBody)\n })\n log(iframeId, '--')\n }\n\n function getPageInfo() {\n var bodyPosition = document.body.getBoundingClientRect(),\n iFramePosition = messageData.iframe.getBoundingClientRect()\n\n return JSON.stringify({\n iframeHeight: iFramePosition.height,\n iframeWidth: iFramePosition.width,\n clientHeight: Math.max(\n document.documentElement.clientHeight,\n window.innerHeight || 0\n ),\n clientWidth: Math.max(\n document.documentElement.clientWidth,\n window.innerWidth || 0\n ),\n offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),\n offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),\n scrollTop: window.pageYOffset,\n scrollLeft: window.pageXOffset,\n documentHeight: document.documentElement.clientHeight,\n documentWidth: document.documentElement.clientWidth,\n windowHeight: window.innerHeight,\n windowWidth: window.innerWidth\n })\n }\n\n function sendPageInfoToIframe(iframe, iframeId) {\n function debouncedTrigger() {\n trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId)\n }\n debounceFrameEvents(debouncedTrigger, 32, iframeId)\n }\n\n function startPageInfoMonitor() {\n function setListener(type, func) {\n function sendPageInfo() {\n if (settings[id]) {\n sendPageInfoToIframe(settings[id].iframe, id)\n } else {\n stop()\n }\n }\n\n ;['scroll', 'resize'].forEach(function (evt) {\n log(id, type + evt + ' listener for sendPageInfo')\n func(window, evt, sendPageInfo)\n })\n }\n\n function stop() {\n setListener('Remove ', removeEventListener)\n }\n\n function start() {\n setListener('Add ', addEventListener)\n }\n\n var id = iframeId // Create locally scoped copy of iFrame ID\n\n start()\n\n if (settings[id]) {\n settings[id].stopPageInfo = stop\n }\n }\n\n function stopPageInfoMonitor() {\n if (settings[iframeId] && settings[iframeId].stopPageInfo) {\n settings[iframeId].stopPageInfo()\n delete settings[iframeId].stopPageInfo\n }\n }\n\n function checkIFrameExists() {\n var retBool = true\n\n if (null === messageData.iframe) {\n warn(iframeId, 'IFrame (' + messageData.id + ') not found')\n retBool = false\n }\n return retBool\n }\n\n function getElementPosition(target) {\n var iFramePosition = target.getBoundingClientRect()\n\n getPagePosition(iframeId)\n\n return {\n x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),\n y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))\n }\n }\n\n function scrollRequestFromChild(addOffset) {\n /* istanbul ignore next */ // Not testable in Karma\n function reposition() {\n pagePosition = newPosition\n scrollTo()\n log(iframeId, '--')\n }\n\n function calcOffset() {\n return {\n x: Number(messageData.width) + offset.x,\n y: Number(messageData.height) + offset.y\n }\n }\n\n function scrollParent() {\n if (window.parentIFrame) {\n window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](\n newPosition.x,\n newPosition.y\n )\n } else {\n warn(\n iframeId,\n 'Unable to scroll to requested position, window.parentIFrame not found'\n )\n }\n }\n\n var offset = addOffset\n ? getElementPosition(messageData.iframe)\n : { x: 0, y: 0 },\n newPosition = calcOffset()\n\n log(\n iframeId,\n 'Reposition requested from iFrame (offset x:' +\n offset.x +\n ' y:' +\n offset.y +\n ')'\n )\n\n if (window.top !== window.self) {\n scrollParent()\n } else {\n reposition()\n }\n }\n\n function scrollTo() {\n if (false !== on('onScroll', pagePosition)) {\n setPagePosition(iframeId)\n } else {\n unsetPagePosition()\n }\n }\n\n function findTarget(location) {\n function jumpToTarget() {\n var jumpPosition = getElementPosition(target)\n\n log(\n iframeId,\n 'Moving to in page link (#' +\n hash +\n ') at x: ' +\n jumpPosition.x +\n ' y: ' +\n jumpPosition.y\n )\n pagePosition = {\n x: jumpPosition.x,\n y: jumpPosition.y\n }\n\n scrollTo()\n log(iframeId, '--')\n }\n\n function jumpToParent() {\n if (window.parentIFrame) {\n window.parentIFrame.moveToAnchor(hash)\n } else {\n log(\n iframeId,\n 'In page link #' +\n hash +\n ' not found and window.parentIFrame not found'\n )\n }\n }\n\n var hash = location.split('#')[1] || '',\n hashData = decodeURIComponent(hash),\n target =\n document.getElementById(hashData) ||\n document.getElementsByName(hashData)[0]\n\n if (target) {\n jumpToTarget()\n } else if (window.top !== window.self) {\n jumpToParent()\n } else {\n log(iframeId, 'In page link #' + hash + ' not found')\n }\n }\n\n function on(funcName, val) {\n return chkEvent(iframeId, funcName, val)\n }\n\n function actionMsg() {\n if (settings[iframeId] && settings[iframeId].firstRun) firstRun()\n\n switch (messageData.type) {\n case 'close':\n closeIFrame(messageData.iframe)\n break\n\n case 'message':\n forwardMsgFromIFrame(getMsgBody(6))\n break\n\n case 'autoResize':\n settings[iframeId].autoResize = JSON.parse(getMsgBody(9))\n break\n\n case 'scrollTo':\n scrollRequestFromChild(false)\n break\n\n case 'scrollToOffset':\n scrollRequestFromChild(true)\n break\n\n case 'pageInfo':\n sendPageInfoToIframe(\n settings[iframeId] && settings[iframeId].iframe,\n iframeId\n )\n startPageInfoMonitor()\n break\n\n case 'pageInfoStop':\n stopPageInfoMonitor()\n break\n\n case 'inPageLink':\n findTarget(getMsgBody(9))\n break\n\n case 'reset':\n resetIFrame(messageData)\n break\n\n case 'init':\n resizeIFrame()\n on('onInit', messageData.iframe)\n break\n\n default:\n resizeIFrame()\n }\n }\n\n function hasSettings(iframeId) {\n var retBool = true\n\n if (!settings[iframeId]) {\n retBool = false\n warn(\n messageData.type +\n ' No settings for ' +\n iframeId +\n '. Message was: ' +\n msg\n )\n }\n\n return retBool\n }\n\n function iFrameReadyMsgReceived() {\n // eslint-disable-next-line no-restricted-syntax, guard-for-in\n for (var iframeId in settings) {\n trigger(\n 'iFrame requested init',\n createOutgoingMsg(iframeId),\n settings[iframeId].iframe,\n iframeId\n )\n }\n }\n\n function firstRun() {\n if (settings[iframeId]) {\n settings[iframeId].firstRun = false\n }\n }\n\n var msg = event.data,\n messageData = {},\n iframeId = null\n\n if ('[iFrameResizerChild]Ready' === msg) {\n iFrameReadyMsgReceived()\n } else if (isMessageForUs()) {\n messageData = processMsg()\n iframeId = messageData.id\n if (settings[iframeId]) {\n settings[iframeId].loaded = true\n }\n\n if (!isMessageFromMetaParent() && hasSettings(iframeId)) {\n log(iframeId, 'Received: ' + msg)\n\n if (checkIFrameExists() && isMessageFromIFrame()) {\n actionMsg()\n }\n }\n } else {\n info(iframeId, 'Ignored: ' + msg)\n }\n }\n\n function chkEvent(iframeId, funcName, val) {\n var func = null,\n retVal = null\n\n if (settings[iframeId]) {\n func = settings[iframeId][funcName]\n\n if ('function' === typeof func) {\n retVal = func(val)\n } else {\n throw new TypeError(\n funcName + ' on iFrame[' + iframeId + '] is not a function'\n )\n }\n }\n\n return retVal\n }\n\n function removeIframeListeners(iframe) {\n var iframeId = iframe.id\n delete settings[iframeId]\n }\n\n function closeIFrame(iframe) {\n var iframeId = iframe.id\n if (chkEvent(iframeId, 'onClose', iframeId) === false) {\n log(iframeId, 'Close iframe cancelled by onClose event')\n return\n }\n log(iframeId, 'Removing iFrame: ' + iframeId)\n\n try {\n // Catch race condition error with React\n if (iframe.parentNode) {\n iframe.parentNode.removeChild(iframe)\n }\n } catch (error) {\n warn(error)\n }\n\n chkEvent(iframeId, 'onClosed', iframeId)\n log(iframeId, '--')\n removeIframeListeners(iframe)\n }\n\n function getPagePosition(iframeId) {\n if (null === pagePosition) {\n pagePosition = {\n x:\n window.pageXOffset !== undefined\n ? window.pageXOffset\n : document.documentElement.scrollLeft,\n y:\n window.pageYOffset !== undefined\n ? window.pageYOffset\n : document.documentElement.scrollTop\n }\n log(\n iframeId,\n 'Get page position: ' + pagePosition.x + ',' + pagePosition.y\n )\n }\n }\n\n function setPagePosition(iframeId) {\n if (null !== pagePosition) {\n window.scrollTo(pagePosition.x, pagePosition.y)\n log(\n iframeId,\n 'Set page position: ' + pagePosition.x + ',' + pagePosition.y\n )\n unsetPagePosition()\n }\n }\n\n function unsetPagePosition() {\n pagePosition = null\n }\n\n function resetIFrame(messageData) {\n function reset() {\n setSize(messageData)\n trigger('reset', 'reset', messageData.iframe, messageData.id)\n }\n\n log(\n messageData.id,\n 'Size reset requested by ' +\n ('init' === messageData.type ? 'host page' : 'iFrame')\n )\n getPagePosition(messageData.id)\n syncResize(reset, messageData, 'reset')\n }\n\n function setSize(messageData) {\n function setDimension(dimension) {\n if (!messageData.id) {\n log('undefined', 'messageData id not set')\n return\n }\n messageData.iframe.style[dimension] = messageData[dimension] + 'px'\n log(\n messageData.id,\n 'IFrame (' +\n iframeId +\n ') ' +\n dimension +\n ' set to ' +\n messageData[dimension] +\n 'px'\n )\n }\n\n function chkZero(dimension) {\n // FireFox sets dimension of hidden iFrames to zero.\n // So if we detect that set up an event to check for\n // when iFrame becomes visible.\n\n /* istanbul ignore next */ // Not testable in PhantomJS\n if (!hiddenCheckEnabled && '0' === messageData[dimension]) {\n hiddenCheckEnabled = true\n log(iframeId, 'Hidden iFrame detected, creating visibility listener')\n fixHiddenIFrames()\n }\n }\n\n function processDimension(dimension) {\n setDimension(dimension)\n chkZero(dimension)\n }\n\n var iframeId = messageData.iframe.id\n\n if (settings[iframeId]) {\n if (settings[iframeId].sizeHeight) {\n processDimension('height')\n }\n if (settings[iframeId].sizeWidth) {\n processDimension('width')\n }\n }\n }\n\n function syncResize(func, messageData, doNotSync) {\n /* istanbul ignore if */ // Not testable in PhantomJS\n if (\n doNotSync !== messageData.type &&\n requestAnimationFrame &&\n // including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame\n !window.jasmine\n ) {\n log(messageData.id, 'Requesting animation frame')\n requestAnimationFrame(func)\n } else {\n func()\n }\n }\n\n function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {\n function postMessageToIFrame() {\n var target = settings[id] && settings[id].targetOrigin\n log(\n id,\n '[' +\n calleeMsg +\n '] Sending msg to iframe[' +\n id +\n '] (' +\n msg +\n ') targetOrigin: ' +\n target\n )\n iframe.contentWindow.postMessage(msgId + msg, target)\n }\n\n function iFrameNotFound() {\n warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found')\n }\n\n function chkAndSend() {\n if (\n iframe &&\n 'contentWindow' in iframe &&\n null !== iframe.contentWindow\n ) {\n // Null test for PhantomJS\n postMessageToIFrame()\n } else {\n iFrameNotFound()\n }\n }\n\n function warnOnNoResponse() {\n function warning() {\n if (settings[id] && !settings[id].loaded && !errorShown) {\n errorShown = true\n warn(\n id,\n 'IFrame has not responded within ' +\n settings[id].warningTimeout / 1000 +\n ' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'\n )\n }\n }\n\n if (\n !!noResponseWarning &&\n settings[id] &&\n !!settings[id].warningTimeout\n ) {\n settings[id].msgTimeout = setTimeout(\n warning,\n settings[id].warningTimeout\n )\n }\n }\n\n var errorShown = false\n\n id = id || iframe.id\n\n if (settings[id]) {\n chkAndSend()\n warnOnNoResponse()\n }\n }\n\n function createOutgoingMsg(iframeId) {\n return (\n iframeId +\n ':' +\n settings[iframeId].bodyMarginV1 +\n ':' +\n settings[iframeId].sizeWidth +\n ':' +\n settings[iframeId].log +\n ':' +\n settings[iframeId].interval +\n ':' +\n settings[iframeId].enablePublicMethods +\n ':' +\n settings[iframeId].autoResize +\n ':' +\n settings[iframeId].bodyMargin +\n ':' +\n settings[iframeId].heightCalculationMethod +\n ':' +\n settings[iframeId].bodyBackground +\n ':' +\n settings[iframeId].bodyPadding +\n ':' +\n settings[iframeId].tolerance +\n ':' +\n settings[iframeId].inPageLinks +\n ':' +\n settings[iframeId].resizeFrom +\n ':' +\n settings[iframeId].widthCalculationMethod\n )\n }\n\n function setupIFrame(iframe, options) {\n function setLimits() {\n function addStyle(style) {\n if (\n Infinity !== settings[iframeId][style] &&\n 0 !== settings[iframeId][style]\n ) {\n iframe.style[style] = settings[iframeId][style] + 'px'\n log(\n iframeId,\n 'Set ' + style + ' = ' + settings[iframeId][style] + 'px'\n )\n }\n }\n\n function chkMinMax(dimension) {\n if (\n settings[iframeId]['min' + dimension] >\n settings[iframeId]['max' + dimension]\n ) {\n throw new Error(\n 'Value for min' +\n dimension +\n ' can not be greater than max' +\n dimension\n )\n }\n }\n\n chkMinMax('Height')\n chkMinMax('Width')\n\n addStyle('maxHeight')\n addStyle('minHeight')\n addStyle('maxWidth')\n addStyle('minWidth')\n }\n\n function newId() {\n var id = (options && options.id) || defaults.id + count++\n if (null !== document.getElementById(id)) {\n id += count++\n }\n return id\n }\n\n function ensureHasId(iframeId) {\n if ('' === iframeId) {\n // eslint-disable-next-line no-multi-assign\n iframe.id = iframeId = newId()\n logEnabled = (options || {}).log\n log(\n iframeId,\n 'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'\n )\n }\n\n return iframeId\n }\n\n function setScrolling() {\n log(\n iframeId,\n 'IFrame scrolling ' +\n (settings[iframeId] && settings[iframeId].scrolling\n ? 'enabled'\n : 'disabled') +\n ' for ' +\n iframeId\n )\n iframe.style.overflow =\n false === (settings[iframeId] && settings[iframeId].scrolling)\n ? 'hidden'\n : 'auto'\n switch (settings[iframeId] && settings[iframeId].scrolling) {\n case 'omit':\n break\n\n case true:\n iframe.scrolling = 'yes'\n break\n\n case false:\n iframe.scrolling = 'no'\n break\n\n default:\n iframe.scrolling = settings[iframeId]\n ? settings[iframeId].scrolling\n : 'no'\n }\n }\n\n // The V1 iFrame script expects an int, where as in V2 expects a CSS\n // string value such as '1px 3em', so if we have an int for V2, set V1=V2\n // and then convert V2 to a string PX value.\n function setupBodyMarginValues() {\n if (\n 'number' ===\n typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||\n '0' === (settings[iframeId] && settings[iframeId].bodyMargin)\n ) {\n settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin\n settings[iframeId].bodyMargin =\n '' + settings[iframeId].bodyMargin + 'px'\n }\n }\n\n function checkReset() {\n // Reduce scope of firstRun to function, because IE8's JS execution\n // context stack is borked and this value gets externally\n // changed midway through running this function!!!\n var firstRun = settings[iframeId] && settings[iframeId].firstRun,\n resetRequertMethod =\n settings[iframeId] &&\n settings[iframeId].heightCalculationMethod in resetRequiredMethods\n\n if (!firstRun && resetRequertMethod) {\n resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' })\n }\n }\n\n function setupIFrameObject() {\n if (settings[iframeId]) {\n settings[iframeId].iframe.iFrameResizer = {\n close: closeIFrame.bind(null, settings[iframeId].iframe),\n\n removeListeners: removeIframeListeners.bind(\n null,\n settings[iframeId].iframe\n ),\n\n resize: trigger.bind(\n null,\n 'Window resize',\n 'resize',\n settings[iframeId].iframe\n ),\n\n moveToAnchor: function (anchor) {\n trigger(\n 'Move to anchor',\n 'moveToAnchor:' + anchor,\n settings[iframeId].iframe,\n iframeId\n )\n },\n\n sendMessage: function (message) {\n message = JSON.stringify(message)\n trigger(\n 'Send Message',\n 'message:' + message,\n settings[iframeId].iframe,\n iframeId\n )\n }\n }\n }\n }\n\n // We have to call trigger twice, as we can not be sure if all\n // iframes have completed loading when this code runs. The\n // event listener also catches the page changing in the iFrame.\n function init(msg) {\n function iFrameLoaded() {\n trigger('iFrame.onload', msg, iframe, undefined, true)\n checkReset()\n }\n\n function createDestroyObserver(MutationObserver) {\n if (!iframe.parentNode) {\n return\n }\n\n var destroyObserver = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n var removedNodes = Array.prototype.slice.call(mutation.removedNodes) // Transform NodeList into an Array\n removedNodes.forEach(function (removedNode) {\n if (removedNode === iframe) {\n closeIFrame(iframe)\n }\n })\n })\n })\n destroyObserver.observe(iframe.parentNode, {\n childList: true\n })\n }\n\n var MutationObserver = getMutationObserver()\n if (MutationObserver) {\n createDestroyObserver(MutationObserver)\n }\n\n addEventListener(iframe, 'load', iFrameLoaded)\n trigger('init', msg, iframe, undefined, true)\n }\n\n function checkOptions(options) {\n if ('object' !== typeof options) {\n throw new TypeError('Options is not an object')\n }\n }\n\n function copyOptions(options) {\n // eslint-disable-next-line no-restricted-syntax\n for (var option in defaults) {\n if (Object.prototype.hasOwnProperty.call(defaults, option)) {\n settings[iframeId][option] = Object.prototype.hasOwnProperty.call(\n options,\n option\n )\n ? options[option]\n : defaults[option]\n }\n }\n }\n\n function getTargetOrigin(remoteHost) {\n return '' === remoteHost ||\n null !== remoteHost.match(/^(about:blank|javascript:|file:\\/\\/)/)\n ? '*'\n : remoteHost\n }\n\n function depricate(key) {\n var splitName = key.split('Callback')\n\n if (splitName.length === 2) {\n var name =\n 'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1)\n this[name] = this[key]\n delete this[key]\n warn(\n iframeId,\n \"Deprecated: '\" +\n key +\n \"' has been renamed '\" +\n name +\n \"'. The old method will be removed in the next major version.\"\n )\n }\n }\n\n function processOptions(options) {\n options = options || {}\n settings[iframeId] = {\n firstRun: true,\n iframe: iframe,\n remoteHost: iframe.src && iframe.src.split('/').slice(0, 3).join('/')\n }\n\n checkOptions(options)\n Object.keys(options).forEach(depricate, options)\n copyOptions(options)\n\n if (settings[iframeId]) {\n settings[iframeId].targetOrigin =\n true === settings[iframeId].checkOrigin\n ? getTargetOrigin(settings[iframeId].remoteHost)\n : '*'\n }\n }\n\n function beenHere() {\n return iframeId in settings && 'iFrameResizer' in iframe\n }\n\n var iframeId = ensureHasId(iframe.id)\n\n if (!beenHere()) {\n processOptions(options)\n setScrolling()\n setLimits()\n setupBodyMarginValues()\n init(createOutgoingMsg(iframeId))\n setupIFrameObject()\n } else {\n warn(iframeId, 'Ignored iFrame, already setup.')\n }\n }\n\n function debouce(fn, time) {\n if (null === timer) {\n timer = setTimeout(function () {\n timer = null\n fn()\n }, time)\n }\n }\n\n var frameTimer = {}\n function debounceFrameEvents(fn, time, frameId) {\n if (!frameTimer[frameId]) {\n frameTimer[frameId] = setTimeout(function () {\n frameTimer[frameId] = null\n fn()\n }, time)\n }\n }\n\n // Not testable in PhantomJS\n /* istanbul ignore next */\n\n function fixHiddenIFrames() {\n function checkIFrames() {\n function checkIFrame(settingId) {\n function chkDimension(dimension) {\n return (\n '0px' ===\n (settings[settingId] && settings[settingId].iframe.style[dimension])\n )\n }\n\n function isVisible(el) {\n return null !== el.offsetParent\n }\n\n if (\n settings[settingId] &&\n isVisible(settings[settingId].iframe) &&\n (chkDimension('height') || chkDimension('width'))\n ) {\n trigger(\n 'Visibility change',\n 'resize',\n settings[settingId].iframe,\n settingId\n )\n }\n }\n\n Object.keys(settings).forEach(function (key) {\n checkIFrame(key)\n })\n }\n\n function mutationObserved(mutations) {\n log(\n 'window',\n 'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type\n )\n debouce(checkIFrames, 16)\n }\n\n function createMutationObserver() {\n var target = document.querySelector('body'),\n config = {\n attributes: true,\n attributeOldValue: false,\n characterData: true,\n characterDataOldValue: false,\n childList: true,\n subtree: true\n },\n observer = new MutationObserver(mutationObserved)\n\n observer.observe(target, config)\n }\n\n var MutationObserver = getMutationObserver()\n if (MutationObserver) {\n createMutationObserver()\n }\n }\n\n function resizeIFrames(event) {\n function resize() {\n sendTriggerMsg('Window ' + event, 'resize')\n }\n\n log('window', 'Trigger event: ' + event)\n debouce(resize, 16)\n }\n\n // Not testable in PhantomJS\n /* istanbul ignore next */\n function tabVisible() {\n function resize() {\n sendTriggerMsg('Tab Visable', 'resize')\n }\n\n if ('hidden' !== document.visibilityState) {\n log('document', 'Trigger event: Visiblity change')\n debouce(resize, 16)\n }\n }\n\n function sendTriggerMsg(eventName, event) {\n function isIFrameResizeEnabled(iframeId) {\n return (\n settings[iframeId] &&\n 'parent' === settings[iframeId].resizeFrom &&\n settings[iframeId].autoResize &&\n !settings[iframeId].firstRun\n )\n }\n\n Object.keys(settings).forEach(function (iframeId) {\n if (isIFrameResizeEnabled(iframeId)) {\n trigger(eventName, event, settings[iframeId].iframe, iframeId)\n }\n })\n }\n\n function setupEventListeners() {\n addEventListener(window, 'message', iFrameListener)\n\n addEventListener(window, 'resize', function () {\n resizeIFrames('resize')\n })\n\n addEventListener(document, 'visibilitychange', tabVisible)\n\n addEventListener(document, '-webkit-visibilitychange', tabVisible)\n }\n\n function factory() {\n function init(options, element) {\n function chkType() {\n if (!element.tagName) {\n throw new TypeError('Object is not a valid DOM element')\n } else if ('IFRAME' !== element.tagName.toUpperCase()) {\n throw new TypeError(\n 'Expected