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]=`63b7ce7e-6ef7-4c38-b091-5d28ae4a097d`,e._sentryDebugIdIdentifier=`sentry-dbid-63b7ce7e-6ef7-4c38-b091-5d28ae4a097d`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Dg as n,Fg as r,Ig as i,dn as a,eh as o,lh as s,mr as c,or as l,ql as u,sh as d,th as f,wg as p,zp as m}from"./entry.client-dr7r6s9a.js";import{n as h}from"./auth-hooks-karaxdb8.js";import{s as g}from"./DialogShell-k2jpaw9r.js";import{t as _}from"./useEmitGameStreamDialogEvent-dljcy1v9.js";import{t as v}from"./useGameStreamProps-h4pgc81o.js";import{t as y}from"./useGameStreamDialogContext-ivl0rv5q.js";import{t as b}from"./PureInStreamConfirmationDialog-ivf23uic.js";var x=e(i(),1),S=r(),C=e=>{let t=(0,S.c)(10),{t:n}=s(`SignInRequiredDialog`),r;if(t[0]!==n||t[1]!==e){r=Symbol.for(`react.early_return_sentinel`);bb0:{let i=n(`This will link your latest saved game progress to a new account. Any unsaved progress may be lost. Using an existing account will not link your progress.`,{shortKey:`sign_in_required_dialog_saved_progress_note`});if(!e||e===u.Default){let e;t[3]===n?e=t[4]:(e=n(`Sign in to unlock this feature`,{shortKey:`sign_in_required_dialog_title`}),t[3]=n,t[4]=e);let a=e,o=n(`You need to sign in for further access. {savedProgressNote}`,{shortKey:`sign_in_required_dialog_description`,values:{savedProgressNote:i}}),s;t[5]!==a||t[6]!==o?(s={title:a,description:o},t[5]=a,t[6]=o,t[7]=s):s=t[7],r=s;break bb0}let a;t[8]===n?a=t[9]:(a=n(`Sign in required`,{shortKey:`xbox_account_required_dialog_title`}),t[8]=n,t[9]=a);let o=a;switch(e){case u.StoreProductPage:case u.StoreAssociatedProducts:r={title:o,description:n(`You need to sign in to view this information. {savedProgressNote}`,{shortKey:`xbox_account_required_product_page_or_associated_products_description`,values:{savedProgressNote:i}})};break bb0;case u.StorePurchase:r={title:o,description:n(`You need to sign in to buy or download. {savedProgressNote}`,{shortKey:`xbox_account_required_purchase_description`,values:{savedProgressNote:i}})};break bb0;case u.StoreRedeemToken:r={title:o,description:n(`You need to sign in to redeem your code. {savedProgressNote}`,{shortKey:`xbox_account_required_redeem_code_description`,values:{savedProgressNote:i}})};break bb0;case u.BillingSwitch:r={title:o,description:n(`You need to sign in to change payment options. {savedProgressNote}`,{shortKey:`xbox_account_required_billing_switch_description`,values:{savedProgressNote:i}})};break bb0;default:throw Error(`Unhandled scenario type: ${e}`)}}t[0]=n,t[1]=e,t[2]=r}else r=t[2];if(r!==Symbol.for(`react.early_return_sentinel`))return r},w=(0,e(l(),1).default)(`w-template-overlays-modal-size-small-width-compact`,`max-h-[90dvh]`,`sm-25:w-template-overlays-modal-size-medium-width-centered`,`xsl-10:w-template-overlays-modal-size-small-width-expanded`,`rounded-lg bg-container-backgrounds-elevation-background-level-2`),T=t(),E=e=>{let t=(0,S.c)(23),{onSignIn:n,onCancel:r,scenario:i}=e,{locSignInOrSignUp:a,locNeverMind:s}=o(),{title:c,description:l}=C(i),{onClose:u}=g(),{setDialogShellProps:d}=y(),f;t[0]===u?f=t[1]:(f=()=>{u(`closeButton`)},t[0]=u,t[1]=f);let p=f,m,h;t[2]!==c||t[3]!==l||t[4]!==r||t[5]!==d?(m=()=>{d({accessibleTitle:c,accessibleDescription:l,dismissable:!0,className:w,autoHeight:!0,onWillClose:r})},h=[l,c,r,d],t[2]=c,t[3]=l,t[4]=r,t[5]=d,t[6]=m,t[7]=h):(m=t[6],h=t[7]),(0,x.useEffect)(m,h);let _;t[8]===a?_=t[9]:(_=a(),t[8]=a,t[9]=_);let v;t[10]!==n||t[11]!==_?(v={onPress:n,label:_,kind:`brand`,as:`button`},t[10]=n,t[11]=_,t[12]=v):v=t[12];let E;t[13]===s?E=t[14]:(E=s(),t[13]=s,t[14]=E);let D;t[15]!==p||t[16]!==E?(D={onPress:p,label:E,as:`button`},t[15]=p,t[16]=E,t[17]=D):D=t[17];let O;return t[18]!==c||t[19]!==l||t[20]!==v||t[21]!==D?(O=(0,T.jsx)(b,{locTitle:c,locDescription:l,illustration:`unauthenticated`,button1Props:v,button2Props:D,showClose:!0,stackButtons:!0}),t[18]=c,t[19]=l,t[20]=v,t[21]=D,t[22]=O):O=t[22],O},D=a(E,()=>{let e=_(m.dialog.gameStream.signInRequired.fullPath,`cancel`),t=f().getLogger(`SignInRequiredDialog`),{returnUrl:r,scenario:i}=v(`signInRequired`)||{},{gameStream:a}=d(),{data:o}=n(a.queries.instance.getOptions()),{mutateAsync:s}=p(a.mutations.unblockNavigation),c=h({returnUrl:r});return{onSignIn:(0,x.useCallback)(async()=>{await s(),o||t.debug(`No game stream instance to shutdown`),o?.shutdownSession({reason:`SigningIn`,skipFeedback:!0}),c()},[o,t,c,s]),onCancel:e,scenario:i}}),O=c(()=>(0,T.jsx)(D.useComponent(),{}),`SignInRequiredDialog`);export{E as PureSignInRequiredDialog,O as SignInRequiredDialog,O as default,D as SignInRequiredDialogConnection};