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]=`d82cf3ed-1955-403d-9d57-ed982c177a9f`,e._sentryDebugIdIdentifier=`sentry-dbid-d82cf3ed-1955-403d-9d57-ed982c177a9f`)}catch{}import{Ag as e,th as t}from"./entry.client-mpghtlrl.js";var n=e(),r=e=>{let r=(0,n.c)(15),{payload:i,onError:a,onSuccess:o,onUserGestureRequired:s,disallowedSearchParams:c,tracking:l}=e,u=t(),d;bb0:{if(!i.url||i.url?.startsWith(`/`)||u||!(`URL`in globalThis)){a?.(Error(`Unable to sanitize URL`)),d=``;break bb0}let e=new URL(i.url),t=``;if(`URLSearchParams`in globalThis){let n=new URLSearchParams;if(e.searchParams.forEach((e,t)=>{e&&(!c||!c.includes(t))&&n.append(t,e)}),l){let{correlationVector:e,location:t,productId:r}=l;if(n.append(`experience`,`share-link`),n.append(`utm_source`,`playxbox`),n.append(`utm_medium`,`share`),n.append(`originating-cv`,e.getBase()),t){let e=t;r&&(e+=`-${r}`),n.append(`utm_campaign`,`${e}`)}}t=n.toString()?`?${n.toString()}`:``}d=`${e.origin}${e.pathname}${t}`}let f=d,p;r[0]!==u||r[1]!==f||r[2]!==i?(p=!u&&!!f&&!!(i.title||i.text)&&globalThis.navigator?.share!=null&&globalThis.navigator?.canShare?.(i),r[0]=u,r[1]=f,r[2]=i,r[3]=p):p=r[3];let m=p,h;r[4]!==m||r[5]!==a||r[6]!==f||r[7]!==i||r[8]!==o||r[9]!==s?(h=()=>{if(!m){let e=Error(`Unable to share payload`);return Promise.resolve(a?.(e))}let e=new URL(f),t=()=>globalThis.navigator?.share?.({...i,url:f}).then(t=>{o?.(e)});return t().catch(e=>{if(e.name===`NotAllowedError`&&s)s(t);else throw e}).catch(e=>a?.(e))},r[4]=m,r[5]=a,r[6]=f,r[7]=i,r[8]=o,r[9]=s,r[10]=h):h=r[10];let g=h,_;return r[11]!==m||r[12]!==f||r[13]!==g?(_={canShare:m,url:f,onShare:g},r[11]=m,r[12]=f,r[13]=g,r[14]=_):_=r[14],_};export{r as t};