1import{Link as O}from"./4244768c.js";import{r as c,i as s,F as B,j as o}from"./index.c143cc60.js";import{f as L}from"./92add5bc.js";import"./b7ba96c7.js";import"./06ca57ce.js";import{d as k}from"./81f6c638.js";import"./cee847a8.js";import{ProductOptionsProvider as F}from"./f1fa5532.js";import"./026133a7.js";import"./19e45f74.js";import{u as j}from"./00fa46e1.js";import"./292fc8b5.js";import{u as z}from"./7d9b0f86.js";import{h as D,M as q}from"./7ee6a1c9.js";import{M as G,v as H,I as g,P as A,g as E}from"./c8a56148.js";import{M as Q,u as U}from"./3e028d6a.js";import{M as Y}from"./bf33926f.js";import{u as $}from"./45b195a2.js";import{S as J}from"./934cbed9.js";import{P as K}from"./beede68a.js";import{D as W}from"./2c858ddf.js";import{u as y}from"./1420ec7a.js";import{u as X,P as Z}from"./2d26ab9f.js";import{M as R}from"./8fd66c54.js";import{a as tt}from"./4cde71d8.js";import{M,G as ot}from"./0dd8432a.js";import{useMyProfile as et}from"./07a9458b.js";import{u as rt}from"./9cda3d51.js";import"./4abb4d00.js";import"./be77fb11.js";import"./7dfd4c4d.js";import"./0979fd1f.js";import"./5a68d931.js";import"./124b31fc.js";import"./81ba4c86.js";import"./72d5ceb7.js";import"./985549e6.js";import"./cc9718ab.js";import"./23e7f389.js";import"./49ba8cd3.js";import"./c33fba21.js";import"./3bdb4419.js";import"./60f538c2.js";import"./baa13376.js";import"./2813c260.js";import"./cb6cc3fc.js";import"./e007319b.js";import"./f4ebc70b.js";import"./2c50bf05.js";import"./86e1d1b7.js";import"./5251f401.js";import"./51003e04.js";import"./8622e3f8.js";import"./5bcc9c3d.js";import"./e356499c.js";import"./56a01f73.js";import"./3f7dba3b.js";import"./ddee48c1.js";import"./768f5746.js";import"./2a7c5e1e.js";import"./f5d11555.js";import"./dbd09f8a.js";import"./e58933ba.js";import"./5cfb7f83.js";import"./67d7ca55.js";const it=12;function yo({products:i}){const{setServerProps:u}=k(),{openRequestProductModal:f}=et(),{pageNumber:a,resetPageNumber:l}=X(),d=j(),{isOpen:_,openModal:C,closeModal:N}=$(G.simpleInfo),{value:n,setValue:P,unsetValue:b}=y({param:"category",defaultValue:H.default.value}),{value:p,setValue:V,unsetValue:x}=y({param:"status",defaultValue:void 0}),S=c.exports.useMemo(()=>!!n||!!p,[n,p]),{data:e,refetch:w,isLoading:T}=z(["myCollectionProductsList",a,n,p],()=>D({page:a,pageSize:it,listType:q.collection,category:n,status:p}),{retry:1});c.exports.useEffect(()=>{e&&u({myProductIds:e==null?void 0:e.results.map(t=>{var r;return(r=t==null?void 0:t.product)==null?void 0:r.shopify_resource_id}).filter(t=>t)})},[e,u]);const v=c.exports.useMemo(()=>e?tt(e):null,[e]),h=c.exports.useMemo(()=>e==null?void 0:e.results,[e==null?void 0:e.results]),m=c.exports.useMemo(()=>h?h.map(t=>{const r=i.find(I=>I.handle===t.product.handle);return r?{...t,matchedProduct:r}:t}):[],[h,i]);return s(B,{children:[s("div",{className:"shop-products shop-watch-list connected-pages",children:[o(Y,{suspense:!0,children:o(W,{activeButton:"collection",listView:g.grid})}),s("div",{className:"shop-products__list products-list",children:[s("div",{className:"reviews__page__box",children:[o("button",{className:"button",onClick:C,children:"Build my collection"}),s("div",{style:{display:"flex",gap:"20px"},children:[o(M,{label:"Category",filterOptions:[{value:"",label:"---"},...Object.values(A)],filterValue:n,onFilter:t=>{const r=l({navigate:!1});t?P(t,{href:r}):b({href:r})}}),o(M,{label:"Status",filterOptions:Object.values(E).filter(t=>t.value!=="disposed"),filterValue:p,onFilter:t=>{const r=l({navigate:!1});t?V(t,{href:r}):x({href:r})}})]})]}),S&&o("div",{className:"mt-20 mr-10",style:{width:"100%"},children:o("button",{className:"button button_type_ghost_dark button_size_small",style:{float:"right"},onClick:()=>{d(`/my/collection?view=${g.grid}`)},children:"Clear filters"})}),o(ot,{activeViewType:g.grid}),!T&&m&&m.length===0&&o("div",{className:"products-list products-empty-message mt-20",children:"Your collection is empty."}),o("div",{className:"shop-products__list products-list",children:m&&m.map(t=>o(Q,{memberProduct:t,children:o(st,{refetch:w,memberProduct:t})},t.uuid))}),v>1&&o(Z,{pageCount:v})]})]}),s(J,{title:"Add products to your Collection",isOpen:_,onRequestClose:N,children:[o("div",{className:"plaintext font-20",children:o("p",{children:"To add a product to your collection, open any product in our store and click the \u201CCollection\u201D button."})}
1),o(O,{to:"/shop",className:"button button_size_large mt-20",children:"Browse our shop"}),s("div",{className:"mt-20 text-content",children:[o("p",{className:"mb-0",children:"Can't find the product you're looking for?"}),o("button",{className:"button_type_ghost button_size_small",onClick:f,children:"Request a product"})]})]})]})}function st({memberProduct:i,refetch:u}){var d;const f=rt(((d=i.matchedProduct)==null?void 0:d.variants)!=null?L(i.matchedProduct.variants):[]),{myMemberProduct:a}=U();if(!(a!=null&&a.is_added_to_collection))return null;const l=o(K,{productId:i.product.shopify_resource_id||i.product.uuid,productImage:i.product.main_image,productTitle:null,rating:i.rating,onRatingSuccess:u});return o(R,{tileFor:"collection",children:f?o(F,{data:i.matchedProduct,children:l}):l})}export{yo as default}; 2//# sourceMappingURL=c917801f.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.