"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[21],{146:(e,t,n)=>{n.d(t,{a:()=>f,b:()=>u});var i=n(40),o=n(147),r=n(286),l=n(6),a=n(5),c=n(78),s=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function l(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}c((i=i.apply(e,t||[])).next())}))},d=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o0&&(n=yield function(e,t,n){return s(this,void 0,void 0,(function*(){const i=yield e.getFromCache(["/filter/product/tag"]);if(!i)return n;const o=t.map((e=>i[e])).filter(a.e).map((e=>new Set(e)));return 0===o.length?n:n.filter((e=>o.every((t=>t.has(e)))))}))}(e,u,n)),n=(0,c.b)(e,n),0===t.filters.length)return{selectedFiltersMap:{},filterList:[],filteredProductHandles:n};const v=yield function(e,t){return s(this,void 0,void 0,(function*(){null!=t||(t=yield function(e){return s(this,void 0,void 0,(function*(){return f(yield e.getContent(i.a))}))}(e));const n=t.filters.map((({key:t,queryKeys:n,aliases:i})=>{if(!Array.isArray(n)||0===n.length)return void console.warn(`Skipping filter with missing queryKeys: ${t}`);const o=n.flatMap((t=>e.params.getAll(t).flatMap((e=>e.split("~"))))).flatMap((e=>{var t;return(null!==(t=null==i?void 0:i[e])&&void 0!==t?t:[e]).map((e=>encodeURIComponent(e)))}));return 0!==o.length?[t,new Set(o)]:void 0})).filter(a.e);return n.length>0?Object.fromEntries(n):void 0}))}(e,t);if("enabled"!==e.getAssignment("showFilters"))return{selectedFiltersMap:v,filterList:[],filteredProductHandles:n};const g=function(e,t,n,i){return s(this,void 0,void 0,(function*(){const l=new Set(n),c=Array.from(l),d=(yield Promise.all(t.filters.map((t=>s(this,void 0,void 0,(function*(){const[n,s]=yield Promise.all([t.color_swatches_list?(0,o.a)(e,t.color_swatches_list,r.a):void 0,m(e,t.key,c,l,null==i?void 0:i[t.key])]);if(!s)return;const d=s.map((({value:e,filteredHandles:t})=>{var i;const o=null===(i=null==n?void 0:n.standard_colors)||void 0===i?void 0:i.find((t=>t.label===e));return{value:decodeURIComponent(e),selected:!!(null==t?void 0:t.length),handles:t,swatch:p(o)}})).filter(a.e).filter((e=>!n||e.swatch));return Object.assign(Object.assign({},t),{values:d})})))))).filter(a.e);return d}))}(e,t,n,v),h=function(e){return s(this,void 0,void 0,(function*(){return(yield e).map((e=>Object.assign(Object.assign({},e),{values:e.values.map((e=>{var{handles:t}=e;return d(e,["handles"])}))})))}))}(g),y=function(e,t){if(!(null==t?void 0:t.length))return e;const n=t.map((e=>{const t=e.values.filter((e=>e.selected)).flatMap((e=>e.handles));if(t.length>0)return new Set(t)})).filter(a.e);return 0===n.length?e:e.filter((e=>n.every((t=>t.has(e)))))}(n,v?yield g:void 0);return{selectedFiltersMap:v,filterList:h,filteredProductHandles:y}}))}function f(e){return(null==e?void 0:e.filter_config)||{filters:[],sorts:[]}}function m(e,t,n,i,o){return s(this,void 0,void 0,(function*(){const r=`/filter/${t}`,l=yield e.getFromCache([r]);if(!l)return;const c="enabled"===e.getAssignment("showFiltersUselessValues"),s=(yield Promise.all(Object.entries(l).map((([e,t])=>{const r=new Set(t),l=n.filter((e=>r.has(e)));if(0!==l.length&&(c||i.size!==l.length))return{value:e,filteredHandles:(null==o?void 0:o.has(e))?l:void 0,matchingHandlesCount:l.length}})))).filter(a.e);if(0===s.length)return;const d=s.every((e=>e.matchingHandlesCount===i.size));return c||!d?s:void 0}))}function p(e){var t;if(!e)return;if("image"!==(null===(t=e.image)||void 0===t?void 0:t.type)||!e.image.url)return{color:e.color};const n=(0,l.b)(e.image.url);return{color:e.color,image:n}}},116:(e,t,n)=>{n.d(t,{a:()=>p,b:()=>u});var i=n(108),o=n(40),r=n(367),l=n(146),a=n(147),c=n(144),s=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function l(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}c((i=i.apply(e,t||[])).next())}))},d=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o{var e,t,n;const i=O,o=null!==(n=null===(t=null===(e=S.transformedMetafields)||void 0===e?void 0:e.pinnedVariants)||void 0===t?void 0:t.map((e=>e.handle)))&&void 0!==n?n:[];if(!o.length)return i;const r=new Set(Object.keys(i)),l=o.filter((e=>!r.has(e))).map(((e,t)=>[e,{default:-1e3+t}]));return l.length?Object.assign(Object.assign({},i),Object.fromEntries(l)):i})(),{productSorts:q,sortedHandles:x,sortList:L}=(0,i.c)({context:e,globalProductSorts:g,baseProductSorts:j,promotedHandles:F,filterConfig:C}),H=function({sortParamValue:e,featuredProductHandles:t,metafieldPinnedProducts:n}){if(!e)return(null==t?void 0:t.length)?[...new Set([...t,...null!=n?n:[]])]:n}({sortParamValue:v,featuredProductHandles:_,metafieldPinnedProducts:S.transformedMetafields.pinnedProducts}),M=S.transformedMetafields.pinnedVariants,T=H?H.filter((t=>!(0,i.e)(e,q[t]))):void 0,k=function({context:e,collectionHandle:t,sortedHandles:n,pinnedProductHandles:i}){var o;if(!(null==i?void 0:i.length))return n;return"enabled"===(null!==(o=e.getAssignment(`pinProducts_${t}`))&&void 0!==o?o:"enabled")?function(e,t){return[...t.filter((t=>e.includes(t))),...e.filter((e=>!t.includes(e)))]}(n,i):n}({context:e,collectionHandle:t,sortedHandles:x,pinnedProductHandles:T}),{selectedFiltersMap:A,filterList:$,filteredProductHandles:V}=yield(0,l.b)({context:e,filterConfig:C,productHandles:k});return{collection:S,sortedHandles:V,filterList:$,selectedFiltersMap:A,sortList:L,filterConfig:C,pinnedVariants:M,originalCollectionHandles:Object.keys(O),colorSwatchMap:w}}))}function f(e,t){return s(this,void 0,void 0,(function*(){var n;const i=null!==(n=e.getAssignment("promotedHandleAlgorithm"))&&void 0!==n?n:"default";return"default"===i?[]:"insider"===i?yield e.getFromCache([`/insider_sorts/${t}`]):[]}))}function m(e,t){return s(this,void 0,void 0,(function*(){var n;if(t)return;const i=e.params.get("featuredProducts");if(!i)return;const o=yield(0,a.a)(e,i,r.a);return null===(n=null==o?void 0:o.products_list)||void 0===n?void 0:n.filter((e=>!e.draft)).map((e=>e.handle))}))}function p(e,t){var n;const i=null!==(n=null==e?void 0:e.sections)&&void 0!==n?n:[];if(1===t)return i;const o=null==e?void 0:e.sections_first_page_only;if(!(null==o?void 0:o.length))return i;const r=new Set(o.map((e=>`${e.type}|${e.handle}`)));return i.filter((e=>!r.has(`${e.type}|${e.handle}`)))}},286:(e,t,n)=>{n.d(t,{a:()=>l});var i=n(2),o=n(230);const r=i.content.object({name:"Color",type:"shopify--color-pattern",fields:{label:i.content.singleLineTextField({name:"Label",required:!0}),color:i.content.colorField({name:"Color",required:!1}),image:i.content.fileField({name:"Image",required:!1}),color_taxonomy_reference:i.content.listField({name:"Base color",required:!0,fieldType:"taxonomyField"}),pattern_taxonomy_reference:i.content.taxonomyField({name:"Base pattern",required:!0})}}),l=i.content.object({name:"Color Swatches List",type:"color_swatches_list",fields:{swatches:i.content.listField({name:"Swatches",required:!0,fieldType:"metaobjectField",reference:o.a}),swatches_2:i.content.listField({name:"Swatches-2",required:!1,fieldType:"metaobjectField",reference:o.a}),swatches_3:i.content.listField({name:"Swatches-3",required:!1,fieldType:"metaobjectField",reference:o.a}),swatches_4:i.content.listField({name:"Swatches-4",required:!1,fieldType:"metaobjectField",reference:o.a}),standard_colors:i.content.listField({name:"Standard Colors",required:!1,fieldType:"metaobjectField",reference:r})}})},231:(e,t,n)=>{n.d(t,{a:()=>o});var i=n(2);const o=i.content.object({name:"Color Option Name",type:"color_option_name",fields:{color_option_name:i.content.singleLineTextField({name:"Color Option Name",required:!0})}})},230:(e,t,n)=>{n.d(t,{a:()=>r});var i=n(2),o=n(231);const r=i.content.object({name:"Color Swatch",type:"color_swatch",fields:{name:i.content.singleLineTextField({name:"Name",required:!0}),color:i.content.colorField({name:"Color",required:!0}),swatch_image:i.content.fileField({name:"Swatch Image",required:!1}),color_option_name:i.content.metaobjectField({name:"Color Option Name",required:!1,reference:o.a}),base_color:i.content.listField({name:"Base color",required:!1,fieldType:"singleLineTextField"})}})},367:(e,t,n)=>{n.d(t,{a:()=>o});var i=n(2);const o=i.content.object({name:"Featured Products Section",type:"featured_products_section",key:"selector",fields:{display_name:i.content.singleLineTextField({name:"Display Name",required:!0}),products_list:i.content.listField({name:"Products List",required:!1,fieldType:"productField"}),call_to_action:i.content.singleLineTextField({name:"Call to Action",required:!1}),call_to_action_destination_link:i.content.singleLineTextField({name:"Call to Action Destination Link",required:!1}),recommendation_algorithm:i.content.singleLineTextField({name:"Recommendation Algorithm",required:!1}),selector:i.content.singleLineTextField({name:"Selector",required:!1}),desktop_product_limit:i.content.integerField({name:"Desktop Product Limit",required:!1}),mobile_product_limit:i.content.integerField({name:"Mobile Product Limit",required:!1}),mobile_slider:i.content.singleLineTextField({name:"Mobile Slider",required:!1}),source_metafield:i.content.singleLineTextField({name:"source_metafield",required:!1}),desktop_slider:i.content.decimalField({name:"Desktop Slider",required:!1}),pinned_variants:i.content.listField({name:"Pinned Variants",required:!1,fieldType:"variantField"})}})},147:(e,t,n)=>{n.d(t,{a:()=>r});var i=n(229),o=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function l(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}c((i=i.apply(e,t||[])).next())}))};function r(e,t,n){return o(this,void 0,void 0,(function*(){const r=e.getFromCache;return(0,i.setupContent)({getFromCache:e=>r([e]),selectContentResult:(e,n)=>o(this,void 0,void 0,(function*(){return n.find((e=>e.handle===t))}))})(n)}))}}}]);