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]=`0b52cf3e-0a43-49aa-8b5a-09747c8d122d`,e._sentryDebugIdIdentifier=`sentry-dbid-0b52cf3e-0a43-49aa-8b5a-09747c8d122d`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{$d as t,Ag as n,Fg as r,Ig as i,Jl as a,Wn as o,ch as s,dn as c,eh as l,hn as u,lh as d,rh as f,sh as p,st as m,wg as h}from"./entry.client-dr7r6s9a.js";import{n as g}from"./responsive-toolkit-nc72eouk.js";import{An as _}from"./xds-icons-d7khcnpi.js";import{t as v}from"./usePlanPickerProps-kd3toy2t.js";import{t as y}from"./PostStreamUpsell-bhkh2447.js";import{t as b}from"./routes-ewiustbc.js";import{t as x}from"./TrialsEndedDialog.types-n8gsn59q.js";import{n as S,t as C}from"./useAutoFocusOnNavigation-gd2bn98v.js";var w=e(i(),1),T=r(),E=n(),D=e=>{let t=(0,T.c)(3),{label:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,E.jsx)(o,{size:`title4`,icon:(0,E.jsx)(_,{}),className:`text-noninteractive-content-primary-content`,"aria-hidden":`true`},`TrialLocked`),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,E.jsxs)(`div`,{className:`flex items-center gap-internal-icon-and-text-gap-regular rounded-regular border-item-visible-container-default-border-rest bg-container-backgrounds-overlay-scrim-dense p-internal-container-padding-borderless-tight`,children:[r,(0,E.jsx)(`span`,{className:`text-noninteractive-content-primary-content type-label`,children:n})]}),t[1]=n,t[2]=i),i},O=e=>{let t=(0,T.c)(37),{primaryProductId:n,isFullySignedIn:r,onGetGamePassPress:i,onUpgradeAccountPress:a,onOtherWaysToPlayPress:o}=e,s=y.useComponent(),{t:c}=d(`TrialsEndedDialog`),{locTrialEnded:f}=l(),p;t[0]===c?p=t[1]:(p=c(`Keep playing with Game Pass`,{shortKey:`keep_playing_title`}),t[0]=c,t[1]=p);let m=p,h;t[2]===c?h=t[3]:(h=c(`Get unlimited cloud gaming and access to hundreds of games`,{shortKey:`keep_playing_description`}),t[2]=c,t[3]=h);let g=h,_;t[4]===f?_=t[5]:(_=f(),t[4]=f,t[5]=_);let v=_,b;t[6]===c?b=t[7]:(b=c(`Get Game Pass`,{shortKey:`get_game_pass_button`}),t[6]=c,t[7]=b);let x=b,S;t[8]===c?S=t[9]:(S=c(`Skip for now`,{shortKey:`skip_for_now_button`}),t[8]=c,t[9]=S);let C=S,w;t[10]===c?w=t[11]:(w=c(`Other ways to play`,{shortKey:`other_ways_to_play_button`}),t[10]=c,t[11]=w);let O=w,k,A;t[12]!==i||t[13]!==x?(A=(0,E.jsx)(u,{"data-auto-focus":!0,className:`max-w-[var(--V1UO)]`,as:`button`,kind:`brand`,onPress:i,children:x},`getGamePass`),t[12]=i,t[13]=x,t[14]=A):A=t[14];let j;if(t[15]!==A||t[16]!==r||t[17]!==o||t[18]!==O||t[19]!==a||t[20]!==C){if(j=[A],r){let e;t[22]!==o||t[23]!==O?(e=(0,E.jsx)(u,{className:`max-w-[var(--V1UO)]`,as:`button`,kind:`standard`,onPress:o,children:O},`otherWaysToPlay`),t[22]=o,t[23]=O,t[24]=e):e=t[24],j.push(e)}else{let e;t[25]!==a||t[26]!==C?(e=(0,E.jsx)(u,{className:`max-w-[var(--V1UO)]`,as:`button`,kind:`standard`,onPress:a,children:C},`skipForNow`),t[25]=a,t[26]=C,t[27]=e):e=t[27],j.push(e)}t[15]=A,t[16]=r,t[17]=o,t[18]=O,t[19]=a,t[20]=C,t[21]=j}else j=t[21];k=j;let M=k,N;t[28]===v?N=t[29]:(N=(0,E.jsx)(D,{label:v}),t[28]=v,t[29]=N);let P;return t[30]!==s||t[31]!==n||t[32]!==m||t[33]!==g||t[34]!==M||t[35]!==N?(P=(0,E.jsx)(s,{variant:`single-tile`,primaryProductId:n,title:m,description:g,actionButtons:M,primaryTileOverlay:N}),t[30]=s,t[31]=n,t[32]=m,t[33]=g,t[34]=M,t[35]=N,t[36]=P):P=t[36],P},k=c(O,()=>{let e=(0,w.useContext)(x),n=S(),r=m(),{trackUserAction:i}=s(),{dialog:o}=p(),{mutate:c}=h(o.mutations.open.getOptions()),{isFullySignedIn:l}=f(),u=e?.productId??``,d=v(u),g=o.keys.subscriptionPlanPicker.fullPath;return{primaryProductId:u,isFullySignedIn:l,onGetGamePassPress:(0,w.useCallback)(()=>{i(`KeepPlayingUpsellInteraction`,{type:`GetGamePass`,productId:u},`Press`,{location:`KeepPlayingUpsellPage`}),e?.complete(a.OpenedPlanPicker),c({key:g,props:d})},[c,e,d,i,u,g]),onUpgradeAccountPress:(0,w.useCallback)(()=>{i(`KeepPlayingUpsellInteraction`,{type:`UpgradeAccount`,productId:u},`Press`,{location:`KeepPlayingUpsellPage`}),n(b.upgradeAccount)},[n,i,u]),onOtherWaysToPlayPress:(0,w.useCallback)(()=>{i(`KeepPlayingUpsellInteraction`,{type:`OtherWaysToPlay`,productId:u},`Press`,{location:`KeepPlayingUpsellPage`}),e?.complete(a.NavigatedToPDP),r(t.products.byProductId.$buildPath({params:{productId:u}}))},[e,r,u,i])}}),A=()=>{let e=(0,T.c)(5),t=k.useComponent(),n=g();C();let r,i;e[0]===n?(r=e[1],i=e[2]):(r=()=>{n?.()},i=[n],e[0]=n,e[1]=r,e[2]=i),(0,w.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a=(0,E.jsx)(t,{}),e[3]=t,e[4]=a),a};export{A as KeepPlayingUpsellPage,k as KeepPlayingUpsellPageConnection,O as PureKeepPlayingUpsellPage};