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]=`ab992418-e24d-4a90-919b-bcbc34b6e0aa`,e._sentryDebugIdIdentifier=`sentry-dbid-ab992418-e24d-4a90-919b-bcbc34b6e0aa`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{$d as t,Ag as n,Bm as r,Cr as i,Dg as a,Fg as o,Ig as s,Sr as c,Ym as l,ch as u,pg as d,sh as f,st as p,wg as m,zp as h}from"./entry.client-dr7r6s9a.js";import{n as g}from"./auth-hooks-karaxdb8.js";import{t as _}from"./XenonSpinner-hionx0on.js";var v=c(),y=o(),b=e(s(),1),x=new d(`useInsiderPreviewGateNavigation`),S=()=>{let e=(0,y.c)(11),n=p(),{insiderPreviewGate:r}=f(),{trackAppAction:i}=u(`useInsiderPreviewGateNavigation`),o=g(),s;e[0]===r.queries.navigationDecision?s=e[1]:(s=r.queries.navigationDecision.getOptions(),e[0]=r.queries.navigationDecision,e[1]=s);let{data:c}=a(s),l;e[2]===r.mutations.openGateDialog?l=e[3]:(l=r.mutations.openGateDialog.getOptions(),e[2]=r.mutations.openGateDialog,e[3]=l);let{mutateAsync:d}=m(l),_,v;e[4]!==c||e[5]!==o||e[6]!==n||e[7]!==i||e[8]!==d?(_=()=>{if(c!=null){x.info(`navigationDecision resolved`,{action:c});bb5:switch(c){case`sign-in-required`:o();break bb5;case`access-denied`:n(t.insiderPreviewGate.$path());break bb5;case`show-welcome`:i(`OpenModal`,{modalType:h.dialog.insiderPreviewGate.fullPath},{location:`handlePreviewWelcome`}),d({mode:`Welcome`}).catch(e=>{x.error(`Failed to open insider preview gate dialog`,e)});break bb5;case`allowed`:}}},v=[c,o,n,i,d],e[4]=c,e[5]=o,e[6]=n,e[7]=i,e[8]=d,e[9]=_,e[10]=v):(_=e[9],v=e[10]),(0,b.useEffect)(_,v)},C=n(),w=()=>{let e=(0,y.c)(1);S();let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsx)(`div`,{className:`h-screen w-screen`,children:(0,C.jsx)(_,{className:`h-1/2 w-1/2`})}),e[0]=t):t=e[0],t},T=l(()=>{let e=(0,v.c)(9),{insiderPreviewGate:t}=f(),n;e[0]===t.queries.isPreviewGateEnabled?n=e[1]:(n=t.queries.isPreviewGateEnabled.getOptions(),e[0]=t.queries.isPreviewGateEnabled,e[1]=n);let{data:i,isPending:o}=a(n),s;e[2]===t.queries.isPreviewAccessAllowed?s=e[3]:(s=t.queries.isPreviewAccessAllowed.getOptions(),e[2]=t.queries.isPreviewAccessAllowed,e[3]=s);let{data:c,isPending:l}=a(s),u;e[4]===t.queries.hasSeenPreviewWelcomeDialog?u=e[5]:(u=t.queries.hasSeenPreviewWelcomeDialog.getOptions(),e[4]=t.queries.hasSeenPreviewWelcomeDialog,e[5]=u);let{data:d,isPending:p}=a(u);if(i===!1&&!o){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsx)(r,{}),e[6]=t):t=e[6],t}if(c&&d&&!l&&!p){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,C.jsx)(r,{}),e[7]=t):t=e[7],t}let m;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,C.jsx)(w,{}),e[8]=m):m=e[8],m});export{i as clientLoader,T as default};