react-luminus-components 1.2.73 → 1.2.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { j as o, ab as t, aj as e } from "./NoInputContainer-B6VOLjlx.js";
1
+ import { j as o, ab as t, aj as e } from "./NoInputContainer-BlKRvyRb.js";
2
2
  const l = ({ text: s, placement: r, children: a }) => /* @__PURE__ */ o.jsx(t, { placement: r, overlay: /* @__PURE__ */ o.jsx(e, { className: "luminus-tooltip", children: s }), children: a });
3
3
  export {
4
4
  l as S
@@ -1 +1 @@
1
- "use strict";const t=require("./NoInputContainer-BMw6_o8g.cjs"),r=({text:o,placement:e,children:i})=>t.jsxRuntimeExports.jsx(t.OverlayTrigger,{placement:e,overlay:t.jsxRuntimeExports.jsx(t.Tooltip,{className:"luminus-tooltip",children:o}),children:i});exports.SimpleTooltip=r;
1
+ "use strict";const t=require("./NoInputContainer-l6WM75EF.cjs"),r=({text:o,placement:e,children:i})=>t.jsxRuntimeExports.jsx(t.OverlayTrigger,{placement:e,overlay:t.jsxRuntimeExports.jsx(t.Tooltip,{className:"luminus-tooltip",children:o}),children:i});exports.SimpleTooltip=r;
@@ -2,7 +2,6 @@
2
2
  import { PublicClientApplication } from '@azure/msal-browser';
3
3
  interface IAuthContext {
4
4
  useMsal: boolean;
5
- storedToken: string | null;
6
5
  msalInstance: PublicClientApplication | null;
7
6
  msalScopes: string[];
8
7
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NoInputContainer-BMw6_o8g.cjs"),n=require("react"),v=require("./useConfirm-XkaUQify.cjs");require("react-hook-form");const l=require("./EventType-BYwx1aU3.cjs"),y=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{isShown:r,text:s,onFinish:o}=v.usePrompt(),{options:a}=n.useContext(e.PromptContext),[c,u]=n.useState(a.defaultValue??""),i=n.useCallback(()=>{o(null)},[o]),d=n.useCallback(()=>{o(c)},[o,c]);n.useEffect(()=>{r===!0&&u(a.defaultValue??"")},[r,a.defaultValue]);const x=n.useMemo(()=>({value:c,onChange:E=>u(E.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[c]);return e.jsxRuntimeExports.jsxs(l.Modal,{show:r,size:"sm",centered:!0,onHide:i,children:[e.jsxRuntimeExports.jsx(l.Modal.Header,{children:e.jsxRuntimeExports.jsx(l.Modal.Title,{children:s})}),e.jsxRuntimeExports.jsxs(l.Modal.Body,{children:[a.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...x,rows:5}):void 0,a.input==="input"?e.jsxRuntimeExports.jsx("input",{...x,type:a.type}):void 0]}),e.jsxRuntimeExports.jsxs(l.Modal.Footer,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:i,children:t.cancel}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:d,disabled:a.required&&!c,children:t.confirm})]})]})},I=({children:t})=>{const[r,s]=n.useState(!1),[o,a]=n.useState(""),[c,u]=n.useState({input:"textarea",type:"text"}),i=n.useRef(()=>{}),d=n.useCallback(C=>{a(C),s(!0)},[]),x=n.useCallback(()=>{s(!1)},[]),E=n.useMemo(()=>({isShown:r,text:o,showPrompt:d,hidePrompt:x,resolveRef:i,options:c,setOptions:u}),[r,o,d,x,c]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:E,children:[t,e.jsxRuntimeExports.jsx(y,{})]})},T=({children:t})=>{const[r,s]=n.useState(!1),[o,a]=n.useState(""),c=n.useCallback(d=>{s(!0),a(d)},[]),u=n.useCallback(()=>{s(!1)},[]),i=n.useMemo(()=>({show:r,text:o,showConfirm:c,hideConfirm:u}),[r,o,c,u]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:i,children:[e.jsxRuntimeExports.jsx(U,{}),t]})},h=({cookieDomain:t,axiosInstance:r,LinkComponent:s,NavigateComponent:o,language:a,axiosTexts:c,confirmTexts:u,formValidationTexts:i,homeDashboardTexts:d,formSubmitTexts:x,appSearchTexts:E,customSelectTexts:C,children:R})=>{const m=n.useMemo(()=>({axiosInstance:r,cookieDomain:t,LinkComponent:s,NavigateComponent:o,language:a,axiosTexts:c,confirmTexts:u,formValidationTexts:i,homeDashboardTexts:d,formSubmitTexts:x,appSearchTexts:E,customSelectTexts:C}),[r,t,s,o,a,c,u,i,d,x,E,C]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:m,children:e.jsxRuntimeExports.jsx(T,{children:e.jsxRuntimeExports.jsxs(I,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),R]})})})},j=({children:t})=>{const[r,s]=n.useState(!1),[o]=n.useState(new Set),a=n.useCallback(i=>{o.add(i),s(!0)},[o]),c=n.useCallback(i=>{o.delete(i),o.size===0&&s(!1)},[o]),u=n.useMemo(()=>({isLoading:r,startLoading:a,stopLoading:c}),[r,a,c]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:u,children:[r&&e.jsxRuntimeExports.jsx(l.Loading,{}),t]})};/*! @azure/msal-browser v3.14.0 2024-05-07 */class P{static getInteractionStatusFromEvent(r,s){switch(r.eventType){case l.EventType.LOGIN_START:return e.InteractionStatus.Login;case l.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case l.EventType.ACQUIRE_TOKEN_START:if(r.interactionType===e.InteractionType.Redirect||r.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case l.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case l.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case l.EventType.SSO_SILENT_SUCCESS:case l.EventType.SSO_SILENT_FAILURE:if(s&&s!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case l.EventType.LOGOUT_END:if(s&&s!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case l.EventType.HANDLE_REDIRECT_END:if(s&&s!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case l.EventType.LOGIN_SUCCESS:case l.EventType.LOGIN_FAILURE:case l.EventType.ACQUIRE_TOKEN_SUCCESS:case l.EventType.ACQUIRE_TOKEN_FAILURE:case l.EventType.RESTORE_FROM_BFCACHE:if(r.interactionType===e.InteractionType.Redirect||r.interactionType===e.InteractionType.Popup){if(s&&s!==e.InteractionStatus.Login&&s!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}break}return null}}/*! @azure/msal-react v2.0.16 2024-05-07 */const b="@azure/msal-react",g="2.0.16";/*! @azure/msal-react v2.0.16 2024-05-07 */const S={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},k=(t,r)=>{const{type:s,payload:o}=r;let a=t.inProgress;switch(s){case S.UNBLOCK_INPROGRESS:t.inProgress===e.InteractionStatus.Startup&&(a=e.InteractionStatus.None,o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case S.EVENT:const u=o.message,i=P.getInteractionStatusFromEvent(u,t.inProgress);i&&(o.logger.info(`MsalProvider - ${u.eventType} results in setting inProgress from ${t.inProgress} to ${i}`),a=i);break;default:throw new Error(`Unknown action type: ${s}`)}const c=o.instance.getAllAccounts();return a!==t.inProgress&&!e.accountArraysAreEqual(c,t.accounts)?{...t,inProgress:a,accounts:c}:a!==t.inProgress?{...t,inProgress:a}:e.accountArraysAreEqual(c,t.accounts)?t:{...t,accounts:c}};function L({instance:t,children:r}){n.useEffect(()=>{t.initializeWrapperLibrary(e.WrapperSKU.React,g)},[t]);const s=n.useMemo(()=>t.getLogger().clone(b,g),[t]),[o,a]=n.useReducer(k,void 0,()=>({inProgress:e.InteractionStatus.Startup,accounts:t.getAllAccounts()}));n.useEffect(()=>{const u=t.addEventCallback(i=>{a({payload:{instance:t,logger:s,message:i},type:S.EVENT})});return s.verbose(`MsalProvider - Registered event callback with id: ${u}`),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{a({payload:{instance:t,logger:s},type:S.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{u&&(s.verbose(`MsalProvider - Removing event callback ${u}`),t.removeEventCallback(u))}},[t,s]);const c={instance:t,inProgress:o.inProgress,accounts:o.accounts,logger:s};return n.createElement(e.MsalContext.Provider,{value:c},r)}const N=({children:t})=>{const r=e.useAxios(),{msalInstance:s}=n.useContext(e.AuthContext),[o,a]=n.useState(!1),c=n.useCallback(()=>{const m=localStorage.getItem("user")??null;return m?JSON.parse(m):null},[]),[u,i]=n.useState(c()),d=n.useCallback(async m=>{let p=null;return await r.get("/user/detail",m?{headers:{Authorization:`Bearer ${m}`}}:void 0).then(f=>{p=f.data}).catch(()=>{p=null}),localStorage.setItem("user",JSON.stringify(p)),p},[r]),x=n.useCallback(()=>{localStorage.removeItem("user")},[]),E=n.useCallback(async m=>{a(!0);const p=await d(m);return a(!1),p?(i(p),!0):!1},[d]),C=n.useCallback(()=>{x(),i(null)},[x]),R=n.useMemo(()=>({user:u,loggingInProgress:o,loginUser:E,logoutUser:C}),[u,E,C,o]);return n.useEffect(()=>{i(c())},[c]),n.useEffect(()=>{if(s){const m=s.addEventCallback(p=>{if(p.eventType===l.EventType.LOGIN_SUCCESS&&p.payload){const f=p.payload;E(f.accessToken).catch(()=>C())}});return()=>{m&&s.removeEventCallback(m)}}return()=>{}},[s,E,C]),e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:R,children:t})},A=({...t})=>{const{cookieDomain:r}=n.useContext(e.LuminusComponentsContext),[,s]=e.useCookies(["Authorization"]),[o,a]=n.useState(null),c=n.useMemo(()=>({useMsal:t.useMsal??!1,storedToken:(o==null?void 0:o.token)??null,msalInstance:t.useMsal?t.msalInstance??null:null,msalScopes:t.useMsal?t.msalScopes??[]:[]}),[t,o]);return n.useEffect(()=>{if(t.useMsal){const u=t.msalInstance.addEventCallback(i=>{if(i.eventType===l.EventType.LOGIN_SUCCESS||i.eventType===l.EventType.ACQUIRE_TOKEN_SUCCESS&&i.payload){const d=i.payload,x=d.account;t.msalInstance.setActiveAccount(x);const E=d.accessToken,C=d.expiresOn;a({token:E,expiresOn:C})}});return()=>{u&&t.msalInstance.removeEventCallback(u)}}return()=>{}},[t]),n.useEffect(()=>{o&&s("Authorization",o.token,{path:"/",secure:!0,sameSite:"none",domain:r,expires:o.expiresOn??void 0})},[o,r,s]),e.jsxRuntimeExports.jsx(e.AuthContext.Provider,{value:c,children:t.useMsal?e.jsxRuntimeExports.jsx(L,{instance:t.msalInstance,children:t.children}):t.children})},U=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{onConfirm:r,onCancel:s,text:o,show:a}=v.useConfirm();return e.jsxRuntimeExports.jsx(l.Modal,{show:a,size:"sm",centered:!0,onHide:s,children:e.jsxRuntimeExports.jsxs(l.Modal.Body,{children:[e.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",children:o})}),e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:s,children:t.no}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:r,children:t.yes})]})]})})};exports.AuthContext=e.AuthContext;exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.AuthProvider=A;exports.LoadingProvider=j;exports.LuminusComponentsProvider=h;exports.UserProvider=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NoInputContainer-l6WM75EF.cjs"),n=require("react"),v=require("./useConfirm-D_VbuDDH.cjs");require("react-hook-form");const l=require("./EventType-EOumBIph.cjs"),y=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{isShown:r,text:s,onFinish:a}=v.usePrompt(),{options:o}=n.useContext(e.PromptContext),[c,i]=n.useState(o.defaultValue??""),u=n.useCallback(()=>{a(null)},[a]),d=n.useCallback(()=>{a(c)},[a,c]);n.useEffect(()=>{r===!0&&i(o.defaultValue??"")},[r,o.defaultValue]);const x=n.useMemo(()=>({value:c,onChange:m=>i(m.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[c]);return e.jsxRuntimeExports.jsxs(l.Modal,{show:r,size:"sm",centered:!0,onHide:u,children:[e.jsxRuntimeExports.jsx(l.Modal.Header,{children:e.jsxRuntimeExports.jsx(l.Modal.Title,{children:s})}),e.jsxRuntimeExports.jsxs(l.Modal.Body,{children:[o.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...x,rows:5}):void 0,o.input==="input"?e.jsxRuntimeExports.jsx("input",{...x,type:o.type}):void 0]}),e.jsxRuntimeExports.jsxs(l.Modal.Footer,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:u,children:t.cancel}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:d,disabled:o.required&&!c,children:t.confirm})]})]})},I=({children:t})=>{const[r,s]=n.useState(!1),[a,o]=n.useState(""),[c,i]=n.useState({input:"textarea",type:"text"}),u=n.useRef(()=>{}),d=n.useCallback(p=>{o(p),s(!0)},[]),x=n.useCallback(()=>{s(!1)},[]),m=n.useMemo(()=>({isShown:r,text:a,showPrompt:d,hidePrompt:x,resolveRef:u,options:c,setOptions:i}),[r,a,d,x,c]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:m,children:[t,e.jsxRuntimeExports.jsx(y,{})]})},T=({children:t})=>{const[r,s]=n.useState(!1),[a,o]=n.useState(""),c=n.useCallback(d=>{s(!0),o(d)},[]),i=n.useCallback(()=>{s(!1)},[]),u=n.useMemo(()=>({show:r,text:a,showConfirm:c,hideConfirm:i}),[r,a,c,i]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:u,children:[e.jsxRuntimeExports.jsx(U,{}),t]})},h=({cookieDomain:t,axiosInstance:r,LinkComponent:s,NavigateComponent:a,language:o,axiosTexts:c,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:d,formSubmitTexts:x,appSearchTexts:m,customSelectTexts:p,children:S})=>{const E=n.useMemo(()=>({axiosInstance:r,cookieDomain:t,LinkComponent:s,NavigateComponent:a,language:o,axiosTexts:c,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:d,formSubmitTexts:x,appSearchTexts:m,customSelectTexts:p}),[r,t,s,a,o,c,i,u,d,x,m,p]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:E,children:e.jsxRuntimeExports.jsx(T,{children:e.jsxRuntimeExports.jsxs(I,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),S]})})})},j=({children:t})=>{const[r,s]=n.useState(!1),[a]=n.useState(new Set),o=n.useCallback(u=>{a.add(u),s(!0)},[a]),c=n.useCallback(u=>{a.delete(u),a.size===0&&s(!1)},[a]),i=n.useMemo(()=>({isLoading:r,startLoading:o,stopLoading:c}),[r,o,c]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:i,children:[r&&e.jsxRuntimeExports.jsx(l.Loading,{}),t]})};/*! @azure/msal-browser v3.14.0 2024-05-07 */class P{static getInteractionStatusFromEvent(r,s){switch(r.eventType){case l.EventType.LOGIN_START:return e.InteractionStatus.Login;case l.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case l.EventType.ACQUIRE_TOKEN_START:if(r.interactionType===e.InteractionType.Redirect||r.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case l.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case l.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case l.EventType.SSO_SILENT_SUCCESS:case l.EventType.SSO_SILENT_FAILURE:if(s&&s!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case l.EventType.LOGOUT_END:if(s&&s!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case l.EventType.HANDLE_REDIRECT_END:if(s&&s!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case l.EventType.LOGIN_SUCCESS:case l.EventType.LOGIN_FAILURE:case l.EventType.ACQUIRE_TOKEN_SUCCESS:case l.EventType.ACQUIRE_TOKEN_FAILURE:case l.EventType.RESTORE_FROM_BFCACHE:if(r.interactionType===e.InteractionType.Redirect||r.interactionType===e.InteractionType.Popup){if(s&&s!==e.InteractionStatus.Login&&s!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}break}return null}}/*! @azure/msal-react v2.0.16 2024-05-07 */const b="@azure/msal-react",f="2.0.16";/*! @azure/msal-react v2.0.16 2024-05-07 */const R={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},L=(t,r)=>{const{type:s,payload:a}=r;let o=t.inProgress;switch(s){case R.UNBLOCK_INPROGRESS:t.inProgress===e.InteractionStatus.Startup&&(o=e.InteractionStatus.None,a.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case R.EVENT:const i=a.message,u=P.getInteractionStatusFromEvent(i,t.inProgress);u&&(a.logger.info(`MsalProvider - ${i.eventType} results in setting inProgress from ${t.inProgress} to ${u}`),o=u);break;default:throw new Error(`Unknown action type: ${s}`)}const c=a.instance.getAllAccounts();return o!==t.inProgress&&!e.accountArraysAreEqual(c,t.accounts)?{...t,inProgress:o,accounts:c}:o!==t.inProgress?{...t,inProgress:o}:e.accountArraysAreEqual(c,t.accounts)?t:{...t,accounts:c}};function k({instance:t,children:r}){n.useEffect(()=>{t.initializeWrapperLibrary(e.WrapperSKU.React,f)},[t]);const s=n.useMemo(()=>t.getLogger().clone(b,f),[t]),[a,o]=n.useReducer(L,void 0,()=>({inProgress:e.InteractionStatus.Startup,accounts:t.getAllAccounts()}));n.useEffect(()=>{const i=t.addEventCallback(u=>{o({payload:{instance:t,logger:s,message:u},type:R.EVENT})});return s.verbose(`MsalProvider - Registered event callback with id: ${i}`),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{o({payload:{instance:t,logger:s},type:R.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{i&&(s.verbose(`MsalProvider - Removing event callback ${i}`),t.removeEventCallback(i))}},[t,s]);const c={instance:t,inProgress:a.inProgress,accounts:a.accounts,logger:s};return n.createElement(e.MsalContext.Provider,{value:c},r)}const N=({children:t})=>{const r=e.useAxios(),{msalInstance:s}=n.useContext(e.AuthContext),[a,o]=n.useState(!1),c=n.useCallback(()=>{const E=localStorage.getItem("user")??null;return E?JSON.parse(E):null},[]),[i,u]=n.useState(c()),d=n.useCallback(async E=>{let C=null;return await r.get("/user/detail",E?{headers:{Authorization:`Bearer ${E}`}}:void 0).then(g=>{C=g.data}).catch(()=>{C=null}),localStorage.setItem("user",JSON.stringify(C)),C},[r]),x=n.useCallback(()=>{localStorage.removeItem("user")},[]),m=n.useCallback(async E=>{o(!0);const C=await d(E);return o(!1),C?(u(C),!0):!1},[d]),p=n.useCallback(()=>{x(),u(null)},[x]),S=n.useMemo(()=>({user:i,loggingInProgress:a,loginUser:m,logoutUser:p}),[i,m,p,a]);return n.useEffect(()=>{u(c())},[c]),n.useEffect(()=>{if(s){const E=s.addEventCallback(C=>{if(C.eventType===l.EventType.LOGIN_SUCCESS&&C.payload){const g=C.payload;m(g.accessToken).catch(()=>p())}});return()=>{E&&s.removeEventCallback(E)}}return()=>{}},[s,m,p]),e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:S,children:t})},A=({...t})=>{const{cookieDomain:r}=n.useContext(e.LuminusComponentsContext),[,s]=e.useCookies(["Authorization"]),a=n.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:t.useMsal?t.msalInstance??null:null,msalScopes:t.useMsal?t.msalScopes??[]:[]}),[t]);return n.useEffect(()=>{if(t.useMsal){const o=t.msalInstance.addEventCallback(c=>{if(c.eventType===l.EventType.LOGIN_SUCCESS||c.eventType===l.EventType.ACQUIRE_TOKEN_SUCCESS&&c.payload){const i=c.payload,u=i.account;t.msalInstance.setActiveAccount(u);const d=i.accessToken,x=i.expiresOn;s("Authorization",d,{path:"/",secure:!0,sameSite:"none",domain:r,expires:x??void 0})}});return()=>{o&&t.msalInstance.removeEventCallback(o)}}return()=>{}},[t,s,r]),e.jsxRuntimeExports.jsx(e.AuthContext.Provider,{value:a,children:t.useMsal?e.jsxRuntimeExports.jsx(k,{instance:t.msalInstance,children:t.children}):t.children})},U=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{onConfirm:r,onCancel:s,text:a,show:o}=v.useConfirm();return e.jsxRuntimeExports.jsx(l.Modal,{show:o,size:"sm",centered:!0,onHide:s,children:e.jsxRuntimeExports.jsxs(l.Modal.Body,{children:[e.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",children:a})}),e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:s,children:t.no}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:r,children:t.yes})]})]})})};exports.AuthContext=e.AuthContext;exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.AuthProvider=A;exports.LoadingProvider=j;exports.LuminusComponentsProvider=h;exports.UserProvider=N;
@@ -1,103 +1,103 @@
1
- import { Q as T, ak as k, j as a, al as _, am as O, an as j, M as y, L as l, ao as U, ap as w, aq as p, a4 as M, a8 as A, aa as G, ar as z, Y as F } from "./NoInputContainer-B6VOLjlx.js";
2
- import K, { useContext as S, useState as C, useCallback as f, useEffect as I, useMemo as P, useRef as B, useReducer as H } from "react";
3
- import { u as D, a as V } from "./useConfirm-Csp-DPDa.js";
1
+ import { Q as T, ak as A, j as a, al as j, am as k, an as O, M as R, L as l, ao as U, ap as w, aq as p, a4 as M, a8 as _, aa as G, ar as z, Y as F } from "./NoInputContainer-BlKRvyRb.js";
2
+ import K, { useContext as y, useState as h, useCallback as m, useEffect as I, useMemo as P, useRef as B, useReducer as H } from "react";
3
+ import { u as D, a as V } from "./useConfirm-C5x0ji94.js";
4
4
  import "react-hook-form";
5
- import { M as v, L as $, E as u } from "./EventType-CtFbVRB_.js";
5
+ import { M as v, L as $, E as u } from "./EventType-BDQWFjx9.js";
6
6
  const q = () => {
7
- const { confirmTexts: e } = S(T), { isShown: s, text: t, onFinish: n } = D(), { options: o } = S(k), [r, i] = C(o.defaultValue ?? ""), c = f(() => {
8
- n(null);
9
- }, [n]), d = f(() => {
10
- n(r);
11
- }, [n, r]);
7
+ const { confirmTexts: e } = y(T), { isShown: s, text: t, onFinish: o } = D(), { options: n } = y(A), [r, c] = h(n.defaultValue ?? ""), i = m(() => {
8
+ o(null);
9
+ }, [o]), d = m(() => {
10
+ o(r);
11
+ }, [o, r]);
12
12
  I(() => {
13
- s === !0 && i(o.defaultValue ?? "");
14
- }, [s, o.defaultValue]);
13
+ s === !0 && c(n.defaultValue ?? "");
14
+ }, [s, n.defaultValue]);
15
15
  const g = P(() => ({
16
16
  value: r,
17
- onChange: (m) => i(m.currentTarget.value),
17
+ onChange: (E) => c(E.currentTarget.value),
18
18
  className: "w-100",
19
19
  autoFocus: !0,
20
20
  tabIndex: 0
21
21
  }), [r]);
22
- return /* @__PURE__ */ a.jsxs(v, { show: s, size: "sm", centered: !0, onHide: c, children: [
22
+ return /* @__PURE__ */ a.jsxs(v, { show: s, size: "sm", centered: !0, onHide: i, children: [
23
23
  /* @__PURE__ */ a.jsx(v.Header, { children: /* @__PURE__ */ a.jsx(v.Title, { children: t }) }),
24
24
  /* @__PURE__ */ a.jsxs(v.Body, { children: [
25
- o.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...g, rows: 5 }) : void 0,
26
- o.input === "input" ? /* @__PURE__ */ a.jsx("input", { ...g, type: o.type }) : void 0
25
+ n.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...g, rows: 5 }) : void 0,
26
+ n.input === "input" ? /* @__PURE__ */ a.jsx("input", { ...g, type: n.type }) : void 0
27
27
  ] }),
28
28
  /* @__PURE__ */ a.jsxs(v.Footer, { children: [
29
- /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick: c, children: e.cancel }),
30
- /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: d, disabled: o.required && !r, children: e.confirm })
29
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick: i, children: e.cancel }),
30
+ /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: d, disabled: n.required && !r, children: e.confirm })
31
31
  ] })
32
32
  ] });
33
33
  }, Q = ({ children: e }) => {
34
- const [s, t] = C(!1), [n, o] = C(""), [r, i] = C({ input: "textarea", type: "text" }), c = B(() => {
35
- }), d = f((E) => {
36
- o(E), t(!0);
37
- }, []), g = f(() => {
34
+ const [s, t] = h(!1), [o, n] = h(""), [r, c] = h({ input: "textarea", type: "text" }), i = B(() => {
35
+ }), d = m((C) => {
36
+ n(C), t(!0);
37
+ }, []), g = m(() => {
38
38
  t(!1);
39
- }, []), m = P(() => ({
39
+ }, []), E = P(() => ({
40
40
  isShown: s,
41
- text: n,
41
+ text: o,
42
42
  showPrompt: d,
43
43
  hidePrompt: g,
44
- resolveRef: c,
44
+ resolveRef: i,
45
45
  options: r,
46
- setOptions: i
47
- }), [s, n, d, g, r]);
48
- return /* @__PURE__ */ a.jsxs(k.Provider, { value: m, children: [
46
+ setOptions: c
47
+ }), [s, o, d, g, r]);
48
+ return /* @__PURE__ */ a.jsxs(A.Provider, { value: E, children: [
49
49
  e,
50
50
  /* @__PURE__ */ a.jsx(q, {})
51
51
  ] });
52
52
  }, J = ({ children: e }) => {
53
- const [s, t] = C(!1), [n, o] = C(""), r = f((d) => {
54
- t(!0), o(d);
55
- }, []), i = f(() => {
53
+ const [s, t] = h(!1), [o, n] = h(""), r = m((d) => {
54
+ t(!0), n(d);
55
+ }, []), c = m(() => {
56
56
  t(!1);
57
- }, []), c = P(() => ({ show: s, text: n, showConfirm: r, hideConfirm: i }), [s, n, r, i]);
58
- return /* @__PURE__ */ a.jsxs(_.Provider, { value: c, children: [
57
+ }, []), i = P(() => ({ show: s, text: o, showConfirm: r, hideConfirm: c }), [s, o, r, c]);
58
+ return /* @__PURE__ */ a.jsxs(j.Provider, { value: i, children: [
59
59
  /* @__PURE__ */ a.jsx(ee, {}),
60
60
  e
61
61
  ] });
62
- }, ae = ({ cookieDomain: e, axiosInstance: s, LinkComponent: t, NavigateComponent: n, language: o, axiosTexts: r, confirmTexts: i, formValidationTexts: c, homeDashboardTexts: d, formSubmitTexts: g, appSearchTexts: m, customSelectTexts: E, children: N }) => {
63
- const x = P(() => ({
62
+ }, ae = ({ cookieDomain: e, axiosInstance: s, LinkComponent: t, NavigateComponent: o, language: n, axiosTexts: r, confirmTexts: c, formValidationTexts: i, homeDashboardTexts: d, formSubmitTexts: g, appSearchTexts: E, customSelectTexts: C, children: N }) => {
63
+ const f = P(() => ({
64
64
  axiosInstance: s,
65
65
  cookieDomain: e,
66
66
  LinkComponent: t,
67
- NavigateComponent: n,
68
- language: o,
67
+ NavigateComponent: o,
68
+ language: n,
69
69
  axiosTexts: r,
70
- confirmTexts: i,
71
- formValidationTexts: c,
70
+ confirmTexts: c,
71
+ formValidationTexts: i,
72
72
  homeDashboardTexts: d,
73
73
  formSubmitTexts: g,
74
- appSearchTexts: m,
75
- customSelectTexts: E
74
+ appSearchTexts: E,
75
+ customSelectTexts: C
76
76
  }), [
77
77
  s,
78
78
  e,
79
79
  t,
80
- n,
81
80
  o,
81
+ n,
82
82
  r,
83
- i,
84
83
  c,
84
+ i,
85
85
  d,
86
86
  g,
87
- m,
88
- E
87
+ E,
88
+ C
89
89
  ]);
90
- return /* @__PURE__ */ a.jsx(T.Provider, { value: x, children: /* @__PURE__ */ a.jsx(J, { children: /* @__PURE__ */ a.jsxs(Q, { children: [
91
- /* @__PURE__ */ a.jsx(O, {}),
90
+ return /* @__PURE__ */ a.jsx(T.Provider, { value: f, children: /* @__PURE__ */ a.jsx(J, { children: /* @__PURE__ */ a.jsxs(Q, { children: [
91
+ /* @__PURE__ */ a.jsx(k, {}),
92
92
  N
93
93
  ] }) }) });
94
94
  }, ce = ({ children: e }) => {
95
- const [s, t] = C(!1), [n] = C(/* @__PURE__ */ new Set()), o = f((c) => {
96
- n.add(c), t(!0);
97
- }, [n]), r = f((c) => {
98
- n.delete(c), n.size === 0 && t(!1);
99
- }, [n]), i = P(() => ({ isLoading: s, startLoading: o, stopLoading: r }), [s, o, r]);
100
- return /* @__PURE__ */ a.jsxs(j.Provider, { value: i, children: [
95
+ const [s, t] = h(!1), [o] = h(/* @__PURE__ */ new Set()), n = m((i) => {
96
+ o.add(i), t(!0);
97
+ }, [o]), r = m((i) => {
98
+ o.delete(i), o.size === 0 && t(!1);
99
+ }, [o]), c = P(() => ({ isLoading: s, startLoading: n, stopLoading: r }), [s, n, r]);
100
+ return /* @__PURE__ */ a.jsxs(O.Provider, { value: c, children: [
101
101
  s && /* @__PURE__ */ a.jsx($, {}),
102
102
  e
103
103
  ] });
@@ -116,7 +116,7 @@ class W {
116
116
  case u.SSO_SILENT_START:
117
117
  return l.SsoSilent;
118
118
  case u.ACQUIRE_TOKEN_START:
119
- if (s.interactionType === y.Redirect || s.interactionType === y.Popup)
119
+ if (s.interactionType === R.Redirect || s.interactionType === R.Popup)
120
120
  return l.AcquireToken;
121
121
  break;
122
122
  case u.HANDLE_REDIRECT_START:
@@ -141,7 +141,7 @@ class W {
141
141
  case u.ACQUIRE_TOKEN_SUCCESS:
142
142
  case u.ACQUIRE_TOKEN_FAILURE:
143
143
  case u.RESTORE_FROM_BFCACHE:
144
- if (s.interactionType === y.Redirect || s.interactionType === y.Popup) {
144
+ if (s.interactionType === R.Redirect || s.interactionType === R.Popup) {
145
145
  if (t && t !== l.Login && t !== l.AcquireToken)
146
146
  break;
147
147
  return l.None;
@@ -154,31 +154,31 @@ class W {
154
154
  /*! @azure/msal-react v2.0.16 2024-05-07 */
155
155
  const Y = "@azure/msal-react", L = "2.0.16";
156
156
  /*! @azure/msal-react v2.0.16 2024-05-07 */
157
- const R = {
157
+ const S = {
158
158
  UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
159
159
  EVENT: "EVENT"
160
160
  }, X = (e, s) => {
161
- const { type: t, payload: n } = s;
162
- let o = e.inProgress;
161
+ const { type: t, payload: o } = s;
162
+ let n = e.inProgress;
163
163
  switch (t) {
164
- case R.UNBLOCK_INPROGRESS:
165
- e.inProgress === l.Startup && (o = l.None, n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
164
+ case S.UNBLOCK_INPROGRESS:
165
+ e.inProgress === l.Startup && (n = l.None, o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
166
166
  break;
167
- case R.EVENT:
168
- const i = n.message, c = W.getInteractionStatusFromEvent(i, e.inProgress);
169
- c && (n.logger.info(`MsalProvider - ${i.eventType} results in setting inProgress from ${e.inProgress} to ${c}`), o = c);
167
+ case S.EVENT:
168
+ const c = o.message, i = W.getInteractionStatusFromEvent(c, e.inProgress);
169
+ i && (o.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${i}`), n = i);
170
170
  break;
171
171
  default:
172
172
  throw new Error(`Unknown action type: ${t}`);
173
173
  }
174
- const r = n.instance.getAllAccounts();
175
- return o !== e.inProgress && !p(r, e.accounts) ? {
174
+ const r = o.instance.getAllAccounts();
175
+ return n !== e.inProgress && !p(r, e.accounts) ? {
176
176
  ...e,
177
- inProgress: o,
177
+ inProgress: n,
178
178
  accounts: r
179
- } : o !== e.inProgress ? {
179
+ } : n !== e.inProgress ? {
180
180
  ...e,
181
- inProgress: o
181
+ inProgress: n
182
182
  } : p(r, e.accounts) ? e : {
183
183
  ...e,
184
184
  accounts: r
@@ -188,118 +188,115 @@ function Z({ instance: e, children: s }) {
188
188
  I(() => {
189
189
  e.initializeWrapperLibrary(U.React, L);
190
190
  }, [e]);
191
- const t = P(() => e.getLogger().clone(Y, L), [e]), [n, o] = H(X, void 0, () => ({
191
+ const t = P(() => e.getLogger().clone(Y, L), [e]), [o, n] = H(X, void 0, () => ({
192
192
  inProgress: l.Startup,
193
193
  accounts: e.getAllAccounts()
194
194
  }));
195
195
  I(() => {
196
- const i = e.addEventCallback((c) => {
197
- o({
196
+ const c = e.addEventCallback((i) => {
197
+ n({
198
198
  payload: {
199
199
  instance: e,
200
200
  logger: t,
201
- message: c
201
+ message: i
202
202
  },
203
- type: R.EVENT
203
+ type: S.EVENT
204
204
  });
205
205
  });
206
- return t.verbose(`MsalProvider - Registered event callback with id: ${i}`), e.initialize().then(() => {
206
+ return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
207
207
  e.handleRedirectPromise().catch(() => {
208
208
  }).finally(() => {
209
- o({
209
+ n({
210
210
  payload: {
211
211
  instance: e,
212
212
  logger: t
213
213
  },
214
- type: R.UNBLOCK_INPROGRESS
214
+ type: S.UNBLOCK_INPROGRESS
215
215
  });
216
216
  });
217
217
  }).catch(() => {
218
218
  }), () => {
219
- i && (t.verbose(`MsalProvider - Removing event callback ${i}`), e.removeEventCallback(i));
219
+ c && (t.verbose(`MsalProvider - Removing event callback ${c}`), e.removeEventCallback(c));
220
220
  };
221
221
  }, [e, t]);
222
222
  const r = {
223
223
  instance: e,
224
- inProgress: n.inProgress,
225
- accounts: n.accounts,
224
+ inProgress: o.inProgress,
225
+ accounts: o.accounts,
226
226
  logger: t
227
227
  };
228
228
  return K.createElement(w.Provider, { value: r }, s);
229
229
  }
230
230
  const ie = ({ children: e }) => {
231
- const s = M(), { msalInstance: t } = S(A), [n, o] = C(!1), r = f(() => {
232
- const x = localStorage.getItem("user") ?? null;
233
- return x ? JSON.parse(x) : null;
234
- }, []), [i, c] = C(r()), d = f(async (x) => {
235
- let h = null;
236
- return await s.get("/user/detail", x ? { headers: { Authorization: `Bearer ${x}` } } : void 0).then((b) => {
237
- h = b.data;
231
+ const s = M(), { msalInstance: t } = y(_), [o, n] = h(!1), r = m(() => {
232
+ const f = localStorage.getItem("user") ?? null;
233
+ return f ? JSON.parse(f) : null;
234
+ }, []), [c, i] = h(r()), d = m(async (f) => {
235
+ let x = null;
236
+ return await s.get("/user/detail", f ? { headers: { Authorization: `Bearer ${f}` } } : void 0).then((b) => {
237
+ x = b.data;
238
238
  }).catch(() => {
239
- h = null;
240
- }), localStorage.setItem("user", JSON.stringify(h)), h;
241
- }, [s]), g = f(() => {
239
+ x = null;
240
+ }), localStorage.setItem("user", JSON.stringify(x)), x;
241
+ }, [s]), g = m(() => {
242
242
  localStorage.removeItem("user");
243
- }, []), m = f(async (x) => {
244
- o(!0);
245
- const h = await d(x);
246
- return o(!1), h ? (c(h), !0) : !1;
247
- }, [d]), E = f(() => {
248
- g(), c(null);
249
- }, [g]), N = P(() => ({ user: i, loggingInProgress: n, loginUser: m, logoutUser: E }), [i, m, E, n]);
243
+ }, []), E = m(async (f) => {
244
+ n(!0);
245
+ const x = await d(f);
246
+ return n(!1), x ? (i(x), !0) : !1;
247
+ }, [d]), C = m(() => {
248
+ g(), i(null);
249
+ }, [g]), N = P(() => ({ user: c, loggingInProgress: o, loginUser: E, logoutUser: C }), [c, E, C, o]);
250
250
  return I(() => {
251
- c(r());
251
+ i(r());
252
252
  }, [r]), I(() => {
253
253
  if (t) {
254
- const x = t.addEventCallback((h) => {
255
- if (h.eventType === u.LOGIN_SUCCESS && h.payload) {
256
- const b = h.payload;
257
- m(b.accessToken).catch(() => E());
254
+ const f = t.addEventCallback((x) => {
255
+ if (x.eventType === u.LOGIN_SUCCESS && x.payload) {
256
+ const b = x.payload;
257
+ E(b.accessToken).catch(() => C());
258
258
  }
259
259
  });
260
260
  return () => {
261
- x && t.removeEventCallback(x);
261
+ f && t.removeEventCallback(f);
262
262
  };
263
263
  }
264
264
  return () => {
265
265
  };
266
- }, [t, m, E]), /* @__PURE__ */ a.jsx(G.Provider, { value: N, children: e });
266
+ }, [t, E, C]), /* @__PURE__ */ a.jsx(G.Provider, { value: N, children: e });
267
267
  }, le = ({ ...e }) => {
268
- const { cookieDomain: s } = S(T), [, t] = z(["Authorization"]), [n, o] = C(null), r = P(() => ({
268
+ const { cookieDomain: s } = y(T), [, t] = z(["Authorization"]), o = P(() => ({
269
269
  useMsal: e.useMsal ?? !1,
270
- storedToken: (n == null ? void 0 : n.token) ?? null,
271
270
  msalInstance: e.useMsal ? e.msalInstance ?? null : null,
272
271
  msalScopes: e.useMsal ? e.msalScopes ?? [] : []
273
- }), [e, n]);
272
+ }), [e]);
274
273
  return I(() => {
275
274
  if (e.useMsal) {
276
- const i = e.msalInstance.addEventCallback((c) => {
277
- if (c.eventType === u.LOGIN_SUCCESS || c.eventType === u.ACQUIRE_TOKEN_SUCCESS && c.payload) {
278
- const d = c.payload, g = d.account;
279
- e.msalInstance.setActiveAccount(g);
280
- const m = d.accessToken, E = d.expiresOn;
281
- o({ token: m, expiresOn: E });
275
+ const n = e.msalInstance.addEventCallback((r) => {
276
+ if (r.eventType === u.LOGIN_SUCCESS || r.eventType === u.ACQUIRE_TOKEN_SUCCESS && r.payload) {
277
+ const c = r.payload, i = c.account;
278
+ e.msalInstance.setActiveAccount(i);
279
+ const d = c.accessToken, g = c.expiresOn;
280
+ t("Authorization", d, {
281
+ path: "/",
282
+ secure: !0,
283
+ sameSite: "none",
284
+ domain: s,
285
+ expires: g ?? void 0
286
+ });
282
287
  }
283
288
  });
284
289
  return () => {
285
- i && e.msalInstance.removeEventCallback(i);
290
+ n && e.msalInstance.removeEventCallback(n);
286
291
  };
287
292
  }
288
293
  return () => {
289
294
  };
290
- }, [e]), I(() => {
291
- n && t("Authorization", n.token, {
292
- path: "/",
293
- secure: !0,
294
- sameSite: "none",
295
- domain: s,
296
- expires: n.expiresOn ?? void 0
297
- });
298
- }, [n, s, t]), /* @__PURE__ */ a.jsx(A.Provider, { value: r, children: e.useMsal ? /* @__PURE__ */ a.jsx(Z, { instance: e.msalInstance, children: e.children }) : e.children });
295
+ }, [e, t, s]), /* @__PURE__ */ a.jsx(_.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ a.jsx(Z, { instance: e.msalInstance, children: e.children }) : e.children });
299
296
  }, ee = () => {
300
- const { confirmTexts: e } = S(T), { onConfirm: s, onCancel: t, text: n, show: o } = V();
301
- return /* @__PURE__ */ a.jsx(v, { show: o, size: "sm", centered: !0, onHide: t, children: /* @__PURE__ */ a.jsxs(v.Body, { children: [
302
- /* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(F, { variant: "h6", children: n }) }),
297
+ const { confirmTexts: e } = y(T), { onConfirm: s, onCancel: t, text: o, show: n } = V();
298
+ return /* @__PURE__ */ a.jsx(v, { show: n, size: "sm", centered: !0, onHide: t, children: /* @__PURE__ */ a.jsxs(v.Body, { children: [
299
+ /* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(F, { variant: "h6", children: o }) }),
303
300
  /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
304
301
  /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: t, children: e.no }),
305
302
  /* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: s, children: e.yes })
@@ -307,9 +304,9 @@ const ie = ({ children: e }) => {
307
304
  ] }) });
308
305
  };
309
306
  export {
310
- A as AuthContext,
307
+ _ as AuthContext,
311
308
  le as AuthProvider,
312
- j as LoadingContext,
309
+ O as LoadingContext,
313
310
  ce as LoadingProvider,
314
311
  T as LuminusComponentsContext,
315
312
  ae as LuminusComponentsProvider,
@@ -3,6 +3,6 @@ declare const useMsalAuth: () => {
3
3
  isAuthenticating: () => boolean;
4
4
  login: () => Promise<string | null>;
5
5
  logout: () => void;
6
- getToken: () => string | null;
6
+ getToken: () => Promise<string | null>;
7
7
  };
8
8
  export default useMsalAuth;
@@ -1,7 +1,7 @@
1
1
  declare const useAuth: () => {
2
2
  isAuthenticated: () => boolean;
3
3
  isAuthenticating: () => boolean;
4
- getToken: () => string | null;
4
+ getToken: (() => string | null) | (() => Promise<string | null>);
5
5
  login: (kid: string, password: string) => Promise<string | null>;
6
6
  logout: () => void;
7
7
  };