1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1810],{59507:(t,e,n)=>{n.d(e,{kl:()=>r,A0:()=>i,wk:()=>p});var i=function(t){return t.REGISTER="RegisterStep",t.SUBSCRIPTION_SUMMARY="SubscriptionSummaryStep",t.SUBSCRIPTION_PAYMENT="SubscriptionPaymentStep",t.CONTENT="ContentStep",t}({}),r=function(t){return t.EXIT_FORM="EXIT_FORM",t.FINISH_FORM="FINISH_FORM",t.NEXT="NEXT",t.PREVIOUS="PREVIOUS",t.AUTH_CHANGED="AUTH_CHANGED",t}({}),a=n(55729),s=n(6396),l=n(76684),u=function(t){return t.IS_STEP_BEFORE_REGISTER="IS_STEP_BEFORE_REGISTER",t.IS_STEP_AFTER_REGISTER="IS_STEP_AFTER_REGISTER",t.IS_STEP_REGISTER="IS_STEP_REGISTER",t.IS_AUTHENTICATED="IS_AUTHENTICATED",t.IS_NOT_AUTHENTICATED="IS_NOT_AUTHENTICATED",t}({}),o=n(51510),c=n(70703),d=n(8444);let p=t=>{let{steps:e,setupConfig:n=d.MlF}=t;return{machine:(0,a.useMemo)(()=>{var t;return(0,s.mj)({...n,types:{...(null==n?void 0:n.types)||{},context:{},events:{},input:{}},guards:{...(null==n?void 0:n.guards)||{},IS_AUTHENTICATED:t=>{let{context:e}=t;return e.isAuthenticated},IS_NOT_AUTHENTICATED:t=>{let{context:e}=t;return!e.isAuthenticated},IS_STEP_AFTER_REGISTER:t=>{let{context:e}=t;return e.currentStepIndex>e.registerStepIndex},IS_STEP_BEFORE_REGISTER:t=>{let{context:e}=t;return e.currentStepIndex<e.registerStepIndex},IS_STEP_REGISTER:t=>{let{context:e}=t;return e.currentStepIndex===e.registerStepIndex}}}).createMachine({context:t=>{let{input:e}=t;return{isAuthenticated:e.isAuthenticated}},id:"generic-funnel",predictableActionArguments:!0,initial:e.length?null==(t=e[0])?void 0:t.uid:void 0,states:(t=>{let{steps:e}=t,n={},a=new Set,s=e.findIndex(t=>{let{type:e}=t;return e===i.REGISTER});if(-1===s)throw Error("buildStates: no REGISTER step found in steps array");return e.forEach((t,i)=>{let{uid:d}=t;if(a.has(d))throw Error("buildStates: duplicate step uid detected: ".concat(d));a.add(d);let p=i===e.length-1,E=0===i?null:e[i-1].uid,w=p?null:e[i+1].uid;n[d]={always:[{guard:(0,o.j)([u.IS_NOT_AUTHENTICATED,u.IS_STEP_AFTER_REGISTER]),target:e[s].uid},{guard:(0,o.j)([u.IS_AUTHENTICATED,(0,o.o)([u.IS_STEP_BEFORE_REGISTER,u.IS_STEP_REGISTER])]),target:w}],entry:[(0,l.a)(()=>({currentStepIndex:i,currentStep:{type:t.type,uid:t.uid,trackingData:t.trackingData},registerStepIndex:s})),t=>{var e;let{context:n}=t;(0,c.sx)({type:"LFPageView",data:null!=(e=n.currentStep.trackingData)?e:{}})}],on:{[r.NEXT]:w?{target:w,actions:[r.NEXT]}:{actions:[r.FINISH_FORM]},[r.PREVIOUS]:E?{target:E,actions:[r.PREVIOUS]}:{actions:[r.EXIT_FORM]}}}}),n})({steps:e}),on:{[r.AUTH_CHANGED]:{actions:(0,l.a)(t=>{let{event:e}=t;return{isAuthenticated:e.payload.isAuthenticated}})}}})},[e,n])}}},61810:(t,e,n)=>{n.r(e),n.d(e,{default:()=>T});var i=n(6029),r=n(92275),a=n(30568),s=n(35133),l=n(59507),u=n(60750),o=n(44843),c=n(42043),d=n(42278),p=n(76029);let E=t=>{var e,n,E;let{prismicContent:w,props:S,withSavingsTextImage:T}=t,{setEditorialPanelSourceUid:I}=(0,u.vc)(),{size:m}=(0,o.s)(),_=(0,c.useTranslations)("SubscriptionFunnel.Flow"),{image:x,title:R,text:h,cta_label:g,tooltip_link:N}=w.primary,{savings:f}=(0,p.O)();return(0,i.jsx)("section",{"data-slice-type":w.slice_type,"data-slice-variation":w.variation,className:"tw-flex tw-flex-1 tw-pt-8 desktop:tw-py-9",children:(0,i.jsxs)("div",{className:"tw-mx-auto tw-flex tw-flex-1 tw-flex-col tw-items-center tw-justify-between desktop:tw-justify-start",children:[(0,i.jsxs)("div",{className:"tw-mb-10 tw-flex tw-max-w-[600px] tw-flex-col tw-items-center tw-px-2 desktop:tw-px-12",children:[x&&(0,i.jsxs)("div",{className:"tw-relative tw-mb-10 tw-max-w-[320px] desktop:tw-max-w-[420px]",children:[(0,i.jsx)(r.A,{width:null==(e=x.dimensions)?void 0:e.width,height:null==(n=x.dimensions)?void 0:n.height,src:x.url,alt:null!=(E=x.alt)?E:""}),T&&(0,i.jsx)("div",{className:"tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-pt-[33%] desktop:tw-pt-[38%]",children:(0,i.jsxs)("h2",{className:"tw-flex tw-flex-col tw-items-center tw-text-center",children:[(0,i.jsx)("span",{className:"tw-lf-title tw-text-8xl",children:(0,d.GP)(Math.abs(12*f),{maximumFractionDigits:0})}),(0,i.jsx)("span",{className:"tw-lf-title tw-text-[40px]",children:_("SavingsCalculatorStep.annually")})]})})]}),(0,i.jsx)("h2",{className:"tw-lf-title tw-lf-title-sm tw-mb-2 tw-text-center tw-leading-[130%] desktop:tw-lf-title-lg",children:R}),(0,i.jsxs)("span",{className:"tw-inline tw-text-center tw-leading-[150%]",children:[null==h?void 0:h.replace(/%HOUSEHOLD_SIZE%/g,_("HouseholdSizeSelectorStep.people",{size:m})),N&&(0,i.jsx)("button",{type:"button",className:"tw-lf-button-ghost tw-z-30 tw-ml-2 tw-w-4 tw-cursor-pointer tw-transition tw-duration-300 tw-ease-in-out hover:tw-opacity-60",onClick:()=>I(N.uid),children:(0,i.jsx)("span",{className:"tooltip-icon tw-text-black-1000 [&_svg]:tw-align-top",children:(0,i.jsx)(a.A,{size:s.y3.sm,"aria-hidden":!0})})})]})]}),(0,i.jsx)("div",{className:"tw-fixed tw-bottom-0 tw-w-full tw-px-3 tw-pb-3 desktop:tw-relative desktop:tw-py-0",children:(0,i.jsx)("button",{className:"tw-lf-button tw-lf-button-primary tw-lf-button-md tw-w-full desktop:tw-lf-button-lg desktop:tw-mx-auto desktop:tw-w-fit",onClick:()=>{var t;null==S||null==(t=S.actor)||t.send({type:l.kl.NEXT})},"data-testid":"ContentStepSlice-Button-next",children:g})})]})})},w=t=>{let{prismicContent:e,props:n}=t;return(0,i.jsx)(E,{prismicContent:e,props:n,withSavingsTextImage:!1})},S=t=>{let{prismicContent:e,props:n}=t;return(0,i.jsx)(E,{prismicContent:e,props:n,withSavingsTextImage:!0})},T=t=>{let{prismicContent:e,props:n,...r}=t;return"withSavingsTextImage"===e.variation?(0,i.jsx)(S,{prismicContent:e,props:n,...r}):(0,i.jsx)(w,{prismicContent:e,props:n,...r})}},76029:(t,e,n)=>{n.d(e,{O:()=>E});var i=n(44843),r=n(60750),a=n(8444),s=n(57503),l=n(32448),u=n(67827),o=n(55729),c=n(81278),d=n(82882),p=n(42278);let E=()=>{let{locale:t}=(0,c.useRouter)(),{channel:e}=(0,d.A)(),{size:n}=(0,i.s)(),E=(0,r.Br)(...a.gmG),[w,S]=(0,o.useState)([]),[T,I]=(0,o.useState)({nonMemberTotal:0,total:0}),m=(0,o.useMemo)(()=>(0,l.p$)(Object.keys(E).map(t=>{let e=Number(t);return(0,u.Et)(e)?e:void 0})),[E]),_=(0,o.useMemo)(()=>m.includes(n)?E[n]:null,[m,n]);return(0,o.useEffect)(()=>{(async()=>{var n;if(!_)return;let i=(await s.zv.getDocumentByUid("average_product_basket",_,void 0,t?{lang:"".concat(t,"-").concat(t)}:{})).data;if(!(null==i||null==(n=i.products)?void 0:n.length))return;let r=i.products.map(t=>{let{sku:e}=t;return e}),{productsWithQuantities:a,nonMemberTotal:u,total:o}=(await s.jU.getProductsBySku(r,e,!1)).reduce((t,e)=>{let n=i.products.find(t=>{let{sku:n}=t;return n===e.sku});if(!n)return t;let r=Number(n.product_quantity),{price:a,compareAtPrice:s}=(0,p.OS)({price:e.price,compare_at_price:e.compare_at_price,tags:e.tags,meta:e.meta},1);return t.nonMemberTotal+=r*s,t.total+=r*a,t.productsWithQuantities.push({...e,quantity:r,membershipPriceSubtotal:a*r}),t},{productsWithQuantities:[],nonMemberTotal:0,total:0});S((0,l.p$)(a)),I({nonMemberTotal:u,total:o})})()},[_,t,e]),{householdSizes:m,products:w,prices:T,savings:T.total-T.nonMemberTotal}}}}]); 2//# sourceMappingURL=1810.645f8f9ef2acfae2.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.