1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6626],{70790:function(e,r,i){i.d(r,{g:function(){return u},o:function(){return j}});var n=i(85893),a=i(64487),t=i(8545),l=i(67294),o=i(41686),c=i(4621),s=i(47010),d=i(68353);let u=(e,r)=>{let i="usd"===e.toLowerCase()?"$":"\xa3";return{price:(0,s.xG)(void 0,r,!0),currency:i}},p=o.default.button.withConfig({componentId:"sc-1c7794d0-0"})(["position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;cursor:pointer;border:none;background:none;padding:0;border-radius:inherit;pointer-events:none;"]),h=o.default.div.withConfig({componentId:"sc-1c7794d0-1"})(["position:relative;z-index:1;user-select:text;pointer-events:auto;"]),g=[],m=e=>{switch(e.type){case"percentage":return"".concat(e.value,"% cheaper");case"fixed":return"Save ".concat(e.money.currency).concat(e.money.price,"/mo")}},j=e=>{var r,i;let{currentPrice:o,switchOptions:s,onRetry:u,onConfirm:j,setIsChangePlanModalOpen:y,termsUrl:f,config:x}=e,[v,b]=(0,l.useState)(null),[w,k]=(0,l.useState)(!1),[C,I]=(0,l.useState)(!1),S=(0,d.U)(),P="ready"===s.status?s.options:g,z=(0,l.useMemo)(()=>{if(!o)return null;try{return x.buildDisplayModel(o,P)}catch(e){return console.error("Error building plan display model:",e),a.Tb(e),null}},[o,P,x]),M=null==z?void 0:z.currentPlan,B=null!==(r=null==z?void 0:z.options)&&void 0!==r?r:[],L=null!==(i=B.find(e=>e.priceLookupKey===v))&&void 0!==i?i:null,T="ready"===s.status&&null===s.reason&&B.length>0,K="error"===s.status,X=(0,l.useCallback)(async()=>{if(L){S("change-plan-confirmed-".concat(x.originProductType)),k(!0);try{await j(L.priceLookupKey),y(!1)}catch(e){console.error("Error confirming plan change:",e),a.Tb(e)}finally{k(!1)}}},[L,j,y,x.originProductType]),A=(0,l.useCallback)(e=>{S("select-plan-option-".concat(e.planOptionId,"-").concat(x.originProductType)),b(e.priceLookupKey)},[x.originProductType]),F=(0,l.useCallback)(()=>{S("change-plan-modal-retry-".concat(x.originProductType)),u()},[S,x.originProductType,u]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.j9,{align:"center",weight:"semiBold",variant:"fluid-paragraph-400",testId:"change-plan-modal-title",children:"Change plan"}),(0,n.jsx)(t.Sf,{size:24,direction:"vertical"}),M&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",testId:"change-plan-modal-your-plan",children:"Your plan"}),(0,n.jsx)(t.Sf,{size:12,direction:"vertical"}),(0,n.jsx)(t.km,{borderWidth:1,borderColor:"default",padding:16,radius:16,children:(0,n.jsxs)(t.MX,{direction:"column",gap:12,width:"100%",children:[M.savingsBadge&&(0,n.jsx)(t.MX,{direction:"row",justifyContent:"flex-start",children:(0,n.jsx)(t.jA,{surfaceColor:"yellow-bold",textColor:"primary",size:"regular",testId:"change-plan-modal-current-plan-savings-badge",children:m(M.savingsBadge)})}),(0,n.jsxs)(t.MX,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[(0,n.jsxs)(t.MX,{direction:"column",gap:4,children:[(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",weight:"semiBold",testId:"change-plan-modal-current-plan-name",children:M.name}),M.billingDetail&&(0,n.jsx)(t.j9,{variant:"fluid-label-100",color:"secondary",testId:"change-plan-modal-current-plan-billing-detail",children:M.billingDetail})]}),(0,n.jsxs)(t.MX,{direction:"row",alignItems:"center",gap:4,children:[M.originalPrice&&(0,n.jsxs)(t.j9,{as:"s",variant:"fluid-paragraph-300",weight:"semiBold",color:"placeholder",testId:"change-plan-modal-current-plan-original-price",children:[M.originalPrice.currency,M.originalPrice.price]}),(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",weight:"semiBold",testId:"change-plan-modal-current-plan-price",children:M.price})]})]})]})}),(0,n.jsx)(t.Sf,{size:24,direction:"vertical"})]}),K?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.j9,{variant:"fluid-paragraph-200",color:"secondary",testId:"change-plan-modal-error",children:"We couldn't load your subscription options. Please try again."}),(0,n.jsx)(t.Sf,{size:16,direction:"vertical"}),(0,n.jsx)(t.BM,{testId:"change-plan-modal-retry-button",onPress:F,width:"full",variant:"secondary",size:"large",children:"Try again"})]}):T?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",testId:"change-plan-modal-subscription-options-title",children:"Your subscription options:"}),(0,n.jsx)(t.Sf,{size:12,direction:"vertical"}),B.map((e,r)=>{let i=(null==L?void 0:L.priceLookupKey)===e.priceLookupKey;return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsxs)(t.km,{surfaceColor:"cream-subtle",padding:16,radius:16,borderWidth:i?3:0,borderColor:i?"focused-alt":void 0,testId:"change-plan-modal-option-".concat(e.priceLookupKey),children:[(0,n.jsx)(p,{type:"button",onClick:()=>A(e),"aria-label":"Select ".concat(e.name," plan")}),(0,n.jsx)(h,{onClick:()=>A(e),children:(0,n.jsxs)(t.MX,{direction:"column",gap:16,children:[e.savingsBadge&&(0,n.jsx)(t.MX,{direction:"row",justifyContent:"flex-start",children:(0,n.jsx)(t.jA,{surfaceColor:"yellow-bold",textColor:"primary",size:"regular",testId:"change-plan-modal-savings-badge-".concat(e.priceLookupKey),children:m(e.s
1avingsBadge)})}),(0,n.jsxs)(t.MX,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",width:"100%",children:[(0,n.jsxs)(t.MX,{direction:"row",alignItems:"flex-start",gap:8,children:[(0,n.jsx)(t.ie,{name:i?"radio-selected":"radio-unselected",size:24,color:"primary"}),(0,n.jsxs)(t.MX,{direction:"column",gap:4,children:[(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",weight:"semiBold",color:"primary",testId:"change-plan-modal-option-name-".concat(e.priceLookupKey),children:e.name}),(0,n.jsx)(t.j9,{variant:"fluid-label-100",color:"secondary",children:e.subtitle})]})]}),(0,n.jsxs)(t.MX,{direction:"row",alignItems:"center",gap:4,children:[e.originalPrice&&(0,n.jsxs)(t.j9,{as:"s",variant:"fluid-paragraph-200",weight:"regular",color:"placeholder",testId:"change-plan-modal-option-original-price-".concat(e.priceLookupKey),children:[e.originalPrice.currency,e.originalPrice.price]}),(0,n.jsx)(t.j9,{variant:"fluid-paragraph-300",weight:"semiBold",color:"primary",testId:"change-plan-modal-option-price-".concat(e.priceLookupKey),children:e.price})]})]})]})})]}),r<B.length-1&&(0,n.jsx)(t.Sf,{size:12,direction:"vertical"})]},e.priceLookupKey)})]}):(0,n.jsx)(t.j9,{variant:"fluid-paragraph-200",color:"secondary",testId:"change-plan-modal-options-unavailable",children:"There are no other plans available for this subscription right now. Please contact support if you think this is wrong."}),T&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.Sf,{size:12,direction:"vertical"}),(0,n.jsxs)(t.j9,{variant:"fluid-paragraph-200",color:"secondary",children:[(null==z?void 0:z.requiresAgreementCheckbox)?"Price before sales tax. ":"","Any existing discounts or coupons you have will be applied automatically."]}),(null==z?void 0:z.requiresAgreementCheckbox)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.Sf,{size:12,direction:"vertical"}),(0,n.jsx)(t.WL,{id:"plan-change-agreement",label:"By changing your plan, you agree that your subscription will automatically renew until cancelled, at the interval you have selected",onChange:I,testId:"change-plan-agreement-checkbox"})]}),(0,n.jsx)(t.Sf,{size:24,direction:"vertical"}),(0,n.jsx)(t.BM,{testId:"change-plan-confirm-button",onPress:X,width:"full",variant:"primary",size:"large",isDisabled:!L||w||!!(null==z?void 0:z.requiresAgreementCheckbox)&&!C,children:"Confirm"})]}),(0,n.jsx)(t.Sf,{size:16,direction:"vertical"}),(0,n.jsx)(t.BM,{onPress:()=>{S("change-plan-modal-cancel-".concat(x.originProductType)),y(!1)},width:"full",variant:"tertiary",size:"small",children:(0,n.jsx)(t.j9,{variant:"fluid-paragraph-200",weight:"semiBold",color:"link",children:"Cancel"})}),(0,n.jsx)(t.Sf,{size:24,direction:"vertical"}),(0,n.jsxs)(t.j9,{align:"center",variant:"fluid-label-100",color:"primary",children:["Read our"," ",(0,n.jsx)(c.A,{href:f,target:"_blank",style:{color:"inherit",textDecoration:"underline"},children:"Terms of Service"})]})]})}},85743:function(e,r,i){i.d(r,{F:function(){return o}});var n=i(64487),a=i(67294),t=i(93591),l=i(33176);function o(){let{authenticatedUser:e}=(0,l.s)(),[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(!0),[s,d]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{if(d(null),i(null),c(!0),!e||e.isAnonymous){d("User not authenticated");return}let r=await (0,t.dy)(e);i(r),c(!1)}catch(e){n.Tb(e),d("Service is currently unavailable. Please contact Customer Support."),c(!1)}finally{c(!1)}},[e]);return(0,a.useEffect)(()=>{e&&!e.isAnonymous&&u()},[u,e]),{paymentPortalUrl:r,isLoading:o,error:s}}}}]); 2//# sourceMappingURL=6626-610f4bff456a18c8.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.