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]=`1800f085-de69-44cf-9e9e-5f6a94cd0248`,e._sentryDebugIdIdentifier=`sentry-dbid-1800f085-de69-44cf-9e9e-5f6a94cd0248`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Oi as r,Um as i,Zh as a,Zm as o,_r as s,jg as c,ng as l,op as u}from"./entry.client-mpghtlrl.js";import{Dt as d}from"./workspace-leaf-files-oergw4h0.js";import{t as f}from"./GameSessionDetails-lrb45wq3.js";import{t as p}from"./useEmitGameStreamDialogEvent-m3jw3fvd.js";import{t as m}from"./useGameStreamProps-wkghqjeq.js";import{t as h}from"./useGameStreamDialogContext-orgnly77.js";var g=e(c(),1),_=n(),v=(e,t)=>{try{let n=new URL(e).protocol.match(/^ms-xbl-(0x)?([0-9a-fA-F]+):/);if(n){let e=parseInt(n[2],16);if(e)return e.toString();t?.error(`Failed to parse titleId as an integer: ${n[2]??`Regex failed to extract titleId`}`)}else t?.error(`Failed to extract title ID from activation URL: ${e}`)}catch(n){t?.error(`Failed to parse title activation URL: ${e}, ${n}`)}},y=l(),b=e=>{let t=(0,_.c)(6),{productInfo:n,title:r,session:i,onClose:a}=e,o=f.useComponent(),s;return t[0]!==o||t[1]!==n||t[2]!==r||t[3]!==i||t[4]!==a?(s=(0,y.jsx)(o,{productInfo:n,title:r,session:i,onPlay:a,onActionButtonPress:a}),t[0]=o,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s):s=t[5],s},x=s(b,({launchUri:e,titleId:n})=>{let r=p(u.dialog.gameStream.titleActivation.fullPath,`complete`),{t:i}=t(`TitleActivationDialog`),{catalog:s}=o(),{setDialogShellProps:c}=h(),{data:l}=a(s.queries.productInfosByAlternateId.detailed.getOptions({id:n,idType:`XboxTitleId`})),f=i(`Launch {title}?`,{shortKey:`titleactivationdialog_launch_778187`,values:{title:l[0].ProductTitle}}),m={accessibleTitle:f,accessibleDescription:i(`The current game is trying to launch {title}.`,{shortKey:`titleactivationdialog_current_trying_launch_4c3495`,values:{title:l[0].ProductTitle}}),dismissable:!0,className:d,onWillClose:r};return(0,g.useEffect)(()=>{c(m)},[m,c]),{productInfo:l[0],title:f,session:{kind:`titleActivation`,titleId:n,payload:e},onClose:r}}),S=r(()=>{let e=m(`titleActivation`),t=i().getLogger(`TitleActivationDialog`),n=x.useComponent();if(!e)return null;let r=v(e.launchUri,t);return r?(0,y.jsx)(n,{launchUri:e.launchUri,titleId:r}):null},`TitleActivationDialog`);export{b as PureTitleActivationDialogContent,S as TitleActivationDialog,S as default,x as TitleActivationDialogContentConnection};