vendor: 71,186 bytes, lines 1-13
1/** 2 * Swiper 8.4.3 3 * Most modern mobile touch slider and framework with hardware accelerated transitions 4 * https://swiperjs.com 5 * 6 * Copyright 2014-2022 Vladimir Kharlampidi 7 * 8 * Released under the MIT License 9 * 10 * Released on: October 6, 2022 11 */ 12 13!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).Swiper = t() }(this, (function () { "use strict"; function e(e) { return null !== e && "object" == typeof e && "constructor" in e && e.constructor === Object } function t(s, a) { void 0 === s && (s = {}), void 0 === a && (a = {}), Object.keys(a).forEach((i => { void 0 === s[i] ? s[i] = a[i] : e(a[i]) && e(s[i]) && Object.keys(a[i]).length > 0 && t(s[i], a[i]) })) } const s = { body: {}, addEventListener() { }, removeEventListener() { }, activeElement: { blur() { }, nodeName: "" }, querySelector: () => null, querySelectorAll: () => [], getElementById: () => null, createEvent: () => ({ initEvent() { } }), createElement: () => ({ children: [], childNodes: [], style: {}, setAttribute() { }, getElementsByTagName: () => [] }), createElementNS: () => ({}), importNode: () => null, location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" } }; function a() { const e = "undefined" != typeof document ? document : {}; return t(e, s), e } const i = { document: s, navigator: { userAgent: "" }, location: { hash: "", host: "", hostname: "", href: "", origin: "", pathname: "", protocol: "", search: "" }, history: { replaceState() { }, pushState() { }, go() { }, back() { } }, CustomEvent: function () { return this }, addEventListener() { }, removeEventListener() { }, getComputedStyle: () => ({ getPropertyValue: () => "" }), Image() { }, Date() { }, screen: {}, setTimeout() { }, clearTimeout() { }, matchMedia: () => ({}), requestAnimationFrame: e => "undefined" == typeof setTimeout ? (e(), null) : setTimeout(e, 0), cancelAnimationFrame(e) { "undefined" != typeof setTimeout && clearTimeout(e) } }; function r() { const e = "undefined" != typeof window ? window : {}; return t(e, i), e } class n extends Array { constructor(e) { "number" == typeof e ? super(e) : (super(...e || []), function (e) { const t = e.__proto__; Object.defineProperty(e, "__proto__", { get: () => t, set(e) { t.__proto__ = e } }) }(this)) } } function l(e) { void 0 === e && (e = []); const t = []; return e.forEach((e => { Array.isArray(e) ? t.push(...l(e)) : t.push(e) })), t } function o(e, t) { return Array.prototype.filter.call(e, t) } function d(e, t) { const s = r(), i = a(); let l = []; if (!t && e instanceof n) return e; if (!e) return new n(l); if ("string" == typeof e) { const s = e.trim(); if (s.indexOf("<") >= 0 && s.indexOf(">") >= 0) { let e = "div"; 0 === s.indexOf("<li") && (e = "ul"), 0 === s.indexOf("<tr") && (e = "tbody"), 0 !== s.indexOf("<td") && 0 !== s.indexOf("<th") || (e = "tr"), 0 === s.indexOf("<tbody") && (e = "table"), 0 === s.indexOf("<option") && (e = "select"); const t = i.createElement(e); t.innerHTML = s; for (let e = 0; e < t.childNodes.length; e += 1)l.push(t.childNodes[e]) } else l = function (e, t) { if ("string" != typeof e) return [e]; const s = [], a = t.querySelectorAll(e); for (let e = 0; e < a.length; e += 1)s.push(a[e]); return s }(e.trim(), t || i) } else if (e.nodeType || e === s || e === i) l.push(e); else if (Array.isArray(e)) { if (e instanceof n) return e; l = e } return new n(function (e) { const t = []; for (let s = 0; s < e.length; s += 1)-1 === t.indexOf(e[s]) && t.push(e[s]); return t }(l)) } d.fn = n.prototype; const c = { addClass: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; const a = l(t.map((e => e.split(" ")))); return this.forEach((e => { e.classList.add(...a) })), this }, removeClass: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; const a = l(t.map((e => e.split(" ")))); return this.forEach((e => { e.classList.remove(...a) })), this }, hasClass: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; const a = l(t.map((e => e.split(" ")))); return o(this, (e => a.filter((t => e.classList.contains(t))).length > 0)).length > 0 }, toggleClass: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; const a = l(t.map((e => e.split(" ")))); this.forEach((e => { a.forEach((t => { e.classList.toggle(t) })) })) }, attr: function (e, t) { if (1 === arguments.length && "string" == typeof e) return this[0] ? this[0].getAttribute(e) : void 0; for (let s = 0; s < this.length; s += 1)if (2 === arguments.length) this[s].setAttribute(e, t); else for (const t in e) this[s][t] = e[t], this[s].setAttribute(t, e[t]); return this }, removeAttr: function (e) { for (let t = 0; t < this.length; t += 1)this[t].removeAttribute(e); return this }, transform: function (e) { for (let t = 0; t < this.length; t += 1)this[t].style.transform = e; return this }, transition: function (e) { for (let t = 0; t < this.length; t += 1)this[t].style.transitionDuration = "string" != typeof e ? `${e}ms` : e; return this }, on: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; let [a, i, r, n] = t; function l(e) { const t = e.target; if (!t) return; const s = e.target.dom7EventData || []; if (s.indexOf(e) < 0 && s.unshift(e), d(t).is(i)) r.apply(t, s); else { const e = d(t).parents(); for (let t = 0; t < e.length; t += 1)d(e[t]).is(i) && r.apply(e[t], s) } } function o(e) { const t = e && e.target && e.target.dom7EventData || []; t.indexOf(e) < 0 && t.unshift(e), r.apply(this, t) } "function" == typeof t[1] && ([a, r, n] = t, i = void 0), n || (n = !1); const c = a.split(" "); let p; for (let e = 0; e < this.length; e += 1) { const t = this[e]; if (i) for (p = 0; p < c.length; p += 1) { const e = c[p]; t.dom7LiveListeners || (t.dom7LiveListeners = {}), t.dom7LiveListeners[e] || (t.dom7LiveListeners[e] = []), t.dom7LiveListeners[e].push({ listener: r, proxyListener: l }), t.addEventListener(e, l, n) } else for (p = 0; p < c.length; p += 1) { const e = c[p]; t.dom7Listeners || (t.dom7Listeners = {}), t.dom7Listeners[e] || (t.dom7Listeners[e] = []), t.dom7Listeners[e].push({ listener: r, proxyListener: o }), t.addEventListener(e, o, n) } } return this }, off: function () { for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)t[s] = arguments[s]; let [a, i, r, n] = t; "function" == typeof t[1] && ([a, r, n] = t, i = void 0), n || (n = !1); const l = a.split(" "); for (let e = 0; e < l.length; e += 1) { const t = l[e]; for (let e = 0; e < this.length; e += 1) { const s = this[e]; let a; if (!i && s.dom7Listeners ? a = s.dom7Listeners[t] : i && s.dom7LiveListeners && (a = s.dom7LiveListeners[t]), a && a.length) for (let e = a.length - 1; e >= 0; e -= 1) { const i = a[e]; r && i.listener === r || r && i.listener && i.listener.dom7proxy && i.listener.dom7proxy === r ? (s.removeEventListener(t, i.proxyListener, n), a.splice(e, 1)) : r || (s.removeEventListener(t, i.proxyListener, n), a.splice(e, 1)) } } } return this }, trigger: function () { const e = r(); for (var t = arguments.length, s = new Array(t), a = 0; a < t; a++)s[a] = arguments[a]; const i = s[0].split(" "), n = s[1]; for (let t = 0; t < i.length; t += 1) { const a = i[t]; for (let t = 0; t < this.length; t += 1) { const i = this[t]; if (e.CustomEvent) { const t = new e.CustomEvent(a, { detail: n, bubbles: !0, cancelable: !0 }); i.dom7EventData = s.filter(((e, t) => t > 0)), i.dispatchEvent(t), i.dom7EventData = [], delete i.dom7EventData } } } return this }, transitionEnd: function (e) { const t = this; return e && t.on("transitionend", (function s(a) { a.target === this && (e.call(this, a), t.off("transitionend", s)) })), this }, outerWidth: function (e) { if (this.length > 0) { if (e) { const e = this.styles(); return this[0].offsetWidth + parseFloat(e.getPropertyValue("margin-right")) + parseFloat(e.getPropertyValue("margin-left")) } return this[0].offsetWidth } return null }, outerHeight: function (e) { if (this.length > 0) { if (e) { const e = this.styles(); return this[0].offsetHeight + parseFloat(e.getPropertyValue("margin-top")) + parseFloat(e.getPropertyValue("margin-bottom")) } return this[0].offsetHeight } return null }, styles: function () { const e = r(); return this[0] ? e.getComputedStyle(this[0], null) : {} }, offset: function () { if (this.length > 0) { const e = r(), t = a(), s = this[0], i = s.getBoundingClientRect(), n = t.body, l = s.clientTop || n.clientTop || 0, o = s.clientLeft || n.clientLeft || 0, d = s === e ? e.scrollY : s.scrollTop, c = s === e ? e.scrollX : s.scrollLeft; return { top: i.top + d - l, left: i.left + c - o } } return null }, css: function (e, t) { const s = r(); let a; if (1 === arguments.length) { if ("string" != typeof e) { for (a = 0; a < this.length; a += 1)for (const t in e) this[a].style[t] = e[t]; return this } if (this[0]) return s.getComputedStyle(this[0], null).getPropertyValue(e) } if (2 === arguments.length && "string" == typeof e) { for (a = 0; a < this.length; a += 1)this[a].style[e] = t; return this } return this }, each: function (e) { return e ? (this.forEach(((t, s) => { e.apply(t, [t, s]) })), this) : this }, html: function (e) { if (void 0 === e) return this[0] ? this[0].innerHTML : null; for (let t = 0; t < this.length; t += 1)this[t].innerHTML = e; return this }, text: function (e) { if (void 0 === e) return this[0] ? this[0].textContent.trim() : null; for (let t = 0; t < this.length; t += 1)this[t].textContent = e; return this }, is: function (e) { const t = r(), s = a(), i = this[0]; let l, o; if (!i || void 0 === e) return !1; if ("string" == typeof e) { if (i.matches) return i.matches(e); if (i.webkitMatchesSelector) return i.webkitMatchesSelector(e); if (i.msMatchesSelector) return i.msMatchesSelector(e); for (l = d(e), o = 0; o < l.length; o += 1)if (l[o] === i) return !0; return !1 } if (e === s) return i === s; if (e === t) return i === t; if (e.nodeType || e instanceof n) { for (l = e.nodeType ? [e] : e, o = 0; o < l.length; o += 1)if (l[o] === i) return !0; return !1 } return !1 }, index: function () { let e, t = this[0]; if (t) { for (e = 0; null !== (t = t.previousSibling);)1 === t.nodeType && (e += 1); return e } }, eq: function (e) { if (void 0 === e) return this; const t = this.length; if (e > t - 1) return d([]); if (e < 0) { const s = t + e; return d(s < 0 ? [] : [this[s]]) } return d([this[e]]) }, append: function () { let e; const t = a(); for (let s = 0; s < arguments.length; s += 1) { e = s < 0 || arguments.length <= s ? void 0 : arguments[s]; for (let s = 0; s < this.length; s += 1)if ("string" == typeof e) { const a = t.createElement("div"); for (a.innerHTML = e; a.firstChild;)this[s].appendChild(a.firstChild) } else if (e instanceof n) for (let t = 0; t < e.length; t += 1)this[s].appendChild(e[t]); else this[s].appendChild(e) } return this }, prepend: function (e) { const t = a(); let s, i; for (s = 0; s < this.length; s += 1)if ("string" == typeof e) { const a = t.createElement("div"); for (a.innerHTML = e, i = a.childNodes.length - 1; i >= 0; i -= 1)this[s].insertBefore(a.childNodes[i], this[s].childNodes[0]) } else if (e instanceof n) for (i = 0; i < e.length; i += 1)this[s].insertBefore(e[i], this[s].childNodes[0]); else this[s].insertBefore(e, this[s].childNodes[0]); return this }, next: function (e) { return this.length > 0 ? e ? this[0].nextElementSibling && d(this[0].nextElementSibling).is(e) ? d([this[0].nextElementSibling]) : d([]) : this[0].nextElementSibling ? d([this[0].nextElementSibling]) : d([]) : d([]) }, nextAll: function (e) { const t = []; let s = this[0]; if (!s) return d([]); for (; s.nextElementSibling;) { const a = s.nextElementSibling; e ? d(a).is(e) && t.push(a) : t.push(a), s = a } return d(t) }, prev: function (e) { if (this.length > 0) { const t = this[0]; return e ? t.previousElementSibling && d(t.previousElementSibling).is(e) ? d([t.previousElementSibling]) : d([]) : t.previousElementSibling ? d([t.previousElementSibling]) : d([]) } return d([]) }, prevAll: function (e) { const t = []; let s = this[0]; if (!s) return d([]); for (; s.previousElementSibling;) { const a = s.previousElementSibling; e ? d(a).is(e) && t.push(a) : t.push(a), s = a } return d(t) }, parent: function (e) { const t = []; for (let s = 0; s < this.length; s += 1)null !== this[s].parentNode && (e ? d(this[s].parentNode).is(e) && t.push(this[s].parentNode) : t.push(this[s].parentNode)); return d(t) }, parents: function (e) { const t = []; for (let s = 0; s < this.length; s += 1) { let a = this[s].parentNode; for (; a;)e ? d(a).is(e) && t.push(a) : t.push(a), a = a.parentNode } return d(t) }, closest: function (e) { let t = this; return void 0 === e ? d([]) : (t.is(e) || (t = t.parents(e).eq(0)), t) }, find: function (e) { const t = []; for (let s = 0; s < this.length; s += 1) { const a = this[s].querySelectorAll(e); for (let e = 0; e < a.length; e += 1)t.push(a[e]) } return d(t) }, children: function (e) { const t = []; for (let s = 0; s < this.length; s += 1) { const a = this[s].children; for (let s = 0; s < a.length; s += 1)e && !d(a[s]).is(e) || t.push(a[s]) } return d(t) }, filter: function (e) { return d(o(this, e)) }, remove: function () { for (let e = 0; e < this.length; e += 1)this[e].parentNode && this[e].parentNode.removeChild(this[e]); return this } }; function p(e, t) { return void 0 === t && (t = 0), setTimeout(e, t) } function u() { return Date.now() } function h(e, t) { void 0 === t && (t = "x"); const s = r(); let a, i, n; const l = function (e) { const t = r(); let s; return t.getComputedStyle && (s = t.getComputedStyle(e, null)), !s && e.currentStyle && (s = e.currentStyle), s || (s = e.style), s }(e); return s.WebKitCSSMatrix ? (i = l.transform || l.webkitTransform, i.split(",").length > 6 && (i = i.split(", ").map((e => e.replace(",", "."))).join(", ")), n = new s.WebKitCSSMatrix("none" === i ? "" : i)) : (n = l.MozTransform || l.OTransform || l.MsTransform || l.msTransform || l.transform || l.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"), a = n.toString().split(",")), "x" === t && (i = s.WebKitCSSMatrix ? n.m41 : 16 === a.length ? parseFloat(a[12]) : parseFloat(a[4])), "y" === t && (i = s.WebKitCSSMatrix ? n.m42 : 16 === a.length ? parseFloat(a[13]) : parseFloat(a[5])), i || 0 } function m(e) { return "object" == typeof e && null !== e && e.constructor && "Object" === Object.prototype.toString.call(e).slice(8, -1) } function f(e) { return "undefined" != typeof window && void 0 !== window.HTMLElement ? e instanceof HTMLElement : e && (1 === e.nodeType || 11 === e.nodeType) } function g() { const e = Object(arguments.length <= 0 ? void 0 : arguments[0]), t = ["__proto__", "constructor", "prototype"]; for (let s = 1; s < arguments.length; s += 1) { const a = s < 0 || arguments.length <= s ? void 0 : arguments[s]; if (null != a && !f(a)) { const s = Object.keys(Object(a)).filter((e => t.indexOf(e) < 0)); for (let t = 0, i = s.length; t < i; t += 1) { const i = s[t], r = Object.getOwnPropertyDescriptor(a, i); void 0 !== r && r.enumerable && (m(e[i]) && m(a[i]) ? a[i].__swiper__ ? e[i] = a[i] : g(e[i], a[i]) : !m(e[i]) && m(a[i]) ? (e[i] = {}, a[i].__swiper__ ? e[i] = a[i] : g(e[i], a[i])) : e[i] = a[i]) } } } return e } function v(e, t, s) { e.style.setProperty(t, s) } function w(e) { let { swiper: t, targetPosition: s, side: a } = e; const i = r(), n = -t.translate; let l, o = null; const d = t.params.speed; t.wrapperEl.style.scrollSnapType = "none", i.cancelAnimationFrame(t.cssModeFrameID); const c = s > n ? "next" : "prev", p = (e, t) => "next" === c && e >= t || "prev" === c && e <= t, u = () => { l = (new Date).getTime(), null === o && (o = l); const e = Math.max(Math.min((l - o) / d, 1), 0), r = .5 - Math.cos(e * Math.PI) / 2; let c = n + r * (s - n); if (p(c, s) && (c = s), t.wrapperEl.scrollTo({ [a]: c }), p(c, s)) return t.wrapperEl.style.overflow = "hidden", t.wrapperEl.style.scrollSnapType = "", setTimeout((() => { t.wrapperEl.style.overflow = "", t.wrapperEl.scrollTo({ [a]: c }) })), void i.cancelAnimationFrame(t.cssModeFrameID); t.cssModeFrameID = i.requestAnimationFrame(u) }; u() } let b, x, y; function E() { return b || (b = function () { const e = r(), t = a(); return { smoothScroll: t.documentElement && "scrollBehavior" in t.documentElement.style, touch: !!("ontouchstart" in e || e.DocumentTouch && t instanceof e.DocumentTouch), passiveListener: function () { let t = !1; try { const s = Object.defineProperty({}, "passive", { get() { t = !0 } }); e.addEventListener("testPassiveListener", null, s) } catch (e) { } return t }(), gestures: "ongesturestart" in e } }()), b } function C(e) { return void 0 === e && (e = {}), x || (x = function (e) { let { userAgent: t } = void 0 === e ? {} : e; const s = E(), a = r(), i = a.navigator.platform, n = t || a.navigator.userAgent, l = { ios: !1, android: !1 }, o = a.screen.width, d = a.screen.height, c = n.match(/(Android);?[\s\/]+([\d.]+)?/); let p = n.match(/(iPad).*OS\s([\d_]+)/); const u = n.match(/(iPod)(.*OS\s([\d_]+))?/), h = !p && n.match(/(iPhone\sOS|iOS)\s([\d_]+)/), m = "Win32" === i; let f = "MacIntel" === i; return !p && f && s.touch && ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"].indexOf(`${o}x${d}`) >= 0 && (p = n.match(/(Version)\/([\d.]+)/), p || (p = [0, 1, "13_0_0"]), f = !1), c && !m && (l.os = "android", l.android = !0), (p || h || u) && (l.os = "ios", l.ios = !0), l }(e)), x } function T() { return y || (y = function () { const e = r(); return { isSafari: function () { const t = e.navigator.userAgent.toLowerCase(); return t.indexOf("safari") >= 0 && t.indexOf("chrome") < 0 && t.indexOf("android") < 0 }(), isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent) } }()), y } Object.keys(c).forEach((e => { Object.defineProperty(d.fn, e, { value: c[e], writable: !0 }) })); var $ = { on(e, t, s) { const a = this; if (!a.eventsListeners || a.destroyed) return a; if ("function" != typeof t) return a; const i = s ? "unshift" : "push"; return e.split(" ").forEach((e => { a.eventsListeners[e] || (a.eventsListeners[e] = []), a.eventsListeners[e][i](t) })), a }, once(e, t, s) { const a = this; if (!a.eventsListeners || a.destroyed) return a; if ("function" != typeof t) return a; function i() { a.off(e, i), i.__emitterProxy && delete i.__emitterProxy; for (var s = arguments.length, r = new Array(s), n = 0; n < s; n++)r[n] = arguments[n]; t.apply(a, r) } return i.__emitterProxy = t, a.on(e, i, s) }, onAny(e, t) { const s = this; if (!s.eventsListeners || s.destroyed) return s; if ("function" != typeof e) return s; const a = t ? "unshift" : "push"; return s.eventsAnyListeners.indexOf(e) < 0 && s.eventsAnyListeners[a](e), s }, offAny(e) { const t = this; if (!t.eventsListeners || t.destroyed) return t; if (!t.eventsAnyListeners) return t; const s = t.eventsAnyListeners.indexOf(e); return s >= 0 && t.eventsAnyListeners.splice(s, 1), t }, off(e, t) { const s = this; return !s.eventsListeners || s.destroyed ? s : s.eventsListeners ? (e.split(" ").forEach((e => { void 0 === t ? s.eventsListeners[e] = [] : s.eventsListeners[e] && s.eventsListeners[e].forEach(((a, i) => { (a === t || a.__emitterProxy && a.__emitterProxy === t) && s.eventsListeners[e].splice(i, 1) })) })), s) : s }, emit() { const e = this; if (!e.eventsListeners || e.destroyed) return e; if (!e.eventsListeners) return e; let t, s, a; for (var i = arguments.length, r = new Array(i), n = 0; n < i; n++)r[n] = arguments[n]; "string" == typeof r[0] || Array.isArray(r[0]) ? (t = r[0], s = r.slice(1, r.length), a = e) : (t = r[0].events, s = r[0].data, a = r[0].context || e), s.unshift(a); return (Array.isArray(t) ? t : t.split(" ")).forEach((t => { e.eventsAnyListeners && e.eventsAnyListeners.length && e.eventsAnyListeners.forEach((e => { e.apply(a, [t, ...s]) })), e.eventsListeners && e.eventsListeners[t] && e.eventsListeners[t].forEach((e => { e.apply(a, s) })) })), e } }; var S = { updateSize: function () { const e = this; let t, s; const a = e.$el; t = void 0 !== e.params.width && null !== e.params.width ? e.params.width : a[0].clientWidth, s = void 0 !== e.params.height && null !== e.params.height ? e.params.height : a[0].clientHeight, 0 === t && e.isHorizontal() || 0 === s && e.isVertical() || (t = t - parseInt(a.css("padding-left") || 0, 10) - parseInt(a.css("padding-right") || 0, 10), s = s - parseInt(a.css("padding-top") || 0, 10) - parseInt(a.css("padding-bottom") || 0, 10), Number.isNaN(t) && (t = 0), Number.isNaN(s) && (s = 0), Object.assign(e, { width: t, height: s, size: e.isHorizontal() ? t : s })) }, updateSlides: function () { const e = this; function t(t) { return e.isHorizontal() ? t : { width: "height", "margin-top": "margin-left", "margin-bottom ": "margin-right", "margin-left": "margin-top", "margin-right": "margin-bottom", "padding-left": "padding-top", "padding-right": "padding-bottom", marginRight: "marginBottom" }[t] } function s(e, s) { return parseFloat(e.getPropertyValue(t(s)) || 0) } const a = e.params, { $wrapperEl: i, size: r, rtlTranslate: n, wrongRTL: l } = e, o = e.virtual && a.virtual.enabled, d = o ? e.virtual.slides.length : e.slides.length, c = i.children(`.${e.params.slideClass}`), p = o ? e.virtual.slides.length : c.length; let u = []; const h = [], m = []; let f = a.slidesOffsetBefore; "function" == typeof f && (f = a.slidesOffsetBefore.call(e)); let g = a.slidesOffsetAfter; "function" == typeof g && (g = a.slidesOffsetAfter.call(e)); const w = e.snapGrid.length, b = e.slidesGrid.length; let x = a.spaceBetween, y = -f, E = 0, C = 0; if (void 0 === r) return; "string" == typeof x && x.indexOf("%") >= 0 && (x = parseFloat(x.replace("%", "")) / 100 * r), e.virtualSize = -x, n ? c.css({ marginLeft: "", marginBottom: "", marginTop: "" }) : c.css({ marginRight: "", marginBottom: "", marginTop: "" }), a.centeredSlides && a.cssMode && (v(e.wrapperEl, "--swiper-centered-offset-before", ""), v(e.wrapperEl, "--swiper-centered-offset-after", "")); const T = a.grid && a.grid.rows > 1 && e.grid; let $; T && e.grid.initSlides(p); const S = "auto" === a.slidesPerView && a.breakpoints && Object.keys(a.breakpoints).filter((e => void 0 !== a.breakpoints[e].slidesPerView)).length > 0; for (let i = 0; i < p; i += 1) { $ = 0; const n = c.eq(i); if (T && e.grid.updateSlide(i, n, p, t), "none" !== n.css("display")) { if ("auto" === a.slidesPerView) { S && (c[i].style[t("width")] = ""); const r = getComputedStyle(n[0]), l = n[0].style.transform, o = n[0].style.webkitTransform; if (l && (n[0].style.transform = "none"), o && (n[0].style.webkitTransform = "none"), a.roundLengths) $ = e.isHorizontal() ? n.outerWidth(!0) : n.outerHeight(!0); else { const e = s(r, "width"), t = s(r, "padding-left"), a = s(r, "padding-right"), i = s(r, "margin-left"), l = s(r, "margin-right"), o = r.getPropertyValue("box-sizing"); if (o && "border-box" === o) $ = e + i + l; else { const { clientWidth: s, offsetWidth: r } = n[0]; $ = e + t + a + i + l + (r - s) } } l && (n[0].style.transform = l), o && (n[0].style.webkitTransform = o), a.roundLengths && ($ = Math.floor($)) } else $ = (r - (a.slidesPerView - 1) * x) / a.slidesPerView, a.roundLengths && ($ = Math.floor($)), c[i] && (c[i].style[t("width")] = `${$}px`); c[i] && (c[i].swiperSlideSize = $), m.push($), a.centeredSlides ? (y = y + $ / 2 + E / 2 + x, 0 === E && 0 !== i && (y = y - r / 2 - x), 0 === i && (y = y - r / 2 - x), Math.abs(y) < .001 && (y = 0), a.roundLengths && (y = Math.floor(y)), C % a.slidesPerGroup == 0 && u.push(y), h.push(y)) : (a.roundLengths && (y = Math.floor(y)), (C - Math.min(e.params.slidesPerGroupSkip, C)) % e.params.slidesPerGroup == 0 && u.push(y), h.push(y), y = y + $ + x), e.virtualSize += $ + x, E = $, C += 1 } } if (e.virtualSize = Math.max(e.virtualSize, r) + g, n && l && ("slide" === a.effect || "coverflow" === a.effect) && i.css({ width: `${e.virtualSize + a.spaceBetween}px` }), a.setWrapperSize && i.css({ [t("width")]: `${e.virtualSize + a.spaceBetween}px` }), T && e.grid.updateWrapperSize($, u, t), !a.centeredSlides) { const t = []; for (let s = 0; s < u.length; s += 1) { let i = u[s]; a.roundLengths && (i = Math.floor(i)), u[s] <= e.virtualSize - r && t.push(i) } u = t, Math.floor(e.virtualSize - r) - Math.floor(u[u.length - 1]) > 1 && u.push(e.virtualSize - r) } if (0 === u.length && (u = [0]), 0 !== a.spaceBetween) { const s = e.isHorizontal() && n ? "marginLeft" : t("marginRight"); c.filter(((e, t) => !a.cssMode || t !== c.length - 1)).css({ [s]: `${x}px` }) } if (a.centeredSlides && a.centeredSlidesBounds) { let e = 0; m.forEach((t => { e += t + (a.spaceBetween ? a.spaceBetween : 0) })), e -= a.spaceBetween; const t = e - r; u = u.map((e => e < 0 ? -f : e > t ? t + g : e)) } if (a.centerInsufficientSlides) { let e = 0; if (m.forEach((t => { e += t + (a.spaceBetween ? a.spaceBetween : 0) })), e -= a.spaceBetween, e < r) { const t = (r - e) / 2; u.forEach(((e, s) => { u[s] = e - t })), h.forEach(((e, s) => { h[s] = e + t })) } } if (Object.assign(e, { slides: c, snapGrid: u, slidesGrid: h, slidesSizesGrid: m }), a.centeredSlides && a.cssMode && !a.centeredSlidesBounds) { v(e.wrapperEl, "--swiper-centered-offset-before", -u[0] + "px"), v(e.wrapperEl, "--swiper-centered-offset-after", e.size / 2 - m[m.length - 1] / 2 + "px"); const t = -e.snapGrid[0], s = -e.slidesGrid[0]; e.snapGrid = e.snapGrid.map((e => e + t)), e.slidesGrid = e.slidesGrid.map((e => e + s)) } if (p !== d && e.emit("slidesLengthChange"), u.length !== w && (e.params.watchOverflow && e.checkOverflow(), e.emit("snapGridLengthChange")), h.length !== b && e.emit("slidesGridLengthChange"), a.watchSlidesProgress && e.updateSlidesOffset(), !(o || a.cssMode || "slide" !== a.effect && "fade" !== a.effect)) { const t = `${a.containerModifierClass}backface-hidden`, s = e.$el.hasClass(t); p <= a.maxBackfaceHiddenSlides ? s || e.$el.addClass(t) : s && e.$el.removeClass(t) } }, updateAutoHeight: function (e) { const t = this, s = [], a = t.virtual && t.params.virtual.enabled; let i, r = 0; "number" == typeof e ? t.setTransition(e) : !0 === e && t.setTransition(t.params.speed); const n = e => a ? t.slides.filter((t => parseInt(t.getAttribute("data-swiper-slide-index"), 10) === e))[0] : t.slides.eq(e)[0]; if ("auto" !== t.params.slidesPerView && t.params.slidesPerView > 1) if (t.params.centeredSlides) (t.visibleSlides || d([])).each((e => { s.push(e) })); else for (i = 0; i < Math.ceil(t.params.slidesPerView); i += 1) { const e = t.activeIndex + i; if (e > t.slides.length && !a) break; s.push(n(e)) } else s.push(n(t.activeIndex)); for (i = 0; i < s.length; i += 1)if (void 0 !== s[i]) { const e = s[i].offsetHeight; r = e > r ? e : r } (r || 0 === r) && t.$wrapperEl.css("height", `${r}px`) }, updateSlidesOffset: function () { const e = this, t = e.slides; for (let s = 0; s < t.length; s += 1)t[s].swiperSlideOffset = e.isHorizontal() ? t[s].offsetLeft : t[s].offsetTop }, updateSlidesProgress: function (e) { void 0 === e && (e = this && this.translate || 0); const t = this, s = t.params, { slides: a, rtlTranslate: i, snapGrid: r } = t; if (0 === a.length) return; void 0 === a[0].swiperSlideOffset && t.updateSlidesOffset(); let n = -e; i && (n = e), a.removeClass(s.slideVisibleClass), t.visibleSlidesIndexes = [], t.visibleSlides = []; for (let e = 0; e < a.length; e += 1) { const l = a[e]; let o = l.swiperSlideOffset; s.cssMode && s.centeredSlides && (o -= a[0].swiperSlideOffset); const d = (n + (s.centeredSlides ? t.minTranslate() : 0) - o) / (l.swiperSlideSize + s.spaceBetween), c = (n - r[0] + (s.centeredSlides ? t.minTranslate() : 0) - o) / (l.swiperSlideSize + s.spaceBetween), p = -(n - o), u = p + t.slidesSizesGrid[e]; (p >= 0 && p < t.size - 1 || u > 1 && u <= t.size || p <= 0 && u >= t.size) && (t.visibleSlides.push(l), t.visibleSlidesIndexes.push(e), a.eq(e).addClass(s.slideVisibleClass)), l.progress = i ? -d : d, l.originalProgress = i ? -c : c } t.visibleSlides = d(t.visibleSlides) }, updateProgress: function (e) { const t = this; if (void 0 === e) { const s = t.rtlTranslate ? -1 : 1; e = t && t.translate && t.translate * s || 0 } const s = t.params, a = t.maxTranslate() - t.minTranslate(); let { progress: i, isBeginning: r, isEnd: n } = t; const l = r, o = n; 0 === a ? (i = 0, r = !0, n = !0) : (i = (e - t.minTranslate()) / a, r = i <= 0, n = i >= 1), Object.assign(t, { progress: i, isBeginning: r, isEnd: n }), (s.watchSlidesProgress || s.centeredSlides && s.autoHeight) && t.updateSlidesProgress(e), r && !l && t.emit("reachBeginning toEdge"), n && !o && t.emit("reachEnd toEdge"), (l && !r || o && !n) && t.emit("fromEdge"), t.emit("progress", i) }, updateSlidesClasses: function () { const e = this, { slides: t, params: s, $wrapperEl: a, activeIndex: i, realIndex: r } = e, n = e.virtual && s.virtual.enabled; let l; t.removeClass(`${s.slideActiveClass} ${s.slideNextClass} ${s.slidePrevClass} ${s.slideDuplicateActiveClass} ${s.slideDuplicateNextClass} ${s.slideDuplicatePrevClass}`), l = n ? e.$wrapperEl.find(`.${s.slideClass}[data-swiper-slide-index="${i}"]`) : t.eq(i), l.addClass(s.slideActiveClass), s.loop && (l.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${r}"]`).addClass(s.slideDuplicateActiveClass)); let o = l.nextAll(`.${s.slideClass}`).eq(0).addClass(s.slideNextClass); s.loop && 0 === o.length && (o = t.eq(0), o.addClass(s.slideNextClass)); let d = l.prevAll(`.${s.slideClass}`).eq(0).addClass(s.slidePrevClass); s.loop && 0 === d.length && (d = t.eq(-1), d.addClass(s.slidePrevClass)), s.loop && (o.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${o.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass), d.hasClass(s.slideDuplicateClass) ? a.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass) : a.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${d.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass)), e.emitSlidesClasses() }, updateActiveIndex: function (e) { const t = this, s = t.rtlTranslate ? t.translate : -t.translate, { slidesGrid: a, snapGrid: i, params: r, activeIndex: n, realIndex: l, snapIndex: o } = t; let d, c = e; if (void 0 === c) { for (let e = 0; e < a.length; e += 1)void 0 !== a[e + 1] ? s >= a[e] && s < a[e + 1] - (a[e + 1] - a[e]) / 2 ? c = e : s >= a[e] && s < a[e + 1] && (c = e + 1) : s >= a[e] && (c = e); r.normalizeSlideIndex && (c < 0 || void 0 === c) && (c = 0) } if (i.indexOf(s) >= 0) d = i.indexOf(s); else { const e = Math.min(r.slidesPerGroupSkip, c); d = e + Math.floor((c - e) / r.slidesPerGroup) } if (d >= i.length && (d = i.length - 1), c === n) return void (d !== o && (t.snapIndex = d, t.emit("snapIndexChange"))); const p = parseInt(t.slides.eq(c).attr("data-swiper-slide-index") || c, 10); Object.assign(t, { snapIndex: d, realIndex: p, previousIndex: n, activeIndex: c }), t.emit("activeIndexChange"), t.emit("snapIndexChange"), l !== p && t.emit("realIndexChange"), (t.initialized || t.params.runCallbacksOnInit) && t.emit("slideChange") }, updateClickedSlide: function (e) { const t = this, s = t.params, a = d(e).closest(`.${s.slideClass}`)[0]; let i, r = !1; if (a) for (let e = 0; e < t.slides.length; e += 1)if (t.slides[e] === a) { r = !0, i = e; break } if (!a || !r) return t.clickedSlide = void 0, void (t.clickedIndex = void 0); t.clickedSlide = a, t.virtual && t.params.virtual.enabled ? t.clickedIndex = parseInt(d(a).attr("data-swiper-slide-index"), 10) : t.clickedIndex = i, s.slideToClickedSlide && void 0 !== t.clickedIndex && t.clickedIndex !== t.activeIndex && t.slideToClickedSlide() } }; var M = { getTranslate: function (e) { void 0 === e && (e = this.isHorizontal() ? "x" : "y"); const { params: t, rtlTranslate: s, translate: a, $wrapperEl: i } = this; if (t.virtualTranslate) return s ? -a : a; if (t.cssMode) return a; let r = h(i[0], e); return s && (r = -r), r || 0 }, setTranslate: function (e, t) { const s = this, { rtlTranslate: a, params: i, $wrapperEl: r, wrapperEl: n, progress: l } = s; let o, d = 0, c = 0; s.isHorizontal() ? d = a ? -e : e : c = e, i.roundLengths && (d = Math.floor(d), c = Math.floor(c)), i.cssMode ? n[s.isHorizontal() ? "scrollLeft" : "scrollTop"] = s.isHorizontal() ? -d : -c : i.virtualTranslate || r.transform(`translate3d(${d}px, ${c}px, 0px)`), s.previousTranslate = s.translate, s.translate = s.isHorizontal() ? d : c; const p = s.maxTranslate() - s.minTranslate(); o = 0 === p ? 0 : (e - s.minTranslate()) / p, o !== l && s.updateProgress(e), s.emit("setTranslate", s.translate, t) }, minTranslate: function () { return -this.snapGrid[0] }, maxTranslate: function () { return -this.snapGrid[this.snapGrid.length - 1] }, translateTo: function (e, t, s, a, i) { void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), void 0 === a && (a = !0); const r = this, { params: n, wrapperEl: l } = r; if (r.animating && n.preventInteractionOnTransition) return !1; const o = r.minTranslate(), d = r.maxTranslate(); let c; if (c = a && e > o ? o : a && e < d ? d : e, r.updateProgress(c), n.cssMode) { const e = r.isHorizontal(); if (0 === t) l[e ? "scrollLeft" : "scrollTop"] = -c; else { if (!r.support.smoothScroll) return w({ swiper: r, targetPosition: -c, side: e ? "left" : "top" }), !0; l.scrollTo({ [e ? "left" : "top"]: -c, behavior: "smooth" }) } return !0 } return 0 === t ? (r.setTransition(0), r.setTranslate(c), s && (r.emit("beforeTransitionStart", t, i), r.emit("transitionEnd"))) : (r.setTransition(t), r.setTranslate(c), s && (r.emit("beforeTransitionStart", t, i), r.emit("transitionStart")), r.animating || (r.animating = !0, r.onTranslateToWrapperTransitionEnd || (r.onTranslateToWrapperTransitionEnd = function (e) { r && !r.destroyed && e.target === this && (r.$wrapperEl[0].removeEventListener("transitionend", r.onTranslateToWrapperTransitionEnd), r.$wrapperEl[0].removeEventListener("webkitTransitionEnd", r.onTranslateToWrapperTransitionEnd), r.onTranslateToWrapperTransitionEnd = null, delete r.onTranslateToWrapperTransitionEnd, s && r.emit("transitionEnd")) }), r.$wrapperEl[0].addEventListener("transitionend", r.onTranslateToWrapperTransitionEnd), r.$wrapperEl[0].addEventListener("webkitTransitionEnd", r.onTranslateToWrapperTransitionEnd))), !0 } }; function P(e) { let { swiper: t, runCallbacks: s, direction: a, step: i } = e; const { activeIndex: r, previousIndex: n } = t; let l = a; if (l || (l = r > n ? "next" : r < n ? "prev" : "reset"), t.emit(`transition${i}`), s && r !== n) { if ("reset" === l) return void t.emit(`slideResetTransition${i}`); t.emit(`slideChangeTransition${i}`), "next" === l ? t.emit(`slideNextTransition${i}`) : t.emit(`slidePrevTransition${i}`) } } var k = { slideTo: function (e, t, s, a, i) { if (void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), "number" != typeof e && "string" != typeof e) throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof e}] given.`); if ("string" == typeof e) { const t = parseInt(e, 10); if (!isFinite(t)) throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${e}] given.`); e = t } const r = this; let n = e; n < 0 && (n = 0); const { params: l, snapGrid: o, slidesGrid: d, previousIndex: c, activeIndex: p, rtlTranslate: u, wrapperEl: h, enabled: m } = r; if (r.animating && l.preventInteractionOnTransition || !m && !a && !i) return !1; const f = Math.min(r.params.slidesPerGroupSkip, n); let g = f + Math.floor((n - f) / r.params.slidesPerGroup); g >= o.length && (g = o.length - 1); const v = -o[g]; if (l.normalizeSlideIndex) for (let e = 0; e < d.length; e += 1) { const t = -Math.floor(100 * v), s = Math.floor(100 * d[e]), a = Math.floor(100 * d[e + 1]); void 0 !== d[e + 1] ? t >= s && t < a - (a - s) / 2 ? n = e : t >= s && t < a && (n = e + 1) : t >= s && (n = e) } if (r.initialized && n !== p) { if (!r.allowSlideNext && v < r.translate && v < r.minTranslate()) return !1; if (!r.allowSlidePrev && v > r.translate && v > r.maxTranslate() && (p || 0) !== n) return !1 } let b; if (n !== (c || 0) && s && r.emit("beforeSlideChangeStart"), r.updateProgress(v), b = n > p ? "next" : n < p ? "prev" : "reset", u && -v === r.translate || !u && v === r.translate) return r.updateActiveIndex(n), l.autoHeight && r.updateAutoHeight(), r.updateSlidesClasses(), "slide" !== l.effect && r.setTranslate(v), "reset" !== b && (r.transitionStart(s, b), r.transitionEnd(s, b)), !1; if (l.cssMode) { const e = r.isHorizontal(), s = u ? v : -v; if (0 === t) { const t = r.virtual && r.params.virtual.enabled; t && (r.wrapperEl.style.scrollSnapType = "none", r._immediateVirtual = !0), h[e ? "scrollLeft" : "scrollTop"] = s, t && requestAnimationFrame((() => { r.wrapperEl.style.scrollSnapType = "", r._swiperImmediateVirtual = !1 })) } else { if (!r.support.smoothScroll) return w({ swiper: r, targetPosition: s, side: e ? "left" : "top" }), !0; h.scrollTo({ [e ? "left" : "top"]: s, behavior: "smooth" }) } return !0 } return r.setTransition(t), r.setTranslate(v), r.updateActiveIndex(n), r.updateSlidesClasses(), r.emit("beforeTransitionStart", t, a), r.transitionStart(s, b), 0 === t ? r.transitionEnd(s, b) : r.animating || (r.animating = !0, r.onSlideToWrapperTransitionEnd || (r.onSlideToWrapperTransitionEnd = function (e) { r && !r.destroyed && e.target === this && (r.$wrapperEl[0].removeEventListener("transitionend", r.onSlideToWrapperTransitionEnd), r.$wrapperEl[0].removeEventListener("webkitTransitionEnd", r.onSlideToWrapperTransitionEnd), r.onSlideToWrapperTransitionEnd = null, delete r.onSlideToWrapperTransitionEnd, r.transitionEnd(s, b)) }), r.$wrapperEl[0].addEventListener("transitionend", r.onSlideToWrapperTransitionEnd), r.$wrapperEl[0].addEventListener("webkitTransitionEnd", r.onSlideToWrapperTransitionEnd)), !0 }, slideToLoop: function (e, t, s, a) { if (void 0 === e && (e = 0), void 0 === t && (t = this.params.speed), void 0 === s && (s = !0), "string" == typeof e) { const t = parseInt(e, 10); if (!isFinite(t)) throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${e}] given.`); e = t } const i = this; let r = e; return i.params.loop && (r += i.loopedSlides), i.slideTo(r, t, s, a) }, slideNext: function (e, t, s) { void 0 === e && (e = this.params.speed), void 0 === t && (t = !0); const a = this, { animating: i, enabled: r, params: n } = a; if (!r) return a; let l = n.slidesPerGroup; "auto" === n.slidesPerView && 1 === n.slidesPerGroup && n.slidesPerGroupAuto && (l = Math.max(a.slidesPerViewDynamic("current", !0), 1)); const o = a.activeIndex < n.slidesPerGroupSkip ? 1 : l; if (n.loop) { if (i && n.loopPreventsSlide) return !1; a.loopFix(), a._clientLeft = a.$wrapperEl[0].clientLeft } return n.rewind && a.isEnd ? a.slideTo(0, e, t, s) : a.slideTo(a.activeIndex + o, e, t, s) }, slidePrev: function (e, t, s) { void 0 === e && (e = this.params.speed), void 0 === t && (t = !0); const a = this, { params: i, animating: r, snapGrid: n, slidesGrid: l, rtlTranslate: o, enabled: d } = a; if (!d) return a; if (i.loop) { if (r && i.loopPreventsSlide) return !1; a.loopFix(), a._clientLeft = a.$wrapperEl[0].clientLeft } function c(e) { return e < 0 ? -Math.floor(Math.abs(e)) : Math.floor(e) } const p = c(o ? a.translate : -a.translate), u = n.map((e => c(e))); let h = n[u.indexOf(p) - 1]; if (void 0 === h && i.cssMode) { let e; n.forEach(((t, s) => { p >= t && (e = s) })), void 0 !== e && (h = n[e > 0 ? e - 1 : e]) } let m = 0; if (void 0 !== h && (m = l.indexOf(h), m < 0 && (m = a.activeIndex - 1), "auto" === i.slidesPerView && 1 === i.slidesPerGroup && i.slidesPerGroupAuto && (m = m - a.slidesPerViewDynamic("previous", !0) + 1, m = Math.max(m, 0))), i.rewind && a.isBeginning) { const i = a.params.virtual && a.params.virtual.enabled && a.virtual ? a.virtual.slides.length - 1 : a.slides.length - 1; return a.slideTo(i, e, t, s) } return a.slideTo(m, e, t, s) }, slideReset: function (e, t, s) { return void 0 === e && (e = this.params.speed), void 0 === t && (t = !0), this.slideTo(this.activeIndex, e, t, s) }, slideToClosest: function (e, t, s, a) { void 0 === e && (e = this.params.speed), void 0 === t && (t = !0), void 0 === a && (a = .5); const i = this; let r = i.activeIndex; const n = Math.min(i.params.slidesPerGroupSkip, r), l = n + Math.floor((r - n) / i.params.slidesPerGroup), o = i.rtlTranslate ? i.translate : -i.translate; if (o >= i.snapGrid[l]) { const e = i.snapGrid[l]; o - e > (i.snapGrid[l + 1] - e) * a && (r += i.params.slidesPerGroup) } else { const e = i.snapGrid[l - 1]; o - e <= (i.snapGrid[l] - e) * a && (r -= i.params.slidesPerGroup) } return r = Math.max(r, 0), r = Math.min(r, i.slidesGrid.length - 1), i.slideTo(r, e, t, s) }, slideToClickedSlide: function () { const e = this, { params: t, $wrapperEl: s } = e, a = "auto" === t.slidesPerView ? e.slidesPerViewDynamic() : t.slidesPerView; let i, r = e.clickedIndex; if (t.loop) { if (e.animating) return; i = parseInt(d(e.clickedSlide).attr("data-swiper-slide-index"), 10), t.centeredSlides ? r < e.loopedSlides - a / 2 || r > e.slides.length - e.loopedSlides + a / 2 ? (e.loopFix(), r = s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(), p((() => { e.slideTo(r) }))) : e.slideTo(r) : r > e.slides.length - a ? (e.loopFix(), r = s.children(`.${t.slideClass}[data-swiper-slide-index="${i}"]:not(.${t.slideDuplicateClass})`).eq(0).index(), p((() => { e.slideTo(r) }))) : e.slideTo(r) } else e.slideTo(r) } }; var z = { loopCreate: function () { const e = this, t = a(), { params: s, $wrapperEl: i } = e, r = i.children().length > 0 ? d(i.children()[0].parentNode) : i; r.children(`.${s.slideClass}.${s.slideDuplicateClass}`).remove(); let n = r.children(`.${s.slideClass}`); if (s.loopFillGroupWithBlank) { const e = s.slidesPerGroup - n.length % s.slidesPerGroup; if (e !== s.slidesPerGroup) { for (let a = 0; a < e; a += 1) { const e = d(t.createElement("div")).addClass(`${s.slideClass} ${s.slideBlankClass}`); r.append(e) } n = r.children(`.${s.slideClass}`) } } "auto" !== s.slidesPerView || s.loopedSlides || (s.loopedSlides = n.length), e.loopedSlides = Math.ceil(parseFloat(s.loopedSlides || s.slidesPerView, 10)), e.loopedSlides += s.loopAdditionalSlides, e.loopedSlides > n.length && e.params.loopedSlidesLimit && (e.loopedSlides = n.length); const l = [], o = []; n.each(((e, t) => { d(e).attr("data-swiper-slide-index", t) })); for (let t = 0; t < e.loopedSlides; t += 1) { const e = t - Math.floor(t / n.length) * n.length; o.push(n.eq(e)[0]), l.unshift(n.eq(n.length - e - 1)[0]) } for (let e = 0; e < o.length; e += 1)r.append(d(o[e].cloneNode(!0)).addClass(s.slideDuplicateClass)); for (let e = l.length - 1; e >= 0; e -= 1)r.prepend(d(l[e].cloneNode(!0)).addClass(s.slideDuplicateClass)) }, loopFix: function () { const e = this; e.emit("beforeLoopFix"); const { activeIndex: t, slides: s, loopedSlides: a, allowSlidePrev: i, allowSlideNext: r, snapGrid: n, rtlTranslate: l } = e; let o; e.allowSlidePrev = !0, e.allowSlideNext = !0; const d = -n[t] - e.getTranslate(); if (t < a) { o = s.length - 3 * a + t, o += a; e.slideTo(o, 0, !1, !0) && 0 !== d && e.setTranslate((l ? -e.translate : e.translate) - d) } else if (t >= s.length - a) { o = -s.length + t + a, o += a; e.slideTo(o, 0, !1, !0) && 0 !== d && e.setTranslate((l ? -e.translate : e.translate) - d) } e.allowSlidePrev = i, e.allowSlideNext = r, e.emit("loopFix") }, loopDestroy: function () { const { $wrapperEl: e, params: t, slides: s } = this; e.children(`.${t.slideClass}.${t.slideDuplicateClass},.${t.slideClass}.${t.slideBlankClass}`).remove(), s.removeAttr("data-swiper-slide-index") } }; function L(e) { const t = this, s = a(), i = r(), n = t.touchEventsData, { params: l, touches: o, enabled: c } = t; if (!c) return; if (t.animating && l.preventInteractionOnTransition) return; !t.animating && l.cssMode && l.loop && t.loopFix(); let p = e; p.originalEvent && (p = p.originalEvent); let h = d(p.target); if ("wrapper" === l.touchEventsTarget && !h.closest(t.wrapperEl).length) return; if (n.isTouchEvent = "touchstart" === p.type, !n.isTouchEvent && "which" in p && 3 === p.which) return; if (!n.isTouchEvent && "button" in p && p.button > 0) return; if (n.isTouched && n.isMoved) return; const m = !!l.noSwipingClass && "" !== l.noSwipingClass, f = e.composedPath ? e.composedPath() : e.path; m && p.target && p.target.shadowRoot && f && (h = d(f[0])); const g = l.noSwipingSelector ? l.noSwipingSelector : `.${l.noSwipingClass}`, v = !(!p.target || !p.target.shadowRoot); if (l.noSwiping && (v ? function (e, t) { return void 0 === t && (t = this), function t(s) { if (!s || s === a() || s === r()) return null; s.assignedSlot && (s = s.assignedSlot); const i = s.closest(e); return i || s.getRootNode ? i || t(s.getRootNode().host) : null }(t) }(g, h[0]) : h.closest(g)[0])) return void (t.allowClick = !0); if (l.swipeHandler && !h.closest(l.swipeHandler)[0]) return; o.currentX = "touchstart" === p.type ? p.targetTouches[0].pageX : p.pageX, o.currentY = "touchstart" === p.type ? p.targetTouches[0].pageY : p.pageY; const w = o.currentX, b = o.currentY, x = l.edgeSwipeDetection || l.iOSEdgeSwipeDetection, y = l.edgeSwipeThreshold || l.iOSEdgeSwipeThreshold; if (x && (w <= y || w >= i.innerWidth - y)) { if ("prevent" !== x) return; e.preventDefault() } if (Object.assign(n, { isTouched: !0, isMoved: !1, allowTouchCallbacks: !0, isScrolling: void 0, startMoving: void 0 }), o.startX = w, o.startY = b, n.touchStartTime = u(), t.allowClick = !0, t.updateSize(), t.swipeDirection = void 0, l.threshold > 0 && (n.allowThresholdMove = !1), "touchstart" !== p.type) { let e = !0; h.is(n.focusableElements) && (e = !1, "SELECT" === h[0].nodeName && (n.isTouched = !1)), s.activeElement && d(s.activeElement).is(n.focusableElements) && s.activeElement !== h[0] && s.activeElement.blur(); const a = e && t.allowTouchMove && l.touchStartPreventDefault; !l.touchStartForcePreventDefault && !a || h[0].isContentEditable || p.preventDefault() } t.params.freeMode && t.params.freeMode.enabled && t.freeMode && t.animating && !l.cssMode && t.freeMode.onTouchStart(), t.emit("touchStart", p) } function O(e) { const t = a(), s = this, i = s.touchEventsData, { params: r, touches: n, rtlTranslate: l, enabled: o } = s; if (!o) return; let c = e; if (c.originalEvent && (c = c.originalEvent), !i.isTouched) return void (i.startMoving && i.isScrolling && s.emit("touchMoveOpposite", c)); if (i.isTouchEvent && "touchmove" !== c.type) return; const p = "touchmove" === c.type && c.targetTouches && (c.targetTouches[0] || c.changedTouches[0]), h = "touchmove" === c.type ? p.pageX : c.pageX, m = "touchmove" === c.type ? p.pageY : c.pageY; if (c.preventedByNestedSwiper) return n.startX = h, void (n.startY = m); if (!s.allowTouchMove) return d(c.target).is(i.focusableElements) || (s.allowClick = !1), void (i.isTouched && (Object.assign(n, { startX: h, startY: m, currentX: h, currentY: m }), i.touchStartTime = u())); if (i.isTouchEvent && r.touchReleaseOnEdges && !r.loop) if (s.isVertical()) { if (m < n.startY && s.translate <= s.maxTranslate() || m > n.startY && s.translate >= s.minTranslate()) return i.isTouched = !1, void (i.isMoved = !1) } else if (h < n.startX && s.translate <= s.maxTranslate() || h > n.startX && s.translate >= s.minTranslate()) return; if (i.isTouchEvent && t.activeElement && c.target === t.activeElement && d(c.target).is(i.focusableElements)) return i.isMoved = !0, void (s.allowClick = !1); if (i.allowTouchCallbacks && s.emit("touchMove", c), c.targetTouches && c.targetTouches.length > 1) return; n.currentX = h, n.currentY = m; const f = n.currentX - n.startX, g = n.currentY - n.startY; if (s.params.threshold && Math.sqrt(f ** 2 + g ** 2) < s.params.threshold) return; if (void 0 === i.isScrolling) { let e; s.isHorizontal() && n.currentY === n.startY || s.isVertical() && n.currentX === n.startX ? i.isScrolling = !1 : f * f + g * g >= 25 && (e = 180 * Math.atan2(Math.abs(g), Math.abs(f)) / Math.PI, i.isScrolling = s.isHorizontal() ? e > r.touchAngle : 90 - e > r.touchAngle) } if (i.isScrolling && s.emit("touchMoveOpposite", c), void 0 === i.startMoving && (n.currentX === n.startX && n.currentY === n.startY || (i.startMoving = !0)), i.isScrolling) return void (i.isTouched = !1); if (!i.startMoving) return; s.allowClick = !1, !r.cssMode && c.cancelable && c.preventDefault(), r.touchMoveStopPropagation && !r.nested && c.stopPropagation(), i.isMoved || (r.loop && !r.cssMode && s.loopFix(), i.startTranslate = s.getTranslate(), s.setTransition(0), s.animating && s.$wrapperEl.trigger("webkitTransitionEnd transitionend"), i.allowMomentumBounce = !1, !r.grabCursor || !0 !== s.allowSlideNext && !0 !== s.allowSlidePrev || s.setGrabCursor(!0), s.emit("sliderFirstMove", c)), s.emit("sliderMove", c), i.isMoved = !0; let v = s.isHorizontal() ? f : g; n.diff = v, v *= r.touchRatio, l && (v = -v), s.swipeDirection = v > 0 ? "prev" : "next", i.currentTranslate = v + i.startTranslate; let w = !0, b = r.resistanceRatio; if (r.touchReleaseOnEdges && (b = 0), v > 0 && i.currentTranslate > s.minTranslate() ? (w = !1, r.resistance && (i.currentTranslate = s.minTranslate() - 1 + (-s.minTranslate() + i.startTranslate + v) ** b)) : v < 0 && i.currentTranslate < s.maxTranslate() && (w = !1, r.resistance && (i.currentTranslate = s.maxTranslate() + 1 - (s.maxTranslate() - i.startTranslate - v) ** b)), w && (c.preventedByNestedSwiper = !0), !s.allowSlideNext && "next" === s.swipeDirection && i.currentTranslate < i.startTranslate && (i.currentTranslate = i.startTranslate), !s.allowSlidePrev && "prev" === s.swipeDirection && i.currentTranslate > i.startTranslate && (i.currentTranslate = i.startTranslate), s.allowSlidePrev || s.allowSlideNext || (i.currentTranslate = i.startTranslate), r.threshold > 0) { if (!(Math.abs(v) > r.threshold || i.allowThresholdMove)) return void (i.currentTranslate = i.startTranslate); if (!i.allowThresholdMove) return i.allowThresholdMove = !0, n.startX = n.currentX, n.startY = n.currentY, i.currentTranslate = i.startTranslate, void (n.diff = s.isHorizontal() ? n.currentX - n.startX : n.currentY - n.startY) } r.followFinger && !r.cssMode && ((r.freeMode && r.freeMode.enabled && s.freeMode || r.watchSlidesProgress) && (s.updateActiveIndex(), s.updateSlidesClasses()), s.params.freeMode && r.freeMode.enabled && s.freeMode && s.freeMode.onTouchMove(), s.updateProgress(i.currentTranslate), s.setTranslate(i.currentTranslate)) } function I(e) { const t = this, s = t.touchEventsData, { params: a, touches: i, rtlTranslate: r, slidesGrid: n, enabled: l } = t; if (!l) return; let o = e; if (o.originalEvent && (o = o.originalEvent), s.allowTouchCallbacks && t.emit("touchEnd", o), s.allowTouchCallbacks = !1, !s.isTouched) return s.isMoved && a.grabCursor && t.setGrabCursor(!1), s.isMoved = !1, void (s.startMoving = !1); a.grabCursor && s.isMoved && s.isTouched && (!0 === t.allowSlideNext || !0 === t.allowSlidePrev) && t.setGrabCursor(!1); const d = u(), c = d - s.touchStartTime; if (t.allowClick) { const e = o.path || o.composedPath && o.composedPath(); t.updateClickedSlide(e && e[0] || o.target), t.emit("tap click", o), c < 300 && d - s.lastClickTime < 300 && t.emit("doubleTap doubleClick", o) } if (s.lastClickTime = u(), p((() => { t.destroyed || (t.allowClick = !0) })), !s.isTouched || !s.isMoved || !t.swipeDirection || 0 === i.diff || s.currentTranslate === s.startTranslate) return s.isTouched = !1, s.isMoved = !1, void (s.startMoving = !1); let h; if (s.isTouched = !1, s.isMoved = !1, s.startMoving = !1, h = a.followFinger ? r ? t.translate : -t.translate : -s.currentTranslate, a.cssMode) return; if (t.params.freeMode && a.freeMode.enabled) return void t.freeMode.onTouchEnd({ currentPos: h }); let m = 0, f = t.slidesSizesGrid[0]; for (let e = 0; e < n.length; e += e < a.slidesPerGroupSkip ? 1 : a.slidesPerGroup) { const t = e < a.slidesPerGroupSkip - 1 ? 1 : a.slidesPerGroup; void 0 !== n[e + t] ? h >= n[e] && h < n[e + t] && (m = e, f = n[e + t] - n[e]) : h >= n[e] && (m = e, f = n[n.length - 1] - n[n.length - 2]) } let g = null, v = null; a.rewind && (t.isBeginning ? v = t.params.virtual && t.params.virtual.enabled && t.virtual ? t.virtual.slides.length - 1 : t.slides.length - 1 : t.isEnd && (g = 0)); const w = (h - n[m]) / f, b = m < a.slidesPerGroupSkip - 1 ? 1 : a.slidesPerGroup; if (c > a.longSwipesMs) { if (!a.longSwipes) return void t.slideTo(t.activeIndex); "next" === t.swipeDirection && (w >= a.longSwipesRatio ? t.slideTo(a.rewind && t.isEnd ? g : m + b) : t.slideTo(m)), "prev" === t.swipeDirection && (w > 1 - a.longSwipesRatio ? t.slideTo(m + b) : null !== v && w < 0 && Math.abs(w) > a.longSwipesRatio ? t.slideTo(v) : t.slideTo(m)) } else { if (!a.shortSwipes) return void t.slideTo(t.activeIndex); t.navigation && (o.target === t.navigation.nextEl || o.target === t.navigation.prevEl) ? o.target === t.navigation.nextEl ? t.slideTo(m + b) : t.slideTo(m) : ("next" === t.swipeDirection && t.slideTo(null !== g ? g : m + b), "prev" === t.swipeDirection && t.slideTo(null !== v ? v : m)) } } function A() { const e = this, { params: t, el: s } = e; if (s && 0 === s.offsetWidth) return; t.breakpoints && e.setBreakpoint(); const { allowSlideNext: a, allowSlidePrev: i, snapGrid: r } = e; e.allowSlideNext = !0, e.allowSlidePrev = !0, e.updateSize(), e.updateSlides(), e.updateSlidesClasses(), ("auto" === t.slidesPerView || t.slidesPerView > 1) && e.isEnd && !e.isBeginning && !e.params.centeredSlides ? e.slideTo(e.slides.length - 1, 0, !1, !0) : e.slideTo(e.activeIndex, 0, !1, !0), e.autoplay && e.autoplay.running && e.autoplay.paused && e.autoplay.run(), e.allowSlidePrev = i, e.allowSlideNext = a, e.params.watchOverflow && r !== e.snapGrid && e.checkOverflow() } function D(e) { const t = this; t.enabled && (t.allowClick || (t.params.preventClicks && e.preventDefault(), t.params.preventClicksPropagation && t.animating && (e.stopPropagation(), e.stopImmediatePropagation()))) } function G() { const e = this, { wrapperEl: t, rtlTranslate: s, enabled: a } = e; if (!a) return; let i; e.previousTranslate = e.translate, e.isHorizontal() ? e.translate = -t.scrollLeft : e.translate = -t.scrollTop, 0 === e.translate && (e.translate = 0), e.updateActiveIndex(), e.updateSlidesClasses(); const r = e.maxTranslate() - e.minTranslate(); i = 0 === r ? 0 : (e.translate - e.minTranslate()) / r, i !== e.progress && e.updateProgress(s ? -e.translate : e.translate), e.emit("setTranslate", e.translate, !1) } let N = !1; function B() { } const H = (e, t) => { const s = a(), { params: i, touchEvents: r, el: n, wrapperEl: l, device: o, support: d } = e, c = !!i.nested, p = "on" === t ? "addEventListener" : "removeEventListener", u = t; if (d.touch) { const t = !("touchstart" !== r.start || !d.passiveListener || !i.passiveListeners) && { passive: !0, capture: !1 }; n[p](r.start, e.onTouchStart, t), n[p](r.move, e.onTouchMove, d.passiveListener ? { passive: !1, capture: c } : c), n[p](r.end, e.onTouchEnd, t), r.cancel && n[p](r.cancel, e.onTouchEnd, t) } else n[p](r.start, e.onTouchStart, !1), s[p](r.move, e.onTouchMove, c), s[p](r.end, e.onTouchEnd, !1); (i.preventClicks || i.preventClicksPropagation) && n[p]("click", e.onClick, !0), i.cssMode && l[p]("scroll", e.onScroll), i.updateOnWindowResize ? e[u](o.ios || o.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", A, !0) : e[u]("observerUpdate", A, !0) }; var X = { attachEvents: function () { const e = this, t = a(), { params: s, support: i } = e; e.onTouchStart = L.bind(e), e.onTouchMove = O.bind(e), e.onTouchEnd = I.bind(e), s.cssMode && (e.onScroll = G.bind(e)), e.onClick = D.bind(e), i.touch && !N && (t.addEventListener("touchstart", B), N = !0), H(e, "on") }, detachEvents: function () { H(this, "off") } }; const Y = (e, t) => e.grid && t.grid && t.grid.rows > 1; var R = { addClasses: function () { const e = this, { classNames: t, params: s, rtl: a, $el: i, device: r, support: n } = e, l = function (e, t) { const s = []; return e.forEach((e => { "object" == typeof e ? Object.keys(e).forEach((a => { e[a] && s.push(t + a) })) : "string" == typeof e && s.push(t + e) })), s }(["initialized", s.direction, { "pointer-events": !n.touch }, { "free-mode": e.params.freeMode && s.freeMode.enabled }, { autoheight: s.autoHeight }, { rtl: a }, { grid: s.grid && s.grid.rows > 1 }, { "grid-column": s.grid && s.grid.rows > 1 && "column" === s.grid.fill }, { android: r.android }, { ios: r.ios }, { "css-mode": s.cssMode }, { centered: s.cssMode && s.centeredSlides }, { "watch-progress": s.watchSlidesProgress }], s.containerModifierClass); t.push(...l), i.addClass([...t].join(" ")), e.emitContainerClasses() }, removeClasses: function () { const { $el: e, classNames: t } = this; e.removeClass(t.join(" ")), this.emitContainerClasses() } }; var W = { init: !0, direction: "horizontal", touchEventsTarget: "wrapper", initialSlide: 0, speed: 300, cssMode: !1, updateOnWindowResize: !0, resizeObserver: !0, nested: !1, createElements: !1, enabled: !0, focusableElements: "input, select, option, textarea, button, video, label", width: null, height: null, preventInteractionOnTransition: !1, userAgent: null, url: null, edgeSwipeDetection: !1, edgeSwipeThreshold: 20, autoHeight: !1, setWrapperSize: !1, virtualTranslate: !1, effect: "slide", breakpoints: void 0, breakpointsBase: "window", spaceBetween: 0, slidesPerView: 1, slidesPerGroup: 1, slidesPerGroupSkip: 0, slidesPerGroupAuto: !1, centeredSlides: !1, centeredSlidesBounds: !1, slidesOffsetBefore: 0, slidesOffsetAfter: 0, normalizeSlideIndex: !0, centerInsufficientSlides: !1, watchOverflow: !0, roundLengths: !1, touchRatio: 1, touchAngle: 45, simulateTouch: !0, shortSwipes: !0, longSwipes: !0, longSwipesRatio: .5, longSwipesMs: 300, followFinger: !0, allowTouchMove: !0, threshold: 0, touchMoveStopPropagation: !1, touchStartPreventDefault: !0, touchStartForcePreventDefault: !1, touchReleaseOnEdges: !1, uniqueNavElements: !0, resistance: !0, resistanceRatio: .85, watchSlidesProgress: !1, grabCursor: !1, preventClicks: !0, preventClicksPropagation: !0, slideToClickedSlide: !1, preloadImages: !0, updateOnImagesReady: !0, loop: !1, loopAdditionalSlides: 0, loopedSlides: null, loopedSlidesLimit: !0, loopFillGroupWithBlank: !1, loopPreventsSlide: !0, rewind: !1, allowSlidePrev: !0, allowSlideNext: !0, swipeHandler: null, noSwiping: !0, noSwipingClass: "swiper-no-swiping", noSwipingSelector: null, passiveListeners: !0, maxBackfaceHiddenSlides: 10, containerModifierClass: "swiper-", slideClass: "swiper-slide", slideBlankClass: "swiper-slide-invisible-blank", slideActiveClass: "swiper-slide-active", slideDuplicateActiveClass: "swiper-slide-duplicate-active", slideVisibleClass: "swiper-slide-visible", slideDuplicateClass: "swiper-slide-duplicate", slideNextClass: "swiper-slide-next", slideDuplicateNextClass: "swiper-slide-duplicate-next", slidePrevClass: "swiper-slide-prev", slideDuplicatePrevClass: "swiper-slide-duplicate-prev", wrapperClass: "swiper-wrapper", runCallbacksOnInit: !0, _emitClasses: !1 }; function q(e, t) { return function (s) { void 0 === s && (s = {}); const a = Object.keys(s)[0], i = s[a]; "object" == typeof i && null !== i ? (["navigation", "pagination", "scrollbar"].indexOf(a) >= 0 && !0 === e[a] && (e[a] = { auto: !0 }), a in e && "enabled" in i ? (!0 === e[a] && (e[a] = { enabled: !0 }), "object" != typeof e[a] || "enabled" in e[a] || (e[a].enabled = !0), e[a] || (e[a] = { enabled: !1 }), g(t, s)) : g(t, s)) : g(t, s) } } const j = { eventsEmitter: $, update: S, translate: M, transition: { setTransition: function (e, t) { const s = this; s.params.cssMode || s.$wrapperEl.transition(e), s.emit("setTransition", e, t) }, transitionStart: function (e, t) { void 0 === e && (e = !0); const s = this, { params: a } = s; a.cssMode || (a.autoHeight && s.updateAutoHeight(), P({ swiper: s, runCallbacks: e, direction: t, step: "Start" })) }, transitionEnd: function (e, t) { void 0 === e && (e = !0); const s = this, { params: a } = s; s.animating = !1, a.cssMode || (s.setTransition(0), P({ swiper: s, runCallbacks: e, direction: t, step: "End" })) } }, slide: k, loop: z, grabCursor: { setGrabCursor: function (e) { const t = this; if (t.support.touch || !t.params.simulateTouch || t.params.watchOverflow && t.isLocked || t.params.cssMode) return; const s = "container" === t.params.touchEventsTarget ? t.el : t.wrapperEl; s.style.cursor = "move", s.style.cursor = e ? "grabbing" : "grab" }, unsetGrabCursor: function () { const e = this; e.support.touch || e.params.watchOverflow && e.isLocked || e.params.cssMode || (e["container" === e.params.touchEventsTarget ? "el" : "wrapperEl"].style.cursor = "") } }, events: X, breakpoints: { setBreakpoint: function () { const e = this, { activeIndex: t, initialized: s, loopedSlides: a = 0, params: i, $el: r } = e, n = i.breakpoints; if (!n || n && 0 === Object.keys(n).length) return; const l = e.getBreakpoint(n, e.params.breakpointsBase, e.el); if (!l || e.currentBreakpoint === l) return; const o = (l in n ? n[l] : void 0) || e.originalParams, d = Y(e, i), c = Y(e, o), p = i.enabled; d && !c ? (r.removeClass(`${i.containerModifierClass}grid ${i.containerModifierClass}grid-column`), e.emitContainerClasses()) : !d && c && (r.addClass(`${i.containerModifierClass}grid`), (o.grid.fill && "column" === o.grid.fill || !o.grid.fill && "column" === i.grid.fill) && r.addClass(`${i.containerModifierClass}grid-column`), e.emitContainerClasses()), ["navigation", "pagination", "scrollbar"].forEach((t => { const s = i[t] && i[t].enabled, a = o[t] && o[t].enabled; s && !a && e[t].disable(), !s && a && e[t].enable() })); const u = o.direction && o.direction !== i.direction, h = i.loop && (o.slidesPerView !== i.slidesPerView || u); u && s && e.changeDirection(), g(e.params, o); const m = e.params.enabled; Object.assign(e, { allowTouchMove: e.params.allowTouchMove, allowSlideNext: e.params.allowSlideNext, allowSlidePrev: e.params.allowSlidePrev }), p && !m ? e.disable() : !p && m && e.enable(), e.currentBreakpoint = l, e.emit("_beforeBreakpoint", o), h && s && (e.loopDestroy(), e.loopCreate(), e.updateSlides(), e.slideTo(t - a + e.loopedSlides, 0, !1)), e.emit("breakpoint", o) }, getBreakpoint: function (e, t, s) { if (void 0 === t && (t = "window"), !e || "container" === t && !s) return; let a = !1; const i = r(), n = "window" === t ? i.innerHeight : s.clientHeight, l = Object.keys(e).map((e => { if ("string" == typeof e && 0 === e.indexOf("@")) { const t = parseFloat(e.substr(1)); return { value: n * t, point: e } } return { value: e, point: e } })); l.sort(((e, t) => parseInt(e.value, 10) - parseInt(t.value, 10))); for (let e = 0; e < l.length; e += 1) { const { point: r, value: n } = l[e]; "window" === t ? i.matchMedia(`(min-width: ${n}px)`).matches && (a = r) : n <= s.clientWidth && (a = r) } return a || "max" } }, checkOverflow: { checkOverflow: function () { const e = this, { isLocked: t, params: s } = e, { slidesOffsetBefore: a } = s; if (a) { const t = e.slides.length - 1, s = e.slidesGrid[t] + e.slidesSizesGrid[t] + 2 * a; e.isLocked = e.size > s } else e.isLocked = 1 === e.snapGrid.length; !0 === s.allowSlideNext && (e.allowSlideNext = !e.isLocked), !0 === s.allowSlidePrev && (e.allowSlidePrev = !e.isLocked), t && t !== e.isLocked && (e.isEnd = !1), t !== e.isLocked && e.emit(e.isLocked ? "lock" : "unlock") } }, classes: R, images: { loadImage: function (e, t, s, a, i, n) { const l = r(); let o; function c() { n && n() } d(e).parent("picture")[0] || e.complete && i ? c() : t ? (o = new l.Image, o.onload = c, o.onerror = c, a && (o.sizes = a), s && (o.srcset = s), t && (o.src = t)) : c() }, preloadImages: function () { const e = this; function t() { null != e && e && !e.destroyed && (void 0 !== e.imagesLoaded && (e.imagesLoaded += 1), e.imagesLoaded === e.imagesToLoad.length && (e.params.updateOnImagesReady && e.update(), e.emit("imagesReady"))) } e.imagesToLoad = e.$el.find("img"); for (let s = 0; s < e.imagesToLoad.length; s += 1) { const a = e.imagesToLoad[s]; e.loadImage(a, a.currentSrc || a.getAttribute("src"), a.srcset || a.getAttribute("srcset"), a.sizes || a.getAttribute("sizes"), !0, t) } } } }, _ = {}; class V { constructor() { let e, t; for (var s = arguments.length, a = new Array(s), i = 0; i < s; i++)a[i] = arguments[i]; if (1 === a.length && a[0].constructor && "Object" === Object.prototype.toString.call(a[0]).slice(8, -1) ? t = a[0] : [e, t] = a, t || (t = {}), t = g({}, t), e && !t.el && (t.el = e), t.el && d(t.el).length > 1) { const e = []; return d(t.el).each((s => { const a = g({}, t, { el: s }); e.push(new V(a)) })), e } const r = this; r.__swiper__ = !0, r.support = E(), r.device = C({ userAgent: t.userAgent }), r.browser = T(), r.eventsListeners = {}, r.eventsAnyListeners = [], r.modules = [...r.__modules__], t.modules && Array.isArray(t.modules) && r.modules.push(...t.modules); const n = {}; r.modules.forEach((e => { e({ swiper: r, extendParams: q(t, n), on: r.on.bind(r), once: r.once.bind(r), off: r.off.bind(r), emit: r.emit.bind(r) }) })); const l = g({}, W, n); return r.params = g({}, l, _, t), r.originalParams = g({}, r.params), r.passedParams = g({}, t), r.params && r.params.on && Object.keys(r.params.on).forEach((e => { r.on(e, r.params.on[e]) })), r.params && r.params.onAny && r.onAny(r.params.onAny), r.$ = d, Object.assign(r, { enabled: r.params.enabled, el: e, classNames: [], slides: d(), slidesGrid: [], snapGrid: [], slidesSizesGrid: [], isHorizontal: () => "horizontal" === r.params.direction, isVertical: () => "vertical" === r.params.direction, activeIndex: 0, realIndex: 0, isBeginning: !0, isEnd: !1, translate: 0, previousTranslate: 0, progress: 0, velocity: 0, animating: !1, allowSlideNext: r.params.allowSlideNext, allowSlidePrev: r.params.allowSlidePrev, touchEvents: function () { const e = ["touchstart", "touchmove", "touchend", "touchcancel"], t = ["pointerdown", "pointermove", "pointerup"]; return r.touchEventsTouch = { start: e[0], move: e[1], end: e[2], cancel: e[3] }, r.touchEventsDesktop = { start: t[0], move: t[1], end: t[2] }, r.support.touch || !r.params.simulateTouch ? r.touchEventsTouch : r.touchEventsDesktop }(), touchEventsData: { isTouched: void 0, isMoved: void 0, allowTouchCallbacks: void 0, touchStartTime: void 0, isScrolling: void 0, currentTranslate: void 0, startTranslate: void 0, allowThresholdMove: void 0, focusableElements: r.params.focusableElements, lastClickTime: u(), clickTimeout: void 0, velocities: [], allowMomentumBounce: void 0, isTouchEvent: void 0, startMoving: void 0 }, allowClick: !0, allowTouchMove: r.params.allowTouchMove, touches: { startX: 0, startY: 0, currentX: 0, currentY: 0, diff: 0 }, imagesToLoad: [], imagesLoaded: 0 }), r.emit("_swiper"), r.params.init && r.init(), r } enable() { const e = this; e.enabled || (e.enabled = !0, e.params.grabCursor && e.setGrabCursor(), e.emit("enable")) } disable() { const e = this; e.enabled && (e.enabled = !1, e.params.grabCursor && e.unsetGrabCursor(), e.emit("disable")) } setProgress(e, t) { const s = this; e = Math.min(Math.max(e, 0), 1); const a = s.minTranslate(), i = (s.maxTranslate() - a) * e + a; s.translateTo(i, void 0 === t ? 0 : t), s.updateActiveIndex(), s.updateSlidesClasses() } emitContainerClasses() { const e = this; if (!e.params._emitClasses || !e.el) return; const t = e.el.className.split(" ").filter((t => 0 === t.indexOf("swiper") || 0 === t.indexOf(e.params.containerModifierClass))); e.emit("_containerClasses", t.join(" ")) } getSlideClasses(e) { const t = this; return t.destroyed ? "" : e.className.split(" ").filter((e => 0 === e.indexOf("swiper-slide") || 0 === e.indexOf(t.params.slideClass))).join(" ") } emitSlidesClasses() { const e = this; if (!e.params._emitClasses || !e.el) return; const t = []; e.slides.each((s => { const a = e.getSlideClasses(s); t.push({ slideEl: s, classNames: a }), e.emit("_slideClass", s, a) })), e.emit("_slideClasses", t) } slidesPerViewDynamic(e, t) { void 0 === e && (e = "current"), void 0 === t && (t = !1); const { params: s, slides: a, slidesGrid: i, slidesSizesGrid: r, size: n, activeIndex: l } = this; let o = 1; if (s.centeredSlides) { let e, t = a[l].swiperSlideSize; for (let s = l + 1; s < a.length; s += 1)a[s] && !e && (t += a[s].swiperSlideSize, o += 1, t > n && (e = !0)); for (let s = l - 1; s >= 0; s -= 1)a[s] && !e && (t += a[s].swiperSlideSize, o += 1, t > n && (e = !0)) } else if ("current" === e) for (let e = l + 1; e < a.length; e += 1) { (t ? i[e] + r[e] - i[l] < n : i[e] - i[l] < n) && (o += 1) } else for (let e = l - 1; e >= 0; e -= 1) { i[l] - i[e] < n && (o += 1) } return o } update() { const e = this; if (!e || e.destroyed) return; const { snapGrid: t, params: s } = e; function a() { const t = e.rtlTranslate ? -1 * e.translate : e.translate, s = Math.min(Math.max(t, e.maxTranslate()), e.minTranslate()); e.setTranslate(s), e.updateActiveIndex(), e.updateSlidesClasses() } let i; s.breakpoints && e.setBreakpoint(), e.updateSize(), e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), e.params.freeMode && e.params.freeMode.enabled ? (a(), e.params.autoHeight && e.updateAutoHeight()) : (i = ("auto" === e.params.slidesPerView || e.params.slidesPerView > 1) && e.isEnd && !e.params.centeredSlides ? e.slideTo(e.slides.length - 1, 0, !1, !0) : e.slideTo(e.activeIndex, 0, !1, !0), i || a()), s.watchOverflow && t !== e.snapGrid && e.checkOverflow(), e.emit("update") } changeDirection(e, t) { void 0 === t && (t = !0); const s = this, a = s.params.direction; return e || (e = "horizontal" === a ? "vertical" : "horizontal"), e === a || "horizontal" !== e && "vertical" !== e || (s.$el.removeClass(`${s.params.containerModifierClass}${a}`).addClass(`${s.params.containerModifierClass}${e}`), s.emitContainerClasses(), s.params.direction = e, s.slides.each((t => { "vertical" === e ? t.style.width = "" : t.style.height = "" })), s.emit("changeDirection"), t && s.update()), s } changeLanguageDirection(e) { const t = this; t.rtl && "rtl" === e || !t.rtl && "ltr" === e || (t.rtl = "rtl" === e, t.rtlTranslate = "horizontal" === t.params.direction && t.rtl, t.rtl ? (t.$el.addClass(`${t.params.containerModifierClass}rtl`), t.el.dir = "rtl") : (t.$el.removeClass(`${t.params.containerModifierClass}
13rtl`), t.el.dir = "ltr"), t.update()) } mount(e) { const t = this; if (t.mounted) return !0; const s = d(e || t.params.el); if (!(e = s[0])) return !1; e.swiper = t; const i = () => `.${(t.params.wrapperClass || "").trim().split(" ").join(".")}`; let r = (() => { if (e && e.shadowRoot && e.shadowRoot.querySelector) { const t = d(e.shadowRoot.querySelector(i())); return t.children = e => s.children(e), t } return s.children ? s.children(i()) : d(s).children(i()) })(); if (0 === r.length && t.params.createElements) { const e = a().createElement("div"); r = d(e), e.className = t.params.wrapperClass, s.append(e), s.children(`.${t.params.slideClass}`).each((e => { r.append(e) })) } return Object.assign(t, { $el: s, el: e, $wrapperEl: r, wrapperEl: r[0], mounted: !0, rtl: "rtl" === e.dir.toLowerCase() || "rtl" === s.css("direction"), rtlTranslate: "horizontal" === t.params.direction && ("rtl" === e.dir.toLowerCase() || "rtl" === s.css("direction")), wrongRTL: "-webkit-box" === r.css("display") }), !0 } init(e) { const t = this; if (t.initialized) return t; return !1 === t.mount(e) || (t.emit("beforeInit"), t.params.breakpoints && t.setBreakpoint(), t.addClasses(), t.params.loop && t.loopCreate(), t.updateSize(), t.updateSlides(), t.params.watchOverflow && t.checkOverflow(), t.params.grabCursor && t.enabled && t.setGrabCursor(), t.params.preloadImages && t.preloadImages(), t.params.loop ? t.slideTo(t.params.initialSlide + t.loopedSlides, 0, t.params.runCallbacksOnInit, !1, !0) : t.slideTo(t.params.initialSlide, 0, t.params.runCallbacksOnInit, !1, !0), t.attachEvents(), t.initialized = !0, t.emit("init"), t.emit("afterInit")), t } destroy(e, t) { void 0 === e && (e = !0), void 0 === t && (t = !0); const s = this, { params: a, $el: i, $wrapperEl: r, slides: n } = s; return void 0 === s.params || s.destroyed || (s.emit("beforeDestroy"), s.initialized = !1, s.detachEvents(), a.loop && s.loopDestroy(), t && (s.removeClasses(), i.removeAttr("style"), r.removeAttr("style"), n && n.length && n.removeClass([a.slideVisibleClass, a.slideActiveClass, a.slideNextClass, a.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")), s.emit("destroy"), Object.keys(s.eventsListeners).forEach((e => { s.off(e) })), !1 !== e && (s.$el[0].swiper = null, function (e) { const t = e; Object.keys(t).forEach((e => { try { t[e] = null } catch (e) { } try { delete t[e] } catch (e) { } })) }(s)), s.destroyed = !0), null } static extendDefaults(e) { g(_, e) } static get extendedDefaults() { return _ } static get defaults() { return W } static installModule(e) { V.prototype.__modules__ || (V.prototype.__modules__ = []); const t = V.prototype.__modules__; "function" == typeof e && t.indexOf(e) < 0 && t.push(e) } static use(e) { return Array.isArray(e) ? (e.forEach((e => V.installModule(e))), V) : (V.installModule(e), V) } } function F(e, t, s, i) { const r = a();
vendor: 20,005 bytes, line 13
13 return e.params.createElements && Object.keys(i).forEach((a => { if (!s[a] && !0 === s.auto) { let n = e.$el.children(`.${i[a]}`)[0]; n || (n = r.createElement("div"), n.className = i[a], e.$el.append(n)), s[a] = n, t[a] = n } })), s } function U(e) { return void 0 === e && (e = ""), `.${e.trim().replace(/([\.:!\/])/g, "\\$1").replace(/ /g, ".")}` } function K(e) { const t = this, { $wrapperEl: s, params: a } = t; if (a.loop && t.loopDestroy(), "object" == typeof e && "length" in e) for (let t = 0; t < e.length; t += 1)e[t] && s.append(e[t]); else s.append(e); a.loop && t.loopCreate(), a.observer || t.update() } function Z(e) { const t = this, { params: s, $wrapperEl: a, activeIndex: i } = t; s.loop && t.loopDestroy(); let r = i + 1; if ("object" == typeof e && "length" in e) { for (let t = 0; t < e.length; t += 1)e[t] && a.prepend(e[t]); r = i + e.length } else a.prepend(e); s.loop && t.loopCreate(), s.observer || t.update(), t.slideTo(r, 0, !1) } function Q(e, t) { const s = this, { $wrapperEl: a, params: i, activeIndex: r } = s; let n = r; i.loop && (n -= s.loopedSlides, s.loopDestroy(), s.slides = a.children(`.${i.slideClass}`)); const l = s.slides.length; if (e <= 0) return void s.prependSlide(t); if (e >= l) return void s.appendSlide(t); let o = n > e ? n + 1 : n; const d = []; for (let t = l - 1; t >= e; t -= 1) { const e = s.slides.eq(t); e.remove(), d.unshift(e) } if ("object" == typeof t && "length" in t) { for (let e = 0; e < t.length; e += 1)t[e] && a.append(t[e]); o = n > e ? n + t.length : n } else a.append(t); for (let e = 0; e < d.length; e += 1)a.append(d[e]); i.loop && s.loopCreate(), i.observer || s.update(), i.loop ? s.slideTo(o + s.loopedSlides, 0, !1) : s.slideTo(o, 0, !1) } function J(e) { const t = this, { params: s, $wrapperEl: a, activeIndex: i } = t; let r = i; s.loop && (r -= t.loopedSlides, t.loopDestroy(), t.slides = a.children(`.${s.slideClass}`)); let n, l = r; if ("object" == typeof e && "length" in e) { for (let s = 0; s < e.length; s += 1)n = e[s], t.slides[n] && t.slides.eq(n).remove(), n < l && (l -= 1); l = Math.max(l, 0) } else n = e, t.slides[n] && t.slides.eq(n).remove(), n < l && (l -= 1), l = Math.max(l, 0); s.loop && t.loopCreate(), s.observer || t.update(), s.loop ? t.slideTo(l + t.loopedSlides, 0, !1) : t.slideTo(l, 0, !1) } function ee() { const e = this, t = []; for (let s = 0; s < e.slides.length; s += 1)t.push(s); e.removeSlide(t) } function te(e) { const { effect: t, swiper: s, on: a, setTranslate: i, setTransition: r, overwriteParams: n, perspective: l, recreateShadows: o, getEffectParams: d } = e; let c; a("beforeInit", (() => { if (s.params.effect !== t) return; s.classNames.push(`${s.params.containerModifierClass}${t}`), l && l() && s.classNames.push(`${s.params.containerModifierClass}3d`); const e = n ? n() : {}; Object.assign(s.params, e), Object.assign(s.originalParams, e) })), a("setTranslate", (() => { s.params.effect === t && i() })), a("setTransition", ((e, a) => { s.params.effect === t && r(a) })), a("transitionEnd", (() => { if (s.params.effect === t && o) { if (!d || !d().slideShadows) return; s.slides.each((e => { s.$(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").remove() })), o() } })), a("virtualUpdate", (() => { s.params.effect === t && (s.slides.length || (c = !0), requestAnimationFrame((() => { c && s.slides && s.slides.length && (i(), c = !1) }))) })) } function se(e, t) { return e.transformEl ? t.find(e.transformEl).css({ "backface-visibility": "hidden", "-webkit-backface-visibility": "hidden" }) : t } function ae(e) { let { swiper: t, duration: s, transformEl: a, allSlides: i } = e; const { slides: r, activeIndex: n, $wrapperEl: l } = t; if (t.params.virtualTranslate && 0 !== s) { let e, s = !1; e = i ? a ? r.find(a) : r : a ? r.eq(n).find(a) : r.eq(n), e.transitionEnd((() => { if (s) return; if (!t || t.destroyed) return; s = !0, t.animating = !1; const e = ["webkitTransitionEnd", "transitionend"]; for (let t = 0; t < e.length; t += 1)l.trigger(e[t]) })) } } function ie(e, t, s) { const a = "swiper-slide-shadow" + (s ? `-${s}` : ""), i = e.transformEl ? t.find(e.transformEl) : t; let r = i.children(`.${a}`); return r.length || (r = d(`<div class="swiper-slide-shadow${s ? `-${s}` : ""}"></div>`), i.append(r)), r } Object.keys(j).forEach((e => { Object.keys(j[e]).forEach((t => { V.prototype[t] = j[e][t] })) })), V.use([function (e) { let { swiper: t, on: s, emit: a } = e; const i = r(); let n = null, l = null; const o = () => { t && !t.destroyed && t.initialized && (a("beforeResize"), a("resize")) }, d = () => { t && !t.destroyed && t.initialized && a("orientationchange") }; s("init", (() => { t.params.resizeObserver && void 0 !== i.ResizeObserver ? t && !t.destroyed && t.initialized && (n = new ResizeObserver((e => { l = i.requestAnimationFrame((() => { const { width: s, height: a } = t; let i = s, r = a; e.forEach((e => { let { contentBoxSize: s, contentRect: a, target: n } = e; n && n !== t.el || (i = a ? a.width : (s[0] || s).inlineSize, r = a ? a.height : (s[0] || s).blockSize) })), i === s && r === a || o() })) })), n.observe(t.el)) : (i.addEventListener("resize", o), i.addEventListener("orientationchange", d)) })), s("destroy", (() => { l && i.cancelAnimationFrame(l), n && n.unobserve && t.el && (n.unobserve(t.el), n = null), i.removeEventListener("resize", o), i.removeEventListener("orientationchange", d) })) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; const n = [], l = r(), o = function (e, t) { void 0 === t && (t = {}); const s = new (l.MutationObserver || l.WebkitMutationObserver)((e => { if (1 === e.length) return void i("observerUpdate", e[0]); const t = function () { i("observerUpdate", e[0]) }; l.requestAnimationFrame ? l.requestAnimationFrame(t) : l.setTimeout(t, 0) })); s.observe(e, { attributes: void 0 === t.attributes || t.attributes, childList: void 0 === t.childList || t.childList, characterData: void 0 === t.characterData || t.characterData }), n.push(s) }; s({ observer: !1, observeParents: !1, observeSlideChildren: !1 }), a("init", (() => { if (t.params.observer) { if (t.params.observeParents) { const e = t.$el.parents(); for (let t = 0; t < e.length; t += 1)o(e[t]) } o(t.$el[0], { childList: t.params.observeSlideChildren }), o(t.$wrapperEl[0], { attributes: !1 }) } })), a("destroy", (() => { n.forEach((e => { e.disconnect() })), n.splice(0, n.length) })) }]); const re = [function (e) { let t, { swiper: s, extendParams: a, on: i, emit: r } = e; function n(e, t) { const a = s.params.virtual; if (a.cache && s.virtual.cache[t]) return s.virtual.cache[t]; const i = a.renderSlide ? d(a.renderSlide.call(s, e, t)) : d(`<div class="${s.params.slideClass}" data-swiper-slide-index="${t}">${e}</div>`); return i.attr("data-swiper-slide-index") || i.attr("data-swiper-slide-index", t), a.cache && (s.virtual.cache[t] = i), i } function l(e) { const { slidesPerView: t, slidesPerGroup: a, centeredSlides: i } = s.params, { addSlidesBefore: l, addSlidesAfter: o } = s.params.virtual, { from: d, to: c, slides: p, slidesGrid: u, offset: h } = s.virtual; s.params.cssMode || s.updateActiveIndex(); const m = s.activeIndex || 0; let f, g, v; f = s.rtlTranslate ? "right" : s.isHorizontal() ? "left" : "top", i ? (g = Math.floor(t / 2) + a + o, v = Math.floor(t / 2) + a + l) : (g = t + (a - 1) + o, v = a + l); const w = Math.max((m || 0) - v, 0), b = Math.min((m || 0) + g, p.length - 1), x = (s.slidesGrid[w] || 0) - (s.slidesGrid[0] || 0); function y() { s.updateSlides(), s.updateProgress(), s.updateSlidesClasses(), s.lazy && s.params.lazy.enabled && s.lazy.load(), r("virtualUpdate") } if (Object.assign(s.virtual, { from: w, to: b, offset: x, slidesGrid: s.slidesGrid }), d === w && c === b && !e) return s.slidesGrid !== u && x !== h && s.slides.css(f, `${x}px`), s.updateProgress(), void r("virtualUpdate"); if (s.params.virtual.renderExternal) return s.params.virtual.renderExternal.call(s, { offset: x, from: w, to: b, slides: function () { const e = []; for (let t = w; t <= b; t += 1)e.push(p[t]); return e }() }), void (s.params.virtual.renderExternalUpdate ? y() : r("virtualUpdate")); const E = [], C = []; if (e) s.$wrapperEl.find(`.${s.params.slideClass}`).remove(); else for (let e = d; e <= c; e += 1)(e < w || e > b) && s.$wrapperEl.find(`.${s.params.slideClass}[data-swiper-slide-index="${e}"]`).remove(); for (let t = 0; t < p.length; t += 1)t >= w && t <= b && (void 0 === c || e ? C.push(t) : (t > c && C.push(t), t < d && E.push(t))); C.forEach((e => { s.$wrapperEl.append(n(p[e], e)) })), E.sort(((e, t) => t - e)).forEach((e => { s.$wrapperEl.prepend(n(p[e], e)) })), s.$wrapperEl.children(".swiper-slide").css(f, `${x}px`), y() } a({ virtual: { enabled: !1, slides: [], cache: !0, renderSlide: null, renderExternal: null, renderExternalUpdate: !0, addSlidesBefore: 0, addSlidesAfter: 0 } }), s.virtual = { cache: {}, from: void 0, to: void 0, slides: [], offset: 0, slidesGrid: [] }, i("beforeInit", (() => { s.params.virtual.enabled && (s.virtual.slides = s.params.virtual.slides, s.classNames.push(`${s.params.containerModifierClass}virtual`), s.params.watchSlidesProgress = !0, s.originalParams.watchSlidesProgress = !0, s.params.initialSlide || l()) })), i("setTranslate", (() => { s.params.virtual.enabled && (s.params.cssMode && !s._immediateVirtual ? (clearTimeout(t), t = setTimeout((() => { l() }), 100)) : l()) })), i("init update resize", (() => { s.params.virtual.enabled && s.params.cssMode && v(s.wrapperEl, "--swiper-virtual-size", `${s.virtualSize}px`) })), Object.assign(s.virtual, { appendSlide: function (e) { if ("object" == typeof e && "length" in e) for (let t = 0; t < e.length; t += 1)e[t] && s.virtual.slides.push(e[t]); else s.virtual.slides.push(e); l(!0) }, prependSlide: function (e) { const t = s.activeIndex; let a = t + 1, i = 1; if (Array.isArray(e)) { for (let t = 0; t < e.length; t += 1)e[t] && s.virtual.slides.unshift(e[t]); a = t + e.length, i = e.length } else s.virtual.slides.unshift(e); if (s.params.virtual.cache) { const e = s.virtual.cache, t = {}; Object.keys(e).forEach((s => { const a = e[s], r = a.attr("data-swiper-slide-index"); r && a.attr("data-swiper-slide-index", parseInt(r, 10) + i), t[parseInt(s, 10) + i] = a })), s.virtual.cache = t } l(!0), s.slideTo(a, 0) }, removeSlide: function (e) { if (null == e) return; let t = s.activeIndex; if (Array.isArray(e)) for (let a = e.length - 1; a >= 0; a -= 1)s.virtual.slides.splice(e[a], 1), s.params.virtual.cache && delete s.virtual.cache[e[a]], e[a] < t && (t -= 1), t = Math.max(t, 0); else s.virtual.slides.splice(e, 1), s.params.virtual.cache && delete s.virtual.cache[e], e < t && (t -= 1), t = Math.max(t, 0); l(!0), s.slideTo(t, 0) }, removeAllSlides: function () { s.virtual.slides = [], s.params.virtual.cache && (s.virtual.cache = {}), l(!0), s.slideTo(0, 0) }, update: l }) }, function (e) { let { swiper: t, extendParams: s, on: i, emit: n } = e; const l = a(), o = r(); function c(e) { if (!t.enabled) return; const { rtlTranslate: s } = t; let a = e; a.originalEvent && (a = a.originalEvent); const i = a.keyCode || a.charCode, r = t.params.keyboard.pageUpDown, d = r && 33 === i, c = r && 34 === i, p = 37 === i, u = 39 === i, h = 38 === i, m = 40 === i; if (!t.allowSlideNext && (t.isHorizontal() && u || t.isVertical() && m || c)) return !1; if (!t.allowSlidePrev && (t.isHorizontal() && p || t.isVertical() && h || d)) return !1; if (!(a.shiftKey || a.altKey || a.ctrlKey || a.metaKey || l.activeElement && l.activeElement.nodeName && ("input" === l.activeElement.nodeName.toLowerCase() || "textarea" === l.activeElement.nodeName.toLowerCase()))) { if (t.params.keyboard.onlyInViewport && (d || c || p || u || h || m)) { let e = !1; if (t.$el.parents(`.${t.params.slideClass}`).length > 0 && 0 === t.$el.parents(`.${t.params.slideActiveClass}`).length) return; const a = t.$el, i = a[0].clientWidth, r = a[0].clientHeight, n = o.innerWidth, l = o.innerHeight, d = t.$el.offset(); s && (d.left -= t.$el[0].scrollLeft); const c = [[d.left, d.top], [d.left + i, d.top], [d.left, d.top + r], [d.left + i, d.top + r]]; for (let t = 0; t < c.length; t += 1) { const s = c[t]; if (s[0] >= 0 && s[0] <= n && s[1] >= 0 && s[1] <= l) { if (0 === s[0] && 0 === s[1]) continue; e = !0 } } if (!e) return } t.isHorizontal() ? ((d || c || p || u) && (a.preventDefault ? a.preventDefault() : a.returnValue = !1), ((c || u) && !s || (d || p) && s) && t.slideNext(), ((d || p) && !s || (c || u) && s) && t.slidePrev()) : ((d || c || h || m) && (a.preventDefault ? a.preventDefault() : a.returnValue = !1), (c || m) && t.slideNext(), (d || h) && t.slidePrev()), n("keyPress", i) } } function p() { t.keyboard.enabled || (d(l).on("keydown", c), t.keyboard.enabled = !0) } function u() { t.keyboard.enabled && (d(l).off("keydown", c), t.keyboard.enabled = !1) } t.keyboard = { enabled: !1 }, s({ keyboard: { enabled: !1, onlyInViewport: !0, pageUpDown: !0 } }), i("init", (() => { t.params.keyboard.enabled && p() })), i("destroy", (() => { t.keyboard.enabled && u() })), Object.assign(t.keyboard, { enable: p, disable: u }) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; const n = r(); let l; s({ mousewheel: { enabled: !1, releaseOnEdges: !1, invert: !1, forceToAxis: !1, sensitivity: 1, eventsTarget: "container", thresholdDelta: null, thresholdTime: null } }), t.mousewheel = { enabled: !1 }; let o, c = u(); const h = []; function m() { t.enabled && (t.mouseEntered = !0) } function f() { t.enabled && (t.mouseEntered = !1) } function g(e) { return !(t.params.mousewheel.thresholdDelta && e.delta < t.params.mousewheel.thresholdDelta) && (!(t.params.mousewheel.thresholdTime && u() - c < t.params.mousewheel.thresholdTime) && (e.delta >= 6 && u() - c < 60 || (e.direction < 0 ? t.isEnd && !t.params.loop || t.animating || (t.slideNext(), i("scroll", e.raw)) : t.isBeginning && !t.params.loop || t.animating || (t.slidePrev(), i("scroll", e.raw)), c = (new n.Date).getTime(), !1))) } function v(e) { let s = e, a = !0; if (!t.enabled) return; const r = t.params.mousewheel; t.params.cssMode && s.preventDefault(); let n = t.$el; if ("container" !== t.params.mousewheel.eventsTarget && (n = d(t.params.mousewheel.eventsTarget)), !t.mouseEntered && !n[0].contains(s.target) && !r.releaseOnEdges) return !0; s.originalEvent && (s = s.originalEvent); let c = 0; const m = t.rtlTranslate ? -1 : 1, f = function (e) { let t = 0, s = 0, a = 0, i = 0; return "detail" in e && (s = e.detail), "wheelDelta" in e && (s = -e.wheelDelta / 120), "wheelDeltaY" in e && (s = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = s, s = 0), a = 10 * t, i = 10 * s, "deltaY" in e && (i = e.deltaY), "deltaX" in e && (a = e.deltaX), e.shiftKey && !a && (a = i, i = 0), (a || i) && e.deltaMode && (1 === e.deltaMode ? (a *= 40, i *= 40) : (a *= 800, i *= 800)), a && !t && (t = a < 1 ? -1 : 1), i && !s && (s = i < 1 ? -1 : 1), { spinX: t, spinY: s, pixelX: a, pixelY: i } }(s); if (r.forceToAxis) if (t.isHorizontal()) { if (!(Math.abs(f.pixelX) > Math.abs(f.pixelY))) return !0; c = -f.pixelX * m } else { if (!(Math.abs(f.pixelY) > Math.abs(f.pixelX))) return !0; c = -f.pixelY } else c = Math.abs(f.pixelX) > Math.abs(f.pixelY) ? -f.pixelX * m : -f.pixelY; if (0 === c) return !0; r.invert && (c = -c); let v = t.getTranslate() + c * r.sensitivity; if (v >= t.minTranslate() && (v = t.minTranslate()), v <= t.maxTranslate() && (v = t.maxTranslate()), a = !!t.params.loop || !(v === t.minTranslate() || v === t.maxTranslate()), a && t.params.nested && s.stopPropagation(), t.params.freeMode && t.params.freeMode.enabled) { const e = { time: u(), delta: Math.abs(c), direction: Math.sign(c) }, a = o && e.time < o.time + 500 && e.delta <= o.delta && e.direction === o.direction; if (!a) { o = void 0, t.params.loop && t.loopFix(); let n = t.getTranslate() + c * r.sensitivity; const d = t.isBeginning, u = t.isEnd; if (n >= t.minTranslate() && (n = t.minTranslate()), n <= t.maxTranslate() && (n = t.maxTranslate()), t.setTransition(0), t.setTranslate(n), t.updateProgress(), t.updateActiveIndex(), t.updateSlidesClasses(), (!d && t.isBeginning || !u && t.isEnd) && t.updateSlidesClasses(), t.params.freeMode.sticky) { clearTimeout(l), l = void 0, h.length >= 15 && h.shift(); const s = h.length ? h[h.length - 1] : void 0, a = h[0]; if (h.push(e), s && (e.delta > s.delta || e.direction !== s.direction)) h.splice(0); else if (h.length >= 15 && e.time - a.time < 500 && a.delta - e.delta >= 1 && e.delta <= 6) { const s = c > 0 ? .8 : .2; o = e, h.splice(0), l = p((() => { t.slideToClosest(t.params.speed, !0, void 0, s) }), 0) } l || (l = p((() => { o = e, h.splice(0), t.slideToClosest(t.params.speed, !0, void 0, .5) }), 500)) } if (a || i("scroll", s), t.params.autoplay && t.params.autoplayDisableOnInteraction && t.autoplay.stop(), n === t.minTranslate() || n === t.maxTranslate()) return !0 } } else { const s = { time: u(), delta: Math.abs(c), direction: Math.sign(c), raw: e }; h.length >= 2 && h.shift(); const a = h.length ? h[h.length - 1] : void 0; if (h.push(s), a ? (s.direction !== a.direction || s.delta > a.delta || s.time > a.time + 150) && g(s) : g(s), function (e) { const s = t.params.mousewheel; if (e.direction < 0) { if (t.isEnd && !t.params.loop && s.releaseOnEdges) return !0 } else if (t.isBeginning && !t.params.loop && s.releaseOnEdges) return !0; return !1 }(s)) return !0 } return s.preventDefault ? s.preventDefault() : s.returnValue = !1, !1 } function w(e) { let s = t.$el; "container" !== t.params.mousewheel.eventsTarget && (s = d(t.params.mousewheel.eventsTarget)), s[e]("mouseenter", m), s[e]("mouseleave", f), s[e]("wheel", v) } function b() { return t.params.cssMode ? (t.wrapperEl.removeEventListener("wheel", v), !0) : !t.mousewheel.enabled && (w("on"), t.mousewheel.enabled = !0, !0) } function x() { return t.params.cssMode ? (t.wrapperEl.addEventListener(event, v), !0) : !!t.mousewheel.enabled && (w("off"), t.mousewheel.enabled = !1, !0) } a("init", (() => { !t.params.mousewheel.enabled && t.params.cssMode && x(), t.params.mousewheel.enabled && b() })), a("destroy", (() => { t.params.cssMode && b(), t.mousewheel.enabled && x() })), Object.assign(t.mousewheel, { enable: b, disable: x }) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; function r(e) { let s; return e && (s = d(e), t.params.uniqueNavElements && "string" == typeof e && s.length > 1 && 1 === t.$el.find(e).length && (s = t.$el.find(e))), s } function n(e, s) { const a = t.params.navigation; e && e.length > 0 && (e[s ? "addClass" : "removeClass"](a.disabledClass), e[0] && "BUTTON" === e[0].tagName && (e[0].disabled = s), t.params.watchOverflow && t.enabled && e[t.isLocked ? "addClass" : "removeClass"](a.lockClass)) } function l() { if (t.params.loop) return; const { $nextEl: e, $prevEl: s } = t.navigation; n(s, t.isBeginning && !t.params.rewind), n(e, t.isEnd && !t.params.rewind) } function o(e) { e.preventDefault(), (!t.isBeginning || t.params.loop || t.params.rewind) && (t.slidePrev(), i("navigationPrev")) } function c(e) { e.preventDefault(), (!t.isEnd || t.params.loop || t.params.rewind) && (t.slideNext(), i("navigationNext")) } function p() { const e = t.params.navigation; if (t.params.navigation = F(t, t.originalParams.navigation, t.params.navigation, { nextEl: "swiper-button-next", prevEl: "swiper-button-prev" }), !e.nextEl && !e.prevEl) return; const s = r(e.nextEl), a = r(e.prevEl); s && s.length > 0 && s.on("click", c), a && a.length > 0 && a.on("click", o), Object.assign(t.navigation, { $nextEl: s, nextEl: s && s[0], $prevEl: a, prevEl: a && a[0] }), t.enabled || (s && s.addClass(e.lockClass), a && a.addClass(e.lockClass)) } function u() { const { $nextEl: e, $prevEl: s } = t.navigation; e && e.length && (e.off("click", c), e.removeClass(t.params.navigation.disabledClass)), s && s.length && (s.off("
13click", o), s.removeClass(t.params.navigation.disabledClass)) } s({ navigation: { nextEl: null, prevEl: null, hideOnClick: !1, disabledClass: "swiper-button-disabled", hiddenClass: "swiper-button-hidden", lockClass: "swiper-button-lock", navigationDisabledClass: "swiper-navigation-disabled" } }), t.navigation = { nextEl: null, $nextEl: null, prevEl: null, $prevEl: null }, a("init", (() => { !1 === t.params.navigation.enabled ? h() : (p(), l()) })), a("toEdge fromEdge lock unlock", (() => { l() })), a("destroy", (() => { u() })), a("enable disable", (() => { const { $nextEl: e, $prevEl: s } = t.navigation; e && e[t.enabled ? "removeClass" : "addClass"](t.params.navigation.lockClass), s && s[t.enabled ? "removeClass" : "addClass"](t.params.navigation.lockClass) })), a("click", ((e, s) => { const { $nextEl: a, $prevEl: r } = t.navigation, n = s.target; if (t.params.navigation.hideOnClick && !d(n).is(r) && !d(n).is(a)) { if (t.pagination && t.params.pagination && t.params.pagination.clickable && (t.pagination.el === n || t.pagination.el.contains(n))) return; let e; a ? e = a.hasClass(t.params.navigation.hiddenClass) : r && (e = r.hasClass(t.params.navigation.hiddenClass)), i(!0 === e ? "navigationShow" : "navigationHide"), a && a.toggleClass(t.params.navigation.hiddenClass), r && r.toggleClass(t.params.navigation.hiddenClass) } })); const h = () => { t.$el.addClass(t.params.navigation.navigationDisabledClass), u() }; Object.assign(t.navigation, { enable: () => { t.$el.removeClass(t.params.navigation.navigationDisabledClass), p(), l() }, disable: h, update: l, init: p, destroy: u }) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; const r = "swiper-pagination"; let n; s({ pagination: { el: null, bulletElement: "span", clickable: !1, hideOnClick: !1, renderBullet: null, renderProgressbar: null, renderFraction: null, renderCustom: null, progressbarOpposite: !1, type: "bullets", dynamicBullets: !1, dynamicMainBullets: 1, formatFractionCurrent: e => e, formatFractionTotal: e => e, bulletClass: `${r}-bullet`, bulletActiveClass: `${r}-bullet-active`, modifierClass: `${r}-`, currentClass: `${r}-current`, totalClass: `${r}-total`, hiddenClass: `${r}-hidden`, progressbarFillClass: `${r}-progressbar-fill`, progressbarOppositeClass: `${r}-progressbar-opposite`, clickableClass: `${r}-clickable`, lockClass: `${r}-lock`, horizontalClass: `${r}-horizontal`, verticalClass: `${r}-vertical`, paginationDisabledClass: `${r}-disabled` } }), t.pagination = { el: null, $el: null, bullets: [] }; let l = 0; function o() { return !t.params.pagination.el || !t.pagination.el || !t.pagination.$el || 0 === t.pagination.$el.length } function c(e, s) { const { bulletActiveClass: a } = t.params.pagination; e[s]().addClass(`${a}-${s}`)[s]().addClass(`${a}-${s}-${s}`) } function p() { const e = t.rtl, s = t.params.pagination; if (o()) return; const a = t.virtual && t.params.virtual.enabled ? t.virtual.slides.length : t.slides.length, r = t.pagination.$el; let p; const u = t.params.loop ? Math.ceil((a - 2 * t.loopedSlides) / t.params.slidesPerGroup) : t.snapGrid.length; if (t.params.loop ? (p = Math.ceil((t.activeIndex - t.loopedSlides) / t.params.slidesPerGroup), p > a - 1 - 2 * t.loopedSlides && (p -= a - 2 * t.loopedSlides), p > u - 1 && (p -= u), p < 0 && "bullets" !== t.params.paginationType && (p = u + p)) : p = void 0 !== t.snapIndex ? t.snapIndex : t.activeIndex || 0, "bullets" === s.type && t.pagination.bullets && t.pagination.bullets.length > 0) { const a = t.pagination.bullets; let i, o, u; if (s.dynamicBullets && (n = a.eq(0)[t.isHorizontal() ? "outerWidth" : "outerHeight"](!0), r.css(t.isHorizontal() ? "width" : "height", n * (s.dynamicMainBullets + 4) + "px"), s.dynamicMainBullets > 1 && void 0 !== t.previousIndex && (l += p - (t.previousIndex - t.loopedSlides || 0), l > s.dynamicMainBullets - 1 ? l = s.dynamicMainBullets - 1 : l < 0 && (l = 0)), i = Math.max(p - l, 0), o = i + (Math.min(a.length, s.dynamicMainBullets) - 1), u = (o + i) / 2), a.removeClass(["", "-next", "-next-next", "-prev", "-prev-prev", "-main"].map((e => `${s.bulletActiveClass}${e}`)).join(" ")), r.length > 1) a.each((e => { const t = d(e), a = t.index(); a === p && t.addClass(s.bulletActiveClass), s.dynamicBullets && (a >= i && a <= o && t.addClass(`${s.bulletActiveClass}-main`), a === i && c(t, "prev"), a === o && c(t, "next")) })); else { const e = a.eq(p), r = e.index(); if (e.addClass(s.bulletActiveClass), s.dynamicBullets) { const e = a.eq(i), n = a.eq(o); for (let e = i; e <= o; e += 1)a.eq(e).addClass(`${s.bulletActiveClass}-main`); if (t.params.loop) if (r >= a.length) { for (let e = s.dynamicMainBullets; e >= 0; e -= 1)a.eq(a.length - e).addClass(`${s.bulletActiveClass}-main`); a.eq(a.length - s.dynamicMainBullets - 1).addClass(`${s.bulletActiveClass}-prev`) } else c(e, "prev"), c(n, "next"); else c(e, "prev"), c(n, "next") } } if (s.dynamicBullets) { const i = Math.min(a.length, s.dynamicMainBullets + 4), r = (n * i - n) / 2 - u * n, l = e ? "right" : "left"; a.css(t.isHorizontal() ? l : "top", `${r}px`) } } if ("fraction" === s.type && (r.find(U(s.currentClass)).text(s.formatFractionCurrent(p + 1)), r.find(U(s.totalClass)).text(s.formatFractionTotal(u))), "progressbar" === s.type) { let e; e = s.progressbarOpposite ? t.isHorizontal() ? "vertical" : "horizontal" : t.isHorizontal() ? "horizontal" : "vertical"; const a = (p + 1) / u; let i = 1, n = 1; "horizontal" === e ? i = a : n = a, r.find(U(s.progressbarFillClass)).transform(`translate3d(0,
130,0) scaleX(${i}) scaleY(${n})`).transition(t.params.speed) } "custom" === s.type && s.renderCustom ? (r.html(s.renderCustom(t, p + 1, u)), i("paginationRender", r[0])) : i("paginationUpdate", r[0]), t.params.watchOverflow && t.enabled && r[t.isLocked ? "addClass" : "removeClass"](s.lockClass) } function u() { const e = t.params.pagination; if (o()) return; const s = t.virtual && t.params.virtual.enabled ? t.virtual.slides.length : t.slides.length, a = t.pagination.$el; let r = ""; if ("bullets" === e.type) { let i = t.params.loop ? Math.ceil((s - 2 * t.loopedSlides) / t.params.slidesPerGroup) : t.snapGrid.length; t.params.freeMode && t.params.freeMode.enabled && !t.params.loop && i > s && (i = s); for (let s = 0; s < i; s += 1)e.renderBullet ? r += e.renderBullet.call(t, s, e.bulletClass) : r += `<${e.bulletElement} class="${e.bulletClass}"></${e.bulletElement}>`; a.html(r), t.pagination.bullets = a.find(U(e.bulletClass)) } "fraction" === e.type && (r = e.renderFraction ? e.renderFraction.call(t, e.currentClass, e.totalClass) : `<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`, a.html(r)), "progressbar" === e.type && (r = e.renderProgressbar ? e.renderProgressbar.call(t, e.progressbarFillClass) : `<span class="${e.progressbarFillClass}"></span>`, a.html(r)), "custom" !== e.type && i("paginationRender", t.pagination.$el[0]) } function h() { t.params.pagination = F(t, t.originalParams.pagination, t.params.pagination, { el: "swiper-pagination" }); const e = t.params.pagination; if (!e.el) return; let s = d(e.el); 0 !== s.length && (t.params.uniqueNavElements && "string" == typeof e.el && s.length > 1 && (s = t.$el.find(e.el), s.length > 1 && (s = s.filter((e => d(e).parents(".swiper")[0] === t.el)))), "bullets" === e.type && e.clickable && s.addClass(e.clickableClass), s.addClass(e.modifierClass + e.type), s.addClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), "bullets" === e.type && e.dynamicBullets && (s.addClass(`${e.modifierClass}${e.type}-dynamic`), l = 0, e.dynamicMainBullets < 1 && (e.dynamicMainBullets = 1)), "progressbar" === e.type && e.progressbarOpposite && s.addClass(e.progressbarOppositeClass), e.clickable && s.on("click", U(e.bulletClass), (function (e) { e.preventDefault(); let s = d(this).index() * t.params.slidesPerGroup; t.params.loop && (s += t.loopedSlides), t.slideTo(s) })), Object.assign(t.pagination, { $el: s, el: s[0] }), t.enabled || s.addClass(e.lockClass)) } function m() { const e = t.params.pagination; if (o()) return; const s = t.pagination.$el; s.removeClass(e.hiddenClass), s.removeClass(e.modifierClass + e.type), s.removeClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), t.pagination.bullets && t.pagination.bullets.removeClass && t.pagination.bullets.removeClass(e.bulletActiveClass), e.clickable && s.off("click", U(e.bulletClass)) } a("init", (() => { !1 === t.params.pagination.enabled ? f() : (h(), u(), p()) })), a("activeIndexChange", (() => { (t.params.loop || void 0 === t.snapIndex) && p() })), a("snapIndexChange", (() => { t.params.loop || p() })), a("slidesLengthChange", (() => { t.params.loop && (u(), p()) })), a("snapGridLengthChange", (() => { t.params.loop || (u(), p()) })), a("destroy", (() => { m() })), a("enable disable", (() => { const { $el: e } = t.pagination; e && e[t.enabled ? "removeClass" : "addClass"](t.params.pagination.lockClass) })), a("lock unlock", (() => { p() })), a("click", ((e, s) => { const a = s.target, { $el: r } = t.pagination; if (t.params.pagination.el && t.params.pagination.hideOnClick && r && r.length > 0 && !d(a).hasClass(t.params.pagination.bulletClass)) { if (t.navigation && (t.navigation.nextEl && a === t.navigation.nextEl || t.navigation.prevEl && a === t.navigation.prevEl)) return; const e = r.hasClass(t.params.pagination.hiddenClass); i(!0 === e ? "paginationShow" : "paginationHide"), r.toggleClass(t.params.pagination.hiddenClass) } })); const f = () => { t.$el.addClass(t.params.pagination.paginationDisabledClass), t.pagination.$el && t.pagination.$el.addClass(t.params.pagination.paginationDisabledClass), m() }; Object.assign(t.pagination, { enable: () => { t.$el.removeClass(t.params.pagination.paginationDisabledClass), t.pagination.$el && t.pagination.$el.removeClass(t.params.pagination.paginationDisabledClass), h(), u(), p() }, disable: f, render: u, update: p, init: h, destroy: m }) }, function (e) { let { swiper: t, extendParams: s, on: i, emit: r }
vendor: 10,412 bytes, line 13
13 = e; const n = a(); let l, o, c, u, h = !1, m = null, f = null; function g() { if (!t.params.scrollbar.el || !t.scrollbar.el) return; const { scrollbar: e, rtlTranslate: s, progress: a } = t, { $dragEl: i, $el: r } = e, n = t.params.scrollbar; let l = o, d = (c - o) * a; s ? (d = -d, d > 0 ? (l = o - d, d = 0) : -d + o > c && (l = c + d)) : d < 0 ? (l = o + d, d = 0) : d + o > c && (l = c - d), t.isHorizontal() ? (i.transform(`translate3d(${d}px, 0, 0)`), i[0].style.width = `${l}px`) : (i.transform(`translate3d(0px, ${d}px, 0)`), i[0].style.height = `${l}px`), n.hide && (clearTimeout(m), r[0].style.opacity = 1, m = setTimeout((() => { r[0].style.opacity = 0, r.transition(400) }), 1e3)) } function v() { if (!t.params.scrollbar.el || !t.scrollbar.el) return; const { scrollbar: e } = t, { $dragEl: s, $el: a } = e; s[0].style.width = "", s[0].style.height = "", c = t.isHorizontal() ? a[0].offsetWidth : a[0].offsetHeight, u = t.size / (t.virtualSize + t.params.slidesOffsetBefore - (t.params.centeredSlides ? t.snapGrid[0] : 0)), o = "auto" === t.params.scrollbar.dragSize ? c * u : parseInt(t.params.scrollbar.dragSize, 10), t.isHorizontal() ? s[0].style.width = `${o}px` : s[0].style.height = `${o}px`, a[0].style.display = u >= 1 ? "none" : "", t.params.scrollbar.hide && (a[0].style.opacity = 0), t.params.watchOverflow && t.enabled && e.$el[t.isLocked ? "addClass" : "removeClass"](t.params.scrollbar.lockClass) } function w(e) { return t.isHorizontal() ? "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientX : e.clientX : "touchstart" === e.type || "touchmove" === e.type ? e.targetTouches[0].clientY : e.clientY } function b(e) { const { scrollbar: s, rtlTranslate: a } = t, { $el: i } = s; let r; r = (w(e) - i.offset()[t.isHorizontal() ? "left" : "top"] - (null !== l ? l : o / 2)) / (c - o), r = Math.max(Math.min(r, 1), 0), a && (r = 1 - r); const n = t.minTranslate() + (t.maxTranslate() - t.minTranslate()) * r; t.updateProgress(n), t.setTranslate(n), t.updateActiveIndex(), t.updateSlidesClasses() } function x(e) { const s = t.params.scrollbar, { scrollbar: a, $wrapperEl: i } = t, { $el: n, $dragEl: o } = a; h = !0, l = e.target === o[0] || e.target === o ? w(e) - e.target.getBoundingClientRect()[t.isHorizontal() ? "left" : "top"] : null, e.preventDefault(), e.stopPropagation(), i.transition(100), o.transition(100), b(e), clearTimeout(f), n.transition(0), s.hide && n.css("opacity", 1), t.params.cssMode && t.$wrapperEl.css("scroll-snap-type", "none"), r("scrollbarDragStart", e) } function y(e) { const { scrollbar: s, $wrapperEl: a } = t, { $el: i, $dragEl: n } = s; h && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, b(e), a.transition(0), i.transition(0), n.transition(0), r("scrollbarDragMove", e)) } function E(e) { const s = t.params.scrollbar, { scrollbar: a, $wrapperEl: i } = t, { $el: n } = a; h && (h = !1, t.params.cssMode && (t.$wrapperEl.css("scroll-snap-type", ""), i.transition("")), s.hide && (clearTimeout(f), f = p((() => { n.css("opacity", 0), n.transition(400) }), 1e3)), r("scrollbarDragEnd", e), s.snapOnRelease && t.slideToClosest()) } function C(e) { const { scrollbar: s, touchEventsTouch: a, touchEventsDesktop: i, params: r, support: l } = t, o = s.$el; if (!o) return; const d = o[0], c = !(!l.passiveListener || !r.passiveListeners) && { passive: !1, capture: !1 }, p = !(!l.passiveListener || !r.passiveListeners) && { passive: !0, capture: !1 }; if (!d) return; const u = "on" === e ? "addEventListener" : "removeEventListener"; l.touch ? (d[u](a.start, x, c), d[u](a.move, y, c), d[u](a.end, E, p)) : (d[u](i.start, x, c), n[u](i.move, y, c), n[u](i.end, E, p)) } function T() { const { scrollbar: e, $el: s } = t; t.params.scrollbar = F(t, t.originalParams.scrollbar, t.params.scrollbar, { el: "swiper-scrollbar" }); const a = t.params.scrollbar; if (!a.el) return; let i = d(a.el); t.params.uniqueNavElements && "string" == typeof a.el && i.length > 1 && 1 === s.find(a.el).length && (i = s.find(a.el)), i.addClass(t.isHorizontal() ? a.horizontalClass : a.verticalClass); let r = i.find(`.${t.params.scrollbar.dragClass}`); 0 === r.length && (r = d(`<div class="${t.params.scrollbar.dragClass}"></div>`), i.append(r)), Object.assign(e, { $el: i, el: i[0], $dragEl: r, dragEl: r[0] }), a.draggable && t.params.scrollbar.el && t.scrollbar.el && C("on"), i && i[t.enabled ? "removeClass" : "addClass"](t.params.scrollbar.lockClass) } function $() { const e = t.params.scrollbar, s = t.scrollbar.$el; s && s.removeClass(t.isHorizontal() ? e.horizontalClass : e.verticalClass), t.params.scrollbar.el && t.scrollbar.el && C("off") } s({ scrollbar: { el: null, dragSize: "auto", hide: !1, draggable: !1, snapOnRelease: !0, lockClass: "swiper-scrollbar-lock", dragClass: "swiper-scrollbar-drag", scrollbarDisabledClass: "swiper-scrollbar-disabled", horizontalClass: "swiper-scrollbar-horizontal", verticalClass: "swiper-scrollbar-vertical" } }), t.scrollbar = { el: null, dragEl: null, $el: null, $dragEl: null }, i("init", (() => { !1 === t.params.scrollbar.enabled ? S() : (T(), v(), g()) })), i("update resize observerUpdate lock unlock", (() => { v() })), i("setTranslate", (() => { g() })), i("setTransition", ((e, s) => { !function (e) { t.params.scrollbar.el && t.scrollbar.el && t.scrollbar.$dragEl.transition(e) }(s) })), i("enable disable", (() => { const { $el: e } = t.scrollbar; e && e[t.enabled ? "removeClass" : "addClass"](t.params.scrollbar.lockClass) })), i("destroy", (() => { $() })); const S = () => { t.$el.addClass(t.params.scrollbar.scrollbarDisabledClass), t.scrollbar.$el && t.scrollbar.$el.addClass(t.params.scrollbar.scrollbarDisabledClass), $() }; Object.assign(t.scrollbar, { enable: () => { t.$el.removeClass(t.params.scrollbar.scrollbarDisabledClass), t.scrollbar.$el && t.scrollbar.$el.removeClass(t.params.scrollbar.scrollbarDisabledClass), T(), v(), g() }, disable: S, updateSize: v, setTranslate: g, init: T, destroy: $ }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ parallax: { enabled: !1 } }); const i = (e, s) => { const { rtl: a } = t, i = d(e), r = a ? -1 : 1, n = i.attr("data-swiper-parallax") || "0"; let l = i.attr("data-swiper-parallax-x"), o = i.attr("data-swiper-parallax-y"); const c = i.attr("data-swiper-parallax-scale"), p = i.attr("data-swiper-parallax-opacity"); if (l || o ? (l = l || "0", o = o || "0") : t.isHorizontal() ? (l = n, o = "0") : (o = n, l = "0"), l = l.indexOf("%") >= 0 ? parseInt(l, 10) * s * r + "%" : l * s * r + "px", o = o.indexOf("%") >= 0 ? parseInt(o, 10) * s + "%" : o * s + "px", null != p) { const e = p - (p - 1) * (1 - Math.abs(s)); i[0].style.opacity = e } if (null == c) i.transform(`translate3d(${l}, ${o}, 0px)`); else { const e = c - (c - 1) * (1 - Math.abs(s)); i.transform(`translate3d(${l}, ${o}, 0px) scale(${e})`) } }, r = () => { const { $el: e, slides: s, progress: a, snapGrid: r } = t; e.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e => { i(e, a) })), s.each(((e, s) => { let n = e.progress; t.params.slidesPerGroup > 1 && "auto" !== t.params.slidesPerView && (n += Math.ceil(s / 2) - a * (r.length - 1)), n = Math.min(Math.max(n, -1), 1), d(e).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((e => { i(e, n) })) })) }; a("beforeInit", (() => { t.params.parallax.enabled && (t.params.watchSlidesProgress = !0, t.originalParams.watchSlidesProgress = !0) })), a("init", (() => { t.params.parallax.enabled && r() })), a("setTranslate", (() => { t.params.parallax.enabled && r() })), a("setTransition", ((e, s) => { t.params.parallax.enabled && function (e) { void 0 === e && (e = t.params.speed); const { $el: s } = t; s.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((t => { const s = d(t); let a = parseInt(s.attr("data-swiper-parallax-duration"), 10) || e; 0 === e && (a = 0), s.transition(a) })) }(s) })) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; const n = r(); s({ zoom: { enabled: !1, maxRatio: 3, minRatio: 1, toggle: !0, containerClass: "swiper-zoom-container", zoomedSlideClass: "swiper-slide-zoomed" } }), t.zoom = { enabled: !1 }; let l, o, c, p = 1, u = !1; const m = { $slideEl: void 0, slideWidth: void 0, slideHeight: void 0, $imageEl: void 0, $imageWrapEl: void 0, maxRatio: 3 }, f = { isTouched: void 0, isMoved: void 0, currentX: void 0, currentY: void 0, minX: void 0, minY: void 0, maxX: void 0, maxY: void 0, width: void 0, height: void 0, startX: void 0, startY: void 0, touchesStart: {}, touchesCurrent: {} }, g = { x: void 0, y: void 0, prevPositionX: void 0, prevPositionY: void 0, prevTime: void 0 }; let v = 1; function w(e) { if (e.targetTouches.length < 2) return 1; const t = e.targetTouches[0].pageX, s = e.targetTouches[0].pageY, a = e.targetTouches[1].pageX, i = e.targetTouches[1].pageY; return Math.sqrt((a - t) ** 2 + (i - s) ** 2) } function b(e) { const s = t.support, a = t.params.zoom; if (o = !1, c = !1, !s.gestures) { if ("touchstart" !== e.type || "touchstart" === e.type && e.targetTouches.length < 2) return; o = !0, m.scaleStart = w(e) } m.$slideEl && m.$slideEl.length || (m.$slideEl = d(e.target).closest(`.${t.params.slideClass}`), 0 === m.$slideEl.length && (m.$slideEl = t.slides.eq(t.activeIndex)), m.$imageEl = m.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${a.containerClass}`), m.maxRatio = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, 0 !== m.$imageWrapEl.length) ? (m.$imageEl && m.$imageEl.transition(0), u = !0) : m.$imageEl = void 0 } function x(e) { const s = t.support, a = t.params.zoom, i = t.zoom; if (!s.gestures) { if ("touchmove" !== e.type || "touchmove" === e.type && e.targetTouches.length < 2) return; c = !0, m.scaleMove = w(e) } m.$imageEl && 0 !== m.$imageEl.length ? (s.gestures ? i.scale = e.scale * p : i.scale = m.scaleMove / m.scaleStart * p, i.scale > m.maxRatio && (i.scale = m.maxRatio - 1 + (i.scale - m.maxRatio + 1) ** .5), i.scale < a.minRatio && (i.scale = a.minRatio + 1 - (a.minRatio - i.scale + 1) ** .5), m.$imageEl.transform(`translate3d(0,
130,0) scale(${i.scale})`)) : "gesturechange" === e.type && b(e) } function y(e) { const s = t.device, a = t.support, i = t.params.zoom, r = t.zoom; if (!a.gestures) { if (!o || !c) return; if ("touchend" !== e.type || "touchend" === e.type && e.changedTouches.length < 2 && !s.android) return; o = !1, c = !1 } m.$imageEl && 0 !== m.$imageEl.length && (r.scale = Math.max(Math.min(r.scale, m.maxRatio), i.minRatio), m.$imageEl.transition(t.params.speed).transform(`translate3d(0,0,0) scale(${r.scale})`), p = r.scale, u = !1, 1 === r.scale && (m.$slideEl = void 0)) } function E(e) { const s = t.zoom; if (!m.$imageEl || 0 === m.$imageEl.length) return; if (t.allowClick = !1, !f.isTouched || !m.$slideEl) return; f.isMoved || (f.width = m.$imageEl[0].offsetWidth, f.height = m.$imageEl[0].offsetHeight, f.startX = h(m.$imageWrapEl[0], "x") || 0, f.startY = h(m.$imageWrapEl[0], "y") || 0, m.slideWidth = m.$slideEl[0].offsetWidth, m.slideHeight = m.$slideEl[0].offsetHeight, m.$imageWrapEl.transition(0)); const a = f.width * s.scale, i = f.height * s.scale; if (!(a < m.slideWidth && i < m.slideHeight)) { if (f.minX = Math.min(m.slideWidth / 2 - a / 2, 0), f.maxX = -f.minX, f.minY = Math.min(m.slideHeight / 2 - i / 2, 0), f.maxY = -f.minY, f.touchesCurrent.x = "touchmove" === e.type ? e.targetTouches[0].pageX : e.pageX, f.touchesCurrent.y = "touchmove" === e.type ? e.targetTouches[0].pageY : e.pageY, !f.isMoved && !u) { if (t.isHorizontal() && (Math.floor(f.minX) === Math.floor(f.startX) && f.touchesCurrent.x < f.touchesStart.x || Math.floor(f.maxX) === Math.floor(f.startX) && f.touchesCurrent.x > f.touchesStart.x)) return void (f.isTouched = !1); if (!t.isHorizontal() && (Math.floor(f.minY) === Math.floor(f.startY) && f.touchesCurrent.y < f.touchesStart.y || Math.floor(f.maxY) === Math.floor(f.startY) && f.touchesCurrent.y > f.touchesStart.y)) return void (f.isTouched = !1) } e.cancelable && e.preventDefault(), e.stopPropagation(), f.isMoved = !0, f.currentX = f.touchesCurrent.x - f.touchesStart.x + f.startX, f.currentY = f.touchesCurrent.y - f.touchesStart.y + f.startY, f.currentX < f.minX && (f.currentX = f.minX + 1 - (f.minX - f.currentX + 1) ** .8), f.currentX > f.maxX && (f.currentX = f.maxX - 1 + (f.currentX - f.maxX + 1) ** .8), f.currentY < f.minY && (f.currentY = f.minY + 1 - (f.minY - f.currentY + 1) ** .8), f.currentY > f.maxY && (f.currentY = f.maxY - 1 + (f.currentY - f.maxY + 1) ** .8), g.prevPositionX || (g.prevPositionX = f.touchesCurrent.x), g.prevPositionY || (g.prevPositionY = f.touchesCurrent.y), g.prevTime || (g.prevTime = Date.now()), g.x = (f.touchesCurrent.x - g.prevPositionX) / (Date.now() - g.prevTime) / 2, g.y = (f.touchesCurrent.y - g.prevPositionY) / (Date.now() - g.prevTime) / 2, Math.abs(f.touchesCurrent.x - g.prevPositionX) < 2 && (g.x = 0), Math.abs(f.touchesCurrent.y - g.prevPositionY) < 2 && (g.y = 0), g.prevPositionX = f.touchesCurrent.x, g.prevPositionY = f.touchesCurrent.y, g.prevTime = Date.now(), m.$imageWrapEl.transform(`translate3d(${f.currentX}px, ${f.currentY}px,0)`) } } function C() { const e = t.zoom; m.$slideEl && t.previousIndex !== t.activeIndex && (m.$imageEl && m.$imageEl.transform("translate3d(0,0,0) scale(1)"), m.$imageWrapEl && m.$imageWrapEl.transform("translate3d(0,0,0)"), e.scale = 1, p = 1, m.$slideEl = void 0, m.$imageEl = void 0, m.$imageWrapEl = void 0) } function T(e) { const s = t.zoom, a = t.params.zoom; if (m.$slideEl || (e && e.target && (m.$slideEl = d(e.target).closest(`.${t.params.slideClass}`)), m.$slideEl || (t.params.virtual && t.params.virtual.enabled && t.virtual ? m.$slideEl = t.$wrapperEl.children(`.${t.params.slideActiveClass}`) : m.$slideEl = t.slides.eq(t.activeIndex)), m.$imageEl = m.$slideEl.find(`.${a.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${a.containerClass}`)), !m.$imageEl || 0 === m.$imageEl.length || !m.$imageWrapEl || 0 === m.$imageWrapEl.length) return; let i, r, l, o, c, u, h, g, v, w, b, x, y, E, C, T, $, S; t.params.cssMode && (t.wrapperEl.style.overflow = "hidden", t.wrapperEl.style.touchAction = "none"), m.$slideEl.addClass(`${a.zoomedSlideClass}`), void 0 === f.touchesStart.x && e ? (i = "touchend" === e.type ? e.changedTouches[0].pageX : e.pageX, r = "touchend" === e.type ? e.changedTouches[0].pageY : e.pageY) : (i = f.touchesStart.x, r = f.touchesStart.y), s.scale = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, p = m.$imageWrapEl.attr("data-swiper-zoom") || a.maxRatio, e ? ($ = m.$slideEl[0].offsetWidth, S = m.$slideEl[0].offsetHeight, l = m.$slideEl.offset().left + n.scrollX, o = m.$slideEl.offset().top + n.scrollY, c = l + $ / 2 - i, u = o + S / 2 - r, v = m.$imageEl[0].offsetWidth, w = m.$imageEl[0].offsetHeight, b = v * s.scale, x = w * s.scale, y = Math.min($ / 2 - b / 2, 0), E = Math.min(S / 2 - x / 2, 0), C = -y, T = -E, h = c * s.scale, g = u * s.scale, h < y && (h = y), h > C && (h = C), g < E && (g = E), g > T && (g = T)) : (h = 0, g = 0), m.$imageWrapEl.transition(300).transform(`translate3d(${h}px, ${g}
13px,0)`), m.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${s.scale})`) } function $() { const e = t.zoom, s = t.params.zoom; m.$slideEl || (t.params.virtual && t.params.virtual.enabled && t.virtual ? m.$slideEl = t.$wrapperEl.children(`.${t.params.slideActiveClass}`) : m.$slideEl = t.slides.eq(t.activeIndex), m.$imageEl = m.$slideEl.find(`.${s.containerClass}`).eq(0).find("picture, img, svg, canvas, .swiper-zoom-target").eq(0), m.$imageWrapEl = m.$imageEl.parent(`.${s.containerClass}`)), m.$imageEl && 0 !== m.$imageEl.length && m.$imageWrapEl && 0 !== m.$imageWrapEl.length && (t.params.cssMode && (t.wrapperEl.style.overflow = "", t.wrapperEl.style.touchAction = ""), e.scale = 1, p = 1, m.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"), m.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"), m.$slideEl.removeClass(`${s.zoomedSlideClass}`), m.$slideEl = void 0) } function S(e) { const s = t.zoom; s.scale && 1 !== s.scale ? $() : T(e) } function M() { const e = t.support; return { passiveListener: !("touchstart" !== t.touchEvents.start || !e.passiveListener || !t.params.passiveListeners) && { passive: !0, capture: !1 }, activeListenerWithCapture: !e.passiveListener || { passive: !1, capture: !0 } } } function P() { return `.${t.params.slideClass}` } function k(e) { const { passiveListener: s } = M(), a = P(); t.$wrapperEl[e]("gesturestart", a, b, s), t.$wrapperEl[e]("gesturechange", a, x, s), t.$wrapperEl[e]("gestureend", a, y, s) } function z() { l || (l = !0, k("on")) } function L() { l && (l = !1, k("off")) } function O() { const e = t.zoom; if (e.enabled) return; e.enabled = !0; const s = t.support, { passiveListener: a, activeListenerWithCapture: i } = M(), r = P(); s.gestures ? (t.$wrapperEl.on(t.touchEvents.start, z, a), t.$wrapperEl.on(t.touchEvents.end, L, a)) : "touchstart" === t.touchEvents.start && (t.$wrapperEl.on(t.touchEvents.start, r, b, a), t.$wrapperEl.on(t.touchEvents.move, r, x, i), t.$wrapperEl.on(t.touchEvents.end, r, y, a), t.touchEvents.cancel && t.$wrapperEl.on(t.touchEvents.cancel, r, y, a)), t.$wrapperEl.on(t.touchEvents.move, `.${t.params.zoom.containerClass}`, E, i) } function I() { const e = t.zoom; if (!e.enabled) return; const s = t.support; e.enabled = !1; const { passiveListener: a, activeListenerWithCapture: i } = M(), r = P(); s.gestures ? (t.$wrapperEl.off(t.touchEvents.start, z, a), t.$wrapperEl.off(t.touchEvents.end, L, a)) : "touchstart" === t.touchEvents.start && (t.$wrapperEl.off(t.touchEvents.start, r, b, a), t.$wrapperEl.off(t.touchEvents.move, r, x, i), t.$wrapperEl.off(t.touchEvents.end, r, y, a), t.touchEvents.cancel && t.$wrapperEl.off(t.touchEvents.cancel, r, y, a)), t.$wrapperEl.off(t.touchEvents.move, `.${t.params.zoom.containerClass}`, E, i) } Object.defineProperty(t.zoom, "scale", { get: () => v, set(e) { if (v !== e) { const t = m.$imageEl ? m.$imageEl[0] : void 0, s = m.$slideEl ? m.$slideEl[0] : void 0; i("zoomChange", e, t, s) } v = e } }), a("init", (() => { t.params.zoom.enabled && O() })), a("destroy", (() => { I() })), a("touchStart", ((e, s) => { t.zoom.enabled && function (e) { const s = t.device; m.$imageEl && 0 !== m.$imageEl.length && (f.isTouched || (s.android && e.cancelable && e.preventDefault(), f.isTouched = !0, f.touchesStart.x = "touchstart" === e.type ? e.targetTouches[0].pageX : e.pageX, f.touchesStart.y = "touchstart" === e.type ? e.targetTouches[0].pageY : e.pageY)) }(s) })), a("touchEnd", ((e, s) => { t.zoom.enabled && function () { const e = t.zoom; if (!m.$imageEl || 0 === m.$imageEl.length) return; if (!f.isTouched || !f.isMoved) return f.isTouched = !1, void (f.isMoved = !1); f.isTouched = !1, f.isMoved = !1; let s = 300, a = 300; const i = g.x * s, r = f.currentX + i, n = g.y * a, l = f.currentY + n; 0 !== g.x && (s = Math.abs((r - f.currentX) / g.x)), 0 !== g.y && (a = Math.abs((l - f.currentY) / g.y)); const o = Math.max(s, a); f.currentX = r, f.currentY = l; const d = f.width * e.scale, c = f.height * e.scale; f.minX = Math.min(m.slideWidth / 2 - d / 2, 0), f.maxX = -f.minX, f.minY = Math.min(m.slideHeight / 2 - c / 2, 0), f.maxY = -f.minY, f.currentX = Math.max(Math.min(f.currentX, f.maxX), f.minX), f.currentY = Math.max(Math.min(f.currentY, f.maxY), f.minY), m.$imageWrapEl.transition(o).transform(`translate3d(${f.currentX}px, ${f.currentY}px,0)`) }() })), a("doubleTap", ((e, s) => { !t.animating && t.params.zoom.enabled && t.zoom.enabled && t.params.zoom.toggle && S(s) })), a("transitionEnd", (() => { t.zoom.enabled && t.params.zoom.enabled && C() })), a("slideChange", (() => { t.zoom.enabled && t.params.zoom.enabled && t.params.cssMode && C() })), Object.assign(t.zoom, { enable: O, disable: I, in: T, out: $, toggle: S }) }, function (e) { let { swiper: t, extendParams: s, on: a, emit: i } = e; s({ lazy: { checkInView: !1, enabled: !1, loadPrevNext: !1, loadPrevNextAmount: 1, loadOnTransitionStart: !1, scrollingElement: "", elementClass: "swiper-lazy", loadingClass: "swiper-lazy-loading", loadedClass: "swiper-lazy-loaded", preloaderClass: "swiper-lazy-preloader" } }), t.lazy = {}; let n = !1, l = !1; function o(e, s) { void 0 === s && (s = !0); const a = t.params.lazy; if (void 0 === e) return; if (0 === t.slides.length) return; const r = t.virtual && t.params.virtual.enabled ? t.$wrapperEl.children(`.${t.params.slideClass}[data-swiper-slide-index="${e}
13"]`) : t.slides.eq(e), n = r.find(`.${a.elementClass}:not(.${a.loadedClass}):not(.${a.loadingClass})`); !r.hasClass(a.elementClass) || r.hasClass(a.loadedClass) || r.hasClass(a.loadingClass) || n.push(r[0]), 0 !== n.length && n.each((e => { const n = d(e); n.addClass(a.loadingClass); const l = n.attr("data-background"), c = n.attr("data-src"), p = n.attr("data-srcset"), u = n.attr("data-sizes"), h = n.parent("picture"); t.loadImage(n[0], c || l, p, u, !1, (() => { if (null != t && t && (!t || t.params) && !t.destroyed) { if (l ? (n.css("background-image", `url("${l}")`), n.removeAttr("data-background")) : (p && (n.attr("srcset", p), n.removeAttr("data-srcset")), u && (n.attr("sizes", u), n.removeAttr("data-sizes")), h.length && h.children("source").each((e => { const t = d(e); t.attr("data-srcset") && (t.attr("srcset", t.attr("data-srcset")), t.removeAttr("data-srcset")) })), c && (n.attr("src", c), n.removeAttr("data-src"))), n.addClass(a.loadedClass).removeClass(a.loadingClass), r.find(`.${a.preloaderClass}`).remove(), t.params.loop && s) { const e = r.attr("data-swiper-slide-index"); if (r.hasClass(t.params.slideDuplicateClass)) { o(t.$wrapperEl.children(`[data-swiper-slide-index="${e}"]:not(.${t.params.slideDuplicateClass})`).index(), !1) } else { o(t.$wrapperEl.children(`.${t.params.slideDuplicateClass}[data-swiper-slide-index="${e}"]`).index(), !1) } } i("lazyImageReady", r[0], n[0]), t.params.autoHeight && t.updateAutoHeight() } })), i("lazyImageLoad", r[0], n[0]) })) } function c() { const { $wrapperEl: e, params: s, slides: a, activeIndex: i } = t, r = t.virtual && s.virtual.enabled, n = s.lazy; let c = s.slidesPerView; function p(t) { if (r) { if (e.children(`.${s.slideClass}[data-swiper-slide-index="${t}"]`).length) return !0 } else if (a[t]) return !0; return !1 } function u(e) { return r ? d(e).attr("data-swiper-slide-index") : d(e).index() } if ("auto" === c && (c = 0), l || (l = !0), t.params.watchSlidesProgress) e.children(`.${s.slideVisibleClass}`).each((e => { o(r ? d(e).attr("data-swiper-slide-index") : d(e).index()) })); else if (c > 1) for (let e = i; e < i + c; e += 1)p(e) && o(e); else o(i); if (n.loadPrevNext) if (c > 1 || n.loadPrevNextAmount && n.loadPrevNextAmount > 1) { const e = n.loadPrevNextAmount, t = Math.ceil(c), s = Math.min(i + t + Math.max(e, t), a.length), r = Math.max(i - Math.max(t, e), 0); for (let e = i + t; e < s; e += 1)p(e) && o(e); for (let e = r; e < i; e += 1)p(e) && o(e) } else { const t = e.children(`.${s.slideNextClass}`); t.length > 0 && o(u(t)); const a = e.children(`.${s.slidePrevClass}`); a.length > 0 && o(u(a)) } } function p() { const e = r(); if (!t || t.destroyed) return; const s = t.params.lazy.scrollingElement ? d(t.params.lazy.scrollingElement) : d(e), a = s[0] === e, i = a ? e.innerWidth : s[0].offsetWidth, l = a ? e.innerHeight : s[0].offsetHeight, o = t.$el.offset(), { rtlTranslate: u } = t; let h = !1; u && (o.left -= t.$el[0].scrollLeft); const m = [[o.left, o.top], [o.left + t.width, o.top], [o.left, o.top + t.height], [o.left + t.width, o.top + t.height]]; for (let e = 0; e < m.length; e += 1) { const t = m[e]; if (t[0] >= 0 && t[0] <= i && t[1] >= 0 && t[1] <= l) { if (0 === t[0] && 0 === t[1]) continue; h = !0 } } const f = !("touchstart" !== t.touchEvents.start || !t.support.passiveListener || !t.params.passiveListeners) && { passive: !0, capture: !1 }; h ? (c(), s.off("scroll", p, f)) : n || (n = !0, s.on("scroll", p, f)) } a("beforeInit", (() => { t.params.lazy.enabled && t.params.preloadImages && (t.params.preloadImages = !1) })), a("init", (() => { t.params.lazy.enabled && (t.params.lazy.checkInView ? p() : c()) })), a("scroll", (() => { t.params.freeMode && t.params.freeMode.enabled && !t.params.freeMode.sticky && c() })), a("scrollbarDragMove resize _freeModeNoMomentumRelease", (() => { t.params.lazy.enabled && (t.params.lazy.checkInView ? p() : c()) })), a("transitionStart", (() => { t.params.lazy.enabled && (t.params.lazy.loadOnTransitionStart || !t.params.lazy.loadOnTransitionStart && !l) && (t.params.lazy.checkInView ? p() : c()) })), a("transitionEnd", (() => { t.params.lazy.enabled && !t.params.lazy.loadOnTransitionStart && (t.params.lazy.checkInView ? p() : c()) })), a("slideChange", (() => { const { lazy: e, cssMode: s, watchSlidesProgress: a, touchReleaseOnEdges: i, resistanceRatio: r } = t.params; e.enabled && (s || a && (i || 0 === r)) && c() })), a("destroy", (() => { t.$el && t.$el.find(`.${t.params.lazy.loadingClass}`).removeClass(t.params.lazy.loadingClass) })), Object.assign(t.lazy, { load: c, loadInSlide: o }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; function i(e, t) { const s = function () { let e, t, s; return (a, i) => { for (t = -1, e = a.length; e - t > 1;)s = e + t >> 1, a[s] <= i ? t = s : e = s; return e } }(); let a, i; return this.x = e, this.y = t, this.lastIndex = e.length - 1, this.interpolate = function (e) { return e ? (i = s(this.x, e), a = i - 1, (e - this.x[a]) * (this.y[i] - this.y[a]) / (this.x[i] - this.x[a]) + this.y[a]) : 0 }, this } function r() { t.controller.control && t.controller.spline && (t.controller.spline = void 0, delete t.controller.spline) } s({ controller: { control: void 0, inverse: !1, by: "slide" } }), t.controller = { control: void 0 }, a("beforeInit", (() => { t.controller.control = t.params.controller.control })), a("update", (() => { r() })), a("resize", (() => { r() })), a("observerUpdate", (() => { r() })), a("setTranslate", ((e, s, a) => { t.controller.control && t.controller.setTranslate(s, a) })), a("setTransition", ((e, s, a) => { t.controller.control && t.controller.setTransition(s, a) })), Object.assign(t.controller, { setTranslate: function (e, s) { const a = t.controller.control; let r, n; const l = t.constructor; function o(e) { const s = t.rtlTranslate ? -t.translate : t.translate; "slide" === t.params.controller.by && (!function (e) { t.controller.spline || (t.controller.spline = t.params.loop ? new i(t.slidesGrid, e.slidesGrid) : new i(t.snapGrid, e.snapGrid)) }(e), n = -t.controller.spline.interpolate(-s)), n && "container" !== t.params.controller.by || (r = (e.maxTranslate() - e.minTranslate()) / (t.maxTranslate() - t.minTranslate()), n = (s - t.minTranslate()) * r + e.minTranslate()), t.params.controller.inverse && (n = e.maxTranslate() - n), e.updateProgress(n), e.setTranslate(n, t), e.updateActiveIndex(), e.updateSlidesClasses() } if (Array.isArray(a)) for (let e = 0; e < a.length; e += 1)a[e] !== s && a[e] instanceof l && o(a[e]); else a instanceof l && s !== a && o(a) }, setTransition: function (e, s) { const a = t.constructor, i = t.controller.control; let r; function n(s) { s.setTransition(e, t), 0 !== e && (s.transitionStart(), s.params.autoHeight && p((() => { s.updateAutoHeight() })), s.$wrapperEl.transitionEnd((() => { i && (s.params.loop && "slide" === t.params.controller.by && s.loopFix(), s.transitionEnd()) }))) } if (Array.isArray(i)) for (r = 0; r < i.length; r += 1)i[r] !== s && i[r] instanceof a && n(i[r]); else i instanceof a && s !== i && n(i) } }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ a11y: { enabled: !0, notificationClass: "swiper-notification", prevSlideMessage: "Previous slide", nextSlideMessage: "Next slide", firstSlideMessage: "This is the first slide", lastSlideMessage: "This is the last slide", paginationBulletMessage: "Go to slide {{index}}", slideLabelMessage: "{{index}} / {{slidesLength}}", containerMessage: null, containerRoleDescriptionMessage: null, itemRoleDescriptionMessage: null, slideRole: "group", id: null } }), t.a11y = { clicked: !1 }; let i = null; function r(e) { const t = i; 0 !== t.length && (t.html(""), t.html(e)) } function n(e) { e.attr("tabIndex", "0") } function l(e) { e.attr("tabIndex", "-1") } function o(e, t) { e.attr("role", t) } function c(e, t) { e.attr("aria-roledescription", t) } function p(e, t) { e.attr("aria-label", t) } function u(e) { e.attr("aria-disabled", !0) } function h(e) { e.attr("aria-disabled", !1) } function m(e) { if (13 !== e.keyCode && 32 !== e.keyCode) return; const s = t.params.a11y, a = d(e.target); t.navigation && t.navigation.$nextEl && a.is(t.navigation.$nextEl) && (t.isEnd && !t.params.loop || t.slideNext(), t.isEnd ? r(s.lastSlideMessage) : r(s.nextSlideMessage)), t.navigation && t.navigation.$prevEl && a.is(t.navigation.$prevEl) && (t.isBeginning && !t.params.loop || t.slidePrev(), t.isBeginning ? r(s.firstSlideMessage) : r(s.prevSlideMessage)), t.pagination && a.is(U(t.params.pagination.bulletClass)) && a[0].click() } function f() { return t.pagination && t.pagination.bullets && t.pagination.bullets.length } function g() { return f() && t.params.pagination.clickable } const v = (e, t, s) => { n(e), "BUTTON" !== e[0].tagName && (o(e, "button"), e.on("key
13down", m)), p(e, s), function (e, t) { e.attr("aria-controls", t) }(e, t) }, w = () => { t.a11y.clicked = !0 }, b = () => { requestAnimationFrame((() => { requestAnimationFrame((() => { t.a11y.clicked = !1 })) })) }, x = e => { if (t.a11y.clicked) return; const s = e.target.closest(`.${t.params.slideClass}`); if (!s || !t.slides.includes(s)) return; const a = t.slides.indexOf(s) === t.activeIndex, i = t.params.watchSlidesProgress && t.visibleSlides && t.visibleSlides.includes(s); a || i || (t.isHorizontal() ? t.el.scrollLeft = 0 : t.el.scrollTop = 0, t.slideTo(t.slides.indexOf(s), 0)) }, y = () => { const e = t.params.a11y; e.itemRoleDescriptionMessage && c(d(t.slides), e.itemRoleDescriptionMessage), e.slideRole && o(d(t.slides), e.slideRole); const s = t.params.loop ? t.slides.filter((e => !e.classList.contains(t.params.slideDuplicateClass))).length : t.slides.length; e.slideLabelMessage && t.slides.each(((a, i) => { const r = d(a), n = t.params.loop ? parseInt(r.attr("data-swiper-slide-index"), 10) : i; p(r, e.slideLabelMessage.replace(/\{\{index\}\}/, n + 1).replace(/\{\{slidesLength\}\}/, s)) })) }, E = () => { const e = t.params.a11y; t.$el.append(i); const s = t.$el; e.containerRoleDescriptionMessage && c(s, e.containerRoleDescriptionMessage), e.containerMessage && p(s, e.containerMessage); const a = t.$wrapperEl, r = e.id || a.attr("id") || `swiper-wrapper-${n = 16, void 0 === n && (n = 16), "x".repeat(n).replace(/x/g, (() => Math.round(16 * Math.random()).toString(16)))}`; var n; const l = t.params.autoplay && t.params.autoplay.enabled ? "off" : "polite"; var o; let d, u; o = r, a.attr("id", o), function (e, t) { e.attr("aria-live", t) }(a, l), y(), t.navigation && t.navigation.$nextEl && (d = t.navigation.$nextEl), t.navigation && t.navigation.$prevEl && (u = t.navigation.$prevEl), d && d.length && v(d, r, e.nextSlideMessage), u && u.length && v(u, r, e.prevSlideMessage), g() && t.pagination.$el.on("keydown", U(t.params.pagination.bulletClass), m), t.$el.on("focus", x, !0), t.$el.on("pointerdown", w, !0), t.$el.on("pointerup", b, !0) }; a("beforeInit", (() => { i = d(`<span class="${t.params.a11y.notificationClass}" aria-live="assertive" aria-atomic="true"></span>`) })), a("afterInit", (() => { t.params.a11y.enabled && E() })), a("slidesLengthChange snapGridLengthChange slidesGridLengthChange", (() => { t.params.a11y.enabled && y() })), a("fromEdge toEdge afterInit lock unlock", (() => { t.params.a11y.enabled && function () { if (t.params.loop || t.params.rewind || !t.navigation) return; const { $nextEl: e, $prevEl: s } = t.navigation; s && s.length > 0 && (t.isBeginning ? (u(s), l(s)) : (h(s), n(s))), e && e.length > 0 && (t.isEnd ? (u(e), l(e)) : (h(e), n(e))) }() })), a("paginationUpdate", (() => { t.params.a11y.enabled && function () { const e = t.params.a11y; f() && t.pagination.bullets.each((s => { const a = d(s); t.params.pagination.clickable && (n(a), t.params.pagination.renderBullet || (o(a, "button"), p(a, e.paginationBulletMessage.replace(/\{\{index\}\}/, a.index() + 1)))), a.is(`.${t.params.pagination.bulletActiveClass}`) ? a.attr("aria-current", "true") : a.removeAttr("aria-current") })) }() })), a("destroy", (() => { t.params.a11y.enabled && function () { let e, s; i && i.length > 0 && i.remove(), t.navigation && t.navigation.$nextEl && (e = t.navigation.$nextEl), t.navigation && t.navigation.$prevEl && (s = t.navigation.$prevEl), e && e.off("keydown", m), s && s.off("keydown", m), g() && t.pagination.$el.off("keydown", U(t.params.pagination.bulletClass), m), t.$el.off("focus", x, !0), t.$el.off("pointerdown", w, !0), t.$el.off("pointerup", b, !0) }() })) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ history: { enabled: !1, root: "", replaceState: !1, key: "slides", keepQuery: !1 } }); let i = !1, n = {}; const l = e => e.toString().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, ""), o = e => { const t = r(); let s; s = e ? new URL(e) : t.location; const a = s.pathname.slice(1).split("/").filter((e => "" !== e)), i = a.length; return { key: a[i - 2], value: a[i - 1] } }, d = (e, s) => { const a = r(); if (!i || !t.params.history.enabled) return; let n; n = t.params.url ? new URL(t.params.url) : a.location; const o = t.slides.eq(s); let d = l(o.attr("data-history")); if (t.params.history.root.length > 0) { let s = t.params.history.root; "/" === s[s.length - 1] && (s = s.slice(0, s.length - 1)), d = `${s}/${e}/${d}` } else n.pathname.includes(e) || (d = `${e}/${d}
13`); t.params.history.keepQuery && (d += n.search); const c = a.history.state; c && c.value === d || (t.params.history.replaceState ? a.history.replaceState({ value: d }, null, d) : a.history.pushState({ value: d }, null, d)) }, c = (e, s, a) => { if (s) for (let i = 0, r = t.slides.length; i < r; i += 1) { const r = t.slides.eq(i); if (l(r.attr("data-history")) === s && !r.hasClass(t.params.slideDuplicateClass)) { const s = r.index(); t.slideTo(s, e, a) } } else t.slideTo(0, e, a) }, p = () => { n = o(t.params.url), c(t.params.speed, n.value, !1) }; a("init", (() => { t.params.history.enabled && (() => { const e = r(); if (t.params.history) { if (!e.history || !e.history.pushState) return t.params.history.enabled = !1, void (t.params.hashNavigation.enabled = !0); i = !0, n = o(t.params.url), (n.key || n.value) && (c(0, n.value, t.params.runCallbacksOnInit), t.params.history.replaceState || e.addEventListener("popstate", p)) } })() })), a("destroy", (() => { t.params.history.enabled && (() => { const e = r(); t.params.history.replaceState || e.removeEventListener("popstate", p) })() })), a("transitionEnd _freeModeNoMomentumRelease", (() => { i && d(t.params.history.key, t.activeIndex) })), a("slideChange", (() => { i && t.params.cssMode && d(t.params.history.key, t.activeIndex) })) }, function (e) { let { swiper: t, extendParams: s, emit: i, on: n } = e, l = !1; const o = a(), c = r(); s({ hashNavigation: { enabled: !1, replaceState: !1, watchState: !1 } }); const p = () => { i("hashChange"); const e = o.location.hash.replace("#", ""); if (e !== t.slides.eq(t.activeIndex).attr("data-hash")) { const s = t.$wrapperEl.children(`.${t.params.slideClass}[data-hash="${e}"]`).index(); if (void 0 === s) return; t.slideTo(s) } }, u = () => { if (l && t.params.hashNavigation.enabled) if (t.params.hashNavigation.replaceState && c.history && c.history.replaceState) c.history.replaceState(null, null, `#${t.slides.eq(t.activeIndex).attr("data-hash")}` || ""), i("hashSet"); else { const e = t.slides.eq(t.activeIndex), s = e.attr("data-hash") || e.attr("data-history"); o.location.hash = s || "", i("hashSet") } }; n("init", (() => { t.params.hashNavigation.enabled && (() => { if (!t.params.hashNavigation.enabled || t.params.history && t.params.history.enabled) return; l = !0; const e = o.location.hash.replace("#", ""); if (e) { const s = 0; for (let a = 0, i = t.slides.length; a < i; a += 1) { const i = t.slides.eq(a); if ((i.attr("data-hash") || i.attr("data-history")) === e && !i.hasClass(t.params.slideDuplicateClass)) { const e = i.index(); t.slideTo(e, s, t.params.runCallbacksOnInit, !0) } } } t.params.hashNavigation.watchState && d(c).on("hashchange", p) })() })), n("destroy", (() => { t.params.hashNavigation.enabled && t.params.hashNavigation.watchState && d(c).off("hashchange", p) })), n("transitionEnd _freeModeNoMomentumRelease", (() => { l && u() })), n("slideChange", (() => { l && t.params.cssMode && u() })) }, function (e) { let t, { swiper: s, extendParams: i, on: r, emit: n } = e; function l() { if (!s.size) return s.autoplay.running = !1, void (s.autoplay.paused = !1); const e = s.slides.eq(s.activeIndex); let a = s.params.autoplay.delay; e.attr("data-swiper-autoplay") && (a = e.attr("data-swiper-autoplay") || s.params.autoplay.delay), clearTimeout(t), t = p((() => { let e; s.params.autoplay.reverseDirection ? s.params.loop ? (s.loopFix(), e = s.slidePrev(s.params.speed, !0, !0), n("autoplay")) : s.isBeginning ? s.params.autoplay.stopOnLastSlide ? d() : (e = s.slideTo(s.slides.length - 1, s.params.speed, !0, !0), n("autoplay")) : (e = s.slidePrev(s.params.speed, !0, !0), n("autoplay")) : s.params.loop ? (s.loopFix(), e = s.slideNext(s.params.speed, !0, !0), n("autoplay")) : s.isEnd ? s.params.autoplay.stopOnLastSlide ? d() : (e = s.slideTo(0, s.params.speed, !0, !0), n("autoplay")) : (e = s.slideNext(s.params.speed, !0, !0), n("autoplay")), (s.params.cssMode && s.autoplay.running || !1 === e) && l() }), a) } function o() { return void 0 === t && (!s.autoplay.running && (s.autoplay.running = !0, n("autoplayStart"), l(), !0)) } function d() { return !!s.autoplay.running && (void 0 !== t && (t && (clearTimeout(t), t = void 0), s.autoplay.running = !1, n("autoplayStop"), !0)) } function c(e) { s.autoplay.running && (s.autoplay.paused || (t && clearTimeout(t), s.autoplay.paused = !0, 0 !== e && s.params.autoplay.waitForTransition ? ["transitionend", "webkitTransitionEnd"].forEach((e => { s.$wrapperEl[0].addEventListener(e, h) })) : (s.autoplay.paused = !1, l()))) } function u() { const e = a(); "hidden" === e.visibilityState && s.autoplay.running && c(), "visible" === e.visibilityState && s.autoplay.paused && (l(), s.autoplay.paused = !1) } function h(e) { s && !s.destroyed && s.$wrapperEl && e.target === s.$wrapperEl[0] && (["transitionend", "webkitTransitionEnd"].forEach((e => { s.$wrapperEl[0].removeEventListener(e, h) })), s.autoplay.paused = !1, s.autoplay.running ? l() : d()) } function m() { s.params.autoplay.disableOnInteraction ? d() : (n("autoplayPause"), c()), ["transitionend", "webkitTransitionEnd"].forEach((e => { s.$wrapperEl[0].removeEventListener(e, h) })) } function f() { s.params.autoplay.disableOnInteraction || (s.autoplay.paused = !1, n("autoplayResume"), l()) } s.autoplay = { running: !1, paused: !1 }, i({ autoplay: { enabled: !1, delay: 3e3, waitForTransition: !0, disableOnInteraction: !0, stopOnLastSlide: !1, reverseDirection: !1, pauseOnMouseEnter: !1 } }), r("init", (() => { if (s.params.autoplay.enabled) { o(); a().addEventListener("visibilitychange", u), s.params.autoplay.pauseOnMouseEnter && (s.$el.on("mouseenter", m), s.$el.on("mouseleave", f)) } })), r("beforeTransitionStart", ((e, t, a) => { s.autoplay.running && (a || !s.params.autoplay.disableOnInteraction ? s.autoplay.pause(t) : d()) })), r("sliderFirstMove", (() => { s.autoplay.running && (s.params.autoplay.disableOnInteraction ? d() : c()) })), r("touchEnd", (() => { s.params.cssMode && s.autoplay.paused && !s.params.autoplay.disableOnInteraction && l() })), r("destroy", (() => { s.$el.off("mouseenter", m), s.$el.off("mouseleave", f), s.autoplay.running && d(); a().removeEventListener("visibilitychange", u) })), Object.assign(s.autoplay, { pause: c, run: l, start: o, stop: d }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ thumbs: { swiper: null, multipleActiveThumbs: !0, autoScrollOffset: 0, slideThumbActiveClass: "swiper-slide-thumb-active", thumbsContainerClass: "swiper-thumbs" } }); let i = !1, r = !1; function n() { const e = t.thumbs.swiper; if (!e || e.destroyed) return; const s = e.clickedIndex, a = e.clickedSlide;
vendor: 11,563 bytes, line 13
13 if (a && d(a).hasClass(t.params.thumbs.slideThumbActiveClass)) return; if (null == s) return; let i; if (i = e.params.loop ? parseInt(d(e.clickedSlide).attr("data-swiper-slide-index"), 10) : s, t.params.loop) { let e = t.activeIndex; t.slides.eq(e).hasClass(t.params.slideDuplicateClass) && (t.loopFix(), t._clientLeft = t.$wrapperEl[0].clientLeft, e = t.activeIndex); const s = t.slides.eq(e).prevAll(`[data-swiper-slide-index="${i}"]`).eq(0).index(), a = t.slides.eq(e).nextAll(`[data-swiper-slide-index="${i}"]`).eq(0).index(); i = void 0 === s ? a : void 0 === a ? s : a - e < e - s ? a : s } t.slideTo(i) } function l() { const { thumbs: e } = t.params; if (i) return !1; i = !0; const s = t.constructor; if (e.swiper instanceof s) t.thumbs.swiper = e.swiper, Object.assign(t.thumbs.swiper.originalParams, { watchSlidesProgress: !0, slideToClickedSlide: !1 }), Object.assign(t.thumbs.swiper.params, { watchSlidesProgress: !0, slideToClickedSlide: !1 }); else if (m(e.swiper)) { const a = Object.assign({}, e.swiper); Object.assign(a, { watchSlidesProgress: !0, slideToClickedSlide: !1 }), t.thumbs.swiper = new s(a), r = !0 } return t.thumbs.swiper.$el.addClass(t.params.thumbs.thumbsContainerClass), t.thumbs.swiper.on("tap", n), !0 } function o(e) { const s = t.thumbs.swiper; if (!s || s.destroyed) return; const a = "auto" === s.params.slidesPerView ? s.slidesPerViewDynamic() : s.params.slidesPerView; let i = 1; const r = t.params.thumbs.slideThumbActiveClass; if (t.params.slidesPerView > 1 && !t.params.centeredSlides && (i = t.params.slidesPerView), t.params.thumbs.multipleActiveThumbs || (i = 1), i = Math.floor(i), s.slides.removeClass(r), s.params.loop || s.params.virtual && s.params.virtual.enabled) for (let e = 0; e < i; e += 1)s.$wrapperEl.children(`[data-swiper-slide-index="${t.realIndex + e}"]`).addClass(r); else for (let e = 0; e < i; e += 1)s.slides.eq(t.realIndex + e).addClass(r); const n = t.params.thumbs.autoScrollOffset, l = n && !s.params.loop; if (t.realIndex !== s.realIndex || l) { let i, r, o = s.activeIndex; if (s.params.loop) { s.slides.eq(o).hasClass(s.params.slideDuplicateClass) && (s.loopFix(), s._clientLeft = s.$wrapperEl[0].clientLeft, o = s.activeIndex); const e = s.slides.eq(o).prevAll(`[data-swiper-slide-index="${t.realIndex}"]`).eq(0).index(), a = s.slides.eq(o).nextAll(`[data-swiper-slide-index="${t.realIndex}"]`).eq(0).index(); i = void 0 === e ? a : void 0 === a ? e : a - o == o - e ? s.params.slidesPerGroup > 1 ? a : o : a - o < o - e ? a : e, r = t.activeIndex > t.previousIndex ? "next" : "prev" } else i = t.realIndex, r = i > t.previousIndex ? "next" : "prev"; l && (i += "next" === r ? n : -1 * n), s.visibleSlidesIndexes && s.visibleSlidesIndexes.indexOf(i) < 0 && (s.params.centeredSlides ? i = i > o ? i - Math.floor(a / 2) + 1 : i + Math.floor(a / 2) - 1 : i > o && s.params.slidesPerGroup, s.slideTo(i, e ? 0 : void 0)) } } t.thumbs = { swiper: null }, a("beforeInit", (() => { const { thumbs: e } = t.params; e && e.swiper && (l(), o(!0)) })), a("slideChange update resize observerUpdate", (() => { o() })), a("setTransition", ((e, s) => { const a = t.thumbs.swiper; a && !a.destroyed && a.setTransition(s) })), a("beforeDestroy", (() => { const e = t.thumbs.swiper; e && !e.destroyed && r && e.destroy() })), Object.assign(t.thumbs, { init: l, update: o }) }, function (e) { let { swiper: t, extendParams: s, emit: a, once: i } = e; s({ freeMode: { enabled: !1, momentum: !0, momentumRatio: 1, momentumBounce: !0, momentumBounceRatio: 1, momentumVelocityRatio: 1, sticky: !1, minimumVelocity: .02 } }), Object.assign(t, { freeMode: { onTouchStart: function () { const e = t.getTranslate(); t.setTranslate(e), t.setTransition(0), t.touchEventsData.velocities.length = 0, t.freeMode.onTouchEnd({ currentPos: t.rtl ? t.translate : -t.translate }) }, onTouchMove: function () { const { touchEventsData: e, touches: s } = t; 0 === e.velocities.length && e.velocities.push({ position: s[t.isHorizontal() ? "startX" : "startY"], time: e.touchStartTime }), e.velocities.push({ position: s[t.isHorizontal() ? "currentX" : "currentY"], time: u() }) }, onTouchEnd: function (e) { let { currentPos: s } = e; const { params: r, $wrapperEl: n, rtlTranslate: l, snapGrid: o, touchEventsData: d } = t, c = u() - d.touchStartTime; if (s < -t.minTranslate()) t.slideTo(t.activeIndex); else if (s > -t.maxTranslate()) t.slides.length < o.length ? t.slideTo(o.length - 1) : t.slideTo(t.slides.length - 1); else { if (r.freeMode.momentum) { if (d.velocities.length > 1) { const e = d.velocities.pop(), s = d.velocities.pop(), a = e.position - s.position, i = e.time - s.time; t.velocity = a / i, t.velocity /= 2, Math.abs(t.velocity) < r.freeMode.minimumVelocity && (t.velocity = 0), (i > 150 || u() - e.time > 300) && (t.velocity = 0) } else t.velocity = 0; t.velocity *= r.freeMode.momentumVelocityRatio, d.velocities.length = 0; let e = 1e3 * r.freeMode.momentumRatio; const s = t.velocity * e; let c = t.translate + s; l && (c = -c); let p, h = !1; const m = 20 * Math.abs(t.velocity) * r.freeMode.momentumBounceRatio; let f; if (c < t.maxTranslate()) r.freeMode.momentumBounce ? (c + t.maxTranslate() < -m && (c = t.maxTranslate() - m), p = t.maxTranslate(), h = !0, d.allowMomentumBounce = !0) : c = t.maxTranslate(), r.loop && r.centeredSlides && (f = !0); else if (c > t.minTranslate()) r.freeMode.momentumBounce ? (c - t.minTranslate() > m && (c = t.minTranslate() + m), p = t.minTranslate(), h = !0, d.allowMomentumBounce = !0) : c = t.minTranslate(), r.loop && r.centeredSlides && (f = !0); else if (r.freeMode.sticky) { let e; for (let t = 0; t < o.length; t += 1)if (o[t] > -c) { e = t; break } c = Math.abs(o[e] - c) < Math.abs(o[e - 1] - c) || "next" === t.swipeDirection ? o[e] : o[e - 1], c = -c } if (f && i("transitionEnd", (() => { t.loopFix() })), 0 !== t.velocity) { if (e = l ? Math.abs((-c - t.translate) / t.velocity) : Math.abs((c - t.translate) / t.velocity), r.freeMode.sticky) { const s = Math.abs((l ? -c : c) - t.translate), a = t.slidesSizesGrid[t.activeIndex]; e = s < a ? r.speed : s < 2 * a ? 1.5 * r.speed : 2.5 * r.speed } } else if (r.freeMode.sticky) return void t.slideToClosest(); r.freeMode.momentumBounce && h ? (t.updateProgress(p), t.setTransition(e), t.setTranslate(c), t.transitionStart(!0, t.swipeDirection), t.animating = !0, n.transitionEnd((() => { t && !t.destroyed && d.allowMomentumBounce && (a("momentumBounce"), t.setTransition(r.speed), setTimeout((() => { t.setTranslate(p), n.transitionEnd((() => { t && !t.destroyed && t.transitionEnd() })) }), 0)) }))) : t.velocity ? (a("_freeModeNoMomentumRelease"), t.updateProgress(c), t.setTransition(e), t.setTranslate(c), t.transitionStart(!0, t.swipeDirection), t.animating || (t.animating = !0, n.transitionEnd((() => { t && !t.destroyed && t.transitionEnd() })))) : t.updateProgress(c), t.updateActiveIndex(), t.updateSlidesClasses() } else { if (r.freeMode.sticky) return void t.slideToClosest(); r.freeMode && a("_freeModeNoMomentumRelease") } (!r.freeMode.momentum || c >= r.longSwipesMs) && (t.updateProgress(), t.updateActiveIndex(), t.updateSlidesClasses()) } } } }) }, function (e) { let t, s, a, { swiper: i, extendParams: r } = e; r({ grid: { rows: 1, fill: "column" } }), i.grid = { initSlides: e => { const { slidesPerView: r } = i.params, { rows: n, fill: l } = i.params.grid; s = t / n, a = Math.floor(e / n), t = Math.floor(e / n) === e / n ? e : Math.ceil(e / n) * n, "auto" !== r && "row" === l && (t = Math.max(t, r * n)) }, updateSlide: (e, r, n, l) => { const { slidesPerGroup: o, spaceBetween: d } = i.params, { rows: c, fill: p } = i.params.grid; let u, h, m; if ("row" === p && o > 1) { const s = Math.floor(e / (o * c)), a = e - c * o * s, i = 0 === s ? o : Math.min(Math.ceil((n - s * c * o) / c), o); m = Math.floor(a / i), h = a - m * i + s * o, u = h + m * t / c, r.css({ "-webkit-order": u, order: u }) } else "column" === p ? (h = Math.floor(e / c), m = e - h * c, (h > a || h === a && m === c - 1) && (m += 1, m >= c && (m = 0, h += 1))) : (m = Math.floor(e / s), h = e - m * s); r.css(l("margin-top"), 0 !== m ? d && `${d}px` : "") }, updateWrapperSize: (e, s, a) => { const { spaceBetween: r, centeredSlides: n, roundLengths: l } = i.params, { rows: o } = i.params.grid; if (i.virtualSize = (e + r) * t, i.virtualSize = Math.ceil(i.virtualSize / o) - r, i.$wrapperEl.css({ [a("width")]: `${i.virtualSize + r}px` }), n) { s.splice(0, s.length); const e = []; for (let t = 0; t < s.length; t += 1) { let a = s[t]; l && (a = Math.floor(a)), s[t] < i.virtualSize + s[0] && e.push(a) } s.push(...e) } } } }, function (e) { let { swiper: t } = e; Object.assign(t, { appendSlide: K.bind(t), prependSlide: Z.bind(t), addSlide: Q.bind(t), removeSlide: J.bind(t), removeAllSlides: ee.bind(t) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ fadeEffect: { crossFade: !1, transformEl: null } }), te({ effect: "fade", swiper: t, on: a, setTranslate: () => { const { slides: e } = t, s = t.params.fadeEffect; for (let a = 0; a < e.length; a += 1) { const e = t.slides.eq(a); let i = -e[0].swiperSlideOffset; t.params.virtualTranslate || (i -= t.translate); let r = 0; t.isHorizontal() || (r = i, i = 0); const n = t.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(e[0].progress), 0) : 1 + Math.min(Math.max(e[0].progress, -1), 0); se(s, e).css({ opacity: n }).transform(`translate3d(${i}px, ${r}px, 0px)`) } }, setTransition: e => { const { transformEl: s } = t.params.fadeEffect; (s ? t.slides.find(s) : t.slides).transition(e), ae({ swiper: t, duration: e, transformEl: s, allSlides: !0 }) }, overwriteParams: () => ({ slidesPerView: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !t.params.cssMode }) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ cubeEffect: { slideShadows: !0, shadow: !0, shadowOffset: 20, shadowScale: .94 } }); const i = (e, t, s) => { let a = s ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"), i = s ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom"); 0 === a.length && (a = d(`<div class="swiper-slide-shadow-${s ? "left" : "top"}"></div>`), e.append(a)), 0 === i.length && (i = d(`<div class="swiper-slide-shadow-${s ? "right" : "bottom"}"></div>`), e.append(i)), a.length && (a[0].style.opacity = Math.max(-t, 0)), i.length && (i[0].style.opacity = Math.max(t, 0)) }; te({ effect: "cube", swiper: t, on: a, setTranslate: () => { const { $el: e, $wrapperEl: s, slides: a, width: r, height: n, rtlTranslate: l, size: o, browser: c } = t, p = t.params.cubeEffect, u = t.isHorizontal(), h = t.virtual && t.params.virtual.enabled; let m, f = 0; p.shadow && (u ? (m = s.find(".swiper-cube-shadow"), 0 === m.length && (m = d('<div class="swiper-cube-shadow"></div>'), s.append(m)), m.css({ height: `${r}px` })) : (m = e.find(".swiper-cube-shadow"), 0 === m.length && (m = d('<div class="swiper-cube-shadow"></div>'), e.append(m)))); for (let e = 0; e < a.length; e += 1) { const t = a.eq(e); let s = e; h && (s = parseInt(t.attr("data-swiper-slide-index"), 10)); let r = 90 * s, n = Math.floor(r / 360); l && (r = -r, n = Math.floor(-r / 360)); const d = Math.max(Math.min(t[0].progress, 1), -1); let c = 0, m = 0, g = 0; s % 4 == 0 ? (c = 4 * -n * o, g = 0) : (s - 1) % 4 == 0 ? (c = 0, g = 4 * -n * o) : (s - 2) % 4 == 0 ? (c = o + 4 * n * o, g = o) : (s - 3) % 4 == 0 && (c = -o, g = 3 * o + 4 * o * n), l && (c = -c), u || (m = c, c = 0); const v = `rotateX(${u ? 0 : -r}deg) rotateY(${u ? r : 0}deg) translate3d(${c}
13px, ${m}px, ${g}px)`; d <= 1 && d > -1 && (f = 90 * s + 90 * d, l && (f = 90 * -s - 90 * d)), t.transform(v), p.slideShadows && i(t, d, u) } if (s.css({ "-webkit-transform-origin": `50% 50% -${o / 2}px`, "transform-origin": `50% 50% -${o / 2}px` }), p.shadow) if (u) m.transform(`translate3d(0px, ${r / 2 + p.shadowOffset}px, ${-r / 2}px) rotateX(90deg) rotateZ(0deg) scale(${p.shadowScale})`); else { const e = Math.abs(f) - 90 * Math.floor(Math.abs(f) / 90), t = 1.5 - (Math.sin(2 * e * Math.PI / 360) / 2 + Math.cos(2 * e * Math.PI / 360) / 2), s = p.shadowScale, a = p.shadowScale / t, i = p.shadowOffset; m.transform(`scale3d(${s}, 1, ${a}) translate3d(0px, ${n / 2 + i}px, ${-n / 2 / a}px) rotateX(-90deg)`) } const g = c.isSafari || c.isWebView ? -o / 2 : 0; s.transform(`translate3d(0px,0,${g}px) rotateX(${t.isHorizontal() ? 0 : f}deg) rotateY(${t.isHorizontal() ? -f : 0}deg)`), s[0].style.setProperty("--swiper-cube-translate-z", `${g}px`) }, setTransition: e => { const { $el: s, slides: a } = t; a.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), t.params.cubeEffect.shadow && !t.isHorizontal() && s.find(".swiper-cube-shadow").transition(e) }, recreateShadows: () => { const e = t.isHorizontal(); t.slides.each((t => { const s = Math.max(Math.min(t.progress, 1), -1); i(d(t), s, e) })) }, getEffectParams: () => t.params.cubeEffect, perspective: () => !0, overwriteParams: () => ({ slidesPerView: 1, slidesPerGroup: 1, watchSlidesProgress: !0, resistanceRatio: 0, spaceBetween: 0, centeredSlides: !1, virtualTranslate: !0 }) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ flipEffect: { slideShadows: !0, limitRotation: !0, transformEl: null } }); const i = (e, s, a) => { let i = t.isHorizontal() ? e.find(".swiper-slide-shadow-left") : e.find(".swiper-slide-shadow-top"), r = t.isHorizontal() ? e.find(".swiper-slide-shadow-right") : e.find(".swiper-slide-shadow-bottom"); 0 === i.length && (i = ie(a, e, t.isHorizontal() ? "left" : "top")), 0 === r.length && (r = ie(a, e, t.isHorizontal() ? "right" : "bottom")), i.length && (i[0].style.opacity = Math.max(-s, 0)), r.length && (r[0].style.opacity = Math.max(s, 0)) }; te({ effect: "flip", swiper: t, on: a, setTranslate: () => { const { slides: e, rtlTranslate: s } = t, a = t.params.flipEffect; for (let r = 0; r < e.length; r += 1) { const n = e.eq(r); let l = n[0].progress; t.params.flipEffect.limitRotation && (l = Math.max(Math.min(n[0].progress, 1), -1)); const o = n[0].swiperSlideOffset; let d = -180 * l, c = 0, p = t.params.cssMode ? -o - t.translate : -o, u = 0; t.isHorizontal() ? s && (d = -d) : (u = p, p = 0, c = -d, d = 0), n[0].style.zIndex = -Math.abs(Math.round(l)) + e.length, a.slideShadows && i(n, l, a); const h = `translate3d(${p}px, ${u}px, 0px) rotateX(${c}deg) rotateY(${d}deg)`; se(a, n).transform(h) } }, setTransition: e => { const { transformEl: s } = t.params.flipEffect; (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e), ae({ swiper: t, duration: e, transformEl: s }) }, recreateShadows: () => { const e = t.params.flipEffect; t.slides.each((s => { const a = d(s); let r = a[0].progress; t.params.flipEffect.limitRotation && (r = Math.max(Math.min(s.progress, 1), -1)), i(a, r, e) })) }, getEffectParams: () => t.params.flipEffect, perspective: () => !0, overwriteParams: () => ({ slidesPerView: 1, slidesPerGroup: 1, watchSlidesProgress: !0, spaceBetween: 0, virtualTranslate: !t.params.cssMode }) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ coverflowEffect: { rotate: 50, stretch: 0, depth: 100, scale: 1, modifier: 1, slideShadows: !0, transformEl: null } }), te({ effect: "coverflow", swiper: t, on: a, setTranslate: () => { const { width: e, height: s, slides: a, slidesSizesGrid: i } = t, r = t.params.coverflowEffect, n = t.isHorizontal(), l = t.translate, o = n ? e / 2 - l : s / 2 - l, d = n ? r.rotate : -r.rotate, c = r.depth; for (let e = 0, t = a.length; e < t; e += 1) { const t = a.eq(e), s = i[e], l = (o - t[0].swiperSlideOffset - s / 2) / s, p = "function" == typeof r.modifier ? r.modifier(l) : l * r.modifier; let u = n ? d * p : 0, h = n ? 0 : d * p, m = -c * Math.abs(p), f = r.stretch; "string" == typeof f && -1 !== f.indexOf("%") && (f = parseFloat(r.stretch) / 100 * s); let g = n ? 0 : f * p, v = n ? f * p : 0, w = 1 - (1 - r.scale) * Math.abs(p); Math.abs(v) < .001 && (v = 0), Math.abs(g) < .001 && (g = 0), Math.abs(m) < .001 && (m = 0), Math.abs(u) < .001 && (u = 0), Math.abs(h) < .001 && (h = 0), Math.abs(w) < .001 && (w = 0); const b = `translate3d(${v}px,${g}px,${m}px) rotateX(${h}deg) rotateY(${u}deg) scale(${w})`; if (se(r, t).transform(b), t[0].style.zIndex = 1 - Math.abs(Math.round(p)), r.slideShadows) { let e = n ? t.find(".swiper-slide-shadow-left") : t.find(".swiper-slide-shadow-top"), s = n ? t.find(".swiper-slide-shadow-right") : t.find(".swiper-slide-shadow-bottom"); 0 === e.length && (e = ie(r, t, n ? "left" : "top")), 0 === s.length && (s = ie(r, t, n ? "right" : "bottom")), e.length && (e[0].style.opacity = p > 0 ? p : 0), s.length && (s[0].style.opacity = -p > 0 ? -p : 0) } } }, setTransition: e => { const { transformEl: s } = t.params.coverflowEffect; (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e) }, perspective: () =>
vendor: 4,700 bytes, line 13
13 !0, overwriteParams: () => ({ watchSlidesProgress: !0 }) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ creativeEffect: { transformEl: null, limitProgress: 1, shadowPerProgress: !1, progressMultiplier: 1, perspective: !0, prev: { translate: [0, 0, 0], rotate: [0, 0, 0], opacity: 1, scale: 1 }, next: { translate: [0, 0, 0], rotate: [0, 0, 0], opacity: 1, scale: 1 } } }); const i = e => "string" == typeof e ? e : `${e}px`; te({ effect: "creative", swiper: t, on: a, setTranslate: () => { const { slides: e, $wrapperEl: s, slidesSizesGrid: a } = t, r = t.params.creativeEffect, { progressMultiplier: n } = r, l = t.params.centeredSlides; if (l) { const e = a[0] / 2 - t.params.slidesOffsetBefore || 0; s.transform(`translateX(calc(50% - ${e}px))`) } for (let s = 0; s < e.length; s += 1) { const a = e.eq(s), o = a[0].progress, d = Math.min(Math.max(a[0].progress, -r.limitProgress), r.limitProgress); let c = d; l || (c = Math.min(Math.max(a[0].originalProgress, -r.limitProgress), r.limitProgress)); const p = a[0].swiperSlideOffset, u = [t.params.cssMode ? -p - t.translate : -p, 0, 0], h = [0, 0, 0]; let m = !1; t.isHorizontal() || (u[1] = u[0], u[0] = 0); let f = { translate: [0, 0, 0], rotate: [0, 0, 0], scale: 1, opacity: 1 }; d < 0 ? (f = r.next, m = !0) : d > 0 && (f = r.prev, m = !0), u.forEach(((e, t) => { u[t] = `calc(${e}px + (${i(f.translate[t])} * ${Math.abs(d * n)}))` })), h.forEach(((e, t) => { h[t] = f.rotate[t] * Math.abs(d * n) })), a[0].style.zIndex = -Math.abs(Math.round(o)) + e.length; const g = u.join(", "), v = `rotateX(${h[0]}deg) rotateY(${h[1]}deg) rotateZ(${h[2]}deg)`, w = c < 0 ? `scale(${1 + (1 - f.scale) * c * n})` : `scale(${1 - (1 - f.scale) * c * n})`, b = c < 0 ? 1 + (1 - f.opacity) * c * n : 1 - (1 - f.opacity) * c * n, x = `translate3d(${g}) ${v} ${w}`; if (m && f.shadow || !m) { let e = a.children(".swiper-slide-shadow"); if (0 === e.length && f.shadow && (e = ie(r, a)), e.length) { const t = r.shadowPerProgress ? d * (1 / r.limitProgress) : d; e[0].style.opacity = Math.min(Math.max(Math.abs(t), 0), 1) } } const y = se(r, a); y.transform(x).css({ opacity: b }), f.origin && y.css("transform-origin", f.origin) } }, setTransition: e => { const { transformEl: s } = t.params.creativeEffect; (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow").transition(e), ae({ swiper: t, duration: e, transformEl: s, allSlides: !0 }) }, perspective: () => t.params.creativeEffect.perspective, overwriteParams: () => ({ watchSlidesProgress: !0, virtualTranslate: !t.params.cssMode }) }) }, function (e) { let { swiper: t, extendParams: s, on: a } = e; s({ cardsEffect: { slideShadows: !0, transformEl: null, rotate: !0, perSlideRotate: 2, perSlideOffset: 8 } }), te({ effect: "cards", swiper: t, on: a, setTranslate: () => { const { slides: e, activeIndex: s } = t, a = t.params.cardsEffect, { startTranslate: i, isTouched: r } = t.touchEventsData, n = t.translate; for (let l = 0; l < e.length; l += 1) { const o = e.eq(l), d = o[0].progress, c = Math.min(Math.max(d, -4), 4); let p = o[0].swiperSlideOffset; t.params.centeredSlides && !t.params.cssMode && t.$wrapperEl.transform(`translateX(${t.minTranslate()}px)`), t.params.centeredSlides && t.params.cssMode && (p -= e[0].swiperSlideOffset); let u = t.params.cssMode ? -p - t.translate : -p, h = 0; const m = -100 * Math.abs(c); let f = 1, g = -a.perSlideRotate * c, v = a.perSlideOffset - .75 * Math.abs(c); const w = t.virtual && t.params.virtual.enabled ? t.virtual.from + l : l, b = (w === s || w === s - 1) && c > 0 && c < 1 && (r || t.params.cssMode) && n < i, x = (w === s || w === s + 1) && c < 0 && c > -1 && (r || t.params.cssMode) && n > i; if (b || x) { const e = (1 - Math.abs((Math.abs(c) - .5) / .5)) ** .5; g += -28 * c * e, f += -.5 * e, v += 96 * e, h = -25 * e * Math.abs(c) + "%" } if (u = c < 0 ? `calc(${u}px + (${v * Math.abs(c)}%))` : c > 0 ? `calc(${u}px + (-${v * Math.abs(c)}%))` : `${u}px`, !t.isHorizontal()) { const e = h; h = u, u = e } const y = c < 0 ? "" + (1 + (1 - f) * c) : "" + (1 - (1 - f) * c), E = `\n translate3d(${u}, ${h}, ${m}px)\n rotateZ(${a.rotate ? g : 0}deg)\n scale(${y})\n `; if (a.slideShadows) { let e = o.find(".swiper-slide-shadow"); 0 === e.length && (e = ie(a, o)), e.length && (e[0].style.opacity = Math.min(Math.max((Math.abs(c) - .5) / .5, 0), 1)) } o[0].style.zIndex = -Math.abs(Math.round(d)) + e.length; se(a, o).transform(E) } }, setTransition: e => { const { transformEl: s } = t.params.cardsEffect; (s ? t.slides.find(s) : t.slides).transition(e).find(".swiper-slide-shadow").transition(e), ae({ swiper: t, duration: e, transformEl: s }) }, perspective: () =>
13 !0, overwriteParams: () => ({ watchSlidesProgress: !0, virtualTranslate: !t.params.cssMode }) }) }]; return V.use(re), V })); 14 15/**Swiper End */ 16 17/* 18 IMPORTANT NOTE: 19 20 This file is the unminified JS that is used by the theme. This file is therefore not included into the "theme.liquid" Liquid. It is bundled only 21 for developers who would like to add their own JavaScript or edit the existing JavaScript. Re-minifying the ile and make sure you include it into 22 the "theme.liquid" is up to the developers responsibility. 23 24 Because we are using WebPack internally to bundle our JavaScript code, even the unminified file can be quite hard to read or edit due to all the 25 code added by WebPack. 26 27 Please note that we do not provide any assistance for changes made here that may break the theme: it's at your own risk :). 28 */ 29var _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 30 31function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 32 33 /******/(function (modules) { 34 // webpackBootstrap 35 /******/ // The module cache 36 /******/var installedModules = {}; 37 /******/ 38 /******/ // The require function 39 /******/function __webpack_require__(moduleId) { 40 /******/ 41 /******/ // Check if module is in cache 42 /******/if (installedModules[moduleId]) { 43 /******/return installedModules[moduleId].exports; 44 /******/ 45 } 46 /******/ // Create a new module (and put it into the cache) 47 /******/var module = installedModules[moduleId] = { 48 /******/i: moduleId, 49 /******/l: false, 50 /******/exports: {} 51 /******/ 52 }; 53 /******/ 54 /******/ // Execute the module function 55 /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 56 /******/ 57 /******/ // Flag the module as loaded 58 /******/module.l = true; 59 /******/ 60 /******/ // Return the exports of the module 61 /******/return module.exports; 62 /******/ 63 } 64 /******/ 65 /******/ 66 /******/ // expose the modules object (__webpack_modules__) 67 /******/__webpack_require__.m = modules; 68 /******/ 69 /******/ // expose the module cache 70 /******/__webpack_require__.c = installedModules; 71 /******/ 72 /******/ // define getter function for harmony exports 73 /******/__webpack_require__.d = function (exports, name, getter) { 74 /******/if (!__webpack_require__.o(exports, name)) { 75 /******/Object.defineProperty(exports, name, { 76 /******/configurable: false, 77 /******/enumerable: true, 78 /******/get: getter 79 /******/ 80 }); 81 /******/ 82 } 83 /******/ 84 }; 85 /******/ 86 /******/ // getDefaultExport function for compatibility with non-harmony modules 87 /******/__webpack_require__.n = function (module) { 88 /******/var getter = module && module.__esModule ? 89 /******/function getDefault() { 90 return module['default']; 91 } : 92 /******/function getModuleExports() { 93 return module; 94 }; 95 /******/__webpack_require__.d(getter, 'a', getter); 96 /******/return getter; 97 /******/ 98 }; 99 /******/ 100 /******/ // Object.prototype.hasOwnProperty.call 101 /******/__webpack_require__.o = function (object, property) { 102 return Object.prototype.hasOwnProperty.call(object, property); 103 }; 104 /******/ 105 /******/ // __webpack_public_path__ 106 /******/__webpack_require__.p = ""; 107 /******/ 108 /******/ // Load entry module and return exports 109 /******/return __webpack_require__(__webpack_require__.s = 54); 110 /******/ 111})( 112 /************************************************************************/ 113 /******/[ 114 /* 0 */ 115 /***/function (module, __webpack_exports__, __webpack_require__) { 116 117 "use strict"; 118 119 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 120 /** 121 * Various DOM helper 122 */ 123 124 var Dom = function () { 125 function Dom() { 126 _classCallCheck(this, Dom); 127 } 128 129 _createClass(Dom, null, [{ 130 key: 'getSiblings', 131 132 /** 133 * Get all the previous and next siblings, optionally filtered by a selector 134 */ 135 value: function getSiblings(element, filter) { 136 var includeSelf = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
137 138 var siblings = []; 139 var currentElement = element; 140 141 // Do the previous first 142 while (currentElement = currentElement.previousElementSibling) { 143 if (!filter || currentElement.matches(filter)) { 144 siblings.push(currentElement); 145 } 146 } 147 148 if (includeSelf) { 149 siblings.push(element); 150 } 151 152 // Then the next side 153 currentElement = element; 154 155 while (currentElement = currentElement.nextElementSibling) { 156 if (!filter || currentElement.matches(filter)) { 157 siblings.push(currentElement); 158 } 159 } 160 161 return siblings; 162 } 163 164 /** 165 * By default, NodeList object are only iterable with forEach on newest browsers. To support it cross-browser, 166 * we need to normalize it 167 */ 168 169 }, { 170 key: 'nodeListToArray', 171 value: function nodeListToArray(nodeList, filter) { 172 var items = []; 173 174 for (var i = 0; i !== nodeList.length; ++i) { 175 if (!filter || nodeList[i].matches(filter)) { 176 items.push(nodeList[i]); 177 } 178 } 179 180 return items; 181 } 182 183 /** 184 * Calculate an element width with its margin 185 */ 186 187 }, { 188 key: 'outerWidthWithMargin', 189 value: function outerWidthWithMargin(element) { 190 var width = element.offsetWidth, 191 style = getComputedStyle(element); 192 193 width += parseInt(style.marginLeft) + parseInt(style.marginRight); 194 195 return width; 196 } 197 }]); 198 199 return Dom; 200 }(); 201 /* harmony export (immutable) */ 202 203 __webpack_exports__["default"] = Dom; 204 205 /***/ 206 }, 207 /* 1 */ 208 /***/function (module, __webpack_exports__, __webpack_require__) { 209 210 "use strict"; 211 212 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 213 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Responsive__ = __webpack_require__(2); 214 215 var Carousel = function () { 216 function Carousel(element) { 217 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 218 219 _classCallCheck(this, Carousel); 220 221 this.element = element; 222 this.initialConfig = JSON.parse(element.getAttribute('data-flickity-config')); 223 this.options = options; 224 225 this._attachListeners(); 226 this._build(); 227 } 228 229 _createClass(Carousel, [{ 230 key: 'destroy', 231 value: function destroy() { 232 this.flickityInstance.destroy(); 233 234 if (this.initialConfig['breakpoints'] !== undefined) { 235 document.removeEventListener('breakpoint:changed', this._onBreakpointChangedListener); 236 } 237 } 238 }, { 239 key: 'selectCell', 240 value: function selectCell(index) { 241 var shouldPause = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 242 var shouldAnimate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 243 244 if (shouldPause) { 245 this.flickityInstance.pausePlayer(); 246 } 247 248 this.flickityInstance.select(index, false, !shouldAnimate); 249 } 250 }, { 251 key: 'pausePlayer', 252 value: function pausePlayer() { 253 this.flickityInstance.pausePlayer(); 254 } 255 }, { 256 key: 'unpausePlayer', 257 value: function unpausePlayer() { 258 this.flickityInstance.unpausePlayer(); 259 } 260 }, { 261 key: 'resize', 262 value: function resize() { 263 this.flickityInstance.resize(); 264 } 265 }, { 266 key: 'getSelectedIndex', 267 value: function getSelectedIndex() { 268 return this.flickityInstance.selectedIndex; 269 } 270 }, { 271 key: 'getSelectedCell', 272 value: function getSelectedCell() { 273 return this.flickityInstance.selectedCell.element; 274 } 275 }, { 276 key: '_attachListeners', 277 value: function _attachListeners() { 278 if (this.initialConfig['breakpoints'] !== undefined) { 279 this._onBreakpointChangedListener = this._onBreakpointChanged.bind(this); 280 document.addEventListener('breakpoint:changed', this._onBreakpointChangedListener); 281 } 282 } 283 284 /** 285 * Create the carousel instance 286 */ 287 288 }, { 289 key: '_build', 290 value: function _build() { 291 292 var _this = this; 293 294 var config = this._processConfig(); 295 296 this.flickityInstance = new Flickity(this.element, config); 297 298 console.log(this.element.classList.contains('VariantSelector__Carousel')); 299 300 if (this.element.classList.contains('VariantSelector__Carousel')) { 301 window.VariantColorSlider = this; 302 } 303
304 this._validateDraggable(); 305 306 this.selectedIndex = this.flickityInstance.selectedIndex; 307 308 this.flickityInstance.on('resize', this._validateDraggable.bind(this)); 309 310 if (this.options['onSelect']) { 311 this.flickityInstance.on('select', function () { 312 // Flickity will send the "select" event whenever the window resize (even on mobile...), as a consequence we need to check 313 // first if the slide index have changed or not (cf: https://github.com/metafizzy/flickity/issues/529) 314 315 if (_this.selectedIndex !== _this.flickityInstance.selectedIndex) { 316 _this.options['onSelect'](_this.flickityInstance.selectedIndex, _this.flickityInstance.selectedCell.element); 317 _this.selectedIndex = _this.flickityInstance.selectedIndex; 318 } 319 }); 320 } 321 322 if (this.options['onClick']) { 323 this.flickityInstance.on('staticClick', function (event, pointer, cell, index) { 324 _this.options['onClick'](cell, index); 325 }); 326 } 327 } 328 329 /** 330 * By default, Flickity does not disable draggable automatically if there is nothing to slide. We therefore manually do the check here by checking 331 * if the displayed elements equals to the amount of elements 332 */ 333 334 }, { 335 key: '_validateDraggable', 336 value: function _validateDraggable() { 337 var isActive = this.flickityInstance.isActive || false; 338 339 if (!isActive || !this.flickityInstance.options['draggable']) { 340 return; // Not draggable, so nothing to do 341 } 342 343 if (undefined === this.flickityInstance.selectedElements || this.flickityInstance.selectedElements.length === this.flickityInstance.cells.length) { 344 this.flickityInstance.unbindDrag(); 345 } else { 346 this.flickityInstance.bindDrag(); 347 } 348 } 349 350 /** 351 * Flickity is a CSS driven library and hence it is hard to setup some stuff in pure JS 352 */ 353 354 }, { 355 key: '_processConfig', 356 value: function _processConfig() { 357 var config = Object.assign({}, this.initialConfig); 358 359 delete config['breakpoints']; 360 361 if (this.initialConfig['breakpoints'] === undefined) { 362 return config; // No change, we simply return the config as it is 363 } 364 365 var breakpoints = this.initialConfig['breakpoints']; 366 367 breakpoints.forEach(function (breakpoint) { 368 if (__WEBPACK_IMPORTED_MODULE_0__helper_Responsive__["default"].matchesBreakpoint(breakpoint['matches'])) { 369 config = Object.assign(config, breakpoint['settings']); 370 } 371 }); 372 373 return config; 374 } 375 376 /** 377 * Verify if the breakpoint has changed, and optionally update the carousel 378 */ 379 380 }, { 381 key: '_onBreakpointChanged', 382 value: function _onBreakpointChanged() { 383 // The breakpoint may have changed, so we delete the carousel and rebuild it 384 this.flickityInstance.destroy(); 385 this._build(); 386 } 387 }]); 388 389 return Carousel; 390 }(); 391 /* harmony export (immutable) */ 392 393 __webpack_exports__["default"] = Carousel; 394 395 /***/ 396 }, 397 /* 2 */ 398 /***/function (module, __webpack_exports__, __webpack_require__) { 399 400 "use strict"; 401 402 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 403 404 var Responsive = function () { 405 function Responsive() { 406 var _this2 = this; 407 408 _classCallCheck(this, Responsive); 409 410 this.currentBreakpoint = Responsive.getCurrentBreakpoint(); 411 412 window.addEventListener('resize', function () { 413 var newBreakpoint = Responsive.getCurrentBreakpoint(); 414 415 if (_this2.currentBreakpoint === newBreakpoint) { 416 return; 417 } 418 419 document.dispatchEvent(new CustomEvent('breakpoint:changed', { 420 detail: { 421 previousBreakpoint: _this2.currentBreakpoint, 422 currentBreakpoint: newBreakpoint 423 } 424 })); 425 426 _this2.currentBreakpoint = newBreakpoint; 427 }); 428 } 429 430 _createClass(Responsive, null, [{ 431 key: 'matchesBreakpoint', 432 value: function matchesBreakpoint(breakpoint) { 433 switch (breakpoint) { 434 case 'phone': 435 return window.matchMedia('screen and (max-width: 640px)').matches; 436 437 case 'tablet': 438 return window.matchMedia('screen and (min-width: 641px) and (max-width: 1007px)').matches; 439 440 case 'tablet-and-up': 441 return window.matchMedia('screen and (min-width: 641px)').matches; 442 443 case 'pocket': 444 return window.matchMedia('screen and (max-width: 1007px)').matches; 445 446 case 'lap': 447 return window.matchMedia('screen and (min-width: 1008px) and (max-width: 1279px)').matches; 448 449 case 'lap-and-up': 450 return window.matchMedia('screen and (min-width: 1008px)').matches; 451 452 case 'desk': 453 return window.matchMedia('screen and (min-width: 1280px)').matches; 454 455 case 'widescreen': 456 return window.matchMedia('screen and (min-width: 1600px)').matches; 457 } 458 } 459 }, { 460 key: 'getCurrentBreakpoint', 461 value: function getCurrentBreakpoint() { 462 if (window.matchMedia('screen and (max-width: 640px)').matches) { 463 return 'phone'; 464 } 465 466 if (window.matchMedia('screen and (min-width: 641px) and (max-width: 1007px)').matches) { 467 return 'tablet'; 468 } 469 470 if (window.matchMedia('screen and (min-width: 1008px) and (max-width: 1279px)').matches) { 471 return 'lap'; 472 } 473 474 if (window.matchMedia('screen and (min-width: 1280px)').matches) { 475 return 'desk'; 476 } 477 } 478 }]); 479 480 return Responsive; 481 }(); 482 /* harmony export (immutable) */ 483 484 __webpack_exports__["default"] = Responsive; 485 486 /***/ 487 }, 488 /* 3 */ 489 /***/function (module, __webpack_exports__, __webpack_require__) { 490 491 "use strict"; 492 493 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 494 495 var Accessibility = function () { 496 function Accessibility() { 497 _classCallCheck(this, Accessibility); 498 } 499 500 _createClass(Accessibility, null, [{ 501 key: 'trapFocus', 502 503 /** 504 * Traps the focus in a particular container 505 */ 506 value: function trapFocus(container, namespace) { 507 this.listeners = this.listeners || {}; 508 509 // We check if there is an element with the attribute "autofocus" 510 var elementToFocus = container.querySelector('[autofocus]') || container; 511 512 container.setAttribute('tabindex', '-1'); 513 elementToFocus.focus(); 514 515 this.listeners[namespace] = function (event) { 516 if (container !== event.target && !container.contains(event.target)) { 517 container.focus(); 518 } 519 }; 520 521 document.addEventListener('focusin', this.listeners[namespace]); 522 } 523 524 /** 525 * Removes the trap of focus in a particular container 526 */ 527 528 }, { 529 key: 'removeTrapFocus', 530 value: function removeTrapFocus(container, namespace) { 531 if (container) { 532 container.removeAttribute('tabindex'); 533 } 534 535 document.removeEventListener('focusin', this.listeners[namespace]); 536 } 537 538 /** 539 * Reset any previous trap focus 540 */ 541 542 }, { 543 key: 'clearTrapFocus', 544 value: function clearTrapFocus() { 545 for (var key in this.listeners) { 546 if (this.listeners.hasOwnProperty(key)) { 547 document.removeEventListener('focusin', this.listeners[key]); 548 } 549 } 550 551 this.listeners = {}; 552 } 553 }]); 554 555 return Accessibility; 556 }(); 557 /* harmony export (immutable) */ 558 559 __webpack_exports__["default"] = Accessibility; 560 561 /***/ 562 }, 563 /* 4 */ 564 /***/function (module, __webpack_exports__, __webpack_require__) { 565 566 "use strict"; 567 568 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 569 /** 570 * Note: this was a feature that was added at the very end and couldn't do something much cleaner without rewriting large parts of the theme... 571 */ 572 573 var ProductItemColorSwatch = function () { 574 function ProductItemColorSwatch(element) { 575 _classCallCheck(this, ProductItemColorSwatch); 576 577 this.element = element; 578 this.delegateElement = new domDelegate.Delegate(this.element); 579 580 this.delegateElement.on('change', '.ColorSwatch__Radio', this._colorChanged.bind(this)); 581 } 582 583 _createClass(ProductItemColorSwatch, [{ 584 key: '_colorChanged', 585 value: function _colorChanged(event, target) { 586 // We need to change the URL of the various links 587 var productItem = target.closest('.ProductItem'), 588 variantUrl = target.getAttribute('data-variant-url'); 589 590 productItem.querySelector('.ProductItem__ImageWrapper').setAttribute('href', variantUrl); 591 productItem.querySelector('.ProductItem__Title > a').setAttribute('href', variantUrl); 592 593 // If we have a custom image for the variant, we change it 594 var originalImageElement = productItem.querySelector('.ProductItem__Image:not(.ProductItem__Image--alternate)'); 595 596 if (target.hasAttribute('data-image-url') && target.getAttribute('data-image-id') !== originalImageElement.getAttribute('data-image-id')) { 597 var newImageElement = document.createElement('img'); 598 newImageElement.className = 'ProductItem__Image Image--fadeIn Image--lazyLoad'; 599 newImageElement.setAttribute('data-image-id', target.getAttribute('data-image-id')); 600 newImageElement.setAttribute('data-src', target.getAttribute('data-image-url')); 601 newImageElement.setAttribute('data-widths', target.getAttribute('data-image-widths')); 602 newImageElement.setAttribute('data-sizes', 'auto'); 603 604 // Replace the original node 605 originalImageElement.parentNode.style.paddingBottom = 100.0 / target.getAttribute('data-image-aspect-ratio') + '%'; 606 originalImageElement.parentNode.style.setProperty('--aspect-ratio', target.getAttribute('data-image-aspect-ratio')); 607 originalImageElement.parentNode.replaceChild(newImageElement, originalImageElement); 608 } 609 } 610 }]); 611 612 return ProductItemColorSwatch; 613 }(); 614 /* harmony export (immutable) */ 615 616 __webpack_exports__["default"] = ProductItemColorSwatch; 617 618 /***/ 619 }, 620 /* 5 */ 621 /***/function (module, __webpack_exports__, __webpack_require__) { 622 623 "use strict"; 624 625 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 626 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__Dom__ = __webpack_require__(0); 627 628 var Currency = function () { 629 function Currency() { 630 _classCallCheck(this, Currency); 631 } 632 633 _createClass(Currency, null, [{ 634 key: 'formatMoney', 635 636 /** 637 * Format money values based on your shop currency settings 638 * 639 * @param {Number|string} cents - value in cents or dollar amount e.g. 300 cents or 3.00 dollars 640 * @param {String} format - shop money_format setting 641 * @return {String} value - formatted value 642 */ 643 value: function formatMoney(cents, format) { 644 if (typeof cents === 'string') { 645 cents = cents.replace('.', ''); 646 } 647 648 var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/, 649 formatString = format || '${{amount}}'; 650 651 function defaultTo(value, defaultValue) { 652 return value == null || value !== value ? defaultValue : value; 653 } 654 655 function formatWithDelimiters(number, precision, thousands, decimal) { 656 precision = defaultTo(precision, 2); 657 thousands = defaultTo(thousands, ','); 658 decimal = defaultTo(decimal, '.'); 659 660 if (isNaN(number) || number == null) { 661 return 0; 662 } 663 664 number = (number / 100.0).toFixed(precision); 665 666 var parts = number.split('.'), 667 dollarsAmount = parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1' + thousands), 668 centsAmount = parts[1] ? decimal + parts[1] : ''; 669 670 return dollarsAmount + centsAmount; 671 } 672 673 var value = ''; 674 675 switch (formatString.match(placeholderRegex)[1]) { 676 case 'amount': 677 value = formatWithDelimiters(cents, 2); 678 break; 679 case 'amount_no_decimals': 680 value = formatWithDelimiters(cents, 0); 681 break; 682 case 'amount_with_space_separator': 683 value = formatWithDelimiters(cents, 2, ' ', '.'); 684 break; 685 case 'amount_no_decimals_with_comma_separator': 686 value = formatWithDelimiters(cents, 0, ',', '.'); 687 break; 688 case 'amount_no_decimals_with_space_separator': 689 value = formatWithDelimiters(cents, 0, ' '); 690 break; 691 case 'amount_with_comma_separator': 692 value = formatWithDelimiters(cents, 2, '.', ','); 693 break; 694 } 695 696 return formatString.replace(placeholderRegex, value).replace('.00', ''); 697 } 698 699 /** 700 * Allow to converts all elements from one currency to another. To speed up, you can pass a selector that will 701 * act as the root element 702 */ 703 704 }, { 705 key: 'convertAll', 706 value: function convertAll(selector) { 707 var _this3 = this; 708 709 var moneyFormats = { 710 "USD": { 711 "money_format": "${{amount}}", 712 "money_with_currency_format": "${{amount}} USD" 713 }, 714 "EUR": { 715 "money_format": "€{{amount}}", 716 "money_with_currency_format": "€{{amount}} EUR" 717 }, 718 "GBP": { 719 "money_format": "£{{amount}}", 720 "money_with_currency_format": "£{{amount}} GBP" 721 }, 722 "CAD": { 723 "money_format": "${{amount}}", 724 "money_with_currency_format": "${{amount}} CAD" 725 }, 726 "ALL": { 727 "money_format": "Lek {{amount}}", 728 "money_with_currency_format": "Lek {{amount}} ALL" 729 }, 730 "DZD": { 731 "money_format": "DA {{amount}}", 732 "money_with_currency_format": "DA {{amount}} DZD" 733 }, 734 "AOA": { 735 "money_format": "Kz{{amount}}", 736 "money_with_currency_format": "Kz{{amount}} AOA" 737 }, 738 "ARS": { 739 "money_format": "${{amount_with_comma_separator}}", 740 "money_with_currency_format": "${{amount_with_comma_separator}} ARS" 741 }, 742 "AMD": { 743 "money_format": "{{amount}} AMD", 744 "money_with_currency_format": "{{amount}} AMD" 745 }, 746 "AWG": { 747 "money_format": "Afl{{amount}}", 748 "money_with_currency_format": "Afl{{amount}} AWG" 749 }, 750 "AUD": { 751 "money_format": "${{amount}}", 752 "money_with_currency_format": "${{amount}} AUD" 753 }, 754 "BBD": { 755 "money_format": "${{amount}}", 756 "mo
756ney_with_currency_format": "${{amount}} Bds" 757 }, 758 "AZN": { 759 "money_format": "m.{{amount}}", 760 "money_with_currency_format": "m.{{amount}} AZN" 761 }, 762 "BDT": { 763 "money_format": "Tk {{amount}}", 764 "money_with_currency_format": "Tk {{amount}} BDT" 765 }, 766 "BSD": { 767 "money_format": "BS${{amount}}", 768 "money_with_currency_format": "BS${{amount}} BSD" 769 }, 770 "BHD": { 771 "money_format": "{{amount}}0 BD", 772 "money_with_currency_format": "{{amount}}0 BHD" 773 }, 774 "BYR": { 775 "money_format": "Br {{amount}}", 776 "money_with_currency_format": "Br {{amount}} BYR" 777 }, 778 "BZD": { 779 "money_format": "BZ${{amount}}", 780 "money_with_currency_format": "BZ${{amount}} BZD" 781 }, 782 "BTN": { 783 "money_format": "Nu {{amount}}", 784 "money_with_currency_format": "Nu {{amount}} BTN" 785 }, 786 "BAM": { 787 "money_format": "KM {{amount_with_comma_separator}}", 788 "money_with_currency_format": "KM {{amount_with_comma_separator}} BAM" 789 }, 790 "BRL": { 791 "money_format": "R$ {{amount_with_comma_separator}}", 792 "money_with_currency_format": "R$ {{amount_with_comma_separator}} BRL" 793 }, 794 "BOB": { 795 "money_format": "Bs{{amount_with_comma_separator}}", 796 "money_with_currency_format": "Bs{{amount_with_comma_separator}} BOB" 797 }, 798 "BWP": { 799 "money_format": "P{{amount}}", 800 "money_with_currency_format": "P{{amount}} BWP" 801 }, 802 "BND": { 803 "money_format": "${{amount}}", 804 "money_with_currency_format": "${{amount}} BND" 805 }, 806 "BGN": { 807 "money_format": "{{amount}} ûò", 808 "money_with_currency_format": "{{amount}} ûò BGN" 809 }, 810 "MMK": { 811 "money_format": "K{{amount}}", 812 "money_with_currency_format": "K{{amount}} MMK" 813 }, 814 "KHR": { 815 "money_format": "KHR{{amount}}", 816 "money_with_currency_format": "KHR{{amount}}" 817 }, 818 "KYD": { 819 "money_format": "${{amount}}", 820 "money_with_currency_format": "${{amount}} KYD" 821 }, 822 "XAF": { 823 "money_format": "FCFA{{amount}}", 824 "money_with_currency_format": "FCFA{{amount}} XAF" 825 }, 826 "CLP": { 827 "money_format": "${{amount_no_decimals}}", 828 "money_with_currency_format": "${{amount_no_decimals}} CLP" 829 }, 830 "CNY": { 831 "money_format": "¥{{amount}}", 832 "money_with_currency_format": "¥{{amount}} CNY" 833 }, 834 "COP": { 835 "money_format": "${{amount_with_comma_separator}}", 836 "money_with_currency_format": "${{amount_with_comma_separator}} COP" 837 }, 838 "CRC": { 839 "money_format": "₡ {{amount_with_comma_separator}}", 840 "money_with_currency_format": "₡ {{amount_with_comma_separator}} CRC" 841 }, 842 "HRK": { 843 "money_format": "{{amount_with_comma_separator}} kn", 844 "money_with_currency_format": "{{amount_with_comma_separator}} kn HRK" 845 }, 846 "CZK": { 847 "money_format": "{{amount_with_comma_separator}} Kč", 848 "money_with_currency_format": "{{amount_with_comma_separator}} Kč" 849 }, 850 "DKK": { 851 "money_format": "{{amount_with_comma_separator}}", 852 "money_with_currency_format": "kr.{{amount_with_comma_separator}}" 853 }, 854 "DOP": { 855 "money_format": "RD$ {{amount}}", 856 "money_with_currency_format": "RD$ {{amount}}" 857 }, 858 "XCD": { 859 "money_format": "${{amount}}", 860 "money_with_currency_format": "EC${{amount}}" 861 }, 862 "EGP": { 863 "money_format": "LE {{amount}}", 864 "money_with_currency_format": "LE {{amount}} EGP" 865 }, 866 "ETB": { 867 "money_format": "Br{{amount}}", 868 "money_with_currency_format": "Br{{amount}} ETB" 869 }, 870 "XPF": { 871 "money_format": "{{amount_no_decimals_with_comma_separator}} XPF", 872 "money_with_currency_format": "{{amount_no_decimals_with_comma_separator}} XPF" 873 }, 874 "FJD": { 875 "money_format": "${{amount}}", 876 "money_with_currency_format": "FJ${{amount}}" 877 }, 878 "GMD": { 879 "money_format": "D {{amount}}", 880 "money_with_currency_format": "D {{amount}} GMD" 881 }, 882 "GHS": { 883 "money_format": "GH₵{{amount}}", 884 "money_with_currency_format": "GH₵{{amount}}" 885 }, 886 "GTQ": { 887 "money_format": "Q{{amount}}", 888 "money_with_currency_format": "{{amount}} GTQ" 889 }, 890 "GYD": { 891 "money_format": "G${{amount}}", 892 "money_with_currency_format": "${{amount}} GYD" 893 }, 894 "GEL": { 895 "money_format": "{{amount}} GEL", 896 "money_with_currency_format": "{{amount}} GEL" 897 }, 898 "HNL": { 899 "money_format": "L {{amount}}", 900 "money_with_currency_format": "L {{amount}} HNL" 901 }, 902 "HKD": { 903 "money_format": "${{amount}}", 904 "money_with_currency_format": "HK${{amount}}" 905 }, 906 "HUF": { 907 "money_format": "{{amount_no_decimals_with_comma_separator}}", 908 "money_with_currency_format": "{{amount_no_decimals_with_comma_separator}} Ft" 909 }, 910 "ISK": { 911 "money_format": "{{amount_no_decimals}} kr", 912 "money_with_currency_format": "{{amount_no_decimals}} kr ISK" 913 }, 914 "INR": { 915 "money_format": "Rs. {{amount}}", 916 "money_with_currency_format": "Rs. {{amount}}" 917 }, 918 "IDR": { 919 "money_format": "{{amount_with_comma_separator}}", 920 "money_with_currency_format": "Rp {{amount_with_comma_separator}}" 921 }, 922 "ILS": { 923 "money_format": "{{amount}} NIS", 924 "money_with_currency_format": "{{amount}} NIS" 925 }, 926 "JMD": { 927 "money_format": "${{amount}}", 928 "money_with_currency_format": "${{amount}} JMD" 929 }, 930 "JPY": { 931 "money_format": "¥{{amount_no_decimals}}", 932 "money_with_currency_format": "¥{{amount_no_decimals}} JPY" 933 }, 934 "JEP": { 935 "money_format": "£{{amount}}", 936 "money_with_currency_format": "£{{amount}} JEP" 937 }, 938 "JOD": { 939 "money_format": "{{amount}}0 JD", 940 "money_with_currency_format": "{{amount}}0 JOD" 941 }, 942 "KZT": { 943 "money_format": "{{amount}} KZT", 944 "money_with_currency_format": "{{amount}} KZT" 945 }, 946 "KES": { 947 "money_format": "KSh{{amount}}", 948 "money_with_currency_format": "KSh{{amount}}" 949 }, 950 "KWD": { 951 "money_format": "{{amount}}0 KD", 952 "money_with_currency_format": "{{amount}}0 KWD" 953 }, 954 "KGS": { 955 "money_format": "ûò{{amount}}", 956 "money_with_currency_format": "ûò{{amount}}" 957 }, 958 "LVL": { 959 "money_format": "Ls {{amount}}", 960 "money_with_currency_format": "Ls {{amount}} LVL" 961 }, 962 "LBP": { 963 "money_format": "L£{{amount}}", 964 "money_with_currency_format": "L£{{amount}} LBP" 965 }, 966 "LTL": { 967 "money_format": "{{amount}} Lt", 968 "money_with_currency_format": "{{amount}} Lt" 969 }, 970 "MGA": { 971 "money_format": "Ar {{amount}}", 972 "money_with_currency_format": "Ar {{amount}} MGA" 973 }, 974 "MKD": { 975 "money_format": "ôõý {{amount}}", 976 "money_with_currency_format": "ôõý {{amount}} MKD" 977 }, 978 "MOP": { 979 "money_format": "MOP${{amount}}", 980 "money_with_currency_format": "MOP${{amount}}" 981 }, 982 "MVR": { 983 "money_format": "Rf{{amount}}", 984 "money_with_currency_format": "Rf{{amount}} MRf" 985 }, 986 "MXN": { 987 "money_format": "$ {{amount}}", 988 "money_with_currency_format": "$ {{amount}} MXN" 989 }, 990 "MYR": { 991 "money_format": "RM{{amount}} MYR", 992 "money_with_currency_format": "RM{{amount}} MYR" 993 }, 994 "MUR": { 995 "money_format": "Rs {{amount}}", 996 "money_with_currency_format": "Rs {{amount}} MUR" 997 }, 998 "MDL": { 999 "money_format": "{{amount}} MDL", 1000 "money_with_currency_format": "{{amount}} MDL" 1001 }, 1002 "MAD": { 1003 "money_format": "{{amount}} dh", 1004 "money_with_currency_format": "Dh {{amount}} MAD" 1005 }, 1006 "MNT": { 1007 "money_format": "{{amount_no_decimals}} ₮", 1008 "money_with_currency_format": "{{amount_no_decimals}} MNT" 1009 }, 1010 "MZN": { 1011 "money_format": "{{amount}} Mt", 1012 "money_with_currency_format": "Mt {{amount}} MZN" 1013 }, 1014 "NAD": { 1015 "money_format": "N${{amount}}", 1016 "money_with_currency_format": "N${{amount}} NAD" 1017 }, 1018 "NPR": { 1019 "money_format": "Rs{{amount}}", 1020 "money_with_currency_format": "Rs{{amount}} NPR" 1021 }, 1022 "ANG": { 1023 "money_format": "ƒ{{amount}}", 1024 "money_with_currency_format": "{{amount}} NAƒ" 1025 }, 1026 "NZD": { 1027 "money_format": "${{amount}}", 1028 "money_with_currency_format": "${{amount}} NZD" 1029 }, 1030 "NIO": { 1031 "money_format": "C${{amount}}", 1032 "money_with_currency_format": "C${{amount}} NIO" 1033 }, 1034 "NGN": { 1035 "money_format": "₦{{amount}}", 1036 "money_with_currency_format": "₦{{amount}} NGN" 1037 }, 1038 "NOK": { 1039 "money_format": "kr {{amount_with_comma_separator}}", 1040 "money_with_currency_format": "kr {{amount_with_comma_separator}} NOK" 1041 }, 1042 "OMR": { 1043 "money_format": "{{amount_with_comma_separator}} OMR", 1044 "money_with_currency_format": "{{amount_with_comma_separator}} OMR" 1045 }, 1046 "PKR": { 1047 "money_format": "Rs.{{amount}}", 1048 "money_with_currency_format": "Rs.{{amount}} PKR" 1049 }, 1050 "PGK": { 1051 "money_format": "K {{amount}}", 1052 "money_with_currency_format": "K {{amount}} PGK" 1053 }, 1054 "PYG": { 1055 "money_format": "Gs. {{amount_no_decimals_with_comma_separator}}", 1056 "money_with_currency_format": "Gs. {{amount_no_decimals_with_comma_separator}} PYG" 1057 }, 1058 "PEN": { 1059 "money_format": "S/. {{amount}}", 1060 "money_with_currency_format": "S/. {{amount}} PEN" 1061 }, 1062 "PHP": { 1063 "money_format": "₱{{amount}}", 1064 "money_with_currency_format": "₱{{amount}} PHP" 1065 }, 1066 "PLN": { 1067 "money_format": "{{amount_with_comma_separator}} zl", 1068 "money_with_currency_format": "{{amount_with_comma_separator}} zl PLN" 1069 }, 1070 "QAR": { 1071 "money_format": "QAR {{amount_with_comma_separator}}", 1072 "money_with_currency_format": "QAR {{amount_with_comma_separator}}" 1073 }, 1074 "RON": { 1075 "money_format": "{{amount_with_comma_separator}} lei", 1076 "money_with_currency_format": "{{amount_with_comma_separator}} lei RON" 1077 }, 1078 "RUB": { 1079 "money_format": "руб{{amount_with_comma_separator}}", 1080 "money_with_currency_format": "руб{{amount_with_comma_separator}} RUB" 1081 }, 1082 "RWF": { 1083 "money_format": "{{amount_no_decimals}} RF", 1084 "money_with_currency_format": "{{amount_no_decimals}} RWF" 1085 }, 1086 "WST": { 1087 "money_format": "WS$ {{amount}}", 1088 "money_with_currency_format": "WS$ {{amount}} WST" 1089 }, 1090 "SAR": { 1091 "money_format": "{{amount}} SR", 1092 "money_with_currency_format": "{{amount}} SAR" 1093 }, 1094 "STD": { 1095 "money_format": "Db {{amount}}", 1096 "money_with_currency_format": "Db {{amount}} STD" 1097 }, 1098 "RSD": { 1099 "money_format": "{{amount}} RSD", 1100 "money_with_currency_format": "{{amount}} RSD" 1101 }, 1102 "SCR": { 1103 "money_format": "Rs {{amount}}", 1104 "money_with_currency_format": "Rs {{amount}} SCR" 1105 }, 1106 "SGD": { 1107 "money_format": "${{amount}}", 1108 "money_with_currency_format": "${{amount}} SGD" 1109 }, 1110 "SYP": { 1111 "money_format": "S£{{amount}}", 1112 "money_with_currency_format": "S£{{amount}} SYP" 1113 }, 1114 "ZAR": { 1115 "money_format": "R {{amount}}", 1116 "money_with_currency_format": "R {{amount}} ZAR" 1117 }, 1118 "KRW": { 1119 "money_format": "₩{{amount_no_decimals}}", 1120 "money_with_currency_format": "₩{{amount_no_decimals}} KRW" 1121 }, 1122 "LKR": { 1123 "money_format": "Rs {{amount}}", 1124 "money_with_currency_format": "Rs {{amount}} LKR" 1125 }, 1126 "SEK": { 1127 "money_format": "{{amount_no_decimals}} kr", 1128 "money_with_currency_format": "{{amount_no_decimals}} kr SEK" 1129 }, 1130 "CHF": { 1131 "money_format": "{{amount}} CHF", 1132 "money_with_currency_format": "{{amount}} CHF" 1133 }, 1134 "TWD": { 1135 "money_format": "${{amount}}", 1136 "money_with_currency_format": "${{amount}} TWD" 1137 }, 1138 "THB": { 1139 "money_format": "{{amount}} ฿", 1140 "money_with_currency_format": "{{amount}} ฿ THB" 1141 }, 1142 "TZS": { 1143 "money_format": "{{amount}} TZS", 1144 "money_with_currency_format": "{{amount}} TZS" 1145 }, 1146 "TTD": { 1147 "money_format": "${{amount}}", 1148 "money_with_currency_format": "${{amount}} TTD" 1149 }, 1150 "TND": { 1151 "money_format": "{{amount}}", 1152 "money_with_currency_fo
1152rmat": "{{amount}} DT" 1153 }, 1154 "TRY": { 1155 "money_format": "{{amount}}TL", 1156 "money_with_currency_format": "{{amount}}TL" 1157 }, 1158 "UGX": { 1159 "money_format": "Ush {{amount_no_decimals}}", 1160 "money_with_currency_format": "Ush {{amount_no_decimals}} UGX" 1161 }, 1162 "UAH": { 1163 "money_format": "ââ´{{amount}}", 1164 "money_with_currency_format": "ââ´{{amount}} UAH" 1165 }, 1166 "AED": { 1167 "money_format": "Dhs. {{amount}}", 1168 "money_with_currency_format": "Dhs. {{amount}} AED" 1169 }, 1170 "UYU": { 1171 "money_format": "${{amount_with_comma_separator}}", 1172 "money_with_currency_format": "${{amount_with_comma_separator}} UYU" 1173 }, 1174 "VUV": { 1175 "money_format": "${{amount}}", 1176 "money_with_currency_format": "${{amount}}VT" 1177 }, 1178 "VEF": { 1179 "money_format": "Bs. {{amount_with_comma_separator}}", 1180 "money_with_currency_format": "Bs. {{amount_with_comma_separator}} VEF" 1181 }, 1182 "VND": { 1183 "money_format": "{{amount_no_decimals_with_comma_separator}}₫", 1184 "money_with_currency_format": "{{amount_no_decimals_with_comma_separator}} VND" 1185 }, 1186 "XBT": { 1187 "money_format": "{{amount_no_decimals}} BTC", 1188 "money_with_currency_format": "{{amount_no_decimals}} BTC" 1189 }, 1190 "XOF": { 1191 "money_format": "CFA{{amount}}", 1192 "money_with_currency_format": "CFA{{amount}} XOF" 1193 }, 1194 "ZMW": { 1195 "money_format": "K{{amount_no_decimals_with_comma_separator}}", 1196 "money_with_currency_format": "ZMW{{amount_no_decimals_with_comma_separator}}" 1197 } 1198 }; 1199 1200 var baseCurrency = window.theme.shopCurrency, 1201 newCurrency = document.querySelector('.CurrencySelector__Select').value; 1202 1203 __WEBPACK_IMPORTED_MODULE_0__Dom__["default"].nodeListToArray((selector || document).querySelectorAll('[data-money-convertible]')).forEach(function (item) { 1204 if (!item.hasAttribute('data-currency-' + baseCurrency)) { 1205 item.setAttribute('data-currency-' + baseCurrency, item.innerHTML); 1206 } 1207 1208 // If the amount has already been converted, we leave it alone. 1209 if (item.getAttribute('data-currency') === newCurrency) { 1210 return; 1211 } 1212 1213 var baseAmount = item.getAttribute('data-currency-' + baseCurrency); 1214 1215 // If we are converting to a currency that we have saved, we will use the saved amount. 1216 if (item.hasAttribute('data-currency-' + newCurrency)) { 1217 item.innerHTML = item.getAttribute('data-currency-' + newCurrency); 1218 } else { 1219 var newFormat = moneyFormats[newCurrency][window.theme.currencyConversionMoneyFormat] || '{{amount}}'; 1220 1221 // We have to normalize by replacing dot by comma and comma by dot 1222 if (window.theme.moneyFormat.indexOf('with_comma_separator') !== -1) { 1223 baseAmount = baseAmount.replace(/[,.]/g, function (match) { 1224 // If `,` is matched return `.`, if `.` matched return `,` 1225 return match === ',' ? '.' : ','; 1226 }); 1227 } 1228 1229 // Converting to Y for the first time? Let's get to it! 1230 var cents = window.Currency.convert(parseFloat(baseAmount.replace(/^[^0-9]+|[^0-9.]/g, '', ''), 10) * 100, baseCurrency, newCurrency); 1231 1232 if (window.theme.currencyConversionRoundAmounts) { 1233 cents = Math.round(cents / 100) * 100; 1234 } 1235 1236 var newFormattedAmount = _this3.formatMoney(cents, newFormat); 1237 1238 item.innerHTML = newFormattedAmount; 1239 item.setAttribute('data-currency-' + newCurrency, newFormattedAmount); 1240 } 1241 1242 // We record the new currency locally. 1243 item.setAttribute('data-currency', newCurrency); 1244 }); 1245 1246 localStorage.setItem('currency', newCurrency); 1247 } 1248 }]); 1249 1250 return Currency; 1251 }(); 1252 /* harmony export (immutable) */ 1253 1254 __webpack_exports__["default"] = Currency; 1255 1256 /***/ 1257 }, 1258 /* 6 */ 1259 /***/function (module, __webpack_exports__, __webpack_require__) { 1260 1261 "use strict"; 1262 1263 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1264 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__Accessibility__ = __webpack_require__(3); 1265 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "AccessibilityHelper", function () { 1266 return __WEBPACK_IMPORTED_MODULE_0__Accessibility__["default"]; 1267 }); 1268 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__Animation__ = __webpack_require__(7); 1269 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "AnimationHelper", function () { 1270 return __WEBPACK_IMPORTED_MODULE_1__Animation__["default"]; 1271 }); 1272 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__Currency__ = __webpack_require__(5); 1273 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "CurrencyHelper", function () { 1274 return __WEBPACK_IMPORTED_MODULE_2__Currency__["default"]; 1275 }); 1276 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__Dom__ = __webpack_require__(0); 1277 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "DomHelper", function () { 1278 return __WEBPACK_IMPORTED_MODULE_3__Dom__["default"]; 1279 }); 1280 /* harmony import */var __WEBPACK_IMPORTED_MODULE_4__Image__ = __webpack_require__(10); 1281 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ImageHelper", function () { 1282 return __WEBPACK_IMPORTED_MODULE_4__Image__["default"]; 1283 }); 1284 /* harmony import */var __WEBPACK_IMPORTED_MODULE_5__Responsive__ = __webpack_require__(2); 1285 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ResponsiveHelper", function () { 1286 return __WEBPACK_IMPORTED_MODULE_5__Responsive__["default"]; 1287 }); 1288 1289 /***/ 1290 }, 1291 /* 7 */ 1292 /***/function (module, __webpack_exports__, __webpack_require__) { 1293 1294 "use strict"; 1295 1296 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1297 1298 var Animation = function () { 1299 function Animation() { 1300 _classCallCheck(this, Animation); 1301 } 1302 1303 _createClass(Animation, null, [{ 1304 key: 'slideUp', 1305 1306 /** 1307 * Slide up aims to close an element. To do that, we take the height of the element, and set it to 0 to 1308 * force an animation 1309 */ 1310 value: function slideUp(element) { 1311 element.style.height = element.scrollHeight + 'px'; // Force previous height to allow CSS transition 1312 element.offsetHeight; // Force redraw 1313 element.style.height = 0; 1314 } 1315 1316 /** 1317 * Slide down aims to open an element. To do that, you must make sure that the element you are trying to open 1318 * is set with height: 0; overflow: hidden in the CSS, and does not contain any padding nor margin. 1319 */ 1320 1321 }, { 1322 key: 'slideDown', 1323 value: function slideDown(element) { 1324 if (element.style.height === 'auto') { 1325 return; 1326 } 1327 1328 // To do the animation we temporarily hide it, check the height, and transition to it 1329 element.style.height = element.firstElementChild.scrollHeight + 'px'; 1330 1331 var transitionEnded = function transitionEnded(event) { 1332 if (event.propertyName === 'height') { 1333 element.style.height = 'auto'; // Allows the content to grow normally 1334 element.removeEventListener('transitionend', transitionEnded); 1335 } 1336 }; 1337 1338 element.addEventListener('transitionend', transitionEnded); 1339 } 1340 }]); 1341 1342 return Animation; 1343 }(); 1344 /* harmony export (immutable) */ 1345 1346 __webpack_exports__["default"] = Animation; 1347 1348 /***/ 1349 }, 1350 /* 8 */ 1351 /***/function (module, __webpack_exports__, __webpack_require__) { 1352 1353 "use strict"; 1354 1355 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1356 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Acce
1356ssibility__ = __webpack_require__(3); 1357 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper__ = __webpack_require__(6); 1358 1359 var Drawer = function () { 1360 function Drawer(element) { 1361 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1362 1363 _classCallCheck(this, Drawer); 1364 1365 this.element = element; 1366 this.delegateElement = new domDelegate.Delegate(this.element); 1367 this.delegateBody = new domDelegate.Delegate(document.body); 1368 1369 this.onOpen = options['onOpen'] || function () { }; 1370 this.onClose = options['onClose'] || function () { }; 1371 1372 this.isOpen = false; 1373 this.direction = this.element.classList.contains('Drawer--fromLeft') ? 'fromLeft' : 'fromRight'; 1374 1375 this.pageOverlayElement = document.querySelector('.PageOverlay'); 1376 1377 this._attachListeners(); 1378 } 1379 1380 _createClass(Drawer, [{ 1381 key: 'destroy', 1382 value: function destroy() { 1383 this.delegateBody.off('click', '[data-action="open-drawer"][data-drawer-id="' + this.element.id + '"]'); 1384 this.delegateBody.off('click', '[data-action="close-drawer"][data-drawer-id="' + this.element.id + '"]'); 1385 window.removeEventListener('resize', this._calculateMaxHeightListener); 1386 } 1387 }, { 1388 key: 'toggle', 1389 value: function toggle() { 1390 this.isOpen ? this.close() : this.open(); 1391 } 1392 }, { 1393 key: 'open', 1394 value: function open(event) { 1395 if (this.isOpen) { 1396 return; 1397 } 1398 1399 if (event) { 1400 event.preventDefault(); 1401 } 1402 1403 this.element.setAttribute('aria-hidden', 'false'); 1404 this._calculateMaxHeight(); 1405 1406 document.documentElement.classList.add('no-scroll'); 1407 1408 // This prevent the body to scroll on iOS. This is honestly a bit hacky, but until the platform supports "touch-action: none" like 1409 // other browsers, this is the only way to achieve that 1410 disableBodyScroll(true, '[data-scrollable]'); 1411 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].trapFocus(this.element, 'drawer'); 1412 1413 // We attach an event to the page overlay to close it 1414 this.pageOverlayElement.classList.add('is-visible'); 1415 this.pageOverlayElement.addEventListener('click', this._closeListener); 1416 1417 this.isOpen = true; 1418 1419 this.onOpen(); // Call the callback to allow other code to hook their logic 1420 1421 return false; 1422 } 1423 }, { 1424 key: 'close', 1425 value: function close(event) { 1426 if (!this.isOpen) { 1427 return; 1428 } 1429 1430 if (event) { 1431 event.preventDefault(); 1432 } 1433 1434 this.element.setAttribute('aria-hidden', 'true'); 1435 1436 document.documentElement.classList.remove('no-scroll'); 1437 1438 disableBodyScroll(false, '[data-scrollable]'); 1439 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].removeTrapFocus(this.element, 'drawer'); 1440 1441 this.pageOverlayElement.classList.remove('is-visible'); 1442 this.pageOverlayElement.removeEventListener('click', this._closeListener); 1443 1444 this.isOpen = false; 1445 1446 this.onClose(); // Call the callback to allow other code to hook their logic 1447 } 1448 }, { 1449 key: '_attachListeners', 1450 value: function _attachListeners() { 1451 this._openListener = this.open.bind(this); 1452 this._closeListener = this.close.bind(this); 1453 this._calculateMaxHeightListener = this._calculateMaxHeight.bind(this); 1454 1455 this.delegateBody.on('click', '[data-action="open-drawer"][data-drawer-id="' + this.element.id + '"]', this._openListener); 1456 this.delegateBody.on('click', '[data-action="close-drawer"][data-drawer-id="' + this.element.id + '"]', this._closeListener); 1457 this.element.addEventListener('keyup', this._handleKeyboard.bind(this)); 1458 window.addEventListener('resize', this._calculateMaxHeightListener); 1459 } 1460 1461 /** 1462 * Make sure that we force a max-height so that the drawer always stays on screen 1463 */ 1464 1465 }, { 1466 key: '_calculateMaxHeight', 1467 value: function _calculateMaxHeight() { 1468 this.element.style.maxHeight = window.innerHeight + 'px'; 1469 } 1470 }, { 1471 key: '_handleKeyboard', 1472 1473 1474 /** 1475 * Handle a11y events 1476 */ 1477 value: function _handleKeyboard(event) { 1478 if (this.isOpen && event.keyCode === 27) { 1479 this.close(); 1480 } 1481 } 1482 }]); 1483 1484 return Drawer; 1485 }(); 1486 /* harmony export (immutable) */ 1487 1488 __webpack_exports__["default"] = Drawer; 1489 1490 /***/ 1491 }, 1492 /* 9 */ 1493 /***/function (module, __webpack_exports__, __webpack_require__) { 1494 1495 "use strict"; 1496 1497 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1498 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Acce
1498ssibility__ = __webpack_require__(3); 1499 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 1500 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__ = __webpack_require__(2); 1501 1502 var Popover = function () { 1503 function Popover(element, options) { 1504 _classCallCheck(this, Popover); 1505 1506 this.element = element; 1507 this.delegateElement = new domDelegate.Delegate(this.element); 1508 1509 this.activator = options['activator'] || document.querySelector('[aria-controls="' + element.getAttribute('id') + '"]'); 1510 this.preferredPosition = options['preferredPosition'] || 'bottom'; 1511 this.isOpen = false; 1512 1513 this.onValueChanged = options['onValueChanged'] || function () { }; 1514 this.onOpen = options['onOpen'] || function () { }; 1515 this.onClose = options['onClose'] || function () { }; 1516 1517 this.showOverlay = options['showOverlay'] === undefined ? true : options['showOverlay']; 1518 this.pageOverlayElement = document.querySelector('.PageOverlay'); 1519 1520 this._attachListeners(); 1521 } 1522 1523 _createClass(Popover, [{ 1524 key: 'destroy', 1525 value: function destroy() { 1526 this.element.removeEventListener('keyup', this._handleKeyboardListener); 1527 this.delegateElement.off('click'); 1528 this.activator.removeEventListener('click', this._toggleListener); 1529 } 1530 }, { 1531 key: 'toggle', 1532 value: function toggle() { 1533 this.isOpen ? this.close() : this.open(); 1534 } 1535 }, { 1536 key: 'open', 1537 value: function open() { 1538 // Note: the additional check on the aria-controls is used here so that a given activator can be used on different 1539 // popovers and be modified dynamically in JavaScript 1540 if (this.isOpen || this.activator.getAttribute('aria-controls') !== this.element.id) { 1541 return; 1542 } 1543 1544 this.element.setAttribute('aria-hidden', 'false'); 1545 this.activator.setAttribute('aria-expanded', 'true'); 1546 1547 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].trapFocus(this.element, 'popover'); 1548 disableBodyScroll(true, '[data-scrollable]'); 1549 1550 document.documentElement.classList.add('no-scroll'); // Prevent scrolling when popover is open 1551 1552 if (__WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].matchesBreakpoint('lap-and-up')) { 1553 document.body.addEventListener('click', this._clickOutsideListener); 1554 this._position(); 1555 } else { 1556 this.element.removeAttribute('style'); 1557 1558 if (this.showOverlay) { 1559 this.pageOverlayElement.classList.add('is-visible'); 1560 this.pageOverlayElement.addEventListener('click', this._closeListener); 1561 } 1562 } 1563 1564 this.onOpen(this); // Call the callback to allow other code to hook their logic 1565 this.isOpen = true; 1566 } 1567 }, { 1568 key: 'close', 1569 value: function close() { 1570 if (!this.isOpen) { 1571 return; 1572 } 1573 1574 this.element.setAttribute('aria-hidden', 'true'); 1575 this.activator.setAttribute('aria-expanded', 'false'); 1576 1577 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].removeTrapFocus(this.element, 'popover'); 1578 disableBodyScroll(false, '[data-scrollable]'); 1579 1580 document.documentElement.classList.remove('no-scroll'); 1581 1582 if (__WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].matchesBreakpoint('lap-and-up')) { 1583 document.body.removeEventListener('click', this._clickOutsideListener); 1584 } else if (this.showOverlay) { 1585 this.pageOverlayElement.classList.remove('is-visible'); 1586 this.pageOverlayElement.removeEventListener('click', this._closeListener); 1587 } 1588 1589 this.onClose(this); // Call the callback to allow other code to hook their logic 1590 this.isOpen = false;
1591 } 1592 }, { 1593 key: '_attachListeners', 1594 value: function _attachListeners() { 1595 this._handleKeyboardListener = this._handleKeyboard.bind(this); 1596 this._clickOutsideListener = this._clickOutside.bind(this); 1597 this._closeListener = this.close.bind(this); 1598 this._toggleListener = this.toggle.bind(this); 1599 1600 this.element.addEventListener('keyup', this._handleKeyboardListener); 1601 this.activator.addEventListener('click', this._toggleListener); 1602 1603 this.delegateElement.on('click', '[data-action="close-popover"]', this.close.bind(this)); 1604 this.delegateElement.on('click', '[data-action="select-value"]', this._valueChanged.bind(this)); 1605 } 1606 1607 /** 1608 * Whenever a value is selected, it can notify a callback so that the calling code can do its own logic in response 1609 * of the value change 1610 */ 1611 1612 }, { 1613 key: '_valueChanged', 1614 value: function _valueChanged(event) { 1615 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].getSiblings(event.target, '.is-selected').forEach(function (item) { 1616 return item.classList.remove('is-selected'); 1617 }); 1618 event.target.classList.add('is-selected'); 1619 1620 // If there is a callback in option we call it with the value 1621 this.onValueChanged(event.target.getAttribute('data-value'), event.target, this.activator); 1622 this.close(); 1623 } 1624 1625 /** 1626 * Callback that is called to decide if we should close the popover when a click is captured outside 1627 */ 1628 1629 }, { 1630 key: '_clickOutside', 1631 value: function _clickOutside(event) { 1632 if (!event.target.closest('.Popover') && !event.target.closest('.Modal') && event.target !== this.activator && !this.activator.contains(event.target)) { 1633 this.close(); 1634 } 1635 } 1636 1637 /** 1638 * On desktop, we reposition the popover in JavaScript by doing some smart logic to detect the most appropriate area 1639 */ 1640 1641 }, { 1642 key: '_position', 1643 value: function _position() { 1644 var _this4 = this; 1645 1646 var topPosition = 0, 1647 rightPosition = 0, 1648 position = '', 1649 alignment = '', 1650 threshold = 20; 1651 1652 fastdom.measure(function () { 1653 var windowHeight = window.innerHeight, 1654 activatorBoundingRect = _this4.activator.getBoundingClientRect(), 1655 halfHeight = windowHeight / 2; 1656 1657 if (_this4.preferredPosition === 'bottom') { 1658 alignment = 'right'; 1659 1660 if (_this4.element.clientHeight <= windowHeight - (activatorBoundingRect.bottom + threshold) || windowHeight - activatorBoundingRect.bottom >= halfHeight) { 1661 position = 'bottom'; 1662 } else { 1663 position = 'top'; 1664 } 1665 } else if (_this4.preferredPosition === 'top') { 1666 alignment = 'right'; 1667 1668 if (_this4.element.clientHeight <= activatorBoundingRect.top - threshold || activatorBoundingRect.top >= halfHeight) { 1669 position = 'top'; 1670 } else { 1671 position = 'bottom'; 1672 } 1673 } else { 1674 position = 'left'; 1675 1676 // Is there enough space to use the center alignment (which is preferred)? 1677 var halfElementHeight = _this4.element.clientHeight / 2; 1678 1679 if (activatorBoundingRect.top >= halfElementHeight && windowHeight - activatorBoundingRect.bottom >= halfElementHeight) { 1680 alignment = 'center'; 1681 } else if (windowHeight - activatorBoundingRect.bottom >= halfElementHeight) { 1682 alignment = 'bottom'; 1683 } else { 1684 alignment = 'top'; 1685 } 1686 } 1687 1688 if (position === 'top') { 1689 topPosition = activatorBoundingRect.top - _this4.element.clientHeight - threshold; 1690 rightPosition = window.innerWidth - activatorBoundingRect.right; 1691 } else if (position === 'bottom') { 1692 topPosition = activatorBoundingRect.bottom + threshold; 1693 rightPosition = window.innerWidth - activatorBoundingRect.right; 1694 } else { 1695 rightPosition = window.innerWidth - activatorBoundingRect.left + threshold; 1696 1697 if (alignment === 'center') { 1698 topPosition = activatorBoundingRect.top - _this4.element.clientHeight / 2 + _this4.activator.clientHeight / 2; 1699 } else if (alignment === 'top') { 1700 topPosition = activatorBoundingRect.bottom - _this4.element.clientHeight; 1701 } else { 1702 topPosition = activatorBoundingRect.top; 1703 } 1704 } 1705 }); 1706 1707 fastdom.mutate(function () {
1708 ['Popover--positionBottom', 'Popover--positionTop', 'Popover--positionCenter', 'Popover--alignTop', 'Popover--alignCenter', 'Popover--alignBottom'].map(function (item) { 1709 return _this4.element.classList.remove(item); 1710 }); 1711 _this4.element.classList.add('Popover--position' + (position.charAt(0).toUpperCase() + position.slice(1))); 1712 _this4.element.classList.add('Popover--align' + (alignment.charAt(0).toUpperCase() + alignment.slice(1))); 1713 1714 _this4.element.setAttribute('style', 'top: ' + parseInt(topPosition) + 'px; right: ' + parseInt(rightPosition) + 'px;'); 1715 }); 1716 } 1717 1718 /** 1719 * Handle a11y events 1720 */ 1721 1722 }, { 1723 key: '_handleKeyboard', 1724 value: function _handleKeyboard(event) { 1725 if (this.isOpen && event.keyCode === 27) { 1726 this.close(); 1727 } 1728 } 1729 }]); 1730 1731 return Popover; 1732 }(); 1733 /* harmony export (immutable) */ 1734 1735 __webpack_exports__["default"] = Popover; 1736 1737 /***/ 1738 }, 1739 /* 10 */ 1740 /***/function (module, __webpack_exports__, __webpack_require__) { 1741 1742 "use strict"; 1743 1744 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1745 1746 var Image = function () { 1747 function Image() { 1748 _classCallCheck(this, Image); 1749 } 1750 1751 _createClass(Image, null, [{ 1752 key: 'getSizedImageUrl', 1753 1754 /** 1755 * Create a CDN URL (similar to the img_url filter in Liquid) 1756 */ 1757 value: function getSizedImageUrl(src, size) { 1758 if (size === null) { 1759 return src; 1760 } 1761 1762 if (size === 'master') { 1763 return src.replace(/http(s)?:/, ''); 1764 } 1765 1766 var match = src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i); 1767 1768 if (match) { 1769 var prefix = src.split(match[0]); 1770 var suffix = match[0]; 1771 1772 return (prefix[0] + '_' + size + suffix).replace(/http(s)?:/, ''); 1773 } else { 1774 return null; 1775 } 1776 } 1777 1778 /** 1779 * From a given set of desired sizes and a given image, filter out any unwanted sizes 1780 */ 1781 1782 }, { 1783 key: 'getSupportedSizes', 1784 value: function getSupportedSizes(image, desiredSizes) { 1785 var supportedSizes = [], 1786 imageWidth = image['width']; 1787 1788 desiredSizes.forEach(function (width) { 1789 if (imageWidth >= width) { 1790 supportedSizes.push(width); 1791 } 1792 }); 1793 1794 return supportedSizes; 1795 } 1796 }]); 1797 1798 return Image; 1799 }(); 1800 /* harmony export (immutable) */ 1801 1802 __webpack_exports__["default"] = Image; 1803 1804 /***/ 1805 }, 1806 /* 11 */ 1807 /***/function (module, __webpack_exports__, __webpack_require__) { 1808 1809 "use strict"; 1810 1811 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 1812 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Popover__ = __webpack_require__(9); 1813 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 1814 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__components_VariantSelector__ = __webpack_require__(16); 1815 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__helper_Currency__ = __webpack_require__(5); 1816 /** 1817 * This component handles all the logic of switching variant, updating product meta... 1818 */ 1819 1820 var ProductVariants = function () { 1821 function ProductVariants(container, options) { 1822 var _this5 = this; 1823 1824 _classCallCheck(this, ProductVariants); 1825 1826 this.element = container; 1827 this.delegateElement = new domDelegate.Delegate(this.element); 1828 this.options = options; 1829 1830 var jsonData = JSON.parse(this.element.querySelector('[data-product-json]').innerHTML); 1831 1832 this.productData = jsonData['product']; 1833 this.variantsInventories = jsonData['inventories'] || {}; 1834 this.masterSelector = this.element.querySelector('#product-select-' + this.productData['id']); 1835 1836 // We init value with the first selected variant 1837 this.productData['variants'].forEach(function (variant) { 1838 if (variant['id'] === jsonData['selected_variant_id']) { 1839 _this5.currentVariant = variant; 1840 _this5.option1 = variant['option1']; 1841 _this5.option2 = variant['option2']; 1842 _this5.option3 = variant['option3']; 1843 } 1844 }); 1845 1846 this._attachListeners(); 1847 this._createSelectors(); 1848 } 1849 1850 _createClass(ProductVariants, [{ 1851 key: 'destroy', 1852 value: function destroy() { 1853 this.delegateElement.off('click');
1854 this.formPopovers.forEach(function (popover) { 1855 return popover.destroy(); 1856 }); 1857 this.formVariantSelectors.forEach(function (selector) { 1858 return selector.destroy(); 1859 }); 1860 } 1861 }, { 1862 key: '_attachListeners', 1863 value: function _attachListeners() { 1864 console.log('event added'); 1865 this.delegateElement.on('click', '[data-action="add-to-cart"]', this._addToCart.bind(this)); 1866 this.delegateElement.on('click', '[data-action="decrease-quantity"]', this._decreaseQuantity.bind(this)); 1867 this.delegateElement.on('click', '[data-action="increase-quantity"]', this._increaseQuantity.bind(this)); 1868 this.delegateElement.on('change', '[name="quantity"]', this._validateQuantity.bind(this)); 1869 } 1870 1871 /** 1872 * Selectors can either be popovers or dedicated variant selectors. We therefore pre-create them all here 1873 */ 1874 1875 }, { 1876 key: '_createSelectors', 1877 value: function _createSelectors() { 1878 var _this6 = this; 1879 1880 // Create the instances for each selector 1881 this.formPopovers = []; 1882 this.formVariantSelectors = []; 1883 1884 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.OptionSelector')).forEach(function (item) { 1885 var popover = new __WEBPACK_IMPORTED_MODULE_0__components_Popover__["default"](item, { preferredPosition: 'left', onValueChanged: _this6._onOptionChanged.bind(_this6) }); 1886 _this6.formPopovers.push(popover); 1887 }); 1888 1889 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.VariantSelector')).forEach(function (item) { 1890 var variantSelector = new __WEBPACK_IMPORTED_MODULE_2__components_VariantSelector__["default"](item, { onValueChanged: _this6._onOptionChanged.bind(_this6) }); 1891 _this6.formVariantSelectors.push(variantSelector); 1892 }); 1893 } 1894 1895 /** 1896 * --------------------------------------------------------------------------------------------------- 1897 * CODE THAT HANDLE VARIANT CHANGES IN THE FRONT 1898 * 1899 * Please note that this code is highly dependant on the markup and classes, so make sure to NOT 1900 * edit this code 1901 * --------------------------------------------------------------------------------------------------- 1902 */ 1903 1904 /** 1905 * This callback is called whenever the variant changes and allows to update data about the active variant 1906 */ 1907 1908 }, { 1909 key: '_onVariantChanged', 1910 value: function _onVariantChanged(previousVariant, newVariant) { 1911 // 1st: the prices 1912 this._updateProductPrices(newVariant, previousVariant); 1913 1914 // 2th: update inventory 1915 this._updateInventory(newVariant, previousVariant); 1916 1917 // 3th: the add to cart button 1918 this._updateAddToCartButton(newVariant, previousVariant); 1919 1920 if (window.theme.currencyConversionEnabled) { 1921 __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].convertAll(this.element); 1922 } 1923 1924 // Finally, we send an event so that other system could hook and do their own logic 1925 this.element.dispatchEvent(new CustomEvent('variant:changed', { 1926 bubbles: true, 1927 detail: { variant: newVariant, previousVariant: previousVariant } 1928 })); 1929 } 1930 1931 /** 1932 * Update the prices (optionally showing compare at price) 1933 */ 1934 1935 }, { 1936 key: '_updateProductPrices', 1937 value: function _updateProductPrices(newVariant, previousVariant) { 1938 var productMetaPrices = this.element.querySelector('.ProductMeta__PriceList'); 1939 1940 if (!newVariant) { 1941 productMetaPrices.style.display = 'none'; 1942 } else { 1943 if (previousVariant && previousVariant['price'] === newVariant['price'] && previousVariant['compare_at_price'] === newVariant['compare_at_price']) { 1944 return; // The price do not have changed so let's return to avoid changing the DOM for nothing 1945 } 1946 1947 productMetaPrices.innerHTML = ''; 1948 1949 if (newVariant['compare_at_price'] > newVariant['price']) { 1950 productMetaPrices.innerHTML += '<span class="ProductMeta__Price Price Price--highlight Text--subdued u-h4" data-money-convertible>' + __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['price'], window.theme.moneyFormat) + '</span>'; 1951 productMetaPrices.innerHTML += '<span class="ProductMeta__Price Price Price--compareAt Text--subdued u-h4" data-money-convertible>' + __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['compare_at_price'], window.theme.moneyFormat) + '</span>'; 1952 document.querySelector(".mobile_price").textContent = __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['price'], window.theme.moneyFormat); 1953 document.querySelector(".mobile_compare_price").textContent = __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['compare_at_price'], window.theme.moneyFormat); 1954 } else { 1955 productMetaPrices.innerHTML += '<span class="ProductMeta__Price Price Text--subdued u-h4" data-money-convertible>' + __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['price'], window.theme.moneyFormat) + '</span>'; 1956 document.querySelector(".mobile_price").textContent = __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['price'], window.theme.moneyFormat); 1957 document.querySelector(".mobile_compare_price").textContent = ''; 1958 } 1959 1960 productMetaPrices.style.display = ''; 1961 } 1962 } 1963 1964 /** 1965 * Update the inventory (if needed) 1966 */ 1967 1968 }, { 1969 key: '_updateInventory', 1970 value: function _updateInventory(newVariant) { 1971 if (!this.options['showInventoryQuantity']) { 1972 return; 1973 } 1974 1975 var productFormInventory = this.element.querySelector('.ProductForm__Inventory'), 1976 variantInventory = newVariant ? this.variantsInventories[newVariant['id']] : null; 1977 1978 if (!newVariant || null === variantInventory['inventory_management'] || variantInventory['inventory_quantity'] <= 0 || this.options['inventoryQuantityThreshold'] > 0 && variantInventory['inventory_quantity'] > this.options['inventoryQuantityThreshold']) { 1979 productFormInventory.style.display = 'none'; 1980 } else { 1981 productFormInventory.textContent = variantInventory['inventory_message']; 1982 productFormInventory.style.display = ''; 1983 } 1984 } 1985 1986 /** 1987 * Update the add to cart 1988 */ 1989 1990 }, { 1991 key: '_updateAddToCartButton', 1992 value: function _updateAddToCartButton(newVariant) { 1993 var addToCartButton = this.element.querySelector('.ProductForm__AddToCart'), 1994 shopifyPaymentButton = this.element.querySelector('.shopify-payment-button'), 1995 newButton = document.createElement('button'); 1996 1997 newButton.setAttribute('type', 'submit'); 1998 newButton.className = 'ProductForm__AddToCart Button Button--full'; 1999 2000 if (!newVariant) { 2001 newButton.setAttribute('disabled', 'disabled'); 2002 newButton.removeAttribute('data-action'); 2003 newButton.classList.add('Button--secondary'); 2004 newButton.innerHTML = window.languages.productFormUnavailable; 2005 } else { 2006 if (newVariant['available']) { 2007 newButton.removeAttribute('disabled'); 2008 newButton.classList.add(this.options['showPaymentButton'] ? 'Button--secondary' : 'Button--primary'); 2009 newButton.setAttribute('data-action', 'add-to-cart'); 2010
2011 newButton.innerHTML = '\n <span>' + window.languages.productFormAddToCart + '</span>\n <span class="Button__SeparatorDot"></span>\n <span data-money-convertible>' + __WEBPACK_IMPORTED_MODULE_3__helper_Currency__["default"].formatMoney(newVariant['price'], window.theme.moneyFormat) + '</span>\n '; 2012 } else { 2013 newButton.setAttribute('disabled', 'disabled'); 2014 newButton.classList.add('Button--secondary'); 2015 newButton.removeAttribute('data-action'); 2016 newButton.innerHTML = window.languages.productFormSoldOut; 2017 } 2018 } 2019 2020 if (this.options['showPaymentButton'] && shopifyPaymentButton) { 2021 if (!newVariant || !newVariant['available']) { 2022 shopifyPaymentButton.style.display = 'none'; 2023 } else { 2024 shopifyPaymentButton.style.display = 'block'; 2025 } 2026 } 2027 2028 // We replace the HTML instead of editing as it prevents for the CSS transition to show up 2029 addToCartButton.parentNode.replaceChild(newButton, addToCartButton); 2030 } 2031 2032 /** 2033 * --------------------------------------------------------------------------------------------------- 2034 * INTERNAL CODE THAT HANDLE VARIANT CHANGES 2035 * --------------------------------------------------------------------------------------------------- 2036 */ 2037 2038 /** 2039 * Whenever an option is changed, this code fetch the corresponding active variant 2040 */ 2041 2042 }, { 2043 key: '_onOptionChanged', 2044 value: function _onOptionChanged(newValue, target, activator) { 2045 this['option' + target.getAttribute('data-option-position')] = newValue; 2046 2047 // We change the value associated with the activator, and check if we have a color swatch 2048 var selectedValueElement = activator.querySelector('.ProductForm__SelectedValue'), 2049 colorSwatchElement = activator.querySelector('.ProductForm__ColorSwatch'); 2050 2051 selectedValueElement.innerHTML = newValue; 2052 2053 if (colorSwatchElement) { 2054 // If the browser does not support a given color, it won't change it back to initial value 2055 if (!window.CSS || window.CSS && window.CSS.supports('background-color: ' + target.getAttribute('data-background-color'))) { 2056 colorSwatchElement.style.backgroundColor = target.getAttribute('data-background-color'); 2057 } else { 2058 colorSwatchElement.style.backgroundColor = 'transparent'; 2059 } 2060 2061 colorSwatchElement.style.backgroundImage = 'url(' + target.getAttribute('data-background-image') + ')'; 2062 2063 if (newValue.toLowerCase() === 'white') { 2064 colorSwatchElement.classList.add('ProductForm__ColorSwatch--white'); 2065 } else { 2066 colorSwatchElement.classList.remove('ProductForm__ColorSwatch--white'); 2067 } 2068 } 2069 2070 // Finally, we get the new variant 2071 var previousVariant = this.currentVariant; 2072 this.currentVariant = this._getCurrentVariantFromOptions(); 2073 2074 this._onVariantChanged(previousVariant, this.currentVariant); 2075 2076 if (this.currentVariant) { 2077 if (this.options['enableHistoryState']) { 2078 this._updateHistoryState(this.currentVariant); 2079 } 2080 2081 // We need to modify the hidden select that contain the id attribute as well 2082 this.masterSelector.querySelector('[selected]').removeAttribute('selected'); 2083 this.masterSelector.querySelector('[value="' + this.currentVariant['id'] + '"]').setAttribute('selected', 'selected'); 2084 } 2085 } 2086 2087 /** 2088 * Get the active variant based on the options 2089 */ 2090 2091 }, { 2092 key: '_getCurrentVariantFromOptions', 2093 value: function _getCurrentVariantFromOptions() { 2094 var _this7 = this; 2095 2096 var found = false; 2097 2098 this.productData['variants'].forEach(function (variant) { 2099 if (variant['option1'] === _this7.option1 && variant['option2'] === _this7.option2 && variant['option3'] === _this7.option3) { 2100 found = variant; 2101 } 2102 }); 2103 2104 return found || null; 2105 } 2106 2107 /** 2108 * Update the history state for browsers that support it 2109 */ 2110 2111 }, { 2112 key: '_updateHistoryState', 2113 value: function _updateHistoryState(variant) { 2114 if (!history.replaceState) { 2115 return; 2116 } 2117 2118 var newUrl = window.location.protocol + '//' + window.location.host + window.location.pathname + '?variant=' + variant.id; 2119 2120 window.history.replaceState({ path: newUrl }, '', newUrl); 2121 } 2122 2123 /** 2124 * --------------------------------------------------------------------------------------------------- 2125 * INTERNAL CODE THAT HANDLE PRODUCT ADD TO CART 2126 * --------------------------------------------------------------------------------------------------- 2127 */ 2128 2129 }, { 2130 key: '_addToCart', 2131 value: function _addToCart(event) { 2132 console.log(this); 2133 var _this8 = this; 2134 2135 if (!this.options['useAjaxCart']) { 2136 return; // When using a cart type of page, we just simply redirect to the cart page 2137 } 2138 2139 event.preventDefault(); // Prevent form to be submitted 2140 2141 var addToCartButton = this.element.querySelector('.ProductForm__AddToCart'); 2142 2143 // First, we switch the status of the button 2144 addToCartButton.setAttribute('disabled', 'disabled'); 2145 document.dispatchEvent(new CustomEvent('theme:loading:start')); 2146 2147 // Then we add the product in Ajax 2148 var formElement = this.element.querySelector('form[action^="/cart/add"]'), 2149 formData = new FormData(formElement); 2150 2151 /* 2152 fetch('/cart/add.js', { 2153 credentials: 'same-origin', 2154 method: 'POST', 2155 headers: { 2156 'Accept': 'application/json', 2157 'X-Requested-With': 'XMLHttpRequest' // This is needed as currently there is a bug in Shopify that assumes this header 2158 }, 2159 body: formData 2160 }).then((response) => { 2161 document.dispatchEvent(new CustomEvent('theme:loading:end')); 2162 if (response.ok) { 2163 addToCartButton.removeAttribute('disabled'); 2164 // We simply trigger an event so the mini-cart
2164can re-render 2165 this.element.dispatchEvent(new CustomEvent('product:added', { 2166 bubbles: true, 2167 detail: { 2168 variant: this.currentVariant, 2169 quantity: parseInt(formElement.querySelector('[name="quantity"]').value) 2170 } 2171 })); 2172 } else { 2173 response.json().then((content) => { 2174 let errorMessageElement = document.createElement('span'); 2175 errorMessageElement.className = 'ProductForm__Error Alert Alert--error'; 2176 errorMessageElement.innerHTML = content['description']; 2177 addToCartButton.removeAttribute('disabled'); 2178 addToCartButton.insertAdjacentElement('afterend', errorMessageElement); 2179 setTimeout(function() { 2180 errorMessageElement.remove(); 2181 }, 2500); 2182 }); 2183 } 2184 });*/ 2185 2186 // Unfortunately Shopify currently does not support fetch API for the Facebook Pixel. We therefore had to revert 2187 // to old style Ajax calls until this is tackled by the dev team 2188 2189 function formSerialize(form) { 2190 var i = void 0, 2191 j = void 0, 2192 len = void 0, 2193 jLen = void 0, 2194 formElement = void 0, 2195 q = []; 2196 2197 function urlencode(str) { 2198 // http://kevin.vanzonneveld.net 2199 // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current 2200 // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following. 2201 return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+'); 2202 } 2203 2204 function addNameValue(name, value) { 2205 q.push(urlencode(name) + '=' + urlencode(value)); 2206 } 2207 2208 if (!form || !form.nodeName || form.nodeName.toLowerCase() !== 'form') { 2209 throw 'You must supply a form element'; 2210 } 2211 2212 for (i = 0, len = form.elements.length; i < len; i++) { 2213 formElement = form.elements[i]; 2214 2215 if (formElement.name === '' || formElement.disabled) { 2216 continue; 2217 } 2218 2219 switch (formElement.nodeName.toLowerCase()) { 2220 case 'input': 2221 switch (formElement.type) { 2222 case 'text': 2223 case 'hidden': 2224 case 'password': 2225 case 'button': // Not submitted when submitting form manually, though jQuery does serialize this and it can be an HTML4 successful control 2226 case 'submit': 2227 addNameValue(formElement.name, formElement.value); 2228 break; 2229 case 'checkbox': 2230 case 'radio': 2231 if (formElement.checked) { 2232 addNameValue(formElement.name, formElement.value); 2233 } 2234 break; 2235 case 'file': 2236 // addNameValue(formElement.name, formElement.value); // Will work and part of HTML4 "successful controls", but not used in jQuery 2237 break; 2238 case 'reset': 2239 break; 2240 } 2241 break; 2242 case 'textarea': 2243 addNameValue(formElement.name, formElement.value); 2244 break; 2245 case 'select': 2246 switch (formElement.type) { 2247 case 'select-one': 2248 addNameValue(formElement.name, formElement.value); 2249 break; 2250 case 'select-multiple': 2251 for (j = 0, jLen = formElement.options.length; j < jLen; j++) { 2252 if (formElement.options[j].selected) { 2253 addNameValue(formElement.name, formElement.options[j].value); 2254 } 2255 } 2256 break; 2257 } 2258 break; 2259 case 'button': 2260 // jQuery does not submit these, though it is an HTML4 successful control 2261 switch (formElement.type) { 2262 case 'reset': 2263 case 'submit': 2264 case 'button': 2265 addNameValue(formElement.name, formElement.value); 2266 break; 2267 } 2268 break; 2269 } 2270 } 2271 return q.join('&'); 2272 } 2273 2274 var httpRequest = new XMLHttpRequest(); 2275 httpRequest.open('POST', '/cart/add.js', true); 2276 httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 2277 httpRequest.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); 2278 httpRequest.send(formSerialize(formElement)); 2279 2280 httpRequest.onreadystatechange = function () { 2281 // Process the server response here. 2282 if (httpRequest.readyState === XMLHttpRequest.DONE) { 2283 document.dispatchEvent(new CustomEvent('theme:loading:end')); 2284 2285 if (httpRequest.status === 200) { 2286 addToCartButton.removeAttribute('disabled'); 2287 console.log('element', _this8.element); 2288 // We simply trigger an event so the mini-cart
2288can re-render 2289 _this8.element.dispatchEvent(new CustomEvent('product:added', { 2290 2291 bubbles: true, 2292 detail: { 2293 variant: _this8.currentVariant, 2294 quantity: parseInt(formElement.querySelector('[name="quantity"]').value) 2295 } 2296 })); 2297 } else { 2298 var errors = JSON.parse(httpRequest['responseText']); 2299 2300 var errorMessageElement = document.createElement('span'); 2301 errorMessageElement.className = 'ProductForm__Error Alert Alert--error'; 2302 errorMessageElement.innerHTML = errors['description']; 2303 2304 addToCartButton.removeAttribute('disabled'); 2305 2306 addToCartButton.insertAdjacentElement('afterend', errorMessageElement); 2307 2308 setTimeout(function () { 2309 errorMessageElement.remove(); 2310 }, 2500); 2311 } 2312 } 2313 }; 2314 2315 event.preventDefault(); 2316 } 2317 2318 /** 2319 * --------------------------------------------------------------------------------------------------- 2320 * OTHER 2321 * --------------------------------------------------------------------------------------------------- 2322 */ 2323 2324 /** 2325 * When using the quantity selector, this can be used to decrease the quantity (be ensuring it won't be lower than 1) 2326 */ 2327 2328 }, { 2329 key: '_decreaseQuantity', 2330 value: function _decreaseQuantity(event, target) { 2331 target.nextElementSibling.value = Math.max(parseInt(target.nextElementSibling.value) - 1, 1); 2332 } 2333 2334 /** 2335 * When using the quantity selector, this can be used to increase the quantity 2336 */ 2337 2338 }, { 2339 key: '_increaseQuantity', 2340 value: function _increaseQuantity(event, target) { 2341 target.previousElementSibling.value = parseInt(target.previousElementSibling.value) + 1; 2342 } 2343 2344 /** 2345 * Make sure the quantity does not go below when manually changed 2346 */ 2347 2348 }, { 2349 key: '_validateQuantity', 2350 value: function _validateQuantity(event, target) { 2351 target.value = Math.max(parseInt(target.value) || 1, 1); 2352 } 2353 }]); 2354 2355 return ProductVariants; 2356 }(); 2357 /* harmony export (immutable) */ 2358 2359 __webpack_exports__["default"] = ProductVariants; 2360 2361 /***/ 2362 }, 2363 /* 12 */ 2364 /***/function (module, __webpack_exports__, __webpack_require__) { 2365 2366 "use strict"; 2367 2368 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 2369 2370 var CountrySelector = function () { 2371 function CountrySelector(countrySelect, provinceSelect) { 2372 _classCallCheck(this, CountrySelector); 2373 2374 this.countrySelect = countrySelect; 2375 this.provinceSelect = provinceSelect; 2376 2377 if (this.countrySelect && this.provinceSelect) { 2378 this._attachListeners(); 2379 this._initSelectors(); 2380 } 2381 } 2382 2383 _createClass(CountrySelector, [{ 2384 key: 'destroy', 2385 value: function destroy() { 2386 if (this.countrySelect) { 2387 this.countrySelect.removeEventListener('change', this._onCountryChangedListener); 2388 } 2389 } 2390 }, { 2391 key: '_initSelectors', 2392 value: function _initSelectors() { 2393 // Check first the default value of country 2394 var defaultCountry = this.countrySelect.getAttribute('data-default'); 2395 2396 if (defaultCountry) { 2397 this.countrySelect.value = defaultCountry; 2398 } else { 2399 this.countrySelect.selectedIndex = 0; 2400 } 2401 2402 var event = new Event('change', { bubbles: true }); 2403 this.countrySelect.dispatchEvent(event); 2404 2405 // Then the province 2406 var defaultProvince = this.provinceSelect.getAttribute('data-default'); 2407 2408 if (defaultProvince) { 2409 this.provinceSelect.value = defaultProvince; 2410 } 2411 } 2412 }, { 2413 key: '_attachListeners', 2414 value: function _attachListeners() { 2415 this._onCountryChangedListener = this._onCountryChanged.bind(this); 2416 this.countrySelect.addEventListener('change', this._onCountryChangedListener); 2417 } 2418 }, { 2419 key: '_onCountryChanged', 2420 value: function _onCountryChanged() { 2421 var _this9 = this; 2422 2423 var selectedOption = this.countrySelect.options[this.countrySelect.selectedIndex], 2424 provinces = JSON.parse(selectedOption.getAttribute('data-provinces') || '[]'); 2425 2426 // First remove all options 2427 this.provinceSelect.innerHTML = ''; 2428 2429 if (provinces.length === 0) { 2430 this.provinceSelect.parentNode.style.display = 'none'; 2431 return; 2432 } 2433 2434 // We need to build the provinces array
2435 provinces.forEach(function (data) { 2436 _this9.provinceSelect.options.add(new Option(data[1], data[0])); 2437 }); 2438 2439 this.provinceSelect.parentNode.style.display = 'block'; 2440 } 2441 }]); 2442 2443 return CountrySelector; 2444 }(); 2445 /* harmony export (immutable) */ 2446 2447 __webpack_exports__["default"] = CountrySelector; 2448 2449 /***/ 2450 }, 2451 /* 13 */ 2452 /***/function (module, __webpack_exports__, __webpack_require__) { 2453 2454 "use strict"; 2455 2456 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 2457 /** 2458 * This class allows to automatically scrolls within a div when this div does not fit into the visible space 2459 */ 2460 2461 var OverflowScroller = function () { 2462 function OverflowScroller(element) { 2463 _classCallCheck(this, OverflowScroller); 2464 2465 if (!element) { 2466 return; 2467 } 2468 2469 this.element = element; 2470 this.lastKnownY = window.scrollY; 2471 this.currentTop = 0; 2472 this.initialTopOffset = parseInt(window.getComputedStyle(this.element).top); 2473 2474 this._attachListeners(); 2475 } 2476 2477 _createClass(OverflowScroller, [{ 2478 key: 'destroy', 2479 value: function destroy() { 2480 window.removeEventListener('scroll', this._checkPositionListener); 2481 } 2482 }, { 2483 key: '_attachListeners', 2484 value: function _attachListeners() { 2485 this._checkPositionListener = this._checkPosition.bind(this); 2486 window.addEventListener('scroll', this._checkPositionListener); 2487 } 2488 }, { 2489 key: '_checkPosition', 2490 value: function _checkPosition() { 2491 var _this10 = this; 2492 2493 fastdom.measure(function () { 2494 var bounds = _this10.element.getBoundingClientRect(), 2495 maxTop = bounds.top + window.scrollY - _this10.element.offsetTop + _this10.initialTopOffset, 2496 minTop = _this10.element.clientHeight - window.innerHeight; 2497 2498 if (window.scrollY < _this10.lastKnownY) { 2499 _this10.currentTop -= window.scrollY - _this10.lastKnownY; 2500 } else { 2501 _this10.currentTop += _this10.lastKnownY - window.scrollY; 2502 } 2503 2504 _this10.currentTop = Math.min(Math.max(_this10.currentTop, -minTop), maxTop, _this10.initialTopOffset); 2505 _this10.lastKnownY = window.scrollY; 2506 }); 2507 2508 fastdom.mutate(function () { 2509 _this10.element.style.top = _this10.currentTop + 'px'; 2510 }); 2511 } 2512 }]); 2513 2514 return OverflowScroller; 2515 }(); 2516 /* harmony export (immutable) */ 2517 2518 __webpack_exports__["default"] = OverflowScroller; 2519 2520 /***/ 2521 }, 2522 /* 14 */ 2523 /***/function (module, __webpack_exports__, __webpack_require__) { 2524 2525 "use strict"; 2526 2527 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 2528 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 2529 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Image__ = __webpack_require__(10); 2530 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__ = __webpack_require__(2); 2531 2532 var ProductImageZoom = function () { 2533 function ProductImageZoom(element, slideshow) { 2534 _classCallCheck(this, ProductImageZoom); 2535 2536 this.element = element; 2537 this.delegateElement = new domDelegate.Delegate(this.element); 2538 this.delegateRoot = new domDelegate.Delegate(document.body); 2539 2540 this.slideshow = slideshow; 2541 2542 this._attachListeners(); 2543 } 2544 2545 _createClass(ProductImageZoom, [{ 2546 key: 'destroy', 2547 value: function destroy() { 2548 this.delegateElement.off('click'); 2549 } 2550 }, { 2551 key: '_attachListeners', 2552 value: function _attachListeners() { 2553 this.delegateElement.on('click', '[data-action="open-product-zoom"]', this._initPhotoSwipe.bind(this)); 2554 this.delegateElement.on('click', '.Product__SlideItem--image', this._initPhotoSwipeFromImageClick.bind(this)); 2555 } 2556 2557 /** 2558 * To save performance, we only initialize PhotoSwipe when it's requested. All high resolution images 2559 * are also loaded only on demand. Also, please note that PhotoSwipe is always completely destroyed 2560 * whenever it is closed, so it stays super snappy 2561 */ 2562 2563 }, { 2564 key: '_initPhotoSwipe', 2565 value: function _initPhotoSwipe() { 2566 var images = []; 2567
2568 this.slideshow.flickityInstance.cells.forEach(function (item) { 2569 if (item.element.classList.contains('Product__SlideItem--image')) { 2570 images.push(item.element.querySelector('img')); 2571 } 2572 }); 2573 2574 this._createPhotoSwipeInstance(this._createPhotoSwipeItemsFromImages(images), parseInt(this.slideshow.flickityInstance.selectedElement.getAttribute('data-image-position-ignoring-video'))); 2575 } 2576 2577 /** 2578 * On desktop we do not have the dedicated small icon, instead the zoom is triggered when clicking directly on the image 2579 */ 2580 2581 }, { 2582 key: '_initPhotoSwipeFromImageClick', 2583 value: function _initPhotoSwipeFromImageClick(event, target) { 2584 // Opening this way is only available on desktop 2585 if (__WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].matchesBreakpoint('pocket')) { 2586 return; 2587 } 2588 2589 var images = []; 2590 2591 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].getSiblings(target, null, true).forEach(function (item) { 2592 if (item.classList.contains('Product__SlideItem--image')) { 2593 images.push(item.querySelector('img')); 2594 } 2595 }); 2596 2597 this._createPhotoSwipeInstance(this._createPhotoSwipeItemsFromImages(images), parseInt(target.getAttribute('data-image-position-ignoring-video'))); 2598 } 2599 2600 /** 2601 * Take a list of images and create a PhotoSwipe array. This is called whenever the gallery is initialized. 2602 */ 2603 2604 }, { 2605 key: '_createPhotoSwipeItemsFromImages', 2606 value: function _createPhotoSwipeItemsFromImages(images) { 2607 return images.map(function (image) { 2608 var maxWidth = parseInt(image.getAttribute('data-max-width')), 2609 maxHeight = parseInt(image.getAttribute('data-max-height')), 2610 maxDimension = __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].matchesBreakpoint('phone') ? 1200 : 1800, 2611 // 1200 is max size for mobile and 1800 for larger devices 2612 reduceFactor = 1.0; 2613 2614 if (maxWidth >= maxHeight) { 2615 reduceFactor = Math.max(maxWidth / maxDimension, 1.0); 2616 } else { 2617 reduceFactor = Math.max(maxHeight / maxDimension, 1.0); 2618 } 2619 2620 var requestedWidth = Math.floor(maxWidth / reduceFactor); 2621 var requestedHeight = Math.floor(maxHeight / reduceFactor); 2622 2623 return { 2624 msrc: image.currentSrc || image.src, // For browser that supports srcset, currentSrc is the currently used image 2625 w: requestedWidth, 2626 h: requestedHeight, 2627 initialZoomLevel: 0.65, 2628 src: __WEBPACK_IMPORTED_MODULE_1__helper_Image__["default"].getSizedImageUrl(image.getAttribute('data-original-src'), requestedWidth + 'x' + requestedHeight) 2629 }; 2630 }); 2631 } 2632 2633 /** 2634 * Take a list of nodes containing all images and create a PhotoSwipe array. This is called 2635 * whenever the gallery is initialized. 2636 */ 2637 2638 }, { 2639 key: '_createPhotoSwipeInstance', 2640 value: function _createPhotoSwipeInstance(items, selectedImageIndex) { 2641 var _this11 = this; 2642 2643 var photoswipeContainer = document.querySelector('.pswp'); 2644 2645 this.photoSwipeInstance = new PhotoSwipe(photoswipeContainer, false, items, { 2646 index: selectedImageIndex, 2647 showHideOpacity: true, 2648 showAnimationDuration: 500, 2649 loop: false, 2650 history: false, 2651 closeOnVerticalDrag: false, 2652 allowPanToNext: false, 2653 pinchToClose: false, 2654 errorMsg: '<p class="pswp__error-msg">' + window.languages.productImageLoadingError + '</p>', 2655 scaleMode: 'zoom', 2656 getDoubleTapZoom: function getDoubleTapZoom(isMouseClick, item) { 2657 if (isMouseClick) { 2658 return 1.6; 2659 } else { 2660 return item.initialZoomLevel < 0.7 ? 1 : 1.33; 2661 } 2662 }, 2663 getThumbBoundsFn: function getThumbBoundsFn(index) { 2664 var thumbnail = _this11.element.querySelector('.Product__Slideshow .Carousel__Cell:nth-child(' + (parseInt(index) + 1) + ') img'), 2665 pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 2666 rect = thumbnail.getBoundingClientRect(); 2667 2668 return { x: rect.left, y: rect.top + pageYScroll, w: rect.width }; 2669 } 2670 }); 2671 2672 this.photoSwipeInstance.listen('beforeChange', this._onSlideChanged.bind(this)); 2673 this.photoSwipeInstance.listen('destroy', this._destroyPhotoSwipe.bind(this)); 2674 this.photoSwipeInstance.listen('doubleTap', this._onDoubleTap.bind(this)); 2675 this.photoSwipeInstance.listen('initialZoomIn', this._onInitialZoomIn.bind(this)); 2676 this.photoSwipeInstance.listen('initialZoomOut', this._onInitialZoomOut.bind(this)); 2677 2678 this.delegateRoot.on('pswpTap', '.pswp__scroll-wrap', this._onSingleTap.bind(this)); 2679 this.delegateRoot.on('pswpTap', '.pswp__button--close', this.photoSwipeInstance.close); 2680 this.delegateRoot.on('pswpTap', '.pswp__button--prev', this.photoSwipeInstance.prev); 2681 this.delegateRoot.on('pswpTap', '.pswp__button--next', this.photoSwipeInstance.next); 2682 2683 this.photoSwipeInstance.init(); 2684 } 2685 2686 /** 2687 * Update the nav 2688 */ 2689 2690 }, { 2691 key: '_onSlideChanged', 2692 value: function _onSlideChanged() { 2693 if (this.photoSwipeInstance.getCurrentIndex() === 0) { 2694 this.photoSwipeInstance.scrollWrap.querySelector('.pswp__button--prev').setAttribute('disabled', 'disabled'); 2695 } else { 2696 this.photoSwipeInstance.scrollWrap.querySelector('.pswp__button--prev').removeAttribute('disabled'); 2697 } 2698 2699 if (this.photoSwipeInstance.getCurrentIndex() + 1 === this.photoSwipeInstance.options.getNumItemsFn()) { 2700 this.photoSwipeInstance.scrollWrap.querySelector('.pswp__button--next').setAttribute('disabled', 'disabled'); 2701 } else { 2702 this.photoSwipeInstance.scrollWrap.querySelector('.pswp__button--next').removeAttribute('disabled'); 2703 } 2704 } 2705 2706 /** 2707 * This event is a bit different and is triggered when the user click somewhere. We use it do allow to zoom in and
2708 * zoom out in the image on desktop and use for the UI 2709 */ 2710 2711 }, { 2712 key: '_onSingleTap', 2713 value: function _onSingleTap(event) { 2714 if (!event.detail || event.detail.pointerType === 'mouse') { 2715 if (event.target.classList.contains('pswp__img')) { 2716 this.photoSwipeInstance.toggleDesktopZoom(event.detail.releasePoint); 2717 } 2718 } else { 2719 if (event.target.classList.contains('pswp__button')) { 2720 return; 2721 } 2722 2723 event.target.closest('.pswp').querySelector('.pswp__ui').classList.toggle('pswp__ui--hidden'); 2724 } 2725 } 2726 }, { 2727 key: '_onDoubleTap', 2728 value: function _onDoubleTap(point) { 2729 var initialZoomLevel = this.photoSwipeInstance.currItem.initialZoomLevel; 2730 2731 if (this.photoSwipeInstance.getZoomLevel() !== initialZoomLevel) { 2732 this.photoSwipeInstance.zoomTo(initialZoomLevel, point, 333); 2733 } else { 2734 this.photoSwipeInstance.zoomTo(initialZoomLevel < 0.7 ? 1 : 1.33, point, 333); 2735 } 2736 } 2737 }, { 2738 key: '_onInitialZoomIn', 2739 value: function _onInitialZoomIn() { 2740 document.querySelector('.pswp__ui').classList.remove('pswp__ui--hidden'); 2741 } 2742 }, { 2743 key: '_onInitialZoomOut', 2744 value: function _onInitialZoomOut() { 2745 document.querySelector('.pswp__ui').classList.add('pswp__ui--hidden'); 2746 } 2747 2748 /** 2749 * PhotoSwipe instance is automatically destroyed for us when it's closed. What we need to do is simply re-set 2750 * our in-memory instance to null and our own events 2751 */ 2752 2753 }, { 2754 key: '_destroyPhotoSwipe', 2755 value: function _destroyPhotoSwipe() { 2756 this.delegateRoot.off('pswpTap'); 2757 this.photoSwipeInstance = null; 2758 } 2759 }]); 2760 2761 return ProductImageZoom; 2762 }(); 2763 /* harmony export (immutable) */ 2764 2765 __webpack_exports__["default"] = ProductImageZoom; 2766 2767 /***/ 2768 }, 2769 /* 15 */ 2770 /***/function (module, __webpack_exports__, __webpack_require__) { 2771 2772 "use strict"; 2773 2774 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 2775 2776 var ProductReviews = function () { 2777 function ProductReviews(container) { 2778 _classCallCheck(this, ProductReviews); 2779 2780 this.element = container; 2781 this.delegateElement = new domDelegate.Delegate(this.element); 2782 2783 this.delegateElement.on('click', '.spr-summary-actions-newreview', this._onNewReviewClicked.bind(this)); 2784 2785 // Extending Shopify Reviews is a bit manual, but let's do it! 2786 2787 window.SPRCallbacks = {}; 2788 window.SPRCallbacks.onFormSuccess = this._onFormSuccess.bind(this); 2789 window.SPRCallbacks.onReviewsLoad = this._onReviewsLoad.bind(this); 2790 } 2791 2792 _createClass(ProductReviews, [{ 2793 key: 'destroy', 2794 value: function destroy() { 2795 this.delegateElement.off(); 2796 } 2797 }, { 2798 key: '_updatePagination', 2799 value: function _updatePagination(event, target) { 2800 // Unfortunately, we have to use this ugly jQuery style stuff 2801 SPR.$(target).data('page', parseInt(target.getAttribute('data-page')) + 1); 2802 } 2803 }, { 2804 key: '_onFormSuccess', 2805 value: function _onFormSuccess() { 2806 var formSuccess = this.element.querySelector('.spr-form-message-success'); 2807 window.scrollTo(0, formSuccess.offsetTop - 45); 2808 } 2809 }, { 2810 key: '_onReviewsLoad', 2811 value: function _onReviewsLoad() { 2812 // We want to move "spr-pagination-next" before the "new review" button in the "spr-summary-actions" div 2813 2814 var sprSummaryActions = this.element.querySelector('.spr-summary-actions'), 2815 previousSprPaginationNext = sprSummaryActions.querySelector('.spr-pagination-next'), 2816 sprPaginationNext = this.element.querySelector('.spr-pagination .spr-pagination-next'); 2817 2818 if (previousSprPaginationNext) { 2819 previousSprPaginationNext.remove(); 2820 } 2821 2822 if (sprPaginationNext) { 2823 sprSummaryActions.insertBefore(sprPaginationNext, sprSummaryActions.firstChild); 2824 } 2825 } 2826 }, { 2827 key: '_onNewReviewClicked', 2828 value: function _onNewReviewClicked(event, target) { 2829 target.style.display = 'none'; 2830 2831 if (target.previousElementSibling) { 2832 target.previousElementSibling.style.display = 'none'; 2833 } 2834 } 2835 }]); 2836 2837 return ProductReviews; 2838 }(); 2839 /* harmony export (immutable) */ 2840 2841 __webpack_exports__["default"] = ProductReviews; 2842 2843 /***/ 2844 }, 2845 /* 16 */ 2846 /***/function (module, __webpack_exports__, __webpack_require__) { 2847 2848 "use strict"; 2849 2850 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 2851 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Acce
2851ssibility__ = __webpack_require__(3); 2852 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__Carousel__ = __webpack_require__(1); 2853 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Dom__ = __webpack_require__(0); 2854 /** 2855 * Variant selector is a bit similar to the popover, but due to some differences, I've created a distinct class 2856 */ 2857 2858 var VariantSelector = function () { 2859 function VariantSelector(element) { 2860 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 2861 2862 _classCallCheck(this, VariantSelector); 2863 2864 this.element = element; 2865 this.delegateElement = new domDelegate.Delegate(this.element); 2866 2867 this.activator = options['activator'] || document.querySelector('[aria-controls="' + element.getAttribute('id') + '"]'); 2868 this.onValueChangedCallback = options['onValueChanged'] || function () { }; 2869 this.isOpen = false; 2870 2871 this.pageOverlayElement = document.querySelector('.PageOverlay'); 2872 2873 this.variantChoiceList = __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.VariantSelector__Choice')); 2874 this.variantCarousel = new __WEBPACK_IMPORTED_MODULE_1__Carousel__["default"](this.element.querySelector('.VariantSelector__Carousel'), { 2875 onSelect: this._variantChanged.bind(this), 2876 onClick: this._variantSelected.bind(this) 2877 }); 2878 2879 this._attachListeners(); 2880 } 2881 2882 _createClass(VariantSelector, [{ 2883 key: 'destroy', 2884 value: function destroy() { 2885 this.element.removeEventListener('keyup', this._handleKeyboardListener); 2886 this.delegateElement.off('click'); 2887 this.activator.removeEventListener('click', this._toggleListener); 2888 this.variantCarousel.destroy(); 2889 } 2890 }, { 2891 key: 'toggle', 2892 value: function toggle() { 2893 this.isOpen ? this.close() : this.open(); 2894 } 2895 }, { 2896 key: 'open', 2897 value: function open() { 2898 if (this.isOpen) { 2899 return; 2900 } 2901 2902 this.element.setAttribute('aria-hidden', 'false'); 2903 this.activator.setAttribute('aria-expanded', 'true'); 2904 2905 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].trapFocus(this.element, 'variant-selector'); 2906 2907 document.documentElement.classList.add('no-scroll'); // Prevent scrolling when popover is open 2908 2909 this.element.setAttribute('style', ''); 2910 this.pageOverlayElement.classList.add('is-visible'); 2911 this.pageOverlayElement.addEventListener('click', this._closeListener); 2912 2913 this.isOpen = true; 2914 } 2915 }, { 2916 key: 'close', 2917 value: function close() { 2918 if (!this.isOpen) { 2919 return; 2920 } 2921 2922 this.element.setAttribute('aria-hidden', 'true'); 2923 this.activator.setAttribute('aria-expanded', 'false'); 2924 2925 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].removeTrapFocus(this.element, 'variant-selector'); 2926 2927 document.documentElement.classList.remove('no-scroll'); 2928 2929 this.pageOverlayElement.classList.remove('is-visible'); 2930 this.pageOverlayElement.removeEventListener('click', this._closeListener); 2931 2932 this.isOpen = false; 2933 } 2934 }, { 2935 key: '_attachListeners', 2936 value: function _attachListeners() { 2937 this._handleKeyboardListener = this._handleKeyboard.bind(this); 2938 this._closeListener = this.close.bind(this); 2939 this._toggleListener = this.toggle.bind(this); 2940 2941 this.element.addEventListener('keyup', this._handleKeyboardListener); 2942 this.activator.addEventListener('click', this._toggleListener); 2943 this.delegateElement.on('click', '[data-action="select-variant"]', this._onVariantSelect.bind(this)); 2944 } 2945 2946 /** 2947 * Called when the variant is changed (but not yet selected) 2948 */ 2949 2950 }, { 2951 key: '_variantChanged', 2952 value: function _variantChanged(selectedIndex) { 2953 var activeChoice = this.variantChoiceList[selectedIndex]; 2954 2955 activeChoice.classList.add('is-selected'); 2956 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].getSiblings(activeChoice, '.is-selected').forEach(function (item) { 2957 return item.classList.remove('is-selected'); 2958 }); 2959 } 2960 2961 /** 2962 * Called when a variant is clicked or selected 2963 */ 2964 2965 }, { 2966 key: '_variantSelected', 2967 value: function _variantSelected(cellElement, cellIndex) { 2968 if (this.variantCarousel.getSelectedIndex() === cellIndex) { 2969 this.onValueChangedCallback(cellElement.getAttribute('data-option-value'), cellElement, this.activator); 2970 this.close(); 2971 } else { 2972 this.variantCarousel.selectCell(cellIndex); 2973 } 2974 } 2975 2976 /** 2977 * Called when the button "choose this variant" is explicitly clicked 2978 */ 2979 2980 }, { 2981 key: '_onVariantSelect', 2982 value: function _onVariantSelect() { 2983 var selectedCell = this.variantCarousel.flickityInstance.selectedCell.element; 2984 2985 this.onValueChangedCallback(selectedCell.getAttribute('data-option-value'), selectedCell, this.activator); 2986 this.close(); 2987 } 2988 2989 /** 2990 * Handle a11y events 2991 */ 2992 2993 }, { 2994 key: '_handleKeyboard', 2995 value: function _handleKeyboard(event) { 2996 if (this.isOpen && event.keyCode === 27) { 2997 this.close(); 2998 } 2999 } 3000 }]); 3001 3002 return VariantSelector; 3003 }(); 3004 /* harmony export (immutable) */ 3005 3006 __webpack_exports__["default"] = VariantSelector; 3007 3008 /***/ 3009 }, 3010 /* 17 */ 3011 /***/function (module, __webpack_exports__, __webpack_require__) { 3012 3013 "use strict"; 3014 3015 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3016 /** 3017 * This code has been heavily inspired by this: https://kitaitimakoto.gitlab.io/scrollspy-example/index.en.html#whatsthis 3018 */ 3019 3020 var ScrollSpy = function () { 3021 function ScrollSpy(container, elementsToSpy, observerOptions) { 3022 var _this12 = this; 3023 3024 _classCallCheck(this, ScrollSpy); 3025 3026 this.container = container; 3027 this.targets = []; 3028 this.targetIndices = {}; 3029 this.indicesInViewPort = []; 3030 3031 this.observer = new IntersectionObserver(this._onIntersectionChange.bind(this), observerOptions); 3032 3033 elementsToSpy.forEach(function (elementToSpy, index) { 3034 _this12.targets.push(elementToSpy); 3035 _this12.targetIndices[elementToSpy.id] = index; 3036 _this12.observer.observe(elementToSpy); 3037 }); 3038 } 3039 3040 _createClass(ScrollSpy, [{ 3041 key: 'destroy', 3042 value: function destroy() { 3043 this.observer.disconnect(); 3044 } 3045 3046 /** 3047 * Called whenever there is a change of visibility 3048 */ 3049 3050 }, { 3051 key: '_onIntersectionChange',
3052 value: function _onIntersectionChange(changes) { 3053 var oldTargetIndex = this.indicesInViewPort[0] || 0; 3054 3055 for (var i = changes.length - 1; i >= 0; i--) { 3056 this._updateIndicesInViewPort(changes[i], oldTargetIndex); 3057 } 3058 3059 // Firefox generates duplicates so make sure to remove 3060 this.indicesInViewPort = this.indicesInViewPort.filter(function (value, index, self) { 3061 return self.indexOf(value) === index; 3062 }); 3063 3064 if (this.indicesInViewPort.length === 0 || oldTargetIndex === this.indicesInViewPort[0]) { 3065 return; 3066 } 3067 3068 var event = new CustomEvent('scrollspy:target:changed', { 3069 detail: { 3070 newTarget: this.targets[this.indicesInViewPort[0]], 3071 oldTarget: this.targets[oldTargetIndex] 3072 } 3073 }); 3074 3075 this.container.dispatchEvent(event); 3076 } 3077 3078 /** 3079 * Update indices visible in the view port 3080 */ 3081 3082 }, { 3083 key: '_updateIndicesInViewPort', 3084 value: function _updateIndicesInViewPort(change, oldTargetIndex) { 3085 var index = this.targetIndices[change.target.id]; 3086 3087 if (change.intersectionRatio === 0) { 3088 var indexInViewPort = this.indicesInViewPort.indexOf(index); 3089 3090 if (indexInViewPort !== -1) { 3091 this.indicesInViewPort.splice(indexInViewPort, 1); 3092 } 3093 } else { 3094 if (index < oldTargetIndex) { 3095 this.indicesInViewPort.unshift(index); 3096 } else if (index > this.indicesInViewPort[this.indicesInViewPort.length - 1]) { 3097 this.indicesInViewPort.push(index); 3098 } else { 3099 this.indicesInViewPort.push(index); 3100 this.indicesInViewPort.sort(); 3101 } 3102 } 3103 } 3104 }]); 3105 3106 return ScrollSpy; 3107 }(); 3108 /* harmony export (immutable) */ 3109 3110 __webpack_exports__["default"] = ScrollSpy; 3111 3112 /***/ 3113 }, 3114 /* 18 */ 3115 /***/function (module, __webpack_exports__, __webpack_require__) { 3116 3117 "use strict"; 3118 3119 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3120 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Animation__ = __webpack_require__(7); 3121 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Currency__ = __webpack_require__(5); 3122 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__CountrySelector__ = __webpack_require__(12); 3123 3124 var ShippingEstimator = function () { 3125 function ShippingEstimator(element) { 3126 _classCallCheck(this, ShippingEstimator); 3127 3128 this.element = element; 3129 this.delegateElement = new domDelegate.Delegate(this.element); 3130 this.countrySelector = new __WEBPACK_IMPORTED_MODULE_2__CountrySelector__["default"](this.element.querySelector('[name="country"]'), this.element.querySelector('[name="province"]')); 3131 3132 this._attachListeners(); 3133 } 3134 3135 _createClass(ShippingEstimator, [{ 3136 key: 'onUnload', 3137 value: function onUnload() { 3138 this.delegateElement.off('click'); 3139 this.countrySelector.destroy(); 3140 } 3141 }, { 3142 key: '_attachListeners', 3143 value: function _attachListeners() { 3144 this.delegateElement.on('click', '.ShippingEstimator__Submit', this._fetchRates.bind(this)); 3145 } 3146 }, { 3147 key: '_fetchRates', 3148 value: function _fetchRates() { 3149 var _this13 = this; 3150 3151 var country = this.element.querySelector('[name="country"]').value, 3152 province = this.element.querySelector('[name="province"]').value, 3153 zip = this.element.querySelector('[name="zip"]').value; 3154 3155 document.dispatchEvent(new CustomEvent('theme:loading:start')); 3156 3157 fetch('/cart/shipping_rates.json?shipping_address[zip]=' + zip + '&shipping_address[country]=' + country + '&shipping_address[province]=' + province, { 3158 credentials: 'same-origin', 3159 method: 'GET' 3160 }).then(function (response) { 3161 response.json().then(function (result) { 3162 document.dispatchEvent(new CustomEvent('theme:loading:end')); 3163 3164 var resultsContainer = _this13.element.querySelector('.ShippingEstimator__Results'), 3165 errorContainer = _this13.element.querySelector('.ShippingEstimator__Error'); 3166 3167 if (response.ok) { 3168 var shippingRates = result['shipping_rates']; 3169 3170 if (shippingRates.length === 0) { 3171 resultsContainer.innerHTML = '<p>' + window.languages.shippingEstimatorNoResults + '</p>'; 3172 } else { 3173 var html = ''; 3174 3175 if (shippingRates.length === 1) { 3176 html += '<p>' + window.languages.shippingEstimatorOneResult + '</p><ul>'; 3177 } else { 3178 html += '<p>' + window.languages.shippingEstimatorMoreResults.replace('{{count}}', shippingRates.length) + '</p><ul>'; 3179 } 3180
3181 shippingRates.forEach(function (item) { 3182 html += '<li>' + item['name'] + ': ' + __WEBPACK_IMPORTED_MODULE_1__helper_Currency__["default"].formatMoney(item['price'], window.theme.moneyFormat) + '</li>'; 3183 }); 3184 3185 html += '</ul>'; 3186 3187 resultsContainer.firstElementChild.innerHTML = html; 3188 } 3189 3190 TweenLite.fromTo(resultsContainer.firstElementChild, 0.6, { autoAlpha: 0, y: -15 }, { autoAlpha: 1, y: 0, delay: 0.35 }); 3191 3192 errorContainer.style.display = 'none'; 3193 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slideDown(resultsContainer); 3194 } else { 3195 var errorHtml = ''; 3196 3197 Object.keys(result).forEach(function (key) { 3198 errorHtml += '<li class="Alert__ErrorItem">' + key + ' ' + result[key] + '</li>'; 3199 }); 3200 3201 errorContainer.innerHTML = '<ul class="Alert__ErrorList">' + errorHtml + '</ul>'; 3202 3203 resultsContainer.style.display = 'none'; 3204 errorContainer.style.display = 'block'; 3205 } 3206 }); 3207 }); 3208 } 3209 }]); 3210 3211 return ShippingEstimator; 3212 }(); 3213 /* harmony export (immutable) */ 3214 3215 __webpack_exports__["default"] = ShippingEstimator; 3216 3217 /***/ 3218 }, 3219 /* 19 */ 3220 /***/function (module, __webpack_exports__, __webpack_require__) { 3221 3222 "use strict"; 3223 3224 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3225 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Animation__ = __webpack_require__(7); 3226 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 3227 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__ = __webpack_require__(2); 3228 /** 3229 * Handle the collapsibles. This plugin is global, so it listens to any click on [data-action="toggle-collapsible"] element 3230 */ 3231 3232 var Collapsible = function () { 3233 function Collapsible() { 3234 _classCallCheck(this, Collapsible); 3235 3236 this.domDelegate = new domDelegate.Delegate(document.body); 3237 this._attachListeners(); 3238 } 3239 3240 _createClass(Collapsible, [{ 3241 key: '_attachListeners', 3242 value: function _attachListeners() { 3243 this.domDelegate.on('click', '[data-action="toggle-collapsible"]', this._toggleCollapsible.bind(this)); 3244 } 3245 3246 /** 3247 * Toggle a given collapsible 3248 */ 3249 3250 }, { 3251 key: '_toggleCollapsible', 3252 value: function _toggleCollapsible(event, target) { 3253 var _this14 = this; 3254 3255 // If this is an auto-expand and that it reaches the needed breakpoint, we do nothing 3256 var parentCollapsible = target.closest('.Collapsible'); 3257 3258 if (parentCollapsible.classList.contains('Collapsible--autoExpand') && __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].matchesBreakpoint('tablet-and-up')) { 3259 return; 3260 } 3261 3262 var isOpen = target.getAttribute('aria-expanded') === 'true'; 3263 3264 if (isOpen) { 3265 this._close(parentCollapsible, target); 3266 } else { 3267 this._open(parentCollapsible, target); 3268 } 3269 3270 // We make sure to close any siblings collapsible as well 3271 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].getSiblings(parentCollapsible).forEach(function (collapsibleToClose) { 3272 return _this14._close(collapsibleToClose); 3273 }); 3274 event.preventDefault(); 3275 } 3276 3277 /** 3278 * Open a given collapsible 3279 */ 3280 3281 }, { 3282 key: '_open', 3283 value: function _open(collapsible) { 3284 var toggleButton = collapsible.querySelector('.Collapsible__Button'), 3285 collapsibleInner = collapsible.querySelector('.Collapsible__Inner'); 3286 3287 if (!collapsibleInner || toggleButton.getAttribute('aria-expanded') === 'true') { 3288 return; // It's already open 3289 } 3290 3291 toggleButton.setAttribute('aria-expanded', 'true'); 3292 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slideDown(collapsibleInner); 3293 } 3294 3295 /** 3296 * Close a given collapsible 3297 */ 3298 3299 }, { 3300 key: '_close', 3301 value: function _close(collapsible) { 3302 var toggleButton = collapsible.querySelector('.Collapsible__Button'),
3303 collapsibleInner = collapsible.querySelector('.Collapsible__Inner'); 3304 3305 if (!collapsibleInner || toggleButton.getAttribute('aria-expanded') === 'false') { 3306 return; // It's already closed 3307 } 3308 3309 toggleButton.setAttribute('aria-expanded', 'false'); 3310 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slideUp(collapsibleInner); 3311 } 3312 }]); 3313 3314 return Collapsible; 3315 }(); 3316 /* harmony export (immutable) */ 3317 3318 __webpack_exports__["default"] = Collapsible; 3319 3320 /***/ 3321 }, 3322 /* 20 */ 3323 /***/function (module, __webpack_exports__, __webpack_require__) { 3324 3325 "use strict"; 3326 3327 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3328 /** 3329 * Simple plugin that handles the loading bar actions 3330 * 3331 * This plugin uses delegate events so it's independent of the sections. 3332 */ 3333 3334 var LoadingBar = function () { 3335 function LoadingBar() { 3336 _classCallCheck(this, LoadingBar); 3337 3338 this.element = document.querySelector('.LoadingBar'); 3339 3340 document.addEventListener('theme:loading:start', this._onLoadingStart.bind(this)); 3341 document.addEventListener('theme:loading:end', this._onLoadingEnd.bind(this)); 3342 3343 this.element.addEventListener('transitionend', this._onTransitionEnd.bind(this)); 3344 } 3345 3346 _createClass(LoadingBar, [{ 3347 key: '_onLoadingStart', 3348 value: function _onLoadingStart() { 3349 this.element.classList.add('is-visible'); 3350 this.element.style.width = '40%'; 3351 } 3352 }, { 3353 key: '_onLoadingEnd', 3354 value: function _onLoadingEnd() { 3355 this.element.style.width = '100%'; 3356 this.element.classList.add('is-finished'); 3357 } 3358 }, { 3359 key: '_onTransitionEnd', 3360 value: function _onTransitionEnd(event) { 3361 if (event.propertyName === 'width' && this.element.classList.contains('is-finished')) { 3362 this.element.classList.remove('is-visible'); 3363 this.element.classList.remove('is-finished'); 3364 this.element.style.width = '0'; 3365 } 3366 } 3367 }]); 3368 3369 return LoadingBar; 3370 }(); 3371 /* harmony export (immutable) */ 3372 3373 __webpack_exports__["default"] = LoadingBar; 3374 3375 /***/ 3376 }, 3377 /* 21 */ 3378 /***/function (module, __webpack_exports__, __webpack_require__) { 3379 3380 "use strict"; 3381 3382 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3383 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__ = __webpack_require__(3); 3384 /** 3385 * Handle the modals. This plugin is global, so it basically listens to any click on [data-action="open-modal"] and 3386 * [data-action="close-modal"] events 3387 */ 3388 3389 var Modal = function () { 3390 function Modal() { 3391 _classCallCheck(this, Modal); 3392 3393 this.domDelegate = new domDelegate.Delegate(document.body); 3394 this.activeModal = null; // Keep track of the active modal 3395 this.wasLocked = false; 3396 3397 this.pageOverlayElement = document.querySelector('.PageOverlay'); 3398 3399 this._attachListeners(); 3400 this._checkOpenByHash(); 3401 } 3402 3403 _createClass(Modal, [{ 3404 key: '_attachListeners', 3405 value: function _attachListeners() { 3406 this._closeListener = this._closeModal.bind(this); 3407 this._handleKeyboardListener = this._handleKeyboard.bind(this); 3408 3409 this.domDelegate.on('click', '[data-action="open-modal"]', this._openModalEvent.bind(this)); 3410 this.domDelegate.on('click', '[data-action="close-modal"]', this._closeModal.bind(this)); 3411 } 3412 }, { 3413 key: '_openModalEvent', 3414 value: function _openModalEvent(event, target) { 3415 this._openModal(document.getElementById(target.getAttribute('aria-controls'))); 3416 event.preventDefault(); 3417 event.stopPropagation(); 3418 } 3419 }, {
3420 key: '_openModal', 3421 value: function _openModal(modal) { 3422 var _this15 = this; 3423 3424 if (this.activeModal || !modal) { 3425 return; // If there is already an open modal, we return as we only allows one modal at a time 3426 } 3427 3428 this.activeModal = modal; 3429 this.domDelegate.on('keyup', this._handleKeyboardListener); 3430 3431 if (document.documentElement.classList.contains('no-scroll')) { 3432 this.wasLocked = true; 3433 } 3434 3435 fastdom.mutate(function () { 3436 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].clearTrapFocus(); // Needed as the modal can be open on top of a popover 3437 3438 _this15._onTransitionEndedListener = _this15._onTransitionEnded.bind(_this15); 3439 _this15.activeModal.addEventListener('transitionend', _this15._onTransitionEndedListener); 3440 3441 _this15.activeModal.setAttribute('aria-hidden', 'false'); 3442 document.documentElement.classList.add('no-scroll'); 3443 3444 // If the modal is not a fullscreen modal, then we also display the overlay 3445 if (!_this15.activeModal.classList.contains('Modal--fullScreen')) { 3446 _this15.pageOverlayElement.classList.add('is-visible'); 3447 _this15.pageOverlayElement.addEventListener('click', _this15._closeListener); 3448 } 3449 }); 3450 } 3451 }, { 3452 key: '_closeModal', 3453 value: function _closeModal() { 3454 var _this16 = this; 3455 3456 if (!this.activeModal) { 3457 return; // If no modal are open, we return immediately 3458 } 3459 3460 this.activeModal.removeEventListener('keyup', this._handleKeyboardListener); 3461 this.domDelegate.off('keyup'); 3462 3463 fastdom.mutate(function () { 3464 // If the modal is of video type, we need to remove the iframe to stop the video 3465 if (_this16.activeModal.classList.contains('Modal--videoContent')) { 3466 _this16._resetVideoListener = _this16._resetVideo.bind(_this16); 3467 _this16.activeModal.addEventListener('transitionend', _this16._resetVideoListener); 3468 } 3469 3470 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].removeTrapFocus(_this16.activeModal, 'modal'); 3471 3472 if (!_this16.activeModal.classList.contains('Modal--fullScreen')) { 3473 _this16.pageOverlayElement.classList.remove('is-visible'); 3474 _this16.pageOverlayElement.removeEventListener('click', _this16._closeListener); 3475 } 3476 3477 _this16.activeModal.setAttribute('aria-hidden', 'true'); 3478 _this16.activeModal = null; 3479 3480 if (!_this16.wasLocked) { 3481 document.documentElement.classList.remove('no-scroll'); 3482 } 3483 }); 3484 } 3485 }, { 3486 key: '_onTransitionEnded', 3487 value: function _onTransitionEnded(event) { 3488 if (event.propertyName !== 'visibility') { 3489 return; 3490 } 3491 3492 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].trapFocus(this.activeModal, 'modal'); // Trap the focus first (as this trigger reflows) 3493 3494 this.activeModal.removeEventListener('transitionend', this._onTransitionEndedListener); 3495 } 3496 }, { 3497 key: '_resetVideo', 3498 value: function _resetVideo(event) { 3499 if (event.propertyName !== 'visibility') { 3500 return; // We check the visibility property as it's the one LazySizes uses for triggering lazyloading 3501 } 3502 3503 var iframe = event.target.querySelector('iframe'); 3504 iframe.parentNode.innerHTML = '<iframe class="Image--lazyLoad" data-src=' + iframe.getAttribute('data-src') + ' frameborder="0" allowfullscreen>'; 3505 3506 event.target.removeEventListener('transitionend', this._resetVideoListener); 3507 } 3508 3509 /** 3510 * Some forms needs to be open inside a modal, and on page reload we must make sure to properly open the modal again 3511 */ 3512 3513 }, { 3514 key: '_checkOpenByHash', 3515 value: function _checkOpenByHash() { 3516 var hash = window.location.hash, 3517 modal = document.getElementById(hash.replace('#', '')); 3518 3519 if (modal && modal.classList.contains('Modal')) { 3520 this._openModal(modal); 3521 } 3522 } 3523 3524 /** 3525 * Handle a11y events 3526 */ 3527 3528 }, { 3529 key: '_handleKeyboard', 3530 value: function _handleKeyboard(event) { 3531 if (null !== this.activeModal && event.keyCode === 27) { 3532 this._closeModal(); 3533 } 3534 } 3535 }]); 3536 3537 return Modal; 3538 }(); 3539 /* harmony export (immutable) */ 3540 3541 __webpack_exports__["default"] = Modal; 3542 3543 /***/ 3544 }, 3545 /* 22 */ 3546 /***/function (module, __webpack_exports__, __webpack_require__) { 3547 3548 "use strict"; 3549 3550 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3551 /** 3552 * This class will coordinate all the transitions from the website 3553 */ 3554 3555 var PageTransition = function () { 3556 _createClass(PageTransition, null, [{ 3557 key: 'getInstance', 3558 value: function getInstance() { 3559 if (!this.instance) { 3560 this.instance = new PageTransition(); 3561 } 3562 3563 return this.instance; 3564 } 3565 }]); 3566 3567 function PageTransition() { 3568 _classCallCheck(this, PageTransition); 3569 3570 this.domDelegate = new domDelegate.Delegate(document.body); 3571 this.isPageLoaded = window.theme.showPageTransition || document.readyState === 'complete' || document.readyState === 'loaded' || document.readyState === 'interactive'; 3572 this.pageTransition = document.querySelector('.PageTransition'); 3573 3574 if (!this.isPageLoaded) { 3575 document.addEventListener('DOMContentLoaded', this._onPageLoaded.bind(this)); 3576 } else { 3577 this._onPageLoaded(); 3578 } 3579 3580 this._attachListeners(); 3581 } 3582 3583 _createClass(PageTransition, [{ 3584 key: '_attachListeners', 3585 value: function _attachListeners() { 3586 this.domDelegate.on('click', 'a[href]:not([href^="#"]):not([href^="javascript:"]):not([href^="mailto:"]):not([href^="tel:"]):not([target="_blank"])', this._onPageUnload.bind(this)); 3587 } 3588 3589 /** 3590 * This callback is called only once, when the page is loaded 3591 */ 3592 3593 }, { 3594 key: '_onPageLoaded', 3595 value: function _onPageLoaded() { 3596 this.isPageLoaded = true; 3597 3598 // If the merchant has enabled full page transitions, we display it 3599 if (window.theme.showPageTransition && this.pageTransition) { 3600 new TimelineLite().fromTo(this.pageTransition, 0.25, { autoAlpha: 1, ease: Linear.easeNone }, { autoAlpha: 0, ease: Linear.easeNone }); 3601 } 3602 } 3603 3604 /** 3605 * This callback captures click and transition from one page to another by doing a transition 3606 */ 3607 3608 }, { 3609 key: '_onPageUnload', 3610 value: function _onPageUnload(event, target) { 3611 if (event.defaultPrevented || event.metaKey || !window.theme.showPageTransition || !this.pageTransition) { 3612 return; 3613 } 3614 3615 event.preventDefault(); // Prevent the click to happen 3616 3617 if (window.theme.showPageTransition && this.pageTransition) { 3618 var timeline = new TimelineLite({ 3619 onComplete: function onComplete() { 3620 window.location.href = target.href; 3621 } 3622 }); 3623 3624 timeline.fromTo(this.pageTransition, 0.25, { autoAlpha: 0, ease: Linear.easeNone }, { autoAlpha: 1, ease: Linear.easeNone }); 3625 } 3626 } 3627 }]); 3628 3629 return PageTransition; 3630 }(); 3631 /* harmony export (immutable) */ 3632 3633 __webpack_exports__["default"] = PageTransition; 3634 3635 /***/ 3636 }, 3637 /* 23 */ 3638 /***/function (module, __webpack_exports__, __webpack_require__) { 3639 3640 "use strict"; 3641 3642 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3643 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Acce
3643ssibility__ = __webpack_require__(3); 3644 3645 var Search = function () { 3646 function Search() { 3647 _classCallCheck(this, Search); 3648 3649 this.searchElement = document.getElementById('Search'); 3650 this.searchInputElement = this.searchElement.querySelector('[name="q"]'); 3651 this.searchResultsElement = this.searchElement.querySelector('.Search__Results'); 3652 this.queryMap = {}; 3653 3654 this.searchInputElement.addEventListener('keydown', this._preventSubmission.bind(this)); 3655 this.searchInputElement.addEventListener('keyup', this._debounce(this._onKeyPress.bind(this), 250)); 3656 } 3657 3658 /** 3659 * Open the search form and trap focus 3660 */ 3661 3662 3663 _createClass(Search, [{ 3664 key: '_openSearch', 3665 value: function _openSearch(event) { 3666 var _this17 = this; 3667 3668 this.searchElement.setAttribute('aria-hidden', 'false'); 3669 3670 document.documentElement.classList.add('no-scroll'); 3671 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].trapFocus(this.searchElement, 'search', this.searchElement.querySelector('[name="q"]')); 3672 3673 var onFocusListener = function onFocusListener() { 3674 _this17.searchInputElement.focus(); 3675 _this17.searchElement.removeEventListener('transitionend', onFocusListener); 3676 }; 3677 3678 this.searchElement.addEventListener('transitionend', onFocusListener); 3679 3680 event.preventDefault(); 3681 } 3682 3683 /** 3684 * Close the search form and clear focus 3685 */ 3686 3687 }, { 3688 key: '_closeSearch', 3689 value: function _closeSearch() { 3690 this.searchElement.setAttribute('aria-hidden', 'true'); 3691 3692 document.documentElement.classList.remove('no-scroll'); 3693 __WEBPACK_IMPORTED_MODULE_0__helper_Accessibility__["default"].removeTrapFocus(this.searchElement, 'search'); 3694 } 3695 3696 /** 3697 * In order to prevent an odd UX where hitting the enter always choose the product results, if the search is set to product + something else, 3698 * then we disable submission using enter key 3699 */ 3700 3701 }, { 3702 key: '_preventSubmission', 3703 value: function _preventSubmission(event) { 3704 if (event.keyCode === 13 && window.theme.searchMode !== 'product') { 3705 event.preventDefault(); 3706 } 3707 } 3708 3709 /** 3710 * This is called when the user has stopped typing (after debounce delay) 3711 */ 3712 3713 }, { 3714 key: '_onKeyPress', 3715 value: function _onKeyPress(event) { 3716 var _this18 = this; 3717 3718 if (event.keyCode === 13) { 3719 return; 3720 } 3721 3722 // Unfortunately, fetch does not support as of today cancelling a request. As a consequence what we do is that we manually 3723 // keep track of sent requests, and only use the results of the last one 3724 this.lastInputValue = event.target.value; 3725 3726 if (this.lastInputValue === '') { 3727 this._resetSearch(); 3728 return; 3729 } 3730 3731 var queryOptions = { method: 'GET', credentials: 'same-origin' }; 3732 3733 var queries = [fetch('/search?view=ajax&q=' + this.lastInputValue + '*&type=product', queryOptions)]; 3734 3735 if (window.theme.searchMode !== 'product') { 3736 queries.push(fetch('/search?view=ajax&q=' + this.lastInputValue + '*&type=' + window.theme.searchMode.replace('product,', ''), queryOptions)); 3737 } 3738 3739 this.queryMap[this.lastInputValue] = true; 3740 3741 document.dispatchEvent(new CustomEvent('theme:loading:start')); 3742 3743 Promise.all(queries).then(function (responses) { 3744 // If we receive the result for a query that is not the last one, we simply do not process the result 3745 if (_this18.lastInputValue !== event.target.value) { 3746 return; 3747 } 3748 3749 delete _this18.queryMap[event.target.value]; 3750 3751 Promise.all(responses.map(function (response) { 3752 return response.text(); 3753 })).then(function (contents) { 3754 // If we have only one content then we only have product, otherwise we have products and articles 3755 if (window.theme.searchMode === 'product') { 3756 _this18.searchResultsElement.innerHTML = contents[0]; 3757 } else { 3758 _this18.searchResultsElement.innerHTML = '<div class="PageLayout PageLayout--breakLap">\n <div class="PageLayout__Section">' + contents[0] + '</div>\n <div class="PageLayout__Section PageLayout__Section--secondary">' + contents[1] + '</div>\n </div>'; 3759 } 3760 }); 3761 3762 document.dispatchEvent(new CustomEvent('theme:loading:end')); 3763 }); 3764 } 3765 }, { 3766 key: '_resetSearch', 3767 value: function _resetSearch() { 3768 if (window.theme.searchMode === 'product') { 3769 this.searchResultsElement.innerHTML = ''; 3770 } else { 3771 this.searchResultsElement.innerHTML = '<div class="PageLayout PageLayout--breakLap">\n <div class="PageLayout__Section"></div>\n <div class="PageLayout__Section PageLayout__Section--secondary"></div>\n </div>'; 3772 } 3773 3774 document.dispatchEvent(new CustomEvent('theme:loading:end')); // Just in case 3775 } 3776 3777 /** 3778 * Simple function that allows to debounce 3779 */ 3780 3781 }, { 3782 key: '_debounce', 3783 value: function _debounce(fn, delay) { 3784 var _this19 = this; 3785 3786 var timer = null; 3787 3788 return function () { 3789 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 3790 args[_key] = arguments[_key]; 3791 } 3792 3793 clearTimeout(timer); 3794 3795 timer = setTimeout(function () { 3796 fn.apply(_this19, args); 3797 }, delay); 3798 }; 3799 } 3800 }]); 3801 3802 return Search; 3803 }(); 3804 /* harmony export (immutable) */ 3805 3806 __webpack_exports__["default"] = Search; 3807 3808 /***/ 3809 }, 3810 /* 24 */ 3811 /***/function (module, __webpack_exports__, __webpack_require__) { 3812 3813 "use strict"; 3814 3815 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3816 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__Carousel__ = __webpack_require__(1); 3817 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Carousel", function () { 3818 return __WEBPACK_IMPORTED_MODULE_0__Carousel__["default"]; 3819 }); 3820 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__Collapsible__ = __webpack_require__(19); 3821 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Collapsible", function () { 3822 return __WEBPACK_IMPORTED_MODULE_1__Collapsible__["default"]; 3823 }); 3824 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__Drawer__ = __webpack_require__(8); 3825 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Drawer", function () { 3826 return __WEBPACK_IMPORTED_MODULE_2__Drawer__["default"]; 3827 }); 3828 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__LoadingBar__ = __webpack_require__(20); 3829 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "LoadingBar", function () { 3830 return __WEBPACK_IMPORTED_MODULE_3__LoadingBar__["default"]; 3831 }); 3832 /* harmony import */var __WEBPACK_IMPORTED_MODULE_4__Modal__ = __webpack_require__(21); 3833 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Modal", function () { 3834 return __WEBPACK_IMPORTED_MODULE_4__Modal__["default"]; 3835 }); 3836 /* harmony import */var __WEBPACK_IMPORTED_MODULE_5__Popover__ = __webpack_require__(9); 3837 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Popover", function () { 3838 return __WEBPACK_IMPORTED_MODULE_5__Popover__["default"]; 3839 }); 3840 /* harmony import */var __WEBPACK_IMPORTED_MODULE_6__PageTransition__ = __webpack_require__(22); 3841 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "PageTransition", function () { 3842 return __WEBPACK_IMPORTED_MODULE_6__PageTransition__["default"]; 3843 }); 3844 /* harmony import */var __WEBPACK_IMPORTED_MODULE_7__ProductItemColorSwatch__ = __webpack_require__(4); 3845 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ProductItemColorSwatch", function () { 3846 return __WEBPACK_IMPORTED_MODULE_7__ProductItemColorSwatch__["default"]; 3847 }); 3848 /* harmony import */var __WEBPACK_IMPORTED_MODULE_8__ProductImageZoom__ = __webpack_require__(14); 3849 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ProductImageZoom", function () { 3850 return __WEBPACK_IMPORTED_MODULE_8__ProductImageZoom__["default"]; 3851 }); 3852 /* harmony import */var __WEBPACK_IMPORTED_MODULE_9__ProductReviews__ = __webpack_require__(15); 3853 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ProductReviews", function () { 3854 return __WEBPACK_IMPORTED_MODULE_9__ProductReviews__["default"]; 3855 }); 3856 /* harmony import */var __WEBPACK_IMPORTED_MODULE_10__ProductVariants__ = __webpack_require__(11); 3857 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ProductVariants", function () { 3858 return __WEBPACK_IMPORTED_MODULE_10__ProductVariants__["default"]; 3859 }); 3860 /* harmony import */var __WEBPACK_IMPORTED_MODULE_11__ScrollSpy__ = __webpack_require__(17); 3861 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ScrollSpy", function () { 3862 return __WEBPACK_IMPORTED_MODULE_11__ScrollSpy__["default"]; 3863 }); 3864 /* harmony import */var __WEBPACK_IMPORTED_MODULE_12__Search__ = __webpack_require__(23); 3865 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "Search", function () { 3866 return __WEBPACK_IMPORTED_MODULE_12__Search__["default"]; 3867 }); 3868 /* harmony import */var __WEBPACK_IMPORTED_MODULE_13__ShippingEstimator__ = __webpack_require__(18); 3869 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ShippingEstimator", function () { 3870 return __WEBPACK_IMPORTED_MODULE_13__ShippingEstimator__["default"]; 3871 }); 3872 /* harmony import */var __WEBPACK_IMPORTED_MODULE_14__VariantSelector__ = __webpack_require__(16); 3873 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "VariantSelector", function () { 3874 return __WEBPACK_IMPORTED_MODULE_14__VariantSelector__["default"]; 3875 }); 3876 3877 /***/ 3878 }, 3879 /* 25 */ 3880 /***/function (module, __webpack_exports__, __webpack_require__) { 3881 3882 "use strict"; 3883 3884 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3885 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper__ = __webpack_require__(6); 3886 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_CountrySelector__ = __webpack_require__(12); 3887 3888 var AddressesSection = function AddressesSection() { 3889 var _this20 = this; 3890 3891 _classCallCheck(this, AddressesSection); 3892 3893 this.countrySelectors = []; 3894 3895 __WEBPACK_IMPORTED_MODULE_0__helper__["DomHelper"].nodeListToArray(document.querySelectorAll('.Modal--address')).forEac
3895h(function (modal) { 3896 _this20.countrySelectors.push(new __WEBPACK_IMPORTED_MODULE_1__components_CountrySelector__["default"](modal.querySelector('[name="address[country]"]'), modal.querySelector('[name="address[province]"]'))); 3897 }); 3898 }; 3899 /* harmony export (immutable) */ 3900 3901 __webpack_exports__["default"] = AddressesSection; 3902 3903 /***/ 3904 }, 3905 /* 26 */ 3906 /***/function (module, __webpack_exports__, __webpack_require__) { 3907 3908 "use strict"; 3909 3910 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3911 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 3912 3913 var ArticleList = function () { 3914 function ArticleList(container) { 3915 var _this21 = this; 3916 3917 _classCallCheck(this, ArticleList); 3918 3919 this.element = container; 3920 3921 if (window.theme.showElementStaggering) { 3922 this.timeline = new TimelineLite({ delay: window.theme.showPageTransition ? 0.5 : 0 }); 3923 3924 this.intersectionObserver = new IntersectionObserver(this._reveal.bind(this)); 3925 3926 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.ArticleItem')).forEac
3926h(function (item) { 3927 _this21.intersectionObserver.observe(item); 3928 }); 3929 } 3930 } 3931 3932 _createClass(ArticleList, [{ 3933 key: 'onUnload', 3934 value: function onUnload() { 3935 if (window.theme.showElementStaggering) { 3936 this.intersectionObserver.disconnect(); 3937 this.timeline.kill(); 3938 } 3939 } 3940 }, { 3941 key: '_reveal', 3942 value: function _reveal(results) { 3943 var _this22 = this; 3944 3945 var toReveal = []; 3946 3947 results.forEach(function (result) { 3948 if (result.isIntersecting || result.intersectionRatio > 0) { 3949 // isIntersecting does not exist on Samsung Android browser 3950 toReveal.push(result.target); 3951 _this22.intersectionObserver.unobserve(result.target); 3952 } 3953 }); 3954 3955 if (toReveal.length === 0) { 3956 return; 3957 } 3958 3959 this.timeline.staggerFromTo(toReveal, 0.45, { autoAlpha: 0, y: 30 }, { autoAlpha: 1, y: 0 }, 0.2); 3960 } 3961 }]); 3962 3963 return ArticleList; 3964 }(); 3965 /* harmony export (immutable) */ 3966 3967 __webpack_exports__["default"] = ArticleList; 3968 3969 /***/ 3970 }, 3971 /* 27 */ 3972 /***/function (module, __webpack_exports__, __webpack_require__) { 3973 3974 "use strict"; 3975 3976 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 3977 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 3978 3979 var ArticleSection = function () { 3980 function ArticleSection(container) { 3981 var _this23 = this; 3982 3983 _classCallCheck(this, ArticleSection); 3984 3985 this.element = container; 3986 this.toolbarElement = this.element.querySelector('.ArticleToolbar'); 3987 this.articleNavElement = this.element.querySelector('.ArticleNav'); 3988 3989 var articleImageElement = this.element.querySelector('.Article__Image'); 3990 3991 if (articleImageElement && window.matchMedia('(-moz-touch-enabled: 0), (hover: hover)').matches) { 3992 this.parallaxInstance = new Rellax('.Article__Image', { 3993 speed: -7, 3994 center: false, 3995 round: true 3996 }); 3997 } 3998 3999 if (window.theme.showElementStaggering) { 4000 this.timeline = new TimelineLite({ delay: window.theme.showPageTransition ? 0.5 : 0 }); 4001 this.intersectionObserver = new IntersectionObserver(this._reveal.bind(this)); 4002 4003 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.ArticleItem')).forEac
4003h(function (item) { 4004 _this23.intersectionObserver.observe(item); 4005 }); 4006 } 4007 4008 this._attachListeners(); 4009 } 4010 4011 _createClass(ArticleSection, [{ 4012 key: 'onUnload', 4013 value: function onUnload() { 4014 if (this.parallaxInstance) { 4015 this.parallaxInstance.destroy(); 4016 } 4017 4018 if (window.theme.showElementStaggering) { 4019 this.intersectionObserver.disconnect(); 4020 this.timeline.kill(); 4021 } 4022 4023 window.removeEventListener('scroll', this._onScrollListener); 4024 } 4025 }, { 4026 key: '_attachListeners', 4027 value: function _attachListeners() { 4028 this._onScrollListener = this._checkToolbarVisibility.bind(this); 4029 window.addEventListener('scroll', this._onScrollListener); 4030 } 4031 }, { 4032 key: '_checkToolbarVisibility', 4033 value: function _checkToolbarVisibility() { 4034 var _this24 = this; 4035 4036 var lastYPosition = 0, 4037 headerHeight = 0, 4038 navBottom = 0, 4039 isFixedHeader = 0, 4040 header = document.querySelector('.Header'); 4041 4042 fastdom.measure(function () { 4043 lastYPosition = window.pageYOffset; 4044 headerHeight = header.offsetHeight; 4045 isFixedHeader = parseInt(window.getComputedStyle(document.body).getPropertyValue('--use-sticky-header') || 0); 4046 4047 if (_this24.articleNavElement) { 4048 navBottom = _this24.articleNavElement.offsetTop + _this24.articleNavElement.clientHeight - headerHeight; 4049 } 4050 }); 4051 4052 fastdom.mutate(function () { 4053 _this24.toolbarElement.style.top = isFixedHeader ? headerHeight + 'px' : null; 4054 4055 if (_this24.articleNavElement) { 4056 if (lastYPosition > 150 && _this24.articleNavElement && lastYPosition < navBottom) { 4057 _this24.toolbarElement.classList.add('is-visible'); 4058 } else { 4059 _this24.toolbarElement.classList.remove('is-visible'); 4060 } 4061 } else { 4062 if (lastYPosition > 150) { 4063 _this24.toolbarElement.classList.add('is-visible'); 4064 } else { 4065 _this24.toolbarElement.classList.remove('is-visible'); 4066 } 4067 } 4068 }); 4069 } 4070 }, { 4071 key: '_reveal', 4072 value: function _reveal(results) { 4073 var _this25 = this; 4074 4075 var toReveal = []; 4076 4077 results.forEach(function (result) { 4078 if (result.isIntersecting || result.intersectionRatio > 0) { 4079 // isIntersecting does not exist on Samsung Android browser 4080 toReveal.push(result.target); 4081 _this25.intersectionObserver.unobserve(result.target); 4082 } 4083 }); 4084 4085 if (toReveal.length === 0) { 4086 return; 4087 } 4088 4089 this.timeline.staggerFromTo(toReveal, 0.45, { autoAlpha: 0, y: 30 }, { autoAlpha: 1, y: 0 }, 0.2); 4090 } 4091 }]); 4092 4093 return ArticleSection; 4094 }(); 4095 /* harmony export (immutable) */ 4096 4097 __webpack_exports__["default"] = ArticleSection; 4098 4099 /***/ 4100 }, 4101 /* 28 */ 4102 /***/function (module, __webpack_exports__, __webpack_require__) { 4103 4104 "use strict"; 4105 4106 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4107
4108 var BackgroundVideoSection = function () { 4109 function BackgroundVideoSection(container) { 4110 _classCallCheck(this, BackgroundVideoSection); 4111 4112 this.element = container; 4113 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 4114 4115 this._loadScript().then(this._setupPlayer.bind(this)); 4116 } 4117 4118 _createClass(BackgroundVideoSection, [{ 4119 key: '_loadScript', 4120 value: function _loadScript() { 4121 var _this26 = this; 4122 4123 return new Promise(function (resolve, reject) { 4124 var script = document.createElement('script'); 4125 document.body.appendChild(script); 4126 script.onload = resolve; 4127 script.onerror = reject; 4128 script.async = true; 4129 script.src = _this26.options['videoType'] === 'youtube' ? '//www.youtube.com/iframe_api' : '//player.vimeo.com/api/player.js'; 4130 }); 4131 } 4132 }, { 4133 key: 'onUnload', 4134 value: function onUnload() { 4135 if (this.player) { 4136 this.player.destroy(); // Both YouTube and Vimeo use the same function name 4137 } 4138 } 4139 }, { 4140 key: '_setupPlayer', 4141 value: function _setupPlayer() { 4142 var _this27 = this; 4143 4144 var elementToInsert = this.element.querySelector('.ImageHero__VideoHolder'); 4145 4146 var playerLoadingInterval = setInterval(function () { 4147 if (_this27.options['videoType'] === 'youtube') { 4148 if (window.YT) { 4149 _this27.player = new YT.Player(elementToInsert, { 4150 videoId: _this27.options['videoId'], 4151 playerVars: { 4152 showinfo: 0, 4153 controls: 0, 4154 fs: 0, 4155 rel: 0, 4156 height: '100%', 4157 width: '100%', 4158 iv_load_policy: 3, 4159 html5: 1, 4160 loop: 1, 4161 playsinline: 1, 4162 modestbranding: 1, 4163 disablekb: 1, 4164 origin: _this27.options['requestHost'] 4165 }, 4166 events: { 4167 onReady: _this27._onYouTubeReady.bind(_this27), 4168 onStateChange: _this27._onYouTubeStateChange.bind(_this27) 4169 } 4170 }); 4171 4172 clearInterval(playerLoadingInterval); 4173 } 4174 } else { 4175 if (window.Vimeo) { 4176 _this27.player = new Vimeo.Player(elementToInsert.parentNode, { 4177 id: _this27.options['videoId'], 4178 autoplay: true, 4179 muted: true, 4180 background: true, 4181 /*height: '100%', 4182 width: '100%',*/ 4183 loop: true 4184 }); 4185 } 4186 } 4187 }, 50); 4188 } 4189 }, { 4190 key: '_onYouTubeReady', 4191 value: function _onYouTubeReady(event) { 4192 this.player.mute(); 4193 this.player.playVideo(); 4194 } 4195 }, { 4196 key: '_onYouTubeStateChange', 4197 value: function _onYouTubeStateChange(event) { 4198 if (event.data === YT.PlayerState.ENDED) { 4199 this.player.playVideo(); 4200 } 4201 } 4202 }]); 4203 4204 return BackgroundVideoSection; 4205 }(); 4206 /* harmony export (immutable) */ 4207 4208 __webpack_exports__["default"] = BackgroundVideoSection; 4209 4210 /***/ 4211 }, 4212 /* 29 */ 4213 /***/function (module, __webpack_exports__, __webpack_require__) { 4214 4215 "use strict"; 4216 4217 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4218 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Drawer__ = __webpack_require__(8); 4219 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 4220 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Currency__ = __webpack_require__(5); 4221 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__components_ShippingEstimator__ = __webpack_require__(18); 4222 4223 var CartSection = function () { 4224 function CartSection(container) { 4225 _classCallCheck(this, CartSection); 4226 4227 this.element = container; 4228 this.delegateElement = new domDelegate.Delegate(this.element); 4229 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 4230 this.itemCount = this.options['itemCount']; 4231 this.isCartNoteOpen = false;
4232 4233 if (this.options['drawer']) { 4234 this.sidebarDrawer = new __WEBPACK_IMPORTED_MODULE_0__components_Drawer__["default"](this.element, { 4235 onClose: this._onDrawerClosed.bind(this) 4236 }); 4237 } 4238 4239 if (this.options['hasShippingEstimator']) { 4240 this.shippingEstimator = new __WEBPACK_IMPORTED_MODULE_3__components_ShippingEstimator__["default"](this.element.querySelector('.ShippingEstimator')); 4241 } 4242 4243 this._attachListeners(); 4244 } 4245 4246 _createClass(CartSection, [{ 4247 key: 'onUnload', 4248 value: function onUnload() { 4249 if (this.options['hasShippingEstimator']) { 4250 this.shippingEstimator.destroy(); 4251 } 4252 4253 this.delegateElement.off(); 4254 document.removeEventListener('product:added', this._onProductAddedListener); 4255 } 4256 }, { 4257 key: '_attachListeners', 4258 value: function _attachListeners() { 4259 this._onProductAddedListener = this._onProductAdded.bind(this); 4260 4261 this.delegateElement.on('change', '#cart-note', this._updateCartNote.bind(this)); 4262 this.delegateElement.on('click', '[data-action="update-item-quantity"], [data-action="remove-item"]', this._updateItemQuantity.bind(this)); 4263 this.delegateElement.on('change', '.QuantitySelector__CurrentQuantity', this._updateItemQuantity.bind(this)); 4264 4265 // We have some listeners that are specific to the fact it's a drawer or the dedicated cart page 4266 if (this.options['drawer']) { 4267 this.delegateElement.on('click', '[data-action="toggle-cart-note"]', this._toggleCartNote.bind(this)); 4268 } 4269 4270 document.addEventListener('product:added', this._onProductAddedListener); 4271 } 4272 }, { 4273 key: '_updateCartNote', 4274 value: function _updateCartNote(event, target) { 4275 var formData = new FormData(); 4276 formData.append('note', target.value); 4277 4278 fetch('/cart/update.js', { 4279 credentials: 'same-origin', 4280 method: 'POST', 4281 headers: { 4282 'Accept': 'application/json', 4283 'X-Requested-With': 'XMLHttpRequest' // This is needed as currently there is a bug in Shopify that assumes this header 4284 }, 4285 body: formData 4286 }); 4287 } 4288 }, { 4289 key: '_toggleCartNote', 4290 value: function _toggleCartNote() { 4291 var _this28 = this; 4292 4293 var noteContainer = this.element.querySelector('.Cart__OffscreenNoteContainer'), 4294 cartNote = this.element.querySelector('#cart-note'); 4295 4296 this.element.classList.toggle('has-note-open'); 4297 this.element.querySelector('.Cart__NoteButton').innerHTML = cartNote.value !== '' ? window.languages.cartEditNote : window.languages.cartAddNote; 4298 4299 noteContainer.setAttribute('aria-hidden', noteContainer.getAttribute('aria-hidden') === 'true' ? 'false' : 'true'); 4300 4301 this.isCartNoteOpen = noteContainer.getAttribute('aria-hidden') === 'false'; 4302 4303 if (this.element.classList.contains('has-note-open')) { 4304 var transitionEndListener = function transitionEndListener() { 4305 _this28.element.querySelector('#cart-note').focus(); 4306 noteContainer.removeEventListener('transitionend', transitionEndListener); 4307 }; 4308 4309 noteContainer.addEventListener('transitionend', transitionEndListener); 4310 } 4311 } 4312 }, { 4313 key: '_updateItemQuantity', 4314 value: function _updateItemQuantity(event, target) { 4315 var _this29 = this; 4316 4317 document.dispatchEvent(new CustomEvent('theme:loading:start')); 4318 4319 var formData = new FormData(), 4320 quantity = null, 4321 elementToAnimate = null; 4322 4323 formData.append('id', target.getAttribute('data-line-id')); 4324 4325 if (target.tagName === 'INPUT') { 4326 quantity = parseInt(Math.max(parseInt(target.value) || 1, 1)); 4327 } else { 4328 quantity = parseInt(target.getAttribute('data-quantity')); 4329 } 4330 4331 formData.append('quantity', quantity); 4332 4333 // If the quantity is 0, then we will animate the product with a removal effect
4334 if (quantity === 0) { 4335 elementToAnimate = target.closest('.CartItemWrapper'); 4336 } 4337 4338 fetch('/cart/change.js', { 4339 credentials: 'same-origin', 4340 method: 'POST', 4341 headers: { 4342 'Accept': 'application/json', 4343 'X-Requested-With': 'XMLHttpRequest' // This is needed as currently there is a bug in Shopify that assumes this header 4344 }, 4345 body: formData 4346 }).then(function (cart) { 4347 cart.json().then(function (content) { 4348 _this29.itemCount = content['item_count']; 4349 _this29._rerenderCart(elementToAnimate); 4350 4351 document.dispatchEvent(new CustomEvent('theme:loading:end')); 4352 }); 4353 }); 4354 4355 event.preventDefault(); 4356 } 4357 }, { 4358 key: '_onProductAdded', 4359 value: function _onProductAdded(event) { 4360 var _this30 = this; 4361 4362 this.itemCount += event.detail.quantity; 4363 4364 this._rerenderCart().then(function () { 4365 _this30.sidebarDrawer.open(); 4366 }); 4367 } 4368 }, { 4369 key: '_onDrawerClosed', 4370 value: function _onDrawerClosed() { 4371 if (this.isCartNoteOpen) { 4372 this._toggleCartNote(); 4373 } 4374 } 4375 4376 /** 4377 * This method is called internally to rerender the cart, based on the content returned by Shopify Ajax API. 4378 * We could save some performance by updating directly in JavaScript instead of doing a GET call to get the HTML 4379 * from Shopify, but by experience, this allows for easier app integration as it allows the Liquid to re-run 4380 * all the time and hence having easier logic. 4381 */ 4382 4383 }, { 4384 key: '_rerenderCart', 4385 value: function _rerenderCart(elementToAnimate) { 4386 var _this31 = this; 4387 4388 // The only thing that we do in JavaScript is checking that if there are no items, we remove the dot in the header 4389 var cartDot = __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(document.querySelectorAll('.Header__CartDot')), 4390 cartQuantity = __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(document.querySelectorAll('.Header__CartCount')); 4391 4392 cartDot.forEach(function (item) { 4393 if (_this31.itemCount === 0) { 4394 item.classList.remove('is-visible'); // IE 11 and lower does not support second attribute of toggle :( 4395 } else { 4396 item.classList.add('is-visible'); 4397 } 4398 }); 4399 4400 cartQuantity.forEach(function (item) { 4401 item.textContent = _this31.itemCount; 4402 }); 4403 4404 // Note: appending a timestamp is necessary as the polyfill on IE11 and lower does not support the "cache" property 4405 return fetch('/cart?view=' + (this.options['drawer'] ? 'drawer' : 'ajax') + '×tamp=' + Date.now(), { 4406 credentials: 'same-origin', 4407 method: 'GET' 4408 }).then(function (content) { 4409 // If there is an element to animate, we animate it using a transition 4410 if (_this31.options['drawer'] && elementToAnimate) { 4411 var timelineLite = new TimelineLite({ 4412 onComplete: function onComplete() { 4413 content.text().then(function (html) { 4414 _this31._replaceContent(html); 4415 }); 4416 } 4417 }); 4418 4419 timelineLite.to(elementToAnimate, 0.5, { height: 0, opacity: 0, ease: Cubic.easeOut }, 0); 4420 4421 if (_this31.itemCount === 0) { 4422 timelineLite.to(_this31.element.querySelector('.Drawer__Footer'), 0.5, { y: '100%', transition: 'none', ease: Cubic.easeInOut }, 0); 4423 } 4424 } else { 4425 content.text().then(function (html) { 4426 _this31._replaceContent(html); 4427 }); 4428 } 4429 }); 4430 } 4431 }, { 4432 key: '_replaceContent', 4433 value: function _replaceContent(html) { 4434 var tempElement = document.createElement('div'); 4435 tempElement.innerHTML = html; 4436 4437 // Convert in background 4438 if (window.theme.currencyConversionEnabled) { 4439 __WEBPACK_IMPORTED_MODULE_2__helper_Currency__["default"].convertAll(tempElement); 4440 } 4441 4442 var cartNodeParent = this.element.querySelector('.Cart').parentNode; 4443 4444 if (this.options['drawer']) { 4445 var currentScrollPosition = this.element.querySelector('.Drawer__Main').scrollTop; 4446 cartNodeParent.replaceChild(tempElement.querySelector('.Cart'), this.element.querySelector('.Cart')); 4447 this.element.querySelector('.Drawer__Main').scrollTop = currentScrollPosition; 4448 } else { 4449 // For dedicated page we replace the whole section if there is no more product 4450 if (this.itemCount === 0) { 4451 this.element.innerHTML = tempElement.querySelector('.shopify-section').firstElementChild.innerHTML; 4452 } else { 4453 cartNodeParent.replaceChild(tempElement.querySelector('.Cart'), this.element.querySelector('.Cart')); 4454 this.element.querySelector('.PageHeader').innerHTML = tempElement.querySelector('.PageHeader').innerHTML; 4455 } 4456 } 4457 } 4458 }]); 4459 4460 return CartSection; 4461 }(); 4462 /* harmony export (immutable) */ 4463 4464 __webpack_exports__["default"] = CartSection; 4465 4466 /***/ 4467 }, 4468 /* 30 */ 4469 /***/function (module, __webpack_exports__, __webpack_require__) { 4470 4471 "use strict"; 4472 4473 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4474 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 4475 4476 var CollectionListSection = function () { 4477 function CollectionListSection(container) { 4478 _classCallCheck(this, CollectionListSection); 4479 4480 this.element = container; 4481 this.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('[data-flickity-config]')); 4482 } 4483 4484 _createClass(CollectionListSection, [{ 4485 key: 'onUnload', 4486 value: function onUnload() { 4487 this.carousel.destroy(); 4488 } 4489 }, { 4490 key: 'onBlockSelect', 4491 value: function onBlockSelect(event) { 4492 this.carousel.selectCell(event.target.getAttribute('data-sli
4492de-index'), true, !event.detail.load); 4493 } 4494 }, { 4495 key: 'onBlockDeselect', 4496 value: function onBlockDeselect() { 4497 this.carousel.unpausePlayer(); 4498 } 4499 }]); 4500 4501 return CollectionListSection; 4502 }(); 4503 /* harmony export (immutable) */ 4504 4505 __webpack_exports__["default"] = CollectionListSection; 4506 4507 /***/ 4508 }, 4509 /* 31 */ 4510 /***/function (module, __webpack_exports__, __webpack_require__) { 4511 4512 "use strict"; 4513 4514 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4515 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Drawer__ = __webpack_require__(8); 4516 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_Popover__ = __webpack_require__(9); 4517 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__components_ProductItemColorSwatch__ = __webpack_require__(4); 4518 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__helper_Dom__ = __webpack_require__(0); 4519 /* harmony import */var __WEBPACK_IMPORTED_MODULE_4__helper_Responsive__ = __webpack_require__(2); 4520 /* harmony import */var __WEBPACK_IMPORTED_MODULE_5__components_OverflowScroller__ = __webpack_require__(13); 4521 4522 var CollectionSection = function () { 4523 function CollectionSection(element) { 4524 _classCallCheck(this, CollectionSection); 4525 4526 this.element = element; 4527 this.delegateElement = new domDelegate.Delegate(this.element); 4528 this.toolbarElement = this.element.querySelector('.CollectionToolbar'); 4529 this.collectionInnerElement = this.element.querySelector('.CollectionInner__Products'); 4530 4531 this.settings = JSON.parse(this.element.getAttribute('data-section-settings')); 4532 this.currentTags = this.settings['currentTags']; 4533 this.currentSortBy = this.settings['sortBy']; 4534 4535 this.temporaryTags = this.currentTags.slice(); // This allows to do a deep copy of the current tags 4536 4537 // Create the popover if available 4538 var sortPopoverElement = document.getElementById('collection-sort-popover'); 4539 if (sortPopoverElement) { 4540 this.sortPopover = new __WEBPACK_IMPORTED_MODULE_1__components_Popover__["default"](sortPopoverElement, { onValueChanged: this._sortByChanged.bind(this) }); 4541 } 4542 4543 // Create the filter drawer if available 4544 var filterDrawerElement = document.getElementById('collection-filter-drawer'); 4545 4546 if (filterDrawerElement) { 4547 this.filterDrawer = new __WEBPACK_IMPORTED_MODULE_0__components_Drawer__["default"](filterDrawerElement, { onClose: this._removeUncommittedTags.bind(this) }); 4548 } 4549 4550 // Create scroller of sidebar 4551 if (this.settings['filterPosition'] === 'sidebar') { 4552 this.filterInnerSidebarScroller = new __WEBPACK_IMPORTED_MODULE_5__components_OverflowScroller__["default"](this.element.querySelector('.CollectionInner__Sidebar')); 4553 } 4554 4555 // Setup parallax on image (if any) 4556 var collectionImageElement = this.element.querySelector('.PageHeader__ImageWrapper'); 4557 4558 if (collectionImageElement && window.matchMedia('(-moz-touch-enabled: 0), (hover: hover)').matches) { 4559 this.parallaxInstance = new Rellax('.PageHeader__ImageWrapper', { 4560 speed: -7, 4561 center: false, 4562 round: true 4563 }); 4564 } 4565 4566 // Setup product item color swatch 4567 new __WEBPACK_IMPORTED_MODULE_2__components_ProductItemColorSwatch__["default"](this.element); 4568 4569 // Setup animation 4570 this.timeline = new TimelineLite({ delay: window.theme.showPageTransition ? 0.5 : 0 }); 4571 this._setupAnimation(); 4572 4573 this._attachListeners(); 4574 } 4575 4576 _createClass(CollectionSection, [{ 4577 key: 'onUnload', 4578 value: function onUnload() { 4579 this.delegateElement.off('click'); 4580 4581 if (this.sortPopover) { 4582 this.sortPopover.destroy(); 4583 } 4584 4585 if (this.filterDrawer) { 4586 this.filterDrawer.destroy(); 4587 } 4588 4589 if (this.filterInnerSidebarScroller) { 4590 this.filterInnerSidebarScroller.destroy(); 4591 } 4592 4593 if (this.parallaxInstance) { 4594 this.parallaxInstance.destroy(); 4595 } 4596 4597 if (window.theme.showElementStaggering) { 4598 this.intersectionObserver.disconnect(); 4599 this.timeline.kill(); 4600 } 4601 } 4602 }, { 4603 key: '_setupAnimation', 4604 value: function _setupAnimation() { 4605 var _this32 = this; 4606 4607 if (!window.theme.showElementStaggering) { 4608 return; 4609 } 4610 4611 // If there is already an observer set up, we remove it first 4612 if (this.intersectionObserver) { 4613 this.intersectionObserver.disconnect(); 4614 } 4615 4616 this.intersectionObserver = new IntersectionObserver(this._reveal.bind(this), { 4617 threshold: 0.3 4618 }); 4619 4620 __WEBPACK_IMPORTED_MODULE_3__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.ProductList .ProductItem')).forEac
4620h(function (item) { 4621 _this32.intersectionObserver.observe(item); 4622 }); 4623 } 4624 }, { 4625 key: '_reveal', 4626 value: function _reveal(results) { 4627 var _this33 = this; 4628 4629 var toReveal = []; 4630 4631 results.forEach(function (result) { 4632 if (result.isIntersecting || result.intersectionRatio > 0) { 4633 // isIntersecting does not exist on Samsung Android browser 4634 toReveal.push(result.target); 4635 _this33.intersectionObserver.unobserve(result.target); 4636 } 4637 }); 4638 4639 if (toReveal.length === 0) { 4640 return; 4641 } 4642 4643 this.timeline.staggerFromTo(toReveal, 0.45, { autoAlpha: 0, y: 25 }, { autoAlpha: 1, y: 0 }, 0.2); 4644 } 4645 }, { 4646 key: '_changeLayoutMode', 4647 value: function _changeLayoutMode(event, target) { 4648 var _this34 = this; 4649 4650 var layoutType = target.getAttribute('data-grid-type'), 4651 newCount = parseInt(target.getAttribute('data-count')); 4652 4653 // Otherwise we detect the mode, and change all classes 4654 var productList = this.collectionInnerElement.querySelector('.ProductList'); 4655 4656 if (productList) { 4657 var previousCount = parseInt(productList.getAttribute('data-' + layoutType + '-count')); 4658 4659 if (previousCount === newCount) { 4660 return; // Nothing has changed so we just return to avoid reflow 4661 } 4662 4663 productList.setAttribute('data-' + layoutType + '-count', newCount); 4664 4665 __WEBPACK_IMPORTED_MODULE_3__helper_Dom__["default"].nodeListToArray(productList.querySelectorAll('.Grid__Cell')).forEac
4665h(function (item) { 4666 if (layoutType === 'mobile') { 4667 item.classList.remove('1/' + previousCount + '--phone'); // IE11 and lower does not support classList.replace 4668 item.classList.add('1/' + newCount + '--phone'); 4669 } else { 4670 var previousTabletCount = previousCount === 2 ? 2 : 3, 4671 newTabletCount = newCount === 2 ? 2 : 3; 4672 4673 if (_this34.settings['filterPosition'] === 'drawer') { 4674 item.classList.remove('1/' + previousCount + '--lap-and-up'); 4675 item.classList.add('1/' + newCount + '--lap-and-up'); 4676 } else { 4677 item.classList.remove('1/' + previousCount + '--desk'); 4678 item.classList.add('1/' + newCount + '--desk'); 4679 } 4680 4681 item.classList.remove('1/' + previousTabletCount + '--tablet-and-up'); 4682 item.classList.add('1/' + newTabletCount + '--tablet-and-up'); 4683 } 4684 4685 if (window.theme.showElementStaggering) { 4686 item.firstElementChild.style.visibility = 'hidden'; // Make it as hidden so we can re-trigger the animation 4687 } 4688 }); 4689 4690 // Force lazy sizes to recalculate item sizes 4691 lazySizes.autoSizer.checkElems(); 4692 } 4693 4694 target.classList.add('is-active'); 4695 __WEBPACK_IMPORTED_MODULE_3__helper_Dom__["default"].getSiblings(target)[0].classList.remove('is-active'); 4696 4697 this._setupAnimation(); 4698 4699 // In order to prevent reflow and provide better user experience, we save into cart attributes (those are removed before the checkout 4700 // is submitted) the user choices so they are preserved on page reload, without the need to use JavaScript 4701 4702 var formData = new FormData(); 4703 4704 formData.append('attributes[collection_' + layoutType + '_items_per_row]', newCount); 4705 4706 fetch('/cart/update.js', { 4707 credentials: 'same-origin', 4708 method: 'POST', 4709 headers: { 4710 'Accept': 'application/json', 4711 'X-Requested-With': 'XMLHttpRequest' // This is needed as currently there is a bug in Shopify that assumes this header 4712 }, 4713 body: formData 4714 }); 4715 } 4716 }, { 4717 key: '_sortByChanged', 4718 value: function _sortByChanged(sortBy) { 4719 if (this.currentSortBy === sortBy) { 4720 return; 4721 } 4722 4723 this.currentSortBy = sortBy; 4724 this._reloadProducts(); 4725 } 4726 }, { 4727 key: '_toggleTag', 4728 value: function _toggleTag(event) { 4729 var element = event.target; 4730 4731 if (element.classList.contains('is-active')) { 4732 this.temporaryTags.splice(this.temporaryTags.indexOf(element.getAttribute('data-tag')), 1); // Delete the tag if already active 4733 } else { 4734 var activeSibling = element.closest('.Collapsible').querySelector('.is-active'); 4735 4736 if (activeSibling) { 4737 this.temporaryTags.splice(this.temporaryTags.indexOf(activeSibling.getAttribute('data-tag')), 1); 4738 } 4739 4740 this.temporaryTags.push(element.getAttribute('data-tag')); // Add if not previously active 4741 } 4742 4743 this._updateActiveTags(); 4744 4745 // If we have the mode set as "sidebar" and that we are on desktop, we auto-commit 4746 if (__WEBPACK_IMPORTED_MODULE_4__helper_Responsive__["default"].matchesBreakpoint('lap-and-up') && this.settings['filterPosition'] === 'sidebar') { 4747 this._commit(); 4748 } 4749 } 4750 }, { 4751 key: '_removeUncommittedTags', 4752 value: function _removeUncommittedTags() { 4753 this.temporaryTags = this.currentTags.slice(); // We simply reset the temporary tags to the active tags 4754 this._updateActiveTags(); 4755 } 4756 }, { 4757 key: '_applyTags', 4758 value: function _applyTags() { 4759 this._updateActiveTags(); 4760 this._commit(); 4761 } 4762 }, { 4763 key: '_resetTags', 4764 value: function _resetTags() { 4765 this.temporaryTags = []; // We simply remove all tags 4766 this._applyTags(); 4767 } 4768 }, { 4769 key: '_updateActiveTags', 4770 value: function _updateActiveTags() { 4771 var _this35 = this; 4772 4773 __WEBPACK_IMPORTED_MODULE_3__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.CollectionFilters [data-tag]')).forEac
4773h(function (item) { 4774 // IE11 and lower does not support classList.toggle... 4775 if (_this35.temporaryTags.includes(item.getAttribute('data-tag'))) { 4776 item.classList.add('is-active'); 4777 item.parentNode.classList.add('is-selected'); // For the case of "ListItem" 4778 } else { 4779 item.classList.remove('is-active'); 4780 item.parentNode.classList.remove('is-selected'); // For the case of "ListItem" 4781 } 4782 }); 4783 } 4784 }, { 4785 key: '_commit', 4786 value: function _commit() { 4787 var _this36 = this; 4788 4789 if (this.currentTags.sort().join(',') !== this.temporaryTags.sort().join(',')) { 4790 this.currentTags = this.temporaryTags.slice(); 4791 this._reloadProducts(); 4792 } 4793 4794 if (this.filterDrawer.isOpen) { 4795 this.filterDrawer.close(); 4796 } 4797 4798 __WEBPACK_IMPORTED_MODULE_3__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('[data-action="reset-tags"]')).forEach(function (resetButton) { 4799 resetButton.style.display = _this36.currentTags.length === 0 ? 'none' : 'block'; 4800 }); 4801 } 4802 }, { 4803 key: '_reloadProducts', 4804 value: function _reloadProducts() { 4805 var _this37 = this; 4806 4807 document.dispatchEvent(new CustomEvent('theme:loading:start')); 4808 4809 var filterElement = this.toolbarElement.querySelector('.CollectionToolbar__Item--filter'); 4810 4811 if (filterElement) { 4812 var filterElementCount = filterElement.querySelector('span'); 4813 4814 if (filterElementCount) { 4815 filterElement.removeChild(filterElementCount); 4816 } 4817 4818 if (this.currentTags.length === 0) { 4819 filterElement.classList.add('Text--subdued'); 4820 } else { 4821 filterElement.classList.remove('Text--subdued'); 4822 filterElement.innerHTML += '<span class="Text--subdued">(' + this.currentTags.length + ')</span>'; 4823 } 4824 } 4825 4826 // We also rewrite the URL if browser supports it 4827 if (history.replaceState) { 4828 var tags = this.currentTags.length > 0 ? this.currentTags.join('+') : ''; 4829 var newUrl = window.location.protocol + '//' + window.location.host + this.settings['collectionUrl'] + '/' + tags + '?sort_by=' + this.currentSortBy; 4830 4831 window.history.pushState({ path: newUrl }, '', newUrl); 4832 } 4833 4834 var formData = new FormData(); 4835 formData.append('view', 'ajax'); 4836 formData.append('sort_by', this.currentSortBy); 4837 4838 fetch(location.pathname + '?view=ajax&sort_by=' + this.currentSortBy, { 4839 credentials: 'same-origin', 4840 method: 'GET' 4841 }).then(function (response) { 4842 response.text().then(function (content) { 4843 var tempElement = document.createElement('div'); 4844 tempElement.innerHTML = content; 4845 4846 _this37.collectionInnerElement.innerHTML = tempElement.querySelector('.shopify-section').innerHTML; 4847 console.log('option init'); 4848 initOptions(); 4849 document.dispatchEvent(new CustomEvent('theme:loading:end')); 4850 4851 _this37._setupAnimation(); 4852 4853 // We scroll to the top 4854 var elementOffset = _this37.element.querySelector('.CollectionMain').getBoundingClientRect().top - parseInt(document.documentElement.style.getPropertyValue('--header-height')); 4855 4856 if (__WEBPACK_IMPORTED_MODULE_4__helper_Responsive__["default"].matchesBreakpoint('lap-and-up') && _this37.toolbarElement && _this37.toolbarElement.clientHeight === 0) { 4857 elementOffset -= 50; 4858 } 4859 4860 if (elementOffset < 0) { 4861 window.scrollBy({ top: elementOffset, behavior: 'smooth' }); 4862 } 4863 }); 4864 }); 4865 } 4866 }, { 4867 key: '_attachListeners', 4868 value: function _attachListeners() { 4869 this._toggleTagListener = this._toggleTag.bind(this); 4870 this._applyTagsListener = this._applyTags.bind(this); 4871 this._resetTagsListener = this._resetTags.bind(this); 4872 this._changeLayoutModeListener = this._changeLayoutMode.bind(this); 4873 4874 this.delegateElement.on('click', '[data-action="toggle-tag"]', this._toggleTagListener); 4875 this.delegateElement.on('click', '[data-action="apply-tags"]', this._applyTagsListener); 4876 this.delegateElement.on('click', '[data-action="reset-tags"]', this._resetTagsListener); 4877 this.delegateElement.on('click', '[data-action="change-layout-mode"]', this._changeLayoutModeListener); 4878 4879 window.addEventListener('popstate', function (event) { 4880 if (event.state.path) { 4881 window.location.href = event.state.path; 4882 } 4883 }); 4884 } 4885 }]); 4886 4887 return CollectionSection; 4888 }(); 4889 /* harmony export (immutable) */ 4890 4891 __webpack_exports__["default"] = CollectionSection; 4892 4893 /***/ 4894 }, 4895 /* 32 */ 4896 /***/function (module, __webpack_exports__, __webpack_require__) { 4897 4898 "use strict"; 4899 4900 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4901 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Animation__ = __webpack_require__(7); 4902 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 4903 4904 var FaqSection = function () { 4905 function FaqSection(element) { 4906 _classCallCheck(this, FaqSection); 4907 4908 this.element = element; 4909 this.delegateElement = new domDelegate.Delegate(this.element); 4910 4911 this._attachListeners(); 4912 } 4913 4914 _createClass(FaqSection, [{ 4915 key: 'onUnload', 4916 value: function onUnload() { 4917 this.delegateElement.off(); 4918 } 4919 }, { 4920 key: 'onBlockSelect', 4921 value: function onBlockSelect(event) { 4922 this._openItem(event.target); 4923 } 4924 }, { 4925 key: 'onBlockDeselect', 4926 value: function onBlockDeselect(event) { 4927 this._closeItem(event.target); 4928 } 4929 }, { 4930 key: '_attachListeners', 4931 value: function _attachListeners() { 4932 this.delegateElement.on('click', '.Faq__Question', this._toggleItem.bind(this)); 4933 this.delegateElement.on('click', '.FaqSummary__Item', this._switchToCategory.bind(this)); 4934 } 4935 }, { 4936 key: '_switchToCategory', 4937 value: function _switchToCategory(event, target) { 4938 target.classList.add('is-active'); 4939 4940 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].getSiblings(target, '.is-active').forEach(function (item) { 4941 item.classList.remove('is-active'); 4942 }); 4943 } 4944 }, { 4945 key: '_toggleItem', 4946 value: function _toggleItem(event, target) { 4947 var item = target.closest('.Faq__Item'); 4948 4949 if (item.getAttribute('aria-expanded') === 'true') { 4950 this._closeItem(item); 4951 } else { 4952 this._openItem(item); 4953 } 4954 } 4955 }, { 4956 key: '_openItem', 4957 value: function _openItem(item) { 4958 var answerWrapper = item.querySelector('.Faq__AnswerWrapper'); 4959 4960 item.setAttribute('aria-expanded', 'true'); 4961 4962 answerWrapper.setAttribute('aria-hidden', 'false'); 4963 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slideDown(answerWrapper, true); 4964 4965 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].getSiblings(item, '[aria-expanded="true"]').forEach(function (siblingItem) { 4966 var siblingAnswerWrapper = siblingItem.querySelector('.Faq__AnswerWrapper'); 4967 4968 siblingItem.setAttribute('aria-expanded', 'false'); 4969 4970 siblingAnswerWrapper.setAttribute('aria-hidden', 'true'); 4971 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slide
4971Up(siblingAnswerWrapper); 4972 }); 4973 } 4974 }, { 4975 key: '_closeItem', 4976 value: function _closeItem(item) { 4977 var answerWrapper = item.querySelector('.Faq__AnswerWrapper'); 4978 4979 item.setAttribute('aria-expanded', 'false'); 4980 answerWrapper.setAttribute('aria-hidden', 'true'); 4981 __WEBPACK_IMPORTED_MODULE_0__helper_Animation__["default"].slideUp(answerWrapper); 4982 } 4983 }]); 4984 4985 return FaqSection; 4986 }(); 4987 /* harmony export (immutable) */ 4988 4989 __webpack_exports__["default"] = FaqSection; 4990 4991 /***/ 4992 }, 4993 /* 33 */ 4994 /***/function (module, __webpack_exports__, __webpack_require__) { 4995 4996 "use strict"; 4997 4998 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 4999 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 5000 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__ = __webpack_require__(4); 5001 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Dom__ = __webpack_require__(0); 5002 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__helper__ = __webpack_require__(6); 5003 5004 var FeaturedCollectionsSection = function () { 5005 function FeaturedCollectionsSection(container) { 5006 var _this38 = this; 5007 5008 _classCallCheck(this, FeaturedCollectionsSection); 5009 5010 this.element = container; 5011 this.delegateElement = new domDelegate.Delegate(this.element); 5012 this.options = JSON.parse(this.element.getAttribute('data-settings')); 5013 5014 this.carousels = []; 5015 5016 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('[data-flickity-config]')).forEach(function (item) { 5017 _this38.carousels.push(new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](item)); 5018 }); 5019 5020 // Setup product item color swatch 5021 new __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__["default"](this.element); 5022 5023 this._setupAnimation(); 5024 this._attachListeners(); 5025 } 5026 5027 _createClass(FeaturedCollectionsSection, [{ 5028 key: 'onUnload', 5029 value: function onUnload() { 5030 this.carousels.forEach(function (item) { 5031 return item.destroy(); 5032 }); 5033 this.delegateElement.off('click'); 5034 5035 this.intersectionObserver.disconnect(); 5036 this.timeline.kill(); 5037 } 5038 }, { 5039 key: 'onBlockSelect', 5040 value: function onBlockSelect(event) { 5041 // We simply trigger a click on the element that controls this tab 5042 this.element.querySelector('[aria-controls="' + event.target.id + '"]').click(); 5043 } 5044 }, { 5045 key: '_attachListeners', 5046 value: function _attachListeners() { 5047 this.delegateElement.on('click', '[data-action="toggle-tab"]', this._switchTab.bind(this)); 5048 } 5049 }, { 5050 key: '_switchTab', 5051 value: function _switchTab(event, target) { 5052 var _this39 = this; 5053 5054 // If the tab is already active, do nothing 5055 if (target.classList.contains('is-active')) { 5056 return; 5057 } 5058 5059 // First, switch the current tab 5060 target.classList.add('is-active'); 5061 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].getSiblings(target, '.is-active').forEach(function (item) { 5062 item.classList.remove('is-active'); 5063 }); 5064 5065 // Then, display the panel 5066 var tabPanelToShow = this.element.querySelector('#' + target.getAttribute('aria-controls')); 5067 5068 this.timeline.eventCallback('onReverseComplete', function () { 5069 tabPanelToShow.setAttribute('aria-hidden', 'false'); 5070 5071 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].getSiblings(tabPanelToShow, '.TabPanel[aria-hidden="false"]').forEach(function (item) { 5072 item.setAttribute('aria-hidden', 'true'); 5073 }); 5074 5075 if (__WEBPACK_IMPORTED_MODULE_3__helper__["ResponsiveHelper"].matchesBreakpoint('lap-and-up')) {
5076 _this39.carousels.forEach(function (carousel) { 5077 // There is a bug in Safari where it cannot detect the pseudo-element "::after" if the tab panel is hidden. As a consequence, 5078 // we manually activate it 5079 carousel.flickityInstance.activate(); 5080 carousel.flickityInstance.resize(); // Ugly hack 5081 }); 5082 } 5083 5084 _this39.timeline.clear(); 5085 _this39._setupAnimation(); 5086 }); 5087 5088 if (this.options['layout'] === 'grid' && window.theme.showElementStaggering) { 5089 this.timeline.reverse().timeScale(3); 5090 } else { 5091 this.timeline.reverse(); 5092 } 5093 } 5094 }, { 5095 key: '_setupAnimation', 5096 value: function _setupAnimation() { 5097 var _this40 = this; 5098 5099 if (this.intersectionObserver) { 5100 this.intersectionObserver.disconnect(); 5101 } 5102 5103 this.timeline = new TimelineLite({ delay: 0.5 }); 5104 5105 if (this.options['layout'] === 'grid' && window.theme.showElementStaggering) { 5106 this.intersectionObserver = new IntersectionObserver(this._reveal.bind(this)); 5107 5108 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.TabPanel[aria-hidden="false"] .ProductList .ProductItem')).forEac
5108h(function (item) { 5109 _this40.intersectionObserver.observe(item); 5110 }); 5111 } else { 5112 var productList = this.element.querySelector('.TabPanel[aria-hidden="false"] .ProductList'); 5113 5114 if (productList) { 5115 this.timeline.fromTo(productList, 0.6, { autoAlpha: 0, y: 25 }, { autoAlpha: 1, y: 0 }); 5116 } 5117 } 5118 } 5119 }, { 5120 key: '_reveal', 5121 value: function _reveal(results) { 5122 var _this41 = this; 5123 5124 var toReveal = []; 5125 5126 results.forEach(function (result) { 5127 if (result.isIntersecting || result.intersectionRatio > 0) { 5128 // isIntersecting does not exist on Samsung Android browser 5129 toReveal.push(result.target); 5130 _this41.intersectionObserver.unobserve(result.target); 5131 } 5132 }); 5133 5134 if (toReveal.length === 0) { 5135 return; 5136 } 5137 5138 this.timeline.staggerFromTo(toReveal, 0.45, { autoAlpha: 0, y: 25 }, { autoAlpha: 1, y: 0 }, 0.2); 5139 } 5140 }]); 5141 5142 return FeaturedCollectionsSection; 5143 }(); 5144 /* harmony export (immutable) */ 5145 5146 __webpack_exports__["default"] = FeaturedCollectionsSection; 5147 5148 /***/ 5149 }, 5150 /* 34 */ 5151 /***/function (module, __webpack_exports__, __webpack_require__) { 5152 5153 "use strict"; 5154 5155 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5156 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_ProductVariants__ = __webpack_require__(11); 5157 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Image__ = __webpack_require__(10); 5158 5159 var FeaturedProductSection = function () { 5160 function FeaturedProductSection(container) { 5161 _classCallCheck(this, FeaturedProductSection); 5162 5163 this.element = container; 5164 this.delegateElement = new domDelegate.Delegate(this.element); 5165 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 5166 5167 if (!this.options['usePlaceholder']) { 5168 this.productVariants = new __WEBPACK_IMPORTED_MODULE_0__components_ProductVariants__["default"](container, this.options); 5169 } 5170 5171 this._attachListeners(); 5172 } 5173 5174 _createClass(FeaturedProductSection, [{ 5175 key: 'onUnload', 5176 value: function onUnload() { 5177 this.delegateElement.off('click'); 5178 5179 if (!this.options['usePlaceholder']) { 5180 this.productVariants.destroy(); 5181 } 5182 } 5183 }, { 5184 key: '_attachListeners', 5185 value: function _attachListeners() { 5186 this.delegateElement.on('variant:changed', this._updateMainImage.bind(this)); 5187 } 5188 5189 /** 5190 * Update the main featured image 5191 */ 5192 5193 }, { 5194 key: '_updateMainImage', 5195 value: function _updateMainImage(event) { 5196 var variant = event.detail.variant, 5197 previousVariant = event.detail.previousVariant; 5198 5199 if (!variant || !variant['featured_image'] || previousVariant['featured_image'] && previousVariant['featured_image']['id'] === variant['featured_image']['id']) { 5200 return; 5201 } 5202 5203 // Otherwise we are on the home page. It's a bit more complex as we have to rewrite some code normally written in Liquid 5204 var newImage = variant['featured_image']; 5205 5206 var mainImageContainer = this.element.querySelector('.FeaturedProduct__Gallery .AspectRatio'); 5207 mainImageContainer.style.cssText = 'max-width: ' + newImage['width'] + 'px; --aspect-ratio: ' + newImage['width'] / newImage['height']; 5208 5209 var newImageElement = document.createElement('img'); 5210 newImageElement.classList.add('Image--lazyLoad'); 5211 newImageElement.setAttribute('data-src', __WEBPACK_IMPORTED_MODULE_1__helper_Image__["default"].getSizedImageUrl(newImage['src'], '1x1').replace('_1x1.', '_{width}x.')); 5212 newImageElement.setAttribute('data-widths', '[' + __WEBPACK_IMPORTED_MODULE_1__helper_Image__["default"].getSupportedSizes(newImage, [200, 400, 600, 700, 800, 900, 1000]).join(',') + ']'); 5213 newImageElement.setAttribute('data-sizes', 'auto'); 5214 5215 mainImageContainer.replaceChild(newImageElement, mainImageContainer.querySelector('img')); 5216 } 5217 }]); 5218 5219 return FeaturedProductSection; 5220 }(); 5221 /* harmony export (immutable) */ 5222 5223 __webpack_exports__["default"] = FeaturedProductSection; 5224 5225 /***/ 5226 }, 5227 /* 35 */ 5228 /***/function (module, __webpack_exports__, __webpack_require__) { 5229 5230 "use strict"; 5231 5232 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5233 5234 var GiftCardSection = function () { 5235 function GiftCardSection(container) { 5236 _classCallCheck(this, GiftCardSection); 5237 5238 this.element = container; 5239 5240 this._createQrCode(); 5241 this._setupPrint(); 5242 } 5243 5244 _createClass(GiftCardSection, [{ 5245 key: '_createQrCode', 5246 value: function _createQrCode() { 5247 var qrCodeElement = document.getElementById('QrCode'); 5248 5249 new QRCode(qrCodeElement, { 5250 text: qrCodeElement.getAttribute('data-identifier'), 5251 width: 120, 5252 height: 120 5253 }); 5254 } 5255 }, { 5256 key: '_setupPrint', 5257 value: function _setupPrint() { 5258 var printElement = document.getElementById('PrintGiftCard'); 5259 5260 if (printElement) { 5261 printElement.addEventListener('click', function () { 5262 window.print(); 5263 }); 5264 } 5265 } 5266 }]); 5267 5268 return GiftCardSection; 5269 }(); 5270 /* harmony export (immutable) */ 5271 5272 __webpack_exports__["default"] = GiftCardSection; 5273 5274 /***/ 5275 }, 5276 /* 36 */ 5277 /***/function (module, __webpack_exports__, __webpack_require__) { 5278 5279 "use strict"; 5280 5281 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5282 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 5283 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Responsive__ = __webpack_require__(2); 5284 5285 var HeaderSection = function () { 5286 function HeaderSection(container) { 5287 var _this42 = this; 5288 5289 _classCallCheck(this, HeaderSection); 5290 5291 this.element = container; 5292 this.delegateElement = new domDelegate.Delegate(this.element); 5293 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 5294 this.lastScrollPosition = -1; 5295 this.isTouch = window.matchMedia('(-moz-touch-enabled: 1), (hover: none)').matches; 5296 5297 if (this.options['isSticky']) { 5298 Stickyfill.addOne(this.element.parentNode); 5299 } 5300 5301 this._attachListeners(); 5302 this._checkNavigationBounds(); 5303
5304 // We set again some CSS variables that are used for some calculations in CSS 5305 var mainLogo = this.element.querySelector('.Header__LogoImage--primary'); 5306 5307 if (mainLogo && !mainLogo.complete) { 5308 mainLogo.addEventListener('load', function () { 5309 fastdom.measure(function () { 5310 document.documentElement.style.setProperty('--header-height', _this42.element.clientHeight + 'px'); 5311 document.documentElement.style.setProperty('--header-is-not-transparent', _this42.options['hasTransparentHeader'] ? 0 : 1); 5312 }); 5313 }); 5314 } else { 5315 fastdom.measure(function () { 5316 document.documentElement.style.setProperty('--header-height', _this42.element.clientHeight + 'px'); 5317 document.documentElement.style.setProperty('--header-is-not-transparent', _this42.options['hasTransparentHeader'] ? 0 : 1); 5318 }); 5319 } 5320 } 5321 5322 _createClass(HeaderSection, [{ 5323 key: 'onUnload', 5324 value: function onUnload() { 5325 this.element.removeEventListener('mouseleave', this._closeNavigationListener); 5326 this.element.removeEventListener('mouseenter', this._focusNavigationListener); 5327 this.element.removeEventListener('focusin', this._focusNavigationListener); 5328 5329 this.delegateElement.off(); 5330 5331 window.removeEventListener('scroll', this._checkTransparentHeaderListener); 5332 window.removeEventListener('resize', this._verifyNavigationOverlapListener); 5333 5334 if (this.options['isSticky']) { 5335 Stickyfill.removeOne(this.element.parentNode); 5336 } 5337 } 5338 }, { 5339 key: 'onSelect', 5340 value: function onSelect() { 5341 this._checkTransparentHeader(); 5342 } 5343 }, { 5344 key: 'onBlockSelect', 5345 value: function onBlockSelect(event) { 5346 var _this43 = this; 5347 5348 var listItem = event.target.closest('.HorizontalList__Item'); 5349 5350 fastdom.mutate(function () { 5351 event.target.setAttribute('aria-hidden', 'false'); 5352 5353 if (listItem) { 5354 listItem.classList.add('is-expanded'); 5355 5356 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].getSiblings(listItem, '.is-expanded').forEach(function (item) { 5357 item.classList.remove('is-expanded'); 5358 }); 5359 } 5360 5361 _this43.element.classList.remove('Header--transparent'); // This is needed to make sure everything is visible 5362 }); 5363 } 5364 }, { 5365 key: 'onBlockDeselect', 5366 value: function onBlockDeselect(event) { 5367 var listItem = event.target.closest('.HorizontalList__Item'); 5368 5369 fastdom.mutate(function () { 5370 event.target.setAttribute('aria-hidden', 'true'); 5371 5372 if (listItem) { 5373 listItem.classList.remove('is-expanded'); 5374 } 5375 }); 5376 5377 this._checkTransparentHeader(); 5378 } 5379 }, { 5380 key: '_attachListeners', 5381 value: function _attachListeners() { 5382 this._checkTransparentHeaderListener = this._checkTransparentHeader.bind(this); 5383 this._closeNavigationListener = this._closeNavigation.bind(this); 5384 this._focusNavigationListener = this._focusNavigation.bind(this); 5385 this._verifyNavigationOverlapListener = this._verifyNavigationOverlap.bind(this); 5386 5387 this.element.addEventListener('mouseleave', this._closeNavigationListener); 5388 5389 this.delegateElement.on('mouseenter', '.Header__MainNav .HorizontalList__Item, [aria-haspopup]', this._openMenu.bind(this), true); 5390 this.delegateElement.on('focusin', '[aria-haspopup]', this._openMenu.bind(this), true); 5391 this.delegateElement.on('focusout', '[aria-haspopup]', this._closeMenu.bind(this), false); 5392 this.delegateElement.on('mouseleave', '.DropdownMenu [aria-haspopup]', this._closeMenu.bind(this), true); 5393 this.delegateElement.on('mouseenter', '.DropdownMenu [aria-haspopup]', this._adjustDropdownPosition.bind(this), true); 5394 5395 if (this.isTouch) { 5396 this.delegateElement.on('click', '.Header__MainNav [aria-haspopup]', this._handleTouchMenu.bind(this)); 5397 } 5398 5399 if (this.options['hasTransparentHeader']) { 5400 this.element.addEventListener('mouseenter', this._focusNavigationListener); 5401 this.element.addEventListener('focusin', this._focusNavigationListener); 5402 } 5403 5404 if (this.options['isSticky'] && this.options['hasTransparentHeader']) { 5405 window.addEventListener('scroll', this._checkTransparentHeaderListener); 5406 } 5407
5408 if (this.options['navigationStyle'] === 'inline') { 5409 window.addEventListener('resize', this._verifyNavigationOverlapListener); 5410 } 5411 } 5412 }, { 5413 key: '_focusNavigation', 5414 value: function _focusNavigation() { 5415 var _this44 = this; 5416 5417 fastdom.mutate(function () { 5418 if (!_this44.isTouch || __WEBPACK_IMPORTED_MODULE_1__helper_Responsive__["default"].matchesBreakpoint('desk')) { 5419 _this44.element.classList.remove('Header--transparent'); 5420 } 5421 }); 5422 } 5423 }, { 5424 key: '_closeNavigation', 5425 value: function _closeNavigation() { 5426 var _this45 = this; 5427 5428 fastdom.mutate(function () { 5429 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(_this45.element.querySelectorAll('.is-expanded')).forEach(function (item) { 5430 item.classList.remove('is-expanded'); 5431 }); 5432 5433 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(_this45.element.querySelectorAll('[aria-hidden="false"]')).forEach(function (item) { 5434 item.setAttribute('aria-hidden', 'true'); 5435 }); 5436 }); 5437 5438 if (this.options['hasTransparentHeader']) { 5439 this._checkTransparentHeader(); 5440 } 5441 } 5442 }, { 5443 key: '_openMenu', 5444 value: function _openMenu(event, target) { 5445 if (event.type === 'mouseenter' && target !== event.target) { 5446 return; 5447 } 5448 5449 fastdom.mutate(function () { 5450 target.classList.add('is-expanded'); 5451 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(target.children, '[aria-hidden="true"]').forEach(function (item) { 5452 item.setAttribute('aria-hidden', 'false'); 5453 }); 5454 5455 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].getSiblings(target, '.is-expanded').forEach(function (item) { 5456 item.classList.remove('is-expanded'); 5457 5458 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(item.children, '[aria-hidden="false"]').forEach(function (item) { 5459 item.setAttribute('aria-hidden', 'true'); 5460 }); 5461 }); 5462 }); 5463 } 5464 }, { 5465 key: '_closeMenu', 5466 value: function _closeMenu(event, target) { 5467 if (event.type === 'mouseleave' && target !== event.target) { 5468 return; 5469 } 5470 5471 fastdom.mutate(function () { 5472 target.classList.remove('is-expanded'); 5473 5474 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(target.children, '[aria-hidden="false"]').forEach(function (item) { 5475 item.setAttribute('aria-hidden', 'true'); 5476 }); 5477 }); 5478 } 5479 }, { 5480 key: '_adjustDropdownPosition', 5481 value: function _adjustDropdownPosition(event, target) { 5482 var nestedMenus = __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(target.querySelectorAll('.DropdownMenu')), 5483 shouldOpenLeft = false; 5484 5485 fastdom.measure(function () { 5486 var windowWidth = window.innerWidth, 5487 rightEdge = target.getBoundingClientRect().right; 5488 5489 nestedMenus.forEach(function (item) { 5490 if (rightEdge + item.offsetWidth > windowWidth) { 5491 shouldOpenLeft = true; 5492 } 5493 }); 5494 }); 5495 5496 fastdom.mutate(function () { 5497 if (shouldOpenLeft) { 5498 nestedMenus.forEach(function (item) { 5499 item.classList.add('DropdownMenu--reversed'); 5500 }); 5501 } else { 5502 nestedMenus.forEach(function (item) { 5503 item.classList.remove('DropdownMenu--reversed'); 5504 }); 5505 } 5506 }); 5507 } 5508 5509 // On touch devices where we display the standard menu (like landscape iPad or Surface) we need to do additional code to properly 5510 // handle the opening of menu. Especially, what we do is that if an item has a sub-menu, a click does not follow the link but instead open
5511 // the sub-menu. If this link is clicked a second twice, then the menu is followed 5512 5513 }, { 5514 key: '_handleTouchMenu', 5515 value: function _handleTouchMenu(event, target) { 5516 if (!target.classList.contains('is-expanded')) { 5517 event.preventDefault(); 5518 } 5519 } 5520 }, { 5521 key: '_checkNavigationBounds', 5522 value: function _checkNavigationBounds() { 5523 var _this46 = this; 5524 5525 if (this.options['navigationStyle'] !== 'inline') { 5526 return; 5527 } 5528 5529 var mainTopMenu = this.element.querySelector('.Header__MainNav'); 5530 5531 this.mainMenuWidth = 45; 5532 this.menuLeftOffset = 0; 5533 5534 fastdom.measure(function () { 5535 _this46.menuLeftOffset = mainTopMenu.offsetLeft; 5536 5537 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(mainTopMenu.querySelectorAll('.HorizontalList__Item')).forEach(function (item) { 5538 _this46.mainMenuWidth += parseInt(__WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].outerWidthWithMargin(item)); 5539 }); 5540 }); 5541 5542 this._verifyNavigationOverlap(); // Verify it once 5543 } 5544 }, { 5545 key: '_verifyNavigationOverlap', 5546 value: function _verifyNavigationOverlap() { 5547 var _this47 = this; 5548 5549 var isOverlapping = false; 5550 5551 fastdom.measure(function () { 5552 isOverlapping = _this47.mainMenuWidth > Math.ceil(_this47.element.querySelector('.Header__Logo').offsetLeft - _this47.menuLeftOffset); 5553 }); 5554 5555 fastdom.mutate(function () { 5556 if (isOverlapping) { 5557 _this47.element.classList.remove('Header--inline'); 5558 _this47.element.classList.add('Header--center'); 5559 } else { 5560 _this47.element.classList.add('Header--inline'); 5561 _this47.element.classList.remove('Header--center'); 5562 } 5563 5564 _this47.element.classList.add('Header--initialized'); 5565 5566 fastdom.measure(function () { 5567 document.documentElement.style.setProperty('--header-height', _this47.element.clientHeight + 'px'); 5568 }); 5569 }); 5570 } 5571 5572 /** 5573 * If the header mode is set to "transparent", we have to do extra work to automatically make it with fill colors when the 5574 * user starts scrolling. For performance we are using fastDOM to do that (which relies of requestAnimationFrame instead of 5575 * scroll listener) 5576 */ 5577 5578 }, { 5579 key: '_checkTransparentHeader', 5580 value: function _checkTransparentHeader() { 5581 var _this48 = this; 5582 5583 if (!this.options['hasTransparentHeader']) { 5584 return; 5585 } 5586 5587 var scrollThreshold = 10; 5588 5589 fastdom.measure(function () { 5590 _this48.lastScrollPosition = window.pageYOffset; 5591 5592 /*if (ResponsiveHelper.matchesBreakpoint('pocket')) { 5593 let firstShopifySection = document.querySelector('#main .shopify-section:first-child'); 5594 if (firstShopifySection && firstShopifySection.classList.contains('shopify-section--slideshow')) { 5595 scrollThreshold = firstShopifySection.querySelector('.Slideshow__Carousel').clientHeight - this.element.clientHeight; 5596 } else { 5597 scrollThreshold = 150; 5598 } 5599 }*/ 5600 }); 5601 5602 fastdom.mutate(function () { 5603 if (_this48.lastScrollPosition <= scrollThreshold) { 5604 _this48.element.classList.add('Header--transparent'); 5605 } else { 5606 _this48.element.classList.remove('Header--transparent'); 5607 } 5608 }); 5609 } 5610 }]); 5611 5612 return HeaderSection; 5613 }(); 5614 /* harmony export (immutable) */ 5615 5616 __webpack_exports__["default"] = HeaderSection; 5617 5618 /***/ 5619 }, 5620 /* 37 */ 5621 /***/function (module, __webpack_exports__, __webpack_require__) { 5622 5623 "use strict"; 5624 5625 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5626 5627 var ImageWithTextBlockSection = function () { 5628 function ImageWithTextBlockSection(container) { 5629 _classCallCheck(this, ImageWithTextBlockSection); 5630 5631 this.element = container; 5632 } 5633 5634 _createClass(ImageWithTextBlockSection, [{ 5635 key: 'onUnload', 5636 value: function onUnload() { } 5637 }]); 5638 5639 return ImageWithTextBlockSection; 5640 }(); 5641 /* harmony export (immutable) */ 5642 5643 __webpack_exports__["default"] = ImageWithTextBlockSection; 5644 5645 /***/ 5646 }, 5647 /* 38 */ 5648 /***/function (module, __webpack_exports__, __webpack_require__) { 5649 5650 "use strict"; 5651 5652 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5653 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 5654 5655 var InstagramSection = function () { 5656 function InstagramSection(element) { 5657 _classCallCheck(this, InstagramSection); 5658 5659 this.element = element; 5660 this.instafeed = this.element.querySelector('.Instafeed'); 5661 5662 this._initFeed(); 5663 } 5664 5665 _createClass(InstagramSection, [{ 5666 key: 'onUnload', 5667 value: function onUnload() { 5668 this.carousel.destroy(); 5669 } 5670 }, { 5671 key: '_initFeed', 5672 value: function _initFeed() { 5673 var _this49 = this; 5674 5675 if (!this.instafeed.hasAttribute('data-access-token')) { 5676 this.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.instafeed); // If no access token we display placeholder 5677 } else { 5678 var instafeed = new Instafeed({ 5679 get: 'user', 5680 userId: 'self', 5681 target: this.instafeed, 5682 accessToken: this.instafeed.getAttribute('data-access-token'), 5683 sortBy: 'most-recent', 5684 limit: this.instafeed.getAttribute('data-image-count'), 5685 resolution: 'standard_resolution', 5686 template: '<a href="{{link}}" target="_blank" class="Carousel__Cell Instafeed__Cell">' + '<div rel="noopener" class="Instafeed__Image Image--lazyLoad Image--zoomOut" data-expand="10" data-bg="{{image}}" aria-label="Open on Instagram"></div>' + '<div class="Instafeed__Overlay">' + '<span class="Instafeed__LikeCount">' + '<svg class="Icon Icon--heart" viewBox="0 0 17 15" role="presentation">' + '<path d="M15.0349331 1.40485867C14.1287273.49933787 12.9252477 0 11.6443673 0S9.16000731.49933787 8.25448651 1.40417371c-.01164437.01164436-.02328874.02328873-.03493311.03561806-.01164436-.01232933-.02260377-.02328873-.03424813-.0349331C7.2790995.49933787 6.07561989 0 4.79473949 0 3.51385908 0 2.31037947.49933787 1.40417371 1.40485867.49796794 2.31037947 0 3.51385908 0 4.79473949 0 6.07561989.4986529 7.2790995 1.40417371 8.1846203L8.2195534 15l6.8153797-6.8153797c.9055208-.9055208 1.4041737-2.10900041 1.4041737-3.38988081 0-1.28019545-.4986529-2.48436002-1.4041737-3.38988082z"></path>' + '</svg>' + '{{likes}} likes' + '</span>' + '<p class="Instafeed__Caption">{{caption}}</p>' + '<time class="Instafeed__Date Heading u-h6">{{model.date}}</time>' + '</div>' + '</a>', 5687 success: function success(data) { 5688 var dateTimeFormatter = new Intl.DateTimeFormat(window.theme.locale, { day: 'numeric', month: 'long', year: 'numeric' }); 5689 5690 data['data'].forEach(function (datum) { 5691 datum['date'] = dateTimeFormatter.format(new Date(parseInt(datum['created_time']) * 1000)); 5692 }); 5693 }, 5694 after: function after() { 5695 // At this stage the images have been added to the DOM, so we can use Flickity 5696 _this49.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](_this49.instafeed); 5697 } 5698 }); 5699 5700 instafeed.run(); 5701 } 5702 } 5703 }]); 5704 5705 return InstagramSection; 5706 }(); 5707 /* harmony export (immutable) */ 5708 5709 __webpack_exports__["default"] = InstagramSection; 5710 5711 /***/ 5712 }, 5713 /* 39 */ 5714 /***/function (module, __webpack_exports__, __webpack_require__) { 5715 5716 "use strict"; 5717 5718 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5719 5720 var LoginSection = function () { 5721 function LoginSection(container) { 5722 _classCallCheck(this, LoginSection); 5723 5724 this.element = container; 5725 this.delegateElement = new domDelegate.Delegate(this.element); 5726 this.timelineLite = new TimelineLite(); 5727 5728 this.customerLoginForm = this.element.querySelector('#customer_login'); 5729 this.recoverPasswordForm = this.element.querySelector('#recover_customer_password'); 5730 5731 this.delegateElement.on('click', '[data-action="toggle-recover-form"]', this._showRecoverPassword.bind(this)); 5732 } 5733 5734 _createClass(LoginSection, [{ 5735 key: '_showRecoverPassword', 5736 value: function _showRecoverPassword() { 5737 var isLoginActive = this.customerLoginForm.style.display === 'block'; 5738 5739 if (isLoginActive) { 5740 this.timelineLite.fromTo(this.customerLoginForm, 0.5, { autoAlpha: 1, display: 'block', y: 0 }, { autoAlpha: 0, y: 20, display: 'none' }).fromTo(this.recoverPasswordForm, 0.5, { autoAlpha: 0, display: 'none', y: 20 }, { autoAlpha: 1, display: 'block', y: 0, delay: 0.25 }); 5741 } else { 5742 this.timelineLite.fromTo(this.recoverPasswordForm, 0.5, { autoAlpha: 1, display: 'block', y: 0 }, { autoAlpha: 0, y: 20, display: 'none' }).fromTo(this.customerLoginForm, 0.5, { autoAlpha: 0, display: 'none', y: 20 }, { autoAlpha: 1, display: 'block', y: 0, delay: 0.25 }); 5743 } 5744 } 5745 }]); 5746 5747 return LoginSection; 5748 }(); 5749 /* harmony export (immutable) */ 5750 5751 __webpack_exports__["default"] = LoginSection; 5752 5753 /***/ 5754 }, 5755 /* 40 */ 5756 /***/function (module, __webpack_exports__, __webpack_require__) { 5757 5758 "use strict"; 5759 5760 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5761 5762 var MapSection = function () { 5763 function MapSection(element) { 5764 _classCallCheck(this, MapSection); 5765 5766 this.element = element; 5767 this.options = JSON.parse(element.getAttribute('data-section-settings')); 5768 5769 if (this.options['apiKey'] && this.options['mapAddress']) { 5770 this._loadScript().then(this._initMap.bind(this)); 5771 } 5772 } 5773 5774 _createClass(MapSection, [{ 5775 key: '_loadScript', 5776 value: function _loadScript() { 5777 var _this50 = this; 5778 5779 return new Promise(function (resolve, reject) { 5780 var script = document.createElement('script'); 5781 document.body.appendChild(script); 5782 script.onload = resolve; 5783 script.onerror = reject; 5784 script.async = true;
5785 script.src = 'https://maps.googleapis.com/maps/api/js?key=' + _this50.options['apiKey']; 5786 }); 5787 } 5788 }, { 5789 key: '_initMap', 5790 value: function _initMap() { 5791 var _this51 = this; 5792 5793 var geocoder = new google.maps.Geocoder(); 5794 5795 geocoder.geocode({ address: this.options['mapAddress'] }, function (results, status) { 5796 if (status !== google.maps.GeocoderStatus.OK) { 5797 if (Shopify.designMode) { } 5798 } else { 5799 var mapOptions = { 5800 zoom: _this51.options['zoom'], 5801 center: results[0].geometry.location, 5802 draggable: false, 5803 clickableIcons: false, 5804 scrollwheel: false, 5805 disableDoubleClickZoom: true, 5806 disableDefaultUI: true 5807 }; 5808 5809 var map = new google.maps.Map(_this51.element.querySelector('.FeaturedMap__GMap'), mapOptions), 5810 center = map.getCenter(); 5811 5812 map.setCenter(center); 5813 5814 var icon = { 5815 path: "M32.7374478,5.617 C29.1154478,1.995 24.2994478,0 19.1774478,0 C14.0544478,0 9.23944778,1.995 5.61744778,5.617 C-1.08555222,12.319 -1.91855222,24.929 3.81344778,32.569 L19.1774478,54.757 L34.5184478,32.6 C40.2734478,24.929 39.4404478,12.319 32.7374478,5.617 Z M19.3544478,26 C15.4954478,26 12.3544478,22.859 12.3544478,19 C12.3544478,15.141 15.4954478,12 19.3544478,12 C23.2134478,12 26.3544478,15.141 26.3544478,19 C26.3544478,22.859 23.2134478,26 19.3544478,26 Z", 5816 fillColor: _this51.options['markerColor'], 5817 fillOpacity: 1, 5818 anchor: new google.maps.Point(15, 55), 5819 strokeWeight: 0, 5820 scale: 0.6 5821 }; 5822 5823 new google.maps.Marker({ 5824 map: map, 5825 position: map.getCenter(), 5826 icon: icon 5827 }); 5828 5829 var styledMapType = new google.maps.StyledMapType(JSON.parse(_this51.element.querySelector('[data-gmap-style]').innerHTML)); 5830 5831 map.mapTypes.set('styled_map', styledMapType); 5832 map.setMapTypeId('styled_map'); 5833 5834 google.maps.event.addDomListener(window, 'resize', function () { 5835 google.maps.event.trigger(map, 'resize'); 5836 map.setCenter(center); 5837 }); 5838 } 5839 }); 5840 } 5841 }]); 5842 5843 return MapSection; 5844 }(); 5845 /* harmony export (immutable) */ 5846 5847 __webpack_exports__["default"] = MapSection; 5848 5849 /***/ 5850 }, 5851 /* 41 */ 5852 /***/function (module, __webpack_exports__, __webpack_require__) { 5853 5854 "use strict"; 5855 5856 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5857 5858 var NewsletterPopupSection = function () { 5859 function NewsletterPopupSection(element) { 5860 _classCallCheck(this, NewsletterPopupSection); 5861 5862 this.element = element; 5863 this.delegateElement = new domDelegate.Delegate(this.element); 5864 this.options = JSON.parse(element.getAttribute('data-section-settings')); 5865 5866 // If the popup has been already displayed, we do not display it 5867 try { 5868 if (window.location.hash === '#newsletter-popup') { 5869 this._openPopup(); 5870 } else if (!this.options['showOnlyOnce'] || this.options['showOnlyOnce'] && localStorage.getItem('themePopup') === null) { 5871 setTimeout(this._openPopup.bind(this), this.options['apparitionDelay'] * 1000); 5872 } 5873 } catch (error) { 5874 // Some browsers (especially in private mode) throw an exception when trying to access local storage, so we protect ourselves here 5875 } 5876 5877 this._attachListeners(); 5878 } 5879 5880 _createClass(NewsletterPopupSection, [{ 5881 key: 'onUnload', 5882 value: function onUnload() { 5883 this.delegateElement.off(); 5884 } 5885 }, { 5886 key: 'onSelect', 5887 value: function onSelect() { 5888 this._openPopup(); 5889 } 5890 }, { 5891 key: 'onDeselect', 5892 value: function onDeselect() { 5893 this._closePopup(); 5894 } 5895 }, { 5896 key: '_attachListeners', 5897 value: function _attachListeners() { 5898 this.delegateElement.on('click', '[data-action="close-popup"]', this._closePopup.bind(this)); 5899 } 5900 }, { 5901 key: '_openPopup', 5902 value: function _openPopup() { 5903 this.element.setAttribute('aria-hidden', 'false'); 5904 localStorage.setItem('themePopup', 'true'); 5905 } 5906 }, { 5907 key: '_closePopup', 5908 value: function _closePopup() { 5909 this.element.setAttribute('aria-hidden', 'true'); 5910 } 5911 }]); 5912 5913 return NewsletterPopupSection; 5914 }(); 5915 /* harmony export (immutable) */ 5916 5917 __webpack_exports__["default"] = NewsletterPopupSection; 5918 5919 /***/ 5920 }, 5921 /* 42 */ 5922 /***/function (module, __webpack_exports__, __webpack_require__) { 5923 5924 "use strict"; 5925 5926 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 5927 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 5928 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_ProductVariants__ = __webpack_require__(11); 5929 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__components_ProductImageZoom__ = __webpack_require__(14); 5930 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__components_ProductReviews__ = __webpack_require__(15); 5931 /* harmony import */var __WEBPACK_IMPORTED_MODULE_4__components_ScrollSpy__ = __webpack_require__(17); 5932 /* harmony import */var __WEBPACK_IMPORTED_MODULE_5__helper_Dom__ = __webpack_require__(0); 5933 /* harmony import */var __WEBPACK_IMPORTED_MODULE_6__components_OverflowScroller__ = __webpack_require__(13); 5934 /* harmony import */var __WEBPACK_IMPORTED_MODULE_7__helper_Responsive__ = __webpack_require__(2); 5935 /* harmony import */var __WEBPACK_IMPORTED_MODULE_8__helper__ = __webpack_require__(6); 5936 5937 var ProductSection = function () { 5938 function ProductSection(container) { 5939 _classCallCheck(this, ProductSection); 5940 5941 this.element = container; 5942 this.delegateElement = new domDelegate.Delegate(this.element); 5943 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 5944 5945 this.productVariants = new __WEBPACK_IMPORTED_MODULE_1__components_ProductVariants__["default"](container, this.options); 5946 this.productReviews = new __WEBPACK_IMPORTED_MODULE_3__components_ProductReviews__["default"](container); 5947 5948 var productSlideshowElement = this.element.querySelector('.Product__Slideshow'); 5949 5950 // If there is no image at all, there is nothing to init 5951 if (productSlideshowElement) { 5952 this.productSlideshow = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](productSlideshowElement, { onSelect: this._onImageChanged.bind(this) }); 5953 5954 this.slideshowNavDots = this.element.querySelector('.Product__SlideshowNav--dots'); 5955 this.slideshowNavDotsItems = this.slideshowNavDots ? __WEBPACK_IMPORTED_MODULE_5__helper_Dom__["default"].nodeListToArray(this.slideshowNavDots.querySelectorAll('a')) : []; 5956 5957 if (this.options['showThumbnails']) { 5958 this.slideshowNavThumbnails = this.element.querySelector('.Product__SlideshowNav--thumbn
5958ails'); 5959 this.slideshowNavThumbnailsItems = this.slideshowNavThumbnails ? __WEBPACK_IMPORTED_MODULE_5__helper_Dom__["default"].nodeListToArray(this.slideshowNavThumbnails.querySelectorAll('a')) : []; 5960 } 5961 5962 this.slideshowImages = __WEBPACK_IMPORTED_MODULE_5__helper_Dom__["default"].nodeListToArray(productSlideshowElement.querySelectorAll('.Carousel__Cell')); 5963 } 5964 5965 this.productWrapperElement = this.element.querySelector('.Product__Wrapper'); 5966 this.productInfoElement = this.element.querySelector('.Product__Info'); 5967 this.productAsideElement = this.element.querySelector('.Product__Aside'); 5968 this.quickNav = this.element.querySelector('.Product__QuickNav'); 5969 5970 if (this.options['enableImageZoom']) { 5971 this.imageZoomInstance = new __WEBPACK_IMPORTED_MODULE_2__components_ProductImageZoom__["default"](this.element, this.productSlideshow); 5972 } 5973 5974 Stickyfill.addOne(this.productInfoElement); 5975 5976 this._setupDeviceFeatures(); 5977 this._attachListeners(); 5978 } 5979 5980 _createClass(ProductSection, [{ 5981 key: 'onUnload', 5982 value: function onUnload() { 5983 this.delegateElement.off('click'); 5984 this.productVariants.destroy(); 5985 this.productReviews.destroy(); 5986 5987 if (this.productSlideshow) { 5988 this.productSlideshow.destroy(); 5989 } 5990 5991 if (this.options['enableImageZoom']) { 5992 this.imageZoomInstance.destroy(); 5993 } 5994 5995 if (this.carouselNavScrollSpy) { 5996 this.carouselNavScrollSpy.destroy(); 5997 } 5998 5999 if (this.quickNav) { 6000 window.removeEventListener('scroll', this._checkQuickNavListener); 6001 } 6002 6003 if (this.productInfoScroller) { 6004 this.productInfoScroller.destroy(); 6005 } 6006 6007 if (this.productThumbnailsScroller) { 6008 this.productThumbnailsScroller.destroy(); 6009 } 6010 6011 if (window.ResizeObserver && window.theme.enableExperimentalResizeObserver && this.productInfoResizeObserver) { 6012 this.productInfoResizeObserver.disconnect(); 6013 } 6014 6015 Stickyfill.removeOne(this.productInfoElement); 6016 6017 document.removeEventListener('breakpoint:changed', this._onBreakpointChangedListener); 6018 } 6019 }, { 6020 key: '_attachListeners', 6021 value: function _attachListeners() { 6022 this._onBreakpointChangedListener = this._setupDeviceFeatures.bind(this); 6023 this._checkQuickNavListener = this._checkQuickNav.bind(this); 6024 6025 this.delegateElement.on('click', '[data-action="toggle-social-share"]', this._toggleSocialShare.bind(this)); 6026 this.delegateElement.on('variant:changed', this._updateSlideshowImage.bind(this)); 6027 this.delegateElement.on('scrollspy:target:changed', this._onScrollTargetChanged.bind(this)); 6028 6029 document.addEventListener('breakpoint:changed', this._onBreakpointChangedListener); 6030 6031 if (this.quickNav) { 6032 window.addEventListener('scroll', this._checkQuickNavListener); 6033 } 6034 } 6035 6036 /** 6037 * Update the main carousel image 6038 */ 6039 6040 }, { 6041 key: '_updateSlideshowImage', 6042 value: function _updateSlideshowImage(event) { 6043 var variant = event.detail.variant, 6044 previousVariant = event.detail.previousVariant; 6045 6046 if (!variant || !variant['featured_image'] || previousVariant && previousVariant['featured_image'] && previousVariant['featured_image']['id'] === variant['featured_image']['id']) { 6047 return; 6048 } 6049 6050 // Using image['position'] has always been unreliable. Further more in this theme we allow some images to be featured and not be part of 6051 // the main carousel, so the position can be simply wrong. 6052 // We have two logic here: if we are on pocket mode, we switch using the carousel, otherwise we simulate a link to the anchor 6053 6054 if (__WEBPACK_IMPORTED_MODULE_8__helper__["ResponsiveHelper"].matchesBreakpoint('pocket')) { 6055 for (var i = 0; i !== this.productSlideshow.flickityInstance.cells.length; ++i) { 6056 var cellElement = this.productSlideshow.flickityInstance.cells[i].element, 6057 imageId = parseInt(cellElement.getAttribute('data-image-id')); 6058 6059 if (imageId === variant['featured_image']['id']) { 6060 this.productSlideshow.selectCell(parseInt(cellElement.getAttribute('data-image-position'))); 6061 } 6062 } 6063 } else { 6064 document.querySelector('[href="#Image' + variant['featured_image']['id'] + '"]').click(); 6065 //document.getElementById(`Image${variant['featured_image']['id']}`).scrollIntoView(); For now there is a bug in Chrome that prevents to use this 6066 } 6067 } 6068 6069 /** 6070 * Callback when the target changes 6071 */ 6072 6073 }, { 6074 key: '_onScrollTargetChanged', 6075 value: function _onScrollTargetChanged(event) { 6076 // The scrollspy emit also an "oldTarget", but when scrolling very fast with Firefox or Safari, it prevents the old to be removed, so we 6077 // manually iterate through all of them to remove it first
6078 this.slideshowNavDotsItems.forEach(function (item) { 6079 return item.classList.remove('is-selected'); 6080 }); 6081 this.slideshowNavDotsItems[parseInt(event.detail.newTarget.getAttribute('data-image-position'))].classList.add('is-selected'); 6082 6083 if (this.options['showThumbnails']) { 6084 this.slideshowNavThumbnailsItems.forEach(function (item) { 6085 return item.classList.remove('is-selected'); 6086 }); 6087 this.slideshowNavThumbnailsItems[parseInt(event.detail.newTarget.getAttribute('data-image-position'))].classList.add('is-selected'); 6088 } 6089 } 6090 6091 /** 6092 * Check the quick nav 6093 */ 6094 6095 }, { 6096 key: '_checkQuickNav', 6097 value: function _checkQuickNav() { 6098 var _this52 = this; 6099 6100 var showAsideQuickNav = false; 6101 6102 fastdom.measure(function () { 6103 showAsideQuickNav = window.scrollY >= _this52.productAsideElement.offsetTop - _this52.productAsideElement.clientHeight; 6104 }); 6105 6106 fastdom.mutate(function () { 6107 if (showAsideQuickNav) { 6108 _this52.quickNav.classList.add('is-flipped'); 6109 } else { 6110 _this52.quickNav.classList.remove('is-flipped'); 6111 } 6112 }); 6113 } 6114 6115 /** 6116 * Toggle the social share icons 6117 */ 6118 6119 }, { 6120 key: '_toggleSocialShare', 6121 value: function _toggleSocialShare(event, target) { 6122 target.classList.toggle('is-active'); 6123 target.classList.toggle('RoundButton--secondaryState'); 6124 6125 target.setAttribute('aria-expanded', target.getAttribute('aria-expanded') === 'true' ? 'false' : 'true'); 6126 target.nextElementSibling.setAttribute('aria-hidden', target.nextElementSibling.getAttribute('aria-hidden') === 'true' ? 'false' : 'true'); 6127 } 6128 }, { 6129 key: '_onImageChanged', 6130 value: function _onImageChanged(event, cell) { 6131 if (!__WEBPACK_IMPORTED_MODULE_8__helper__["ResponsiveHelper"].matchesBreakpoint('pocket')) { 6132 return; 6133 } 6134 6135 // If cell is video, we hide the action list 6136 var productGalleryActionListElement = this.element.querySelector('.Product__Gallery .Product__ActionList'); 6137 6138 if (productGalleryActionListElement) { 6139 if (cell.classList.contains('Product__SlideItem--video')) { 6140 productGalleryActionListElement.classList.add('is-hidden'); 6141 } else { 6142 productGalleryActionListElement.classList.remove('is-hidden'); 6143 } 6144 } 6145 } 6146 6147 /** 6148 * Verify when the screen size changes to create additional stuff on non pocket mode 6149 */ 6150 6151 }, { 6152 key: '_setupDeviceFeatures', 6153 value: function _setupDeviceFeatures(event) { 6154 var _this53 = this; 6155 6156 var currentBreakpoint = event ? event.detail.currentBreakpoint : __WEBPACK_IMPORTED_MODULE_8__helper__["ResponsiveHelper"].getCurrentBreakpoint(), 6157 previousBreakpoint = event ? event.detail.previousBreakpoint : null; 6158 6159 if (currentBreakpoint === previousBreakpoint) { 6160 return; // Nothing has changed, no specific setup to do 6161 } 6162 6163 if (currentBreakpoint === 'phone' || currentBreakpoint === 'tablet') { 6164 if (this.carouselNavScrollSpy) { 6165 this.carouselNavScrollSpy.destroy(); 6166 } 6167 6168 if (this.productInfoScroller) { 6169 this.productInfoScroller.destroy(); 6170 } 6171 6172 if (this.productThumbnailsScroller) { 6173 this.productThumbnailsScroller.destroy(); 6174 } 6175 6176 if (this.productAsideElement) { 6177 this.productAsideElement.style.minHeight = null; 6178 } else { 6179 this.productWrapperElement.style.minHeight = null; 6180 } 6181 6182 this.productInfoElement.parentNode.style.maxHeight = null; 6183 } else { 6184 // 1st: scrollspy for the dots and image 6185 if (this.slideshowImages && this.slideshowImages.length > 1) { 6186 var offsetTop = this.slideshowNavDots.firstElementChild.offsetTop; 6187 6188 if (this.options['showThumbnails'] && __WEBPACK_IMPORTED_MODULE_8__helper__["ResponsiveHelper"].matchesBreakpoint('desk')) { 6189 offsetTop = 250; 6190 } 6191 6192 this.carouselNavScrollSpy = new __WEBPACK_IMPORTED_MODULE_4__components_ScrollSpy__["default"](this.element, this.slideshowImages, { 6193 rootMargin: '-' + offsetTop + 'px 0px 0px 0px' 6194 }); 6195 } 6196 6197 var productInfoStyles = window.getComputedStyle(this.productInfoElement), 6198 productInfoPadding = parseInt(productInfoStyles.paddingTop) + parseInt(productInfoStyles.paddingBottom); 6199 6200 // 2nd: making sure to set up enough space in aside part 6201 var calculateMinHeight = function calculateMinHeight() { 6202 if (_this53.productAsideElement) { 6203 _this53.productAsideElement.style.minHeight = _this53.productInfoElement.scrollHeight - productInfoPadding + 'px'; 6204 _this53.productInfoElement.closest('.Product__InfoWrapper').style.maxHeight = _this53.productAsideElement.offsetTop + _this53.productInfoElement.scrollHeight - productInfoPadding + 'px'; 6205 } else { 6206 _this53.productWrapperElement.style.minHeight = _this53.productInfoElement.scrollHeight - parseInt(productInfoStyles.paddingTop) + 'px'; 6207 } 6208 }; 6209 6210 calculateMinHeight(); 6211 6212 // This code actually works well, but if a merchant is using an app that dynamically adds content (such as ReCharge or any other widget-based app), this 6213 // will mess the min height. There is a clean solution to this issue, which is by using ResizeObserver. However it's only supported in Chrome for now, 6214 // but I feel it's already good to have a clean fix 6215 if (window.ResizeObserver && window.theme.enableExperimentalResizeObserver) { 6216 this.productInfoResizeObserver = new ResizeObserver(function () { 6217 calculateMinHeight(); // We currently do not take advantage of the values returned by the observer as our calculation depends on other values 6218 }); 6219 6220 this.productInfoResizeObserver.observe(this.productInfoElement); 6221 } 6222 6223 // 3rd: let's handle the scroll for the product info 6224 this.productInfoScroller = new __WEBPACK_IMPORTED_MODULE_6__components_OverflowScroller__["default"](this.productInfoElement); 6225 6226 // 4th: let's handle the scroll for the thumbnails 6227 if (this.options['showThumbnails'] && this.slideshowNavThumbnails) {
6228 this.productThumbnailsScroller = new __WEBPACK_IMPORTED_MODULE_6__components_OverflowScroller__["default"](this.slideshowNavThumbnails); 6229 } 6230 } 6231 } 6232 }]); 6233 6234 return ProductSection; 6235 }(); 6236 /* harmony export (immutable) */ 6237 6238 __webpack_exports__["default"] = ProductSection; 6239 6240 /***/ 6241 }, 6242 /* 43 */ 6243 /***/function (module, __webpack_exports__, __webpack_require__) { 6244 6245 "use strict"; 6246 6247 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6248 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 6249 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__ = __webpack_require__(4); 6250 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Currency__ = __webpack_require__(5); 6251 6252 var RecentlyViewedProductsSection = function () { 6253 function RecentlyViewedProductsSection(container) { 6254 _classCallCheck(this, RecentlyViewedProductsSection); 6255 6256 this.element = container; 6257 this.options = JSON.parse(this.element.getAttribute('data-section-settings')); 6258 6259 if (this.options['productId']) { 6260 this._saveProduct(this.options['productId']); 6261 } 6262 6263 // Setup product item color swatch 6264 new __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__["default"](this.element); 6265 6266 this._fetchProducts(); 6267 } 6268 6269 _createClass(RecentlyViewedProductsSection, [{ 6270 key: 'onUnload', 6271 value: function onUnload() { 6272 if (this.carousel) { 6273 this.carousel.destroy(); 6274 } 6275 } 6276 6277 /** 6278 * When we are on a product page, we need to save the current product into local storage 6279 */ 6280 6281 }, { 6282 key: '_saveProduct', 6283 value: function _saveProduct(productId) { 6284 var items = JSON.parse(localStorage.getItem('recentlyViewedProducts') || '[]'); 6285 6286 // We check if the current product already exists, and if it does not, we add it at the start 6287 if (!items.includes(productId)) { 6288 items.unshift(productId); 6289 } 6290 6291 // Then, we save the current product into the local storage, by keeping only the 8 most recent 6292 try { 6293 localStorage.setItem('recentlyViewedProducts', JSON.stringify(items.slice(0, 8))); 6294 } catch (error) { 6295 // Do nothing, this may happen in Safari in incognito mode 6296 } 6297 } 6298 6299 /** 6300 * In order to get the products to display, we hit the search template with the given IDS 6301 */ 6302 6303 }, { 6304 key: '_fetchProducts', 6305 value: function _fetchProducts() { 6306 var _this54 = this; 6307 6308 var queryString = this._getSearchQueryString(); 6309 6310 if (queryString === '') { 6311 return; 6312 } 6313 6314 // If we have a non empty query string we do a search query 6315 fetch('/search?view=recently-viewed-products&type=product&q=' + queryString, { 6316 credentials: 'same-origin', 6317 method: 'GET' 6318 }).then(function (response) { 6319 response.text().then(function (content) { 6320 var tempElement = document.createElement('div'); 6321 tempElement.innerHTML = content; 6322 6323 // Set the content 6324 _this54.element.innerHTML = tempElement.querySelector('.Section').innerHTML; 6325 6326 // Show the section 6327 _this54.element.parentNode.style.display = 'block'; 6328 6329 // Convert any amount (if applicable) 6330 if (window.theme.currencyConversionEnabled) { 6331 __WEBPACK_IMPORTED_MODULE_2__helper_Currency__["default"].convertAll(_this54.element); 6332 } 6333 6334 // And finally let's create the carousel ! 6335 _this54.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](_this54.element.querySelector('[data-flickity-config]')); 6336 }); 6337 }); 6338 } 6339 }, { 6340 key: '_getSearchQueryString', 6341 value: function _getSearchQueryString() { 6342 var items = JSON.parse(localStorage.getItem('recentlyViewedProducts') || '[]'); 6343 6344 // If we are on a product template, we make sure to remove the main product from the related product 6345 if (items.includes(this.options['productId'])) { 6346 items.splice(items.indexOf(this.options['productId']), 1); 6347 } 6348 6349 return items.map(function (item) { 6350 return 'id:' + item; 6351 }).join(' OR '); 6352 } 6353 }]); 6354 6355 return RecentlyViewedProductsSection; 6356 }(); 6357 /* harmony export (immutable) */ 6358 6359 __webpack_exports__["default"] = RecentlyViewedProductsSection; 6360 6361 /***/ 6362 }, 6363 /* 44 */ 6364 /***/function (module, __webpack_exports__, __webpack_require__) { 6365 6366 "use strict"; 6367 6368 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6369 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 6370 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__ = __webpack_require__(4); 6371 6372 var RelatedProductsSection = function () { 6373 function RelatedProductsSection(container) { 6374 _classCallCheck(this, RelatedProductsSection); 6375 6376 this.element = container; 6377 this.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('[data-flickity-config]')); 6378 6379 // Setup product item color swatch 6380 new __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__["default"](this.element); 6381 } 6382 6383 _createClass(RelatedProductsSection, [{ 6384 key: 'onUnload', 6385 value: function onUnload() { 6386 this.carousel.destroy(); 6387 } 6388 }]); 6389 6390 return RelatedProductsSection; 6391 }(); 6392 /* harmony export (immutable) */ 6393 6394 __webpack_exports__["default"] = RelatedProductsSection; 6395 6396 /***/ 6397 }, 6398 /* 45 */ 6399 /***/function (module, __webpack_exports__, __webpack_require__) { 6400 6401 "use strict"; 6402 6403 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6404 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 6405 6406 var SearchSection = function () { 6407 function SearchSection(container) { 6408 _classCallCheck(this, SearchSection); 6409 6410 this.element = container; 6411 this.delegateElement = new domDelegate.Delegate(this.element); 6412 6413 this._setupAnimation(); 6414 } 6415 6416 _createClass(SearchSection, [{ 6417 key: 'onUnload', 6418 value: function onUnload() { 6419 this.intersectionObserver.disconnect(); 6420 this.timeline.kill(); 6421 } 6422 }, { 6423 key: '_setupAnimation', 6424 value: function _setupAnimation() { 6425 var _this55 = this; 6426 6427 if (this.intersectionObserver) { 6428 this.intersectionObserver.disconnect(); 6429 } 6430 6431 this.timeline = new TimelineLite({ delay: 0.5 }); 6432 6433 if (window.theme.showElementStaggering) { 6434 this.intersectionObserver = new IntersectionObserver(this._reveal.bind(this)); 6435 6436 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.ProductList .ProductItem, .ArticleList .ArticleItem')).forEac
6436h(function (item) { 6437 _this55.intersectionObserver.observe(item); 6438 }); 6439 } 6440 } 6441 }, { 6442 key: '_reveal', 6443 value: function _reveal(results) { 6444 var _this56 = this; 6445 6446 var toReveal = []; 6447 6448 results.forEach(function (result) { 6449 if (result.isIntersecting || result.intersectionRatio > 0) { 6450 // isIntersecting does not exist on Samsung Android browser 6451 toReveal.push(result.target); 6452 _this56.intersectionObserver.unobserve(result.target); 6453 } 6454 }); 6455 6456 if (toReveal.length === 0) { 6457 return; 6458 } 6459 6460 this.timeline.staggerFromTo(toReveal, 0.6, { autoAlpha: 0, y: 25 }, { autoAlpha: 1, y: 0 }, 0.2); 6461 } 6462 }]); 6463 6464 return SearchSection; 6465 }(); 6466 /* harmony export (immutable) */ 6467 6468 __webpack_exports__["default"] = SearchSection; 6469 6470 /***/ 6471 }, 6472 /* 46 */ 6473 /***/function (module, __webpack_exports__, __webpack_require__) { 6474 6475 "use strict"; 6476 6477 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6478 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 6479 6480 /** 6481 * This code is extracted from Slate 6482 */ 6483 6484 var SectionContainer = function () { 6485 function SectionContainer() { 6486 _classCallCheck(this, SectionContainer); 6487 6488 this.constructors = []; 6489 this.instances = []; 6490 6491 this._attachListeners(); 6492 } 6493 6494 _createClass(SectionContainer, [{ 6495 key: '_attachListeners', 6496 value: function _attachListeners() { 6497 document.addEventListener('shopify:section:load', this._onSectionLoad.bind(this)); 6498 document.addEventListener('shopify:section:unload', this._onSectionUnload.bind(this)); 6499 document.addEventListener('shopify:section:select', this._onSelect.bind(this)); 6500 document.addEventListener('shopify:section:deselect', this._onDeselect.bind(this)); 6501 document.addEventListener('shopify:section:reorder', this._onReorder.bind(this)); 6502 document.addEventListener('shopify:block:select', this._onBlockSelect.bind(this)); 6503 document.addEventListener('shopify:block:deselect', this._onBlockDeselect.bind(this)); 6504 } 6505 }, { 6506 key: 'register', 6507 value: function register(type, constructor) { 6508 var _this57 = this; 6509 6510 this.constructors[type] = constructor; 6511 6512 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(document.querySelectorAll('[data-section-type=' + type + ']')).forEach(function (container) { 6513 _this57._createInstance(container, constructor); 6514 }); 6515 } 6516 6517 /** 6518 * Return an object from an array of objects that matches the provided key and value 6519 */ 6520 6521 }, { 6522 key: '_findInstance', 6523 value: function _findInstance(array, key, value) { 6524 for (var i = 0; i < array.length; i++) { 6525 if (array[i][key] === value) { 6526 return array[i]; 6527 } 6528 } 6529 } 6530 6531 /** 6532 * Remove an object from an array of objects by matching the provided key and value 6533 */ 6534 6535 }, { 6536 key: '_removeInstance', 6537 value: function _removeInstance(array, key, value) { 6538 var i = array.length; 6539 6540 while (i--) { 6541 if (array[i][key] === value) { 6542 array.splice(i, 1); 6543 break; 6544 } 6545 } 6546 6547 return array; 6548 } 6549 }, { 6550 key: '_onSectionLoad', 6551 value: function _onSectionLoad(event) { 6552 var container = event.target.querySelector('[data-section-id]'); 6553 6554 if (container) { 6555 this._createInstance(container); 6556 } 6557 } 6558 }, { 6559 key: '_onSectionUnload', 6560 value: function _onSectionUnload(event) { 6561 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6562 6563 if (!instance) { 6564 return; 6565 } 6566 6567 if (typeof instance.onUnload === 'function') { 6568 instance.onUnload(event); 6569 } 6570 6571 this.instances = this._removeInstance(this.instances, 'id', event.detail.sectionId); 6572 } 6573 }, { 6574 key: '_onSelect', 6575 value: function _onSelect(event) { 6576 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6577 6578 if (instance && typeof instance.onSelect === 'function') { 6579 instance.onSelect(event); 6580 } 6581 } 6582 }, { 6583 key: '_onDeselect', 6584 value: function _onDeselect(event) { 6585 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6586 6587 if (instance && typeof instance.onDeselect === 'function') { 6588 instance.onDeselect(event); 6589 } 6590 } 6591 }, { 6592 key: '_onReorder', 6593 value: function _onReorder(event) { 6594 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6595 6596 if (instance && typeof instance.onReorder === 'function') { 6597 instance.onReorder(event); 6598 } 6599 } 6600 }, { 6601 key: '_onBlockSelect', 6602 value: function _onBlockSelect(event) { 6603 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6604 6605 if (instance && typeof instance.onBlockSelect === 'function') { 6606 instance.onBlockSelect(event); 6607 } 6608 } 6609 }, { 6610 key: '_onBlockDeselect', 6611 value: function _onBlockDeselect(event) { 6612 var instance = this._findInstance(this.instances, 'id', event.detail.sectionId); 6613 6614 if (instance && typeof instance.onBlockDeselect === 'function') { 6615 instance.onBlockDeselect(event); 6616 } 6617 } 6618 }, { 6619 key: '_createInstance', 6620 value: function _createInstance(container, constructor) { 6621 var id = container.getAttribute('data-section-id'), 6622 type = container.getAttribute('data-section-type'); 6623 6624 constructor = constructor || this.constructors[type]; 6625 6626 if (typeof constructor === 'undefined') { 6627 return; 6628 } 6629 6630 var instance = Object.assign(new constructor(container), {
6631 id: id, 6632 type: type, 6633 container: container 6634 }); 6635 6636 this.instances.push(instance); 6637 } 6638 }]); 6639 6640 return SectionContainer; 6641 }(); 6642 /* harmony export (immutable) */ 6643 6644 __webpack_exports__["default"] = SectionContainer; 6645 6646 /***/ 6647 }, 6648 /* 47 */ 6649 /***/function (module, __webpack_exports__, __webpack_require__) { 6650 6651 "use strict"; 6652 6653 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6654 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 6655 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__ = __webpack_require__(4); 6656 6657 var ShopNowSection = function () { 6658 function ShopNowSection(container) { 6659 _classCallCheck(this, ShopNowSection); 6660 6661 this.element = container; 6662 this.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('[data-flickity-config]')); 6663 6664 // Setup product item color swatch 6665 new __WEBPACK_IMPORTED_MODULE_1__components_ProductItemColorSwatch__["default"](this.element); 6666 } 6667 6668 _createClass(ShopNowSection, [{ 6669 key: 'onUnload', 6670 value: function onUnload() { 6671 this.carousel.destroy(); 6672 } 6673 }]); 6674 6675 return ShopNowSection; 6676 }(); 6677 /* harmony export (immutable) */ 6678 6679 __webpack_exports__["default"] = ShopNowSection; 6680 6681 /***/ 6682 }, 6683 /* 48 */ 6684 /***/function (module, __webpack_exports__, __webpack_require__) { 6685 6686 "use strict"; 6687 6688 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6689 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 6690 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__components_Popover__ = __webpack_require__(9); 6691 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Dom__ = __webpack_require__(0); 6692 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__helper_Responsive__ = __webpack_require__(2); 6693 6694 var ShopTheLookSection = function () { 6695 function ShopTheLookSection(container) { 6696 _classCallCheck(this, ShopTheLookSection); 6697 6698 this.element = container; 6699 this.delegateElement = new domDelegate.Delegate(this.element); 6700 this.usePocketMode = __WEBPACK_IMPORTED_MODULE_3__helper_Responsive__["default"].matchesBreakpoint('pocket'); 6701 this.pocketActivatorButton = this.element.querySelector('[data-action="open-look"]'); 6702 6703 this._createOuterCarousel(); 6704 this._createPocketPopovers(); 6705 6706 this._attachListeners(); 6707 } 6708 6709 _createClass(ShopTheLookSection, [{ 6710 key: 'onUnload', 6711 value: function onUnload() { 6712 this.outerCarousel.destroy(); 6713 this.innerCarousels.forEach(function (item) { 6714 item.forEach(function (innerItem) { 6715 return innerItem.destroy(); 6716 }); 6717 }); 6718 6719 this.popovers.forEach(function (item) { 6720 return item.destroy(); 6721 }); 6722 6723 this.delegateElement.off(); 6724 } 6725 }, { 6726 key: 'onBlockSelect', 6727 value: function onBlockSelect(event) { 6728 this.outerCarousel.selectCell(event.target.getAttribute('data-slide-index'), true, !event.detail.load); 6729 } 6730 6731 /** 6732 * Attach all the listeners 6733 */ 6734 6735 }, { 6736 key: '_attachListeners', 6737 value: function _attachListeners() { 6738 this.delegateElement.on('click', '.ShopTheLook__Dot', this._onDotClicked.bind(this)); 6739 } 6740 6741 /** 6742 * There is one mobile and tablet popover per look, so we pre-create them 6743 */ 6744 6745 }, { 6746 key: '_createPocketPopovers', 6747 value: function _createPocketPopovers() { 6748 var _this58 = this; 6749 6750 this.popovers = []; 6751 6752 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.Popover')).forEac
6752h(function (popover) { 6753 _this58.popovers.push(new __WEBPACK_IMPORTED_MODULE_1__components_Popover__["default"](popover, { 6754 activator: _this58.pocketActivatorButton, 6755 showOverlay: false, 6756 onOpen: _this58._openPocketZoom.bind(_this58), 6757 onClose: _this58._closePocketZoom.bind(_this58) 6758 })); 6759 }); 6760 } 6761 6762 /** 6763 * The outer carousel is the carousel that holds the main one (all the looks). Internally, it also creates 6764 * a sub-carousel for each inner carousel 6765 */ 6766 6767 }, { 6768 key: '_createOuterCarousel', 6769 value: function _createOuterCarousel() { 6770 var _this59 = this; 6771 6772 this.outerCarousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('.ShopTheLook'), { 6773 onSelect: this._onLookChanged.bind(this) 6774 }); 6775 6776 this.innerCarousels = new Array(this.outerCarousel.flickityInstance.cells.length); 6777 6778 for (var i = 0; i !== this.innerCarousels.length; ++i) { 6779 this.innerCarousels[i] = []; 6780 } 6781 6782 // We need to create ALL the carousels (both in desktop and mobile). Fortunately Flickity is quite fast, but 6783 // we have no other choices if we want to have proper animations everywhere. 6784 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.ShopTheLook__ProductList')).forEac
6784h(function (item) { 6785 var lookIndex = parseInt(item.getAttribute('data-look-index')); 6786 _this59.innerCarousels[lookIndex].push(new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](item, { onSelect: _this59._onProductChanged.bind(_this59) })); 6787 6788 // By default, Flickity will append the carousel, hence making the "ViewButton" before the carousel. We need to manipulate it to move it after 6789 item.insertBefore(item.querySelector('.flickity-viewport'), item.querySelector('.ShopTheLook__ViewButton')); 6790 }); 6791 6792 this.outerCarousel.resize(); // Needed in case the products are taller than the image 6793 } 6794 6795 /** 6796 * This function is called whenever the main look has changed, so that we can modify the popover activator 6797 */ 6798 6799 }, { 6800 key: '_onLookChanged', 6801 value: function _onLookChanged(selectedIndex, selectedCell) { 6802 // Then, we update the mobile button so that it opens the correct block 6803 this.pocketActivatorButton.setAttribute('aria-controls', selectedCell.getAttribute('id') + '-popover'); 6804 } 6805 6806 /** 6807 * This function is called whenever a product is changed in the list for a given look. This allows to focus the main dot 6808 */ 6809 6810 }, { 6811 key: '_onProductChanged', 6812 value: function _onProductChanged(selectedIndex, selectedCell) { 6813 var lookItem = this.outerCarousel.getSelectedCell(), 6814 activeDot = null; 6815 6816 __WEBPACK_IMPORTED_MODULE_2__helper_Dom__["default"].nodeListToArray(lookItem.querySelectorAll('.ShopTheLook__Dot')).forEach(function (dot, index) { 6817 dot.classList.remove('is-active'); // IE11 and lower does not support "toggle" with second parameter :( 6818 6819 if (index === selectedIndex) { 6820 dot.classList.add('is-active'); 6821 activeDot = dot; 6822 } 6823 }); 6824 6825 // Update the link to the product (if using the desktop view) 6826 lookItem.querySelector('.ShopTheLook__ViewButton').setAttribute('href', selectedCell.getAttribute('data-product-url')); 6827 6828 // We trigger an event so that when the dot change we can recalculate the position 6829 lookItem.dispatchEvent(new CustomEvent('product:changed', { detail: { dot: activeDot } })); 6830 } 6831 6832 /** 6833 * This function is called whenever you explicitly click on a dot. 6834 * 6835 * On mobile and tablet, this must open the appropriate popver 6836 */ 6837 6838 }, { 6839 key: '_onDotClicked', 6840 value: function _onDotClicked(event, target) { 6841 var shouldAnimateCarousel = false, 6842 hasOnePopoverOpen = false, 6843 lookIndex = this.outerCarousel.getSelectedIndex(); 6844 6845 this.popovers.forEach(function (item) { 6846 if (item.isOpen) { 6847 hasOnePopoverOpen = true; 6848 shouldAnimateCarousel = true; 6849 } 6850 }); 6851 6852 // Each inner carousel has a mobile AND desktop version, so we change both 6853 this.innerCarousels[lookIndex].forEach(function (innerCarousel) { 6854 innerCarousel.selectCell(parseInt(target.getAttribute('data-product-index')) - 1, false, shouldAnimateCarousel); 6855 }); 6856 6857 if (this.usePocketMode && !hasOnePopoverOpen) { 6858 this.popovers[lookIndex].open(); 6859 } 6860 } 6861 6862 /** 6863 * This is called when, on mobile, the popover is open. We must open the image in full resolution 6864 */ 6865 6866 }, { 6867 key: '_openPocketZoom', 6868 value: function _openPocketZoom(popover) { 6869 var _this60 = this; 6870 6871 this._calculateImageTransform(popover); 6872 6873 fastdom.mutate(function () { 6874 // We need to animate the header to avoid a slightly ugly effect if image overlap the header 6875 document.getElementById('shopify-section-header').style.cssText = 'transform: translateY(-100%); transition: transform 0.3s ease-in-out;'; 6876 6877 _this60.outerCarousel.flickityInstance.unbindDrag(); // Prevent changing the active slide 6878 _this60.outerCarousel.flickityInstance.element.classList.add('is-zoomed'); 6879 _this60.outerCarousel.getSelectedCell().classList.add('is-expanded'); 6880 }); 6881 } 6882 6883 /** 6884 * When the mobile zoom is open, and whenever the active dot changes, we need to potentially re-calculate the transform 6885 */ 6886 6887 }, { 6888 key: '_calculateImageTransform', 6889 value: function _calculateImageTransform(openPopover) { 6890 var _this61 = this; 6891 6892 var selectedCell = this.outerCarousel.getSelectedCell(); 6893 6894 fastdom.measure(function () { 6895 // We first need to compute the initial transform and scale factor 6896 var scale = window.innerWidth / (selectedCell.offsetWidth - parseInt(window.getComputedStyle(selectedCell).paddingLeft) * 2), 6897 heightAfterScale = Math.round(selectedCell.offsetHeight * scale), 6898 // Height of the selected cell once the scale transform is applied 6899 hiddenImageHeight = Math.round(Math.max(heightAfterScale - (window.innerHeight - openPopover.element.offsetHeight), 0)), 6900 // Part of image that is below popover 6901 visibleImageHeight = heightAfterScale - hiddenImageHeight, 6902 // Part of the image that is visible in the viewport 6903 minTranslateY = Math.round(-(selectedCell.getBoundingClientRect().top - (heightAfterScale - selectedCell.offsetHeight) / 2)), 6904 // The minimum translate Y transform allowed so that image is visible 6905 maxTranslateY = Math.round(minTranslateY - hiddenImageHeight); // The maximum translate Y transform allowed so that image is visible 6906 6907 _this61._calculateTransformForDotListener = function (event) { 6908 var dotTopPosition = Math.round((event.detail.dot.offsetTop + event.detail.dot.offsetHeight / 2) * scale), 6909 offsetToMove = Math.round(dotTopPosition - visibleImageHeight / 2), 6910 translateY = Math.min(Math.max(minTranslateY - offsetToMove, maxTranslateY), minTranslateY); 6911 6912 fastdom.mutate(function () { 6913 _this61.outerCarousel.flickityInstance.viewport.style.transform = 'translate3d(0, ' + Math.round(translateY) + 'px, 0) scale(' + scale + ')'; 6914 }); 6915 }; 6916 6917 // We manually generate an event the first time to trigger the positioning 6918 6919 selectedCell.addEventListener('product:changed', _this61._calculateTransformForDotListener); 6920 selectedCell.dispatchEvent(new CustomEvent('product:changed', { 6921 detail: { dot: selectedCell.querySelector('.ShopTheLook__Dot.is-active') } 6922 })); 6923 }); 6924 } 6925 6926 /** 6927 * Close the mobile zoom (which close the popover and remove any transform 6928 */ 6929 6930 }, { 6931 key: '_closePocketZoom', 6932 value: function _closePocketZoom() { 6933 var _this62 = this; 6934 6935 var selectedCell = this.outerCarousel.getSelectedCell(); 6936 6937 selectedCell.removeEventListener('product:changed', this._calculateTransformForDotListener); 6938 6939 fastdom.mutate(function () { 6940 document.getElementById('shopify-section-header').style.cssText = 'transform: translateY(0); transition: transform 0.3s ease-in-out 0.3s;'; 6941 6942 _this62.outerCarousel.flickityInstance.bindDrag(); 6943 _this62.outerCarousel.flickityInstance.element.classList.remove('is-zoomed'); 6944 _this62.outerCarousel.flickityInstance.viewport.style.transform = null; 6945 6946 selectedCell.classList.remove('is-expanded'); 6947 }); 6948 } 6949 }]); 6950 6951 return ShopTheLookSection; 6952 }(); 6953 /* harmony export (immutable) */ 6954 6955 __webpack_exports__["default"] = ShopTheLookSection; 6956 6957 /***/ 6958 }, 6959 /* 49 */ 6960 /***/function (module, __webpack_exports__, __webpack_require__) { 6961 6962 "use strict"; 6963 6964 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 6965 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Drawer__ = __webpack_require__(8); 6966 6967 var SidebarMenuSection = function () { 6968 function SidebarMenuSection(container) { 6969 _classCallCheck(this, SidebarMenuSection); 6970 6971 this.element = container; 6972 this.sidebarDrawer = new __WEBPACK_IMPORTED_MODULE_0__components_Drawer__["default"](container); 6973 } 6974 6975 _createClass(SidebarMenuSection, [{ 6976 key: 'onUnload', 6977 value: function onUnload() { 6978 this.sidebarDrawer.destroy(); 6979 } 6980 }, { 6981 key: 'onSelect', 6982 value: function onSelect() { 6983 this.sidebarDrawer.open(); 6984 } 6985 }, { 6986 key: 'onDeselect', 6987 value: function onDeselect() { 6988 this.sidebarDrawer.close(); 6989 } 6990 }]); 6991 6992 return SidebarMenuSection; 6993 }(); 6994 /* harmony export (immutable) */ 6995 6996 __webpack_exports__["default"] = SidebarMenuSection; 6997 6998 /***/ 6999 }, 7000 /* 50 */ 7001 /***/function (module, __webpack_exports__, __webpack_require__) { 7002 7003 "use strict"; 7004 7005 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 7006 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 7007 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 7008 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__ = __webpack_require__(2); 7009 7010 var SlideshowSection = function () { 7011 function SlideshowSection(container) { 7012 _classCallCheck(this, SlideshowSection); 7013 7014 this.element = container; 7015 this.delegateElement = new domDelegate.Delegate(this.element); 7016 this.slideshow = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('[data-flickity-config]'), { onSelect: this._onSlideChanged.bind(this) }); 7017 this.selectedSlide = null; 7018 this.shouldAnimate = true; 7019 this.timeline = new TimelineLite({ delay: window.theme.showPageTransition ? 0.5 : 0 }); 7020 7021 if (this.slideshow.flickityInstance.cells.length > 0) { 7022 this._transitionToSlide(this.slideshow.flickityInstance.selectedCell.element, true); 7023 } 7024 7025 this._attachListeners(); 7026 } 7027 7028 _createClass(SlideshowSection, [{ 7029 key: 'onUnload', 7030 value: function onUnload() { 7031 this.slideshow.destroy(); 7032 this.timeline.kill(); 7033 this.delegateElement.off(); 7034 7035 document.removeEventListener('breakpoint:changed', this._onBreakpointChangedListener); 7036 } 7037 }, { 7038 key: 'onBlockSelect', 7039 value: function onBlockSelect(event) { 7040 if (this.slideshow.flickityInstance.options.autoPlay) { 7041 this.slideshow.flickityInstance.stopPlayer(); 7042 } 7043 7044 this.shouldAnimate = !event.detail.load; 7045 this.slideshow.selectCell(event.target.getAttribute('data-sli
7045de-index'), false, !event.detail.load); 7046 } 7047 }, { 7048 key: 'onBlockDeselect', 7049 value: function onBlockDeselect() { 7050 this.shouldAnimate = true; 7051 7052 if (this.slideshow.flickityInstance.options.autoPlay) { 7053 this.slideshow.flickityInstance.playPlayer(); 7054 } 7055 } 7056 }, { 7057 key: '_attachListeners', 7058 value: function _attachListeners() { 7059 this._onBreakpointChangedListener = this._onBreakpointChanged.bind(this); 7060 7061 this.delegateElement.on('mouseenter', '.Button', this._pauseSlideshow.bind(this), true); 7062 this.delegateElement.on('mouseleave', '.Button', this._resumeSlideshow.bind(this), true); 7063 7064 document.addEventListener('breakpoint:changed', this._onBreakpointChangedListener); 7065 } 7066 }, { 7067 key: '_pauseSlideshow', 7068 value: function _pauseSlideshow() { 7069 if (this.slideshow.flickityInstance.options.autoPlay) { 7070 this.slideshow.flickityInstance.pausePlayer(); 7071 } 7072 } 7073 }, { 7074 key: '_resumeSlideshow', 7075 value: function _resumeSlideshow() { 7076 if (this.slideshow.flickityInstance.options.autoPlay) { 7077 this.slideshow.flickityInstance.unpausePlayer(); 7078 } 7079 } 7080 }, { 7081 key: '_onSlideChanged', 7082 value: function _onSlideChanged(index, element) { 7083 this._transitionToSlide(element); 7084 } 7085 }, { 7086 key: '_transitionToSlide', 7087 value: function _transitionToSlide(slide) { 7088 var _this63 = this; 7089 7090 this.timeline.clear(); 7091 7092 // First, we check if there is a previous slide selected, if that's the case 7093 if (this.selectedSlide) { 7094 this._slideLeave(this.selectedSlide); 7095 this.timeline.addLabel('enter', this.shouldAnimate ? '-=0.4' : 0); 7096 } 7097 7098 // We get the next slide (if any) to preload it 7099 this._lazyLoadNextImage(); 7100 7101 this.timeline.fromTo(slide, this.selectedSlide && this.shouldAnimate ? 0.3 : 0, { autoAlpha: 0 }, { autoAlpha: 1, ease: Cubic.easeInOut }, 'enter'); 7102 7103 // The image may take 1s or more to load depending on the network, so we make sure to pause the player, and restart it once it has transitioned 7104 if (this.slideshow.flickityInstance.options.autoPlay && this.slideshow.flickityInstance.player.state === 'playing') { 7105 this.slideshow.flickityInstance.pausePlayer(); 7106 } 7107 7108 __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(slide.querySelectorAll('.Slideshow__Image')).forEac
7108h(function (image) { 7109 if (image.classList.contains('Image--lazyLoading') || image.classList.contains('Image--lazyLoad')) { 7110 image.addEventListener('lazyloaded', _this63._slideEnter.bind(_this63, slide)); 7111 } else { 7112 _this63._slideEnter(slide); 7113 } 7114 }); 7115 7116 this.selectedSlide = slide; 7117 } 7118 }, { 7119 key: '_slideLeave', 7120 value: function _slideLeave(slide) { 7121 var content = slide.querySelector('.SectionHeader'), 7122 buttonWrapper = slide.querySelector('.SectionHeader__ButtonWrapper'); 7123 7124 this.timeline.fromTo(slide, this.shouldAnimate ? 0.3 : 0, { autoAlpha: 1 }, { autoAlpha: 0, ease: Cubic.easeInOut, delay: this.shouldAnimate ? 0.35 : 0 }); 7125 7126 if (content) { 7127 this.timeline.fromTo(content, this.shouldAnimate ? 0.4 : 0, { autoAlpha: 1, y: 0 }, { autoAlpha: 0, y: 20, ease: Cubic.easeIn }, 0); 7128 } 7129 7130 if (buttonWrapper) { 7131 this.timeline.fromTo(buttonWrapper, this.shouldAnimate ? 0.4 : 0, { autoAlpha: 1, y: 0 }, { autoAlpha: 0, y: 10, ease: Cubic.easeIn }, 0); 7132 } 7133 } 7134 }, { 7135 key: '_slideEnter', 7136 value: function _slideEnter(slide) { 7137 var images = slide.querySelectorAll('.Slideshow__Image'), 7138 content = slide.querySelector('.SectionHeader'), 7139 buttonWrapper = slide.querySelector('.SectionHeader__ButtonWrapper'); 7140 7141 if (this.slideshow.flickityInstance.options.autoPlay && this.slideshow.flickityInstance.player.state === 'paused') { 7142 this.slideshow.flickityInstance.unpausePlayer(); 7143 } 7144 7145 if (window.CSS && window.CSS.supports('(object-fit: cover) or (-o-object-fit: cover)')) { 7146 if (window.theme.showImageZooming) { 7147 this.timeline.fromTo(images, this.shouldAnimate ? 1.2 : 0, { opacity: 0, scale: 1.2 }, { opacity: 1, scale: 1, ease: Quad.easeOut }, 'enter'); 7148 } else { 7149 this.timeline.fromTo(images, this.shouldAnimate ? 1.2 : 0, { opacity: 0 }, { opacity: 1, ease: Quad.easeOut }, 'enter'); 7150 } 7151 } 7152 7153 if (content) { 7154 this.timeline.fromTo(content, this.shouldAnimate ? 0.8 : 0, { autoAlpha: 0, y: 30 }, { autoAlpha: 1, y: 0, delay: this.shouldAnimate ? 0.8 : 0, ease: Cubic.easeOut }, 'enter'); 7155 } 7156 7157 if (buttonWrapper) { 7158 this.timeline.fromTo(buttonWrapper, this.shouldAnimate ? 0.8 : 0, { autoAlpha: 0, y: 20 }, { autoAlpha: 1, y: 0, delay: this.shouldAnimate ? 0.8 : 0, ease: Cubic.easeOut }, 'enter'); 7159 } 7160 } 7161 }, { 7162 key: '_lazyLoadNextImage', 7163 value: function _lazyLoadNextImage() { 7164 var currentIndex = this.slideshow.flickityInstance.selectedIndex, 7165 breakpoint = __WEBPACK_IMPORTED_MODULE_2__helper_Responsive__["default"].getCurrentBreakpoint(); 7166 7167 if (this.slideshow.flickityInstance.cells.length - 1 > currentIndex) { 7168 var nextCellElement = this.slideshow.flickityInstance.cells[currentIndex + 1].element, 7169 imageContainers = __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(nextCellElement.querySelectorAll('.Slideshow__ImageContainer')), 7170 imageToReveal = null; 7171 7172 if (breakpoint === 'phone') { 7173 imageToReveal = imageContainers[0]; 7174 } else { 7175 imageToReveal = imageContainers[1]; 7176 } 7177 7178 if (window.lazySizes && imageToReveal && imageToReveal.classList.contains('Image--lazyLoad')) { 7179 lazySizes.loader.unveil(imageToReveal.firstElementChild); 7180 } 7181 } 7182 } 7183 }, { 7184 key: '_onBreakpointChanged', 7185 value: function _onBreakpointChanged(event) { 7186 if (event.detail.previousBreakpoint === 'phone' && event.detail.currentBreakpoint !== 'phone' || event.detail.previousBreakpoint !== 'phone' && event.detail.currentBreakpoint === 'phone') { 7187 this.selectedSlide = null; 7188 this._transitionToSlide(this.slideshow.flickityInstance.selectedElement); 7189 } 7190 } 7191 }]); 7192 7193 return SlideshowSection; 7194 }(); 7195 /* harmony export (immutable) */ 7196 7197 __webpack_exports__["default"] = SlideshowSection; 7198 7199 /***/ 7200 }, 7201 /* 51 */ 7202 /***/function (module, __webpack_exports__, __webpack_require__) { 7203 7204 "use strict"; 7205 7206 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 7207 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components_Carousel__ = __webpack_require__(1); 7208 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper_Dom__ = __webpack_require__(0); 7209 7210 var TestimonialsSection = function () { 7211 function TestimonialsSection(container) { 7212 _classCallCheck(this, TestimonialsSection); 7213 7214 this.element = container; 7215 this.delegateElement = new domDelegate.Delegate(this.element); 7216 this.navItems = __WEBPACK_IMPORTED_MODULE_1__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.TestimonialNav__Item')); 7217 7218 this.carousel = new __WEBPACK_IMPORTED_MODULE_0__components_Carousel__["default"](this.element.querySelector('.TestimonialList'), { 7219 onSelect: this._testimonialChanged.bind(this) 7220 }); 7221 7222 this._attachListeners(); 7223 } 7224 7225 _createClass(TestimonialsSection, [{ 7226 key: 'onUnload', 7227 value: function onUnload() { 7228 this.carousel.destroy(); 7229 this.delegateElement.off('click'); 7230 } 7231 }, { 7232 key: 'onBlockSelect', 7233 value: function onBlockSelect(event) { 7234 this.carousel.selectCell(event.target.getAttribute('data-sli
7234de-index'), true); 7235 } 7236 }, { 7237 key: 'onBlockDeselect', 7238 value: function onBlockDeselect() { 7239 this.carousel.unpausePlayer(); 7240 } 7241 }, { 7242 key: '_testimonialClicked', 7243 value: function _testimonialClicked(event, target) { 7244 this.carousel.pausePlayer(); 7245 this.carousel.selectCell(parseInt(target.getAttribute('data-index'))); 7246 this.carousel.unpausePlayer(); 7247 } 7248 }, { 7249 key: '_testimonialChanged', 7250 value: function _testimonialChanged(newIndex) { 7251 this.navItems.forEach(function (item, index) { 7252 item.classList.remove('is-selected'); // IE11 and lower does not support classList.toggle 7253 7254 if (newIndex === index) { 7255 item.classList.add('is-selected'); 7256 } 7257 }); 7258 } 7259 }, { 7260 key: '_attachListeners', 7261 value: function _attachListeners() { 7262 this.delegateElement.on('click', '.TestimonialNav__Item', this._testimonialClicked.bind(this)); 7263 } 7264 }]); 7265 7266 return TestimonialsSection; 7267 }(); 7268 /* harmony export (immutable) */ 7269 7270 __webpack_exports__["default"] = TestimonialsSection; 7271 7272 /***/ 7273 }, 7274 /* 52 */ 7275 /***/function (module, __webpack_exports__, __webpack_require__) { 7276 7277 "use strict"; 7278 7279 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 7280 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__helper_Dom__ = __webpack_require__(0); 7281 7282 var TimelineSection = function () { 7283 function TimelineSection(container) { 7284 _classCallCheck(this, TimelineSection); 7285 7286 this.element = container; 7287 this.delegateElement = new domDelegate.Delegate(this.element); 7288 this.items = __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.Timeline__Item')); 7289 this.navItems = __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].nodeListToArray(this.element.querySelectorAll('.Timeline__NavItem')); 7290 7291 this._attachListeners(); 7292 } 7293 7294 _createClass(TimelineSection, [{ 7295 key: 'onUnload', 7296 value: function onUnload() { 7297 this.delegateElement.off('click'); 7298 } 7299 }, { 7300 key: 'onBlockSelect', 7301 value: function onBlockSelect(event) { 7302 this.navItems[parseInt(event.target.getAttribute('data-index'))].click(); // Simulate a click on the given nav item 7303 } 7304 }, { 7305 key: '_attachListeners', 7306 value: function _attachListeners() { 7307 this.delegateElement.on('click', '.Timeline__NavItem', this._clickOnNavItem.bind(this)); 7308 } 7309 }, { 7310 key: '_clickOnNavItem', 7311 value: function _clickOnNavItem(event, target) { 7312 var newItem = this.items[parseInt(target.getAttribute('data-index'))]; 7313 7314 if (newItem.classList.contains('is-selected')) { 7315 return; 7316 } 7317 7318 var isContentLarger = false, 7319 navWrapper = target.parentNode, 7320 scrollableOffset = 0; 7321 7322 fastdom.measure(function () { 7323 var scrollableWidth = navWrapper.scrollWidth, 7324 visibleWidth = navWrapper.offsetWidth; 7325 7326 isContentLarger = visibleWidth < scrollableWidth; 7327 7328 if (isContentLarger) { 7329 var beginBound = target.offsetLeft, 7330 endBound = beginBound + target.offsetWidth, 7331 closerToLeft = beginBound <= visibleWidth - endBound; 7332 7333 var itemToUse = null; 7334 7335 if (closerToLeft) { 7336 // If closer to left, we try to make the previous item visible (if possible) 7337 itemToUse = target.previousElementSibling || target; 7338 } else { 7339 // If closer to right, we try to make the next item visible (if possible) 7340 itemToUse = target.nextElementSibling || target; 7341 } 7342 7343 var itemBeginBound = itemToUse.offsetLeft - navWrapper.scrollLeft, 7344 itemEndBound = itemBeginBound + itemToUse.offsetWidth; 7345 7346 if (itemEndBound > visibleWidth) { 7347 // Element is not visible from the right, so we must move by a given amount so that endBound is within viewable screen 7348 scrollableOffset = itemEndBound - visibleWidth; 7349 } else if (itemBeginBound < 0) { 7350 // Element is not visible from the left, so we simply use the opposite of the negative offset 7351 scrollableOffset = itemBeginBound; 7352 } 7353 } 7354 }); 7355 7356 fastdom.mutate(function () { 7357 if (isContentLarger) { 7358 navWrapper.scrollBy({ behavior: 'smooth', left: scrollableOffset }); 7359 } 7360 7361 // First we set the class on the selected item and remove it on siblings 7362 target.classList.add('is-selected'); 7363 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].getSiblings(target, '.is-selected').forEach(function (item) { 7364 item.classList.remove('is-selected'); 7365 }); 7366 7367 // Then we slide to the appropriate element 7368 newItem.classList.add('is-selected'); 7369 __WEBPACK_IMPORTED_MODULE_0__helper_Dom__["default"].getSiblings(newItem, '.is-selected').forEach(function (item) { 7370 item.classList.remove('is-selected'); 7371 }); 7372 }); 7373 } 7374 }]); 7375 7376 return TimelineSection; 7377 }(); 7378 /* harmony export (immutable) */ 7379 7380 __webpack_exports__["default"] = TimelineSection; 7381 7382 /***/ 7383 }, 7384 /* 53 */ 7385 /***/function (module, __webpack_exports__, __webpack_require__) { 7386 7387 "use strict"; 7388 7389 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 7390 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__AddressesSection__ = __webpack_require__(25); 7391 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "AddressesSection", function () { 7392 return __WEBPACK_IMPORTED_MODULE_0__AddressesSection__["default"]; 7393 }); 7394 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__ArticleListSection__ = __webpack_require__(26); 7395 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ArticleListSection", function () { 7396 return __WEBPACK_IMPORTED_MODULE_1__ArticleListSection__["default"]; 7397 }); 7398 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__ArticleSection__ = __webpack_require__(27); 7399 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ArticleSection", function () { 7400 return __WEBPACK_IMPORTED_MODULE_2__ArticleSection__["default"]; 7401 }); 7402 /* harmony import */var __WEBPACK_IMPORTED_MODULE_3__CartSection__ = __webpack_require__(29); 7403 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "CartSection", function () { 7404 return __WEBPACK_IMPORTED_MODULE_3__CartSection__["default"]; 7405 }); 7406 /* harmony import */var __WEBPACK_IMPORTED_MODULE_4__CollectionListSection__ = __webpack_require__(30); 7407 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "CollectionListSection", function () { 7408 return __WEBPACK_IMPORTED_MODULE_4__CollectionListSection__["default"]; 7409 }); 7410 /* harmony import */var __WEBPACK_IMPORTED_MODULE_5__CollectionSection__ = __webpack_require__(31); 7411 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "CollectionSection", function () { 7412 return __WEBPACK_IMPORTED_MODULE_5__CollectionSection__["default"]; 7413 }); 7414 /* harmony import */var __WEBPACK_IMPORTED_MODULE_6__FaqSection__ = __webpack_require__(32); 7415 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "FaqSection", function () { 7416 return __WEBPACK_IMPORTED_MODULE_6__FaqSection__["default"]; 7417 }); 7418 /* harmony import */var __WEBPACK_IMPORTED_MODULE_7__FeaturedCollectionsSection__ = __webpack_require__(33); 7419 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "FeaturedCollectionsSection", function () { 7420 return __WEBPACK_IMPORTED_MODULE_7__FeaturedCollectionsSection__["default"]; 7421 }); 7422 /* harmony import */var __WEBPACK_IMPORTED_MODULE_8__FeaturedProductSection__ = __webpack_require__(34); 7423 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "FeaturedProductSection", function () { 7424 return __WEBPACK_IMPORTED_MODULE_8__FeaturedProductSection__["default"]; 7425 }); 7426 /* harmony import */var __WEBPACK_IMPORTED_MODULE_9__Backgroun
7426dVideoSection__ = __webpack_require__(28); 7427 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "BackgroundVideoSection", function () { 7428 return __WEBPACK_IMPORTED_MODULE_9__BackgroundVideoSection__["default"]; 7429 }); 7430 /* harmony import */var __WEBPACK_IMPORTED_MODULE_10__GiftCardSection__ = __webpack_require__(35); 7431 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "GiftCardSection", function () { 7432 return __WEBPACK_IMPORTED_MODULE_10__GiftCardSection__["default"]; 7433 }); 7434 /* harmony import */var __WEBPACK_IMPORTED_MODULE_11__HeaderSection__ = __webpack_require__(36); 7435 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "HeaderSection", function () { 7436 return __WEBPACK_IMPORTED_MODULE_11__HeaderSection__["default"]; 7437 }); 7438 /* harmony import */var __WEBPACK_IMPORTED_MODULE_12__ImageWithTextBlockSection__ = __webpack_require__(37); 7439 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ImageWithTextBlockSection", function () { 7440 return __WEBPACK_IMPORTED_MODULE_12__ImageWithTextBlockSection__["default"]; 7441 }); 7442 /* harmony import */var __WEBPACK_IMPORTED_MODULE_13__InstagramSection__ = __webpack_require__(38); 7443 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "InstagramSection", function () { 7444 return __WEBPACK_IMPORTED_MODULE_13__InstagramSection__["default"]; 7445 }); 7446 /* harmony import */var __WEBPACK_IMPORTED_MODULE_14__LoginSection__ = __webpack_require__(39); 7447 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "LoginSection", function () { 7448 return __WEBPACK_IMPORTED_MODULE_14__LoginSection__["default"]; 7449 }); 7450 /* harmony import */var __WEBPACK_IMPORTED_MODULE_15__MapSection__ = __webpack_require__(40); 7451 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "MapSection", function () { 7452 return __WEBPACK_IMPORTED_MODULE_15__MapSection__["default"]; 7453 }); 7454 /* harmony import */var __WEBPACK_IMPORTED_MODULE_16__NewsletterPopupSection__ = __webpack_require__(41); 7455 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "NewsletterPopupSection", function () { 7456 return __WEBPACK_IMPORTED_MODULE_16__NewsletterPopupSection__["default"]; 7457 }); 7458 /* harmony import */var __WEBPACK_IMPORTED_MODULE_17__ProductSection__ = __webpack_require__(42); 7459 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ProductSection", function () { 7460 return __WEBPACK_IMPORTED_MODULE_17__ProductSection__["default"]; 7461 }); 7462 /* harmony import */var __WEBPACK_IMPORTED_MODULE_18__RecentlyViewedProductsSection__ = __webpack_require__(43); 7463 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "RecentlyViewedProductsSection", function () { 7464 return __WEBPACK_IMPORTED_MODULE_18__RecentlyViewedProductsSection__["default"]; 7465 }); 7466 /* harmony import */var __WEBPACK_IMPORTED_MODULE_19__RelatedProductsSection__ = __webpack_require__(44); 7467 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "RelatedProductsSection", function () { 7468 return __WEBPACK_IMPORTED_MODULE_19__RelatedProductsSection__["default"]; 7469 }); 7470 /* harmony import */var __WEBPACK_IMPORTED_MODULE_20__SectionContainer__ = __webpack_require__(46); 7471 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "SectionContainer", function () { 7472 return __WEBPACK_IMPORTED_MODULE_20__SectionContainer__["default"]; 7473 }); 7474 /* harmony import */var __WEBPACK_IMPORTED_MODULE_21__SearchSection__ = __webpack_require__(45); 7475 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "SearchSection", function () { 7476 return __WEBPACK_IMPORTED_MODULE_21__SearchSection__["default"]; 7477 }); 7478 /* harmony import */var __WEBPACK_IMPORTED_MODULE_22__ShopNowSection__ = __webpack_require__(47); 7479 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ShopNowSection", function () { 7480 return __WEBPACK_IMPORTED_MODULE_22__ShopNowSection__["default"]; 7481 }); 7482 /* harmony import */var __WEBPACK_IMPORTED_MODULE_23__ShopTheLookSection__ = __webpack_require__(48); 7483 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "ShopTheLookSection", function () { 7484 return __WEBPACK_IMPORTED_MODULE_23__ShopTheLookSection__["default"]; 7485 }); 7486 /* harmony import */var __WEBPACK_IMPORTED_MODULE_24__SidebarMenuSection__ = __webpack_require__(49); 7487 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "SidebarMenuSection", function () { 7488 return __WEBPACK_IMPORTED_MODULE_24__SidebarMenuSection__["default"]; 7489 }); 7490 /* harmony import */var __WEBPACK_IMPORTED_MODULE_25__SlideshowSection__ = __webpack_require__(50); 7491 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "SlideshowSection", function () { 7492 return __WEBPACK_IMPORTED_MODULE_25__SlideshowSection__["default"]; 7493 }); 7494 /* harmony import */var __WEBPACK_IMPORTED_MODULE_26__TestimonialsSection__ = __webpack_require__(51); 7495 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "TestimonialsSection", function () { 7496 return __WEBPACK_IMPORTED_MODULE_26__TestimonialsSection__["default"]; 7497 }); 7498 /* harmony import */var __WEBPACK_IMPORTED_MODULE_27__TimelineSection__ = __webpack_require__(52); 7499 /* harmony reexport (binding) */__webpack_require__.d(__webpack_exports__, "TimelineSection", function () { 7500 return __WEBPACK_IMPORTED_MODULE_27__TimelineSection__["default"]; 7501 }); 7502 7503 /***/ 7504 }, 7505 /* 54 */ 7506 /***/function (module, exports, __webpack_require__) { 7507 7508 __webpack_require__(3); 7509 __webpack_require__(7); 7510 __webpack_require__(5); 7511 __webpack_require__(0); 7512 __webpack_require__(10); 7513 __webpack_require__(2); 7514 __webpack_require__(6); 7515 __webpack_require__(1); 7516 __webpack_require__(19); 7517 __webpack_require__(12); 7518 __webpack_require__(8); 7519 __webpack_require__(20); 7520 __webpack_require__(21); 7521 __webpack_require__(13); 7522 __webpack_require__(22); 7523 __webpack_require__(9); 7524 __webpack_require__(14); 7525 __webpack_require__(4); 7526 __webpack_require__(15); 7527 __webpack_require__(11); 7528 __webpack_require__(17); 7529 __webpack_require__(23); 7530 __webpack_require__(18); 7531 __webpack_require__(16); 7532 __webpack_require__(24); 7533 __webpack_require__(25); 7534 __webpack_require__(26); 7535 __webpack_require__(27); 7536 __webpack_require__(28); 7537 __webpack_require__(29); 7538 __webpack_require__(30); 7539 __webpack_require__(31); 7540 __webpack_require__(32); 7541 __webpack_require__(33); 7542 __webpack_require__(34); 7543 __webpack_require__(35); 7544 __webpack_require__(36); 7545 __webpack_require__(37); 7546 __webpack_require__(38); 7547 __webpack_require__(39); 7548 __webpack_require__(40); 7549 __webpack_require__(41); 7550 __webpack_require__(42); 7551 __webpack_require__(43); 7552 __webpack_require__(44); 7553 __webpack_require__(45); 7554 __webpack_require__(46); 7555 __webpack_require__(47); 7556 __webpack_require__(48); 7557 __webpack_require__(49); 7558 __webpack_require__(50); 7559 __webpack_require__(51); 7560 __webpack_require__(52); 7561 __webpack_require__(53); 7562 module.exports = __webpack_require__(55); 7563 7564 /***/ 7565 }, 7566 /* 55 */ 7567 /***/function (module, __webpack_exports__, __webpack_require__) { 7568 7569 "use strict"; 7570 7571 Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 7572 /* harmony import */var __WEBPACK_IMPORTED_MODULE_0__components__ = __webpack_require__(24); 7573 /* harmony import */var __WEBPACK_IMPORTED_MODULE_1__helper__ = __webpack_require__(6); 7574 /* harmony import */var __WEBPACK_IMPORTED_MODULE_2__sections__ = __webpack_require__(53); 7575 7576 (function () { 7577 // First, we register all plugins that are used for all pages 7578 new __WEBPACK_IMPORTED_MODULE_0__components__["Collapsible"](); 7579 new __WEBPACK_IMPORTED_MODULE_0__components__["Modal"](); 7580 new __WEBPACK_IMPORTED_MODULE_1__helper__["ResponsiveHelper"](); 7581 7582 if (window.theme.template !== 'password' && window.theme.template !== 'gift_card') { 7583 new __WEBPACK_IMPORTED_MODULE_0__components__["Search"](); 7584 new __WEBPACK_IMPORTED_MODULE_0__components__["LoadingBar"](); 7585 } 7586 7587 // Then, we instantiate specific sections that may appear in all pages. In the past I used to scope the sections by the template for 7588 // (slightly) improving performance, but we had merchants who actually created their own sections based on home page sections to integrate them 7589 // on content page, for instance. 7590 7591 var sections = new __WEBPACK_IMPORTED_MODULE_2__sections__["SectionContainer"](); 7592 7593 sections.register('header', __WEBPACK_IMPORTED_MODULE_2__sections__["HeaderSection"]); 7594 sections.register('sidebar-menu', __WEBPACK_IMPORTED_MODULE_2__sections__["SidebarMenuSection"]); 7595 sections.register('cart', __WEBPACK_IMPORTED_MODULE_2__sections__["CartSection"]); 7596 sections.register('newsletter-popup', __WEBPACK_IMPORTED_MODULE_2__sections__["NewsletterPopupSection"]); 7597 7598 // Sections used on index 7599 sections.register('slideshow', __WEBPACK_IMPORTED_MODULE_2__sections__["SlideshowSection"]); 7600 sections.register('collection-list', __WEBPACK_IMPORTED_MODULE_2__sections__["CollectionListSection"]); 7601 sections.register('article-list', __WEBPACK_IMPORTED_MODULE_2__sections__["ArticleListSection"]); 7602 sections.register('featured-product', __WEBPACK_IMPORTED_MODULE_2__sections__["FeaturedProductSection"]); 7603 sections.register('image-with-text-block', __WEBPACK_IMPORTED_MODULE_2__sections__["ImageWithTextBlockSection"]); 7604 sections.register('timeline', __WEBPACK_IMPORTED_MODULE_2__sections__["TimelineSection"]); 7605 sections.register('instagram', __WEBPACK_IMPORTED_MODULE_2__sections__["InstagramSection"]); 7606 sections.register('map', __WEBPACK_IMPORTED_MODULE_2__sections__["MapSection"]); 7607 sections.register('featured-collections', __WEBPACK_IMPORTED_MODULE_2__sections__["FeaturedCollectionsSection"]); 7608 sections.register('shop-the-look', __WEBPACK_IMPORTED_MODULE_2__sections__["ShopTheLookSection"]); 7609 sections.register('testimonials', __WEBPACK_IMPORTED_MODULE_2__sections__["TestimonialsSection"]); 7610 sections.register('background-video', __WEBPACK_IMPORTED_MODULE_2__sections__["Backgroun
7610dVideoSection"]); 7611 7612 // Sections used on product page 7613 sections.register('product', __WEBPACK_IMPORTED_MODULE_2__sections__["ProductSection"]); 7614 sections.register('related-products', __WEBPACK_IMPORTED_MODULE_2__sections__["RelatedProductsSection"]); 7615 7616 // Sections used on collection page 7617 sections.register('collection', __WEBPACK_IMPORTED_MODULE_2__sections__["CollectionSection"]); 7618 7619 // Sections used on blog page 7620 sections.register('article-list', __WEBPACK_IMPORTED_MODULE_2__sections__["ArticleListSection"]); 7621 7622 // Sections used on article page 7623 sections.register('article', __WEBPACK_IMPORTED_MODULE_2__sections__["ArticleSection"]); 7624 7625 // Sections used on content pages 7626 sections.register('faq', __WEBPACK_IMPORTED_MODULE_2__sections__["FaqSection"]); 7627 7628 // Sections used on login page 7629 sections.register('login', __WEBPACK_IMPORTED_MODULE_2__sections__["LoginSection"]); 7630 7631 // Sections used on addresses page 7632 sections.register('addresses', __WEBPACK_IMPORTED_MODULE_2__sections__["AddressesSection"]); 7633 7634 // Sections used on gift card page 7635 sections.register('gift-card', __WEBPACK_IMPORTED_MODULE_2__sections__["GiftCardSection"]); 7636 7637 // Sections used on search page 7638 sections.register('search', __WEBPACK_IMPORTED_MODULE_2__sections__["SearchSection"]); 7639 7640 // Sections used on different pages 7641 sections.register('recently-viewed-products', __WEBPACK_IMPORTED_MODULE_2__sections__["RecentlyViewedProductsSection"]); 7642 sections.register('shop-now', __WEBPACK_IMPORTED_MODULE_2__sections__["ShopNowSection"]); 7643 7644 /** 7645 * ---------------------------------------------------------------------------- 7646 * AUTOMATIC CURRENCY CONVERSION 7647 * ---------------------------------------------------------------------------- 7648 */ 7649 7650 (function () { 7651 if (window.theme.currencyConversionEnabled) { 7652 var shopCurrency = window.theme.shopCurrency, 7653 currencySelectors = __WEBPACK_IMPORTED_MODULE_1__helper__["DomHelper"].nodeListToArray(document.querySelectorAll('.CurrencySelector__Select')); 7654 7655 var currencyHasChanged = function currencyHasChanged(event) { 7656 var newCurrency = event.target.value; 7657 7658 // As we have multiple selectors in the page, we need to update them all 7659 currencySelectors.forEach(function (currencySelectorToUpdate) { 7660 currencySelectorToUpdate.value = newCurrency; 7661 }); 7662 7663 // Then we can convert everything 7664 __WEBPACK_IMPORTED_MODULE_1__helper__["CurrencyHelper"].convertAll(); 7665 }; 7666 7667 currencySelectors.forEach(function (currencySelector) { 7668 currencySelector.addEventListener('change', currencyHasChanged); 7669 }); 7670 7671 var currentCurrency = shopCurrency; 7672 7673 try { 7674 currentCurrency = localStorage.getItem('currency') || shopCurrency; 7675 } catch (exception) { 7676 currentCurrency = shopCurrency; 7677 } 7678 7679 if (currentCurrency !== shopCurrency) { 7680 currencySelectors.forEach(function (currencySelector) { 7681 currencySelector.value = currentCurrency; 7682 }); 7683 7684 __WEBPACK_IMPORTED_MODULE_1__helper__["CurrencyHelper"].convertAll(); 7685 } 7686 } 7687 })(); 7688 7689 /** 7690 * ---------------------------------------------------------------------------- 7691 * RTE 7692 * ---------------------------------------------------------------------------- 7693 */ 7694 7695 (function () { 7696 // We wrap each RTE table by a specific class to allow wrapping 7697 __WEBPACK_IMPORTED_MODULE_1__helper__["DomHelper"].nodeListToArray(document.querySelectorAll('.Rte table')).forEac
7697h(function (table) { 7698 table.outerHTML = '<div class="TableWrapper">' + table.outerHTML + '</div>'; 7699 }); 7700 7701 __WEBPACK_IMPORTED_MODULE_1__helper__["DomHelper"].nodeListToArray(document.querySelectorAll('.Rte iframe')).forEach(function (iframe) { 7702 iframe.outerHTML = '<div class="VideoWrapper">' + iframe.outerHTML + '</div>'; 7703 7704 // Re-set the src attribute on each iframe after page load for Chrome's "incorrect iFrame content on 'back'" bug. 7705 // https://code.google.com/p/chromium/issues/detail?id=395791. Need to specifically target video and admin bar 7706 iframe.src = iframe.src; 7707 }); 7708 })(); 7709 7710 /** 7711 * ---------------------------------------------------------------------------- 7712 * UTILS 7713 * ---------------------------------------------------------------------------- 7714 */ 7715 7716 (function () { 7717 var documentDelegate = new domDelegate.Delegate(document.body), 7718 announcementBar = document.querySelector('.AnnouncementBar'); 7719 7720 documentDelegate.on('click', '[href^="#"], [data-href]', function (event, target) { 7721 var selector = target.hasAttribute('href') ? target.getAttribute('href') : target.getAttribute('data-href'); 7722 7723 if (selector === '#') { 7724 return; 7725 } 7726 7727 var element = document.querySelector(selector), 7728 offset = parseInt(target.getAttribute('data-offset') || 0); 7729 7730 if (announcementBar) { 7731 offset -= announcementBar.clientHeight; 7732 } 7733 7734 window.scrollTo({ behavior: 'smooth', top: element.offsetTop - offset }); 7735 7736 event.preventDefault(); 7737 }); 7738 })(); 7739 7740 (function () { 7741 var windowWidth = window.innerWidth, 7742 headerSection = document.getElementById('shopify-section-header'); 7743 7744 window.addEventListener('resize', function () { 7745 var newWidth = -1; 7746 7747 fastdom.measure(function () { 7748 newWidth = window.innerWidth; 7749 }); 7750 7751 fastdom.mutate(function () { 7752 if (newWidth === windowWidth) { 7753 return; 7754 } 7755 7756 windowWidth = newWidth; 7757 7758 document.documentElement.style.setProperty('--window-height', window.innerHeight + 'px'); 7759 7760 if (headerSection) { 7761 document.documentElement.style.setProperty('--header-height', headerSection.clientHeight + 'px'); 7762 } 7763 }); 7764 }); 7765 })(); 7766 7767 (function () { 7768 function handleFirstTab(event) { 7769 if (event.keyCode === 9) { 7770 document.body.classList.add('is-tabbing'); 7771 window.removeEventListener('keydown', handleFirstTab); 7772 } 7773 } 7774 7775 window.addEventListener('keydown', handleFirstTab); 7776 })(); 7777 7778 /** 7779 * ---------------------------------------------------------------------------- 7780 * ANIMATION 7781 * 7782 * Important: this has to be at the very end of the file 7783 * ---------------------------------------------------------------------------- 7784 */ 7785 7786 __WEBPACK_IMPORTED_MODULE_0__components__["PageTransition"].getInstance(); 7787 })(); 7788 7789 /***/ 7790 }] 7791 /******/); 7792 7793 7794 7795class RecomendSectionProduct extends HTMLElement { 7796 constructor() { 7797 super(); 7798 } 7799 7800 connectedCallback() { 7801 console.log('Custom square element added to page.'); 7802 // updateStyle(this); 7803 this.element = this.querySelector('.product-slider'); 7804 7805 this.RecomendSlider = new Flickity(this.element, { 7806 // options 7807 cellAlign: 'left', 7808 contain: true, 7809 pageDots: false, 7810 draggable: true, 7811 wrapAround: true, 7812 contain: false, 7813 prevNextButtons: false, 7814 autoPlay: 2500 7815 }); 7816 } 7817} 7818 7819customElements.define('recomend-section-product', RecomendSectionProduct); 7820 7821//Footer Link 7822if (window.innerWidth < 641) { 7823 document.querySelectorAll('.Footer__Title_link').forEach(title => { 7824 const ul = title.parentElement.querySelector('.Linklist'); 7825 ul.setAttribute('max-height', (ul.clientHeight + 20)); 7826 ul.style.maxHeight = 0; 7827 // ul.style.marginBottom = 20 + 'px'; 7828 title.addEventListener('click', function () { 7829 this.toggleAttribute('open'); 7830 if (this.hasAttribute('open')) { 7831 this.querySelector('.mobile-sign').textContent = '-'; 7832 ul.style.maxHeight = Number(ul.getAttribute('max-height')) + 'px'; 7833 ul.style.paddingBottom = 20 + 'px'; 7834 } else { 7835 this.querySelector('.mobile-sign').textContent = '+'; 7836 ul.style.maxHeight = 0; 7837 ul.style.paddingBottom = 0; 7838 } 7839 }) 7840 }); 7841 7842 document.querySelectorAll('.Footer__Title_text').forEach(title => { 7843 const ul = title.parentElement.querySelector('.content-area'); 7844 ul.setAttribute('max-height', (ul.clientHeight + 20)); 7845 ul.style.maxHeight = 0; 7846 // ul.style.marginBottom = 20 + 'px'; 7847 title.addEventListener('click', function () { 7848 this.toggleAttribute('open'); 7849 if (this.hasAttribute('open')) { 7850 this.querySelector('.mobile-sign').textContent = '-'; 7851 ul.style.maxHeight = Number(ul.getAttribute('max-height')) + 'px'; 7852 ul.style.paddingBottom = 20 + 'px'; 7853 } else { 7854 this.querySelector('.mobile-sign').textContent = '+'; 7855 ul.style.maxHeight = 0; 7856 ul.style.paddingBottom = 0; 7857 } 7858 }) 7859 }); 7860} 7861//Footer End Link 7862 7863 7864//Annoucment Bar Script Start 7865class AannoucementBar extends HTMLElement { 7866 constructor() { 7867 super(); 7868 7869 const swiper = new Swiper('.swiper-annoucement-bar', { 7870 // Optional parameters 7871 loop: true, 7872 autoplay: { 7873 delay: 1 7874 }, 7875 slidesPerView: 'auto', 7876 speed: 12000, 7877 grabCursor: true, 7878 mousewheelControl: true, 7879 keyboardControl: true, 7880 }); 7881 } 7882} 7883 7884customElements.define('annoucement-bar', AannoucementBar); 7885//Annoucment Bar Script End 7886 7887 7888 7889 7890//Product Image Changer Desktop 7891 7892let sizes = [200, 400, 600, 700, 800, 900]; 7893let imgFirst_src = document.querySelector('.Product__SlideshowNavImage.is-selected').querySelector('img').src; 7894document.querySelector('#custom_image img').src = imgFirst_src.split('_160x').join('_200x'); 7895 7896let srcset = sizes.map(size => { 7897 let src = imgFirst_src.split('_160x').join(`_${size}x`) + ' ' + size + 'w'; 7898 return src; 7899}) 7900document.querySelector('#custom_image img').srcset = srcset; 7901 7902document.querySelector('#custom_image').style.display = 'block'; 7903document.querySelector('#custom_image img').style.display = 'block'; 7904 7905 7906document.querySelector('#custom_image img').addEventListener('load', function () { 7907 console.log('image is loaded'); 7908 document.querySelector('#custom_image img').classList.remove('hide'); 7909}); 7910 7911 7912document.querySelectorAll('.Product__SlideshowNavScroller a').forEach(tag => { 7913 tag.addEventListener('click', function (event) { 7914 event.preventDefault(); 7915 document.querySelector('#custom_image img').classList.add('hide') 7916 7917 //console.log(this.getAttribute('href')); 7918 let img_src = tag.querySelector('img').src; 7919 document.querySelector('#custom_image img').src = img_src.split('_160x').join('_200x'); 7920 let srcset = sizes.map(size => { 7921 let src = img_src.split('_160x').join(`_${size}x`) + ' ' + size + 'w'; 7922 return src; 7923 }) 7924 document.querySelector('#custom_image img').srcset = srcset; 7925 // document.querySelector('#custom_image img').src = document.querySelector(this.getAttribute('href') + ' img').src; 7926 // document.querySelector('#custom_image img').srcset = document.querySelector(this.getAttribute('href') + ' img').srcset; 7927 }) 7928}) 7929//End
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.