try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5f691b64-d1c0-4acf-ab46-e12db592c73f",e._sentryDebugIdIdentifier="sentry-dbid-5f691b64-d1c0-4acf-ab46-e12db592c73f")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"4d6f2342016a20c91d0085aeca799321955e1f8b"},(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>k});var n={};e.r(n),e.d(n,{RequestMethod:()=>o,request:()=>s});class r{constructor(){this.resolve=void 0,this.reject=void 0,this.then=void 0,this.catch=void 0,this.promise=void 0,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t})),this.then=this.promise.then.bind(this.promise),this.catch=this.promise.catch.bind(this.promise),Object.freeze(this)}}let o=function(e){return e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.HEAD="HEAD",e}({});const i="Something went wrong.",a={"Content-Type":"application/json"};async function s(e){let{url:t,method:n=o.GET,authToken:r,headers:s,toJson:l=!0,throwError:c=!1,useDefaultHeaders:u=!0,queryParams:d,...g}=e;const f={method:n,...r&&{credentials:"include"},headers:{...u&&a,...r&&{Authorization:r},...s},...g};let h;try{if(h=await(null===globalThis||void 0===globalThis?void 0:globalThis.fetch(function(e,t){if(!t)return e;const n=e.indexOf("?")>-1?"&":"?",r=new URLSearchParams(t);return r?"".concat(e).concat(n).concat(r):e}(t,d),{...f})),h.ok&&h.status>=200&&h.status<300){var v;let e;return l&&204!==h.status&&null!==(v=h.headers.get("Content-type"))&&void 0!==v&&v.includes("json")&&(e=await h.json()),{data:e,error:void 0,response:h}}}catch(e){if(c)throw e||new Error(i);return{data:void 0,error:e||i,response:h}}if(c)throw new Error(i);return{data:void 0,error:i,response:h}}const l=2e3,c=3e4,u=5,d=e=>g(...e.reverse())();function g(){for(var e=arguments.length,t=new Array(e),n=0;nn=>t(e(n))))}function f(e,t){return n=>(n[e]=t,n)}function h(e,t){return parseInt(String(v(e,t)),10)}function v(e,t){return m(e,t,globalThis.commonProps)}function p(e,t){return void 0===t&&(t=!1),v("featureFlag.fromCommonProps.enabled",!1)||(globalThis.evaluatedFlags.add(e),globalThis.notifyServerThrottled()),m(e,t,function(){let e;if(window._flags)e=window._flags;else try{e=window.parent._flags}catch(t){e={}}return e}())}function m(e,t,n){void 0===n&&(n=globalThis.commonProps);const r=n||globalThis.commonProps||globalThis.rtCommonProps||{};return void 0===r[e]?t:r[e]}null!==globalThis&&void 0!==globalThis&&globalThis.notifyServerThrottled||(globalThis.notifyServerThrottled=function(e,t,n){let r,{leading:o}=void 0===n?{leading:!1}:n;return function(){for(var t=arguments.length,n=new Array(t),i=0;i{e(...n),r=null}),3e4)}}((async function(){if(function(){let e=!0;return(globalThis.parentFlags||globalThis.commonProps&&!globalThis.rtCommonProps)&&(e=!1),e}())return;const e=Array.from(globalThis.evaluatedFlags);if(globalThis.evaluatedFlags.clear(),e.length)try{await s({url:"/api/uis/flags/notify",method:o.POST,body:JSON.stringify(e),keepalive:!0})}catch(t){console.warn("Couldn't send flags evaluation (flags: ".concat(e,"):"),t)}}),0,{leading:!1})),null!==globalThis&&void 0!==globalThis&&globalThis.evaluatedFlags||(globalThis.evaluatedFlags=new Set);const b={TRACE:"trace",DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"},y=()=>{},w=(e,t)=>t?{[e]:t}:{},T="application/json",E="/_dm/s/rt/actions/logs",S=p("sentry.report.on.client.logs.enabled"),R=p("sentry.report.on.client.logs.levels",["ERROR"]),O=e=>"string"==typeof e?e:["message","msg","text","error","desc","description","dataString"].reduce(((t,n)=>{const r=e[n];return t||("string"==typeof r?r:null)}),null),A=e=>{const t=e=>[b.TRACE,b.DEBUG,b.INFO,b.WARN,b.ERROR].indexOf(e);return n=>r=>{let{level:o,...i}=r;return t(o)>=t(e)&&n({level:o,...i})}},_=function(){const e=[{test:e=>e instanceof Error,format:e=>["message","stack","code","cause"].reduce(((t,n)=>({...w(n,e[n]),...t})),{})},{test:e=>["string","number"].includes(typeof e),format:e=>({message:e})},{test:()=>!0,format:e=>Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return{[n]:["number","string"].includes(typeof r)?r:JSON.stringify(r),...e}}),{})}];return t=>n=>{t({logs:n.map((t=>{let{data:n,level:r,timestamp:o,userAgent:i,url:a,version:s,environment:l}=t;const c=O(n);return{priority:r.toUpperCase(),_error:n._error||n.error,...w("log",c),fields:{_ts:o,_url:a,_userAgent:i,...w("_ver",s),...w("_env",l),...e.find((e=>{let{test:t}=e;return t(n)})).format(n)}}}))})}}();var P;const C=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;rt=>{let{logLevel:n,dataString:r}=t;return e({data:r,level:n})},e=>t=>{var n,r;return e(Object.assign(t,{userAgent:null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.userAgent,url:null===(r=window)||void 0===r||null===(r=r.location)||void 0===r?void 0:r.href,timestamp:Date.now()}))},function(e){void 0===e&&(e="");const[t,n]=(e.match(/^(\w+)_([0-9]+)$/)||[]).slice(1);return e=>g(...[t&&f("environment",t),n&&f("version",Number(n)),e].filter(Boolean))}((P=(e,t)=>t&&(t.version||(t.parent!==t?e(e,t.parent):"")))(P,window)),(N=[d([A(b.WARN),e=>t=>{let{data:n,level:r,timestamp:o}=t;return e({level:r,text:"[".concat((i=o,["getHours","getMinutes","getSeconds"].map((e=>new Date(i)[e]().toString().padStart(2,"0"))).join(":")),"] ").concat(O(n)||'Cannot find a description for the message sent. See "fields" for more information.')});var i},()=>e=>{var t,n;let{text:r,level:o}=e;(null!==(t=null===(n=console)||void 0===n?void 0:n[o])&&void 0!==t?t:console.log)(r)}]),d([e=>t=>{var n;return(null!==(n=v("server.for.resources"))&&void 0!==n&&n.includes("localhost")?y:e)(t)},e=>t=>{let{data:n,data:{_skipJournal:r=!1}={},...o}=t;(r?y:e)({data:n,...o})},A(b.TRACE),function(e){let{debounceTime:t=l,timeout:n=c,maxBufferCount:r=u}=void 0===e?{}:e;return function(e){let o,i=null;const a=[],s=function(){i=null,e(a.splice(0))};return e=>{clearInterval(o),a.push(e),i=i||Date.now(),(a.length>=r?s:()=>o=setTimeout(s,Math.max(Math.min(t,i+n-Date.now()))))()}}}({debounceTime:h("common.log.debounceDelay")||500,maxBufferCount:h("common.log.batchLogLimit")||5}),_,e=>t=>{var n;return navigator.sendBeacon?navigator.sendBeacon(E,new Blob([JSON.stringify(t)],{type:T})):null===globalThis||void 0===globalThis||null===(n=globalThis.fetch)||void 0===n||n.call(globalThis,E,{headers:{"content-type":T},credentials:"omit",cache:"no-store",method:"POST",body:JSON.stringify(t)}),e(t)},e=>t=>{var n;if(S&&null!==(n=window)&&void 0!==n&&n.Sentry){const{logs:e}=t;e.length&&e.forEach((e=>{if(R.includes(e.priority)){const{log:t,_error:n,fields:r={}}=e,{_source:o,errorBoundaryId:i,...a}=r;window.Sentry.withScope((e=>{e.setContext("Logger",JSON.parse(JSON.stringify(a))),i&&e.setTag("errorBoundaryId",i),e.setTag("isErrorBoundary","ErrorBoundary"===o),n instanceof Error?window.Sentry.captureException(n):window.Sentry.captureMessage(null!=n?n:t)}))}}))}return null==e?void 0:e(t)}])],()=>e=>N.forEach((t=>t(e))))]));var N;const[D,B,x,j,I]=[b.TRACE,b.DEBUG,b.INFO,b.WARN,b.ERROR].map((e=>t=>C({logLevel:e,dataString:t}))),F=(Object.assign(C,{[b.TRACE]:D,[b.DEBUG]:B,[b.INFO]:x,[b.WARN]:j,[b.ERROR]:I}),{[b.TRACE]:D,[b.DEBUG]:B,[b.INFO]:x,[b.WARN]:j,[b.ERROR]:I});globalThis._abtests=globalThis._abtests||{};const{request:U}=n;let L=function(e){return e.USER="user",e.STORE="store",e}({});const J=new Map;async function M(e){const{name:t,page:n,filters:o,search:i,sortBy:a,fields:s}=e;return await async function(e,t){let{context:n}=t;if(J.has(e))return console.log("[Collection API] Cache hit for url: ".concat(e,". Returning cached value.")),J.get(e).promise;const o=new r;let i;J.set(e,o);try{var a;i=await fetch(e);const t=await(null===(a=i)||void 0===a?void 0:a.json());if(!i.ok)throw new Error(t.message||t);return o.resolve(t),t}catch(e){throw o.resolve(e),async function(e){var t,n;let{error:r,context:o,response:i}=e;const a={context:o,url:null==i?void 0:i.url,status:null==i?void 0:i.status,"d-id":null==i||null===(t=i.headers)||void 0===t||null===(n=t.get)||void 0===n?void 0:n.call(t,"d-request-id")};(function(e,t){return 400===(null==t?void 0:t.status)&&e.message.includes("The requested site does not belong to this domain")})(r,i)||F.error({message:"[Collection API] Error fetching collection data: ".concat(r.message),siteAlias:window.Parameters.SiteAlias,dataString:JSON.stringify(a),error:r,tags:["collections-api"]})}({error:e,context:n,response:i}),e}}(function(e,t,n){const r=e=>"string"==typeof e?e:JSON.stringify(e);n=Object.entries(n).filter((e=>{let[t,n]=e;return n})).flatMap((e=>{let[t,n]=e;return Array.isArray(n)?n.map((e=>[t,r(e)])):[[t,r(n)]]}));const o=new URLSearchParams(n);window.currentLanguage&&o.set("language",window.currentLanguage),["internal-usage#store_catalog#catalog_product","internal-usage#store_catalog#catalog_category"].includes(e)&&(e=e.replaceAll("#","__"));const i=encodeURIComponent(e),a=function(){const e=window.Parameters.isRuntimeServer;return{prefix:e?"rts":"ms",siteFlow:e?"runtime":"designtime",siteAlias:window.Parameters.SiteAlias}}(),s="/".concat(a.prefix,"/collections/public/").concat(a.siteAlias,"/").concat(a.siteFlow,"/collection/").concat(i,"/").concat(t);return o.toString()?"".concat(s,"?").concat(o):s}(t,"data",{page:n,filters:o,search:i,sortBy:a,fields:s}),{context:e})}function G(e){let t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.USER;return{get:function(){return M({name:e=a===L.STORE?"internal-usage#store_catalog#".concat(e):e,page:o,filters:t,search:n,sortBy:r,fields:i})},pageSize:function(e){return o||(o={}),o.pageSize=e,this},pageNumber:function(e){return o||(o={}),o.pageNumber=e,this},orderBy:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r||(r=[]),r.push({field:e,direction:t}),this},where:function(e,n,r){return t||(t=[]),t.push({field:e,operator:n,value:r}),this},select:function(){for(var e=arguments.length,t=new Array(e),n=0;n