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]=`9ea8ad05-c552-4ecb-bbae-d2dd43a6e0ac`,e._sentryDebugIdIdentifier=`sentry-dbid-9ea8ad05-c552-4ecb-bbae-d2dd43a6e0ac`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Im as t,Ji as n,Lm as r,Qh as i,Tm as a,Um as o,Xt as s,Zm as c,Zt as l,_f as u,jg as d,ng as f}from"./entry.client-mpghtlrl.js";import{r as p,t as m}from"./openDialogSchema-fv7jc82y.js";var h=n(),g=e(d(),1);function _(e){return()=>{let t=[];return e.isFeatureEnabled||t.push(`enableOutofStreamPurchase feature gate is off`),e.isFullySignedIn||t.push(`user is not fully signed in  `),{canOpen:t.length===0,blockers:t}}}function v(){let{authentication:e,configuration:t}=c(),{data:n}=i(e.queries.authenticationState.getOptions()),{data:r}=i(t.queries.configuration.getOptions(`enableOutofStreamPurchase`)),a=t.castAsConfiguration(r,`enableOutofStreamPurchase`)??!1,o=n===u.FullySignedIn;return(0,g.useMemo)(()=>_({isFeatureEnabled:a,isFullySignedIn:o}),[a,o])}function y(){let e=v();return(0,g.useMemo)(()=>({[s.purchase.fullPath]:e}),[e])}var b=f(),x=()=>{let e=(0,h.c)(10),{getLogger:n}=o(),r=(0,g.useRef)(null),[i,a]=t(),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={location:`OpenDialogLayout`},e[0]=s):s=e[0];let c=l(s),u=y(),d;e[1]===a?d=e[2]:(d=()=>{a(e=>{let t=new URLSearchParams(e);return t.delete(m),t},{replace:!0})},e[1]=a,e[2]=d);let f=d,_,v;return e[3]!==i||e[4]!==n||e[5]!==u||e[6]!==c||e[7]!==f?(_=()=>{let e=i.get(m);if(!e||e===r.current)return;let t=p(i);if(!t)return;let a=n(`OpenDialogLayout`),o=u[t.key];if(o){let e=o();if(!e.canOpen){a.info(`Dialog "${t.key}" cannot open yet. Blockers: [${e.blockers.join(`; `)}]`);return}}r.current=e,a.info(`Opening dialog "${t.key}"${o?``:` (no guard registered)`}.`),c(t),f()},v=[n,u,c,i,f],e[3]=i,e[4]=n,e[5]=u,e[6]=c,e[7]=f,e[8]=_,e[9]=v):(_=e[8],v=e[9]),(0,g.useEffect)(_,v),null},S=r(()=>{let e=(0,h.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x,{}),(0,b.jsx)(a,{})]}),e[0]=t):t=e[0],t});export{S as default};