1/* 2@license 3 Expanse by Archetype Themes (https://archetypethemes.co) 4 Access unminified JS in assets/theme.js 5 6 Use this event listener to run your own JS outside of this file. 7 Documentation - https://archetypethemes.co/blogs/expanse/javascript-events-for-developers 8 9 document.addEventListener('page:loaded', function() { 10 // Page has loaded and theme assets are ready 11 }); 12*/ 13(window.theme = window.theme || {}), 14 (window.Shopify = window.Shopify || {}), 15 (theme.config = { 16 bpSmall: !1, 17 hasSessionStorage: !0, 18 hasLocalStorage: !0, 19 mediaQuerySmall: "screen and (max-width: 769px)", 20 youTubeReady: !1, 21 vimeoReady: !1, 22 vimeoLoading: !1, 23 isTouch: !!("ontouchstart" in window || (window.DocumentTouch && window.document instanceof DocumentTouch) || window.navigator.maxTouchPoints || window.navigator.msMaxTouchPoints), 24 stickyHeader: !1, 25 rtl: "rtl" == document.documentElement.getAttribute("dir"), 26 }), 27 (theme.recentlyViewedIds = []), 28 theme.config.isTouch && (document.documentElement.className += " supports-touch"), 29 console && console.log && console.log("Expanse theme (" + theme.settings.themeVersion + ") by ARCHÎTYPE | Learn more at https://archetypethemes.co"), 30 (window.lazySizesConfig = window.lazySizesConfig || {}), 31 (lazySizesConfig.expFactor = 4), 32 (function () { 33 "use strict"; 34 var e, t, i, n, o, s, a, r; 35 if ( 36 ((theme.delegate = { 37 on: function (e, t, i) { 38 return this.namespaces || (this.namespaces = {}), (this.namespaces[e] = t), (i = i || !1), this.addEventListener(e.split(".")[0], t, i), this; 39 }, 40 off: function (e) { 41 if (this.namespaces) return this.removeEventListener(e.split(".")[0], this.namespaces[e]), delete this.namespaces[e], this; 42 }, 43 }), 44 (window.on = Element.prototype.on = theme.delegate.on), 45 (window.off = Element.prototype.off = theme.delegate.off), 46 (theme.utils = { 47 defaultTo: function (e, t) { 48 return null == e || e != e ? t : e; 49 }, 50 wrap: function (e, t) { 51 e.parentNode.insertBefore(t, e), t.appendChild(e); 52 }, 53 debounce: function (e, t, i) { 54 var n; 55 return function () { 56 var o = this, 57 s = arguments, 58 a = function () { 59 (n = null), i || t.apply(o, s); 60 }, 61 r = i && !n; 62 clearTimeout(n), (n = setTimeout(a, e)), r && t.apply(o, s); 63 }; 64 }, 65 throttle: function (e, t) { 66 var i = !1; 67 return function () { 68 i || 69 (t.apply(this, arguments), 70 (i = !0), 71 setTimeout(function () { 72 i = !1; 73 }, e)); 74 }; 75 }, 76 prepareTransition: function (e, t) { 77 e.addEventListener("transitionend", function t(i) { 78 e.classList.remove("is-transitioning"), e.removeEventListener("transitionend", t); 79 }), 80 e.classList.add("is-transitioning"), 81 e.offsetWidth, 82 "function" == typeof t && t(); 83 }, 84 compact: function (e) { 85 for (var t = -1, i = null == e ? 0 : e.length, n = 0, o = []; ++t < i; ) { 86 var s = e[t]; 87 s && (o[n++] = s); 88 } 89 return o; 90 }, 91 serialize: function (e) { 92 var t = []; 93 return ( 94 Array.prototype.slice.call(e.elements).forEac
94h(function (e) { 95 !e.name || 96 e.disabled || 97 ["file", "reset", "submit", "button"].indexOf(e.type) > -1 || 98 ("select-multiple" !== e.type 99 ? (["checkbox", "radio"].indexOf(e.type) > -1 && !e.checked) || t.push(encodeURIComponent(e.name) + "=" + encodeURIComponent(e.value)) 100 : Array.prototype.slice.call(e.options).forEach(function (i) { 101 i.selected && t.push(encodeURIComponent(e.name) + "=" + encodeURIComponent(i.value)); 102 })); 103 }), 104 t.join("&") 105 ); 106 }, 107 }), 108 (theme.a11y = { 109 trapFocus: function (e) { 110 var t = { focusin: e.namespace ? "focusin." + e.namespace : "focusin", focusout: e.namespace ? "focusout." + e.namespace : "focusout", keydown: e.namespace ? "keydown." + e.namespace : "keydown.handleFocus" }, 111 i = e.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])'), 112 n = [].slice.call(i).filter((e) => null !== e.offsetParent), 113 o = n[0], 114 s = n[n.length - 1]; 115 e.elementToFocus || (e.elementToFocus = e.container), 116 e.container.setAttribute("tabindex", "-1"), 117 e.elementToFocus.focus(), 118 document.documentElement.off("focusin"), 119 document.documentElement.on(t.focusout, function () { 120 document.documentElement.off(t.keydown); 121 }), 122 document.documentElement.on(t.focusin, function (e) { 123 (e.target !== s && e.target !== o) || 124 document.documentElement.on(t.keydown, function (e) { 125 !(function (e) { 126 if (9 !== e.keyCode) return; 127 e.target === o && e.shiftKey && (e.preventDefault(), s.focus()); 128 })(e); 129 }); 130 }); 131 }, 132 removeTrapFocus: function (e) { 133 var t = e.namespace ? "focusin." + e.namespace : "focusin"; 134 e.container && e.container.removeAttribute("tabindex"), document.documentElement.off(t); 135 }, 136 lockMobileScrolling: function (e, t) { 137 var i = t || document.documentElement; 138 document.documentElement.classList.add("lock-scroll"), 139 i.on("touchmove" + e, function () { 140 return !0; 141 }); 142 }, 143 unlockMobileScrolling: function (e, t) { 144 document.documentElement.classList.remove("lock-scroll"), (t || document.documentElement).off("touchmove" + e); 145 }, 146 }), 147 document.documentElement.on("keyup.tab", function (e) { 148 9 === e.keyCode && (document.documentElement.classList.add("tab-outline"), document.documentElement.off("keyup.tab")); 149 }), 150 (theme.Currency = 151 ((e = theme && theme.settings && theme.settings.superScriptPrice), 152 { 153 formatMoney: function (t, i) { 154 i || (i = theme.settings.moneyFormat), "string" == typeof t && (t = t.replace(".", "")); 155 var n = "", 156 o = /\{\{\s*(\w+)\s*\}\}/, 157 s = i || "${{amount}}"; 158 function a(e, t, i, n) { 159 if (((t = theme.utils.defaultTo(t, 2)), (i = theme.utils.defaultTo(i, ",")), (n = theme.utils.defaultTo(n, ".")), isNaN(e) || null == e)) return 0; 160 var o = (e = (e / 100).toFixed(t)).split("."); 161 return o[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1" + i) + (o[1] ? n + o[1] : ""); 162 }
163 switch (s.match(o)[1]) { 164 case "amount": 165 (n = a(t, 2)), e && n && n.includes(".") && (n = n.replace(".", "<sup>") + "</sup>"); 166 break; 167 case "amount_no_decimals": 168 n = a(t, 0); 169 break; 170 case "amount_with_comma_separator": 171 (n = a(t, 2, ".", ",")), e && n && n.includes(".") && (n = n.replace(",", "<sup>") + "</sup>"); 172 break; 173 case "amount_no_decimals_with_comma_separator": 174 n = a(t, 0, ".", ","); 175 break; 176 case "amount_no_decimals_with_space_separator": 177 n = a(t, 0, " "); 178 } 179 return s.replace(o, n); 180 }, 181 getBaseUnit: function (e) { 182 if (e && e.unit_price_measurement && e.unit_price_measurement.reference_value) 183 return 1 === e.unit_price_measurement.reference_value ? e.unit_price_measurement.reference_unit : e.unit_price_measurement.reference_value + e.unit_price_measurement.reference_unit; 184 }, 185 })), 186 (theme.Images = { 187 imageSize: function (e) { 188 if (!e) return "620x"; 189 var t = e.match(/.+_((?:pico|icon|thumb|small|compact|medium|large|grande)|\d{1,4}x\d{0,4}|x\d{1,4})[_\.@]/); 190 return null !== t ? t[1] : null; 191 }, 192 getSizedImageUrl: function (e, t) { 193 if (!e) return e; 194 if (null == t) return e; 195 if ("master" === t) return this.removeProtocol(e); 196 var i = e.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i); 197 if (null != i) { 198 var n = e.split(i[0]), 199 o = i[0]; 200 return this.removeProtocol(n[0] + "_" + t + o); 201 } 202 return null; 203 }, 204 removeProtocol: function (e) { 205 return e.replace(/http(s)?:/, ""); 206 }, 207 lazyloadImagePath: function (e) { 208 var t; 209 return null !== e && (t = e.replace(/(\.[^.]*)$/, "_{width}x$1")), t; 210 }, 211 }), 212 (theme.loadImageSection = function (e) { 213 function t() { 214 e.classList.remove("loading", "loading--delayed"), e.classList.add("loaded"); 215 } 216 function i() { 217 return e.querySelector(".lazyloaded"); 218 } 219 if (e.querySelector("svg")) t(); 220 else if (i()) t(); 221 else 222 var n = setInterval(function () { 223 i() && (clearInterval(n), t()); 224 }, 25); 225 }), 226 (theme.initWhenVisible = function (e) { 227 var t = e.threshold ? e.threshold : 0; 228 new IntersectionObserver( 229 (t, i) => { 230 t.forEach((t) => { 231 t.isIntersecting && "function" == typeof e.callback && (e.callback(), i.unobserve(t.target)); 232 }); 233 }, 234 { rootMargin: "0px 0px " + t + "px 0px" } 235 ).observe(e.element); 236 }), 237 (theme.LibraryLoader = 238 ((n = "requested"), 239 (o = "loaded"), 240 (a = { 241 youtubeSdk: { tagId: "youtube-sdk", src: "https://www.youtube.com/iframe_api", type: (i = "script") }, 242 vimeo: { tagId: "vimeo-api", src: "https://player.vimeo.com/api/player.js", type: i }, 243 shopifyXr: { tagId: "shopify-model-viewer-xr", src: (s = "https://cdn.shopify.com/shopifycloud/") + "shopify-xr-js/assets/v1.0/shopify-xr.en.js", type: i }, 244 modelViewerUi: { tagId: "shopify-model-viewer-ui", src: s + "model-viewer-ui/assets/v1.0/model-viewer-ui.en.js", type: i }, 245 modelViewerUiStyles: { tagId: "shopify-model-viewer-ui-styles", src: s + "model-viewer-ui/assets/v1.0/model-viewer-ui.css", type: (t = "link") }, 246 }), 247 { 248 load: function (e, s) { 249 var r = a[e]; 250 if (r && r.status !== n) 251 if (((s = s || function () {}), r.status !== o)) { 252 var c; 253 switch (((r.status = n), r.type)) { 254 case i: 255 c = (function (e, t) { 256 var i = document.createElement("script"); 257 return ( 258 (i.src = e.src), 259 i.addEventListener("load", function () { 260 (e.status = o), t(); 261 }), 262 i 263 ); 264 })(r, s); 265 break; 266 case t: 267 c = (function (e, t) { 268 var i = document.createElement("link"); 269 return ( 270 (i.href = e.src), 271 (i.rel = "stylesheet"), 272 (i.type = "text/css"), 273 i.addEventListener("load", function () { 274 (e.status = o), t(); 275 }), 276 i 277 ); 278 })(r, s); 279 } 280 (c.id = r.tagId), (r.element = c); 281 var d = document.getElementsByTagName(r.type)[0]; 282 d.parentNode.insertBefore(c, d); 283 } else s(); 284 }, 285 })), 286 (theme.rteInit = function () { 287 function e(e) { 288 e.src = e.src; 289 var t = document.createElement("div"); 290 t.classList.add("video-wrapper"), theme.utils.wrap(e, t); 291 } 292 document.querySelectorAll(".rte table").forEach((e) => { 293 var t = document.createElement("div"); 294 t.classList.add("table-wrapper"), theme.utils.wrap(e, t); 295 }), 296 document.querySelectorAll('.rte iframe[src*="youtube.com/embed"]').forEach((t) => { 297 e(t); 298 }), 299 document.querySelectorAll('.rte iframe[src*="player.vimeo"]').forEach((t) => { 300 e(t); 301 }), 302 document.querySelectorAll(".rte a img").forEach((e) => { 303 e.parentNode.classList.add("rte__image"); 304 }); 305 }), 306 (theme.Sections = function () { 307 (this.constructors = {}), 308 (this.instances = []), 309 document.addEventListener("shopify:section:load", this._onSectionLoad.bind(this)), 310 document.addEventListener("shopify:section:unload", this._onSectionUnload.bind(this)), 311 document.addEventListener("shopify:section:select", this._onSelect.bind(this)), 312 document.addEventListener("shopify:section:deselect", this._onDeselect.bind(this)), 313 document.addEventListener("shopify:block:select", this._onBlockSelect.bind(this)), 314 document.addEventListener("shopify:block:deselect", this._onBlockDeselect.bind(this)); 315 }), 316 (theme.Sections.prototype = Object.assign({}, theme.Sections.prototype, { 317 _createInstance: function (e, t, i) { 318 var n = e.getAttribute("data-section-id"), 319 o = e.getAttribute("data-section-type"); 320 if (void 0 !== (t = t || this.constructors[o])) { 321 if (i) this._findInstance(n) && this._removeInstance(n); 322 var s = Object.assign(new t(e), { id: n, type: o, container: e }); 323 this.instances.push(s); 324 } 325 }, 326 _findInstance: function (e) { 327 for (var t = 0; t < this.instances.length; t++) if (this.instances[t].id === e) return this.instances[t]; 328 }, 329 _removeInstance: function (e) { 330 for (var t, i = this.instances.length; i--; ) 331 if (this.instances[i].id === e) { 332 (t = this.instances[i]), this.instances.splice(i, 1); 333 break; 334 } 335 return t; 336 }, 337 _onSectionLoad: function (e, t, i) { 338 window.AOS && AOS.refreshHard(), theme && theme.initGlobals && theme.initGlobals(); 339 var n = t || e.target, 340 o = t || e.target.querySelector("[data-section-id]"); 341 if (o) { 342 this._createInstance(o); 343 var s = t ? i : this._findInstance(e.detail.sectionId); 344 n.querySelectorAll("[data-subsection]").length && this.loadSubSections(n), 345 s && "function" == typeof s.onLoad && s.onLoad(e), 346 setTimeout(function () { 347 window.dispatchEvent(new Event("scroll")); 348 }, 200); 349 } 350 }, 351 _onSectionUnload: function (e) { 352 this.instances = this.instances.filter(function (t) { 353 var i = t.id === e.detail.sectionId; 354 return i && "function" == typeof t.onUnload && t.onUnload(e), !i; 355 }); 356 }, 357 loadSubSections: function (e) { 358 e && 359 e.querySelectorAll("[data-section-id]").forEach((e) => { 360 this._onSectionLoad(null, e, e.dataset.sectionId); 361 }); 362 }, 363 _onSelect: function (e) { 364 var t = this._findInstance(e.detail.sectionId); 365 void 0 !== t && "function" == typeof t.onSelect && t.onSelect(e); 366 }, 367 _onDeselect: function (e) { 368 var t = this._findInstance(e.detail.sectionId); 369 void 0 !== t && "function" == typeof t.onDeselect && t.onDeselect(e); 370 }, 371 _onBlockSelect: function (e) { 372 var t = this._findInstance(e.detail.sectionId); 373 void 0 !== t && "function" == typeof t.onBlockSelect && t.onBlockSelect(e); 374 }, 375 _onBlockDeselect: function (e) { 376 var t = this._findInstance(e.detail.sectionId); 377 void 0 !== t && "function" == typeof t.onBlockDeselect && t.onBlockDeselect(e); 378 }, 379 register: function (e, t, i) { 380 this.constructors[e] = t; 381 var n = document.querySelectorAll('[data-section-type="' + e + '"]'); 382 i && (n = i.querySelectorAll('[data-section-type="' + e + '"]')),
383 n.forEach( 384 function (e) { 385 this._createInstance(e, t, i); 386 }.bind(this) 387 ); 388 }, 389 reinit: function (e) { 390 for (var t = 0; t < this.instances.length; t++) { 391 var i = this.instances[t]; 392 i.type === e && "function" == typeof i.forceReload && i.forceReload(); 393 } 394 }, 395 })), 396 (theme.Variants = (function () { 397 function e(e) { 398 (this.container = e.container), 399 (this.variants = e.variants), 400 (this.singleOptionSelector = e.singleOptionSelector), 401 (this.originalSelectorId = e.originalSelectorId), 402 (this.enableHistoryState = e.enableHistoryState), 403 (this.currentVariant = this._getVariantFromOptions()), 404 this.container.querySelectorAll(this.singleOptionSelector).forEach((e) => { 405 e.addEventListener("change", this._onSelectChange.bind(this)); 406 }); 407 } 408 return ( 409 (e.prototype = Object.assign({}, e.prototype, { 410 _getCurrentOptions: function () { 411 var e = []; 412 return ( 413 this.container.querySelectorAll(this.singleOptionSelector).forEach((t) => { 414 var i = t.getAttribute("type"); 415 "radio" === i || "checkbox" === i ? t.checked && e.push({ value: t.value, index: t.dataset.index }) : e.push({ value: t.value, index: t.dataset.index }); 416 }), 417 (e = theme.utils.compact(e)) 418 ); 419 }, 420 _getVariantFromOptions: function () { 421 var e = this._getCurrentOptions(), 422 t = this.variants, 423 i = !1; 424 return ( 425 t.forEach(function (t) { 426 var n = !0; 427 t.options; 428 e.forEach(function (e) { 429 n && (n = t[e.index] === e.value); 430 }), 431 n && (i = t); 432 }), 433 i || null 434 ); 435 }, 436 _onSelectChange: function () { 437 var e = this._getVariantFromOptions(); 438 this.container.dispatchEvent(new CustomEvent("variantChange", { detail: { variant: e } })), 439 document.dispatchEvent(new CustomEvent("variant:change", { detail: { variant: e } })), 440 e && 441 (this._updateMasterSelect(e), this._updateImages(e), this._updatePrice(e), this._updateUnitPrice(e), this._updateSKU(e), this._updateMPN(e), (this.currentVariant = e), this.enableHistoryState && this._updateHistoryState(e)); 442 }, 443 _updateImages: function (e) { 444 var t = e.featured_image || {}, 445 i = this.currentVariant.featured_image || {}; 446 e.featured_image && t.src !== i.src && this.container.dispatchEvent(new CustomEvent("variantImageChange", { detail: { variant: e } })); 447 }, 448 _updatePrice: function (e) { 449 (e.price === this.currentVariant.price && e.compare_at_price === this.currentVariant.compare_at_price) || this.container.dispatchEvent(new CustomEvent("variantPriceChange", { detail: { variant: e } })); 450 }, 451 _updateUnitPrice: function (e) { 452 e.unit_price !== this.currentVariant.unit_price && this.container.dis
452patchEvent(new CustomEvent("variantUnitPriceChange", { detail: { variant: e } })); 453 }, 454 _updateSKU: function (e) { 455 e.sku !== this.currentVariant.sku && this.container.dispatchEvent(new CustomEvent("variantSKUChange", { detail: { variant: e } })); 456 }, 457 _updateMPN: function (e) { 458 e.sku !== this.currentVariant.sku && this.container.dispatchEvent(new CustomEvent("variantMPNChange", { detail: { variant: e } })); 459 }, 460 _updateHistoryState: function (e) { 461 if (history.replaceState && e) { 462 var t = window.location.protocol + "//" + window.location.host + window.location.pathname + "?variant=" + e.id; 463 window.history.replaceState({ path: t }, "", t); 464 } 465 }, 466 _updateMasterSelect: function (e) { 467 (this.container.querySelector(this.originalSelectorId).value = e.id), this.container.querySelector(this.originalSelectorId).dispatchEvent(new Event("change", { bubbles: !0 })); 468 }, 469 })), 470 e 471 ); 472 })()), 473 (window.vimeoApiReady = function () { 474 var e, t; 475 (theme.config.vimeoLoading = !0), 476 new Promise((i, n) => { 477 (e = setInterval(function () { 478 Vimeo && (clearInterval(e), clearTimeout(t), i()); 479 }, 500)), 480 (t = setTimeout(function () { 481 clearInterval(e), n(); 482 }, 4e3)); 483 }).then(function () { 484 (theme.config.vimeoReady = !0), (theme.config.vimeoLoading = !1), document.dispatchEvent(new CustomEvent("vimeoReady")); 485 }); 486 }), 487 (theme.VimeoPlayer = (function () { 488 var e = "loading", 489 t = "loaded", 490 i = "video-interactable", 491 n = { background: !0, byline: !1, controls: !1, loop: !0, muted: !0, playsinline: !0, portrait: !1, title: !1 }; 492 function o(e, t, i) { 493 (this.divId = e), 494 (this.el = document.getElementById(e)), 495 (this.videoId = t), 496 (this.iframe = null), 497 (this.options = i), 498 this.options && this.options.videoParent && (this.parent = this.el.closest(this.options.videoParent)), 499 this.setAsLoading(), 500 theme.config.vimeoReady ? this.init() : (theme.LibraryLoader.load("vimeo", window.vimeoApiReady), document.addEventListener("vimeoReady", this.init.bind(this))); 501 } 502 return ( 503 (o.prototype = Object.assign({}, o.prototype, { 504 init: function () { 505 var e = n; 506 (e.id = this.videoId), (this.videoPlayer = new Vimeo.Player(this.el, e)), this.videoPlayer.ready().then(this.playerReady.bind(this)); 507 }, 508 playerReady: function () { 509 (this.iframe = this.el.querySelector("iframe")), 510 this.iframe.setAttribute("tabindex", "-1"), 511 this.videoPlayer.setMuted(!0), 512 this.setAsLoaded(), 513 new IntersectionObserver( 514 (e, t) => { 515 e.forEach((e) => { 516 e.isIntersecting ? this.play() : this.pause(); 517 }); 518 }, 519 { rootMargin: "0px 0px 50px 0px" } 520 ).observe(this.iframe); 521 }, 522 setAsLoading: function () { 523 this.parent && this.parent.classList.add(e); 524 }, 525 setAsLoaded: function () { 526 this.parent && (this.parent.classList.remove(e), this.parent.classList.add(t), Shopify && Shopify.designMode && window.AOS && AOS.refreshHard()); 527 }, 528 enableInteraction: function () { 529 this.parent && this.parent.classList.add(i); 530 }, 531 play: function () { 532 this.videoPlayer && "function" == typeof this.videoPlayer.play && this.videoPlayer.play(); 533 }, 534 pause: function () { 535 this.videoPlayer && "function" == typeof this.videoPlayer.pause && this.videoPlayer.pause(); 536 }, 537 destroy: function () { 538 this.videoPlayer && "function" == typeof this.videoPlayer.destroy && this.videoPlayer.destroy(); 539 }, 540 })), 541 o 542 ); 543 })()), 544 (window.onYouTubeIframeAPIReady = function () { 545 (theme.config.youTubeReady = !0), document.dispatchEvent(new CustomEvent("youTubeReady")); 546 }), 547 (theme.YouTube = (function () { 548 var e = "loading", 549 t = "loaded", 550 i = "video-interactable", 551 n = { width: 1280, height: 720, playerVars: { autohide: 0, autoplay: 1, cc_load_policy: 0, controls: 0, fs: 0, iv_load_policy: 3, modestbranding: 1, playsinline: 1, rel: 0 } }; 552 function o(e, t) { 553 (this.divId = e), 554 (this.iframe = null),
555 (this.attemptedToPlay = !1), 556 (n.events = { onReady: this.onVideoPlayerReady.bind(this), onStateChange: this.onVideoStateChange.bind(this) }), 557 (this.options = Object.assign({}, n, t)), 558 this.options && 559 (this.options.videoParent && (this.parent = document.getElementById(this.divId).closest(this.options.videoParent)), 560 this.options.autoplay || (this.options.playerVars.autoplay = this.options.autoplay), 561 "sound" === this.options.style && ((this.options.playerVars.controls = 1), (this.options.playerVars.autoplay = 0))), 562 this.setAsLoading(), 563 theme.config.youTubeReady ? this.init() : (theme.LibraryLoader.load("youtubeSdk"), document.addEventListener("youTubeReady", this.init.bind(this))); 564 } 565 return ( 566 (o.prototype = Object.assign({}, o.prototype, { 567 init: function () { 568 this.videoPlayer = new YT.Player(this.divId, this.options); 569 }, 570 onVideoPlayerReady: function (e) { 571 (this.iframe = document.getElementById(this.divId)), 572 this.iframe.setAttribute("tabindex", "-1"), 573 "sound" !== this.options.style && e.target.mute(), 574 new IntersectionObserver( 575 (e, t) => { 576 e.forEach((e) => { 577 e.isIntersecting ? this.play() : this.pause(); 578 }); 579 }, 580 { rootMargin: "0px 0px 50px 0px" } 581 ).observe(this.iframe); 582 }, 583 onVideoStateChange: function (e) { 584 switch (e.data) { 585 case -1: 586 this.attemptedToPlay && (this.setAsLoaded(), this.enableInteraction()); 587 break; 588 case 0: 589 this.play(e); 590 break; 591 case 1: 592 this.setAsLoaded(); 593 break; 594 case 3: 595 this.attemptedToPlay = !0; 596 } 597 }, 598 setAsLoading: function () { 599 this.parent && this.parent.classList.add(e); 600 }, 601 setAsLoaded: function () { 602 this.parent && (this.parent.classList.remove(e), this.parent.classList.add(t), Shopify && Shopify.designMode && window.AOS && AOS.refreshHard()); 603 }, 604 enableInteraction: function () { 605 this.parent && this.parent.classList.add(i); 606 }, 607 play: function () { 608 this.videoPlayer && "function" == typeof this.videoPlayer.playVideo && this.videoPlayer.playVideo(); 609 }, 610 pause: function () { 611 this.videoPlayer && "function" == typeof this.videoPlayer.pauseVideo && this.videoPlayer.pauseVideo(); 612 }, 613 destroy: function () { 614 this.videoPlayer && "function" == typeof this.videoPlayer.destroy && this.videoPlayer.destroy(); 615 }, 616 })), 617 o 618 ); 619 })()), 620 (theme.AjaxRenderer = (function () { 621 function e({ sections: e, preserveParams: t, onReplace: i, debug: n } = {}) { 622 (this.sections = e || []), (this.preserveParams = t || []), (this.cachedSections = []), (this.onReplace = i), (this.debug = Boolean(n)); 623 } 624 return ( 625 (e.prototype = Object.assign({}, e.prototype, { 626 renderPage: function (e, t, i = !0) { 627 t && this.appendPreservedParams(t); 628 const n = this.sections.map((i) => { 629 const n = `${e}?section_id=${i.sectionId}&${t}`, 630 o = (e) => e.url === n; 631 return this.cachedSections.some(o) ? this.renderSectionFromCac
631he(o, i) : this.renderSectionFromFetch(n, i); 632 }); 633 return i && this.updateURLHash(t), Promise.all(n); 634 }, 635 renderSectionFromCache: function (e, t) { 636 const i = this.cachedSections.find(e); 637 return this.log("[AjaxRenderer] rendering from cache: url=" + i.url), this.renderSection(i.html, t), Promise.resolve(t); 638 }, 639 renderSectionFromFetch: function (e, t) { 640 return ( 641 this.log("[AjaxRenderer] redering from fetch: url=" + e), 642 new Promise((i, n) => { 643 fetch(e) 644 .then((e) => e.text()) 645 .then((n) => { 646 const o = n; 647 (this.cachedSections = [...this.cachedSections, { html: o, url: e }]), this.renderSection(o, t), i(t); 648 }) 649 .catch((e) => n(e)); 650 }) 651 ); 652 }, 653 renderSection: function (e, t) { 654 this.log("[AjaxRenderer] rendering section: section=" + JSON.stringify(t)); 655 const i = new DOMParser().parseFromString(e, "text/html"); 656 return ( 657 this.onReplace 658 ? this.onReplace(i, t) 659 : "string" == typeof t.nodeId 660 ? (document.getElementById(t.nodeId).innerHTML = i.getElementById(t.nodeId).innerHTML) 661 : t.nodeId.forEach((e) => { 662 document.getElementById(e).innerHTML = i.getElementById(e).innerHTML; 663 }), 664 t 665 ); 666 }, 667 appendPreservedParams: function (e) { 668 this.preserveParams.forEach((t) => { 669 const i = new URLSearchParams(window.location.search).get(t); 670 i && (this.log(`[AjaxRenderer] Preserving ${t} param`), e.append(t, i)); 671 }); 672 }, 673 updateURLHash: function (e) { 674 history.pushState({}, "", `${window.location.pathname}${e && "?".concat(e)}`); 675 }, 676 log: function (...e) { 677 this.debug && console.log(...e); 678 }, 679 })), 680 e 681 ); 682 })()), 683 (theme.cart = { 684 getCart: function () { 685 var e = "".concat(theme.routes.cart, "?t=").concat(Date.now()); 686 return fetch(e, { credentials: "same-origin", method: "GET" }).then((e) => e.json()); 687 }, 688 getCartProductMarkup: function () { 689 var e = "".concat(theme.routes.cartPage, "?t=").concat(Date.now()); 690 return ( 691 (e = -1 === e.indexOf("?") ? e + "?view=ajax" : e + "&view=ajax"), 692 fetch(e, { credentials: "same-origin", method: "GET" }).then(function (e) { 693 return e.text(); 694 }) 695 ); 696 }, 697 changeItem: function (e, t) { 698 return this._updateCart({ url: "".concat(theme.routes.cartChange, "?t=").concat(Date.now()), data: JSON.stringify({ id: e, quantity: t }) }); 699 }, 700 _updateCart: function (e) { 701 return fetch(e.url, { method: "POST", body: e.data, credentials: "same-origin", headers: { "Content-Type": "application/json", "X-Requested-With": "XMLHttpRequest" } }) 702 .then((e) => e.json()) 703 .then(function (e) { 704 return e; 705 }); 706 }, 707 updateAttribute: function (e, t) { 708 return this._updateCart({ url: "/cart/update.js", data: JSON.stringify({ attributes: { [e]: theme.cart.attributeToString(t) } }) }); 709 }, 710 updateNote: function (e) { 711 return this._updateCart({ url: "/cart/update.js", data: JSON.stringify({ note: theme.cart.attributeToString(e) }) }); 712 }, 713 attributeToString: function (e) { 714 return "string" != typeof e && "undefined" === (e += "") && (e = ""), e.trim(); 715 }, 716 }), 717 (theme.CartForm = (function () { 718 var e = "[data-products]", 719 t = ".js-qty__wrapper", 720 i = "[data-discounts]", 721 n = "[data-savings]", 722 o = "[data-subtotal]", 723 s = ".cart-link__bubble", 724 a = '[name="note"]', 725 r = ".cart__terms-checkbox", 726 c = ".cart__checkout", 727 d = "btn--loading", 728 l = { requiresTerms: !1 }; 729 function h(t) { 730 t && 731 ((this.form = t), 732 (this.wrapper = t.parentNode), 733 (this.location = t.dataset.location), 734 (this.namespace = ".cart-" + this.location), 735 (this.products = t.querySelector(e)), 736 (this.submitBtn = t.querySelector(c)), 737 (this.discounts = t.querySelector(i)), 738 (this.savings = t.querySelector(n)), 739 (this.subtotal = t.querySelector(o)), 740 (this.termsCheckbox = t.querySelector(r)), 741 (this.noteInput = t.querySelector(a)), 742 this.termsCheckbox && (l.requiresTerms = !0), 743 this.init()); 744 } 745 return ( 746 (h.prototype = Object.assign({}, h.prototype, { 747 init: function () { 748 this.initQtySelectors(), 749 document.addEventListener("cart:quantity" + this.namespace, this.quantityChanged.bind(this)), 750 this.form.on("submit" + this.namespace, this.onSubmit.bind(this)), 751 this.noteInput && 752 this.noteInput.addEventListener("change", function () { 753 var e = this.value; 754 theme.cart.updateNote(e); 755 }), 756 document.addEventListener( 757 "cart:build", 758 function () { 759 this.buildCart(); 760 }.bind(this) 761 ); 762 }, 763 reInit: function () { 764 this.initQtySelectors(); 765 }, 766 onSubmit: function (e) { 767 if ((this.submitBtn.classList.add(d), l.requiresTerms && !this.termsCheckbox.checked)) return alert(theme.strings.cartTermsConfirmation), this.submitBtn.classList.remove(d), e.preventDefault(), !1; 768 }, 769 _parseProductHTML: function (e) { 770 var t = new DOMParser().parseFromString(e, "text/html"); 771 return { items: t.querySelector(".cart__items"), discounts: t.querySelector(".cart__discounts") }; 772 }, 773 buildCart: function () { 774 theme.cart.getCartProductMarkup().then(this.cartMarkup.bind(this)); 775 }, 776 cartMarkup: function (e) { 777 var t = this._parseProductHTML(e), 778 i = t.items, 779 n = parseInt(i.dataset.count), 780 o = i.dataset.cartSubtotal, 781 s = i.dataset.cartSavings; 782 this.updateCartDiscounts(t.discounts), 783 this.updateSavings(s), 784 n > 0 ? this.wrapper.classList.remove("is-empty") : this.wrapper.classList.add("is-empty"), 785 this.updateCount(n), 786 (this.products.innerHTML = ""), 787 this.products.append(i), 788 (this.subtotal.innerHTML = theme.Currency.formatMoney(o, theme.settings.moneyFormat)), 789 this.reInit(), 790 window.AOS && AOS.refreshHard(), 791 Shopify && Shopify.StorefrontExpressButtons && Shopify.StorefrontExpressButtons.initialize(); 792 }, 793 updateCartDiscounts: function (e) { 794 this.discounts && ((this.discounts.innerHTML = ""), this.discounts.append(e)); 795 }, 796 initQtySelectors: function () { 797 this.form.querySelectorAll(t).forEach((e) => { 798 new theme.QtySelector(e, { namespace: this.namespace, isCart: !0 }); 799 }); 800 }, 801 quantityChanged: function (e) { 802 var t = e.detail[0], 803 i = e.detail[1], 804 n = e.detail[2]; 805 t && 806 i && 807 (n && n.classList.add("is-loading"), 808 theme.cart 809 .changeItem(t, i) 810 .then( 811 function (e) { 812 e.item_count > 0 ? this.wrapper.classList.remove("is-empty") : this.wrapper.classList.add("is-empty"), 813 this.buildCart(), 814 document.dispatchEvent(new CustomEvent("cart:updated", { detail: { cart: e } })); 815 }.bind(this) 816 ) 817 .catch(function (e) {})); 818 }, 819 updateSubtotal: function (e) { 820 this.form.querySelector(o).innerHTML = theme.Currency.formatMoney(e, theme.settings.moneyFormat); 821 }, 822 updateSavings: function (e) { 823 if (this.savings) 824 if (e > 0) { 825 var t = theme.Currency.formatMoney(e, theme.settings.moneyFormat); 826 this.savings.classList.remove("hide"), (this.savings.innerHTML = theme.strings.cartSavings.replace("[savings]", t)); 827 } else this.savings.classList.add("hide"); 828 }, 829 updateCount: function (e) { 830 var t = document.querySelectorAll(".cart-link__bubble-num"); 831 t.length && 832 t.forEach((t) => { 833 t.innerText = e; 834 }); 835 var i = document.querySelectorAll(s); 836 i.length && 837 (e > 0
838 ? i.forEach((e) => { 839 e.classList.add("cart-link__bubble--visible"); 840 }) 841 : i.forEach((e) => { 842 e.classList.remove("cart-link__bubble--visible"); 843 })); 844 }, 845 })), 846 h 847 ); 848 })()), 849 (theme.collapsibles = (function () { 850 var e = ".collapsible-trigger", 851 t = ".collapsible-content", 852 i = ".collapsible-content__inner", 853 n = ".collapsible-trigger--tab", 854 o = "hide", 855 s = "is-open", 856 a = "collapsible--auto-height", 857 r = "collapsible-trigger--tab", 858 c = !1; 859 function d(e) { 860 if (!c) { 861 c = !0; 862 var o = e.currentTarget, 863 d = o.classList.contains(s), 864 h = o.classList.contains(r), 865 u = o.getAttribute("aria-controls"), 866 m = document.getElementById(u); 867 if ((u || (u = o.dataset.controls), u)) { 868 if (!m) document.querySelectorAll('[data-id="' + u + '"]').length > 0 && (m = o.parentNode.querySelector('[data-id="' + u + '"]')); 869 if (m) { 870 var p = m.querySelector(i).offsetHeight, 871 f = m.classList.contains(a), 872 v = m.parentNode.closest(t), 873 g = p; 874 if (h) { 875 if (d) return void (c = !1); 876 document.querySelectorAll(n + '[data-id="' + o.dataset.id + '"]').forEach((e) => { 877 e.classList.remove(s), l(document.querySelector("#" + e.getAttribute("aria-controls")), 0, !0); 878 }); 879 } 880 if ( 881 (d && 882 f && 883 setTimeout(function () { 884 l(m, (p = 0), d, f); 885 }, 0), 886 d && !f && (p = 0), 887 o.setAttribute("aria-expanded", !d), 888 d ? o.classList.remove(s) : o.classList.add(s), 889 l(m, p, d, f), 890 v) 891 ) 892 l(v, d ? v.offsetHeight - g : p + v.offsetHeight, !1, !1); 893 if (window.SPR) { 894 var y = m.querySelector(".spr-summary-actions-newreview"); 895 if (!y) return; 896 y.off("click.collapsible"), 897 y.on("click.collapsible", function () { 898 (p = m.querySelector(i).offsetHeight), l(m, p, d, f); 899 }); 900 } 901 } else c = !1; 902 } 903 } 904 } 905 function l(e, t, i, n) { 906 if ( 907 (e.classList.remove(o), 908 theme.utils.prepareTransition(e, function () { 909 (e.style.height = t + "px"), i ? e.classList.remove(s) : e.classList.add(s); 910 }), 911 !i && n) 912 ) { 913 var a = e; 914 window.setTimeout(function () { 915 a.css("height", "auto"), (c = !1); 916 }, 500); 917 } else c = !1; 918 } 919 return { 920 init: function (t) { 921 (t || document).querySelectorAll(e).forEach((e) => { 922 var t = e.classList.contains(s); 923 e.setAttribute("aria-expanded", t), e.off("click.collapsible"), e.on("click.collapsible", d); 924 }); 925 }, 926 }; 927 })()), 928 (theme.Disclosure = (function () { 929 var e = "[data-disclosure-form]", 930 t = "[data-disclosure-list]", 931 i = "[data-disclosure-toggle]", 932 n = "[data-disclosure-input]", 933 o = "[data-disclosure-option]", 934 s = "disclosure-list--visible"; 935 function a(e) { 936 (this.container = e), this._cacheSelectors(), this._setupListeners(); 937 } 938 return ( 939 (a.prototype = Object.assign({}, a.prototype, { 940 _cacheSelectors: function () { 941 this.cache = { 942 disclosureForm: this.container.closest(e), 943 disclosureList: this.container.querySelector(t), 944 disclosureToggle: this.container.querySelector(i), 945 disclosureInput: this.container.querySelector(n), 946 disclosureOptions: this.container.querySelectorAll(
946o), 947 }; 948 }, 949 _setupListeners: function () { 950 (this.eventHandlers = this._setupEventHandlers()), 951 this.cache.disclosureToggle.addEventListener("click", this.eventHandlers.toggleList), 952 this.cache.disclosureOptions.forEach(function (e) { 953 e.addEventListener("click", this.eventHandlers.connectOptions); 954 }, this), 955 this.container.addEventListener("keyup", this.eventHandlers.onDisclosureKeyUp), 956 this.cache.disclosureList.addEventListener("focusout", this.eventHandlers.onDisclosureListFocusOut), 957 this.cache.disclosureToggle.addEventListener("focusout", this.eventHandlers.onDisclosureToggleFocusOut), 958 document.body.addEventListener("click", this.eventHandlers.onBodyClick); 959 }, 960 _setupEventHandlers: function () { 961 return { 962 connectOptions: this._connectOptions.bind(this), 963 toggleList: this._toggleList.bind(this), 964 onBodyClick: this._onBodyClick.bind(this), 965 onDisclosureKeyUp: this._onDisclosureKeyUp.bind(this), 966 onDisclosureListFocusOut: this._onDisclosureListFocusOut.bind(this), 967 onDisclosureToggleFocusOut: this._onDisclosureToggleFocusOut.bind(this), 968 }; 969 }, 970 _connectOptions: function (e) { 971 e.preventDefault(), this._submitForm(e.currentTarget.dataset.value); 972 }, 973 _onDisclosureToggleFocusOut: function (e) { 974 !1 === this.container.contains(e.relatedTarget) && this._hideList(); 975 }, 976 _onDisclosureListFocusOut: function (e) { 977 var t = e.currentTarget.contains(e.relatedTarget); 978 this.cache.disclosureList.classList.contains(s) && !t && this._hideList(); 979 }, 980 _onDisclosureKeyUp: function (e) { 981 27 === e.which && (this._hideList(), this.cache.disclosureToggle.focus()); 982 }, 983 _onBodyClick: function (e) { 984 var t = this.container.contains(e.target); 985 this.cache.disclosureList.classList.contains(s) && !t && this._hideList(); 986 }, 987 _submitForm: function (e) { 988 (this.cache.disclosureInput.value = e), this.cache.disclosureForm.submit(); 989 }, 990 _hideList: function () { 991 this.cache.disclosureList.classList.remove(s), this.cache.disclosureToggle.setAttribute("aria-expanded", !1); 992 }, 993 _toggleList: function () { 994 var e = "true" === this.cache.disclosureToggle.getAttribute("aria-expanded"); 995 this.cache.disclosureList.classList.toggle(s), this.cache.disclosureToggle.setAttribute("aria-expanded", !e); 996 }, 997 destroy: function () { 998 this.cache.disclosureToggle.removeEventListener("click", this.eventHandlers.toggleList), 999 this.cache.disclosureOptions.forEach(function (e) { 1000 e.removeEventListener("click", this.eventHandlers.connectOptions); 1001 }, this), 1002 this.container.removeEventListener("keyup", this.eventHandlers.onDisclosureKeyUp), 1003 this.cache.disclosureList.removeEventListener("focusout", this.eventHandlers.onDisclosureListFocusOut), 1004 this.cache.disclosureToggle.removeEventListener("focusout", this.eventHandlers.onDisclosureToggleFocusOut), 1005 document.body.removeEventListener("click", this.eventHandlers.onBodyClick); 1006 }, 1007 })), 1008 a 1009 ); 1010 })()), 1011 (theme.Modals = (function () { 1012 function e(e, t, i) { 1013 var n = { 1014 close: ".js-modal-close", 1015 open: ".js-modal-open-" + t, 1016 openClass: "modal--is-active", 1017 closingClass: "modal--is-closing", 1018 bodyOpenClass: "modal-open", 1019 bodyOpenSolidClass: "modal-open--solid", 1020 bodyClosingClass: "modal-closing", 1021 closeOffContentClick: !0, 1022 }; 1023 if (((this.id = e), (this.modal = document.getElementById(e)), !this.modal)) return !1; 1024 (this.modalContent = this.modal.querySelector(".modal__inner")), 1025 (this.config = Object.assign(n, i)), 1026 (this.modalIsOpen = !1), 1027 (this.focusOnOpen = this.config.focusIdOnOpen ? document.getElementById(this.config.focusIdOnOpen) : this.modal), 1028 (this.isSolid = this.config.solid), 1029 this.init(); 1030 } 1031 return ( 1032 (e.prototype.init = function () { 1033 document.querySelectorAll(this.config.open).forEac
1033h((e) => { 1034 e.setAttribute("aria-expanded", "false"), e.addEventListener("click", this.open.bind(this)); 1035 }), 1036 this.modal.querySelectorAll(this.config.close).forEach((e) => { 1037 e.addEventListener("click", this.close.bind(this)); 1038 }), 1039 document.addEventListener( 1040 "drawerOpen", 1041 function () { 1042 this.close(); 1043 }.bind(this) 1044 ); 1045 }), 1046 (e.prototype.open = function (e) { 1047 var t = !1; 1048 this.modalIsOpen || 1049 (e ? e.preventDefault() : (t = !0), 1050 e && e.stopPropagation && (e.stopPropagation(), (this.activeSource = e.currentTarget.setAttribute("aria-expanded", "true"))), 1051 this.modalIsOpen && !t && this.close(), 1052 this.modal.classList.add(this.config.openClass), 1053 document.documentElement.classList.add(this.config.bodyOpenClass), 1054 this.isSolid && document.documentElement.classList.add(this.config.bodyOpenSolidClass), 1055 (this.modalIsOpen = !0), 1056 theme.a11y.trapFocus({ container: this.modal, elementToFocus: this.focusOnOpen, namespace: "modal_focus" }), 1057 document.dispatchEvent(new CustomEvent("modalOpen")), 1058 document.dispatchEvent(new CustomEvent("modalOpen." + this.id)), 1059 this.bindEvents()); 1060 }), 1061 (e.prototype.close = function (e) { 1062 if (this.modalIsOpen) { 1063 if (e) 1064 if (e.target.closest(".js-modal-close")); 1065 else if (e.target.closest(".modal__inner")) return; 1066 document.activeElement.blur(), 1067 this.modal.classList.remove(this.config.openClass), 1068 this.modal.classList.add(this.config.closingClass), 1069 document.documentElement.classList.remove(this.config.bodyOpenClass), 1070 document.documentElement.classList.add(this.config.bodyClosingClass), 1071 window.setTimeout( 1072 function () { 1073 document.documentElement.classList.remove(this.config.bodyClosingClass), 1074 this.modal.classList.remove(this.config.closingClass), 1075 this.activeSource && this.activeSource.getAttribute("aria-expanded") && this.activeSource.setAttribute("aria-expanded", "false").focus(); 1076 }.bind(this), 1077 500 1078 ), 1079 this.isSolid && document.documentElement.classList.remove(this.config.bodyOpenSolidClass), 1080 (this.modalIsOpen = !1), 1081 theme.a11y.removeTrapFocus({ container: this.modal, namespace: "modal_focus" }), 1082 document.dispatchEvent(new CustomEvent("modalClose." + this.id)), 1083 this.unbindEvents(); 1084 } 1085 }), 1086 (e.prototype.bindEvents = function () { 1087 window.on( 1088 "keyup.modal", 1089 function (e) { 1090 27 === e.keyCode && this.close(); 1091 }.bind(this) 1092 ), 1093 this.config.closeOffContentClick && this.modal.on("click.modal", this.close.bind(this)); 1094 }), 1095 (e.prototype.unbindEvents = function () { 1096 document.documentElement.off(".modal"), this.config.closeOffContentClick && this.modal.off(".modal"); 1097 }), 1098 e 1099 ); 1100 })()), 1101 (window.onpageshow = function (e) { 1102 e.persisted && 1103 (document.body.classList.remove("unloading"), 1104 document.querySelectorAll(".cart__checkout").forEach((e) => { 1105 e.classList.remove("btn--loading"); 1106 })); 1107 }), 1108 (theme.pageTransitions = function () { 1109 "true" === document.body.dataset.transitions && 1110 (navigator.userAgent.match(/Version\/[\d\.]+.*Safari/) && 1111 document.querySelectorAll("a").forEach((e) => { 1112 window.setTimeout(function () { 1113 document.body.classList.remove("unloading"); 1114 }, 1200); 1115 }), 1116 document.querySelectorAll('a[href^="mailto:"], a[href^="#"], a[target="_blank"], a[href*="youtube.com/watch"], a[href*="youtu.be/"], a[download]').forEach((e) => { 1117 e.classList.add("js-no-transition"); 1118 }), 1119 document.querySelectorAll("a:not(.js-no-transition)").forEach((e) => { 1120 e.addEventListener("click", function (t) { 1121 if (t.metaKey) return !0; 1122 t.preventDefault(), document.body.classList.add("unloading"); 1123 var i = e.getAttribute("href"); 1124 window.setTimeout(function () { 1125 location.href = i; 1126 }, 50); 1127 }); 1128 }), 1129 document.querySelectorAll("a.mobile-nav__link").forEach((e) => { 1130 e.addEventListener("click", function () { 1131 theme.NavDrawer.close(); 1132 }); 1133 })); 1134 }), 1135 (theme.parallaxSections = {}), 1136 (theme.Parallax = (function () { 1137 var e = !1; 1138 function t(e, t) { 1139 (this.isInit = !1), 1140 (this.isVisible = !1), 1141 (this.container = e), 1142 (this.image = e.querySelector(".parallax-image")), 1143 (this.namespace = t.namespace), 1144 (this.desktopOnly = t.desktopOnly), 1145 this.container && 1146 this.image && 1147 (this.desktopOnly && 1148 (document.addEventListener( 1149 "matchSmall", 1150 function () { 1151 this.destroy(); 1152 }.bind(this) 1153 ), 1154 document.addEventListener( 1155 "unmatchSmall", 1156 function () { 1157 this.init(!0); 1158 }.bind(this) 1159 )), 1160 this.init(this.desktopOnly)); 1161 } 1162 return ( 1163 (t.prototype = Object.assign({}, t.prototype, { 1164 init: function (e) { 1165 (this.isInit && this.destroy(), (this.isInit = !0), e && theme.config.bpSmall) || 1166 (this.setSizes(), 1167 this.scrollHandler(), 1168 new IntersectionObserver( 1169 (e, t) => { 1170 e.forEach((e) => { 1171 (this.isVisible = e.isIntersecting), this.isVisible ? window.on("scroll" + this.namespace, this.onScroll.bind(this)) : window.off("scroll" + this.namespace); 1172 }); 1173 }, 1174 { rootMargin: "200px 0px 200px 0px" } 1175 ).observe(this.container), 1176 window.on("resize" + this.namespace, theme.utils.debounce(250, this.setSizes.bind(this))), 1177 document.addEventListener("shopify:section:reorder", theme.utils.debounce(250, this.onReorder.bind(this)))); 1178 }, 1179 onScroll: function () { 1180 this.isVisible && (window.SPR && !e && (this.setSizes(), (e = !0)), requestAnimationFrame(this.scrollHandler.bind(this))); 1181 }, 1182 scrollHandler: function () { 1183 var e = 0.85 * (window.scrollY - this.elTop); 1184 this.image.style.transform = "translate3d(0, " + e + "px, 0)"; 1185 }, 1186 setSizes: function () { 1187 var e = this.container.getBoundingClientRect(); 1188 this.elTop = e.top + window.scrollY; 1189 }, 1190 onReorder: function () { 1191 this.setSizes(), this.onScroll(); 1192 }, 1193 destroy: function () { 1194 (this.image.style.transform = "none"), window.off("scroll" + this.namespace), window.off("resize" + this.namespace); 1195 }, 1196 })), 1197 t 1198 ); 1199 })()), 1200 void 0 === window.noUiSlider) 1201 ) 1202 throw new Error("theme.PriceRange is missing vendor noUiSlider: // =require vendor/nouislider.js"); 1203 if ( 1204 ((theme.PriceRange = (function () { 1205 var e = ".price-range__slider", 1206 t = ".price-range__input-min", 1207 i = ".price-range__input-max", 1208 n = ".price-range__display-min", 1209 o = ".price-range__display-max"; 1210 function s(e, { onChange: t, onUpdate: i, ...n } = {}) { 1211 return (this.container = e), (this.onChange = t), (this.onUpdate = i), (this.sliderOptions = n || {}), this.init(); 1212 } 1213 return ( 1214 (s.prototype = Object.assign({}, s.prototype, { 1215 init: function () { 1216 if (!this.container.classList.contains("price-range")) throw new Error("You must instantiate PriceRange with a valid container"); 1217 return ( 1218 (this.formEl = this.container.closest("form")), 1219 (this.sliderEl = this.container.querySelector(e)), 1220 (this.inputMinEl = this.container.querySelector(t)), 1221 (this.inputMaxEl = this.container.querySelector(i)), 1222 (this.displayMinEl = this.container.querySelector(n)), 1223 (this.displayMaxEl = this.container.querySelector(o)), 1224 (this.minRange = parseFloat(this.container.dataset.min) || 0), 1225 (this.minValue = parseFloat(this.container.dataset.minValue) || 0), 1226 (this.maxRange = parseFloat(this.container.dataset.max) || 100), 1227 (this.maxValue = parseFloat(this.container.dataset.maxValue) || this.maxRange), 1228 this.createPriceRange() 1229 ); 1230 }, 1231 createPriceRange: function () { 1232 this.sliderEl && this.sliderEl.noUiSlider && "function" == typeof this.sliderEl.noUiSlider.destroy && this.sliderEl.noUiSlider.destroy(); 1233 var e = noUiSlider.create(this.sliderEl, { connect: !0, step: 10, ...this.sliderOptions, start: [this.minValue, this.maxValue], range: { min: this.minRange, max: this.maxRange } }); 1234 return ( 1235 e.on("update", (e) => { 1236 (this.displayMinEl.innerHTML = theme.Currency.formatMoney(e[0], theme.settings.moneyFormat)), 1237 (this.displayMaxEl.innerHTML = theme.Currency.formatMoney(e[1], theme.settings.moneyFormat)), 1238 this.onUpdate && this.onUpdate(e); 1239 }), 1240 e.on("change", (e) => { 1241 if (((this.inputMinEl.value = e[0]), (this.inputMaxEl.value = e[1]), this.onChange)) { 1242 const e = new FormData(this.formEl); 1243 this.onChange(e); 1244 } 1245 }), 1246 e 1247 ); 1248 }, 1249 })), 1250 s 1251 ); 1252 })()), 1253 (theme.AjaxProduct = (function () { 1254 var e = { loading: !1 }; 1255 function t(e, t, i) { 1256 (this.form = e), (this.args = i); 1257 var n = t || ".add-to-cart"; 1258 this.form && ((this.addToCart = e.querySelector(n)), this.form.addEventListener("submit", this.addItemFromForm.bind(this))); 1259 } 1260 return ( 1261 (t.prototype = Object.assign({}, t.prototype, { 1262 addItemFromForm: function (t, i) { 1263 if ((t.preventDefault(), !e.loading)) { 1264 this.addToCart.classList.add("btn--loading"), (e.loading = !0); 1265 var n = theme.utils.serialize(this.form); 1266 fetch(theme.routes.cartAdd, { method: "POST", body: n, credentials: "same-origin", headers: { "Content-Type": "application/x-www-form-urlencoded", "X-Requested-With": "XMLHttpRequest" } }) 1267 .then((e) => e.json()) 1268 .then( 1269 function (t) { 1270 if (422 === t.status) this.error(t); 1271 else { 1272 var i = t; 1273 this.success(i); 1274 } 1275 (e.loading = !1), this.addToCart.classList.remove("btn--loading"), document.body.classList.contains("template-cart") && (window.scrollTo(0, 0), location.reload()); 1276 }.bind(this) 1277 ); 1278 } 1279 }, 1280 success: function (e) { 1281 var t = this.form.querySelector(".errors"); 1282 t && t.remove(), 1283 document.dispatchEvent(new CustomEvent("ajaxProduct:added", { detail: { product: e, addToCartBtn: this.addToCart } })), 1284 this.args && this.args.scopedEventId && document.dispatchEvent(new CustomEvent("ajaxProduct:added:"
1284+ this.args.scopedEventId, { detail: { product: e, addToCartBtn: this.addToCart } })); 1285 }, 1286 error: function (e) { 1287 if (e.description) { 1288 var t = this.form.querySelector(".errors"); 1289 t && t.remove(); 1290 var i = document.createElement("div"); 1291 i.classList.add("errors", "text-center"), 1292 (i.textContent = e.description), 1293 this.form.append(i), 1294 document.dispatchEvent(new CustomEvent("ajaxProduct:error", { detail: { errorMessage: e.description } })), 1295 this.args && this.args.scopedEventId && document.dispatchEvent(new CustomEvent("ajaxProduct:error:" + this.args.scopedEventId, { detail: { errorMessage: e.description } })); 1296 } else console.warn(e); 1297 }, 1298 })), 1299 t 1300 ); 1301 })()), 1302 (theme.ProductMedia = (function () { 1303 var e = {}, 1304 t = {}, 1305 i = {}, 1306 n = "[data-product-single-media-group]", 1307 o = "[data-shopify-xr]"; 1308 function s(t) { 1309 if (!t) 1310 if (window.ShopifyXR) { 1311 for (var i in e) 1312 if (e.hasOwnProperty(i)) { 1313 var n = e[i]; 1314 if (n.loaded) continue; 1315 var o = document.querySelector("#ModelJson-" + i); 1316 window.ShopifyXR.addModels(JSON.parse(o.innerHTML)), (n.loaded = !0); 1317 } 1318 window.ShopifyXR.setupXRElements(); 1319 } else 1320 document.addEventListener("shopify_xr_initialized", function () { 1321 s(); 1322 }); 1323 } 1324 function a(e) { 1325 if (!e) 1326 for (var i in t) 1327 if (t.hasOwnProperty(i)) { 1328 var n = t[i]; 1329 !n.modelViewerUi && Shopify && (n.modelViewerUi = new Shopify.ModelViewerUI(n.element)), r(n); 1330 } 1331 } 1332 function r(e) { 1333 var t = i[e.sectionId]; 1334 e.container.addEventListener("mediaVisible", function () { 1335 t.element.setAttribute("data-shopify-model3d-id", e.modelId), theme.config.isTouch || e.modelViewerUi.play(); 1336 }), 1337 e.container.addEventListener("mediaHidden", function () { 1338 t.element.setAttribute("data-shopify-model3d-id", t.defaultId), e.modelViewerUi.pause(); 1339 }), 1340 e.container.addEventListener("xrLaunch", function () { 1341 e.modelViewerUi.pause(); 1342 }); 1343 } 1344 return { 1345 init: function (r, c) { 1346 (e[c] = { loaded: !1 }), 1347 r.forEach(function (e, s) { 1348 var a = e.dataset.mediaId, 1349 r = e.querySelector("model-viewer"), 1350 d = r.dataset.modelId; 1351 if (0 === s) { 1352 var l = e.closest(n).querySelector(o); 1353 i[c] = { element: l, defaultId: d }; 1354 } 1355 t[a] = { modelId: d, sectionId: c, container: e, element: r }; 1356 }), 1357 window.Shopify.loadFeatures([ 1358 { name: "shopify-xr", version: "1.0", onLoad: s }, 1359 { name: "model-viewer-ui", version: "1.0", onLoad: a }, 1360 ]), 1361 theme.LibraryLoader.load("modelViewerUiStyles"); 1362 }, 1363 removeSectionModels: function (i) { 1364 for (var n in t) { 1365 if (t.hasOwnProperty(n)) t[n].sectionId === i && delete t[n]; 1366 } 1367 delete e[i]; 1368 }, 1369 }; 1370 })()), 1371 (theme.QtySelector = (function () { 1372 var e = ".js-qty__num", 1373 t = ".js-qty__adjust--plus", 1374 i = ".js-qty__adjust--minus"; 1375 function n(n, o) { 1376 (this.wrapper = n), (this.plus = n.querySelector(t)), (this.minus = n.querySelector(i)), (this.input = n.querySelector(e)), (this.minValue = this.input.getAttribute("min") || 1); 1377 var s = { namespace: null, isCart: !1, key: this.input.dataset.id }; 1378 (this.options = Object.assign({}, s, o)), this.init(); 1379 } 1380 return ( 1381 (n.prototype = Object.assign({}, n.prototype, { 1382 init: function () { 1383 this.plus.addEventListener( 1384 "click", 1385 function () { 1386 var e = this._getQty(); 1387 this._change(e + 1); 1388 }.bind(this) 1389 ), 1390 this.minus.addEventListener( 1391 "click", 1392 function () { 1393 var e = this._getQty(); 1394 this._change(e - 1); 1395 }.bind(this) 1396 ), 1397 this.input.addEventListener( 1398 "change", 1399 function (e) { 1400 this._change(this._getQty()); 1401 }.bind(this) 1402 ); 1403 }, 1404 _getQty: function () { 1405 var e = this.input.value; 1406 return (parseFloat(e) != parseInt(e) || isNaN(e)) && (e = 1), parseInt(e); 1407 }, 1408 _change: function (e) { 1409 e <= this.minValue && (e = this.minValue), 1410 (this.input.value = e), 1411 this.options.isCart && document.dispatchEvent(new CustomEvent("cart:quantity" + this.options.namespace, { detail: [this.options.key, e, this.wrapper] })); 1412 }, 1413 })), 1414 n 1415 ); 1416 })()), 1417 (theme.Slideshow = (function () { 1418 var e = "animate-out", 1419 t = "is-paused", 1420 i = "is-active", 1421 n = ".slideshow__slide", 1422 o = ".is-selected", 1423 s = ".slideshow-wrapper", 1424 a = ".slideshow__pause", 1425 r = ".product__thumb-item:not(.hide)", 1426 c = ".product__thumb-item:not(.hide) a", 1427 d = ".product__thumb-arrow", 1428 l = { 1429 adaptiveHeight: !1, 1430 autoPlay: !1, 1431 avoidReflow: !1, 1432 childNav: null, 1433 childNavScroller: null, 1434 childVertical: !1, 1435 fade: !1, 1436 initialIndex: 0, 1437 pageDots: !1, 1438 pauseAutoPlayOnHover: !1, 1439 prevNextButtons: !1, 1440 rightToLeft: theme.config.rtl, 1441 setGallerySize: !0, 1442 wrapAround: !0, 1443 }; 1444 function h(e, t) { 1445 if ( 1446 ((this.el = e), 1447 (this.args = Object.assign({}, l, t)), 1448 (this.args.on = { ready: this.init.bind(this), change: this.slideChange.bind(this), settle: this.afterChange.bind(this) }), 1449 this.args.childNav && 1450 ((this.childNavEls = this.args.childNav.querySelectorAll(r)), 1451 (this.childNavLinks = this.args.childNav.querySelectorAll(c)), 1452 (this.arrows = this.args.childNav.querySelectorAll(d)), 1453 this.childNavLinks.length && this.initChildNav()), 1454 this.args.avoidReflow && 1455 (function (e) { 1456 if (!e.id) return; 1457 var t = e.firstChild; 1458 for (; null != t && 3 == t.nodeType; ) t = t.nextSibling; 1459 var i = document.createElement("style"); 1460 (i.innerHTML = `#${e.id} .flickity-viewport{height:${t.offsetHeight}px}`), document.head.appendChild(i); 1461 })(e), 1462 (this.slideshow = new Flickity(e, this.args)), 1463 this.args.autoPlay) 1464 ) { 1465 var i = e.closest(s); 1466 (this.pauseBtn = i.querySelector(a)), this.pauseBtn && this.pauseBtn.addEventListener("click", this._togglePause.bind(this)); 1467 } 1468 window.on( 1469 "resize", 1470 theme.utils.debounce( 1471 300, 1472 function () { 1473 this.resize(); 1474 }.bind(this) 1475 ) 1476 ); 1477 } 1478 return ( 1479 (h.prototype = Object.assign({}, h.prototype, { 1480 init: function (e) { 1481 (this.currentSlide = this.el.querySelector(o)), 1482 this.args.callbacks && this.args.callbacks.onInit && "function" == typeof this.args.callbacks.onInit && this.args.callbacks.onInit(this.currentSlide), 1483 window.AOS && AOS.refresh(); 1484 }, 1485 slideChange: function (t) { 1486 this.args.fade && 1487 this.currentSlide && 1488 (this.currentSlide.classList.add(e), 1489 this.currentSlide.addEventListener( 1490 "transitionend", 1491 function () { 1492 this.currentSlide.classList.remove(e); 1493 }.bind(this) 1494 )), 1495 this.args.childNav && this.childNavGoTo(t), 1496 this.args.callbacks && this.args.callbacks.onChange && "function" == typeof this.args.callbacks.onChange && this.args.callbacks.onChange(t), 1497 this.arrows && this.arrows.length && (this.arrows[0].classList.toggle("hide", 0 === t), this.arrows[1].classList.toggle("hide", t === this.childNavLinks.length - 1)); 1498 }, 1499 afterChange: function (t) { 1500 this.args.fade && 1501 this.el.querySelectorAll(n).forEac
1501h((t) => { 1502 t.classList.remove(e); 1503 }), 1504 (this.currentSlide = this.el.querySelector(o)), 1505 this.args.childNav && this.childNavGoTo(this.slideshow.selectedIndex); 1506 }, 1507 destroy: function () { 1508 this.args.childNav && 1509 this.childNavLinks.length && 1510 this.childNavLinks.forEach((e) => { 1511 e.classList.remove(i); 1512 }), 1513 this.slideshow.destroy(); 1514 }, 1515 _togglePause: function () { 1516 this.pauseBtn.classList.contains(t) ? (this.pauseBtn.classList.remove(t), this.slideshow.playPlayer()) : (this.pauseBtn.classList.add(t), this.slideshow.pausePlayer()); 1517 }, 1518 resize: function () { 1519 this.slideshow.resize(); 1520 }, 1521 play: function () { 1522 this.slideshow.playPlayer(); 1523 }, 1524 pause: function () { 1525 this.slideshow.pausePlayer(); 1526 }, 1527 goToSlide: function (e) { 1528 this.slideshow.select(e); 1529 }, 1530 setDraggable: function (e) { 1531 (this.slideshow.options.draggable = e), this.slideshow.updateDraggable(); 1532 }, 1533 initChildNav: function () { 1534 this.childNavLinks[this.args.initialIndex].classList.add("is-active"), 1535 this.childNavLinks.forEach((e, t) => { 1536 e.setAttribute("data-index", t), 1537 e.addEventListener( 1538 "click", 1539 function (e) { 1540 e.preventDefault(), this.goToSlide(this.getChildIndex(e.currentTarget)); 1541 }.bind(this) 1542 ), 1543 e.addEventListener( 1544 "focus", 1545 function (e) { 1546 this.goToSlide(this.getChildIndex(e.currentTarget)); 1547 }.bind(this) 1548 ), 1549 e.addEventListener( 1550 "keydown", 1551 function (e) { 1552 13 === e.keyCode && this.goToSlide(this.getChildIndex(e.currentTarget)); 1553 }.bind(this) 1554 ); 1555 }), 1556 this.arrows.length && 1557 this.arrows.forEach((e) => { 1558 e.addEventListener("click", this.arrowClick.bind(this)); 1559 }); 1560 }, 1561 getChildIndex: function (e) { 1562 return parseInt(e.dataset.index); 1563 }, 1564 childNavGoTo: function (e) { 1565 this.childNavLinks.forEach((e) => { 1566 e.classList.remove(i); 1567 }); 1568 var t = this.childNavLinks[e]; 1569 if ((t.classList.add(i), this.args.childNavScroller)) 1570 if (this.args.childVertical) { 1571 var n = t.offsetTop; 1572 this.args.childNavScroller.scrollTop = n - 100; 1573 } else { 1574 var o = t.offsetLeft; 1575 this.args.childNavScroller.scrollLeft = o - 100; 1576 } 1577 }, 1578 arrowClick: function (e) { 1579 e.currentTarget.classList.contains("product__thumb-arrow--prev") ? this.slideshow.previous() : this.slideshow.next(); 1580 }, 1581 })), 1582 h 1583 ); 1584 })()), 1585 (theme.VariantAvailability = (function () { 1586 var e = "disabled"; 1587 function t(e) {
1588 (this.type = e.type), (this.variantsObject = e.variantsObject), (this.currentVariantObject = e.currentVariantObject), (this.container = e.container), (this.namespace = e.namespace), this.init(); 1589 } 1590 return ( 1591 (t.prototype = Object.assign({}, t.prototype, { 1592 init: function () { 1593 this.container.on("variantChange" + this.namespace, this.setAvailability.bind(this)), this.setAvailability(null, this.currentVariantObject); 1594 }, 1595 setAvailability: function (e, t) { 1596 if (e) t = e.detail.variant; 1597 var i = { option1: [], option2: [], option3: [] }, 1598 n = this.variantsObject.filter(function (e) { 1599 return ( 1600 !(!t || t.id === e.id) && 1601 ((t.option2 === e.option2 && t.option3 === e.option3) || (t.option1 === e.option1 && t.option3 === e.option3) || (t.option1 === e.option1 && t.option2 === e.option2) || void 0) 1602 ); 1603 }), 1604 o = Object.assign({}, { variant: t }, n); 1605 for (var s in (this.container.querySelectorAll(".variant-input-wrap").forEach((e) => { 1606 this.disableVariantGroup(e); 1607 }), 1608 o)) 1609 if (o.hasOwnProperty(s)) { 1610 var a = o[s]; 1611 if (!a) return; 1612 var r = a.option1, 1613 c = a.option2, 1614 d = a.option3, 1615 l = !1 === a.available; 1616 r && i.option1.push({ value: r, soldOut: l }), c && i.option2.push({ value: c, soldOut: l }), d && i.option3.push({ value: d, soldOut: l }); 1617 } 1618 for (var [h, u] of Object.entries(i)) this.manageOptionState(h, u); 1619 }, 1620 manageOptionState: function (e, t) { 1621 var i = this.container.querySelector('.variant-input-wrap[data-index="' + e + '"]'); 1622 t.forEach((e) => { 1623 this.enableVariantOption(i, e); 1624 }); 1625 }, 1626 enableVariantOptionByValue: function (e, t) { 1627 for (var i = this.container.querySelector('.variant-input-wrap[data-index="' + t + '"]'), n = 0; n < e.length; n++) this.enableVariantOption(i, e[n]); 1628 }, 1629 enableVariantOption: function (t, i) { 1630 var n = i.value.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, "\\$1"); 1631 if ("dropdown" === this.type) t.querySelector('option[value="' + n + '"]').disabled = !1; 1632 else { 1633 var o = t.querySelector('.variant-input[data-value="' + n + '"]'), 1634 s = o.querySelector("input"), 1635 a = o.querySelector("label"); 1636 s.classList.remove(e), a.classList.remove(e), i.soldOut && (s.classList.add(e), a.classList.add(e)); 1637 } 1638 }, 1639 disableVariantGroup: function (t) { 1640 "dropdown" === this.type 1641 ? t.querySelectorAll("option").forEach((e) => { 1642 e.disabled = !0; 1643 }) 1644 : (t.querySelectorAll("input").forEach((t) => { 1645 t.classList.add(e); 1646 }), 1647 t.querySelectorAll("label").forEach((t) => { 1648 t.classList.add(e); 1649 })); 1650 }, 1651 })), 1652 t 1653 ); 1654 })()), 1655 (theme.videoModal = function () { 1656 var e, 1657 t = 'a[href*="youtube.com/watch"], a[href*="youtu.be/"]', 1658 i = ".product-video-trigger--mp4", 1659 n = ".product-video-mp4-sound", 1660 o = document.querySelectorAll(t), 1661 s = document.querySelectorAll(i); 1662 if (o.length || s.length) { 1663 var a = document.getElementById("VideoHolder"); 1664 o.length && theme.LibraryLoader.load("youtubeSdk"); 1665 var r = new theme.Modals("VideoModal", "video-modal", { closeOffContentClick: !0, solid: !0 }); 1666 o.forEach((e) => { 1667 e.addEventListener("click", c); 1668 }),
1669 s.forEach((e) => { 1670 e.addEventListener("click", d); 1671 }), 1672 document.addEventListener("modalClose.VideoModal", function () { 1673 e && "function" == typeof e.destroy ? e.destroy() : h(); 1674 }); 1675 } 1676 function c(t) { 1677 if (theme.config.youTubeReady) { 1678 t.preventDefault(), h(), r.open(t); 1679 var i, 1680 n, 1681 o = ((i = t.currentTarget.getAttribute("href")), !(!(n = i.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/)) || 11 != n[7].length) && n[7]); 1682 e = new theme.YouTube("VideoHolder", { videoId: o, style: "sound", events: { onReady: l } }); 1683 } 1684 } 1685 function d(e) { 1686 h(); 1687 var t = e.currentTarget.parentNode.querySelector(n).cloneNode(!0); 1688 t.classList.remove("hide"), a.append(t), r.open(e), a.querySelector("video").play(); 1689 } 1690 function l(e) { 1691 e.target.unMute(), e.target.playVideo(); 1692 } 1693 function h() { 1694 a.innerHTML = ""; 1695 } 1696 }), 1697 (theme.announcementBar = (function () { 1698 var e, 1699 t, 1700 i = { autoPlay: 5e3, avoidReflow: !0, cellAlign: theme.config.rtl ? "right" : "left", fade: !0 }; 1701 function n() { 1702 t && "function" == typeof t.destroy && t.destroy(); 1703 } 1704 return { 1705 init: function () { 1706 (e = document.getElementById("AnnouncementSlider")) && (n(), 1 !== e.dataset.blockCount && (t = new theme.Slideshow(e, i))); 1707 }, 1708 onBlockSelect: function (i) { 1709 var n = e.querySelector("#AnnouncementSlide-" + i), 1710 o = parseInt(n.dataset.index); 1711 t && "function" == typeof t.pause && (t.goToSlide(o), t.pause()); 1712 }, 1713 onBlockDeselect: function () { 1714 t && "function" == typeof t.play && t.play(); 1715 }, 1716 unload: n, 1717 }; 1718 })()), 1719 (theme.customerTemplates = function () { 1720 function e() { 1721 document.getElementById("RecoverPasswordForm").classList.toggle("hide"), document.getElementById("CustomerLoginForm").classList.toggle("hide"); 1722 } 1723 "#recover" === window.location.hash && e(), 1724 (function () { 1725 var t = document.getElementById("RecoverPassword"); 1726 t && 1727 t.addEventListener("click", function (t) { 1728 t.preventDefault(), e(); 1729 }); 1730 var i = document.getElementById("HideRecoverPasswordLink"); 1731 i && 1732 i.addEventListener("click", function (t) { 1733 t.preventDefault(), e(); 1734 }); 1735 })(), 1736 (function () { 1737 if (!document.querySelector(".reset-password-success")) return; 1738 document.getElementById("ResetSuccess").classList.remove("hide"); 1739 })(), 1740 (function () { 1741 var e = document.getElementById("AddressNewForm"), 1742 t = document.querySelectorAll(".js-address-form"); 1743 if (!e || !t.length) return; 1744 setTimeout(function () { 1745 document.querySelectorAll(".js-address-country").forEach((e) => { 1746 var t = e.dataset.countryId, 1747 i = e.dataset.provinceId, 1748 n = e.dataset.provinceContainerId; 1749 new Shopify.CountryProvinceSelector(t, i, { hideElement: n }); 1750 }); 1751 }, 1e3), 1752 document.querySelector(".address-new-toggle").addEventListener("click", function () { 1753 e.classList.toggle("hide"); 1754 }), 1755 document.querySelectorAll(".address-edit-toggle").forEach((e) => { 1756 e.addEventListener("click", function (e) { 1757 var t = e.currentTarget.dataset.formId; 1758 document.getElementById("EditAddress_" + t).classList.toggle("hide"); 1759 }); 1760 }), 1761 document.querySelectorAll(".address-delete").forEach((e) => { 1762 e.addEventListener("click", function (e) { 1763 var t = e.currentTarget.dataset.formId, 1764 i = e.currentTarget.dataset.confirmMessage; 1765 confirm(i || "Are you sure you wish to delete this address?") && Shopify && Shopify.postLink("/account/addresses/" + t, { parameters: { _method: "delete" } }); 1766 }); 1767 }); 1768 })(); 1769 }), 1770 (theme.headerNav = (function () { 1771 var e, 1772 t, 1773 i, 1774 n, 1775 o = "#HeaderWrapper", 1776 s = "#SiteHeader", 1777 a = "#LogoContainer img", 1778 r = ".megamenu", 1779 c = ".site-navigation", 1780 d = ".site-nav__item", 1781 l = ".site-nav__link", 1782 h = ".site-nav__link--has-dropdown", 1783 u = ".site-nav__dropdown-link--second-level", 1784 m = ".site-nav__compress-menu", 1785 p = '[data-type="nav"]', 1786 f = '[data-type="search"]', 1787 v = "site-nav--has-dropdown", 1788 g = "site-nav__deep-dropdown-trigger", 1789 y = "is-focused", 1790 S = "header-wrapper--compressed", 1791 b = "is-light", 1792 w = { namespace: ".siteNav", wrapperOverlayed: !1, stickyEnabled: !1, stickyActive: !1, subarPositionInit: !1, threshold: 0 }; 1793 function L() { 1794 theme.settings.overlayHeader && document.querySelector(".header-section").classList.add("header-section--overlay"); 1795 var t = theme.config.bpSmall ? document.querySelector('.site-header__element--sub[data-type="search"]') : document.querySelector('.site-header__element--sub[data-type="nav"]'); 1796 if (t) { 1797 var i = t.offsetHeight; 1798 0 !== i && document.documentElement.style.setProperty("--header-padding-bottom", i + "px"), w.subarPositionInit || (e.classList.add("header-wrapper--init"), (w.subarPositionInit = !0)); 1799 } 1800 } 1801 function E() { 1802 document.querySelector(".header-section").style.position = "relative"; 1803 } 1804 function _() { 1805 w.stickyEnabled && (w.forceStopSticky || requestAnimationFrame(k)); 1806 } 1807 function k() { 1808 if (window.scrollY > w.threshold) { 1809 if (w.stickyActive) return; 1810 i && theme.utils.prepareTransition(i), 1811 n && theme.utils.prepareTransition(n), 1812 (w.stickyActive = !0), 1813 e.classList.add(S), 1814 w.wrapperOverlayed && e.classList.remove(b), 1815 document.dispatchEvent(new CustomEvent("headerStickyChange")); 1816 } else { 1817 if (!w.stickyActive) return; 1818 i && theme.utils.prepareTransition(i), 1819 n && theme.utils.prepareTransition(n), 1820 (w.stickyActive = !1), 1821 (w.threshold = e.getBoundingClientRect().top), 1822 e.classList.remove(S), 1823 w.wrapperOverlayed && e.classList.add(b), 1824 document.dispatchEvent(new CustomEvent("headerStickyChange")); 1825 } 1826 } 1827 function I(e) {
1828 document.querySelectorAll(a).forEach((e) => { 1829 var t = e.clientWidth, 1830 i = e.closest(".header-item").clientWidth; 1831 t > i ? (e.style.maxWidth = i) : e.removeAttribute("style"); 1832 }); 1833 } 1834 return { 1835 init: function () { 1836 var a; 1837 (e = document.querySelector(o)), 1838 (t = document.querySelector(s)), 1839 (i = e.querySelector(p)), 1840 (n = e.querySelector(f)), 1841 (w.threshold = e.getBoundingClientRect().top), 1842 (w.subarPositionInit = !1), 1843 (w.stickyEnabled = "true" === t.dataset.sticky), 1844 w.stickyEnabled 1845 ? ((w.wrapperOverlayed = e.classList.contains(b)), 1846 (theme.config.stickyHeader = 1847 ((a = 0), 1848 t.querySelectorAll(r).forEach((e) => { 1849 var t = e.offsetHeight; 1850 t > a && (a = t); 1851 }), 1852 !(window.innerHeight < a + 120))), 1853 theme.config.stickyHeader ? ((w.forceStopSticky = !1), window.scrollY > w.threshold && _(), window.on("scroll" + w.namespace, _)) : ((w.forceStopSticky = !0), E())) 1854 : E(), 1855 (theme.settings.overlayHeader = "true" === t.dataset.overlay), 1856 theme.settings.overlayHeader && Shopify && Shopify.designMode && document.body.classList.contains("template-collection") && !document.querySelector(".collection-hero") && this.disableOverlayHeader(), 1857 L(), 1858 window.on("resize" + w.namespace, theme.utils.debounce(250, L)); 1859 var S = e.querySelector(m); 1860 S && 1861 S.on("click", function () { 1862 S.classList.toggle("is-active"), 1863 theme.utils.prepareTransition(i, function () { 1864 i.classList.toggle("is-active"); 1865 }); 1866 }), 1867 (function () { 1868 var e = !1, 1869 t = !1, 1870 i = !1; 1871 theme.config.isTouch && 1872 document.querySelectorAll(h).forEach((e) => { 1873 e.on("touchend" + w.namespace, function (e) { 1874 e.currentTarget.parentNode.classList.contains(y) ? window.location.replace(e.currentTarget.getAttribute("href")) : (e.preventDefault(), a(), o(e.currentTarget)); 1875 }); 1876 }); 1877 function n(i) { 1878 e && r(), t && c(), o(i.currentTarget); 1879 } 1880 function o(t) { 1881 var n = t.parentNode; 1882 if ((n.classList.contains(v) && (n.classList.add(y), (e = !0)), !theme.config.isTouch && !i)) { 1883 var o = theme.config.isTouch ? "touchend" : "click"; 1884 (i = !0), 1885 document.documentElement.on( 1886 o + w.namespace, 1887 function () { 1888 a(), document.documentElement.off(o + w.namespace), (i = !1); 1889 }.bind(this) 1890 ); 1891 } 1892 } 1893 function s(e, i) { 1894 var n = e.parentNode; 1895 (n.classList.contains(g) || i) && (n.classList.add(y), (t = !0)); 1896 } 1897 function a() { 1898 r(), c(); 1899 } 1900 function r() { 1901 document.querySelectorAll(d).forEac
1901h((e) => { 1902 e.classList.remove(y); 1903 }); 1904 } 1905 function c() { 1906 document.querySelectorAll(u).forEach((e) => { 1907 e.parentNode.classList.remove(y); 1908 }); 1909 } 1910 document.querySelectorAll(l).forEach((e) => { 1911 e.on("focusin" + w.namespace, n), e.on("mouseover" + w.namespace, n), e.on("mouseleave" + w.namespace, a); 1912 }), 1913 document.querySelectorAll(u).forEach((e) => { 1914 theme.config.isTouch && 1915 e.on("touchend" + w.namespace, function (e) { 1916 var t = e.currentTarget.parentNode; 1917 t.classList.contains(g) 1918 ? t.classList.contains(y) 1919 ? window.location.replace(e.currentTarget.getAttribute("href")) 1920 : (e.preventDefault(), c(), s(e.currentTarget)) 1921 : window.location.replace(e.currentTarget.getAttribute("href")); 1922 }), 1923 e.on("focusin" + w.namespace, function (e) { 1924 c(), s(e.currentTarget, !0); 1925 }); 1926 }); 1927 })(); 1928 var k = t.querySelector(c); 1929 k.querySelectorAll(".grid-product") && (new theme.QuickAdd(k), new theme.QuickShop(k)), window.on("load" + w.namespace, I), window.on("resize" + w.namespace, theme.utils.debounce(150, I)); 1930 }, 1931 removeOverlayClass: function () { 1932 w.wrapperOverlayed && e.classList.remove(b); 1933 }, 1934 disableOverlayHeader: function () { 1935 e.classList.remove(w.overlayEnabledClass, b), (w.wrapperOverlayed = !1), (theme.settings.overlayHeader = !1); 1936 }, 1937 }; 1938 })()), 1939 (theme.MobileNav = (function () { 1940 var e = ".slide-nav__wrapper", 1941 t = ".slide-nav", 1942 i = ".slide-nav__dropdown", 1943 n = "a.slide-nav__link", 1944 o = ".js-toggle-submenu", 1945 s = ".mobile-nav-trigger", 1946 a = "is-active", 1947 r = { isOpen: !1, menuLevel: 1, inHeader: !1 }; 1948 function c(i) { 1949 (this.config = Object.assign({}, r, i)), 1950 (this.namespace = ".nav-header-" + i.id), 1951 (this.container = document.getElementById(this.config.id)), 1952 this.container && ((this.wrapper = this.container.querySelector(e)), this.wrapper && ((this.nav = this.wrapper.querySelector(t)), (this.openTriggers = document.querySelectorAll(s)), this.init())); 1953 } 1954 return ( 1955 (c.prototype = Object.assign({}, c.prototype, { 1956 init: function () { 1957 this.openTriggers.length && 1958 this.openTriggers.forEach((e) => { 1959 e.addEventListener( 1960 "click", 1961 function () { 1962 this.config.isOpen ? this.close() : this.open(); 1963 }.bind(this) 1964 ); 1965 }),
1966 this.nav.querySelectorAll(o).forEach((e) => { 1967 e.addEventListener("click", this.toggleSubNav.bind(this)); 1968 }), 1969 this.nav.querySelectorAll(n).forEach((e) => { 1970 e.addEventListener("click", this.close.bind(this)); 1971 }), 1972 this.inHeader && 1973 (document.addEventListener( 1974 "unmatchSmall", 1975 function () { 1976 this.close(null, !0); 1977 }.bind(this) 1978 ), 1979 document.addEventListener("CartDrawer:open", this.close.bind(this)), 1980 document.addEventListener("mobileNav:open", this.open.bind(this)), 1981 document.addEventListener("mobileNav:close", this.close.bind(this))); 1982 }, 1983 open: function (e) { 1984 e && e.preventDefault(), 1985 theme.sizeDrawer(), 1986 this.openTriggers.forEach((e) => { 1987 e.classList.add("is-active"); 1988 }), 1989 theme.utils.prepareTransition( 1990 this.container, 1991 function () { 1992 this.container.classList.add("is-active"); 1993 }.bind(this) 1994 ), 1995 window.on( 1996 "keyup" + this.namespace, 1997 function (e) { 1998 27 === e.keyCode && this.close(); 1999 }.bind(this) 2000 ), 2001 theme.headerNav.removeOverlayClass(), 2002 document.documentElement.classList.add("mobile-nav-open"), 2003 document.dispatchEvent(new CustomEvent("MobileNav:open")), 2004 (this.config.isOpen = !0), 2005 setTimeout( 2006 function () { 2007 window.on( 2008 "click" + this.namespace, 2009 function (e) { 2010 this.close(e); 2011 }.bind(this) 2012 ); 2013 }.bind(this), 2014 0 2015 ); 2016 }, 2017 close: function (e, t) { 2018 var i = !1; 2019 (e && e.target.closest && e.target.closest(".site-header__drawer") && (e.currentTarget && e.currentTarget.classList && e.currentTarget.classList.contains("slide-nav__link") && (i = !0), !i)) || 2020 (this.openTriggers.forEach((e) => { 2021 e.classList.remove("is-active"); 2022 }), 2023 t 2024 ? this.container.classList.remove("is-active") 2025 : theme.utils.prepareTransition( 2026 this.container, 2027 function () { 2028 this.container.classList.remove("is-active"); 2029 }.bind(this) 2030 ), 2031 document.documentElement.classList.remove("mobile-nav-open"), 2032 document.dispatchEvent(new CustomEvent("MobileNav:close")), 2033 window.off("keyup" + this.namespace),
2034 window.off("click" + this.namespace), 2035 (this.config.isOpen = !1)); 2036 }, 2037 toggleSubNav: function (e) { 2038 var t = e.currentTarget; 2039 this.goToSubnav(t.dataset.target); 2040 }, 2041 goToSubnav: function (e) { 2042 var t = this.nav.querySelector(i + '[data-parent="' + e + '"]'); 2043 t 2044 ? ((this.config.menuLevel = t.dataset.level), 2045 2 == this.config.menuLevel && 2046 this.nav.querySelectorAll(i + '[data-level="3"]').forEach((e) => { 2047 e.classList.remove(a); 2048 }), 2049 t.classList.add(a), 2050 this.setWrapperHeight(t.offsetHeight)) 2051 : ((this.config.menuLevel = 1), 2052 this.wrapper.removeAttribute("style"), 2053 this.nav.querySelectorAll(i).forEach((e) => { 2054 e.classList.remove(a); 2055 })), 2056 (this.wrapper.dataset.level = this.config.menuLevel); 2057 }, 2058 setWrapperHeight: function (e) { 2059 this.wrapper.style.height = e + "px"; 2060 }, 2061 })), 2062 c 2063 ); 2064 })()), 2065 (window.onpageshow = function (e) { 2066 e.persisted && 2067 document.querySelectorAll(".cart__checkout").forEach((e) => { 2068 e.classList.remove("btn--loading"); 2069 }); 2070 }), 2071 (theme.headerSearch = (function () { 2072 var e, 2073 t, 2074 i = "", 2075 n = !1, 2076 o = ".site-header__search-form", 2077 s = 'input[type="search"]', 2078 a = ".site-header__search-container", 2079 r = ".js-search-header", 2080 c = "[data-predictive-search-button]", 2081 d = ".site-header__search-btn--cancel", 2082 l = "#SearchResultsWrapper", 2083 h = "#TopSearched", 2084 u = "#PredictiveWrapper", 2085 m = "#PredictiveResults", 2086 p = {}, 2087 f = { namespace: ".search", topSearched: !1, predictiveSearch: !1, imageSize: "square" }, 2088 v = 27, 2089 g = 38, 2090 y = 40, 2091 S = 9; 2092 function b() { 2093 f.predictiveSearch && (p.predictiveWrapper.classList.add("hide"), (p.results.innerHTML = ""), clearTimeout(e)), f.topSearched ? p.topSearched.classList.remove("hide") : p.wrapper.classList.add("hide"); 2094 } 2095 function w(t) { 2096 if (t && t.target.closest) 2097 if (t.target.closest(d)); 2098 else { 2099 if (t.target.closest(".site-header__search-form")) return; 2100 if (t.target.closest(".site-header__element--sub")) return; 2101 if (t.target.closest("#SearchResultsWrapper")) return; 2102 if (t.target.closest(".site-header__search-container")) return; 2103 } 2104 document.activeElement.blur(), 2105 p.wrapper.classList.add("hide"), 2106 f.topSearched && p.topSearched.classList.remove("hide"), 2107 f.predictiveSearch && (p.predictiveWrapper.classList.add("hide"), clearTimeout(e)), 2108 p.inlineSearchContainer && p.inlineSearchContainer.classList.remove("is-active"),
2109 document.querySelectorAll(o).forEach((e) => { 2110 e.classList.remove("is-active"); 2111 }), 2112 window.off("click" + f.namespace); 2113 } 2114 function L(e) { 2115 e.preventDefault(), e.stopImmediatePropagation(); 2116 var t = document.querySelector(a); 2117 t.classList.add("is-active"), t.querySelector(".site-header__search-input").focus(), q(); 2118 } 2119 function E() { 2120 t && t.submit(); 2121 } 2122 function _(e) { 2123 e.preventDefault ? e.preventDefault() : (e.returnValue = !1); 2124 var t = {}, 2125 i = new FormData(e.target); 2126 for (var n of i.keys()) t[n] = i.get(n); 2127 t.q && (t.q += "*"); 2128 var o = C(t); 2129 return (window.location.href = "/search?" + o), !1; 2130 } 2131 function k(o) { 2132 (t = o.currentTarget.closest("form")), 2133 o.keyCode !== g && 2134 o.keyCode !== y && 2135 o.keyCode !== S && 2136 (o.keyCode !== v 2137 ? (function (t) { 2138 var o = t.value; 2139 if ("" === o) return void b(); 2140 var s = (function (e) { 2141 if ("string" != typeof e) return null; 2142 return e.trim().replace(/\ /g, "-").toLowerCase(); 2143 })(o); 2144 clearTimeout(e), 2145 (e = setTimeout( 2146 function () { 2147 !(function (e) { 2148 if (n) return; 2149 if (i === e) return; 2150 (i = e), (n = !0); 2151 var t = C({ 2152 q: e, 2153 "resources[type]": theme.settings.predictiveSearchType, 2154 "resources[limit]": 4, 2155 "resources[options][unavailable_products]": "last", 2156 "resources[options][fields]": "title,product_type,variants.title,vendor", 2157 }); 2158 fetch("/search/suggest.json?" + t) 2159 .then((e) => e.json()) 2160 .then((e) => { 2161 n = !1; 2162 var t = {}, 2163 i = 0; 2164 p.topSearched && p.topSearched.classList.add("hide"), p.predictiveWrapper.classList.remove("hide"); 2165 var o = Object.entries(e.resources.results); 2166 if ( 2167 (Object.keys(o).forEach(function (e) { 2168 var n = o[e], 2169 s = n[0], 2170 a = n[1]; 2171 switch (((i += a.length), s)) { 2172 case "products": 2173 t[s] = (function (e) { 2174 var t = "", 2175 i = []; 2176 if ( 2177 (e.forEach((e) => { 2178 var t = { 2179 title: e.title, 2180 url: e.url, 2181 image_responsive_url: theme.Images.lazyloadImagePath(e.image), 2182 image_aspect_ratio: e.featured_image.as
2182pect_ratio, 2183 }; 2184 i.push(t); 2185 }), 2186 i.length) 2187 ) { 2188 var n = theme.buildProductGridItem(i, f.imageSize); 2189 t = `\n <div data-type-products>\n <div class="new-grid product-grid" data-view="small">\n ${n}\n </div>\n </div>\n `; 2190 } 2191 return t; 2192 })(a); 2193 break; 2194 case "collections": 2195 t[s] = (function (e) { 2196 var t = ""; 2197 if (e.length) { 2198 var i = theme.buildCollectionItem(e); 2199 t = `\n <div data-type-collections>\n <p class="h6 predictive__label">${theme.strings.searchCollections}</p>\n <ul class="no-bullets">\n ${i}\n </ul>\n </div>\n `; 2200 } 2201 return t; 2202 })(a); 2203 break; 2204 case "pages": 2205 t[s] = (function (e) { 2206 var t = ""; 2207 if (e.length) { 2208 var i = theme.buildPageItem(e); 2209 t = `\n <div data-type-pages>\n <p class="h6 predictive__label">${theme.strings.searchPages}</p>\n <ul class="no-bullets">\n ${i}\n </ul>\n </div>\n `; 2210 } 2211 return t; 2212 })(a); 2213 break; 2214 case "articles": 2215 t[s] = (function (e) { 2216 var t = ""; 2217 if ( 2218 (e.forEach((e) => { 2219 e.image && (e.image = theme.Images.getSizedImageUrl(e.image, "200x200_crop_center")); 2220 }), 2221 e.length) 2222 ) { 2223 var i = theme.buildArticleItem(e, f.imageSize); 2224 t = `\n <div data-type-articles>\n <p class="h6 predictive__label">${theme.strings.searchArticles}</p>\n <div class="grid grid--uniform grid--no-gutters">\n ${i}\n </div>\n </div>\n `; 2225 } 2226 return t; 2227 })(a); 2228 } 2229 }), 2230 0 !== i) 2231 ) { 2232 var s = (function (e) { 2233 var t = ""; 2234 e.products && "" !== e.products && (t += e.products); 2235 e.collections && "" !== e.collections && (t += e.collections); 2236 e.pages && "" !== e.pages && (t += e.pages); 2237 e.articles && "" !== e.articles && (t += e.articles); 2238 return t; 2239 })(t); 2240 (p.results.innerHTML = ""), (p.results.innerHTML = s), p.wrapper.classList.remove("hide"); 2241 } else b(); 2242 }); 2243 })(s); 2244 }.bind(this), 2245 500 2246 )); 2247 })(o.currentTarget) 2248 : w()); 2249 } 2250 function I(e) { 2251 e.currentTarget.parentNode.classList.add("is-active"), f.topSearched && p.wrapper.classList.remove("hide"), q(); 2252 } 2253 function q() { 2254 setTimeout(function () { 2255 window.on("click" + f.namespace, function (e) { 2256 w(e); 2257 }); 2258 }, 0), 2259 window.on("keyup", function (e) { 2260 27 === e.keyCode && w(); 2261 }); 2262 } 2263 function C(e) { 2264 return Object.keys(e) 2265 .map(function (t) { 2266 return t + "=" + encodeURIComponent(e[t]); 2267 }) 2268 .join("&"); 2269 } 2270 return { 2271 init: function () { 2272 if ( 2273 ((p.inlineSearchContainer = document.querySelector(a)), 2274 document.querySelectorAll(r).forEach((e) => { 2275 e.addEventListener("click", L); 2276 }), 2277 (p.wrapper = document.querySelector(l)), 2278 p.wrapper) 2279 ) { 2280 if (((p.topSearched = document.querySelector(h)), p.topSearched && (f.topSearched = !0), theme.settings.predictiveSearch)) 2281 if (document.getElementById("shopify-features")) JSON.parse(document.getElementById("shopify-features").innerHTML).predictiveSearch && (f.predictiveSearch = !0); 2282 f.predictiveSearch && 2283 ((p.predictiveWrapper = document.querySelector(u)), 2284 (f.imageSize = p.predictiveWrapper.dataset.imageSize), 2285 (p.results = document.querySelector(m)), 2286 (p.submit = p.predictiveWrapper.querySelector(c)), 2287 p.submit.on("click" + f.namespace, E)),
2288 document.querySelectorAll(o).forEach((e) => { 2289 !(function (e) { 2290 e.setAttribute("autocomplete", "off"), e.on("submit" + f.namespace, _); 2291 var t = e.querySelector(s); 2292 t.on("focus" + f.namespace, I), f.predictiveSearch && t.on("keyup" + f.namespace, k); 2293 })(e); 2294 }); 2295 } 2296 }, 2297 }; 2298 })()), 2299 (theme.HeaderCart = (function () { 2300 var e = "#HeaderCartTrigger", 2301 t = "#HeaderCart", 2302 i = ".js-close-header-cart", 2303 n = ".add-note", 2304 o = { cartOpen: !1, namespace: ".cart-header" }; 2305 function s() { 2306 (this.wrapper = document.querySelector(t)), 2307 this.wrapper && 2308 ((this.trigger = document.querySelector(e)), 2309 (this.noteBtn = this.wrapper.querySelector(n)), 2310 (this.form = this.wrapper.querySelector("form")), 2311 document.addEventListener("MobileNav:open", this.close.bind(this)), 2312 document.addEventListener("modalOpen", this.close.bind(this)), 2313 this.init()); 2314 } 2315 return ( 2316 (s.prototype = Object.assign({}, s.prototype, { 2317 init: function () { 2318 (this.cartForm = new theme.CartForm(this.form)), 2319 (this.quickAdd = new theme.QuickAdd(this.wrapper)), 2320 (this.quickShop = new theme.QuickShop(this.wrapper)), 2321 this.cartForm.buildCart(), 2322 this.trigger.on("click", this.open.bind(this)), 2323 document.querySelectorAll(i).forEach((e) => { 2324 e.addEventListener( 2325 "click", 2326 function () { 2327 this.close(); 2328 }.bind(this) 2329 ); 2330 }), 2331 this.noteBtn && 2332 this.noteBtn.addEventListener( 2333 "click", 2334 function () { 2335 this.noteBtn.classList.toggle("is-active"), this.wrapper.querySelector(".cart__note").classList.toggle("hide"); 2336 }.bind(this) 2337 ), 2338 document.addEventListener( 2339 "ajaxProduct:added", 2340 function (e) { 2341 this.cartForm.buildCart(), o.cartOpen || this.open(); 2342 }.bind(this) 2343 ), 2344 document.addEventListener("cart:open", this.open.bind(this)), 2345 document.addEventListener("cart:close", this.close.bind(this)); 2346 }, 2347 open: function (e) { 2348 "dropdown" === theme.settings.cartType && 2349 (e && e.preventDefault(), 2350 theme.sizeDrawer(), 2351 theme.utils.prepareTransition( 2352 this.wrapper, 2353 function () { 2354 this.wrapper.classList.add("is-active"), (this.wrapper.scrollTop = 0); 2355 }.bind(this) 2356 ), 2357 document.documentElement.classList.add("cart-open"), 2358 theme.a11y.lockMobileScrolling(o.namespace), 2359 window.on( 2360 "keyup" + o.namespace, 2361 function (e) { 2362 27 === e.keyCode && this.close(); 2363 }.bind(this) 2364 ), 2365 theme.headerNav.removeOverlayClass(), 2366 document.dispatchEvent(new CustomEvent("CartDrawer:open")), 2367 document.dispatchEvent(new CustomEvent("drawerOpen")), 2368 setTimeout( 2369 function () { 2370 window.on( 2371 "click" + o.namespace, 2372 function (e) { 2373 this.close(e); 2374 }.bind(this) 2375 ); 2376 }.bind(this), 2377 0 2378 ), 2379 (o.cartOpen = !0)); 2380 }, 2381 close: function (e) { 2382 "dropdown" === theme.settings.cartType && 2383 ((e && e.target.closest && e.target.closest(".site-header__cart")) || 2384 (o.cartOpen && 2385 (e && "MobileNav:open" === e.type 2386 ? this.wrapper.classList.remove("is-active") 2387 : theme.utils.prepareTransition( 2388 this.wrapper, 2389 function () { 2390 this.wrapper.classList.remove("is-active"); 2391 }.bind(this) 2392 ), 2393 window.off("keyup" + o.namespace),
2394 window.off("click" + o.namespace), 2395 theme.a11y.unlockMobileScrolling(o.namespace), 2396 document.documentElement.classList.remove("cart-open"), 2397 (o.cartOpen = !1)))); 2398 }, 2399 })), 2400 s 2401 ); 2402 })()), 2403 (theme.QuickAdd = (function () { 2404 var e, 2405 t = ".js-quick-add-btn", 2406 i = ".js-quick-add-form", 2407 n = "#QuickAddHolder", 2408 o = !1; 2409 function s(e) { 2410 e && theme.settings.quickAdd && ((this.container = e), this.init()); 2411 } 2412 return ( 2413 (s.prototype = Object.assign({}, s.prototype, { 2414 init: function () { 2415 var s = this.container.querySelectorAll(t); 2416 s && 2417 s.forEach((e) => { 2418 e.addEventListener("click", this.addToCart.bind(this)); 2419 }); 2420 var a = this.container.querySelectorAll(i); 2421 a.length && 2422 ((this.quickAddHolder = document.querySelector(n)), 2423 o || 2424 ((e = new theme.Modals("QuickAddModal", "quick-add")), 2425 (o = !0), 2426 document.addEventListener( 2427 "modalClose.QuickAddModal", 2428 function () { 2429 setTimeout( 2430 function () { 2431 this.quickAddHolder.innerHTML = ""; 2432 }.bind(this), 2433 350 2434 ); 2435 }.bind(this) 2436 )), 2437 a.forEach((e) => { 2438 e.addEventListener("click", this.loadQuickAddForm.bind(this)); 2439 })); 2440 }, 2441 addToCart: function (e) { 2442 var t = e.currentTarget, 2443 i = t.querySelector(".btn"); 2444 i.classList.add("btn--loading"); 2445 var n = { items: [{ id: t.dataset.id, quantity: 1 }] }; 2446 fetch(theme.routes.cartAdd, { method: "POST", body: JSON.stringify(n), credentials: "same-origin", headers: { "Content-Type": "application/json" } }) 2447 .then((e) => e.json()) 2448 .then( 2449 function (e) { 2450 if (422 === e.status || "bad_request" === e.status); 2451 else { 2452 var n = e; 2453 document.dispatchEvent(new CustomEvent("ajaxProduct:added", { detail: { product: n, addToCartBtn: t } })); 2454 } 2455 i.classList.remove("btn--loading"); 2456 }.bind(this) 2457 ); 2458 }, 2459 loadQuickAddForm: function (t) { 2460 this.quickAddHolder.innerHTML = ""; 2461 t.currentTarget; 2462 var i = t.currentTarget.closest(".grid-product"), 2463 n = i.getAttribute("data-product-handle"), 2464 o = i.getAttribute("data-product-id"), 2465 s = theme.routes.home + "/products/" + n + "?view=form"; 2466 (s = s.replace("//", "/")), 2467 fetch(s) 2468 .then(function (e) { 2469 return e.text(); 2470 }) 2471 .then( 2472 function (t) { 2473 var i = new DOMParser().parseFromString(t, "text/html").querySelector('.product-section[data-product-handle="' + n + '"]'); 2474 this.quickAddHolder.append(i), 2475 theme.sections.register("product", theme.Product, this.quickAddHolder), 2476 Shopify && Shopify.PaymentButton && Shopify.PaymentButton.init(), 2477 window.dispatchEvent(new CustomEvent("quickadd:loaded:" + o)), 2478 document.dispatchEvent(new CustomEvent("quickadd:loaded", { detail: { productId: o, handle: n } })), 2479 e.open(); 2480 }.bind(this) 2481 ); 2482 }, 2483 })), 2484 s 2485 ); 2486 })()), 2487 (theme.QuickShop = (function () { 2488 var e = [], 2489 t = ".grid-product", 2490 i = ".quick-product__btn", 2491 n = "#ProductModals"; 2492 function o(e) { 2493 theme.settings.quickView && ((this.container = e), this.init()); 2494 } 2495 function s(t) { 2496 var i = t.currentTarget; 2497 if (!theme.config.bpSmall && i && i.dataset.productId) { 2498 var o = (function (e) { 2499 return { id: e.dataset.productId, handle: e.dataset.productHandle }; 2500 })(i); 2501 i.removeEventListener("mouseover", s), 2502 (function (t) { 2503 var i = document.querySelectorAll('.modal--quick-shop[data-product-id="' + t.id + '"]'); 2504 if (!i.length) return; 2505 if (e.indexOf(t.id) > -1) 2506 !(function (e) { 2507 e.length > 1 && 2508 e.forEach(function (e, t) { 2509 e.closest("#ProductModals") || e.remove(); 2510 }); 2511 })(i), 2512 a(t); 2513 else { 2514 !(function (e) { 2515 var t = e[0]; 2516 if (!t) return; 2517 e.length > 1 && 2518 e.forEach(function (e, t) { 2519 t > 0 && e.remove(); 2520 }); 2521 document.querySelector(n).appendChild(t); 2522 })(i); 2523 var o = document.getElementById("QuickShopHolder-" + t.handle), 2524 s = theme.routes.home + "/products/" + t.handle + "?view=modal"; 2525 (s = s.replace("//", "/")), 2526 fetch(s) 2527 .then(function (e) { 2528 return e.text(); 2529 }) 2530 .then(function (e) { 2531 var i = new DOMParser().parseFromString(e, "text/html").querySelector('.product-section[data-product-handle="' + t.handle + '"]'); 2532 o && (o.append(i), theme.sections.register("product", theme.Product, o), theme.collapsibles.init(), theme.videoModal(), a(t)); 2533 }); 2534 } 2535 e.push(t.id); 2536 })(o); 2537 } 2538 } 2539 function a(e) { 2540 var t = "QuickShopModal-" + e.id, 2541 n = "quick-modal-" + e.id; 2542 new theme.Modals(t, n); 2543 var o = document.querySelectorAll(i + '[data-handle="' + e.handle + '"]'); 2544 o.length && 2545 o.forEach((e) => {
2546 e.classList.remove("quick-product__btn--not-ready"); 2547 }); 2548 } 2549 return ( 2550 (o.prototype = Object.assign({}, o.prototype, { 2551 init: function () { 2552 var e = this.container.querySelectorAll(t); 2553 e.length && 2554 e.forEach((e) => { 2555 e.addEventListener("mouseover", s); 2556 }); 2557 }, 2558 })), 2559 o 2560 ); 2561 })()), 2562 (theme.buildProductGridItem = function (e, t) { 2563 var i = ""; 2564 return ( 2565 e.forEach((e) => { 2566 var n = theme.buildProductImage(e, t), 2567 o = `\n <div class="grid-item grid-product">\n <div class="grid-item__content">\n <a href="${e.url}" class="grid-item__link">\n <div class="grid-product__image-wrap">\n ${n}\n </div>\n <div class="grid-item__meta">\n <div class="grid-product__title">${e.title}</div>\n </div>\n </a>\n </div>\n </div>\n `; 2568 i += o; 2569 }), 2570 i 2571 ); 2572 }), 2573 (theme.buildProductImage = function (e, t) { 2574 var i = t || theme.settings.productImageSize, 2575 n = ""; 2576 if ("natural" === i) 2577 n = `\n <div class="image-wrap" style="height: 0; padding-bottom: ${e.image_aspect_ratio}%;">\n <img class="grid-product__image lazyload"\n data-src="${e.image_responsive_url}"\n data-widths="[180, 360, 540, 720, 900]"\n data-aspectratio="${e.image_aspect_ratio}"\n data-sizes="auto"\n alt="${e.title}">\n </div>`; 2578 else { 2579 var o = "lazyload"; 2580 theme.settings.productImageCover || (o += " grid__image-contain"), 2581 (n = `\n <div class="grid__image-ratio grid__image-ratio--${i}">\n <img class="${o}"\n data-src="${e.image_responsive_url}"\n data-widths="[360, 540, 720, 900, 1080]"\n data-aspectratio="${e.aspect_ratio}"\n data-sizes="auto"\n alt="${e.title}">\n </div>\n `); 2582 } 2583 return n; 2584 }), 2585 (theme.buildCollectionItem = function (e) { 2586 var t = ""; 2587 return ( 2588 e.forEach((e) => { 2589 var i = `\n <li>\n <a href="${e.url}">\n ${e.title}\n </a>\n </li>\n `; 2590 t += i; 2591 }), 2592 t 2593 ); 2594 }), 2595 (theme.buildPageItem = function (e) { 2596 var t = ""; 2597 return ( 2598 e.forEach((e) => { 2599 var i = `\n <li>\n <a href="${e.url}">\n ${e.title}\n </a>\n </li>\n `; 2600 t += i; 2601 }), 2602 t 2603 ); 2604 }), 2605 (theme.buildArticleItem = function (e, t) { 2606 var i = ""; 2607 return ( 2608 e.forEach((e) => { 2609 var n = theme.buildPredictiveImage(e), 2610 o = `\n <div class="grid__item small--one-half medium-up--one-quarter">\n <a href="${e.url}" class="grid-item__link grid-item__link--inline">\n <div class="grid-product__image-wrap">\n <div\n class="grid__image-ratio grid__image-ratio--object grid__image-ratio--${t}">\n <div class="predictive__image-wrap">\n ${n}\n </div>\n </div>\n </div>\n <div class="grid-item__meta">\n ${e.title}\n </div>\n </a>\n </div>\n `; 2611 i += o; 2612 }), 2613 i 2614 ); 2615 }), 2616 (theme.buildPredictiveImage = function (e) { 2617 var t = ""; 2618 return e.image && (t = `<img class="lazyload"\n data-src="${e.image}"\n data-widths="[360, 540, 720]"\n data-sizes="auto">`), t; 2619 }), 2620 (theme.animationObserver = function () { 2621 document.querySelectorAll(".animation-contents").forEach((e) => { 2622 new IntersectionObserver( 2623 (e, t) => { 2624 e.forEach((e) => { 2625 e.isIntersecting && (e.target.classList.add("is-visible"), t.unobserve(e.target)); 2626 }); 2627 }, 2628 { threshold: 1 } 2629 ).observe(e); 2630 }); 2631 }), 2632 (theme.Maps = (function () { 2633 var e = 14, 2634 t = null, 2635 i = [], 2636 n = {}, 2637 o = '[data-section-type="map"]', 2638 s = "[data-map]", 2639 a = ".map-section__overlay"; 2640 function r(e) { 2641 (this.container = e), 2642 (this.sectionId = this.container.getAttribute("data-section-id")), 2643 (this.namespace = ".map-" + this.sectionId), 2644 (this.map = e.querySelector(s)), 2645 (this.key = this.map.dataset.apiKey), 2646 (n = { addressNoResults: theme.strings.addressNoResults, addressQueryLimit: theme.strings.addressQueryLimit, addressError: theme.strings.addressError, authError: theme.strings.authError }), 2647 this.key && theme.initWhenVisible({ element: this.container, callback: this.prepMapApi.bind(this), threshold: 20 }); 2648 } 2649 return ( 2650 (window.gm_authFailure = function () { 2651 Shopify.designMode &&
2652 (document.querySelectorAll(o).forEach((e) => { 2653 e.classList.add("map-section--load-error"); 2654 }), 2655 document.querySelectorAll(s).forEach((e) => { 2656 e.parentNode.removeChild(e); 2657 }), 2658 window.mapError(theme.strings.authError)); 2659 }), 2660 (window.mapError = function (e) { 2661 var t = document.createElement("div"); 2662 t.classList.add("map-section__error", "errors", "text-center"), 2663 (t.innerHTML = e), 2664 document.querySelectorAll(a).forEach((e) => { 2665 e.parentNode.prepend(t); 2666 }), 2667 document.querySelectorAll(".map-section__link").forEach((e) => { 2668 e.classList.add("hide"); 2669 }); 2670 }), 2671 (r.prototype = Object.assign({}, r.prototype, { 2672 prepMapApi: function () { 2673 if ("loaded" === t) this.createMap(); 2674 else if ((i.push(this), "loading" !== t && ((t = "loading"), void 0 === window.google || void 0 === window.google.maps))) { 2675 var e = document.createElement("script"); 2676 (e.onload = function () { 2677 (t = "loaded"), 2678 i.forEach((e) => { 2679 e.createMap(); 2680 }); 2681 }), 2682 (e.src = "https://maps.googleapis.com/maps/api/js?key=" + this.key), 2683 document.head.appendChild(e); 2684 } 2685 }, 2686 createMap: function () { 2687 var t = this.map; 2688 return (function (e) { 2689 var t = new google.maps.Geocoder(); 2690 if (e) { 2691 var i = e.dataset.addressSetting; 2692 return new Promise((e, n) => { 2693 t.geocode({ address: i }, function (t, i) { 2694 i !== google.maps.GeocoderStatus.OK && n(i), e(t); 2695 }); 2696 }); 2697 } 2698 })(t) 2699 .then( 2700 function (i) { 2701 var n = { zoom: e, backgroundColor: "none", center: i[0].geometry.location, draggable: !1, clickableIcons: !1, scrollwheel: !1, disableDoubleClickZoom: !0, disableDefaultUI: !0 }, 2702 o = (this.map = new google.maps.Map(t, n)), 2703 s = (this.center = o.getCenter()); 2704 new google.maps.Marker({ map: o, position: o.getCenter() }); 2705 google.maps.event.addDomListener( 2706 window, 2707 "resize", 2708 theme.utils.debounce(250, function () { 2709 google.maps.event.trigger(o, "resize"), o.setCenter(s), t.removeAttribute("style"); 2710 }) 2711 ), 2712 Shopify.designMode && window.AOS && AOS.refreshHard(); 2713 }.bind(this) 2714 ) 2715 .catch(function (e) { 2716 var t; 2717 switch (e) { 2718 case "ZERO_RESULTS": 2719 t = n.addressNoResults; 2720 break; 2721 case "OVER_QUERY_LIMIT": 2722 t = n.addressQueryLimit; 2723 break; 2724 case "REQUEST_DENIED": 2725 t = n.authError; 2726 break; 2727 default: 2728 t = n.addressError; 2729 } 2730 Shopify.designMode && window.mapError(t); 2731 }); 2732 }, 2733 onUnload: function () { 2734 0 !== this.map.length && google && google.maps && google.maps.event && google.maps.event.clearListeners(this.map, "resize"); 2735 }, 2736 })), 2737 r 2738 ); 2739 })()), 2740 (theme.NewsletterPopup = (function () { 2741 function e(e) { 2742 this.container = e; 2743 var t = this.container.getAttribute("data-section-id"); 2744 (this.cookieName = "newsletter-" + t), 2745 e && 2746 "/challenge" !== window.location.pathname && 2747 ((this.data = { secondsBeforeShow: e.dataset.delaySeconds, daysBeforeReappear: e.dataset.delayDays, cookie: Cookies.get(this.cookieName), testMode: e.dataset.testMode }), 2748 (this.modal = new theme.Modals("NewsletterPopup-" + t, "newsletter-popup-modal")), 2749 (e.querySelector(".errors") || e.querySelector(".note--success")) && this.modal.open(), 2750 e.querySelector(".note--success") 2751 ? this.closePopup(!0) 2752 : (document.addEventListener("modalClose." + e.id, this.closePopup.bind(this)), (this.data.cookie && "true" !== this.data.testMode) || this.initPopupDelay())); 2753 } 2754 return ( 2755 (e.prototype = Object.assign({}, e.prototype, { 2756 initPopupDelay: function () { 2757 (Shopify && Shopify.designMode) || 2758 setTimeout( 2759 function () { 2760 this.modal.open(); 2761 }.bind(this), 2762 1e3 * this.data.secondsBeforeShow 2763 ); 2764 }, 2765 closePopup: function (e) { 2766 if ("true" !== this.data.testMode) { 2767 var t = e ? 200 : this.data.daysBeforeReappear; 2768 Cookies.set(this.cookieName, "opened", { path: "/", expires: t }); 2769 } else Cookies.remove(this.cookieName, { path: "/" }); 2770 }, 2771 onLoad: function () { 2772 this.modal.open(); 2773 }, 2774 onSelect: function () { 2775 this.modal.open(); 2776 }, 2777 onDeselect: function () { 2778 this.modal.close(); 2779 }, 2780 })), 2781 e 2782 ); 2783 })()), 2784 (theme.PasswordHeader = (function () { 2785 function e() { 2786 this.init(); 2787 } 2788 return ( 2789 (e.prototype = Object.assign({}, e.prototype, { 2790 init: function () { 2791 if (document.querySelector("#LoginModal")) { 2792 var e = new theme.Modals("LoginModal", "login-modal", { focusIdOnOpen: "password", solid: !0 }); 2793 document.querySelectorAll(".errors").length && e.open(); 2794 } 2795 }, 2796 })), 2797 e 2798 ); 2799 })()), 2800 (theme.Photoswipe = (function () { 2801 var e = ".js-photoswipe__zoom", 2802 t = ".photoswipe__image", 2803 i = ".flickity-viewport ", 2804 n = ".is-selected"; 2805 function o(e, t) { 2806 (this.container = e), 2807 (this.sectionId = t), 2808 (this.namespace = ".photoswipe-" + this.sectionId), 2809 this.gallery, 2810 this.images, 2811 this.items, 2812 (this.inSlideshow = !1), 2813 e && "false" !== e.dataset.zoom && ("true" === e.dataset.hasSlideshow && (this.inSlideshow = !0), this.init()); 2814 } 2815 return ( 2816 (o.prototype = Object.assign({}, o.prototype, { 2817 init: function () { 2818 this.container.querySelectorAll(e).forEach((e) => { 2819 e.on("click" + this.namespace, this.triggerClick.bind(this)); 2820 }); 2821 }, 2822 triggerClick: function (e) { 2823 this.items = this.getImageData(); 2824 var t = this.inSlideshow ? this.container.querySelector(n) : e.currentTarget, 2825 i = this.inSlideshow ? this.getChildIndex(t) : t.dataset.index; 2826 this.initGallery(this.items, i); 2827 }, 2828 getChildIndex: function (e) { 2829 for (var t = 0; null != (e = e.previousSibling); ) t++; 2830 return t + 1; 2831 }, 2832 getImageData: function () { 2833 this.images = this.inSlideshow ? this.container.querySelectorAll(i + t) : this.container.querySelectorAll(t); 2834 var e = []; 2835 return (
2836 this.images.forEach((t) => { 2837 var i = { msrc: t.currentSrc || t.src, src: t.getAttribute("data-photoswipe-src"), w: t.getAttribute("data-photoswipe-width"), h: t.getAttribute("data-photoswipe-height"), el: t, initialZoomLevel: 0.5 }; 2838 e.push(i); 2839 }), 2840 e 2841 ); 2842 }, 2843 initGallery: function (e, t) { 2844 var i = document.querySelectorAll(".pswp")[0], 2845 n = { 2846 allowPanToNext: !1, 2847 captionEl: !1, 2848 closeOnScroll: !1, 2849 counterEl: !1, 2850 history: !1, 2851 index: t - 1, 2852 pinchToClose: !1, 2853 preloaderEl: !1, 2854 scaleMode: "zoom", 2855 shareEl: !1, 2856 tapToToggleControls: !1, 2857 getThumbBoundsFn: function (t) { 2858 var i = window.pageYOffset || document.documentElement.scrollTop, 2859 n = e[t].el.getBoundingClientRect(); 2860 return { x: n.left, y: n.top + i, w: n.width }; 2861 }, 2862 }; 2863 (this.gallery = new PhotoSwipe(i, PhotoSwipeUI_Default, e, n)), this.gallery.init(), this.gallery.listen("afterChange", this.afterChange.bind(this)); 2864 }, 2865 afterChange: function () { 2866 var e = this.gallery.getCurrentIndex(); 2867 this.container.dispatchEvent(new CustomEvent("photoswipe:afterChange", { detail: { index: e } })); 2868 }, 2869 })), 2870 o 2871 ); 2872 })()), 2873 (theme.Recommendations = (function () { 2874 var e = { placeholder: ".product-recommendations-placeholder", sectionClass: " .product-recommendations", productResults: ".grid-product" }; 2875 function t(t) { 2876 (this.container = t), 2877 (this.sectionId = t.getAttribute("data-section-id")), 2878 (this.url = t.dataset.url), 2879 (e.recommendations = "Recommendations-" + this.sectionId), 2880 theme.initWhenVisible({ element: t, callback: this.init.bind(this), threshold: 500 }); 2881 } 2882 return ( 2883 (t.prototype = Object.assign({}, t.prototype, { 2884 init: function () { 2885 var t = document.getElementById(e.recommendations); 2886 if (t && "false" !== t.dataset.enable) { 2887 var i = t.dataset.productId, 2888 n = t.dataset.limit, 2889 o = this.url + "?section_id=product-recommendations&limit=" + n + "&product_id=" + i; 2890 if (Shopify.designMode) { 2891 var s = t.querySelector(e.sectionClass); 2892 s && (s.innerHTML = ""); 2893 } 2894 fetch(o) 2895 .then(function (e) { 2896 return e.text(); 2897 }) 2898 .then( 2899 function (i) { 2900 var n = new DOMParser().parseFromString(i, "text/html").querySelector(e.sectionClass), 2901 o = t.querySelector(e.placeholder); 2902 o && 2903 ((o.innerHTML = ""), 2904 n 2905 ? (o.appendChild(n), 2906 theme.reinitProductGridItem(t), 2907 document.dispatchEvent(new CustomEvent("recommendations:loaded", { detail: { section: t } })), 2908 0 === n.querySelectorAll(e.productResults).length && this.container.classList.add("hide")) 2909 : this.container.classList.add("hide")); 2910 }.bind(this) 2911 ); 2912 } 2913 }, 2914 })), 2915 t 2916 ); 2917 })()), 2918 (theme.SlideshowSection = (function () { 2919 var e = ".parallax-container"; 2920 function t(e) { 2921 this.container = e; 2922 var t = e.getAttribute("data-section-id"); 2923 if (((this.slideshow = e.querySelector("#Slideshow-" + t)), (this.namespace = "." + t), (this.initialIndex = 0), this.slideshow)) { 2924 var i = e.parentElement; 2925 0 === [].indexOf.call(i.parentElement.children, i) ? this.init() : theme.initWhenVisible({ element: this.container, callback: this.init.bind(this) }); 2926 } 2927 } 2928 return ( 2929 (t.prototype = Object.assign({}, t.prototype, { 2930 init: function () { 2931 var t = this.slideshow.querySelectorAll(".slideshow__slide"); 2932 if ( 2933 (this.container.hasAttribute("data-immediate-load") ? (this.slideshow.classList.remove("loading", "loading--delayed"), this.slideshow.classList.add("loaded")) : theme.loadImageSection(this.slideshow), 2934 t.length > 1) 2935 ) { 2936 var i = { 2937 prevNextButtons: this.slideshow.hasAttribute("data-arrows"), 2938 pageDots: this.slideshow.hasAttribute("data-dots"), 2939 fade: !0, 2940 setGallerySize: !1, 2941 initialIndex: this.initialIndex, 2942 autoPlay: "true" === this.slideshow.dataset.autoplay && parseInt(this.slideshow.dataset.speed), 2943 }; 2944 this.flickity = new theme.Slideshow(this.slideshow, i); 2945 } else t[0].classList.add("is-selected"); 2946 this.container.hasAttribute("data-parallax") && 2947 this.container.querySelectorAll(e).forEach( 2948 function (e, t) { 2949 new theme.Parallax(e, { namespace: this.namespace + "-parallax-" + t }); 2950 }.bind(this) 2951 ); 2952 }, 2953 forceReload: function () { 2954 this.onUnload(), this.init(); 2955 }, 2956 onUnload: function () { 2957 this.flickity && "function" == typeof this.flickity.destroy && this.flickity.destroy(); 2958 }, 2959 onDeselect: function () { 2960 this.flickity && "function" == typeof this.flickity.play && this.flickity.play(); 2961 }, 2962 onBlockSelect: function (e) { 2963 var t = this.slideshow.querySelector(".slideshow__slide--" + e.detail.blockId), 2964 i = parseInt(t.dataset.index); 2965 this.flickity && "function" == typeof this.flickity.pause 2966 ? (this.flickity.goToSlide(i), this.flickity.pause()) 2967 : ((this.initialIndex = i), 2968 setTimeout( 2969 function () { 2970 this.flickity && "function" == typeof this.flickity.pause && this.flickity.pause(); 2971 }.bind(this), 2972 1e3 2973 )); 2974 }, 2975 onBlockDeselect: function () { 2976 this.flickity && "function" == typeof this.flickity.play && this.flickity.args.autoPlay && this.flickity.play(); 2977 }, 2978 })), 2979 t 2980 ); 2981 })()), 2982 (theme.StoreAvailability = (function () { 2983 var e = ".js-drawer-open-availability", 2984 t = ".js-modal-open-availability", 2985 i = "[data-availability-product-title]"; 2986 function n(e) { 2987 (this.container = e), (this.baseUrl = e.dataset.baseUrl), (this.productTitle = e.dataset.productName); 2988 } 2989 return ( 2990 (n.prototype = Object.assign({}, n.prototype, { 2991 updateContent: function (n) { 2992 var o = this.baseUrl + "/variants/" + n + "/?section_id=store-availability", 2993 s = this; 2994 fetch(o) 2995 .then(function (e) { 2996 return e.text(); 2997 }) 2998 .then(function (n) { 2999 if ("" !== n.trim()) { 3000 (s.container.innerHTML = n), 3001 (s.container.innerHTML = s.container.firstElementChild.innerHTML), 3002 s.container.querySelector(e) && (s.drawer = new theme.Drawers("StoreAvailabilityDrawer", "availability")), 3003 s.container.querySelector(t) && (s.modal = new theme.Modals("StoreAvailabilityModal", "availability")); 3004 var o = s.container.querySelector(i); 3005 o && (o.textContent = s.productTitle); 3006 } else this.container.innerHTML = ""; 3007 }); 3008 }, 3009 })), 3010 n 3011 ); 3012 })()), 3013 (theme.VideoSection = (function () { 3014 var e = ".video-parent-section"; 3015 function t(e) { 3016 (this.container = e), 3017 (this.sectionId = e.getAttribute("data-section-id")), 3018 (this.namespace = ".video-" + this.sectionId), 3019 this.videoObject, 3020 theme.initWhenVisible({ element: this.container, callback: this.init.bind(this), threshold: 500 }); 3021 } 3022 return ( 3023 (t.prototype = Object.assign({}, t.prototype, { 3024 init: function () { 3025 var e = this.container.querySelector(".video-div"); 3026 if (e) 3027 switch (e.dataset.type) { 3028 case "youtube": 3029 var t = e.dataset.videoId; 3030 this.initYoutubeVideo(t); 3031 break; 3032 case "vimeo": 3033 t = e.dataset.videoId; 3034 this.initVimeoVideo(t); 3035 break; 3036 case "mp4": 3037 this.initMp4Video(); 3038 } 3039 }, 3040 initYoutubeVideo: function (t) { 3041 this.videoObject = new theme.YouTube("YouTubeVideo-" + this.sectionId, { videoId: t, videoParent: e }); 3042 }, 3043 initVimeoVideo: function (t) { 3044 this.videoObject = new theme.VimeoPlayer("Vimeo-" + this.sectionId, t, { videoParent: e }); 3045 }, 3046 initMp4Video: function () { 3047 var t = "Mp4Video-" + this.sectionId, 3048 i = document.getElementById(t), 3049 n = i.closest(e); 3050 if (i) { 3051 n.classList.add("loaded"); 3052 var o = document.querySelector("#" + t).play(); 3053 void 0 !== o && 3054 o 3055 .then(function () {}) 3056 .catch(function () { 3057 i.setAttribute("controls", ""), n.classList.add("video-interactable"); 3058 }); 3059 } 3060 }, 3061 onUnload: function (e) { 3062 e.target.id.replace("shopify-section-", ""); 3063 this.videoObject && "function" == typeof this.videoObject.destroy && this.videoObject.destroy(); 3064 }, 3065 })), 3066 t 3067 ); 3068 })()),
3069 (theme.BackgroundImage = (function () { 3070 var e = ".parallax-container"; 3071 function t(e) { 3072 if (((this.container = e), e)) { 3073 var t = e.getAttribute("data-section-id"); 3074 (this.namespace = "." + t), theme.initWhenVisible({ element: this.container, callback: this.init.bind(this) }); 3075 } 3076 } 3077 return ( 3078 (t.prototype = Object.assign({}, t.prototype, { 3079 init: function () { 3080 if ((theme.loadImageSection(this.container), this.container.dataset && this.container.dataset.parallax)) { 3081 var t = this.container.querySelector(e), 3082 i = { namespace: this.namespace + "-parallax", desktopOnly: !0 }; 3083 theme.parallaxSections[this.namespace] = new theme.Parallax(t, i); 3084 } 3085 }, 3086 onUnload: function (e) { 3087 this.container && 3088 (theme.parallaxSections[this.namespace] && "function" == typeof theme.parallaxSections[this.namespace].destroy && theme.parallaxSections[this.namespace].destroy(), 3089 delete theme.parallaxSections[this.namespace]); 3090 }, 3091 })), 3092 t 3093 ); 3094 })()), 3095 (theme.CollectionHeader = (function () { 3096 var e = !1; 3097 function t(t) { 3098 this.namespace = ".collection-header"; 3099 var i = t.querySelector(".collection-hero"); 3100 if (i) { 3101 if ((e && this.checkIfNeedReload(), theme.loadImageSection(i), t.dataset && t.dataset.parallax)) { 3102 var n = t.querySelector(".parallax-container"), 3103 o = { namespace: this.namespace + "-parallax" }; 3104 theme.parallaxSections[this.namespace] = new theme.Parallax(n, o); 3105 } 3106 } else theme.settings.overlayHeader && theme.headerNav.disableOverlayHeader(); 3107 e = !0; 3108 } 3109 return ( 3110 (t.prototype = Object.assign({}, t.prototype, { 3111 checkIfNeedReload: function () { 3112 Shopify.designMode && theme.settings.overlayHeader && (document.querySelector(".header-wrapper").classList.contains("header-wrapper--overlay") || location.reload()); 3113 }, 3114 onUnload: function () { 3115 theme.parallaxSections[this.namespace] && (theme.parallaxSections[this.namespace].destroy(), delete theme.parallaxSections[this.namespace]); 3116 }, 3117 })), 3118 t 3119 ); 3120 })()), 3121 (theme.CollectionSidebar = (function () { 3122 var e = "CollectionSidebar", 3123 t = ".collection-filter__btn", 3124 i = "#CollectionInlineFilterWrap", 3125 n = ".filter-wrapper", 3126 o = ".collection-filter", 3127 s = { isOpen: !1, namespace: ".collection-filters" }; 3128 function a() { 3129 document.getElementById(e) && (document.addEventListener("filter:selected", this.close.bind(this)), this.init()); 3130 } 3131 return ( 3132 (a.prototype = Object.assign({}, a.prototype, { 3133 init: function () { 3134 (s.isOpen = !1), 3135 theme.a11y.unlockMobileScrolling(s.namespace), 3136 (this.container = document.getElementById(e)), 3137 (this.trigger = document.querySelector(t)), 3138 (this.wrapper = document.querySelector(i)), 3139 (this.filters = this.wrapper.querySelector(n)), 3140 this.trigger.off("click"), 3141 this.trigger.on("click", this.toggle.bind(this)); 3142 }, 3143 toggle: function () { 3144 s.isOpen ? this.close() : this.open(); 3145 }, 3146 open: function () { 3147 var e, t, i; 3148 (e = document.getElementById("HeaderWrapper").offsetHeight), 3149 (t = document.querySelector(o).offsetHeight), 3150 (i = window.innerHeight - e - t), 3151 document.documentElement.style.setProperty("--maxFiltersHeight", i + "px"); 3152 var n, 3153 a = ((n = window.pageYOffset || document.documentElement.scrollTop), document.querySelector(o).getBoundingClientRect().top + n); 3154 window.scrollTo({ top: a, behavior: "smooth" }), 3155 this.trigger.classList.add("is-active"), 3156 theme.utils.prepareTransition( 3157 this.filters, 3158 function () { 3159 this.filters.classList.add("is-active"); 3160 }.bind(this) 3161 ), 3162 (s.isOpen = !0), 3163 theme.a11y.lockMobileScrolling(s.namespace), 3164 window.on( 3165 "keyup" + s.namespace, 3166 function (e) { 3167 27 === e.keyCode && this.close(); 3168 }.bind(this) 3169 ); 3170 }, 3171 close: function () { 3172 this.trigger.classList.remove("is-active"), 3173 theme.utils.prepareTransition( 3174 this.filters, 3175 function () { 3176 this.filters.classList.remove("is-active"); 3177 }.bind(this) 3178 ), 3179 (s.isOpen = !1), 3180 theme.a11y.unlockMobileScrolling(s.namespace), 3181 window.off("keyup" + s.namespace); 3182 }, 3183 onSelect: function () { 3184 this.open(); 3185 }, 3186 onDeselect: function () { 3187 this.close(); 3188 }, 3189 })), 3190 a 3191 ); 3192 })()), 3193 (theme.Collection = (function () { 3194 var e = !1, 3195 t = "#SortBy",
3196 i = ".filter-sort", 3197 n = ".grid-product__color-image", 3198 o = ".color-swatch--with-image", 3199 s = ".grid-view-btn", 3200 a = ".product-grid", 3201 r = ".collection-grid__wrapper", 3202 c = "#CollectionSidebar", 3203 d = ".tag-list--active-tags", 3204 l = ".tag-list input", 3205 h = ".tag-list a", 3206 u = ".filter-form", 3207 m = ".collection-filter", 3208 p = ".price-range", 3209 f = ".collapsible-trigger", 3210 v = ".filter-wrapper", 3211 g = "#CollectionSidebarFilterWrap", 3212 y = "#CollectionInlineFilterWrap", 3213 S = { isInit: !1, mobileFiltersInPlace: !1 }, 3214 b = "tag--active", 3215 w = "tag--remove", 3216 L = "collapsible-content", 3217 E = "is-open"; 3218 function _(e) { 3219 (this.container = e), 3220 (this.containerId = e.id), 3221 (this.sectionId = e.getAttribute("data-section-id")), 3222 (this.namespace = ".collection-" + this.sectionId), 3223 (this.isCollectionTemplate = this.container.dataset.collectionTemplate), 3224 (this.ajaxRenderer = new theme.AjaxRenderer({ sections: [{ sectionId: this.sectionId, nodeId: "CollectionAjaxContent" }], onReplace: this.onReplaceAjaxContent.bind(this), preserveParams: ["sort_by"] })), 3225 (S.mobileFiltersInPlace = !1), 3226 this.init(e), 3227 (this.sidebar = new theme.CollectionSidebar()); 3228 } 3229 return ( 3230 (_.prototype = Object.assign({}, _.prototype, { 3231 init: function (e) { 3232 e || (this.container = document.getElementById(this.containerId)), 3233 this.isCollectionTemplate && (this.cloneFiltersOnMobile(), this.initSort(), this.initFilters(), this.initPriceRange(), this.initGridOptions()), 3234 (this.quickAdd = new theme.QuickAdd(this.container)), 3235 (this.quickShop = new theme.QuickShop(this.container)), 3236 (this.colorImages = this.container.querySelectorAll(n)), 3237 this.colorImages.length && ((this.swatches = this.container.querySelectorAll(o)), this.colorSwatchHovering()), 3238 (S.isInit = !0); 3239 }, 3240 initSort: function () { 3241 (this.sortSelect = document.querySelector(t)), 3242 (this.sortBtns = document.querySelectorAll(i)), 3243 (this.sortSelect || this.sortBtn) && this.initParams(), 3244 this.sortSelect && ((this.defaultSort = this.getDefaultSortValue()), this.sortSelect.on("change" + this.namespace, this.onSortChange.bind(this))), 3245 this.sortBtns.length && 3246 this.sortBtns.forEach((e) => { 3247 e.addEventListener( 3248 "click", 3249 function () { 3250 document.dispatchEvent(new Event("filter:selected")), (this.queryParams.sort_by = e.dataset.value), this.goToSortUrl(); 3251 }.bind(this) 3252 ); 3253 }); 3254 }, 3255 initParams: function () { 3256 if (((this.queryParams = {}), location.search.length)) 3257 for (var e, t = location.search.substr(1).split("&"), i = 0; i < t.length; i++) (e = t[i].split("=")).length > 1 && (this.queryParams[decodeURIComponent(e[0])] = decodeURIComponent(e[1])); 3258 }, 3259 getSortValue: function () { 3260 return this.sortSelect.value || this.defaultSort; 3261 }, 3262 getDefaultSortValue: function () { 3263 return this.sortSelect.getAttribute("data-default-sortby"); 3264 }, 3265 onSortChange: function () { 3266 (this.queryParams.sort_by = this.get
3266SortValue()), this.goToSortUrl(); 3267 }, 3268 goToSortUrl: function () { 3269 this.queryParams.page && delete this.queryParams.page, (window.location.search = new URLSearchParams(Object.entries(this.queryParams))); 3270 }, 3271 colorSwatchHovering: function () { 3272 this.swatches.forEach((e) => { 3273 e.addEventListener( 3274 "mouseenter", 3275 function () { 3276 this.setActiveColorImage(e); 3277 }.bind(this) 3278 ), 3279 e.addEventListener( 3280 "touchstart", 3281 function (t) { 3282 t.preventDefault(), this.setActiveColorImage(e); 3283 }.bind(this), 3284 { passive: !0 } 3285 ); 3286 }); 3287 },
3288 setActiveColorImage: function (e) { 3289 var t = e.dataset.variantId, 3290 i = e.dataset.variantImage; 3291 this.colorImages.forEach((e) => { 3292 e.classList.remove("is-active"); 3293 }), 3294 this.swatches.forEach((e) => { 3295 e.classList.remove("is-active"); 3296 }); 3297 var n = this.container.querySelector(".grid-product__color-image--" + t); 3298 (n.style.backgroundImage = "url(" + i + ")"), n.classList.add("is-active"), e.classList.add("is-active"); 3299 var o = e.dataset.url; 3300 e.closest(".grid-item__link").setAttribute("href", o); 3301 }, 3302 initGridOptions: function () { 3303 var e = this.container.querySelector(a), 3304 t = this.container.querySelectorAll(s); 3305 this.container.querySelectorAll(s).forEach((i) => { 3306 i.addEventListener("click", function () { 3307 t.forEach((e) => { 3308 e.classList.remove("is-active"); 3309 }), 3310 i.classList.add("is-active"); 3311 var n = i.dataset.view; 3312 (e.dataset.view = n), theme.cart.updateAttribute("product_view", n), window.dispatchEvent(new Event("resize")); 3313 }); 3314 }); 3315 }, 3316 initFilters: function () { 3317 document.querySelectorAll(l).length && 3318 (document.addEventListener("matchSmall", this.cloneFiltersOnMobile.bind(this)), 3319 this.bindBackButton(), 3320 theme.config.stickyHeader && 3321 (this.setFilterStickyPosition(), 3322 document.addEventListener("headerStickyChange", theme.utils.debounce(500, this.setFilterStickyPosition)), 3323 window.on("resize", theme.utils.debounce(500, this.setFilterStickyPosition))), 3324 document.querySelectorAll(h).forEach((e) => { 3325 e.addEventListener("click", this.onTagClick.bind(this)); 3326 }), 3327 document.querySelectorAll(u).forEach((e) => { 3328 e.addEventListener("input", this.onFormSubmit.bind(this)); 3329 })); 3330 }, 3331 initPriceRange: function () { 3332 document.querySelectorAll(p).forEach((e) => new theme.PriceRange(e, { onChange: this.renderFromFormData.bind(this) })); 3333 }, 3334 cloneFiltersOnMobile: function () { 3335 if (!S.mobileFiltersInPlace) { 3336 var e = document.querySelector(g); 3337 if (e) { 3338 var t = e.querySelector(v).cloneNode(!0), 3339 i = document.querySelector(y); 3340 (i.innerHTML = ""), i.append(t), theme.collapsibles.init(i), (S.mobileFiltersInPlace = !0); 3341 } 3342 } 3343 }, 3344 renderActiveTag: function (e, t) { 3345 const i = e.querySelector(".tag__text"); 3346 e.classList.contains(b) 3347 ? e.classList.remove(b) 3348 : (e.classList.add(b), 3349 t.closest("li").classList.contains(w) 3350 ? e.remove() 3351 : document.querySelectorAll(d).forEac
3351h((e) => { 3352 const t = document.createElement("li"), 3353 n = document.createElement("a"); 3354 t.classList.add("tag", "tag--remove"), n.classList.add("btn", "btn--small"), (n.innerText = i.innerText), t.appendChild(n), e.appendChild(t); 3355 })); 3356 }, 3357 onTagClick: function (t) { 3358 const i = t.currentTarget; 3359 if ((document.dispatchEvent(new Event("filter:selected")), i.classList.contains("no-ajax"))) return; 3360 if ((t.preventDefault(), e)) return; 3361 e = !0; 3362 const n = i.parentNode, 3363 o = new URL(i.href); 3364 this.renderActiveTag(n, i), this.updateScroll(!0), this.startLoading(), this.renderCollectionPage(o.searchParams); 3365 }, 3366 onFormSubmit: function (t) { 3367 const i = t.target; 3368 if ((document.dispatchEvent(new Event("filter:selected")), i.classList.contains("no-ajax"))) return; 3369 if ((t.preventDefault(), e)) return; 3370 e = !0; 3371 const n = i.closest("li"), 3372 o = i.closest("form"), 3373 s = new FormData(o); 3374 this.renderActiveTag(n, i), this.updateScroll(!0), this.startLoading(), this.renderFromFormData(s); 3375 }, 3376 onReplaceAjaxContent: function (e, t) { 3377 this.fetchOpenCollasibleFilters().forEach((t) => { 3378 e.querySelectorAll(`[data-collapsible-id=${t}]`).forEach(this.openCollapsible); 3379 }), 3380 (document.getElementById(t.nodeId).innerHTML = e.getElementById(t.nodeId).innerHTML); 3381 }, 3382 renderFromFormData: function (e) { 3383 const t = new URLSearchParams(e); 3384 this.renderCollectionPage(t); 3385 }, 3386 renderCollectionPage: function (t, i = !0) { 3387 this.ajaxRenderer.renderPage(window.location.pathname, t, i).then(() => { 3388 theme.sections.reinit("collection-template"), this.updateScroll(!1), this.initPriceRange(), theme.reinitProductGridItem(), (e = !1); 3389 }); 3390 }, 3391 updateScroll: function (e) { 3392 var t = document.getElementById("CollectionAjaxContent").offsetTop; 3393 theme.config.stickyHeader && (t -= document.querySelector("#SiteHeader").offsetHeight), theme.config.bpSmall || (t -= 10), e ? window.scrollTo({ top: t, behavior: "smooth" }) : window.scrollTo({ top: t }); 3394 }, 3395 bindBackButton: function () { 3396 window.off("popstate" + this.namespace), 3397 window.on( 3398 "popstate" + this.namespace, 3399 function (e) { 3400 if (e) { 3401 const e = new URL(window.location.href); 3402 this.renderCollectionPage(e.searchParams, !1); 3403 } 3404 }.bind(this) 3405 ); 3406 }, 3407 fetchOpenCollasibleFilters: function () { 3408 return [...Array.from(document.querySelectorAll(`${c} ${f}.${E}`)), ...Array.from(document.querySelectorAll(`${y} ${f}.${E}`))].map((e) => e.dataset.collapsibleId); 3409 }, 3410 openCollapsible: function (e) { 3411 e.classList.contains(L) && (e.style.height = "auto"), e.classList.add(E); 3412 }, 3413 setFilterStickyPosition: function () { 3414 var e = document.querySelector(".site-header").offsetHeight - 1; 3415 document.querySelector(m).style.top = e + "px"; 3416 var t = document.querySelector(".grid__item--sidebar"); 3417 t && (t.style.top = e + 30 + "px"); 3418 }, 3419 startLoading: function () { 3420 document.querySelector(r).classList.add("unload"); 3421 }, 3422 forceReload: function () { 3423 this.init(); 3424 }, 3425 })), 3426 _ 3427 ); 3428 })()), 3429 (theme.FooterSection = (function () { 3430 var e = "[data-disclosure-locale]",
3431 t = "[data-disclosure-currency]", 3432 i = "MobileNav", 3433 n = "FooterMobileNavWrap", 3434 o = "FooterMobileNav"; 3435 function s(e) { 3436 (this.container = e), (this.localeDisclosure = null), (this.currencyDisclosure = null), theme.initWhenVisible({ element: this.container, callback: this.init.bind(this), threshold: 1e3 }); 3437 } 3438 return ( 3439 (s.prototype = Object.assign({}, s.prototype, { 3440 init: function () { 3441 var i = this.container.querySelector(e), 3442 n = this.container.querySelector(t); 3443 i && (this.localeDisclosure = new theme.Disclosure(i)), n && (this.currencyDisclosure = new theme.Disclosure(n)), theme.config.bpSmall && this.initDoubleMobileNav(), theme.collapsibles.init(this.container); 3444 }, 3445 initDoubleMobileNav: function () { 3446 var e = document.getElementById(n); 3447 if (e) { 3448 var t = document.getElementById(i), 3449 s = document.getElementById(o), 3450 a = t.cloneNode(!0).querySelector(".slide-nav__wrapper"); 3451 s.appendChild(a), new theme.MobileNav({ id: o, inHeader: !1 }), e.classList.remove("hide"); 3452 } 3453 }, 3454 onUnload: function () { 3455 this.localeDisclosure && this.localeDisclosure.destroy(), this.currencyDisclosure && this.currencyDisclosure.destroy(); 3456 }, 3457 })), 3458 s 3459 ); 3460 })()), 3461 (theme.HeaderSection = (function () { 3462 var e = "#MobileNavFooter", 3463 t = "#FooterMenus"; 3464 function i(e) { 3465 (this.container = e), (this.sectionId = this.container.getAttribute("data-section-id")), this.init(); 3466 } 3467 return ( 3468 (i.prototype = Object.assign({}, i.prototype, { 3469 init: function () { 3470 Shopify && 3471 Shopify.designMode && 3472 (theme.sections.reinit("slideshow-section"), 3473 setTimeout(function () { 3474 window.dispatchEvent(new Event("resize")); 3475 }, 500)), 3476 theme.headerNav.init(), 3477 theme.announcementBar.init(), 3478 theme.headerSearch.init(), 3479 document.body.classList.contains("template-cart") || new theme.HeaderCart(), 3480 new theme.MobileNav({ id: "MobileNav", inHeader: !0 }), 3481 theme.config.bpSmall && this.cloneFooter(), 3482 window.on("resize.header", theme.utils.debounce(300, theme.sizeDrawer)); 3483 }, 3484 cloneFooter: function () { 3485 var i = document.querySelector(e); 3486 if (i) { 3487 var n = document.querySelector(t).cloneNode(!0); 3488 (n.id = ""), i.appendChild(n); 3489 var o = i.querySelector(".multi-selectors"); 3490 o && 3491 o.querySelectorAll("[data-disclosure-toggle]").forEach((e) => { 3492 var t = e.getAttribute("aria-controls"), 3493 i = e.getAttribute("aria-describedby"); 3494 e.setAttribute("aria-controls", t + "-header"), e.setAttribute("aria-describedby", i + "-header"); 3495 var n = document.getElementById(t); 3496 n && (n.id = t + "-header"); 3497 var o = document.getElementById(i); 3498 o && (o.id = i + "-header"); 3499 var s = e.parentNode; 3500 s && new theme.Disclosure(s); 3501 }); 3502 } 3503 }, 3504 onUnload: function () {}, 3505 })), 3506 i 3507 ); 3508 })()), 3509 (theme.Toolbar = (function () { 3510 var e = "[data-disclosure-locale]",
3511 t = "[data-disclosure-currency]"; 3512 function i(e) { 3513 (this.container = e), (this.sectionId = this.container.getAttribute("data-section-id")), this.init(); 3514 } 3515 return ( 3516 (i.prototype = Object.assign({}, i.prototype, { 3517 init: function () { 3518 this.initDisclosures(), theme.announcementBar.init(); 3519 }, 3520 initDisclosures: function () { 3521 var i = this.container.querySelector(e), 3522 n = this.container.querySelector(t); 3523 i && (this.localeDisclosure = new theme.Disclosure(i)), n && (this.currencyDisclosure = new theme.Disclosure(n)); 3524 }, 3525 onBlockSelect: function (e) { 3526 theme.announcementBar.onBlockSelect(e.detail.blockId); 3527 }, 3528 onBlockDeselect: function () { 3529 theme.announcementBar.onBlockDeselect(); 3530 }, 3531 onUnload: function () { 3532 theme.announcementBar.unload(), this.localeDisclosure && this.localeDisclosure.destroy(), this.currencyDisclosure && this.currencyDisclosure.destroy(); 3533 }, 3534 })), 3535 i 3536 ); 3537 })()), 3538 (theme.Product = (function () { 3539 var e = {}, 3540 t = "on-sale", 3541 i = "disabled", 3542 n = "is-modal", 3543 o = "hide", 3544 s = ".product__video", 3545 a = ".product__video-wrapper", 3546 r = ".product-main-slide", 3547 c = ".is-selected", 3548 d = ".starting-slide", 3549 l = ".variant-wrapper", 3550 h = "[data-product-blocks]", 3551 u = "[data-blocks-holder]"; 3552 function m(e) { 3553 this.container = e; 3554 var t = (this.sectionId = e.getAttribute("data-section-id")), 3555 i = (this.productId = e.getAttribute("data-product-id")); 3556 (this.inModal = "true" === e.dataset.modal), 3557 this.modal, 3558 (this.settings = { 3559 enableHistoryState: "true" === e.dataset.history || !1, 3560 namespace: ".product-" + t, 3561 inventory: !1, 3562 inventoryThreshold: 10, 3563 modalInit: !1, 3564 hasImages: !0, 3565 imageSetName: null, 3566 imageSetIndex: null, 3567 currentImageSet: null, 3568 imageSize: "620x", 3569 currentSlideIndex: 0, 3570 videoLooping: e.dataset.videoLooping, 3571 }), 3572 this.inModal && ((this.settings.enableHistoryState = !1), (this.settings.namespace = ".product-" + t + "-modal"), (this.modal = document.getElementById("QuickShopModal-" + i))), 3573 (this.selectors = { 3574 variantsJson: "[data-variant-json]", 3575 currentVariantJson: "[data-current-variant-json]", 3576 form: ".product-single__form", 3577 media: "[data-product-media-type-model]", 3578 closeMedia: ".product-single__close-media", 3579 photoThumbs: "[data-product-thumb]", 3580 thumbSlider: "[data-product-thumbs]", 3581 thumbScroller: ".product__thumbs--scroller", 3582 mainSlider: "[data-product-photos]", 3583 imageContainer: "[data-product-images]", 3584 productImageMain: "[data-product-image-main]", 3585 priceWrapper: "[data-product-price-wrap]", 3586 price: "[data-product-price]", 3587 comparePrice: "[data-compare-price]", 3588 savePrice: "[data-save-price]", 3589 priceA11y: "[data-a11y-price]", 3590 comparePriceA11y: "[data-compare-price-a11y]", 3591 unitWrapper: "[data-unit-price-wrapper]", 3592 unitPrice: "[data-unit-price]", 3593 unitPriceBaseUnit: "[data-unit-base]", 3594 sku: "[data-sku]", 3595 inventory: "[data-product-inventory]", 3596 incomingInventory: "[data-incoming-inventory]", 3597 colorLabel: "[data-variant-color-label]", 3598 addToCart: "[data-add-to-cart]", 3599 addToCartText: "[data-add-to-cart-text]", 3600 originalSelectorId: "[data-product-select]", 3601 singleOptionSelector: "[data-variant-input]", 3602 variantColorSwatch: ".variant__input--color-swatch", 3603 availabilityContainer: "[data-store-availability-holder]", 3604 }), 3605 this.cacheElements(), 3606 (this.firstProductImage = this.cache.mainSlider.querySelector("img")), 3607 this.firstProductImage || (this.settings.hasImages = !1); 3608 var n = this.cache.mainSlider.querySelector("[data-set-name]"); 3609 n && (this.settings.imageSetName = n.dataset.setName), this.init(); 3610 } 3611 return ( 3612 (m.prototype = Object.assign({}, m.prototype, { 3613 init: function () { 3614 this.inModal && 3615 (this.container.classList.add(n), 3616 document.addEventListener("modalOpen.QuickShopModal-" + this.productId, this.openModalProduct.bind(this)), 3617 document.addEventListener("modalClose.QuickShopModal-" + this.productId, this.closeModalProduct.bind(this))), 3618 this.inModal || (this.formSetup(), this.productSetup(), this.videoSetup(), this.initProductSlider(), this.customMediaListners(), this.addIdToRecentlyViewed()), 3619 window.off("quickadd:loaded:" + this.sectionId), 3620 window.on("quickadd:loaded:" + this.sectionId, this.initQuickAddForm.bind(this)); 3621 }, 3622 cacheElements: function () { 3623 this.cache = { 3624 form: this.container.querySelector(this.selectors.form), 3625 mainSlider: this.container.querySelector(this.selectors.mainSlider), 3626 thumbSlider: this.container.querySelector(this.selectors.thumbSlider), 3627 thumbScroller: this.container.querySelector(this.selectors.thumbScroller), 3628 productImageMain: this.container.querySelector(this.selectors.productImageMain), 3629 priceWrapper: this.container.querySelector(this.selectors.priceWrapper), 3630 comparePriceA11y: this.container.querySelector(this.selectors.comparePriceA11y), 3631 comparePrice: this.container.querySelector(this.selectors.comparePrice), 3632 price: this.container.querySelector(this.selectors.price), 3633 savePrice: this.container.querySelector(this.selectors.savePrice), 3634 priceA11y: this.container.querySelector(this.selectors.priceA11y), 3635 }; 3636 }, 3637 formSetup: function () { 3638 this.initQtySelector(), this.initAjaxProductForm(
3638), this.availabilitySetup(), this.initVariants(), this.settings.imageSetName && this.updateImageSet(); 3639 }, 3640 availabilitySetup: function () { 3641 var e = this.container.querySelector(this.selectors.availabilityContainer); 3642 e && (this.storeAvailability = new theme.StoreAvailability(e)); 3643 }, 3644 productSetup: function () { 3645 this.setImageSizes(), this.initImageZoom(), this.initModelViewerLibraries(), this.initShopifyXrLaunch(), window.SPR && (SPR.initDomEls(), SPR.loadBadges()); 3646 }, 3647 setImageSizes: function () { 3648 if (this.settings.hasImages) { 3649 var e = this.firstProductImage.currentSrc; 3650 e && (this.settings.imageSize = theme.Images.imageSize(e)); 3651 } 3652 }, 3653 addIdToRecentlyViewed: function () { 3654 var e = this.container.getAttribute("data-product-id"); 3655 if (e) { 3656 var t = theme.recentlyViewedIds.indexOf(e); 3657 t > -1 && theme.recentlyViewedIds.splice(t, 1), theme.recentlyViewedIds.unshift(e), theme.config.hasLocalStorage && window.localStorage.setItem("recently-viewed", JSON.stringify(theme.recentlyViewedIds)); 3658 } 3659 }, 3660 initVariants: function () { 3661 var e = this.container.querySelector(this.selectors.variantsJson); 3662 if (e) { 3663 3664 this.variantsObject = JSON.parse(e.innerHTML); 3665 var t = { 3666 container: this.container, 3667 enableHistoryState: this.settings.enableHistoryState, 3668 singleOptionSelector: this.selectors.singleOptionSelector, 3669 originalSelectorId: this.selectors.originalSelectorId, 3670 variants: this.variantsObject, 3671 }, 3672 i = this.container.querySelectorAll(this.selectors.variantColorSwatch); 3673 if ( 3674 (i.length && 3675 i.forEach((e) => { 3676 e.addEventListener( 3677 "change", 3678 function (t) { 3679 var i = e.dataset.colorName, 3680 n = e.dataset.colorIndex; 3681 this.updateColorName(i, n); 3682 }.bind(this) 3683 ); 3684 }), 3685 (this.variants = new theme.Variants(t)), 3686 this.storeAvailability) 3687 ) { 3688 var n = this.variants.currentVariant ? this.variants.currentVariant.id : this.variants.variants[0].id; 3689 this.storeAvailability.updateContent(n), this.container.on("variantChange" + this.settings.namespace, this.updateAvailability.bind(this)); 3690 } 3691 this.container.on("variantChange" + this.settings.namespace, this.updateCartButton.bind(this)), 3692 this.container.on("variantImageChange" + this.settings.namespace, this.updateVariantImage.bind(this)), 3693 this.container.on("variantPriceChange" + this.settings.namespace, this.updatePrice.bind(this)), 3694 this.container.on("variantUnitPriceChange" + this.settings.namespace, this.updateUnitPrice.bind(this)), 3695 this.container.querySelectorAll(this.selectors.sku).length && this.container.on("variantSKUChange" + this.settings.namespace, this.updateSku.bind(this)); 3696 this.container.querySelectorAll(this.selectors.sku).length && this.container.on("variantMPNChange" + this.settings.namespace, this.updateMpn.bind(this)); 3697 var o = this.container.querySelector(this.selectors.inventory); 3698 if ( 3699 (o && ((this.settings.inventory = !0), (this.settings.inventoryThreshold = o.dataset.threshold), this.container.on("variantChange" + this.settings.namespace, this.updateInventory.bind(this))), 3700 theme.settings.dynamicVariantsEnable) 3701 ) { 3702 var s = this.container.querySelector(this.selectors.currentVariantJson); 3703 if (s) { 3704 var a = this.container.querySelector(l); 3705 a && 3706 new theme.VariantAvailability({ 3707 container: this.container, 3708 namespace: this.settings.namespace, 3709 type: a.dataset.type, 3710 variantsObject: this.variantsObject, 3711 currentVariantObject: JSON.parse(s.innerHTML), 3712 }); 3713 } 3714 } 3715 this.settings.imageSetName && 3716 ((this.settings.imageSetIndex = this.container.querySelector('.variant-input-wrap[data-handle="' + this.settings.imageSetName + '"]').dataset.index), 3717 this.container.on("variantChange" + this.settings.namespace, this.updateImageSet.bind(this))); 3718 } 3719 }, 3720 initQtySelector: function () { 3721 this.container.querySelectorAll(".js-qty__wrapper").forEach((e) => { 3722 new theme.QtySelector(e, { namespace: ".product" }); 3723 }); 3724 }, 3725 initAjaxProductForm: function () { 3726 "dropdown" === theme.settings.cartType && new theme.AjaxProduct(this.cache.form, ".add-to-cart"); 3727 }, 3728 updateColorName: function (e, t) { 3729 this.container.querySelector(this.selectors.colorLabel + `[data-index="${t}"`).textContent = e; 3730 }, 3731 updateCartButton: function (e) { 3732 var t = e.detail.variant, 3733 n = this.container.querySelector(this.selectors.addToCart), 3734 o = this.container.querySelector(this.selectors.addToCartText); 3735 if (t) 3736 if (t.available) { 3737 n.classList.remove(i), (n.disabled = !1); 3738 var s = o.dataset.defaultText; 3739 o.textContent = s; 3740 } else n.classList.add(i), (n.disabled = !0), (o.textContent = theme.strings.soldOut); 3741 else n.classList.add(i), (n.disabled = !0), (o.textContent = theme.strings.unavailable); 3742 }, 3743 updatePrice: function (e) { 3744 var i = e.detail.variant; 3745 if (i) 3746 if ((this.cache.price || this.cacheElements(), (this.cache.price.innerHTML = theme.Currency.formatMoney(i.price, theme.settings.moneyFormat)), i.compare_at_price > i.price)) { 3747 (this.cache.comparePrice.innerHTML = theme.Currency.formatMoney(i.compare_at_price, theme.settings.moneyFormat)), 3748 this.cache.priceWrapper.classList.remove(o), 3749 this.cache.price.classList.add(t), 3750 this.cache.comparePriceA11y && this.cache.comparePriceA11y.setAttribute("aria-hidden", "false"), 3751 this.cache.priceA11y && this.cache.priceA11y.setAttribute("aria-hidden", "false"); 3752 var n = i.compare_at_price - i.price; 3753 (n = "percent" == theme.settings.saveType ? Math.round((100 * n) / i.compare_at_price) + "%" : theme.Currency.formatMoney(n, theme.settings.moneyFormat)), 3754 this.cache.savePrice.classList.remove(o), 3755 (this.cache.savePrice.innerHTML = theme.strings.savePrice.replace("[saved_amount]", n)); 3756 } else 3757 this.cache.priceWrapper && this.cache.priceWrapper.classList.add(o), 3758 this.cache.savePrice.classList.add(o), 3759 this.cache.price.classList.remove(t), 3760 this.cache.comparePriceA11y && this.cache.comparePriceA11y.setAttribute("aria-hidden", "true"), 3761 this.cache.priceA11y && this.cache.priceA11y.setAttribute("aria-hidden", "true"); 3762 }, 3763 updateUnitPrice: function (e) { 3764 var t = e.detail.variant; 3765 t && t.unit_price 3766 ? ((this.container.querySelector(this.selectors.unitPrice).innerHTML = theme.Currency.formatMoney(t.unit_price, theme.settings.moneyFormat)), 3767 (this.container.querySelector(this.selectors.unitPriceBaseUnit).innerHTML = theme.Currency.getBaseUnit(t)), 3768 this.container.querySelector(this.selectors.unitWrapper).classList.remove(o)) 3769 : this.container.querySelector(this.selectors.unitWrapper).classList.add(o); 3770 }, 3771 imageSetArguments: function (e) { 3772 if ((e = e || (this.variants ? this.variants.currentVariant : null))) { 3773 var t = (this.settings.currentImageSet = this.getImageSetName(e[this.settings.imageSetIndex])), 3774 i = this.settings.imageSetName + "_" + t; 3775 return (this.settings.currentSlideIndex = 0), { cellSelector: '[data-group="' + i + '"]', imageSet: i, initialIndex: this.settings.currentSlideIndex }; 3776 } 3777 }, 3778 updateImageSet: function (e) { 3779 var t = e ? e.detail.variant : this.variants ? this.variants.currentVariant : null; 3780 if (t) { 3781 var i = this.getImageSetName(t[this.settings.imageSetIndex]); 3782 this.settings.currentImageSet !== i && this.initProductSlider(t); 3783 } 3784 }, 3785 updateImageSetThumbs: function (e) { 3786 this.cache.thumbSlider.querySelectorAll(".product__thumb-item").forEach((t) => { 3787 t.classList.toggle(o, t.dataset.group !== e); 3788 }); 3789 }, 3790 getImageSetName: function (e) { 3791 return e 3792 .toLowerCase() 3793 .replace(/[^a-z0-9]+/g, "-") 3794 .replace(/-$/, "") 3795 .replace(/^-/, ""); 3796 }, 3797 updateSku: function (e) { 3798 var t = e.detail.variant, 3799 i = "", 3800 n = !0; 3801 t && 3802 (t.sku && ((i = t.sku), (n = !1)), 3803 this.container.querySelectorAll(this.selectors.sku).forEach((e) => { 3804 e.classList.toggle(o, n), (e.querySelector("[data-sku-id]").textContent = i); 3805 })); 3806 }, 3807 updateMpn: function (e) { 3808 3809 var t = e.detail.variant, 3810 i = "", 3811 n = !0; 3812 let div = document.getElementById(t.id); 3813 let value = ' (MPN: ' + div.getAttribute('data-mpn') + ')'; 3814 console.log(value); // "myValue" 3815 t && 3816 (t.sku && ((i = value), (n = !1)), 3817 this.container.querySelectorAll(this.selectors.sku).forEach((e) => { 3818 e.classList.toggle(o, n), (e.querySelector("[data-mpn-id]").textContent = i); 3819 })); 3820 }, 3821 updateInventory: function (e) { 3822 var t = e.detail.variant; 3823 if (!t || !t.inventory_management || "continue" === t.inventory_policy) return this.toggleInventoryQuantity(t, !1), void this.toggleIncomingInventory(!1); 3824 if ("shopify" === t.inventory_management && window.inventories && window.inventories[this.productId]) { 3825 var i = window.inventories[this.productId][t.id], 3826 n = i.quantity, 3827 o = !0, 3828 s = !1; 3829 (n <= 0 || n > this.settings.inventoryThreshold) && (o = !1), 3830 this.toggleInventoryQuantity(t, o, n), 3831 !o && "true" === i.incoming && n <= this.settings.inventoryThreshold && (s = !0), 3832 this.toggleIncomingInventory(s, t.available, i.next_incoming_date); 3833 } 3834 }, 3835 updateAvailability: function (e) { 3836 var t = e.detail.variant; 3837 t && this.storeAvailability.updateContent(t.id); 3838 }, 3839 toggleInventoryQuantity: function (e, t, i) { 3840 this.settings.inventory; 3841 var n = this.container.querySelector(this.selectors.inventory), 3842 s = n.closest(".product-block"); 3843 parseInt(i) <= parseInt(this.settings.inventoryThreshold) 3844 ? (n.parentNode.classList.add("inventory--low"), (n.textContent = theme.strings.stockLabel.replace("[count]", i))) 3845 : (n.parentNode.classList.remove("inventory--low"), (n.textContent = theme.strings.inStockLabel)), 3846 e && e.available ? (n.parentNode.classList.remove(o), s && s.classList.remove(o)) : (n.parentNode.classList.add(o), s && s.classList.add(o)); 3847 }, 3848 toggleIncomingInventory: function (e, t, i) { 3849 var n = this.container.querySelector(this.selectors.incomingInventory); 3850 if (n) { 3851 var s = n.querySelector(".js-incoming-text"); 3852 if (e) { 3853 var a = t ? theme.strings.willNotShipUntil.replace("[date]", i) : theme.strings.willBeInStockAfter.replace("[date]", i); 3854
3854 i || (a = theme.strings.waitingForStock), n.classList.remove(o), (s.textContent = a); 3855 } else n.classList.add(o); 3856 } 3857 }, 3858 videoSetup: function () { 3859 var e = this.cache.mainSlider.querySelectorAll(s); 3860 if (!e.length) return !1; 3861 e.forEach((e) => { 3862 var t = e.dataset.videoType; 3863 "youtube" === t ? this.initYoutubeVideo(e) : "mp4" === t && this.initMp4Video(e); 3864 }); 3865 }, 3866 initYoutubeVideo: function (t) { 3867 e[t.id] = new theme.YouTube(t.id, { 3868 videoId: t.dataset.youtubeId, 3869 videoParent: a, 3870 autoplay: !1, 3871 style: t.dataset.videoStyle, 3872 loop: t.dataset.videoLoop, 3873 events: { onReady: this.youtubePlayerReady.bind(this), onStateChange: this.youtubePlayerStateChange.bind(this) }, 3874 }); 3875 }, 3876 youtubePlayerReady: function (t) { 3877 var i = t.target.getIframe().id; 3878 if (e[i]) { 3879 var n = e[i], 3880 o = n.videoPlayer; 3881 "sound" !== n.options.style && o.mute(), n.parent.classList.remove("loading"), n.parent.classList.add("loaded"), this._isFirstSlide(i) && "sound" !== n.options.style && o.playVideo(); 3882 } 3883 }, 3884 _isFirstSlide: function (e) { 3885 return this.cache.mainSlider.querySelector(d + " #" + e); 3886 }, 3887 youtubePlayerStateChange: function (t) { 3888 var i = t.target.getIframe().id, 3889 n = e[i]; 3890 switch (t.data) { 3891 case -1: 3892 n.attemptedToPlay && n.parent.classList.add("video-interactable"); 3893 break; 3894 case 0: 3895 n && "true" === n.options.loop && n.videoPlayer.playVideo(); 3896 break; 3897 case 3: 3898 n.attemptedToPlay = !0; 3899 } 3900 }, 3901 initMp4Video: function (t) { 3902 (e[t.id] = { id: t.id, type: "mp4" }), this._isFirstSlide(t.id) && this.playMp4Video(t.id); 3903 }, 3904 stopVideos: function () { 3905 for (var [t, i] of Object.entries(e)) i.videoPlayer ? "function" == typeof i.videoPlayer.stopVideo && i.videoPlayer.stopVideo() : "mp4" === i.type && this.stopMp4Video(i.id); 3906 }, 3907 _getVideoType: function (e) { 3908 return e.getAttribute("data-video-type"); 3909 }, 3910 _getVideoDivId: function (e) { 3911 return e.id; 3912 }, 3913 playMp4Video: function (e) { 3914 var t = this.container.querySelector("#" + e), 3915 i = t.play(); 3916 t.setAttribute("controls", ""), 3917 t.focus(), 3918 t.addEventListener("focusout", this.returnFocusToThumbnail.bind(this)), 3919 void 0 !== i && 3920 i 3921 .then(function () {}) 3922 .catch(function (e) { 3923 t.setAttribute("controls", ""), t.closest(a).setAttribute("data-video-style", "unmuted"); 3924 }); 3925 }, 3926 stopMp4Video: function (e) { 3927 var t = this.container.querySelector("#" + e); 3928 t.removeEventListener("focusout", this.returnFocusToThumbnail.bind(this)), t && "function" == typeof t.pause && (t.removeAttribute("controls"), t.pause()); 3929 }, 3930 returnFocusToThumbnail: function () { 3931 var e = this.container.querySelector('.product__thumb-item[data-index="' + this.settings.currentSlideIndex + '"] a'); 3932 e && e.focus(); 3933 }, 3934 initImageZoom: function () { 3935 var e = this.container.querySelector(this.selectors.imageContainer); 3936 if (e) { 3937 new theme.Photoswipe(e, this.sectionId); 3938 e.addEventListener( 3939 "photoswipe:afterChange", 3940 function (e) { 3941 this.flickity && this.flickity.goToSlide(e.detail.index); 3942 }.bind(this) 3943 ); 3944 } 3945 }, 3946 getThumbIndex: function (e) { 3947 return e.dataset.index; 3948 },
3949 updateVariantImage: function (e) { 3950 var t = e.detail.variant, 3951 i = (theme.Images.getSizedImageUrl(t.featured_media.preview_image.src, this.settings.imageSize), this.container.querySelector('.product__thumb[data-id="' + t.featured_media.id + '"]')), 3952 n = this.getThumbIndex(i); 3953 void 0 !== n && this.flickity && this.flickity.goToSlide(n); 3954 }, 3955 initProductSlider: function (e) { 3956 if (this.cache.mainSlider.querySelectorAll(r).length <= 1) { 3957 var t = this.cache.mainSlider.querySelector(r); 3958 t && t.classList.add("is-selected"); 3959 } else { 3960 if ((this.flickity && "function" == typeof this.flickity.destroy && this.flickity.destroy(), !e)) { 3961 var i = this.cache.mainSlider.querySelector(d); 3962 this.settings.currentSlideIndex = this._slideIndex(i); 3963 } 3964 var n = { 3965 adaptiveHeight: !0, 3966 avoidReflow: !0, 3967 initialIndex: this.settings.currentSlideIndex, 3968 childNav: this.cache.thumbSlider, 3969 childNavScroller: this.cache.thumbScroller, 3970 childVertical: "beside" === this.cache.thumbSlider.dataset.position, 3971 pageDots: !0, 3972 wrapAround: !0, 3973 callbacks: { onInit: this.onSliderInit.bind(this), onChange: this.onSlideChange.bind(this) }, 3974 }; 3975 if (this.settings.imageSetName) { 3976 var o = this.imageSetArguments(e); 3977 (n = Object.assign({}, n, o)), this.updateImageSetThumbs(n.imageSet); 3978 } 3979 this.flickity = new theme.Slideshow(this.cache.mainSlider, n); 3980 } 3981 }, 3982 onSliderInit: function (e) { 3983 this.settings.imageSetName && this.prepMediaOnSlide(e); 3984 }, 3985 onSlideChange: function (e) { 3986 if (this.flickity) { 3987 var t = this.cache.mainSlider.querySelector('.product-main-slide[data-index="' + this.settings.currentSlideIndex + '"]'), 3988 i = this.settings.imageSetName ? this.cache.mainSlider.querySelectorAll(".flickity-slider .product-main-slide")[e] : this.cache.mainSlider.querySelector('.product-main-slide[data-index="' + e + '"]'); 3989 t.setAttribute("tabindex", "-1"), i.setAttribute("tabindex", 0), this.stopMediaOnSlide(t), this.prepMediaOnSlide(i), (this.settings.currentSlideIndex = e); 3990 } 3991 }, 3992 stopMediaOnSlide(t) { 3993 var i = t.querySelector(s); 3994 if (i) { 3995 var n = this._getVideoType(i), 3996 o = this._getVideoDivId(i); 3997 if ("youtube" === n) { 3998 if (e[o].videoPlayer) return void e[o].videoPlayer.stopVideo(); 3999 } else if ("mp4" === n) return void this.stopMp4Video(o); 4000 } 4001 var a = t.querySelector(this.selectors.media); 4002 a && a.dispatchEvent(new CustomEvent("mediaHidden", { bubbles: !0, cancelable: !0 })); 4003 }, 4004 prepMediaOnSlide(t) { 4005 var i = t.querySelector(s); 4006 if (i) { 4007 var n = this._getVideoType(i), 4008 o = this._getVideoDivId(i); 4009 if ("youtube" === n) { 4010 if (e[o].videoPlayer && "sound" !== e[o].options.style) return void e[o].videoPlayer.playVideo(); 4011 } else "mp4" === n && this.playMp4Video(o); 4012 } 4013 var a = t.querySelector(this.selectors.media); 4014 a && 4015 (a.dispatchEvent(new CustomEvent("mediaVisible", { bubbles: !0, cancelable: !0 })), 4016 t.querySelector(".shopify-model-viewer-ui__button").setAttribute("tabindex", 0), 4017 t.querySelector(".product-single__close-media").setAttribute("tabindex", 0)); 4018 }, 4019 _slideIndex: function (e) { 4020 return e.getAttribute("data-index"); 4021 }, 4022 openModalProduct: function () { 4023 var e = !1; 4024 if (this.settings.modalInit) e = !0; 4025 else { 4026 this.blocksHolder = this.container.querySelector(u); 4027 var t = this.blocksHolder.dataset.url; 4028 fetch(t) 4029 .then(function (e) { 4030 return e.text(); 4031 }) 4032 .then( 4033 function (e) { 4034 var t = new DOMParser().parseFromString(e, "text/html").querySelector(h); 4035 t.querySelectorAll("[id]").forEach((e) => { 4036 var i = e.getAttribute("id"); 4037 e.setAttribute("id", i + "-modal"); 4038 var n = t.querySelector(`[for="${i}"]`); 4039 n && n.setAttribute("for", i + "-modal"); 4040 var o = t.querySelector(`[aria-controls="${i}"]`); 4041 o && o.setAttribute("aria-controls", i + "-modal"); 4042 }); 4043 var i = t.querySelector(this.selectors.form).getAttribute("id"); 4044 t.querySelectorAll("[form]").forEach((e) => { 4045 e.setAttribute("form", i); 4046 }), 4047 (this.blocksHolder.innerHTML = ""), 4048 this.blocksHolder.append(t), 4049 this.blocksHolder.classList.add("product-form-holder--loaded"), 4050 this.cacheElements(), 4051 this.formSetup(), 4052 this.updateModalProductInventory(), 4053 Shopify && Shopify.PaymentButton && Shopify.PaymentButton.init(), 4054 theme.collapsibles.init(this.container), 4055 document.dispatchEvent(new CustomEvent("quickview:loaded", { detail: { productId: this.sectionId } })); 4056 }.bind(this) 4057 ), 4058 this.productSetup(), 4059 this.videoSetup(), 4060 this.settings.imageSetName 4061 ? this.variants 4062 ? this.initProductSlider() 4063 : document.addEventListener( 4064 "quickview:loaded", 4065 function (e) { 4066 e.detail.productId === this.sectionId && this.initProductSlider(); 4067 }.bind(this) 4068 ) 4069 : this.initProductSlider(), 4070 this.customMediaListners(), 4071 this.addIdToRecentlyViewed(), 4072 (this.settings.modalInit = !0); 4073 } 4074 document.dispatchEvent(new CustomEvent("quickview:open", { detail: { initialized: e, productId: this.sectionId } })); 4075 }, 4076 updateModalProductInventory: function () { 4077 (window.inventories = window.inventories || {}), 4078 this.container.querySelectorAll(".js-product-inventory-data").forEach((e) => { 4079 var t = e.dataset.productId; 4080 (window.inventories[t] = {}), 4081 e.querySelectorAll(".js-variant-inventory-data").forEach((e) => { 4082 window.inventories[t][e.dataset.id] = { quantity: e.dataset.quantity, incoming: e.dataset.incoming, next_incoming_date: e.dataset.date }; 4083 }); 4084 }); 4085 }, 4086 closeModalProduct: function () { 4087 this.stopVideos(); 4088 }, 4089 initQuickAddForm: function () { 4090 this.updateModalProductInventory(), Shopify && Shopify.PaymentButton && Shopify.PaymentButton.init(); 4091 }, 4092 initModelViewerLibraries: function () { 4093 var e = this.container.querySelectorAll(this.selectors.media); 4094 e.length < 1 || theme.ProductMedia.init(e, this.sectionId); 4095 }, 4096 initShopifyXrLaunch: function () { 4097 document.addEventListener( 4098 "shopify_xr_launch", 4099 function () { 4100 this.container.querySelector(this.selectors.productMediaWrapper + ":not(." + self.classes.hidden + ")").dispatchEvent(new CustomEvent("xrLaunch", { bubbles: !0, cancelable: !0 })); 4101 }.bind(this) 4102 ); 4103 }, 4104 customMediaListners: function () { 4105 document.querySelectorAll(this.selectors.closeMedia).forEac
4105h((e) => { 4106 e.addEventListener( 4107 "click", 4108 function () { 4109 var e = this.cache.mainSlider.querySelector(c).querySelector(this.selectors.media); 4110 e && e.dispatchEvent(new CustomEvent("mediaHidden", { bubbles: !0, cancelable: !0 })); 4111 }.bind(this) 4112 ); 4113 }); 4114 var e = this.container.querySelectorAll("model-viewer"); 4115 e.length && 4116 e.forEach((e) => { 4117 e.addEventListener( 4118 "shopify_model_viewer_ui_toggle_play", 4119 function (e) { 4120 this.mediaLoaded(e); 4121 }.bind(this) 4122 ), 4123 e.addEventListener( 4124 "shopify_model_viewer_ui_toggle_pause", 4125 function (e) { 4126 this.mediaUnloaded(e); 4127 }.bind(this) 4128 ); 4129 }); 4130 }, 4131 mediaLoaded: function (e) { 4132 this.container.querySelectorAll(this.selectors.closeMedia).forEach((e) => { 4133 e.classList.remove(o); 4134 }), 4135 this.flickity && this.flickity.setDraggable(!1); 4136 }, 4137 mediaUnloaded: function (e) { 4138 this.container.querySelectorAll(this.selectors.closeMedia).forEach((e) => { 4139 e.classList.add(o); 4140 }), 4141 this.flickity && this.flickity.setDraggable(!0); 4142 }, 4143 onUnload: function () { 4144 theme.ProductMedia.removeSectionModels(this.sectionId), this.flickity && "function" == typeof this.flickity.destroy && this.flickity.destroy(); 4145 }, 4146 })), 4147 m 4148 ); 4149 })()), 4150 (theme.RecentlyViewed = (function () { 4151 var e = !1; 4152 function t(e) { 4153 e && ((this.container = e), (this.sectionId = this.container.getAttribute("data-section-id")), theme.initWhenVisible({ element: this.container, callback: this.init.bind(this), threshold: 600 })); 4154 } 4155 return ( 4156 (t.prototype = Object.assign({}, t.prototype, { 4157 init: function () { 4158 if (!e) 4159 if (((e = !0), theme.recentlyViewedIds.length)) { 4160 this.outputContainer = document.getElementById("RecentlyViewed-" + this.sectionId); 4161 var t = this.container.getAttribute("data-product-id"), 4162 i = theme.routes.search + "?view=recently-viewed&type=product&q=", 4163 n = "", 4164 o = 0; 4165 theme.recentlyViewedIds.forEach(function (e) { 4166 e !== t && (o >= 7 || ((n += "id:" + e + " OR "), o++)); 4167 }), 4168 (i += encodeURIComponent(n)), 4169 fetch(i) 4170 .then(function (e) { 4171 return e.text(); 4172 }) 4173 .then( 4174 function (e) { 4175 var t = new DOMParser().parseFromString(e, "text/html"); 4176 if (t.querySelectorAll(".grid-product").length > 0) { 4177 var i = t.querySelector(".product-grid"); 4178 this.outputContainer.append(i), new theme.QuickAdd(this.outputContainer), new theme.QuickShop(this.outputContainer); 4179 } else this.container.classList.add("hide"); 4180 }.bind(this) 4181 ); 4182 } else this.container.classList.add("hide"); 4183 }, 4184 onUnload: function () { 4185 e = !1; 4186 }, 4187 })), 4188 t 4189 ); 4190 })()), 4191 (theme.VendorProducts = (function () { 4192 function e(e) { 4193 e && 4194 ((this.container = e), 4195 (this.sectionId = this.container.getAttribute("data-section-id")), 4196 (this.currentProduct = this.container.getAttribute("data-product-id")), 4197 theme.initWhenVisible({ element: this.container, callback: this.init.bind(this), threshold: 600 })); 4198 } 4199 return ( 4200 (e.prototype = Object.assign({}, e.prototype, { 4201 init: function () { 4202 (this.outputContainer = document.getElementById("VendorProducts-" + this.sectionId)), (this.vendor = this.container.getAttribute("data-vendor")); 4203 var e = theme.routes.collections + "/vendors?view=vendor-ajax&sort_by=best-selling&q=" + this.vendor; 4204 (e = e.replace("//", "/")), 4205 fetch(e) 4206 .then(function (e) { 4207 return e.text(); 4208 }) 4209 .then((e) => { 4210 var t = 0, 4211 i = [], 4212 n = [], 4213 o = new DOMParser().parseFromString(e, "text/html"); 4214 o.querySelectorAll(".grid-product").forEach((e) => { 4215 var s = e.dataset.productId; 4216 if (6 !== t && s !== this.currentProduct) { 4217 var a = o.querySelector('.modal[data-
4217product-id="' + s + '"]'); 4218 a && n.push(a), t++, i.push(e); 4219 } 4220 }), 4221 (this.outputContainer.innerHTML = ""), 4222 0 === i.length 4223 ? this.container.classList.add("hide") 4224 : (this.outputContainer.classList.remove("hide"), 4225 this.outputContainer.append(...i), 4226 n.length && (this.outputContainer.append(...n), new theme.QuickShop(this.outputContainer)), 4227 new theme.QuickAdd(this.outputContainer)); 4228 }); 4229 }, 4230 })), 4231 e 4232 ); 4233 })()), 4234 (theme.Testimonials = (function () { 4235 var e = { adaptiveHeight: !0, avoidReflow: !0, pageDots: !0, prevNextButtons: !1 }; 4236 function t(e) { 4237 (this.container = e), this.timeout; 4238 var t = e.getAttribute("data-section-id"); 4239 (this.slideshow = e.querySelector("#Testimonials-" + t)), (this.namespace = ".testimonial-" + t), this.slideshow && theme.initWhenVisible({ element: this.container, callback: this.init.bind(this), threshold: 600 }); 4240 } 4241 return ( 4242 (t.prototype = Object.assign({}, t.prototype, { 4243 init: function () { 4244 this.slideshow.dataset.count <= 3 && (e.wrapAround = !1), 4245 (this.flickity = new theme.Slideshow(this.slideshow, e)), 4246 this.slideshow.dataset.count > 2 && 4247 (this.timeout = setTimeout( 4248 function () { 4249 this.flickity.goToSlide(1); 4250 }.bind(this), 4251 1e3 4252 )); 4253 }, 4254 onUnload: function () { 4255 this.flickity && "function" == typeof this.flickity.destroy && this.flickity.destroy(); 4256 }, 4257 onDeselect: function () { 4258 this.flickity && "function" == typeof this.flickity.play && this.flickity.play(); 4259 }, 4260 onBlockSelect: function (e) { 4261 var t = this.slideshow.querySelector(".testimonials-slide--" + e.detail.blockId), 4262 i = parseInt(t.dataset.index); 4263 clearTimeout(this.timeout), this.flickity && "function" == typeof this.flickity.pause && (this.flickity.goToSlide(i), this.flickity.pause()); 4264 }, 4265 onBlockDeselect: function () { 4266 this.flickity && "function" == typeof this.flickity.play && this.flickity.play(); 4267 }, 4268 })), 4269 t 4270 ); 4271 })()), 4272 (theme.isStorageSupported = function (e) { 4273 if (window.self !== window.top) return !1; 4274 var t; 4275 "session" === e && (t = window.sessionStorage), "local" === e && (t = window.localStorage); 4276 try { 4277 return t.setItem("test", "1"), t.removeItem("test"), !0; 4278 } catch (e) { 4279 return !1; 4280 } 4281 }), 4282 (theme.reinitProductGridItem = function (e) { 4283 window.SPR && (SPR.initDomEls(), SPR.loadBadges()), theme.collapsibles.init(); 4284 }), 4285 (theme.sizeDrawer = function () { 4286 var e = document.getElementById("HeaderWrapper").offsetHeight, 4287 t = window.innerHeight - e; 4288 document.documentElement.style.setProperty("--maxDrawerHe
4288ight", t + "px"); 4289 }), 4290 (theme.config.hasSessionStorage = theme.isStorageSupported("session")), 4291 (theme.config.hasLocalStorage = theme.isStorageSupported("local")), 4292 theme.config.hasLocalStorage) 4293 ) { 4294 var c = window.localStorage.getItem("recently-viewed"); 4295 c && void 0 !== typeof c && (theme.recentlyViewedIds = JSON.parse(c)); 4296 } 4297 (theme.config.bpSmall = matchMedia(theme.config.mediaQuerySmall).matches), 4298 matchMedia(theme.config.mediaQuerySmall).addListener(function (e) { 4299 e.matches ? ((theme.config.bpSmall = !0), document.dispatchEvent(new CustomEvent("matchSmall"))) : ((theme.config.bpSmall = !1), document.dispatchEvent(new CustomEvent("unmatchSmall"))); 4300 }), 4301 (theme.initGlobals = function () { 4302 theme.collapsibles.init(), theme.videoModal(), theme.animationObserver(); 4303 }), 4304 (r = function () { 4305 if ( 4306 ((theme.sections = new theme.Sections()), 4307 theme.sections.register("slideshow-section", theme.SlideshowSection), 4308 theme.sections.register("header", theme.HeaderSection), 4309 theme.sections.register("toolbar", theme.Toolbar), 4310 theme.sections.register("product", theme.Product), 4311 theme.sections.register("password-header", theme.PasswordHeader), 4312 theme.sections.register("photoswipe", theme.Photoswipe), 4313 theme.sections.register("product-recommendations", theme.Recommendations), 4314 theme.sections.register("background-image", theme.BackgroundImage), 4315 theme.sections.register("testimonials", theme.Testimonials), 4316 theme.sections.register("video-section", theme.VideoSection), 4317 theme.sections.register("map", theme.Maps), 4318 theme.sections.register("footer-section", theme.FooterSection), 4319 theme.sections.register("store-availability", theme.StoreAvailability), 4320 theme.sections.register("recently-viewed", theme.RecentlyViewed), 4321 theme.sections.register("vendor-products", theme.VendorProducts), 4322 theme.sections.register("newsletter-popup", theme.NewsletterPopup), 4323 theme.sections.register("collection-header", theme.CollectionHeader), 4324 theme.sections.register("collection-template", theme.Collection), 4325 theme.initGlobals(), 4326 theme.rteInit(), 4327 theme.settings.isCustomerTemplate && theme.customerTemplates(), 4328 document.body.classList.contains("template-cart")) 4329 ) { 4330 var e = document.getElementById("CartPageForm"); 4331 if (e) { 4332 var t = new theme.CartForm(e), 4333 i = document.querySelector('.cart-recommendations[data-location="page"]'); 4334 i && (new theme.QuickAdd(i), new theme.QuickShop(i)); 4335 var n = e.querySelector(".add-note"); 4336 n && 4337 n.addEventListener("click", function () { 4338 n.classList.toggle("is-active"), e.querySelector(".cart__note").classList.toggle("hide"); 4339 }), 4340 document.addEventListener( 4341 "ajaxProduct:added", 4342 function (e) { 4343 t.buildCart(); 4344 }.bind(this) 4345 ); 4346 } 4347 } 4348 if (document.body.classList.contains("template-search")) { 4349 var o = document.querySelector(".search-grid"); 4350 o && o.querySelectorAll(".grid-product").length && (new theme.QuickAdd(o), new theme.QuickShop(o)); 4351 } 4352 document.addEventListener("recommendations:loaded", function (e) { 4353 e && e.detail && e.detail.section && (new theme.QuickAdd(e.detail.section), new theme.QuickShop(e.detail.section)); 4354 }), 4355 theme.pageTransitions(), 4356 document.dispatchEvent(new CustomEvent("page:loaded")); 4357 }), 4358 "loading" != document.readyState ? r() : document.addEventListener("DOMContentLoaded", r); 4359 })();
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.