const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/KeepPlayingUpsellPage-e4oys5x9.js","assets/rolldown-runtime-nx40z1zs.js","assets/entry.client-mpghtlrl.js","assets/responsive-toolkit-jup4yedr.js","assets/gamepad-nav-virtual-lh6mhh03.js","assets/xds-react-components-ihgca01z.js","assets/xds-icons-m106f2fc.js","assets/workspace-leaf-files-oergw4h0.js","assets/usePlanPickerProps-ovsyok80.js","assets/determineUpsells-munlya5p.js","assets/PostStreamUpsell-frbpu6bq.js","assets/DialogShell-ga7ic6wy.js","assets/accelerators-mediz1dj.js","assets/navigation-stack-h7n8tudn.js","assets/DialogShellContext-grfsno45.js","assets/UpsellBackgroundImage-g7tl5l2r.js","assets/useAutoFocusOnNavigation-jozowuvg.js","assets/useLocation-gval357w.js","assets/UpgradeAccountUpsellPage-ic1stpkz.js","assets/auth-hooks-dkb6uyrd.js"])))=>i.map(i=>d[i]);
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]=`5b0f42a7-6778-43a9-a78d-0c39db5f7a8f`,e._sentryDebugIdIdentifier=`sentry-dbid-5b0f42a7-6778-43a9-a78d-0c39db5f7a8f`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,Lh as n,Qm as r,Xi as i,Yh as a,Zm as o,bi as s,fp as c,jg as l,ng as u,op as d,pi as f,si as p,ui as m,up as h,yt as g}from"./entry.client-mpghtlrl.js";import{en as _}from"./workspace-leaf-files-oergw4h0.js";import{n as v}from"./DialogShell-ga7ic6wy.js";var y=e(l(),1),b=t(),x=e(f(),1),S=d.dialog.trialsEnded,C={keepPlaying:S.keepPlaying.fullPath,upgradeAccount:S.upgradeAccount.fullPath},w=!1;function T(){if(w)return;w=!0;let e=d.dialog.trialsEnded;e.keepPlaying.update({component:i(()=>n(()=>import(`./KeepPlayingUpsellPage-e4oys5x9.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])),`KeepPlayingUpsellPage`)}),e.upgradeAccount.update({component:i(()=>n(()=>import(`./UpgradeAccountUpsellPage-ic1stpkz.js`),__vite__mapDeps([18,1,2,3,4,5,6,7,19,11,12,13,14,15,16,17])),`UpgradeAccountUpsellPage`)})}var E=(0,y.createContext)(null),D=u(),O=()=>{let e=(0,b.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(h,{}),e[0]=t):t=e[0],t};T();var k=(0,x.default)(`bg-container-backgrounds-elevation-background-level-2`),A=g(k,`w-component-upsell-modal-modal-width-hd`,`modal-generic`,`modal-floating`),j=g(k,`h-full`,`w-full`),M=e=>{let t=(0,b.c)(33),{productId:n,initialPage:i,onClose:l}=e,{dialog:u}=o(),{trackUserAction:d}=r(),f;t[0]===u.mutations.goBack?f=t[1]:(f=u.mutations.goBack.getOptions(),t[0]=u.mutations.goBack,t[1]=f);let{mutate:h}=a(f),g=c(),x=i===`upgradeAccount`?C.upgradeAccount:C.keepPlaying,S=u.keys.trialsEnded.fullPath,w,T;t[2]!==g||t[3]!==x||t[4]!==n||t[5]!==i?(w=()=>{g({to:x,replace:!0,search:{productId:n,initialPage:i}})},T=[g,x,n,i],t[2]=g,t[3]=x,t[4]=n,t[5]=i,t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,y.useEffect)(w,T);let k;t[8]!==d||t[9]!==n||t[10]!==S||t[11]!==h||t[12]!==l?(k=e=>{d(`TrialsEndedDialogCompleted`,{completionReason:e,productId:n},`Press`,{location:`TrialsEndedDialog`}),d(`CloseModal`,{modalType:S,dismissMethod:`sideEffect`},`Press`,{location:`TrialsEndedDialog`}),h(),l?.(e)},t[8]=d,t[9]=n,t[10]=S,t[11]=h,t[12]=l,t[13]=k):k=t[13];let M=k,N;t[14]!==d||t[15]!==n||t[16]!==l?(N=()=>{d(`TrialsEndedDialogCompleted`,{completionReason:_.Dismissed,productId:n},`Press`,{location:`TrialsEndedDialog`}),l?.(_.Dismissed)},t[14]=d,t[15]=n,t[16]=l,t[17]=N):N=t[17];let P=N,F,I;t[18]!==M||t[19]!==n||t[20]!==i?(I={complete:M,productId:n,initialPage:i},t[18]=M,t[19]=n,t[20]=i,t[21]=I):I=t[21],F=I;let L=F,R=v.useComponent(),z=s()===`high`,B=z?A:j,V,H;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(V={opacity:0,transform:`scale(0.75)`},H={opacity:1,transform:`scale(1)`},t[22]=V,t[23]=H):(V=t[22],H=t[23]);let U;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(m,{initial:V,animate:H,transition:p,className:`h-full w-full bg-container-backgrounds-elevation-background-level-2`,children:(0,D.jsx)(O,{})}),t[24]=U):U=t[24];let W;t[25]!==R||t[26]!==B||t[27]!==z||t[28]!==P?(W=(0,D.jsx)(R,{className:B,dismissable:!0,dimBackground:!0,autoHeight:z,onWillClose:P,children:U}),t[25]=R,t[26]=B,t[27]=z,t[28]=P,t[29]=W):W=t[29];let G;return t[30]!==L||t[31]!==W?(G=(0,D.jsx)(E.Provider,{value:L,children:W}),t[30]=L,t[31]=W,t[32]=G):G=t[32],G};export{M as TrialsEndedDialog,M as default,C as n,E as t};