(()=>{var vt=Object.create;var me=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var kt=Object.getOwnPropertyNames;var Et=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty;var Ct=(t,e)=>()=>(t&&(e=t(t=0)),e);var he=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Dt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kt(e))!Tt.call(t,o)&&o!==r&&me(t,o,{get:()=>e[o],enumerable:!(n=wt(e,o))||n.enumerable});return t};var Pt=(t,e,r)=>(r=t!=null?vt(Et(t)):{},Dt(e||!t||!t.__esModule?me(r,"default",{value:t,enumerable:!0}):r,t));var c,s=Ct(()=>{c={eu1:"1.4.246","eu1-b":"1.4.231",us1:"1.4.246"}});var lt=he((es,ut)=>{s();var Ir=[{name:"Chrome",flags:["isChrome"],regex:/(?:Chrome|CriOS)\/([0-9]+)\./i},{name:"Firefox",flags:["isFirefox"],regex:/Firefox\/([0-9]+)\./i},{name:"IE",flags:["isIE"],regex:/(?:MSIE|Trident.*rv)[: ]([0-9]+)\./i},{name:"Opera",flags:["isOpera"],regex:/Opera\/.*Version\/([0-9]+)/i},{name:"Safari",flags:["isSafari"],regex:/AppleWebKit\/.*Version\/([0-9]+)/i},{name:"Unknown",flags:["isUnknown"],regex:null}],$r=[{name:"Motorola Razr",flags:["isTablet"],platform:"Tablet",regex:/ Android .*? Droid Razr/i},{name:"Motorola Xoom",flags:["isTablet"],platform:"Tablet",regex:/ Android .*? Xoom/i},{name:"Samsung Tablet",flags:["isTablet"],platform:"Tablet",regex:/ Android .*? (SCH-I|GT-P)/i},{name:"Android Phone",flags:["isPhone"],platform:"Phone",regex:/ Android .*? (Chrome|Version)\/[.0-9]* Mobile/i},{name:"Android Tablet",flags:["isTablet"],platform:"Tablet",regex:/ Android .*? (Chrome|Version)\/[.0-9]* (?!Mobile)/i},{name:"Firefox OS",flags:["isPhone"],platform:"Phone",regex:/Mozilla.*?Mobile.*?Gecko.*?Firefox/i},{name:"iPad",flags:["isTablet"],platform:"Tablet",regex:/iPad/i},{name:"iPhone",flags:["isPhone"],platform:"Phone",regex:/iPhone|iPod/i},{name:"BlackBerry Phone",flags:["isPhone"],platform:"Phone",regex:/BlackBerry|BB10/i},{name:"BlackBerry Playbook",flags:["isTablet"],platform:"Tablet",regex:/Playbook/i},{name:"Motorola Droid",flags:["isPhone"],platform:"Phone",regex:/(Droid|SHOLS_U2|XT[0-9]{4})/i},{name:"HTC",flags:["isPhone"],platform:"Phone",regex:/HTC One|HTC Sensation|Sprint APA9292KT/i},{name:"Kindle",flags:["isTablet"],platform:"Tablet",regex:/Silk|Kindle/i},{name:"LG",flags:["isPhone"],platform:"Phone",regex:/LG-M|LG-E|LG-P/i},{name:"Nexus Phone",flags:["isPhone"],platform:"Phone",regex:/Nexus 4|Nexus 5|Nexus S/i},{name:"Nexus Tablet",flags:["isTablet"],platform:"Tablet",regex:/Nexus 7|Nexus 10/i},{name:"Nokia",flags:["isPhone"],platform:"Phone",regex:/Nokia|Windows Phone/i},{name:"Samsung Phone",flags:["isPhone"],platform:"Phone",regex:/SM-N900|GT-I|GT-N|SAMSUNG-SGH|SAMSUNG SCH/i},{name:"Sony",flags:["isPhone"],platform:"Phone",regex:/LT28|SonyEricsson|Sony/i},{name:"PC",flags:["isDesktop"],platform:"Desktop",regex:null}];function Rr(t,e){Ir.some(function(r){var n=null;if(!r.regex||(n=r.regex.exec(e)))return t.browser=r.name,r.flags.forEach(function(o){t[o]=!0}),t.version=n&&n.length>0?Number(n[1]):0,e.indexOf("Trident/4")!==-1&&t.version<8&&(t.version=8),e.indexOf("Trident/5")!==-1&&t.version<9&&(t.version=9),e.indexOf("Trident/6")!==-1&&t.version<10&&(t.version=10),e.indexOf("Trident/7")!==-1&&t.version<11&&(t.version=11),!0})}function Or(t,e){$r.some(function(r){if(!r.regex||r.regex.test(e))return t.device=r.name,r.flags.forEach(function(n){t[n]=!0}),t.platform=r.platform,!0})}ut.exports=function(t){var e={browser:"IE",device:"PC",isChrome:!1,isDesktop:!1,isFirefox:!1,isIE:!1,isOpera:!1,isPhone:!1,isSafari:!1,isTablet:!1,isUnknown:!1,platform:"Desktop",version:0};return Rr(e,t),Or(e,t),e}});var ft=he((rs,dt)=>{s();dt.exports=lt()});s();s();function pe(){try{decodeURIComponent(location.href)}catch{throw new Error("invalid UTF-8 on url-encoded query params")}}s();s();s();s();var N,It=new Uint8Array(16);function K(){if(!N&&(N=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!N))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(It)}s();var p=[];for(let t=0;t<256;++t)p.push((t+256).toString(16).slice(1));function ge(t,e=0){return p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]}s();s();var $t=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),G={randomUUID:$t};function Rt(t,e,r){if(G.randomUUID&&!e&&!t)return G.randomUUID();t=t||{};let n=t.random||(t.rng||K)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return ge(n)}var P=Rt;s();var Q="__DF_DEBUG_MODE__",_e="true",A=window.sessionStorage;function ye(){A.setItem(Q,_e)}function xe(){A.removeItem(Q)}function Ot(){return A.getItem(Q)===_e}function M(t){return A.getItem(t)||window[t]}function j(t,e){A.setItem(t,e)}function d(...t){Ot()&&console.log("[doofinder]",...t)}s();s();var be={canPushState(){return typeof history.pushState<"u"},dropLocal(t,e,r){return t.removeItem(this.localKey(e,r))},updateLocal(t,e,r,n,o){let i=this.getLocal(t,e,r),a=this.localKey(e,r),u=i===null?n:o(i);return t.setItem(a,JSON.stringify(u)),u},getLocal(t,e,r){return JSON.parse(t.getItem(this.localKey(e,r)))},updateCurrentState(t){this.canPushState()&&history.replaceState(t(history.state||{}),"",window.location.href)},pushState(t,e,r){if(this.canPushState()){if(r!==window.location.href){if(e.type=="redirect"&&e.scroll){let o=history.state||{};o.scroll=e.scroll,history.replaceState(o,"",window.location.href)}delete e.scroll,history[t+"State"](e,"",r||null);let n=this.getHashTargetEl(window.location.hash);n?n.scrollIntoView():e.type==="redirect"&&window.scroll(0,0)}}else this.redirect(r)},setCookie(t,e){document.cookie=`${t}=${e}`},getCookie(t){return document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${t}s*=s*([^;]*).*$)|^.*$`),"$1")},redirect(t,e){e&&be.setCookie("__phoenix_flash__",e+"; max-age=60000; path=/"),window.location=t},localKey(t,e){return`${t}-${e}`},getHashTargetEl(t){let e=t.toString().substring(1);if(e!=="")return document.getElementById(e)||document.querySelector(`a[name="${e}"]`)}},Y=be;s();var J="df-cookies-allowed",X=window.localStorage;function Z(){X.setItem(J,"true")}function Se(){X.removeItem(J)}function ve(){return JSON.parse(X.getItem(J)||"false")}var we="df",ke=window.localStorage;function I(t,e=ke){return Y.getLocal(e,we,t)}function _(t,e,r=ke){return ve()?Y.updateLocal(r,we,t,e,()=>e):null}var De=12*60*60*1e3,Ee="random-userid",q="session",Te="apps",Ce="tab-id";function Pe(){return{id:P().replaceAll("-",""),expiry:new Date().getTime()+De,live:[]}}function W(){let t=I(q);return(!t||Lt(t))&&(t=Pe()),_(q,t)}function Lt({expiry:t}){return te.live.includes(n))}};s();function Ut(){return{"content-type":"application/json"}}async function z(t,e={}){return(await fetch(t,{method:"GET",cache:"no-cache",mode:"cors",headers:Ut(),...e})).json()}var V=class{constructor(e){this.zone=e}async add(e,r,{id:n,title:o,price:i},a=1){let u=`${this.url(e)}/cart/${m.getSessionId()||""}`,f=JSON.stringify({amount:a,id:n,title:o,price:i,index:r});return z(u,{method:"PUT",body:f})}async remove(e,r,n,o=1){let i=`${this.url(e)}/cart/${m.getSessionId()||""}`,a=JSON.stringify({amount:o,id:n,index:r});return z(i,{method:"PATCH",body:a})}async clear(e){let r=`${this.url(e)}/cart/${m.getSessionId()||""}`;return z(r,{method:"DELETE"})}async checkout(e){let r=JSON.stringify({session_id:m.getSessionId(),user_id:m.getUserId(),sources:m.getLastUsedApps().split(",")});return z(`${this.url(e)}/checkout`,{method:"PUT",body:r})}url(e){return`https://${this.zone}-search.doofinder.com/6/${e}/stats`}};s();function Ie(t){return j("__DF_CDN_PREFIX__",t)}s();function $e(t){return j("__DF_LAYER_SERVER__",t)}s();s();async function ee(t,e){if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,r.async=1,e&&(r.onerror=()=>ee(e)),document.head.appendChild(r)}}async function te(t,e){if(!document.querySelector(`link[rel="stylesheet"][href="${t}"]`)){let r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",t),e&&(r.onerror=()=>te(e)),document.head.appendChild(r)}}async function v(t){let e=document.createElement("style");e.appendChild(document.createTextNode((t||"").trim())),document.head.appendChild(e)}s();s();var E=class{constructor(e={}){e=Object.assign({resolveTimeout:null,resolveValue:!0,rejectTimeout:null,rejectValue:!1},e),this._promise=new Promise((a,u)=>{this.resolve=a,this.reject=u}),this.then=this._promise.then.bind(this._promise),this.catch=this._promise.catch.bind(this._promise),this.finally=this._promise.finally.bind(this._promise),this[Symbol.toStringTag]="Promise";let{resolveTimeout:r,resolveValue:n,rejectTimeout:o,rejectValue:i}=e;r&&setTimeout(()=>this.resolve(n),r),o&&setTimeout(()=>this.reject(i),o)}get promise(){return this._promise}};s();s();var y=new Promise((t,e)=>{document.readyState!="loading"?t():document.addEventListener("DOMContentLoaded",()=>{t()})});var $="recommendations",re="";function Nt(t){return[$,{}]}function Mt(t,e,r){let n=r.find(a=>a.name==$);if(!n)return console.error(`Doofinder app '${$}' not enabled`),null;let o=Ht(t,e,n),i=zt(o);return{...o,custom_css:n.overrides.custom_css,custom_template:n.overrides.custom_template,matchingPageTypes:i,widgets:[...Vt(i,o)]}}function jt(t,e,r){if(!qt(t))return re=window.location.href,null;let n=e[$];return{assets:n[t.device],cdn_prefix:n.cdn_prefix,vsn:n.vsn,appConfig:t,onRegister:function(o){y.then(()=>{window.location.href===re||document.querySelector("df-recommendations-v2")||(o.deleteTags(t),o.create(t),re=window.location.href)})}}}var ne={appName:$,backendAppToScriptApp:Nt,buildConfig:Mt,buildSettingsConfig:jt};function qt({matchingPageTypes:t,overridePageTypeCheck:e,widgets:r}){if(r.length===0)return!1;if(e)return!0;if(t.length===0)return!1;let n=t.map(o=>o.id);return r.some(o=>n.includes(o.page_type_id))}function zt({pageTypeMappings:t}){let e=window.location.href;return t.reduce((r,n)=>{let{match_conditions:o}=n;return o.length===0?r:o.some(i=>Bt(e,i))?[n,...r]:r},[])}function Vt(t,{widgets:e,overridePageTypeCheck:r}){if(r)return e;let n=t.map(o=>o.id);return e.filter(o=>n.includes(o.page_type_id))}function Ht(t,e,r){let n=Ft(e);if(n.length>0){let i=n.map(a=>{let u=r.widgets.find(f=>f.widget_id===a.widget_id);if(u)return{...a,widget_id:a.widget_id,page_type_id:u.page_type_id,insertion_point:a.insertion_point||u.options.insertion_point,insertion_method:a.insertion_method||u.options.insertion_method,hooks:a.hooks,hashids:u.overrides.hashids};console.error(`Custom recommendations widget '${a.widget_id}' does not exist`)}).filter(a=>!!a);return{...t,widgets:[...i],overridePageTypeCheck:!0}}let o=r.widgets.map(i=>({widget_id:i.widget_id,page_type_id:i.page_type_id,insertion_point:i.options.insertion_point,insertion_method:i.options.insertion_method,hooks:i.options.hooks,hashids:i.overrides.hashids}));return{...t,widgets:o,overridePageTypeCheck:!1}}function Bt(t,{match_type:e,value:r}){switch(e){case"equals":return Re(t)==Re(r);case"contains":return t.includes(r);case"starts_with":return t.startsWith(r);case"regex":try{return new RegExp(r,"i").test(t)}catch{return!1}default:return!1}}function Re(t){let e=new URL(t);return e.origin+e.pathname}function Ft(t){return t?Array.isArray(t)?[...t]:Object.hasOwn(t,"widget_id")?[{...t}]:[]:[]}async function Oe(t,e){if(!t.includes("recommendations"))return;let n=new MutationObserver(()=>{n.disconnect(),e(),n.observe(document,{childList:!0,subtree:!0})});n.observe(document,{childList:!0,subtree:!0})}s();var T="quiz";function Kt(t){return[T,{quiz_id:t.quiz_id}]}function Gt(t,e,r){let n=r.find(i=>i.name==T&&i.quiz_id==e.quiz_id);if(!n)return console.error(`Doofinder app '${T}' not enabled or wrong quiz_id`),null;let o={quiz_id:e.quiz_id,trigger:e.trigger||n.options.trigger,hashid:n.overrides.hashid,custom_css:n.overrides.custom_css,hooks:e.hooks,account_code:t.account_code};return{...t,...o}}function Qt(t,e,r){let n=e[T],o=n.vsn?.[t.zone];return{assets:n[t.device],cdn_prefix:e[T].cdn_prefix,cdn_fallback:n.cdn_fallback,vsn:o,appConfig:t,onRegister:function(i){y.then(()=>{let a=i.create(t);typeof r=="function"&&r(a)})}}}var oe={appName:T,backendAppToScriptApp:Kt,buildConfig:Gt,buildSettingsConfig:Qt};s();s();s();function Le(t,e={}){let r=document.querySelector(t);return r?Promise.resolve(r):new Promise((n,o)=>{let i=0,a=null,u=e.interval||500,f=e.times||10;a=setInterval(function(){i++r.offsetWidth>0&&r.offsetHeight>0)}async updateQuery(e=""){let r=await this.getElement();r instanceof HTMLInputElement&&(r.value=e)}async focus(){let e=await this.getElement();e instanceof HTMLInputElement&&e.focus()}setCaptureLength(e){this._minCaptureLength=e||Ue}async getElement(){if(!(!this._enabled||!this._elementSelector)){if(!this._element)try{this._element=await Le(this._elementSelector)}catch{this._element=void 0}return this._element}}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==!!e){this._enabled=!!e;let r=document[`${this._enabled?"add":"remove"}EventListener`];this._events.forEach(n=>r(...n))}}get captureSubmit(){return this._handleSubmit}set captureSubmit(e){this._handleSubmit=!!e}get redirection(){if(this._redirection)return{...this._redirection}}set redirection(e){this._redirection=e}setEventBus(e){this._eventBus=e}flushMessages(){if(this._eventsQueue=[...new Map(this._eventsQueue).entries()],this._eventsQueue.length>0){let e=this._eventsQueue.shift();for(;e&&e.length===2;)d("trigger:emit",e),this._eventBus?.emit(...e),e=this._eventsQueue.shift()}else document.activeElement===this._element&&this.notify(Ne,this.getPayload())}destroy(){this._events.forEach(e=>window.removeEventListener(...e))}shouldHandle(e){let r=this.getElementFromEvent(e);return r?(this._element=r,!0):!1}getPayload(e){let r={source:this._element,originalEvent:e};if(this._element instanceof HTMLInputElement){let n=this._element.value.trim();(n.length>=this._minCaptureLength||e?.type==="keydown")&&(r.query=n)}return r}getElementFromEvent(e){if(!e.target||e.target===document||e.target===window)return;let r=e.type==="submit"?"querySelector":"closest",n=e.target[r](this._elementSelector);if(n&&!n.closest("[dfd-hook]"))return n}handleClick(e){this.shouldHandle(e)&&(e.preventDefault(),e.stopImmediatePropagation(),this.notify(Ne,this.getPayload(e)))}handleFocus(e){this.shouldHandle(e)&&(e.stopImmediatePropagation(),this.notify(Yt,this.getPayload(e)))}handleInput(e){this.shouldHandle(e)&&this.notify(Jt,this.getPayload(e))}handleSubmit(e){this._handleSubmit&&this.shouldHandle(e)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.notify(Me,this.getPayload(e)))}handleKeypress(e){e.key==="Enter"&&this.shouldHandle(e)&&(this._redirection||this._handleSubmit)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this._redirection?window.location=this._redirection.url:e.type==="keydown"&&this.notify(Me,this.getPayload(e)))}notify(e,r){this._eventBus?this._eventBus.emit(e,r):this._eventsQueue.push([e,r]),d("[trigger]",this._eventBus?"[emit]":"[queue]",e,r)}};var R="layer";function Xt(t){return[R,{}]}function Zt(t,e,r){let n=r.find(a=>a.name==R);if(!n)return console.error(`Doofinder app '${R}' not enabled`),null;let o=n.overrides.autoload,i={trigger:e.trigger||n.options.trigger,url_hash:e.url_hash||e.url_hash===void 0&&n.options.url_hash,hooks:e.hooks,params:e.params,search_query_retention:n.overrides.search_query_retention,sort:e.sort,layout:n.overrides.layout,custom_css:n.overrides.custom_css[t.device],custom_properties:n.overrides.custom_properties[t.device],autoload:o&&o[t.device],type:n.type,exportResultsData:e.exportResultsData,zone:e.zone||n.options.zone||t.zone};return{...t,...i}}function Wt(t,e,r){let n=e[R],o=t.device=="mobile"?n.mobile:n.desktop[t.layout];t=se(t);let i=t.custom_properties?.join(` `),a=n.vsn?.[t.zone];return{assets:o,cdn_prefix:n.cdn_prefix,cdn_fallback:n.cdn_fallback,vsn:a,appConfig:t,onRegister:function(u){y.then(()=>{let f=u.create(t);v(`#${f.mount.id} { ${i||""} }`),typeof r=="function"&&r(f)})}}}function se(t){return t.trigger=er(t.trigger,t.autoload),t.urlHash=t.url_hash||!1,t.searchQueryRetention=t.search_query_retention,t.layerType=t.layerType||"search",t.installationId=t.store,t}function er(t,e){let r=new H(t);return r.enabled=!e||e.trigger,r}var ie={appName:R,backendAppToScriptApp:Xt,buildConfig:Zt,buildSettingsConfig:Wt};s();var O="chat";function tr(t){return[O,{chat_id:t.chat_id}]}function rr(t,e,r){let n=r.find(i=>i.name==O&&i.chat_id==e.chat_id);if(!n)return console.error(`Doofinder app '${O}' not enabled or wrong chat_id`),null;let o={chat_id:e.chat_id,id:e.id||n.options.id,zone:e.zone||t.zone,trigger:e.trigger||!0,label:e.label,extra_params:e.extra_params||{},meta:e.meta||{}};return{...t,...o}}function nr(t,e,r){let n=e[O],o=n.vsn?.[t.zone];return{assets:n[t.device],cdn_prefix:n.cdn_prefix,cdn_fallback:n.cdn_fallback,vsn:o,appConfig:t,onRegister:function(a){y.then(()=>{let u=a.create(t);typeof r=="function"&&r(u)})}}}var ae={appName:O,backendAppToScriptApp:tr,buildConfig:rr,buildSettingsConfig:nr};s();s();function je(t){let{url_patterns:e}=t,r=window.location.toString();return d("[category merchandising] __getNewOptions__ category merchandising URL patterns: ",e," url: ",r),or(e,r)}function or(t,e){try{let r=sr(t,e);if(!r)return d("[category merchandising] configuration not found for current location, urlStr: ",e),null;let n=qe(r),o=[...e.matchAll(n)][0].groups,i=ir(r,o);return i.url_pattern_id=r.id,d("[category merchandising] configuration found for current location, urlStr: ",e,"categoryMerchandisingConfig: ",r,"capturedValues from URL: ",o,"params to open the layer: ",i),i}catch(r){return d("[category merchandising] error trying to get category merchandising search options: ",r),null}}function sr(t,e){return t.find(r=>{let n=qe(r);return[...e.matchAll(n)].length>0})}function qe(t){let[,,e,r]=t.pattern.match(/(\/?)(.+)\1([a-z]*)/i);r=r||"g";let n=new RegExp(e,r);return d("pattern ",e,"flags",r,"regexp",n),n}function ir(t,e){let r="{{",n="}}",{params:o}=t,i=JSON.stringify(o.search);for(let a in e){let u=`${r}${a}${n}`,f=ar(t,a,`${e[a]}`);d("[category merchandising] replacing old value: ",u,", new value ",f,"at",i),i=i.replaceAll(u,f)}return JSON.parse(i)}function ar(t,e,r){let n=t.params?.transformers;if(!n||!n[e])return d("[category merchandising] __applyTransformer__ transformers not found in categoryMerchandisingConfig",t," for ",e),r;try{return Array.isArray(n[e])?cr(n[e],r):typeof n[e]=="string"?ur(n[e],r):r}catch(o){d("[category merchandising] __applyTransformer__ error ","category merchandising config: ",t,"key",e,"value",r,"error",o)}return r}function cr(t,e){d("[category merchandising] __applyTransformerDefinedAsArray__ ",t);let[r,n]=t,o=r.split("."),i=window[o[0]];return o.slice(1).forEach(a=>i=window[a]),typeof i=="function"?(d("[category merchandising] __applyTransformer__ call function ",r," args: ",[e,n]),i(e,n)):(d("[category merchandising] __applyTransformer__ transformer",r," is not a function. Type: ",typeof i),e)}function ur(t,e){let r=(0,eval)(t);return d("[category merchandising] __applyTransformerDefinedAsString__ completionValue obtained with eval",r," evaluated code ",t),typeof r=="function"?r(e):e}var L="category_merchandising";function lr(t){return[L,{}]}function dr(t,e,r){let n=r.find(a=>a.name==L);if(!n)return console.error(`Doofinder app '${L}' not enabled`),null;let o=n.devices[t.device],i={insertion_point:e.insertion_point||o.options.insertion_point,url_hash:e.url_hash||!1,search:e.search||n.options.search,sort:e.sort||{},hooks:e.hooks,custom_css:o.overrides.custom_css,custom_properties:o.overrides.custom_properties,autoload:o.overrides.autoload,url_patterns:e.url_patterns||n.options.url_patterns,type:"category_pages",zone:e.zone||n.options.zone||t.zone};return{...t,...i}}function fr(t,e,r){let n=e[L],o=n.vsn?.[t.zone],i=n[t.device??"desktop"];t.layerType="category_pages",t=se(t);let a=t.custom_properties?.join(` `);return{assets:i,cdn_prefix:n.cdn_prefix,cdn_fallback:n.cdn_fallback,vsn:o,appConfig:t,onRegister:function(u){t.search=je(t),y.then(()=>{if(t.search){t.forceOpen=!0;let f=u.create(t);v(`#${f.mount.id} { ${a||""} }`),typeof r=="function"&&r(f)}})}}}var ce={appName:L,backendAppToScriptApp:lr,buildConfig:dr,buildSettingsConfig:fr};var mr=ie.appName,ze=ce.appName,hr=ae.appName,pr=oe.appName,gr=ne.appName,Ve={LAYER:mr,CHAT:hr,QUIZ:pr,RECOMMENDATIONS:gr};function He(t){return t.reduce(function(e,r){return e[r]=new E,e},{})}function Be(t){return async function(e,r){if(!t[e])throw new Error(`unknown "${e}" app!`);r(await t[e])}}function Fe(t,e){document.dispatchEvent(new CustomEvent("doofinder.register",{detail:{name:t,entrypoint:e}}))}function B(t){return[ce,ie,ne,oe,ae].find(e=>e.appName===t)}s();var ue=".min",w=`/js/dflayer${ue}.js`,k="/css/2/common.css",Ke={js:["/recommendations.min.js"],css:["/recommendations.css"]},Ge={js:[`/quiz${ue}.js`],css:["/quiz.css"]},Qe={js:[`/chat${ue}.js`],css:["/chat.css"]},x="https://cdn.doofinder.com",F=typeof c>"u"?{eu1:"0",us1:"0","eu1-b":"0"}:c,Ye=[{vsn:"1.0",recommendations:{cdn_prefix:x+"/recommendations-v2",desktop:Ke,mobile:Ke},layer:{cdn_prefix:x+"/livelayer",cdn_fallback:x+"/livelayer/1",desktop:{Fullscreen:{js:[w],css:[k,"/css/2/fullscreen.css"]},Embedded:{js:[w],css:[k,"/css/2/embedded.css"]},Floating:{js:[w],css:[k,"/css/2/classic.css"]},FloatingEmbedded:{js:[w],css:[k,"/css/2/classic.css","/css/2/embedded.css"]}},mobile:{js:[w],css:[k,"/css/2/mobile.css"]},vsn:F},category_merchandising:{cdn_prefix:x+"/livelayer",cdn_fallback:x+"/livelayer/1",desktop:{js:[w],css:[k,"/css/2/embedded.css"]},mobile:{js:[w],css:[k,"/css/2/mobile_embedded.css"]},vsn:F},quiz:{cdn_prefix:x+"/quiz",cdn_fallback:x+"/quiz",desktop:Ge,mobile:Ge,vsn:F},chat:{cdn_prefix:x+"/chat",cdn_fallback:x+"/chat",desktop:Qe,mobile:Qe,vsn:F}}];s();function Je(t,e,r=""){let n=M("__DF_CDN_PREFIXES__");return n&&n[t]?n[t]:`${e}${r!=""?"/":""}${r}`}function Ze(t,e,r,n,o,i){let a=Ye[0],u=B(r);if(!u)return console.error(`Doofinder app '${r}' not found`),null;let f=u.buildConfig(e,n,o.apps);if(!f)return console.error(`Doofinder app '${r}' not enabled`),null;let g=u.buildSettingsConfig(f,a,i);if(!g)return null;let D=r==ze?"layer":r;return t(D,g.onRegister),_r(r,g.assets,g.cdn_prefix,g.vsn,g.appConfig.custom_css,g.cdn_fallback),g.appConfig}async function _r(t,e,r,n,o,i){let a=Je(t,r,n),u=n?`?v=${n}`:"";Xe(a,u,i,ee,e.js),Xe(a,u,i,te,e.css),o&&Array.isArray(o)?o.forEach(v):o&&v(o)}async function Xe(t,e,r,n,o){o&&o.forEach(i=>n(`${t}${i}${r?"":e}`,r?`${r}${i}${e}`:void 0))}s();async function We(t,e){let r=yr(t,e),n=await fetch(r);if(!n.ok)throw new Error(`HTTP error! Status: ${n.status}`);return await n.json()}function yr(t,e){let r=M("__DF_STORE_CONFIG__"),n="",o={eu1:"eu-west-1.",us1:""};switch(e=Object.hasOwn(o,e)?e:"eu1",r){case"provisional-bucket":n=`provisional-${e}-df-store-config-files`;break;case"production-bucket":n+=`${e}-df-store-config-files`;break;case"test":return`http://appsloader/store-configs/${e}/${t}.json`;case"local-directory":break;default:n=`${e}-df-store-config-files`}return`https://${n}.s3.${o[e]}amazonaws.com/${t}.json`}s();s();function et(t){let e=t?.replaceAll("_","-").trim().split("-")||[];function r(n){return n?`-${n.toUpperCase()}`:""}if(e.length<3){let[n,o]=e;return`${n?.toLowerCase()}${r(o)}`}else{let[n,o,i]=e;return`${n?.toLowerCase()}-${o.toUpperCase()}${r(i)}`}}function tt(t){return t?.trim().toUpperCase()}function rt(t,e){let r=xr(t.language,e),n=br(r,t.currency,e),o=Sr(t.hashid,r,n,e);return{language:r,currency:n,hashid:o}}function xr(t,e){let r=t||document.documentElement.getAttribute("lang");if(r){r=et(r);let n=e.search_engines;return n[r]?r:vr(n,r)||e.defaults.language}return e.defaults.language}function br(t,e,r){let n=r.search_engines,o=tt(e);return o&&n[t]&&n[t][o]?o:n[t]?Object.keys(n[t])[0]:r.defaults.currency}function Sr(t,e,r,n){if(t)return t;let o=n.search_engines;return o[e]&&o[e][r]?o[e][r]:n.defaults.hashid}function vr(t,e){let[r]=e.split("-");if(t[r])return r;let n=Object.keys(t).filter(o=>wr(o,r)).shift();return t[n]?n:null}function wr(t,e){let[r]=t.split("-");return r===e}s();s();function U(t){return`https://${t}-api.doofinder.com`}s();async function C(t,e){let n={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)};return n.mode="cors",await fetch(t,n)}async function nt(t){t.hashid?(d("[loader]","[loader]","Registering visit",window.location.href),C(`${U(t.zone)}/api/v2/stats/visit`,{session_id:m.getSessionId(),user_id:m.getUserId(),store:t.store,hashid:t.hashid,url:window.location.href})):d("[loader]","No hashid. Skipping register visit")}s();s();function ot(t){return`https://${t}-admin.doofinder.com`}async function it(t){if(t.registerCheckouts){let e="",r=new MutationObserver(async function(o){e=await st(e,t)}),n={subtree:!0,childList:!0};r.observe(document,n),e=await st(e,t)}}async function st(t,e){if(window.location.href.split("#")[0]!==t){let r=Cr(e),n=Dr(e);d("[checkout][logic] isCheckoutUrl",r),d("[checkout][logic] isCheckoutCartUrl",n),r&&Er(e),n&&kr(e),t=window.location.href.split("#")[0]}return t}async function kr(t){let e=t.hashid,r=t.checkout_css_selector||t.checkoutData[e].selector?.products;if(r==null){let o=await C(`${ot(t.zone)}/api/v1/graphql.json`,{query:Tr,variables:{html_content:document.documentElement.outerHTML,hashid:e}});if(!o.ok||(o=await o.json(),r=o.data.updateCheckoutHtml?.checkoutHtml.products,!r))return}if(r==="")return;let n=document.querySelector(r);n&&C(`${U(t.zone)}/api/v2/stats/carts`,{hashid:e,session_id:m.getSessionId(),user_id:m.getUserId(),checkout_html:Pr(Ar(n.outerHTML))})}async function Er(t){let e=t.hashid;C(`${U(t.zone)}/api/v2/stats/sales`,{hashid:e,session_id:m.getSessionId(),user_id:m.getUserId(),has_init:m.isLive("layer")}),document.dispatchEvent(new CustomEvent("doofinder.layer.checkout",{detail:{tag:{_hashid:e},url:window.location.href}})),Ae()}function at(t){if(!t.checkout_url)return null;let e={};for(let r in t.checkout_url){let n=t.checkout_selector?.[r];e[r]={selector:n,paths:t.checkout_url?.[r],cartPaths:t.checkout_cart_url?.[r]}}return e}var Tr=` mutation UpdateCheckoutHtml($html_content: String!, $hashid: String!) { updateCheckoutHtml(html_content: $html_content, hashid: $hashid) { checkoutHtml { products } errors { key message } message } } `;function Cr(t){let e=window.location.pathname,r=window.location.href;if(ct(t.checkout_confirmation_urls,e,r))return!0;if(!(t.hashid in t.checkoutData))return!1;let o=t.hashid,i=t.checkoutData[o].paths??[];return d(`[checkout][checkoutUrlPaths] ${i}`),i.filter(a=>a!=="").some(a=>{let u=le(a);return u.test(e)||u.test(r)})}function Dr(t){let e=window.location.pathname,r=window.location.href;if(ct(t.checkout_summary_urls,e,r))return!0;if(!(t.hashid in t.checkoutData))return!1;let o=t.hashid,i=t.checkoutData[o].cartPaths??[];return d(`[checkout][checkoutCartUrlPaths] ${i}`),i.filter(a=>a!=="").some(a=>{let u=le(a);return u.test(e)||u.test(r)})}function Pr(t){let e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCharCode(n)).join("");return btoa(r)}function le(t){return new RegExp(t.replaceAll("?","\\?").replaceAll(".","\\.").replaceAll("*",".*"))}function Ar(t){return t.replace(//g,"")}function ct(t,e,r){return t.filter(n=>n&&n.value&&n.value!=="").some(n=>{d("[checkout][anyUrlMatches] Checking checkout url for",n);let o=le(n.value),i=(()=>{switch(n.match_type){case"contains":return e.includes(n.value)||r.includes(n.value);case"equals":return e==n.value||r==n.value;case"regex":return o.test(e)||o.test(r);case"starts_with":return e.startsWith(n.value)||r.startsWith(n.value);default:return!1}})();return d(`[checkout][anyUrlMatches] Result for ${n.match_type}:`,i),i})}s();var mt=Pt(ft());function ht(){let{isPhone:t}=(0,mt.default)(navigator.userAgent);return t?"mobile":"desktop"}s();function pt(t){return t.map(e=>{let r=B(e.name);return r?r.backendAppToScriptApp(e):(console.error(`Doofinder app '${e.name}' not found`),!1)}).filter(e=>e)}var gt=!1;function _t(t,e,r){if(gt)throw new Error("Doofinder already exists!");{let g=function(l){let h=u.settings,S=rt(l,h),b=l.register_visits||l.register_visits===void 0&&h.register_visits,fe=l.register_checkouts||l.register_checkouts==null&&h.register_checkouts,St=l.require_cookies_consent||l.require_cookies_consent===void 0&&h.require_cookies_consent;o={...l,...S,pageTypeMappings:h.page_type_mappings,registerVisits:b,registerCheckouts:fe,checkoutData:fe?at(h):{},device:l.device||ht(),account_code:h.account_code,require_cookies_consent:St,checkout_confirmation_urls:h.checkout_confirmation_urls||[],checkout_summary_urls:h.checkout_summary_urls||[],checkout_css_selector:h.checkout_css_selector}},D=function(l,h,S=null){let b=Ze(a,o,l,h,u,S);b&&(i[l]||(i[l]=[]),i[l].push(b))},xt=function(){bt().forEach(h=>{D(...h),Oe(h,()=>D(...h))})},bt=function(){if(o.apps==!1)return e;let l=e.map(b=>b[0]),h=u.apps.filter(b=>!l.includes(b.name)),S=pt(h);return e.concat(S)};gt=!0;let n={},o={},i={},a,u,f=new E;n=He(Object.values(Ve)),a=Be(n),document.addEventListener("doofinder.register",l=>{let{name:h,entrypoint:S}=l.detail;n[h].resolve(S)});async function de(l){u=l[0],g(t),o.require_cookies_consent||Z(),m.getSessionId(),m.getUserId(),m.getTabId(),_("script-version","2.0"),f.resolve(!0),d("[loader]","Doofinder ready. Apps will be initialized now."),xt(),o.registerVisits&&(nt(o),_("hashid",o.hashid)),it(o)}return r?de(r):We(t.store,t.zone).then(l=>{de(l)}).catch(l=>{Object.seal(l),f.reject(l)}),{get Session(){return m},getApp(l){return i[l]},getRegistry(l){return n[l]},buildCart(l){return new V(l)},ready(){return f.promise},enableCookies:Z,disableCookies:Se,enableDebug:ye,disableDebug:xe,setLayerServerUrl:$e,setCDNServerUrl:Ie,init:D,configure:g,registerApp:Fe}}}s();function yt(){let t=window.DoofinderAppsObject,e=window[t].q,r={},n=[],o=null,i;for(;i=e.shift();){let[a,u,f,g]=i;a==="config"?u==="settings"?o=f:r[u]=f:a==="init"&&n.push([u,f,g])}return{config:r,apps:n,scriptStoreConfig:o}}if(window.DoofinderStarted===void 0){window.DoofinderStarted=!0,pe();let{config:t,apps:e,scriptStoreConfig:r}=yt(),n=_t(t,e,r);Object.defineProperty(window,"Doofinder",{value:n,writable:!1})}else console.warn("Multiple Doofinder single scripts detected. Only one will be executed.");})(); /*! Bundled license information: useragent-lite/lib/useragent-lite.js: (** * * @package useragent-lite * @version 0.0.2 * @copyright Copyright (c) 2014 - All rights reserved. * @license MIT License * @author Mark Florence * @link http://mflo.info * *) useragent-lite/index.js: (** * * @package useragent-lite * @version 0.0.2 * @copyright Copyright (c) 2014 - All rights reserved. * @license MIT License * @author Mark Florence * @link http://mflo.info * *) */