import{c as e,e as t,K as i}from"./p-d0bfb1d8.js";import"./p-c55c67b2.js";import"./p-c2e91ee8.js";function o(i,o){return{klevuModifierId:"sendMerchandisingViewEvent",onResult:(r,n)=>{var d,s,c,a;if(!n.params){return r}const{id:u,abtest:l}=n.params;if(n.klevuFunctionId!=="categoryMerchandising"||!u){return r}const v=(d=n.queries)===null||d===void 0?void 0:d.find((e=>{var t,i;return Boolean((i=(t=e.settings)===null||t===void 0?void 0:t.query)===null||i===void 0?void 0:i.categoryPath)}));const g=(a=(c=(s=v===null||v===void 0?void 0:v.settings)===null||s===void 0?void 0:s.query)===null||c===void 0?void 0:c.categoryPath)!==null&&a!==void 0?a:"unknown";const b=r.queriesById(u);if(!b){return r}e.categoryMerchandisingView({categoryTitle:i,klevuCategory:g,products:b.records,pageStartsFrom:b.meta.offset,abTestId:l===null||l===void 0?void 0:l.abTestId,abTestVariantId:l===null||l===void 0?void 0:l.abTestVariantId,activeFilters:t(b),override:o});return r}}}const r={id:"categoryMerchandising",searchTerm:"*",limit:24};function n(e,t,...o){const n=Object.assign(Object.assign({},r),t);const d={id:n.id,typeOfRequest:i.CategoryNavigation,settings:Object.assign({query:{categoryPath:e,term:n.searchTerm}},n)};return{klevuFunctionId:"categoryMerchandising",queries:[d],modifiers:o,params:Object.assign(Object.assign({},n),{category:e})}}export{n as c,o as s};
//# sourceMappingURL=p-42fcafbc.js.map