PageSourceSearch

https://whop.com/_web/assets/gha-35971278800-1/use-is-internal-bOiU_49_.js

js whop.com collected 2026-09-24 08:31:13 UTC 2,096 bytes, 4 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="650b5789-1a58-5800-95b6-7538d278dda3")}catch(e){}}();
3import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{Ta as t}from"./frosted-ui-IuunJNEA.js";import{t as n}from"./useRouter-By-0xqVW.js";import{m as r}from"./useQuery-h_lbmEls.js";import{n as i}from"./react-client-D5SPP8rz.js";import{Zs as a,fr as o,hc as s}from"./hooks-okue38-X.js";import{t as c}from"./auth-store-R0K-CVSk.js";import{o as l}from"./toast-BSw6zLhC.js";var u=e(t(),1);function d(){let{isAuthenticated:e,userId:t}=c(),{data:n,isError:r}=a(void 0,{enabled:e,staleTime:5*6e4}),{data:i,isError:s}=o({},{enabled:e,staleTime:5*6e4}),l=n?.viewer.user,u=!!l?.admin,d=!!(l?.admin||l?.support||l?.manager),f=!!i?.viewer.user.hasInvestigationAccess,p=e&&!!i?.viewer.user.roles.includes(`sales_and_am`),m=e&&!!i?.viewer.user.roles.includes(`finance`),h=e&&(d||p||m),g=!e||n!==void 0||r;return{isInternal:d,hasInvestigationAccess:f,isAdmin:u,isSalesAndAm:p,isLoaded:g,canInvestigateUsers:h,isFinance:m,isInvestigationAccessLoaded:g&&(!e||i!==void 0||s),investigatorUserId:t??void 0}}function f(e){let t=i(),a=n(),c=r(),{hasInvestigationAccess:f}=d(),p=o.getKey({}),{mutate:m,isPending:h}=s({onSuccess:n=>{let r=!!n.updateUser?.investigationEnabled,i=e?.enabled??t(`rK+WBr`),s=e?.disabled??t(`A+/DWh`);l.success(r?i:s),c.setQueryData(p,e=>e&&{...e,viewer:{...e.viewer,user:{...e.viewer.user,hasInvestigationAccess:r}}}),c.invalidateQueries({queryKey:o.getKey()}).catch(()=>{}),c.removeQueries({queryKey:[`resolveSlug`]}),c.invalidateQueries({queryKey:[`account`]}).catch(()=>{}),a.invalidate().catch(()=>{})},onError:()=>{l.error(t(`44UBpR`))}}),g=(0,u.useCallback)(e=>m({input:{investigationEnabled:e}}),[m]);return{hasInvestigationAccess:f,isPending:h,setEnabled:g,toggle:(0,u.useCallback)(()=>g(!f),[f,g])}}export{f as n,d as t};
4//# debugId=650b5789-1a58-5800-95b6-7538d278dda3

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.