1import{a as x}from"/build/_shared/chunk-42ITEOR7.js";import{a as l}from"/build/_shared/chunk-5OBEDPFR.js";import{a as S}from"/build/_shared/chunk-H6S7FWVP.js";import{d as i}from"/build/_shared/chunk-T36URGAI.js";var s=i(S());var h=i(l()),D=(0,s.createContext)({}),F=({children:A})=>{let{cart:d}=(0,s.useContext)(x),[e,v]=(0,s.useState)(),[y,r]=(0,s.useState)(!1),[R,o]=(0,s.useState)(!1),[T,u]=(0,s.useState)();return(0,s.useEffect)(()=>{var m,L,g,k;let C;if(d&&e){let n=[],c=[];Array.isArray(e)?(c=e,r(!1),o(!1)):"skus"in e?(c=e.skus,r((m=e.hasCoverSelected)!=null?m:!1),o((L=e.wasFirstAdd)!=null?L:!1)):(C=e.sendDateAndTime,n=(g=d==null?void 0:d.lineItems)==null?void 0:g.filter(t=>{var a;return e.sku===(t==null?void 0:t.variant.sku)&&e.recipientEmail===((a=t.giftCard)==null?void 0:a.eGiftCardRecipientEmail)&&e.recipientName===t.giftCard.eGiftCardRecipientName}),r(!1),o(!1)),c.length>0&&(n=(k=d==null?void 0:d.lineItems)==null?void 0:k.filter(t=>c.includes((t==null?void 0:t.variant.sku)||"")));let w=n==null?void 0:n.reduce((t,a)=>{if(!t.find(p=>p.variant.sku===(a==null?void 0:a.variant.sku))){let p=!Array.isArray(e)&&!("skus"in e);t.push({...a,...p&&{giftCard:{...a.giftCard,eGiftCardSendDate:C}}})}return t},[]);u(w)}else u(void 0),r(!1),o(!1)},[e,d]),(0,h.jsx)(D.Provider,{value:{lastAddedLines:T,setLastAddedSKUs:v,hasCoverSelected:y,wasFirstAdd:R},children:A})};var f=i(S()),I=i(l()),Q=(0,f.createContext)({}),P=({children:A})=>{let[d,e]=(0,f.useState)(!1);return(0,I.jsx)(Q.Provider,{value:{isQuickAddOpen:d,setIsQuickAddOpen:e},children:A})};export{D as a,F as b,Q as c,P as d};
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.