1(function(){try{var 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]=`62e24cb8-727a-45f8-a59e-c68b93d3391e`,e._sentryDebugIdIdentifier=`sentry-dbid-62e24cb8-727a-45f8-a59e-c68b93d3391e`)}catch{}})();import{a as e}from"./rolldown-runtime-eil0g4P7.js";import{a as t,u as n}from"./auth-cache-S2VpQl_w.js";import{Yp as r}from"./icons-DpkGVEtF.js";import{At as i,C as a,F as o,I as s,N as c,O as l,S as u,b as d,k as f,m as p,x as m}from"./login-shell-shared-B1ZmoKZI.js";import{n as h}from"./use-auth-session-BOLgc4zF.js";var g=e(r(),1),_=`/admin/dealer-accounts`,v=new Set([_,`/admin/dealers`,`/admin/invite-codes`,`/rm/dealers`]);function y(e){let t=e.filter(e=>v.has(e.path));if(t.length===0)return[...e];let n=t.find(e=>e.path===`/admin/dealer-accounts`)??t.find(e=>e.name===`Dealers`)??t[0];return e.flatMap(e=>v.has(e.path)?e===n?e.path===`/admin/dealer-accounts`?[e]:[{...e,path:_}]:[]:[e])}var b=()=>{t()},x=()=>{m(p)},S=()=>n(),C={authenticated:!1,method:null,session:!1,hasReplitAuth:!1,hasReplitUser:!1,hasLinkedDbUser:!1},w={authenticated:!1,user:null,permissions:[],quickActions:null,notifications:[]},T={navigationPages:[],accessiblePages:[],functionGroups:[],sidebarGroups:[],pageGroupAssignments:[]};function E(e={}){let t=e.enabled??!0,n=e.refreshOnMount??!0,r=h(),p=i({queryKey:o,queryFn:u,enabled:t,staleTime:d,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:n,...c(l)}),m=i({queryKey:s,queryFn:a,enabled:t&&r.authenticated,staleTime:d,gcTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:n,...c(f)}),_=p.data??w,v=m.data??T,y=_.user,b=p.isLoading||m.isLoading,S=p.isFetching||m.isFetching,C=b||!y&&p.isFetching,{refetch:E}=p,{refetch:O}=m,k=g.useCallback(async()=>{let[e]=await Promise.all([E(),O()]);return e},[E,O]),A=g.useCallback(async()=>{x(),await k()},[k]);return{...g.useMemo(()=>D(_,v),[_,v]),isLoading:b,isFetching:S,isResolving:C,isError:p.isError||m.isError,error:p.error??m.error,refetch:k,clearAuthCache:A}}function D(e,t){let n=e.user;return{user:n,authStatus:e.authStatus??C,isAuthenticated:!!n,authMethod:e.authStatus?.method??null,permissions:e.permissions,navigationPages:y(t.navigationPages),accessiblePages:y(t.accessiblePages),quickActions:e.quickActions,notifications:e.notifications,functionGroups:t.functionGroups,sidebarGroups:t.sidebarGroups,pageGroupAssignments:t.pageGroupAssignments,canManageRbac:e.canManageRbac??!1,impersonation:e.impersonation??null,contextCachedAt:e.clientCachedAt??null,isImpersonating:!!e.impersonation?.isImpersonating}}export{E as i,b as n,S as r,x as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.