PageSourceSearch

https://ufeelgreat.com/_next/static/immutable/chunks/39fchriad54yp.js

js ufeelgreat.com collected 2026-09-25 18:54:16 UTC 29,650 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,644524,213263,401213,e=>{"use strict";var t=e.i(321433),i=e.i(461163);e.i(116233);var r=e.i(974623),s=e.i(51391),a=e.i(517335),n=e.i(375425),c=e.i(705633),o=e.i(54379),l=e.i(211444),d=e.i(213045),u=e.i(194645),m=e.i(812423),p=e.i(354284),g=e.i(187249),h=e.i(864780),x=e.i(113339),y=e.i(712),S=e.i(52393);let b=e=>{let r,s,a,c,o,l,d,u,h,b,j,_,N,T,v,E,A,C,R=(0,i.c)(52),{subscription:O,itemToAdd:M,itemToReplace:k}=e,{formatPrice:P}=(0,g.usePriceFormatter)(),{user:w}=(0,x.default)(),{customerType:D}=w;R[0]!==O.lines?.items?(r=O.lines?.items??[],R[0]=O.lines?.items,R[1]=r):r=R[1];let U=r;R[2]!==U||R[3]!==k?(s=k?U.filter(e=>e.item.id.unicity!==k.sku):U,R[2]=U,R[3]=k,R[4]=s):s=R[4];let I=s;R[5]!==D||R[6]!==M.po||R[7]!==M.product.pricing||R[8]!==M.subscriptionDiscount?(a=(0,p.getProductPricing)({pricingData:M.product.pricing,forCustomerType:D,purchaseOption:M.po,cosmicSubscriptionDiscount:M.subscriptionDiscount}),R[5]=D,R[6]=M.po,R[7]=M.product.pricing,R[8]=M.subscriptionDiscount,R[9]=a):a=R[9];let q=a;R[10]!==D||R[11]!==P||R[12]!==M.po||R[13]!==M.product.pricing||R[14]!==M.qty||R[15]!==M.subscriptionDiscount||R[16]!==q.terms?.priceEach?(c=q.terms?.priceEach?P({pricingData:M.product.pricing,forCustomerType:D,purchaseOption:M.po,cosmicSubscriptionDiscount:M.subscriptionDiscount,quantity:M.qty}):null,R[10]=D,R[11]=P,R[12]=M.po,R[13]=M.product.pricing,R[14]=M.qty,R[15]=M.subscriptionDiscount,R[16]=q.terms?.priceEach,R[17]=c):c=R[17];let B=c;R[18]!==P||R[19]!==k?(o=k?.price?P({price:k.price}):null,R[18]=P,R[19]=k,R[20]=o):o=R[20];
1let G=o,F=I.length+1;return R[21]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("span",{className:"text-sm font-medium",children:(0,t.jsx)(n.T,{children:"subscription_items"})}),R[21]=l):l=R[21],R[22]!==F?(d=(0,t.jsx)(m.AccordionTrigger,{className:"rounded-lg bg-gray-50 px-4 py-3 hover:no-underline",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[l,(0,t.jsx)("span",{className:"rounded-none bg-primary/10 px-2 py-0.5 text-xs text-primary",children:F})]})}),R[22]=F,R[23]=d):d=R[23],R[24]!==k||R[25]!==G?(u=k&&(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm text-destructive line-through opacity-60",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(y.Minus,{className:"h-3 w-3"}),(0,t.jsxs)("span",{className:"font-medium",children:["(",k.quantity,")"]}),(0,t.jsx)("span",{children:k.name}),k.variationName&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"-"}),(0,t.jsx)("span",{children:k.variationName})]})]}),G&&(0,t.jsxs)("span",{className:"font-medium",children:["-",G]})]}),R[24]=k,R[25]=G,R[26]=u):u=R[26],R[27]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)(S.Plus,{className:"h-3 w-3"}),R[27]=h):h=R[27],R[28]!==M.qty?(b=(0,t.jsxs)("span",{className:"font-medium",children:["(",M.qty,")"]}),R[28]=M.qty,R[29]=b):b=R[29],R[30]!==M.title?(j=(0,t.jsx)("span",{children:M.title}),R[30]=M.title,R[31]=j):j=R[31],R[32]!==M.product.combinationName?(_=M.product.combinationName&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"-"}),(0,t.jsx)("span",{children:M.product.combinationName})]}),R[32]=M.product.combinationName,R[33]=_):_=R[33],R[34]!==b||R[35]!==j||R[36]!==_?(N=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[h,b,j,_]}),R[34]=b,R[35]=j,R[36]=_,R[37]=N):N=R[37],R[38]!==B?(T=B&&(0,t.jsxs)("span",{className:"font-medium",children:["+",B]}),R[38]=B,R[39]=T):T=R[39],R[40]!==N||R[41]!==T?(v=(0,t.jsxs)("div",{className:"flex items-center justify-between text-sm text-primary",children:[N,T]}),R[40]=N,R[41]=T,R[42]=v):v=R[42],R[43]!==I?(E=I.map(f),R[43]=I,R[44]=E):E=R[44],R[45]!==v||R[46]!==E||R[47]!==u?(A=(0,t.jsx)(m.AccordionContent,{className:"px-4 pt-2",children:(0,t.jsxs)("div",{className:"space-y-2",children:[u,v,E]})}),R[45]=v,R[46]=E,R[47]=u,R[48]=A):A=R[48],R[49]!==A||R[50]!==d?(C=(0,t.jsx)(m.Accordion,{type:"single",collapsible:!0,className:"w-full",children:(0,t.jsxs)(m.AccordionItem,{value:"line-items",className:"border-none",children:[d,A]})}),R[49]=A,R[50]=d,R[51]=C):C=R[51],C};function f(e){let{variationFlavor:i,productName:r}=(0,h.resolveSubscriptionLineItem)({line:e});return(0,t.jsxs)("div",{className:"flex items-center gap-2 pl-5 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium",children:["(",e.quantity,")"]}),(0,t.jsx)("span",{children:r}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"-"}),(0,t.jsx)("span",{children:i})]})]},e.item.id.unicity)}var j=e.i(133306),_=e.i(843914),N=e.i(549351),T=e.i(358462),v=e.i(468946);let E=e=>{let r,s,c,o,l,d,u,m,p,h,x,y,S,b,f,E,A,C,R,O,M,k=(0,i.c)(53),{orderCalculation:P,isLoading:w}=e,{formatPrice:D}=(0,g.usePriceFormatter)(),{marketExceptions:U}=(0,n.useLocalization)();if(w){let e;return k[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(T.Skeleton,{className:"h-8 w-full"}),(0,t.jsx)(T.Skeleton,{className:"h-8 w-full"}),(0,t.jsx)(T.Skeleton,{className:"h-8 w-full"}),(0,t.jsx)(N.Separator,{className:"my-3"}),(0,t.jsx)(T.Skeleton,{className:"h-10 w-full"})]}),k[0]=e):e=k[0],e}if(!P||P.error){let e,i;return k[1]!==P?(e=P||{error:{message:"Unable to calculate order totals"}},k[1]=P,k[2]=e):e=k[2],k[3]!==e?(i=(0,t.jsx)(a.ErrorAlert,{error:e}),k[3]=e,k[4]=i):i=k[4],i}if(!P.items||0===P.items.length||!P.items[0].terms){let e;return k[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(a.ErrorAlert,{error:{error:{message:"Order calculation returned no items"}}}),k[5]=e):e=k[5],e}let{terms:I}=P.items[0];k[6]!==U?(r=(0,_.shouldApplyFrontendTax)({marketExceptions:U}),k[6]=U,k[7]=r):r=k[7];let q=r,B=I.tax?.amount??0,G=I.discount?.amount??0,F=I.subtotal-G,L=q&&F>0?B/F:0,H=I.subtotal*(1+L),Y=G*(1+L);return k[8]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(n.T,{children:"subtotal"}),k[8]=s):s=k[8],k[9]!==L?(c=L>0&&(0,t.jsxs)("span",{className:"ms-1 text-sm text-muted-foreground",children:["(",(0,t.jsx)(n.T,{children:"vat_included"}),")"]}),k[9]=L,k[10]=c):c=k[10],k[11]!==c?(o=(0,t.jsxs)("span",{children:[s,c]}
1),k[11]=c,k[12]=o):o=k[12],k[13]!==H||k[14]!==D?(l=D({price:H}),k[13]=H,k[14]=D,k[15]=l):l=k[15],k[16]!==l?(d=(0,t.jsx)("span",{children:l}),k[16]=l,k[17]=d):d=k[17],k[18]!==o||k[19]!==d?(u=(0,t.jsxs)("div",{className:"flex justify-between",children:[o,d]}),k[18]=o,k[19]=d,k[20]=u):u=k[20],k[21]!==D||k[22]!==q||k[23]!==B?(m=!q&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"taxes"})}),(0,t.jsx)("span",{children:0===B?(0,t.jsx)(n.T,{children:"free"}):D({price:B})})]}),k[21]=D,k[22]=q,k[23]=B,k[24]=m):m=k[24],k[25]!==Y||k[26]!==D?(p=Y>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"discount"})}),(0,t.jsxs)("span",{children:["-",D({price:Y})]})]}),k[25]=Y,k[26]=D,k[27]=p):p=k[27],k[28]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"shipping"})}),k[28]=h):h=k[28],k[29]!==D||k[30]!==I.freight?.amount?(x=(I.freight?.amount??0)===0?(0,t.jsx)(n.T,{children:"free"}):D({price:I.freight?.amount??0}),k[29]=D,k[30]=I.freight?.amount,k[31]=x):x=k[31],k[32]!==x?(y=(0,t.jsxs)("div",{className:"flex justify-between",children:[h,(0,t.jsx)("span",{children:x})]}),k[32]=x,k[33]=y):y=k[33],k[34]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(N.Separator,{className:"my-3"}),k[34]=S):S=k[34],k[35]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"new_total"})}),k[35]=b):b=k[35],k[36]!==D||k[37]!==I.total?(f=D({price:I.total}),k[36]=D,k[37]=I.total,k[38]=f):f=k[38],k[39]!==f?(E=(0,t.jsxs)("div",{className:"flex justify-between text-lg font-bold",children:[b,(0,t.jsx)("span",{children:f})]}),k[39]=f,k[40]=E):E=k[40],k[41]===Symbol.for("react.memo_cache_sentinel")?(A=["Associate"],k[41]=A):A=k[41],k[42]===Symbol.for("react.memo_cache_sentinel")?(C=(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"new_total_pv"})}),k[42]=C):C=k[42],k[43]!==I.pv?(R=(0,t.jsx)(j.CustomerTypeGate,{allow:A,hideForAffiliate:!0,children:(0,t.jsxs)("div",{className:"flex justify-between",children:[C,(0,t.jsx)("span",{children:I.pv})]})}),k[43]=I.pv,k[44]=R):R=k[44],k[45]===Symbol.for("react.memo_cache_sentinel")?(O=(0,t.jsxs)("div",{className:"mt-4 flex items-center gap-2 rounded-lg bg-secondary-50 p-3 text-sm text-secondary-600",children:[(0,t.jsx)(v.default,{src:"/icons/green-info.svg",height:15,width:15,alt:""}),(0,t.jsx)("span",{children:(0,t.jsx)(n.T,{children:"you_wont_be_charged_right_now"})})]}),k[45]=O):O=k[45],k[46]!==y||k[47]!==E||k[48]!==R||k[49]!==u||k[50]!==m||k[51]!==p?(M=(0,t.jsxs)("div",{className:"space-y-2",children:[u,m,p,y,S,E,R,O]}),k[46]=y,k[47]=E,k[48]=R,k[49]=u,k[50]=m,k[51]=p,k[52]=M):M=k[52],M};e.s(["SubManagerAddProductTotals",0,E],213263);let A=e=>{let r,s,a,c,o,l,d,u,m,h,y,S,b,f=(0,i.c)(41),{item:j,isReplacementMode:_}=e,{formatPrice:N}=(0,g.usePriceFormatter)(),{user:T}=(0,x.default)(),{customerType:E}=T;f[0]!==E||f[1]!==j.po||f[2]!==j.product.pricing||f[3]!==j.subscriptionDiscount?(r=(0,p.getProductPricing)({pricingData:j.product.pricing,forCustomerType:E,purchaseOption:j.po,cosmicSubscriptionDiscount:j.subscriptionDiscount}),f[0]=E,f[1]=j.po,f[2]=j.product.pricing,f[3]=j.subscriptionDiscount,f[4]=r):r=f[4];let A=r;f[5]!==E||f[6]!==N||f[7]!==j.po||f[8]!==j.product.pricing||f[9]!==j.qty||f[10]!==j.subscriptionDiscount||f[11]!==A.terms?.priceEach?(s=A.terms?.priceEach?N({pricingData:j.product.pricing,forCustomerType:E,purchaseOption:j.po,cosmicSubscriptionDiscount:j.subscriptionDiscount,quantity:j.qty}):null,f[5]=E,f[6]=N,f[7]=j.po,f[8]=j.product.pricing,f[9]=j.qty,f[10]=j.subscriptionDiscount,f[11]=A.terms?.priceEach,f[12]=s):s=f[12];let C=s;f[13]!==_?(a=_&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[(0,t.jsx)(v.default,{src:"/icons/plus.svg",height:16,width:16,alt:""}),(0,t.jsx)(n.T,{children:"adding_to_subscription"})]}),f[13]=_,f[14]=a):a=f[14];let R=`flex gap-4 rounded-lg p-4 ${_?"border border-primary/30 bg-primary/5":"bg-gray-50"}`,O=j.image||"/icons/product-placeholder.svg";return f[15]!==j.title||f[16]!==O?(c=(0,t.jsx)("div",{className:"relative h-20 w-20 shrink-0 overflow-hidden rounded-lg bg-white",children:(0,t.jsx)(v.default,{src:O,alt:j.title,fill:!0,className:"object-contain"})}),f[15]=j.title,f[16]=O,f[17]=c):c=f[17],f[18]!==j.title?(o=(0,t.jsx)("p",{className:"font-semibold",children:j.title}),f[18]=j.title,f[19]=o):o=f[19],f[20]!==j.product.combinationName?(l=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:j.product.combinationName}),f[20]=j.product.combinationName,f[21]=l):l=f[21],f[22]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(n.T,{children:"quantity"}),f[22]=d):d=f[22],f[23]!==j.qty?(u=(0,t.jsxs)("p",{className:"text-sm",children:[d,": ",j.qty]}),f[23]=j.qty,f[24]=u):u=f[24],f[25]!==C?(m=C&&(0,t.jsx)("p",{className:"font-semibold text-primary",children:C}),f[25]=C,f[26]=m):m=f[26],f[27]!==u||f[28]!==m?(h=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[u,m]}),f[27]=u,f[28]=m,f[29]=h):h=f[29],f[30]!==h||f[31]!==o||f[32]!==l?(y=(0,t.jsxs)("div",{className:"flex flex-1 flex-col justify-center",children:[o,l,h]}),f[30]=h,f[31]=o,f[32]=l,f[33]=y):y=f[33],f[34]!==y||f[35]!==R||f[36]!==c?(S=(0,t.jsxs)("div",{className:R,children:[c,y]}),f[34]=y,f[35]=R,f[36]=c,f[37]=S):S=f[37],f[38]!==S||f[39]!==a?(b=(0,t.jsxs)("div",{className:"space-y-2",children:[a,S]}),f[38]=S,f[39]=a,f[40]=b):b=f[40],b},C=e=>{let r,s,a,c,o,l,d,u,m,p,h,x=(0,i.c)(26),{name:y,quantity:S,image:b,variationName:f,price:j}=e,{formatPrice:_}=(0,g.usePriceFormatter)();x[0]!==_||x[1]!==j?(r=j?_({price:j}):null,x[0]=_,x[1]=j,x[2]=r):r=x[2];let N=r;x[3]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-red-600",children:[(0,t.jsx)(v.default,{src:"/icons/minus.svg",height:16,width:16,alt:""}),(0,t.jsx)(n.T,{children:"removing_from_subscription"})]}),x[3]=s):s=x[3];let T=b||"/icons/product-placeholder.svg";return x[4]!==y||x[5]!==T?(a=(0,t.jsx)("div",{className:"relative h-20 w-20 shrink-0 overflow-hidden rounded-lg bg-white",children:(0,t.jsx)(v.default,{src:T,alt:y,fill:!0,className:"object-contain"})}),x[4]=y,x[5]=T,x[6]=a):a=x[6],x[7]!==y?(c=(0,t.jsx)("p",{className:"font-semibold",children:y}),x[7]=y,x[8]=c):c=x[8],x[9]!==f?(o=f&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:f}),x[9]=f,x[10]=o):o=x[10],x[11]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)(n.T,{children:"quantity"}),x[11]=l):l=x[11],x[12]!==S?(d=(0,t.jsxs)("p",{className:"text-sm",children:[l,": ",S]}),x[12]=S,x[13]=d):d=x[13],x[14]!==N?(u=N&&(0,t.jsxs)("p",{className:"font-semibold text-red-600",children:["-",N]}),x[14]=N,x[15]=u):u=x[15],x[16]!==d||x[17]!==u?(m=(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[d,u]}),x[16]=d,x[17]=u,x[18]=m):m=x[18],x[19]!==m||x[20]!==c||x[21]!==o?(p=(0,t.jsxs)("div",{className:"flex flex-1 flex-col justify-center",children:[c,o,m]}),x[19]=m,x[20]=c,x[21]=o,x[22]=p):p=x[22],x[23]!==p||x[24]!==a?(h=(0,t.jsxs)("div",{className:"space-y-2",children:[s,(0,t.jsxs)("div",{className:"flex gap-4 roun
1ded-lg border border-red-200 bg-red-50 p-4",children:[a,p]})]}),x[23]=p,x[24]=a,x[25]=h):h=x[25],h};function R(){}e.s(["SubManagerAddProductConfirmation",0,e=>{let m,p,g,h,x,y,S,f,j,_,N,T,v,O,M,k,P,w,D,U,I,q=(0,i.c)(64),{onClose:B,onSuccess:G,selectedProduct:F,subscription:L,itemToReplace:H}=e,{translate:Y}=(0,n.useTranslate)(),{openSubscriptionErrorModal:$}=(0,d.useSubscriptionErrorModal)();if(q[0]!==F||q[1]!==L){let{subscriptionSupplyMonths:e,hasFrequencyMismatch:t,selectedPurchaseOptionKey:i,cadenceOverrideSkus:r}=(0,u.resolveProductPurchaseOption)({selectedProduct:F,subscription:L});g=e,p=t,m=(0,c.createCartItem)({product:F.product,variation:F.variation,po:"subscribe",qty:F.quantity,addToCartLocation:["product_page_main_button"],selectedPurchaseOptionKey:i}),h=g>1&&!r.includes(m.product.sku),q[0]=F,q[1]=L,q[2]=m,q[3]=p,q[4]=g,q[5]=h}else m=q[2],p=q[3],g=q[4],h=q[5];let z=h,V=p||z,K=H?.sku;q[6]!==m||q[7]!==L||q[8]!==K?(x={subscription:L,itemToAddToSubscription:m,skuToExclude:K},q[6]=m,q[7]=L,q[8]=K,q[9]=x):x=q[9];let{orderCalculation:Q,calculationError:W,isLoadingOrderCalculation:J}=(0,l.useCalculateNewSubscriptionTotals)(x),{handleAddItemToSubscription:X,isLoadingAddingItemToSubscription:Z}=(0,o.useAddNewItemToSubscription)(),ee=!!H;q[10]!==m||q[11]!==X||q[12]!==ee||q[13]!==H?.sku||q[14]!==B||q[15]!==G||q[16]!==$||q[17]!==Q||q[18]!==L||q[19]!==Y?(y=()=>{X({subscription:L,itemToAddToSubscription:m,orderCalculation:Q,mode:ee?"replace":"add",skuToExclude:H?.sku,onSuccess:G,onError:e=>{$({error:e,title:ee?Y("error_replacing_product"):Y("error_adding_product"),onClose:B})}}).catch(R)},q[10]=m,q[11]=X,q[12]=ee,q[13]=H?.sku,q[14]=B,q[15]=G,q[16]=$,q[17]=Q,q[18]=L,q[19]=Y,q[20]=y):y=q[20];let et=y;q[21]!==ee||q[22]!==L.id.unicity?(S=(0,t.jsx)("div",{children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:ee?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.T,{children:"replacing_product_in_subscription"})," ",L.id.unicity]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.T,{children:"adding_product_to_subscription"})," ",L.id.unicity]})})}),q[21]=ee,q[22]=L.id.unicity,q[23]=S):S=q[23],q[24]!==H?(f=H&&(0,t.jsx)(C,{name:H.name,quantity:H.quantity,image:H.image,variationName:H.variationName,price:H.price}),q[24]=H,q[25]=f):f=q[25],q[26]!==m||q[27]!==ee?(j=(0,t.jsx)(A,{item:m,isReplacementMode:ee}),q[26]=m,q[27]=ee,q[28]=j):j=q[28],q[29]!==m||q[30]!==H||q[31]!==L?(_=(0,t.jsx)(b,{subscription:L,itemToAdd:m,itemToReplace:H}),q[29]=m,q[30]=H,q[31]=L,q[32]=_):_=q[32],q[33]===Symbol.for("react.memo_cache_sentinel")?(N=(0,t.jsx)("h3",{className:"mb-3 font-semibold",children:(0,t.jsx)(n.T,{children:"new_subscription_totals"})}),q[33]=N):N=q[33],q[34]!==J||q[35]!==Q?(T=(0,t.jsxs)("div",{children:[N,(0,t.jsx)(E,{orderCalculation:Q,isLoading:J})]}),q[34]=J,q[35]=Q,q[36]=T):T=q[36],q[37]!==W?(v=W&&(0,t.jsx)(a.ErrorAlert,{error:W}),q[37]=W,q[38]=v):v=q[38],q[39]!==V||q[40]!==g||q[41]!==Y?(O=V&&(0,t.jsx)(a.ErrorAlert,{error:{error:{message:Y("product_not_available_for_frequency",{variables:{months:String(g)}})}}}),q[39]=V,q[40]=g,q[41]=Y,q[42]=O):O=q[42];let ei=J||!!W||V;return q[43]===Symbol.for("react.memo_cache_sentinel")?(M=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Spinner,{size:16}),(0,t.jsx)(n.T,{children:"loading"})]}),q[43]=M):M=q[43],q[44]===Symbol.for("react.memo_cache_sentinel")?(k=(0,t.jsx)(n.T,{children:"confirm"}),q[44]=k):k=q[44],q[45]!==et||q[46]!==Z||q[47]!==ei?(P=(0,t.jsx)(r.Button,{onClick:et,disabled:ei,isLoading:Z,loadingChildren:M,variant:"secondary",children:k}),q[45]=et,q[46]=Z,q[47]=ei,q[48]=P):P=q[48],q[49]===Symbol.for("react.memo_cache_sentinel")?(w=(0,t.jsx)(n.T,{children:"cancel"}),q[49]=w):w=q[49],q[50]!==B?(D=(0,t.jsx)(r.Button,{variant:"ghost",onClick:B,children:w}),q[50]=B,q[51]=D):D=q[51],q[52]!==P||q[53]!==D?(U=(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[P,D]}),q[52]=P,q[53]=D,q[54]=U):U=q[54],q[55]!==T||q[56]!==v||q[57]!==O||q[58]!==U||q[59]!==S||q[60]!==f||q[61]!==j||q[62]!==_?(I=(0,t.jsxs)("div",{className:"flex flex-col gap-6 p-4",children:[S,f,j,_,T,v,O,U]}),q[55]=T,q[56]=v,q[57]=O,q[58]=U,q[59]=S,q[60]=f,q[61]=j,q[62]=_,q[63]=I):I=q[63],I}
1],644524),e.s(["hasResolvableSubscriptionLines",0,({subscription:e})=>(e.lines?.items??[]).some(e=>!!e.productData)],401213)},509350,e=>{"use strict";var t=e.i(461163),i=e.i(290401);e.s(["useDevice",0,()=>{let e,r,s,a=(0,t.c)(5),[n,c]=(0,i.useState)(!1),[o,l]=(0,i.useState)(!1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=()=>{let e=window.innerWidth;c(e<1024),l(e>=1024)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},r=[],a[0]=e,a[1]=r):(e=a[0],r=a[1]),(0,i.useEffect)(e,r),a[2]!==o||a[3]!==n?(s={isMobile:n,isDesktop:o},a[2]=o,a[3]=n,a[4]=s):s=a[4],s}])},54379,976699,211444,213045,194645,e=>{"use strict";var t=e.i(321433);e.i(116233);var i=e.i(974623);e.i(400925);var r=e.i(702422),s=e.i(303937);e.i(479578);var a=e.i(254667),n=e.i(375425),c=e.i(549597),o=e.i(451428),l=e.i(650637),d=e.i(357573),u=e.i(705001),m=e.i(475033);let p=({subscriptionId:e,responseCode:t,errorMessage:i})=>u.mixpanelService.trackEvent(m.MixpanelEvent.REVIEW_SUBSCRIPTION_CHANGES_SERVER_ERROR,{subscription_id:e,response_code:t||"",error_message:i||""}),g=({scenario:e,action:t,subscriptionId:i,cartItem:r,itemCount:s,customerType:a,currencyCode:n})=>u.mixpanelService.trackEvent(m.MixpanelEvent.SUBSCRIPTION_ITEMS_AMOUNT_CHANGES,{scenario:e,action:t,subscription_id:i,item_change_amount:s,item_sku:r.product.sku,item_name:r.title,item_variant:r.product.combinationName,currency:n,order_total:(0,d.getTerms)({forCustomerType:a,pricingData:r.product.pricing||null})?.priceEach||0,..."combine_subscription"===e&&{add_to_cart_location:"product_page_main_button"}}),h={sku:"",combinationName:""};e.s(["TrackAddSubscriptionCompleted",0,g,"TrackFlavorChange",0,({subscription:e,oldVariant:t,newVariant:i})=>u.mixpanelService.trackEvent(m.MixpanelEvent.SUBSCRIPTION_FLAVOR_CHANGED,{subscriptionId:e.id.unicity,item_sku:i.sku,old_value:t.combinationName,new_value:i.combinationName}).catch(()=>{}),"TrackSubscriptionError",0,p,"TrackSubscriptionQuantityChanges",0,({scenario:e,action:t,subscription:i,editedSubscription:r,variation:s,quantity:a})=>{let{sku:n,combinationName:c}=s??h;return u.mixpanelService.trackEvent(m.MixpanelEvent.SUBSCRIPTION_ITEMS_AMOUNT_CHANGES,{scenario:e,action:t,subscription_id:i.id.unicity,item_change_amount:a,item_sku:n,item_name:r.productData?.name||"",item_variant:c,value:i.terms.subtotal})},"TrackSubscriptionSelected",0,({scenario:e,subscriptionId:t})=>u.mixpanelService.trackEvent(m.MixpanelEvent.CREATE_OR_COMBINE_SUBSCRIPTION_SELECTED,{scenario:e,...t&&{subscription_id:t}}),"TrackSubscriptionTermChange",0,({subscriptionId:e,fromSupplyMonths:t,toSupplyMonths:i})=>u.mixpanelService.trackEvent(m.MixpanelEvent.SUBSCRIPTION_TERM_CHANGED,{subscription_id:e,old_value:t,new_value:i})],976699);var x=e.i(228312),y=e.i(181542),S=e.i(113339),b=e.i(468946);e.s(["useAddNewItemToSubscription",0,()=>{let{marketExceptions:e,alpha2:c}=(0,n.useLocalization)(),{user:{token:d,customerType:u}}=(0,S.default)(),{modals:m}=(0,r.useModals)(),{mutateAsync:h,isPending:f}=(0,s.useEditSubscriptionMutation)();return{handleAddItemToSubscription:async({subscription:r,itemToAddToSubscription:s,orderCalculation:S,mode:f="add",skuToExclude:j,onSuccess:_,onError:N})=>{let T=Date.now(),v="replace"===f?a.logger.tags.OPERATION.REPLACE_PRODUCT:a.logger.tags.OPERATION.ADD_PRODUCT;if(!d||!r||!s){a.logger.warn(`[Sub Manager: ${"replace"===f?"Replace Product":"Add Product"}] Validation failed — missing subscription or token`,{market:c,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,v,a.logger.tags.STATUS.ERROR],metadata:{durationMs:Date.now()-T}}),N({error:{message:"Missing required parameters",code:400}});return}if(!r.transactions.items?.[0]?.methodDetails){a.logger.warn(`[Sub Manager: ${"replace"===f?"Replace Product":"Add Product"}] Blocked — subscription missing payment method details`,{market:c,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,v,a.logger.tags.STATUS.ERROR],metadata:{subscriptionId:r.id.unicity,durationMs:Date.now()-T}}),N({error:{message:"Missing subscription transaction details",code:400}});return}let E=S?.items?.[0];if(!S||S.error||!E){let e=S?.error;a.logger.warn(`[Sub Manager: ${"replace"===f?"Replace Product":"Add Product"}
1] Cannot proceed — order calculation failed`,{market:c,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,v,a.logger.tags.STATUS.ERROR],metadata:{subscriptionId:r.id.unicity,durationMs:Date.now()-T},...e?{error:S}:{}}),N(e?{error:e}:{error:{message:"Order calculation unavailable",code:400}});return}let A=(0,x.getSubscriptionEditUrl)(r),C={items:[{...r.transactions.items[0],amount:"this.terms.total"}]},R=(0,y.leanOutSubscription)(r),O=s.product.sku||"",M=R.lines.items.filter(e=>!j||e.item.id.unicity!==j),k=M.findIndex(e=>e.item.id.unicity===O),P=k>=0,w=P?M.map((e,t)=>t===k?{...e,quantity:e.quantity+s.qty}:e):M,D={...R,transactions:C,lines:{items:P?w:[...w,{item:{href:`https://hydra.unicity.net/v5a/items?id.unicity=${O}`,id:{unicity:O}},quantity:s.qty}]}},U=r.id.unicity,I=s.product.sku||"",q=s.qty;try{await h({token:d,href:A,data:D}),a.logger.info(`[Sub Manager: ${"replace"===f?"Replace Product":"Add Product"}] Item ${"replace"===f?"replaced":"added"} in subscription`,{market:c,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,v,a.logger.tags.STATUS.SUCCESS],metadata:{subscriptionId:U,sku:I,quantity:q,durationMs:Date.now()-T}}),g({scenario:"combine_subscription",action:"replace"===f?"replace":"add",subscriptionId:r.id.unicity,cartItem:s,itemCount:s.qty,customerType:u,currencyCode:e?.currencyCode||"USD"}).catch(()=>{}),_?.(),m.openModal({type:"dialogOrDrawer",modalId:"subscription-updated-successfully",modal:{dialogProps:{className:"max-w-md"},children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"my-5 flex items-center justify-center",children:(0,t.jsx)(b.default,{height:50,width:50,src:"/icons/checked-circle.svg",alt:"Check"})}),(0,t.jsx)("h3",{className:"text-lg font-bold",children:(0,t.jsx)(n.T,{children:"items_successfully_added_to_subscription"})}),(0,t.jsx)(n.T,{children:"items_will_not_show_in_your_cart"}),(0,t.jsx)("div",{className:"mt-6 flex flex-col items-center justify-center gap-3",children:(0,t.jsx)(i.Button,{variant:"ghost",onClick:()=>m.closeModals(),children:(0,t.jsx)(n.T,{children:"close"})})})]})}})}catch(t){a.logger.error(`[Sub Manager: ${"replace"===f?"Replace Product":"Add Product"}] Failed to ${"replace"===f?"replace":"add"} item in subscription`,{market:c,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,v,a.logger.tags.STATUS.ERROR],metadata:{subscriptionId:U,sku:I,quantity:q,durationMs:Date.now()-T},error:t});let e=t instanceof o.HydraApiError?t:null;p({subscriptionId:r.id.unicity,responseCode:e?.code?.toString(),errorMessage:(e?.errorMessage??e?.message)?.toString()}).catch(()=>{}),N((0,l.toHydraErrorType)({error:t,fallbackMessage:"Failed to update subscription"}))}},isLoadingAddingItemToSubscription:f}}],54379),e.i(383861);var f=e.i(977800),j=e.i(541446),_=e.i(656347);e.s(["useCalculateNewSubscriptionTotals",0,({subscription:e,itemToAddToSubscription:t,skuToExclude:i})=>{let{user:r}=(0,S.default)(),{marketExceptions:s,alpha2:o}=(0,n.useLocalization)(),d=!!(r?.customer&&r?.token&&e)&&!!o,u=e?.id.unicity||"",m=t.product.sku||"",p=t.qty,g=s?.currencyCode||"USD",{data:h,isLoading:x}=(0,_.useQuery)({queryKey:[j.QUERY_KEYS.HYDRA.SUBSCRIPTION_TOTALS,u,m,p,i||"none",g,o],queryFn:async()=>{if(!r?.customer||!r?.token||!e)return{orderCalculation:null,error:null};let s=Date.now();try{let n=await c.hydraV2.calculateOrder({customerType:r.customer.type,customerId:r.customer.unicity?.toString()||"",items:[...(e.lines?.items??[]).filter(e=>!i||e.item.id.unicity!==i).map(e=>({id:e.item.id.unicity||"",quantity:e.quantity,currency:g,po:"subscription"})),{id:m,quantity:p,currency:g,po:t.po||""}],shippingMethod:`type=${e.shippingMethod.type}${e.shippingMethod.location?`&location=${e.shippingMethod.location}`:""}`,customer:r.customer,shipToAddress:{state:e.shipToAddress?.state||"",country:e.shipToAddress?.country,firstName:e.shipToName?.firstName||"",lastName:e.shipToName?.lastName||"",fullName:e.shipToName?.fullName||"",email:e.shipToEmail??"",phone:e.shipToPhone||"",address1:e.shipToAddress?.address1??"",address2:e.shipToAddress?.address2||"",city:e.shipToAddress?.city??"",zip:e.shipToAddress?.zip??"",neighborhood:""},token:r.token,market:o,transactionItem:[]}),l=Date.now()-s;
1return a.logger.info("[Sub Manager: Order Calculation] New totals calculated",{market:o,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,a.logger.tags.OPERATION.CALCULATE_ORDER,a.logger.tags.STATUS.SUCCESS],metadata:{subscriptionId:u,sku:m,skuToExclude:i,quantity:p,total:n.items?.[0]?.terms.total,durationMs:l}}),{orderCalculation:n,error:null}}catch(r){let e=Date.now()-s,t=(0,l.toHydraErrorType)({error:r,fallbackMessage:"Error calculating order"});return a.logger.error("[Sub Manager: Order Calculation] Failed to calculate new totals",{market:o,tags:[a.logger.tags.GROUP.SUB_MANAGEMENT,a.logger.tags.PAGE.SUBSCRIPTIONS,a.logger.tags.SOURCE.HYDRA,a.logger.tags.OPERATION.CALCULATE_ORDER,a.logger.tags.STATUS.ERROR],metadata:{subscriptionId:u,sku:m,skuToExclude:i,quantity:p,durationMs:e},error:r}),{orderCalculation:t,error:t}}},enabled:d,staleTime:f.QUERY_CACHE_TIMES.TWO_MINUTES_MS,gcTime:f.QUERY_CACHE_TIMES.FIVE_MINUTES_MS});return{orderCalculation:h?.orderCalculation??null,calculationError:h?.error??null,isLoadingOrderCalculation:x}}],211444);var N=e.i(461163),T=e.i(517335);let v="subscription-error-modal";e.s(["useSubscriptionErrorModal",0,()=>{let e,s,a,c=(0,N.c)(8),{modals:o}=(0,r.useModals)(),{translate:l}=(0,n.useTranslate)();c[0]!==o||c[1]!==l?(e=e=>{let{error:r,title:s,onRetry:a,onClose:c}=e;o.openModal({type:"dialogOrDrawer",modalId:v,modal:{title:s||l("error"),dialogProps:{className:"max-w-md"},children:(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsx)(T.ErrorAlert,{error:r}),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[a&&(0,t.jsx)(i.Button,{variant:"secondary",onClick:()=>{o.updateModal(v,{isOpen:!1}),a()},children:(0,t.jsx)(n.T,{children:"try_again"})}),(0,t.jsx)(i.Button,{variant:"ghost",onClick:()=>{o.updateModal(v,{isOpen:!1}),c?.()},children:(0,t.jsx)(n.T,{children:"close"})})]})]})}})},c[0]=o,c[1]=l,c[2]=e):e=c[2];let d=e;c[3]!==o?(s=()=>{o.updateModal(v,{isOpen:!1})},c[3]=o,c[4]=s):s=c[4];let u=s;return c[5]!==u||c[6]!==d?(a={openSubscriptionErrorModal:d,closeSubscriptionErrorModal:u,SUBSCRIPTION_ERROR_MODAL_ID:v},c[5]=u,c[6]=d,c[7]=a):a=c[7],a}],213045);var E=e.i(601445);e.s(["resolveProductPurchaseOption",0,({selectedProduct:e,subscription:t})=>{var i;let r=(e.variation.purchaseOptions??e.product.purchaseOptions??[]).filter(e=>"onetime"!==e.key&&e.isEnable),{supplyMonths:s}=(0,E.getSubscriptionCadence)(t),a=r.find(e=>(e.supplyMonths??1)===s),n=s>1&&!a;return{subscriptionSupplyMonths:s,hasFrequencyMismatch:n,selectedPurchaseOptionKey:a?.key??r.find(e=>e.isDefault)?.key??r[0]?.key??null,cadenceOverrideSkus:(!(i=a?.variationSkuOverride)?[]:Array.isArray(i)?i:[i]).filter(t=>t.combinationName===e.variation.combinationName&&!!t.overrideSku?.trim()).map(e=>e.overrideSku)}}],194645)},864780,e=>{"use strict";var t=e.i(287106);e.s(["resolveSubscriptionLineItem",0,({line:e})=>{let i=e.productData?(0,t.resolveVariationSelectionBySku)({variations:e.productData.variations,productPurchaseOptions:e.productData.purchaseOptions,overrideSkuPricing:e.productData.overrideSkuPricing,sku:e.item.id.unicity}):null,r=i?.baseVariation,s=r?.combinationName;return{variation:r,variationFlavor:s,productName:e.productData?.name||e.catalogSlide?.content.description||e.item.id.unicity}}])}]);

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.