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]=`82c4cc46-9ab6-43bf-86f3-39f5e00b47c8`,e._sentryDebugIdIdentifier=`sentry-dbid-82c4cc46-9ab6-43bf-86f3-39f5e00b47c8`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Fg as n,Ig as r,dn as i,ep as a,mh as o,sh as s,th as c,wg as l}from"./entry.client-dr7r6s9a.js";import{t as u}from"./PurchaseHost-neaf6sjk.js";import{t as d}from"./useFlowId-n9vqrww9.js";import{n as f}from"./DialogShell-k2jpaw9r.js";var p=n(),m=e(r(),1),h=t(),g=i(e=>{let t=(0,p.c)(3),n=u.useComponent(),r;return t[0]!==n||t[1]!==e?(r=(0,h.jsx)(n,{...e,preload:!1}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r},e=>{let{queryClient:t,systems:{dialog:n}}=c(),r=d(),{authentication:{queries:{xToken:i}}}=s(),{mutate:o}=l(n.mutations.goBack.getOptions()),u=(0,m.useCallback)(async e=>(await t.fetchQuery(i.getActiveUserQuery().getOptions({relyingParty:a.MDollar,uri:e}))).toAuthenticationHeader(),[t,i]),f=(0,m.useCallback)(t=>{e.onExit?.(t),o()},[o,e]),p=(0,m.useCallback)(t=>{e.onResult?.(t)},[e]);return{...e,preload:!1,includeOrderDocument:!1,getAuthToken:u,getExtraHeaders:()=>Promise.resolve(void 0),onResult:p,onExit:f,flowId:r}}),_=e=>{let t=(0,p.c)(17),n=f.useComponent(),r=g.useComponent(),i=e.productId,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=performance.now(),t[0]=a):a=t[0];let s=e.campaignId??`CloudGaming.Web`,c=e.sourceClientName??o.XEWeb,l;t[1]!==r||t[2]!==e.productId||t[3]!==e.skuId||t[4]!==e.availabilityId||t[5]!==e.optionalCampaignId||t[6]!==e.catalogId||t[7]!==e.callerApplicationId||t[8]!==e.purchaseSource||t[9]!==e.onResult||t[10]!==e.onExit||t[11]!==s||t[12]!==c?(l=(0,h.jsx)(r,{productId:i,purchaseLaunchStartTime:a,skuId:e.skuId,availabilityId:e.availabilityId,campaignId:s,optionalCampaignId:e.optionalCampaignId,allowAsyncPurchase:!0,catalogId:e.catalogId,callerApplicationId:e.callerApplicationId,sourceClientName:c,purchaseSource:e.purchaseSource,onResult:e.onResult,onExit:e.onExit}),t[1]=r,t[2]=e.productId,t[3]=e.skuId,t[4]=e.availabilityId,t[5]=e.optionalCampaignId,t[6]=e.catalogId,t[7]=e.callerApplicationId,t[8]=e.purchaseSource,t[9]=e.onResult,t[10]=e.onExit,t[11]=s,t[12]=c,t[13]=l):l=t[13];let u;return t[14]!==n||t[15]!==l?(u=(0,h.jsx)(n,{className:`h-full w-full overflow-visible`,children:l}),t[14]=n,t[15]=l,t[16]=u):u=t[16],u};export{_ as PurchaseDialog,_ as default};