1(()=>{"use strict";var __webpack_exports__={};function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}var LOCAL_STORAGE_KEY="pxu-shopify-surface-pick-up",loadingClass="surface-pick-up--loading",isNotExpired=function(timestamp){return timestamp+1e3*60*60>=Date.now()},removeTrailingSlash=function(s){return s.replace(/(.*)\/$/,"$1")};function calculateDistance(latitude1,longitude1,latitude2,longitude2,unitSystem){var dtor=Math.PI/180,radius=unitSystem==="metric"?6378.14:3959,rlat1=latitude1*dtor,rlong1=longitude1*dtor,rlat2=latitude2*dtor,rlong2=longitude2*dtor,dlon=rlong1-rlong2,dlat=rlat1-rlat2,a=Math.pow(Math.sin(dlat/2),2)+Math.cos(rlat1)*Math.cos(rlat2)*Math.pow(Math.sin(dlon/2),2),c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return radius*c}function getGeoLocation(){return _getGeoLocation.apply(this,arguments)}function _getGeoLocation(){return _getGeoLocation=_asyncToGenerator(regeneratorRuntime.mark(function _callee(){return regeneratorRuntime.wrap(function(_context){for(;;)switch(_context.prev=_context.next){case 0:return _context.abrupt("return",new Promise(function(resolve,reject){var options={maximumAge:36e5,timeout:5e3};navigator.geolocation?navigator.geolocation.getCurrentPosition(function(_ref3){var coords=_ref3.coords;return resolve(coords)},reject,options):reject()}));case 1:case"end":return _context.stop()}},_callee)})),_getGeoLocation.apply(this,arguments)}function setLocation(_x){return _setLocation.apply(this,arguments)}function _setLocation(){return _setLocation=_asyncToGenerator(regeneratorRuntime.mark(function _callee2(_ref){var latitude,longitude,newData;return regeneratorRuntime.wrap(function(_context2){for(;;)switch(_context2.prev=_context2.next){case 0:return latitude=_ref.latitude,longitude=_ref.longitude,newData={latitude,longitude,timestamp:Date.now()},localStorage.setItem(LOCAL_STORAGE_KEY,JSON.stringify(newData)),_context2.abrupt("return",fetch("/localization.json",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({latitude,longitude})}).then(function(){return{latitude,longitude}}));case 4:case"end":return _context2.stop()}},_callee2)}
1)),_setLocation.apply(this,arguments)}function getLocation(){return _getLocation.apply(this,arguments)}function _getLocation(){return _getLocation=_asyncToGenerator(regeneratorRuntime.mark(function _callee3(){var requestLocation,cachedLocation,_args3=arguments;return regeneratorRuntime.wrap(function(_context3){for(;;)switch(_context3.prev=_context3.next){case 0:if(requestLocation=_args3.length>0&&_args3[0]!==void 0?_args3[0]:!1,cachedLocation=JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)),!(cachedLocation&&isNotExpired(cachedLocation.timestamp))){_context3.next=4;break}return _context3.abrupt("return",cachedLocation);case 4:if(!requestLocation){_context3.next=6;break}return _context3.abrupt("return",getGeoLocation().then(function(coords){return setLocation(coords),coords}));case 6:return _context3.abrupt("return",null);case 7:case"end":return _context3.stop()}},_callee3)})),_getLocation.apply(this,arguments)}var SurfacePickUp=(function(){function SurfacePickUp2(el,options){_classCallCheck(this,SurfacePickUp2),this.el=el,this.options=_objectSpread2({root_url:window.Theme&&window.Theme.routes&&window.Theme.routes.root_url||""},options),this.options.root_url=removeTrailingSlash(this.options.root_url),this.callbacks=[],this.onBtnPress=null,this.latestVariantId=null}return _createClass(SurfacePickUp2,[{key:"load",value:function(variantId){var _this=this;return variantId?(this.latestVariantId=variantId,this.el.classList.add(loadingClass),this._getData(variantId).then(function(data){return _this._injectData(data)})):(this.el.innerHTML="",Promise.resolve(!0))}},{key:"onModalRequest",value:function(callback){this.callbacks.indexOf(callback)>=0||this.callbacks.push(callback)}},{key:"offModalRequest",value:function(callback){this.callbacks.splice(this.callbacks.indexOf(callback))}},{key:"unload",value:function(){this.callbacks=[],this.el.innerHTML=""}},{key:"_getData",value:function(variantId){var _this2=this;return new Promise(function(resolve){var xhr=new XMLHttpRequest,requestUrl="".concat(_this2.options.root_url,"/variants/").concat(variantId,"/?section_id=surface-pick-up");xhr.open("GET",requestUrl,!0),xhr.onload=function(){var el=xhr.response,embed=el.querySelector('[data-html="surface-pick-up-embed"]'),itemsContainer=el.querySelector('[data-html="surface-pick-up-items"]'),items=itemsContainer.content.querySelectorAll("[data-surface-pick-up-item]");resolve({embed,itemsContainer,items,variantId})},xhr.onerror=function(){resolve({embed:{innerHTML:""},itemsContainer:{innerHTML:""},items:[],variantId})},xhr.responseType="document",xhr.send()})}},{key:"_injectData",value:function(_ref2){var _this3=this,embed=_ref2.embed,itemsContainer=_ref2.itemsContainer,items=_ref2.items,variantId=_ref2.variantId;if(variantId!==this.latestVariantId||items.length===0){this.el.innerHTML="",this.el.classList.remove(loadingClass);return}this.el.innerHTML=embed.innerHTML,this.el.classList.remove(loadingClass);var calculatedDistances=!1,calculateDistances=function(){return calculatedDistances?Promise.resolve():getLocation(!0).then(function(coords){items.forEach(function(item){var distanceEl=item.querySelector("[data-distance]"),distanceUnitEl=item.querySelector("[data-distance-unit]"),unitSystem=distanceUnitEl.dataset.distanceUnit,itemLatitude=parseFloat(distanceEl.dataset.latitude),itemLongitude=parseFloat(distanceEl.dataset.longitude);if(coords&&isFinite(itemLatitude)&&isFinite(itemLongitude)){var distance=calculateDistance(coords.latitude,coords.longitude,itemLatitude,itemLongitude,unitSystem);distanceEl.innerHTML=distance.toFixed(1)}else distanceEl.remove(),distanceUnitEl.remove()})}).catch(function(e){console.log(e),items.forEach(function(item){var distanceEl=item.querySelector("[data-distance]"),distanceUnitEl=item.querySelector("[data-distance-unit]");distanceEl.remove(),distanceUnitEl.remove()})}).finally(function(){calculatedDistances=!0})};this.el.querySelector("[data-surface-pick-up-embed-modal-btn]").addEventListener("click",function(){calculateDistances().then(function(){return _this3.callbacks.forEach(function(callback){return callback(itemsContainer.innerHTML)})})})}}]),SurfacePickUp2})();const index_es=SurfacePickUp;function index_es_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function index_es_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function index_es_createClass(Constructor,protoProps,staticProps){return protoProps&&index_es_defineProperties(Constructor.prototype,protoProps),staticProps&&index_es_defineProperties(Constructor,staticProps),Constructor}function index_es_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function index_es_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);
1enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function index_es_objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};i%2?index_es_ownKeys(Object(source),!0).forEach(function(key){index_es_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):index_es_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}var priceUITemplate=document.getElementById("price-ui").content,priceTemplate=document.getElementById("price-ui__price").content,priceRangeTemplate=document.getElementById("price-ui__price-range").content,unitPriceTemplate=document.getElementById("price-ui__unit-pricing").content;function createPriceRangeFragment(priceMin,priceMax,formatter){var priceRangeFragment=priceRangeTemplate.cloneNode(!0);return priceRangeFragment.querySelector("[data-price-min] [data-price]").innerHTML=formatter(priceMin),priceRangeFragment.querySelector("[data-price-max] [data-price]").innerHTML=formatter(priceMax),priceRangeFragment}function createPriceFragment(price,formatter){var priceFragment=priceTemplate.cloneNode(!0);return priceFragment.querySelector("[data-price]").innerHTML=formatter(price),priceFragment}function createUnitPricing(variant,formatter){var unitPriceContainer=unitPriceTemplate.cloneNode(!0),unitQuantityEl=unitPriceContainer.querySelector("[data-unit-quantity]"),unitPriceEl=unitPriceContainer.querySelector("[data-unit-price] [data-price]"),unitMeasurementEl=unitPriceContainer.querySelector("[data-unit-measurement]");return unitQuantityEl.innerHTML="".concat(variant.unit_price_measurement.quantity_value).concat(variant.unit_price_measurement.quantity_unit),unitPriceEl.innerHTML=formatter(variant.unit_price),variant.unit_price_measurement.reference_value===1?unitMeasurementEl.innerHTML=variant.unit_price_measurement.reference_unit:unitMeasurementEl.innerHTML="".concat(variant.unit_price_measurement.reference_value).concat(variant.unit_price_measurement.reference_unit),unitPriceContainer}var PriceUI=(function(){function PriceUI2(el){index_es_classCallCheck(this,PriceUI2),this._el=el}return index_es_createClass(PriceUI2,[{key:"load",value:function(product,options){var _variant$formatter$ha=index_es_objectSpread2({variant:!1,formatter:function(price){return price},handler:function(priceUIFragment2){return priceUIFragment2}},options),variant=_variant$formatter$ha.variant,formatter=_variant$formatter$ha.formatter,handler=_variant$formatter$ha.handler;this._el.classList.add("price-ui--loading");var priceUIFragment=handler(variant?this._loadVariant(variant,formatter):this._loadProduct(product,formatter),product,options);this._el.innerHTML="",this._el.appendChild(priceUIFragment),this._el.classList.remove("price-ui--loading")}},{key:"_loadVariant",value:function(variant,formatter){var priceUIFragment=priceUITemplate.cloneNode(!0),compareAtPriceEl=priceUIFragment.querySelector("[data-compare-at-price]"),priceEl=priceUIFragment.querySelector("[data-price]"),unitPricingEl=priceUIFragment.querySelector("[data-unit-pricing]"),isOnSale=variant.compare_at_price&&variant.compare_at_price!==variant.price;if(isOnSale){priceEl.classList.add("price--sale");var _priceFragment=createPriceFragment(variant.compare_at_price,formatter);compareAtPriceEl.appendChild(_priceFragment)}var priceFragment=createPriceFragment(variant.price,formatter);if(priceEl.appendChild(priceFragment),"unit_price"in variant){var unitPricingFragment=createUnitPricing(variant,formatter);unitPricingEl.appendChild(unitPricingFragment)}return priceUIFragment}},{key:"_loadProduct",value:function(product,formatter){var priceMin=null,priceMax=null,compareAtPriceMin=null,compareAtPriceMax=null,priceVaries=!1,compareAtPriceVaries=!1,isOnSale=!1;
1product.variants.forEach(function(variant){var tmpCompareAtPrice=variant.compare_at_price?variant.compare_at_price:variant.price;(priceMin===null||variant.price<priceMin)&&(priceMin=variant.price),(priceMax===null||variant.price>priceMax)&&(priceMax=variant.price),(compareAtPriceMin===null||tmpCompareAtPrice<compareAtPriceMin)&&(compareAtPriceMin=tmpCompareAtPrice),(compareAtPriceMax===null||tmpCompareAtPrice>compareAtPriceMax)&&(compareAtPriceMax=tmpCompareAtPrice),tmpCompareAtPrice!==variant.price&&(isOnSale=!0)}),priceVaries=priceMin!==priceMax,compareAtPriceVaries=compareAtPriceMin!==compareAtPriceMax;var priceUIFragment=priceUITemplate.cloneNode(!0),compareAtPriceEl=priceUIFragment.querySelector("[data-compare-at-price]"),priceEl=priceUIFragment.querySelector("[data-price]");if(isOnSale)if(priceEl.classList.add("price--sale"),compareAtPriceVaries){var priceRangeFragment=createPriceRangeFragment(compareAtPriceMin,compareAtPriceMax,formatter);compareAtPriceEl.appendChild(priceRangeFragment)}else{var priceFragment=createPriceFragment(compareAtPriceMin,formatter);compareAtPriceEl.appendChild(priceFragment)}if(priceVaries){var _priceRangeFragment=createPriceRangeFragment(priceMin,priceMax,formatter);priceEl.appendChild(_priceRangeFragment)}else{var _priceFragment2=createPriceFragment(priceMin,formatter);priceEl.appendChild(_priceFragment2)}return priceUIFragment}}]),PriceUI2})(),priceUIBadgeTemplate=document.getElementById("price-ui-badge").content,badgePercentSavingsTemplate=document.getElementById("price-ui-badge__percent-savings").content,badgePercentSavingsRangeTemplate=document.getElementById("price-ui-badge__percent-savings-range").content,badgeSavingsTemplate=document.getElementById("price-ui-badge__price-savings").content,badgeSavingsRangeTemplate=document.getElementById("price-ui-badge__price-savings-range").content,badgeOnSaleTemplate=document.getElementById("price-ui-badge__on-sale").content,badgeSoldOutTemplate=document.getElementById("price-ui-badge__sold-out").content,badgeInStockTemplate=document.getElementById("price-ui-badge__in-stock").content;function createBadgeRangeFragment(savings,percent,style,formatter){var badgeRangeFragment=null;switch(style){case"percent":badgeRangeFragment=badgePercentSavingsRangeTemplate.cloneNode(!0),badgeRangeFragment.querySelector("[data-price-percent]").innerHTML=percent;break;case"money":badgeRangeFragment=badgeSavingsRangeTemplate.cloneNode(!0),badgeRangeFragment.querySelector("[data-price]").innerHTML=formatter(savings);break;default:badgeRangeFragment=badgeOnSaleTemplate.cloneNode(!0);break}return badgeRangeFragment}function createBadgeSingleFragment(savings,percent,style,formatter){var badgeSingleFragment=null;switch(style){case"percent":badgeSingleFragment=badgePercentSavingsTemplate.cloneNode(!0),badgeSingleFragment.querySelector("[data-price-percent]").innerHTML=percent;break;case"money":badgeSingleFragment=badgeSavingsTemplate.cloneNode(!0),badgeSingleFragment.querySelector("[data-price]").innerHTML=formatter(savings);break;default:badgeSingleFragment=badgeOnSaleTemplate.cloneNode(!0);break}return badgeSingleFragment}var PriceUIBadge=null;/*! 2 * @pixelunion/shopify-asyncview v2.0.5 3 * (c) 2020 Pixel Union 4*/function dist_index_es_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function dist_index_es_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function dist_index_es_createClass(Constructor,protoProps,staticProps){return protoProps&&dist_index_es_defineProperties(Constructor.prototype,protoProps),staticProps&&dist_index_es_defineProperties(Constructor,staticProps),Constructor}function dist_index_es_defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function dist_index_es_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);
4enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function dist_index_es_objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};i%2?dist_index_es_ownKeys(Object(source),!0).forEach(function(key){dist_index_es_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):dist_index_es_ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _iterableToArrayLimit(arr,i){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(arr)))){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return!=null&&_i.return()}finally{if(_d)throw _e}}return _arr}}function _unsupportedIterableToArray(o,minLen){if(o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var deferred={},AsyncView=(function(){function AsyncView2(){dist_index_es_classCallCheck(this,AsyncView2)}return dist_index_es_createClass(AsyncView2,null,[{key:"load",value:function(url){var query=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},options=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("view"in query))return Promise.reject(new Error("'view' not found in 'query' parameter"));var querylessUrl=url.replace(/\?[^#]+/,""),queryParamsString=new RegExp(/.+\?([^#]+)/).exec(url),queryParams=query;queryParamsString&&queryParamsString.length>=2&&queryParamsString[1].split("&").forEach(function(param){var _param$split=param.split("="),_param$split2=_slicedToArray(_param$split,2),key=_param$split2[0],value=_param$split2[1];queryParams[key]=value});var cachebustingParams=dist_index_es_objectSpread2({},queryParams,{_:new Date().getTime()}),hashUrl=querylessUrl.replace(/([^#]+)(.*)/,function(match,address,hash){return"".concat(address,"?").concat(Object.keys(queryParams).sort().map(function(key){return"".concat(key,"=").concat(encodeURIComponent(queryParams[key]))}).join("&")).concat(hash)}),requestUrl=querylessUrl.replace(/([^#]+)(.*)/,function(match,address,hash){return"".concat(address,"?").concat(Object.keys(cachebustingParams).sort().map(function(key){return"".concat(key,"=").concat(encodeURIComponent(cachebustingParams[key]))}).join("&")).concat(hash)}),promise=new Promise(function(resolve,reject){var data;if(hashUrl in deferred){resolve(deferred[hashUrl]);return}if(deferred[hashUrl]=promise,options.hash&&(data=sessionStorage.getItem(hashUrl),data)){var deserialized=JSON.parse(data);if(options.hash===deserialized.options.hash){delete deferred[hashUrl],resolve(deserialized);return}}var xhr=new XMLHttpRequest;xhr.open("GET",requestUrl,!0),xhr.onload=function(){var el=xhr.response,newOptions={},optionsEl=el.querySelector("[data-options]");optionsEl&&optionsEl.innerHTML&&(newOptions=JSON.parse(el.querySelector("[data-options]").innerHTML));var htmlEls=el.querySelectorAll("[data-html]"),newHtml={};if(htmlEls.length===1&&htmlEls[0].getAttribute("data-html")==="")newHtml=htmlEls[0].innerHTML;else for(var i=0;i<htmlEls.length;i++)newHtml[htmlEls[i].getAttribute("data-html")]=htmlEls[i].innerHTML;var dataEls=el.querySelectorAll("[data-data]"),newData={};if(dataEls.length===1&&dataEls[0].getAttribute("data-data")==="")newData=JSON.parse(dataEls[0].innerHTML);else for(var _i=0;_i<dataEls.length;_i++)newData[dataEls[_i].getAttribute("data-data")]=JSON.parse(dataEls[_i].innerHTML);if(options.hash)try{sessionStorage.setItem(hashUrl,JSON.stringify({options:newOptions,data:newData,html:newHtml}))}catch(error){console.error(error)}delete deferred[hashUrl],resolve({data:newData,html:newHtml})},xhr.onerror=function(){delete deferred[hashUrl],reject()},xhr.responseType="document",xhr.send()});return promise}}]),AsyncView2})();const dist_index_es=AsyncView;class Product{static load(url){return dist_index_es.load(url,{view:"_quickshop"})}constructor($section){this._section=$section[0],this._data=Shopify.theme.getSectionData($section),window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0"}
5,{name:"model-viewer-ui",version:"1.0"}],Shopify.theme.productMedia.setupMedia);const priceUIEl=$section[0].querySelector("[data-price-ui]"),surfacePickUpEl=$section[0].querySelector("[data-surface-pick-up]");this.variantSelection=$section[0].querySelector("[data-variant-selection]"),this.variantSelection&&(this.variantSelection.addEventListener("variant-change",event2=>this._switchVariant(event2.detail.product,event2.detail.variant,event2.detail.state)),surfacePickUpEl&&(this.surfacePickUp=new index_es(surfacePickUpEl),this.surfacePickUp.onModalRequest(contents=>{Promise.all([this.variantSelection.getProduct(),this.variantSelection.getVariant()]).then(([product,variant])=>{const surfacePickUpModal=$section[0].querySelector("[data-surface-pick-up-modal]"),fragment=document.createDocumentFragment(),header=document.createElement("div"),title=document.createElement("span"),subtitle=document.createElement("span");header.classList.add("surface-pick-up__modal-header"),title.classList.add("surface-pick-up__modal-title"),subtitle.classList.add("surface-pick-up__modal-subtitle"),title.innerHTML=product.title,subtitle.innerHTML=variant.title,header.appendChild(title),variant.title!=="Default Title"&&header.appendChild(subtitle),fragment.appendChild(header),surfacePickUpModal.innerHTML=contents,surfacePickUpModal.insertBefore(fragment,surfacePickUpModal.firstChild),$.fancybox.open(surfacePickUpModal,{hash:!1,infobar:!1,toolbar:!1,loop:!0,smallBtn:!0,buttons:[],touch:!1,video:{autoStart:!1},mobile:{preventCaptionOverlap:!1,toolbar:!0},beforeShow:()=>{document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed"},beforeClose:()=>{const scrollY=document.body.style.top;document.body.style.position="",document.body.style.top="",window.scrollTo(0,parseInt(scrollY||0,10)*-1)}})})}))),priceUIEl&&(this.priceUI=new PriceUI(priceUIEl));const $productGallery=$section.find(".product-gallery__main"),$stickyElement=$section.find(".sticky-product-scroll");$productGallery&&(this.enableSlideshow($productGallery),this._data.enable_zoom&&document.addEventListener("lazyloaded",this.enableZoom),this._data.enable_product_lightbox&&this.enableLightbox($productGallery)),$stickyElement&&window.isScreenSizeLarge()&&this._data.template==="image-scroll"&&this.enableStickyScroll($stickyElement,$productGallery),window.location.search==="?contact_posted=true"&&($(".notify_form .contact-form").hide(),$(".notify_form .contact-form").prev(".message").html(Shopify.translation.notify_form_success)),$(".masonry--true").length>0&&Shopify.theme.applyMasonry(".thumbnail"),this.variantSelection&&Promise.all([this.variantSelection.getProduct(),this.variantSelection.getVariant(),this.variantSelection.getState()]).then(([product,variant,state])=>this._switchVariant(product,variant,state))}enableStickyScroll($stickyElement,$productGallery){let announcementHeight=0,headerHeight=0;typeof Shopify.theme.jsAnnouncementBar<"u"&&Shopify.theme.jsAnnouncementBar.enable_sticky&&(announcementHeight=$("#announcement-bar").outerHeight()),Shopify.theme_settings.header_layout!=="vertical"&&Shopify.theme.jsHeader.enable_sticky&&(headerHeight=$("#header").outerHeight()),$productGallery.data("media-count")>1&&$stickyElement.stick_in_parent({offset_top:announcementHeight+headerHeight+20})}enableLightbox($productGallery){$productGallery.find(".product-gallery__link").fancybox({beforeClose:instance=>{const $instanceGallery=instance.$trigger.first().parents(".product-gallery__main");$instanceGallery.hide(),setTimeout(()=>$instanceGallery.fadeIn(100),500)},afterClose:()=>{setTimeout(()=>{$productGallery.find(".is-selected a").focus()},500)}})}enableZoom(){const $image=$(event.target),zoomSrc=$image.data("zoom-src");zoomSrc&&$image.wrap('<span class="zoom-container"></span>').css("display","block").parent().zoom({url:zoomSrc,touch:!1,magnify:1})}disableSlideshow($section,selector){let $slider;$section?$slider=$section.find(".flickity-enabled"):$slider=$(selector),$slider.flickity("destroy")}enableSlideshow(selector,settings){const $productGallery=selector,$thumbnailProductGallery=$productGallery.closest(".product-gallery").find(".product-gallery__thumbnails"),$slides=$productGallery.find(".product-gallery__image"),$thumbnails=$thumbnailProductGallery.find(".product-gallery__thumbnail");function autoplayVideo(videoID,$slide){$.each(window.videoPlayers,(_,player)=>{player.id===videoID&&(player.play(),player.on("exitfullscreen",()=>$slide.closest(".product-gallery").find(".product-gallery__thumbnails").focus()))})}function autoplayYoutubeVideo(iframeID,$slide){$.each(window.videoPlayers,(_,player)=>{player.playing&&player.pause(),player.media.id===iframeID&&(player.play(),player.on("exitfullscreen",()=>$slide.closest(".product-gallery").find(".product-gallery__thumbnails").focus()))})}function checkForVideos(){$slides.each((index,slide)=>{const $slide=$(slide),mediaType=$slide.data("media-type")||$slide.find("[data-media-type]").data("media-type");let videoID=$slide.find("video").data("plyr-video-id");const iframeID=$slide.find("iframe").attr("id");
5$slide.hasClass("is-selected")&&(mediaType==="video"?(videoID=$slide.find("video").data("plyr-video-id"),videoID&&autoplayVideo(videoID,$slide)):mediaType==="external_video"&&iframeID&&autoplayYoutubeVideo(iframeID,$slide))})}$productGallery.find(".gallery-cell:not(.product-gallery__image)").addClass("product-gallery__image"),$thumbnailProductGallery.find(".gallery-cell:not(.product-gallery__thumbnail)").addClass("product-gallery__thumbnail");const{thumbnails_enabled:thumbnailsEnabled,enable_thumbnail_slider:thumbnailsSliderEnabled,thumbnail_position:thumbnailsPosition,gallery_arrows:arrowsEnabled,slideshow_speed:slideshowSpeed,slideshow_transition:slideshowTransition}=settings||this._data;$productGallery.on("ready.flickity",()=>{$slides.each((index,slide)=>{const mediaType=$(slide).data("media-type")||$(slide).find("[data-media-type]").data("media-type");let videoID;const videoLooping=$("[data-video-loop]").data("video-loop"),{videoPlayers}=window;switch(mediaType){case"external_video":if(videoID=$(slide).find("[data-plyr-video-id]").data("plyr-video-id"),videoPlayers)for(let i=0;i<videoPlayers.length;i++)(videoPlayers[i].id===videoID||videoPlayers[i].media.id===videoID)&&(videoPlayers[i].loop=videoLooping,$(slide).hasClass("is-selected")||(videoPlayers[i].keyboard={focused:!1,global:!1}));break;case"video":if(videoID=$(slide).find("[data-plyr-video-id]").data("plyr-video-id"),videoPlayers)for(let i=0;i<videoPlayers.length;i++)(videoPlayers[i].id===videoID||videoPlayers[i].media.id===videoID)&&(videoPlayers[i].loop=videoLooping,$(slide).hasClass("is-selected")||(videoPlayers[i].keyboard={focused:!0,global:!1}));break;case"model":$(slide).hasClass("is-selected")&&mediaType==="model"&&window.isScreenSizeLarge()&&($(slide).on("mouseenter",()=>$productGallery.flickity("unbindDrag")),$(slide).on("mouseleave",()=>$productGallery.flickity("bindDrag")));break;default:break}$(slide).keypress(event2=>{event2.which===13&&($(slide).find("model-viewer, .product-gallery__link, .plyr").focus(),(mediaType==="video"||mediaType==="external_video")&&checkForVideos())})})}),$productGallery.flickity({wrapAround:!0,adaptiveHeight:!0,dragThreshold:10,imagesLoaded:!0,pageDots:!1,prevNextButtons:$productGallery.data("media-count")>1||$slides.length>1,autoPlay:slideshowSpeed*1e3,fade:slideshowTransition==="fade",watchCSS:this._data.template==="image-scroll"&&!$productGallery.hasClass("js-gallery-modal"),arrowShape:window.arrowShape}),$productGallery.on("change.flickity",()=>{$slides.each((index,slide)=>{const mediaType=$(slide).data("media-type")||$(slide).find("[data-media-type]").data("media-type");if($(slide).hasClass("is-selected"))mediaType==="model"?(window.isScreenSizeLarge()&&($(slide).on("mouseenter",()=>$productGallery.flickity("unbindDrag")),$(slide).on("mouseleave",()=>$productGallery.flickity("bindDrag"))),$(slide).find("model-viewer").on("shopify_model_viewer_ui_toggle_play",()=>$productGallery.flickity("unbindDrag")),$(slide).find("model-viewer").on("shopify_model_viewer_ui_toggle_pause",()=>$productGallery.flickity("bindDrag"))):$productGallery.flickity("bindDrag");else switch(mediaType){case"external_video":$.each(window.videoPlayers,(_,player)=>player.pause());break;case"video":$.each(window.videoPlayers,(_,player)=>player.pause());break;case"model":$.each(Shopify.theme.productMedia.models,(_,model)=>model.pause());break;default:break}}),Shopify.theme.productMedia.showModelIcon($productGallery)});const $sliderArrows=$productGallery.find(".flickity-prev-next-button");($sliderArrows||$thumbnails)&&window.isScreenSizeLarge()?($sliderArrows.on("click",()=>($productGallery.on("settle.flickity",()=>{const $selectedSlide=$productGallery.find(".product-gallery__image.is-selected"),mediaType=$selectedSlide.data("media-type")||$selectedSlide.find("[data-media-type]").data("media-type"),pId=$productGallery.data("product-id");if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(Shopify.theme.productMedia.models,(index,model)=>{$(model.container).closest(".product-gallery__image").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,(index,model)=>{$(model.container).parents(".product-gallery__image").hasClass("is-selected")&&model.play()})}$productGallery.off("settle.flickity")}),!1)),$thumbnails.on("click",event2=>{const index=$(event2.currentTarget).index();return $productGallery.flickity("select",index),$productGallery.on("settle.flickity",()=>{const $selectedSlide=$productGallery.find(".product-gallery__image.is-selected"),mediaType=$selectedSlide.data("media-type")||$selectedSlide.find("[data-media-type]").data("media-type"),pId=$productGallery.data("product-id");
5if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(Shopify.theme.productMedia.models,(_,model)=>{$(model.container).closest(".product-gallery__image").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,(_,model)=>{$(model.container).parents(".product-gallery__image").hasClass("is-selected")&&model.play()})}$productGallery.off("settle.flickity")}),!1}),$thumbnails.keypress(event2=>{const index=$(event2.currentTarget).index();if(event2.which===13){$productGallery.flickity("select",index);const $selectedSlide=$productGallery.find(".product-gallery__image.is-selected"),pId=$productGallery.data("product-id");$productGallery.on("settle.flickity",()=>{$selectedSlide.find("model-viewer, .plyr, a").focus(),$selectedSlide.find("[data-youtube-video]").attr("tabindex","0"),$productGallery.off("settle.flickity")});const mediaType=$selectedSlide.data("media-type");if((mediaType==="video"||mediaType==="external_video")&&checkForVideos(),mediaType==="model"){const sortedModels=[];$.each(Shopify.theme.productMedia.models,(_,model)=>{$(model.container).closest(".product-gallery__image").data("product-id")===pId&&sortedModels.push(model)}),$.each(sortedModels,(_,model)=>{$(model.container).parents(".product-gallery__image").hasClass("is-selected")&&model.play()})}}})):thumbnailsEnabled&&$thumbnailProductGallery.find(".product-gallery__thumbnail").on("click",event2=>{const index=$(event2.currentTarget).index();$productGallery.flickity("selectCell",index)}),$productGallery.on("settle.flickity",()=>$productGallery.flickity("resize")),$(window).on("load",()=>$productGallery.flickity("resize"));let resizeTimer;if($(window).on("resize",()=>{clearTimeout(resizeTimer),resizeTimer=setTimeout(()=>$productGallery.flickity("resize"),250)}),thumbnailsEnabled===!0&&thumbnailsSliderEnabled===!0&&$slides.length>1)if(window.isScreenSizeLarge())if(thumbnailsPosition==="right-thumbnails"||thumbnailsPosition==="left-thumbnails"){$thumbnailProductGallery.addClass("vertical-slider-enabled");const navCellHeight=$thumbnails.height(),navHeight=$thumbnailProductGallery.height();$(window).on("load",()=>{const $productGalleryHeight=$productGallery.height();$thumbnailProductGallery.css("max-height",$productGalleryHeight)}),$(window).on("resize",()=>{$productGallery.flickity("resize");const $productGalleryHeight=$productGallery.height();$thumbnailProductGallery.css("max-height",$productGalleryHeight)}),$productGallery.on("change.flickity",()=>{$productGallery.flickity("resize");const $productGalleryHeight=$productGallery.height();$thumbnailProductGallery.css("max-height",$productGalleryHeight)}),$productGallery.on("select.flickity",()=>{const flkty=$productGallery.data("flickity");if(flkty){$thumbnailProductGallery.find(".is-nav-selected").removeClass("is-nav-selected");const scrollY=$thumbnails.eq(flkty.selectedIndex).addClass("is-nav-selected").position().top+$thumbnailProductGallery.scrollTop()-(navHeight+navCellHeight)/2;$thumbnailProductGallery.animate({scrollTop:scrollY})}})}else $thumbnailProductGallery.flickity({cellAlign:"center",contain:!0,groupCells:"80%",imagesLoaded:!0,pageDots:!1,prevNextButtons:$thumbnails.length>5?arrowsEnabled:!1,asNavFor:this._data.template==="image-scroll"&&window.isScreenSizeLarge()?"":$productGallery[0],arrowShape:window.arrowShape}),$thumbnailProductGallery.on("settle.flickity",()=>$thumbnailProductGallery.flickity("resize")),$(window).on("load",()=>$thumbnailProductGallery.flickity("resize"));else $thumbnailProductGallery.flickity({cellAlign:"center",contain:!0,groupCells:"80%",imagesLoaded:!0,pageDots:!1,prevNextButtons:$thumbnails.length>5,asNavFor:this._data.template==="image-scroll"&&window.isScreenSizeLarge()?"":$productGallery[0],arrowShape:window.arrowShape})}findSelectedVariantImage(){function getIndex($selector,variantID){const imageID=$selector.parents(".product_form").find(`select option[value=${variantID}]`).attr("data-image-id");if(!imageID)return!1;const index=$(`[data-image-id=${imageID}]`).data("index");return this._data.template==="image-scroll"?(this.scrollSelectedImage(index),!0):!1}$("[data-variant-selector]").on("selectedVariantChanged",event2=>{const $currentTarget=$(event2.currentTarget);$currentTarget.attr("disabled")||getIndex($currentTarget,$currentTarget.val())})}scrollSelectedImage(variant){let headerHeight=0,announceHeight=0;Shopify.theme.jsHeader.enable_sticky===!0&&Shopify.theme_settings.header_layout!=="vertical"&&(headerHeight=Shopify.theme.jsHeader.getHeaderHeight()),typeof Shopify.theme.jsAnnouncementBar<"u"&&Shopify.theme.jsAnnouncementBar.enable_sticky===!0&&Shopify.theme_settings.header_layout!=="vertical"&&(announceHeight=Shopify.theme.jsAnnouncementBar.getAnnouncementHeight());const totalHeight=headerHeight+announceHeight;Shopify.theme.scrollToTop($(`[data-index="${variant}"]`),totalHeight)}unload($section){$(".selector-wrapper select",$section).unwrap(),this.disableSlideshow($section),$("[data-variant-selector]").off(),document.removeEventListener("lazyloaded",this.enableZoom)}_switchVariant(product,variant,state){if(window.selectCallback(this._section.querySelector(`.product-${product.id}`),product,variant,state),this.priceUI){const formatter=price=>price===0?Shopify.translation.free_price_text:Shopify.formatMoney(price,$("body").data("money-format"));this.priceUI.load(product,{variant,formatter,handler:(priceUIFragment,p,{variant:v})=>
5{if(state==="unavailable")return document.createDocumentFragment();if(v&&v.available){const shopPayInstallmentsTemplate=this._section.querySelector("[data-shop-pay-installments-template] shopify-payment-terms");let shopPayInstallEl=null;if(shopPayInstallmentsTemplate&&(shopPayInstallEl=shopPayInstallmentsTemplate.cloneNode(!0),shopPayInstallEl.setAttribute("variant-id",variant.id)),this._data.display_savings&&v.compare_at_price>v.price){const span=document.createElement("span");span.classList.add("sale","savings"),span.innerHTML=`${Shopify.translation.product_savings} ${parseInt((v.compare_at_price-v.price)*100/v.compare_at_price,10)}% (<span class="money">${formatter(v.compare_at_price-v.price)}</span>)`,priceUIFragment.appendChild(span)}shopPayInstallEl&&priceUIFragment.appendChild(shopPayInstallEl)}if(Shopify.theme.currencyConverter){const moneyEls=priceUIFragment.querySelectorAll(".money");for(let i=0;i<moneyEls.length;i++)Shopify.theme.currencyConverter.update(moneyEls[i])}return priceUIFragment}})}this.surfacePickUp&&this.surfacePickUp.load(variant?variant.id:null)}}Shopify.theme.jsProductClass=Product,Shopify.theme.jsProduct={init($section){return new Product($section)},relatedProducts(){$(".block__recommended-products .js-related-products-slider .products-slider").each((_,slider)=>{const $relatedSlider=$(slider),slideData={products_per_slide:$relatedSlider.data("products-per-slide"),products_available:$relatedSlider.data("products-available"),products_limit:$relatedSlider.data("products-limit"),initialIndex:0,cellAlign:"left",wrapAround:!0};slideData.products_available>slideData.products_per_slide&&slideData.products_limit>slideData.products_per_slide?slideData.wrapAround=!0:slideData.wrapAround=!1,slideData.products_available<slideData.products_per_slide||slideData.products_limit<slideData.products_per_slide?($relatedSlider.addClass("container is-justify-center"),$relatedSlider.find(".gallery-cell").addClass("column")):($relatedSli
5der.flickity({lazyLoad:2,freeScroll:!0,imagesLoaded:!0,draggable:!0,cellAlign:"center",wrapAround:slideData.wrapAround,pageDots:!1,contain:!0,prevNextButtons:slideData.products_limit>slideData.products_per_slide,initialIndex:slideData.initialIndex,arrowShape:window.arrowShape}),$relatedSlider.on("settle.flickity",()=>$relatedSlider.flickity("resize")),$(window).on("load",()=>$relatedSlider.flickity("resize")))})}}})(); 6//# sourceMappingURL=/cdn/shop/t/27/assets/z__jsProduct.js.map?v=101722057845314277881641995765
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.