{"version":3,"file":"Sessions.OeebRTwh.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/OhTNE1MFPBbKNcro1Dib/7Kcra2sNlquhDYp5KmP3/Hooks.js","https:/framerusercontent.com/modules/vmCqoc0d2tDDIuXAt1Mr/MzvXXWreLCae38yUEyTW/Sessions.js"],"sourcesContent":["import{useState,useEffect,useMemo}from\"react\";import{getEnv,getHeaders,isDebugMode,API_ROOTS,APP_ROOTS}from\"https://framerusercontent.com/modules/6EVT1gOc4ZsMFeCgxift/pN2GtuvMTPJozc0EYbcr/Environment.js\";export const useGlobalState=()=>{const[env,setEnv]=useState(\"production\");const[debug,setDebug]=useState(false);const[headers,setHeaders]=useState({});const[role,setRole]=useState(null);const is=useMemo(()=>({guest:!role,vendor:role===\"vendor\",buyer:role===\"buyer\",lp:role===\"logistics_partner\",broker:role===\"broker\",headBuyer:role===\"head_buyer\"}),[role]);const apiRoot=useMemo(()=>API_ROOTS[env]||API_ROOTS.production,[env]);const appRoot=useMemo(()=>APP_ROOTS[env]||APP_ROOTS.production,[env]);useEffect(()=>{setEnv(getEnv());setHeaders(getHeaders());setRole(getHeaders()?.role||null);setDebug(isDebugMode());},[]);return{env,debug,headers,role,is,apiRoot,appRoot};};export const useIf=condition=>{const[res,setRes]=useState(false);useEffect(()=>{setRes(condition());},[]);return res;};\nexport const __FramerMetadata__ = {\"exports\":{\"useIf\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useGlobalState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Hooks.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{useGlobalState}from\"https://framerusercontent.com/modules/OhTNE1MFPBbKNcro1Dib/7Kcra2sNlquhDYp5KmP3/Hooks.js\";export const forGuestOnly=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{is}=useGlobalState();return is.guest?/*#__PURE__*/_jsx(Component,{ref:ref,...props}):undefined;});};export const forLoggedOnly=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{is}=useGlobalState();return!is.guest?/*#__PURE__*/_jsx(Component,{ref:ref,...props}):undefined;});};export const forNonChatBotUserOnly=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{is}=useGlobalState();return is.guest||is.broker||is.vendor?undefined:/*#__PURE__*/_jsx(Component,{ref:ref,...props});});};export const forChatBotUserOnly=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{is}=useGlobalState();return is.guest||is.broker||is.vendor?/*#__PURE__*/_jsx(Component,{ref:ref,...props}):undefined;});};export const withIframeParams=Component=>{return /*#__PURE__*/forwardRef((props,ref)=>{const{headers}=useGlobalState();const url=headers?.uid?`${props.url}?email=${encodeURIComponent(btoa(headers?.uid))}`:props.url;return /*#__PURE__*/_jsx(Component,{ref:ref,...props,url:url,style:{...props?.style,colorScheme:\"light\"}});});};\nexport const __FramerMetadata__ = {\"exports\":{\"forGuestOnly\":{\"type\":\"reactHoc\",\"name\":\"forGuestOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withIframeParams\":{\"type\":\"reactHoc\",\"name\":\"withIframeParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"forNonChatBotUserOnly\":{\"type\":\"reactHoc\",\"name\":\"forNonChatBotUserOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"forLoggedOnly\":{\"type\":\"reactHoc\",\"name\":\"forLoggedOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"forChatBotUserOnly\":{\"type\":\"reactHoc\",\"name\":\"forChatBotUserOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Sessions.map"],"mappings":"qOAA8C,IAA8J,CAAa,MAAmB,CAAC,GAAK,CAAC,EAAI,GAAQA,EAAS,aAAa,CAAM,CAAC,EAAM,GAAUA,EAAS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