try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`de9ba754-3dde-4a8c-94d4-cc1e2616f1b9`,e._sentryDebugIdIdentifier=`sentry-dbid-de9ba754-3dde-4a8c-94d4-cc1e2616f1b9`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Ai as r,Ct as i,Hm as a,Pt as o,Qm as s,jg as c,ng as l,xr as u}from"./entry.client-mpghtlrl.js";import{pt as d}from"./xds-react-components-ihgca01z.js";import{n as f,r as p}from"./purchasePageReadyUtils-h1z511qr.js";import{c as m}from"./PurchaseDialog-fpui7yuh.js";var h=n(),g=e(c(),1),_=l(),v=e=>{let n=(0,h.c)(32),{t:i}=t(`SubscriptionUpgradeButtonPanel`),{locCancel:o,locContinue:c}=a(),{trackUserAction:l}=s(),d;n[0]!==l||n[1]!==e.confirm?(d=()=>{l(`ConfirmButton`,{},`Press`,{location:`SubscriptionUpgrade`}),e.confirm?.()},n[0]=l,n[1]=e.confirm,n[2]=d):d=n[2];let f=d,p;n[3]!==l||n[4]!==e.learnMoreUri?(p=()=>{l(`LearnMoreButton`,{learnMoreLink:e.learnMoreUri},`Press`,{location:`SubscriptionUpgrade`}),window.open(e.learnMoreUri,`_blank`)},n[3]=l,n[4]=e.learnMoreUri,n[5]=p):p=n[5];let m=p,g;n[6]!==l||n[7]!==e.cancel?(g=()=>{l(`CancelButton`,{},`Press`,{location:`SubscriptionUpgrade`}),e.cancel?.()},n[6]=l,n[7]=e.cancel,n[8]=g):g=n[8];let v=g,y=!e.confirm,b;n[9]===c?b=n[10]:(b=c(),n[9]=c,n[10]=b);let x;n[11]!==f||n[12]!==y||n[13]!==b?(x=(0,_.jsx)(u,{as:`button`,kind:`brand`,onPress:f,isDisabled:y,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V21D)]`,"data-auto-focus":!0,children:b}),n[11]=f,n[12]=y,n[13]=b,n[14]=x):x=n[14];let S=!e.cancel,C;n[15]===o?C=n[16]:(C=o(),n[15]=o,n[16]=C);let w;n[17]!==v||n[18]!==S||n[19]!==C?(w=(0,_.jsx)(u,{as:`button`,kind:`standard`,onPress:v,isDisabled:S,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V21D)]`,children:C}),n[17]=v,n[18]=S,n[19]=C,n[20]=w):w=n[20];let T=!e.learnMoreUri,E;n[21]!==e.learnMoreText||n[22]!==i?(E=e.learnMoreText||i(`Learn more`,{shortKey:`learn_more_button_text`}),n[21]=e.learnMoreText,n[22]=i,n[23]=E):E=n[23];let D;n[24]!==m||n[25]!==T||n[26]!==E?(D=(0,_.jsx)(u,{as:`button`,kind:`standard`,onPress:m,isDisabled:T,size:`standard`,className:`w-full grow lg-10:min-w-[var(--V21D)]`,children:E}),n[24]=m,n[25]=T,n[26]=E,n[27]=D):D=n[27];let O;return n[28]!==x||n[29]!==w||n[30]!==D?(O=(0,_.jsx)(r,{location:`SubscriptionUpgradeButtonPanel`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-layout-horizontal-gap sm-10:flex-row`,children:[x,w,D]})}),n[28]=x,n[29]=w,n[30]=D,n[31]=O):O=n[31],O},y=e=>{let{trackAppAction:n}=s(),{t:r}=t(`SubscriptionUpgrade`);f(e.onPurchasePageReady),(0,g.useEffect)(()=>{e.timeToInteractiveSpan?.end()},[e.timeToInteractiveSpan]),(0,g.useEffect)(()=>{n(`ShowSubscriptionUpgradeInterstitial`,{productId:e.productId},{location:`SubscriptionUpgrade`})},[n,e.productId]);let a=e.body.join(`

`);return e.newRenewalDate&&(a=a.replace(`{0}`,new Date(e.newRenewalDate).toLocaleDateString())),(0,_.jsxs)(m,{children:[(0,_.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight shrink-0`,children:[(0,_.jsx)(`h1`,{className:`mb-layout-vertical-title-and-row-regular text-2xl font-semibold text-noninteractive-content-primary-content`,children:r(`Subscribe`,{shortKey:`subscription_upgrade_header`})}),(0,_.jsx)(`h2`,{className:`type-subtitle1`,children:r(`You're changing your plan:`,{shortKey:`subscription_upgrade_subheader`})})]}),(0,_.jsx)(`div`,{className:`shrink-0 px-layout-vertical-related-content-in-a-section-tight`,children:(0,_.jsx)(d,{variant:`subtle`,className:`w-full`})}),(0,_.jsxs)(`div`,{className:`m-layout-vertical-related-content-in-a-section-tight flex flex-col gap-internal-gap-regular`,children:[(0,_.jsxs)(`div`,{className:`mb-internal-gap-regular flex items-center gap-internal-icon-and-text-gap-action-separator text-2xl font-semibold`,children:[(0,_.jsx)(o,{src:e.poster?.url,alt:e.title,className:`max-w-[96px] rounded`,aspectRatio:p(e.poster?.width,e.poster?.height)||`1/1`,getResizedImageUrl:i,constraintSet:{entries:[{query:`LG_10`,size:{width:96},imageType:`jpg`}],defaultEntry:{size:{width:96},imageType:`jpg`}}}),e.title]}),(0,_.jsx)(`div`,{className:`min-w-0`,children:(0,_.jsx)(`p`,{className:`text-noninteractive-content-primary-content`,children:a})}),(0,_.jsx)(`div`,{className:`pt-internal-gap-regular`,children:(0,_.jsx)(v,{confirm:e.confirm,cancel:e.exit,learnMoreUri:e.learnMoreUri,learnMoreText:e.learnMoreButtonText})})]})]})};export{y as default};