(()=>{"use strict";var e={77119:(e,t)=>{var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=Object.assign||function(e){for(var t=1;t{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{r.r(n),r.d(n,{default:()=>s});var e=r(77119);(0,e.default)({BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESCAPE:27,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,ARROW_LEFT:41,DELETE:46});const t=(0,e.default)({USER:"user",STORE:"store"});(0,e.default)({CONFIRMATION:"confirmation",FREESTYLE:"freestyle",LIGHT_HEADER:"light_header",DARK_HEADER:"dark_header",SINGLE_BUTTON:"single_button",INPUT:"input"}),(0,e.default)("CUSTOMER_ANNOTATIONS","PREVIEW","DEFAULT","DEV","INSITE","INSITE_PREVIEW","TEMPLATE_MODE","WIDGET_BUILDER_PREVIEW","SECTIONS","CREATE_SECTIONS","SELECT_ROWS","MOVE","BLOG_POST_EDIT","BLOG_LAYOUT_EDIT","BLOG_ONLY","DYNAMIC","DUDAFLEX");class o{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)}}const i=new Map;async function a(e){const{name:t,page:r,filters:n,search:a,sortBy:c,fields:s}=e;return await async function(e){if(i.has(e))return console.log("[Collection API] Cache hit for url: ".concat(e,". Returning cached value.")),i.get(e).promise;const t=new o;i.set(e,t);try{const r=await fetch(e),n=await(null==r?void 0:r.json());return t.resolve(n),n}catch(e){throw t.reject(e),e}}(function(e,t,r){const n=e=>"string"==typeof e?e:JSON.stringify(e);r=Object.entries(r).filter((e=>{let[t,r]=e;return r})).flatMap((e=>{let[t,r]=e;return Array.isArray(r)?r.map((e=>[t,n(e)])):[[t,n(r)]]}));const o=new URLSearchParams(r);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}}(),c="/".concat(a.prefix,"/collections/public/").concat(a.siteAlias,"/").concat(a.siteFlow,"/collection/").concat(i,"/").concat(t);return o.toString()?"".concat(c,"?").concat(o):c}(t,"data",{page:r,filters:n,search:a,sortBy:c,fields:s}))}function c(e){let r,n,o,i,c,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.USER;return{get:function(){return a({name:e=s===t.STORE?"internal-usage#store_catalog#".concat(e):e,page:i,filters:r,search:n,sortBy:o,fields:c})},pageSize:function(e){return i||(i={}),i.pageSize=e,this},pageNumber:function(e){return i||(i={}),i.pageNumber=e,this},orderBy:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o||(o=[]),o.push({field:e,direction:t}),this},where:function(e,t,n){return r||(r=[]),r.push({field:e,operator:t,value:n}),this},select:function(){for(var e=arguments.length,t=new Array(e),r=0;r