react-luminus-components 2.0.5-beta.r19-25 → 2.0.5-beta.r19-26
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.
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +246 -242
- package/package.json +1 -1
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar-C1VYGnTR.cjs"),S=require("react/jsx-runtime"),y=require("react"),R=require("@azure/msal-browser"),z=require("@azure/msal-react");require("react-router");require("react-dom");require("react-hook-form");require("react-flexmonster");const B=require("./FormDisabledProvider-CiGUtSf7.cjs"),V=require("./useLocalStorageState-AB4BFfn5.cjs");function Q(t){const e=s.toDate(t);return e.setHours(23,59,59,999),e}function X(){return Q(Date.now())}function Y(t,e){const l=+s.toDate(t),[c,n]=[+s.toDate(e.start),+s.toDate(e.end)].sort((u,o)=>u-o);return l>=c&&l<=n}function Z(){return s.startOfDay(Date.now())}const ee=t=>{const e=s.compilerRuntimeExports.c(10),{children:l}=t,[c,n]=y.useState(!1),[u,o]=y.useState(""),[r,p]=y.useState(void 0);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=(h,f)=>{n(!0),o(h),p(f)},e[0]=v):v=e[0];const m=v;let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{n(!1)},e[1]=C):C=e[1];const x=C;let i;e[2]!==c||e[3]!==u||e[4]!==r?(i={show:c,text:u,showConfirm:m,hideConfirm:x,textSm:r},e[2]=c,e[3]=u,e[4]=r,e[5]=i):i=e[5];const a=i;let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=S.jsx(xe,{}),e[6]=d):d=e[6];let g;return e[7]!==l||e[8]!==a?(g=S.jsxs(s.ConfirmContext.Provider,{value:a,children:[d,l]}),e[7]=l,e[8]=a,e[9]=g):g=e[9],g},te=()=>{const t=s.compilerRuntimeExports.c(43),{texts:e}=y.useContext(s.LuminusComponentsContext),{confirm:l}=e,{isShown:c,text:n,onFinish:u}=s.usePrompt(),{options:o}=y.useContext(s.PromptContext),[r,p]=y.useState(o.defaultValue??"");let v;t[0]!==u?(v=()=>{u(null)},t[0]=u,t[1]=v):v=t[1];const m=v;let C;t[2]!==u||t[3]!==o.required||t[4]!==r?(C=A=>{A.preventDefault(),!(o.required&&!r)&&(u(r),p(""))},t[2]=u,t[3]=o.required,t[4]=r,t[5]=C):C=t[5];const x=C;let i;t[6]===Symbol.for("react.memo_cache_sentinel")?(i=A=>p(A.currentTarget.value),t[6]=i):i=t[6];let a;t[7]!==r?(a={value:r,onChange:i,className:"w-100",autoFocus:!0,tabIndex:0},t[7]=r,t[8]=a):a=t[8];const d=a;let g,h;t[9]!==c||t[10]!==o.defaultValue?(g=()=>{c===!0&&p(o.defaultValue??"")},h=[c,o.defaultValue],t[9]=c,t[10]=o.defaultValue,t[11]=g,t[12]=h):(g=t[11],h=t[12]),y.useEffect(g,h);let f;t[13]!==n?(f=S.jsx(s.Modal.Header,{className:"justify-content-center",children:S.jsx(s.Modal.Title,{children:n})}),t[13]=n,t[14]=f):f=t[14];let k;t[15]!==d||t[16]!==o.input?(k=o.input==="textarea"?S.jsx("textarea",{...d,rows:5}):void 0,t[15]=d,t[16]=o.input,t[17]=k):k=t[17];let T;t[18]!==d||t[19]!==o.input||t[20]!==o.type?(T=o.input==="input"?S.jsx(s.FormControl,{...d,type:o.type}):void 0,t[18]=d,t[19]=o.input,t[20]=o.type,t[21]=T):T=t[21];let w;t[22]!==k||t[23]!==T?(w=S.jsxs(s.Modal.Body,{children:[k,T]}),t[22]=k,t[23]=T,t[24]=w):w=t[24];let E;t[25]!==l.cancel||t[26]!==m?(E=S.jsx(s.PrimaryButton,{variant:"outlined",color:"secondary",onClick:m,className:"flex-grow-1",children:l.cancel}),t[25]=l.cancel,t[26]=m,t[27]=E):E=t[27];const L=o.required&&!r;let b;t[28]!==l.confirm||t[29]!==L?(b=S.jsx(s.PrimaryButton,{color:"primary",disabled:L,type:"submit",className:"flex-grow-1",children:l.confirm}),t[28]=l.confirm,t[29]=L,t[30]=b):b=t[30];let M;t[31]!==E||t[32]!==b?(M=S.jsxs(s.Modal.Footer,{className:"w-100 d-flex gap-5",children:[E,b]}),t[31]=E,t[32]=b,t[33]=M):M=t[33];let D;t[34]!==x||t[35]!==w||t[36]!==M?(D=S.jsxs("form",{onSubmit:x,onKeyDown:ne,children:[w,M]}),t[34]=x,t[35]=w,t[36]=M,t[37]=D):D=t[37];let j;return t[38]!==c||t[39]!==m||t[40]!==D||t[41]!==f?(j=S.jsxs(s.Modal,{show:c,size:"sm",centered:!0,onHide:m,children:[f,D]}),t[38]=c,t[39]=m,t[40]=D,t[41]=f,t[42]=j):j=t[42],j};function ne(t){return t.stopPropagation()}const oe=t=>{const e=s.compilerRuntimeExports.c(11),{children:l}=t,[c,n]=y.useState(!1),[u,o]=y.useState("");let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={input:"textarea",type:"text"},e[0]=r):r=e[0];const[p,v]=y.useState(r),m=y.useRef(se);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=k=>{o(k),n(!0)},e[1]=C):C=e[1];const x=C;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{n(!1)},e[2]=i):i=e[2];const a=i;let d;e[3]!==c||e[4]!==p||e[5]!==u?(d={isShown:c,text:u,showPrompt:x,hidePrompt:a,resolveRef:m,options:p,setOptions:v},e[3]=c,e[4]=p,e[5]=u,e[6]=d):d=e[6];const g=d;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=S.jsx(te,{}),e[7]=h):h=e[7];let f;return e[8]!==l||e[9]!==g?(f=S.jsxs(s.PromptContext.Provider,{value:g,children:[l,h]}),e[8]=l,e[9]=g,e[10]=f):f=e[10],f};function se(){}const le=t=>{const e=s.compilerRuntimeExports.c(14),{cookieDomain:l,axiosOptions:c,language:n,texts:u,ProjectIconComponent:o,localizationContext:r,chartColorPalette:p,children:v}=t;let m;e[0]!==o||e[1]!==c||e[2]!==p||e[3]!==l||e[4]!==n||e[5]!==r||e[6]!==u?(m={axiosOptions:c,cookieDomain:l,language:n,texts:u,ProjectIconComponent:o,localizationContext:r,chartColorPalette:p},e[0]=o,e[1]=c,e[2]=p,e[3]=l,e[4]=n,e[5]=r,e[6]=u,e[7]=m):m=e[7];const C=m;let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=S.jsx(s.Fe,{}),e[8]=x):x=e[8];let i;e[9]!==v?(i=S.jsx(ee,{children:S.jsxs(oe,{children:[x,v]})}),e[9]=v,e[10]=i):i=e[10];let a;return e[11]!==C||e[12]!==i?(a=S.jsx(s.LuminusComponentsContext.Provider,{value:C,children:i}),e[11]=C,e[12]=i,e[13]=a):a=e[13],a},re=t=>{const e=s.compilerRuntimeExports.c(15),{children:l}=t,[c,n]=y.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[0]=u):u=e[0];const[o]=y.useState(u);let r;e[1]!==o?(r=d=>{o.add(d),n(!0)},e[1]=o,e[2]=r):r=e[2];const p=r;let v;e[3]!==o?(v=d=>{o.delete(d),o.size===0&&n(!1)},e[3]=o,e[4]=v):v=e[4];const m=v;let C;e[5]!==c||e[6]!==p||e[7]!==m?(C={isLoading:c,startLoading:p,stopLoading:m},e[5]=c,e[6]=p,e[7]=m,e[8]=C):C=e[8];const x=C;let i;e[9]!==c?(i=c&&S.jsx(B.Loading,{}),e[9]=c,e[10]=i):i=e[10];let a;return e[11]!==l||e[12]!==x||e[13]!==i?(a=S.jsxs(s.LoadingContext.Provider,{value:x,children:[i,l]}),e[11]=l,e[12]=x,e[13]=i,e[14]=a):a=e[14],a},ie=t=>{const e=s.compilerRuntimeExports.c(39),{children:l}=t,c=s.useAxios(),{msalInstance:n,getToken:u}=y.useContext(s.AuthContext),{delegation:o,setDelegation:r,setAvailableDelegations:p,refreshAvailableDelegations:v}=y.useContext(s.DelegationContext),[m,C]=y.useState(null);let x;e[0]!==u?(x=async()=>{const P=await u();P&&C(P.token)},e[0]=u,e[1]=x):x=e[1];const i=x;let a,d;e[2]!==i?(a=()=>{i()},d=[i],e[2]=i,e[3]=a,e[4]=d):(a=e[3],d=e[4]),y.useEffect(a,d);let g;if(e[5]===Symbol.for("react.memo_cache_sentinel")){e:{const P=localStorage.getItem("user")??null;if(!P){g=null;break e}g=JSON.parse(P??"")}e[5]=g}else g=e[5];const h=g;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f={state:h?s.LoginState.LOGGED_IN:s.LoginState.LOGGED_OUT,user:h},e[6]=f):f=e[6];const[k,T]=y.useState(f);let w;e[7]!==c?(w=async P=>{let _=null;return await c.get("/user/detail",P?{headers:{Authorization:`Bearer ${P}`}}:void 0).then(F=>{_=F.data}).catch(()=>{_=null}),_},e[7]=c,e[8]=w):w=e[8];const E=w;let L;e[9]!==p||e[10]!==r?(L=()=>{localStorage.removeItem("user"),T({state:s.LoginState.LOGGED_OUT,user:null}),r(null),p(null)},e[9]=p,e[10]=r,e[11]=L):L=e[11];const b=L;let M;e[12]!==E||e[13]!==v?(M=async P=>{T({state:s.LoginState.LOGGING_IN,user:null});const _=await E(P);return _?(T({state:s.LoginState.LOGGED_IN,user:_}),localStorage.setItem("user",JSON.stringify(_)),await v(),!0):(T({state:s.LoginState.LOGIN_FAILED,user:null}),!1)},e[12]=E,e[13]=v,e[14]=M):M=e[14];const D=M;let j;e[15]!==n?(j=()=>{if(n){const P=n.addEventCallback(_=>{if(_.eventType===R.EventType.LOGIN_SUCCESS&&_.payload){const F=_.payload;C(F.accessToken)}});return()=>{P&&n.removeEventCallback(P)}}return ce},e[15]=n,e[16]=j):j=e[16];let A;e[17]!==D||e[18]!==b||e[19]!==n?(A=[n,D,b],e[17]=D,e[18]=b,e[19]=n,e[20]=A):A=e[20],y.useEffect(j,A);let q;e[21]!==D||e[22]!==b||e[23]!==r?(q=async P=>{P&&await D(P).catch(()=>{b(),r(null)})},e[21]=D,e[22]=b,e[23]=r,e[24]=q):q=e[24];const O=q;let N;e[25]!==m||e[26]!==O?(N=()=>{O(m)},e[25]=m,e[26]=O,e[27]=N):N=e[27];const $=o==null?void 0:o.id;let U;e[28]!==m||e[29]!==O||e[30]!==$?(U=[m,$,O],e[28]=m,e[29]=O,e[30]=$,e[31]=U):U=e[31],y.useEffect(N,U);let H;e[32]!==D||e[33]!==b||e[34]!==k?(H={user:k.user,userLoginState:k,loginUser:D,logoutUser:b},e[32]=D,e[33]=b,e[34]=k,e[35]=H):H=e[35];const G=H;let I;return e[36]!==l||e[37]!==G?(I=S.jsx(s.UserContext.Provider,{value:G,children:l}),e[36]=l,e[37]=G,e[38]=I):I=e[38],I};function ce(){}const K=()=>{const t=s.compilerRuntimeExports.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=S.jsx("p",{children:"Redirecting..."}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=S.jsxs("div",{children:[e,S.jsxs("p",{children:["If you are not redirected within 10 seconds, please click"," ",S.jsx("a",{href:window.location.href.replace("/blank","/"),children:"here"})]})]}),t[1]=l):l=t[1],l},ae=t=>{const e=t==null?void 0:t.getActiveAccount();console.log("getTokenMsal activeAccount",e);const l=t==null?void 0:t.getAllAccounts();console.log("getTokenMsal allAccounts",l);const c=(l==null?void 0:l.at(0))??void 0;return console.log("getTokenMsal account",c),c?(e||t==null||t.setActiveAccount(c),c):null},ue=({...t})=>{const{inProgress:e}=z.useMsal(),{cookieDomain:l}=y.useContext(s.LuminusComponentsContext),[,c]=s.useCookies(["Authorization"]),n=y.useMemo(()=>t.useMsal?t.msalInstance:null,[t.useMsal,t.useMsal?t.msalInstance:null]),u=y.useMemo(()=>t.useMsal?t.msalScopes:[],[t.useMsal,t.useMsal?t.msalScopes:null]),o=y.useMemo(()=>t.useMsal?t.msalExtraScopes:[],[t.useMsal,t.useMsal?t.msalExtraScopes:null]),r=y.useRef(null),p=y.useRef(!1),v=y.useCallback(()=>{const i=localStorage.getItem("token");return i?{token:i,expiresOn:B.addYears(new Date(Date.now()),1)}:null},[]),m=y.useCallback(async()=>{if(console.log("getTokenMsal"),n==null)throw console.log("getTokenMsal throwing error because msalInstance is null"),new Error("getTokenMsal: msalInstance is null");if(r.current)return console.log("getTokenMsal returning tokenRequestPromise.current",r.current),r.current;const i=new Promise((a,d)=>{const g=()=>{const h=ae(n);if(!h){console.log("getTokenMsal no account found. Redirecting to login"),n==null||n.loginRedirect({scopes:u,extraScopesToConsent:o});return}n==null||n.acquireTokenSilent({scopes:u,account:h,redirectUri:t.useMsal?t.msalSilentRedirectUri:void 0}).then(f=>{r.current=null,a({token:f.accessToken,expiresOn:f.expiresOn??new Date(Date.now())})}).catch(f=>{console.error("Error acquiring token",f),f instanceof R.InteractionRequiredAuthError&&(console.log("Silent token acquisition failed. Acquiring token using redirect"),n==null||n.acquireTokenRedirect({scopes:u,extraScopesToConsent:o}),r.current=null,a(null)),r.current=null,d(f)}).finally(()=>{r.current=null,d(new Error("No access token returned from handleRedirectPromise"))})};if(console.log("getTokenMsal promise"),e!==R.InteractionStatus.None){console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None",e),d(new Error("Authentication in progress"));return}p.current?g():n.handleRedirectPromise().then(h=>{if(console.log("getTokenMsal tokenResponse",h),!(h!=null&&h.accessToken)){g();return}r.current=null,a({token:h.accessToken,expiresOn:h.expiresOn??new Date(Date.now())})})});return r.current=i,i},[e,o,n,u,t.msalSilentRedirectUri,t.useMsal]),C=y.useCallback(async()=>t.useMsal?m():v(),[v,m,t.useMsal]),x=y.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:n,msalScopes:u,msalExtraScopes:o,getToken:C}),[t.useMsal,n,u,o,C]);return y.useEffect(()=>{if(t.useMsal&&n){const i=n.addEventCallback(a=>{if(a.eventType===R.EventType.LOGIN_SUCCESS||a.eventType===R.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const d=a.payload,g=d.account;n.setActiveAccount(g);const h=d.accessToken,f=d.expiresOn;c("Authorization",h,{path:"/",secure:!0,sameSite:"none",domain:l,expires:f??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{i&&n.removeEventCallback(i)}}return()=>{}},[t.useMsal,n,c,l]),S.jsx(s.AuthContext.Provider,{value:x,children:t.useMsal?S.jsx(z.MsalProvider,{instance:t.msalInstance,children:window.location.pathname==="/blank"?S.jsx(K,{}):t.children}):window.location.pathname==="/blank"?S.jsx(K,{}):t.children})},de=t=>{const e=s.compilerRuntimeExports.c(18),{children:l,relativeEndpoint:c}=t,[n,u,o]=V.useLocalStorageState("user-delegation",null);let r;e:{if(!n){r=null;break e}const w=n.from?s.parseISO(n.from):Z(),E=n.to?s.parseISO(n.to):X();if(!Y(new Date(Date.now()),{start:w,end:E})){u(null),r=null;break e}r=n}const p=r;let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={nullStateBeforeLoad:!1,nullStateOnFail:!0},e[0]=v):v=e[0];const{data:m,setData:C,reloadData:x}=V.useGetApiData(c,v),i=y.useRef(null);let a,d;e[1]!==x?(a=()=>{const w=()=>{x(),i.current=window.setTimeout(w,s.msToStartOfNextDay()+5e3)};return w(),()=>{i.current!==null&&window.clearTimeout(i.current)}},d=[x],e[1]=x,e[2]=a,e[3]=d):(a=e[2],d=e[3]),y.useEffect(a,d);let g;e[4]!==o?(g=()=>{const w=()=>{o()};return window.addEventListener("focus",w),()=>{window.removeEventListener("focus",w)}},e[4]=o,e[5]=g):g=e[5];let h;e[6]!==o||e[7]!==x?(h=[o,x],e[6]=o,e[7]=x,e[8]=h):h=e[8],y.useEffect(g,h);let f;e[9]!==m||e[10]!==x||e[11]!==C||e[12]!==u||e[13]!==p?(f={delegation:p,setDelegation:u,availableDelegations:m,setAvailableDelegations:C,refreshAvailableDelegations:x},e[9]=m,e[10]=x,e[11]=C,e[12]=u,e[13]=p,e[14]=f):f=e[14];const k=f;let T;return e[15]!==l||e[16]!==k?(T=S.jsx(s.DelegationContext.Provider,{value:k,children:l}),e[15]=l,e[16]=k,e[17]=T):T=e[17],T},J=(t,e)=>t?`${t} | ${e}`:e,fe=t=>{const e=s.compilerRuntimeExports.c(18),{defaultHelmet:l,children:c,helmetPrefix:n}=t,u=n??"";let o;e[0]!==l||e[1]!==u?(o=J(u,l),e[0]=l,e[1]=u,e[2]=o):o=e[2];let r;e[3]!==o?(r=[o],e[3]=o,e[4]=r):r=e[4];const[p,v]=y.useState(r);let m;e[5]!==n?(m=T=>{v(w=>[...w,J(n??"",T)])},e[5]=n,e[6]=m):m=e[6];const C=m;let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{v(me)},e[7]=x):x=e[7];const i=x;let a;e[8]!==p?(a=p.at(-1)??"",e[8]=p,e[9]=a):a=e[9];const d=a;let g;e[10]!==C?(g={addHelmet:C,removeHelmet:i},e[10]=C,e[11]=g):g=e[11];const h=g;let f;e[12]!==d?(f=S.jsx("title",{children:d}),e[12]=d,e[13]=f):f=e[13];let k;return e[14]!==c||e[15]!==h||e[16]!==f?(k=S.jsxs(s.HelmetContext.Provider,{value:h,children:[f,c]}),e[14]=c,e[15]=h,e[16]=f,e[17]=k):k=e[17],k};function me(t){return t.length>1?t.slice(0,-1):t}const W=50,xe=()=>{const t=s.compilerRuntimeExports.c(22),{texts:e}=y.useContext(s.LuminusComponentsContext),{confirm:l}=e,{onConfirm:c,onCancel:n,text:u,show:o,textSm:r}=s.useConfirm(),p=r===void 0?u.length>W:r,v=u.length>W;let m;t[0]!==n||t[1]!==c||t[2]!==o?(m=f=>{if(o)e:switch(f.key){case"Enter":{f.preventDefault(),f.stopPropagation(),c();break e}case"Escape":{f.preventDefault(),f.stopPropagation(),n();break e}}},t[0]=n,t[1]=c,t[2]=o,t[3]=m):m=t[3];const C=m;s.useKeyPress(C);const x=v?void 0:"sm";let i;t[4]!==p||t[5]!==u?(i=S.jsx(s.Modal.Header,{className:"justify-content-center",children:p?S.jsx(s.Typography,{variant:"body",children:u}):S.jsx(s.Modal.Title,{children:u})}),t[4]=p,t[5]=u,t[6]=i):i=t[6];let a;t[7]!==l.no||t[8]!==n?(a=S.jsx(s.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:n,children:l.no}),t[7]=l.no,t[8]=n,t[9]=a):a=t[9];let d;t[10]!==l.yes||t[11]!==c?(d=S.jsx(s.PrimaryButton,{type:"button",color:"primary",onClick:c,className:"w-100 ml",children:l.yes}),t[10]=l.yes,t[11]=c,t[12]=d):d=t[12];let g;t[13]!==a||t[14]!==d?(g=S.jsx(s.Modal.Body,{children:S.jsxs("div",{className:"w-100 d-flex gap-5",children:[a,d]})}),t[13]=a,t[14]=d,t[15]=g):g=t[15];let h;return t[16]!==n||t[17]!==o||t[18]!==x||t[19]!==i||t[20]!==g?(h=S.jsxs(s.Modal,{show:o,size:x,centered:!0,onHide:n,children:[i,g]}),t[16]=n,t[17]=o,t[18]=x,t[19]=i,t[20]=g,t[21]=h):h=t[21],h};exports.AuthContext=s.AuthContext;exports.DelegationContext=s.DelegationContext;exports.FormDisabledContext=s.FormDisabledContext;exports.HelmetContext=s.HelmetContext;exports.LoadingContext=s.LoadingContext;exports.LuminusComponentsContext=s.LuminusComponentsContext;exports.UserContext=s.UserContext;exports.useFormDisabledContext=s.useFormDisabledContext;exports.FormDisabledProvider=B.FormDisabledProvider;exports.AuthProvider=ue;exports.DelegationProvider=de;exports.HelmetProvider=fe;exports.LoadingProvider=re;exports.LuminusComponentsProvider=le;exports.UserProvider=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar-C1VYGnTR.cjs"),S=require("react/jsx-runtime"),p=require("react"),R=require("@azure/msal-browser"),z=require("@azure/msal-react");require("react-router");require("react-dom");require("react-hook-form");require("react-flexmonster");const F=require("./FormDisabledProvider-CiGUtSf7.cjs"),V=require("./useLocalStorageState-AB4BFfn5.cjs");function Q(t){const e=s.toDate(t);return e.setHours(23,59,59,999),e}function X(){return Q(Date.now())}function Y(t,e){const l=+s.toDate(t),[c,n]=[+s.toDate(e.start),+s.toDate(e.end)].sort((u,o)=>u-o);return l>=c&&l<=n}function Z(){return s.startOfDay(Date.now())}const ee=t=>{const e=s.compilerRuntimeExports.c(10),{children:l}=t,[c,n]=p.useState(!1),[u,o]=p.useState(""),[i,v]=p.useState(void 0);let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=(x,h)=>{n(!0),o(x),v(h)},e[0]=y):y=e[0];const f=y;let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{n(!1)},e[1]=C):C=e[1];const m=C;let r;e[2]!==c||e[3]!==u||e[4]!==i?(r={show:c,text:u,showConfirm:f,hideConfirm:m,textSm:i},e[2]=c,e[3]=u,e[4]=i,e[5]=r):r=e[5];const a=r;let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=S.jsx(xe,{}),e[6]=d):d=e[6];let g;return e[7]!==l||e[8]!==a?(g=S.jsxs(s.ConfirmContext.Provider,{value:a,children:[d,l]}),e[7]=l,e[8]=a,e[9]=g):g=e[9],g},te=()=>{const t=s.compilerRuntimeExports.c(43),{texts:e}=p.useContext(s.LuminusComponentsContext),{confirm:l}=e,{isShown:c,text:n,onFinish:u}=s.usePrompt(),{options:o}=p.useContext(s.PromptContext),[i,v]=p.useState(o.defaultValue??"");let y;t[0]!==u?(y=()=>{u(null)},t[0]=u,t[1]=y):y=t[1];const f=y;let C;t[2]!==u||t[3]!==o.required||t[4]!==i?(C=A=>{A.preventDefault(),!(o.required&&!i)&&(u(i),v(""))},t[2]=u,t[3]=o.required,t[4]=i,t[5]=C):C=t[5];const m=C;let r;t[6]===Symbol.for("react.memo_cache_sentinel")?(r=A=>v(A.currentTarget.value),t[6]=r):r=t[6];let a;t[7]!==i?(a={value:i,onChange:r,className:"w-100",autoFocus:!0,tabIndex:0},t[7]=i,t[8]=a):a=t[8];const d=a;let g,x;t[9]!==c||t[10]!==o.defaultValue?(g=()=>{c===!0&&v(o.defaultValue??"")},x=[c,o.defaultValue],t[9]=c,t[10]=o.defaultValue,t[11]=g,t[12]=x):(g=t[11],x=t[12]),p.useEffect(g,x);let h;t[13]!==n?(h=S.jsx(s.Modal.Header,{className:"justify-content-center",children:S.jsx(s.Modal.Title,{children:n})}),t[13]=n,t[14]=h):h=t[14];let k;t[15]!==d||t[16]!==o.input?(k=o.input==="textarea"?S.jsx("textarea",{...d,rows:5}):void 0,t[15]=d,t[16]=o.input,t[17]=k):k=t[17];let T;t[18]!==d||t[19]!==o.input||t[20]!==o.type?(T=o.input==="input"?S.jsx(s.FormControl,{...d,type:o.type}):void 0,t[18]=d,t[19]=o.input,t[20]=o.type,t[21]=T):T=t[21];let w;t[22]!==k||t[23]!==T?(w=S.jsxs(s.Modal.Body,{children:[k,T]}),t[22]=k,t[23]=T,t[24]=w):w=t[24];let E;t[25]!==l.cancel||t[26]!==f?(E=S.jsx(s.PrimaryButton,{variant:"outlined",color:"secondary",onClick:f,className:"flex-grow-1",children:l.cancel}),t[25]=l.cancel,t[26]=f,t[27]=E):E=t[27];const L=o.required&&!i;let b;t[28]!==l.confirm||t[29]!==L?(b=S.jsx(s.PrimaryButton,{color:"primary",disabled:L,type:"submit",className:"flex-grow-1",children:l.confirm}),t[28]=l.confirm,t[29]=L,t[30]=b):b=t[30];let M;t[31]!==E||t[32]!==b?(M=S.jsxs(s.Modal.Footer,{className:"w-100 d-flex gap-5",children:[E,b]}),t[31]=E,t[32]=b,t[33]=M):M=t[33];let D;t[34]!==m||t[35]!==w||t[36]!==M?(D=S.jsxs("form",{onSubmit:m,onKeyDown:ne,children:[w,M]}),t[34]=m,t[35]=w,t[36]=M,t[37]=D):D=t[37];let j;return t[38]!==c||t[39]!==f||t[40]!==D||t[41]!==h?(j=S.jsxs(s.Modal,{show:c,size:"sm",centered:!0,onHide:f,children:[h,D]}),t[38]=c,t[39]=f,t[40]=D,t[41]=h,t[42]=j):j=t[42],j};function ne(t){return t.stopPropagation()}const oe=t=>{const e=s.compilerRuntimeExports.c(11),{children:l}=t,[c,n]=p.useState(!1),[u,o]=p.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={input:"textarea",type:"text"},e[0]=i):i=e[0];const[v,y]=p.useState(i),f=p.useRef(se);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=k=>{o(k),n(!0)},e[1]=C):C=e[1];const m=C;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{n(!1)},e[2]=r):r=e[2];const a=r;let d;e[3]!==c||e[4]!==v||e[5]!==u?(d={isShown:c,text:u,showPrompt:m,hidePrompt:a,resolveRef:f,options:v,setOptions:y},e[3]=c,e[4]=v,e[5]=u,e[6]=d):d=e[6];const g=d;let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=S.jsx(te,{}),e[7]=x):x=e[7];let h;return e[8]!==l||e[9]!==g?(h=S.jsxs(s.PromptContext.Provider,{value:g,children:[l,x]}),e[8]=l,e[9]=g,e[10]=h):h=e[10],h};function se(){}const le=t=>{const e=s.compilerRuntimeExports.c(14),{cookieDomain:l,axiosOptions:c,language:n,texts:u,ProjectIconComponent:o,localizationContext:i,chartColorPalette:v,children:y}=t;let f;e[0]!==o||e[1]!==c||e[2]!==v||e[3]!==l||e[4]!==n||e[5]!==i||e[6]!==u?(f={axiosOptions:c,cookieDomain:l,language:n,texts:u,ProjectIconComponent:o,localizationContext:i,chartColorPalette:v},e[0]=o,e[1]=c,e[2]=v,e[3]=l,e[4]=n,e[5]=i,e[6]=u,e[7]=f):f=e[7];const C=f;let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=S.jsx(s.Fe,{}),e[8]=m):m=e[8];let r;e[9]!==y?(r=S.jsx(ee,{children:S.jsxs(oe,{children:[m,y]})}),e[9]=y,e[10]=r):r=e[10];let a;return e[11]!==C||e[12]!==r?(a=S.jsx(s.LuminusComponentsContext.Provider,{value:C,children:r}),e[11]=C,e[12]=r,e[13]=a):a=e[13],a},re=t=>{const e=s.compilerRuntimeExports.c(15),{children:l}=t,[c,n]=p.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[0]=u):u=e[0];const[o]=p.useState(u);let i;e[1]!==o?(i=d=>{o.add(d),n(!0)},e[1]=o,e[2]=i):i=e[2];const v=i;let y;e[3]!==o?(y=d=>{o.delete(d),o.size===0&&n(!1)},e[3]=o,e[4]=y):y=e[4];const f=y;let C;e[5]!==c||e[6]!==v||e[7]!==f?(C={isLoading:c,startLoading:v,stopLoading:f},e[5]=c,e[6]=v,e[7]=f,e[8]=C):C=e[8];const m=C;let r;e[9]!==c?(r=c&&S.jsx(F.Loading,{}),e[9]=c,e[10]=r):r=e[10];let a;return e[11]!==l||e[12]!==m||e[13]!==r?(a=S.jsxs(s.LoadingContext.Provider,{value:m,children:[r,l]}),e[11]=l,e[12]=m,e[13]=r,e[14]=a):a=e[14],a},ie=t=>{const e=s.compilerRuntimeExports.c(39),{children:l}=t,c=s.useAxios(),{msalInstance:n,getToken:u}=p.useContext(s.AuthContext),{delegation:o,setDelegation:i,setAvailableDelegations:v,refreshAvailableDelegations:y}=p.useContext(s.DelegationContext),[f,C]=p.useState(null);let m;e[0]!==u?(m=async()=>{const P=await u();P&&C(P.token)},e[0]=u,e[1]=m):m=e[1];const r=m;let a,d;e[2]!==r?(a=()=>{r()},d=[r],e[2]=r,e[3]=a,e[4]=d):(a=e[3],d=e[4]),p.useEffect(a,d);let g;if(e[5]===Symbol.for("react.memo_cache_sentinel")){e:{const P=localStorage.getItem("user")??null;if(!P){g=null;break e}g=JSON.parse(P??"")}e[5]=g}else g=e[5];const x=g;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={state:x?s.LoginState.LOGGED_IN:s.LoginState.LOGGED_OUT,user:x},e[6]=h):h=e[6];const[k,T]=p.useState(h);let w;e[7]!==c?(w=async P=>{let _=null;return await c.get("/user/detail",P?{headers:{Authorization:`Bearer ${P}`}}:void 0).then(B=>{_=B.data}).catch(()=>{_=null}),_},e[7]=c,e[8]=w):w=e[8];const E=w;let L;e[9]!==v||e[10]!==i?(L=()=>{localStorage.removeItem("user"),T({state:s.LoginState.LOGGED_OUT,user:null}),i(null),v(null)},e[9]=v,e[10]=i,e[11]=L):L=e[11];const b=L;let M;e[12]!==E||e[13]!==y?(M=async P=>{T({state:s.LoginState.LOGGING_IN,user:null});const _=await E(P);return _?(T({state:s.LoginState.LOGGED_IN,user:_}),localStorage.setItem("user",JSON.stringify(_)),await y(),!0):(T({state:s.LoginState.LOGIN_FAILED,user:null}),!1)},e[12]=E,e[13]=y,e[14]=M):M=e[14];const D=M;let j;e[15]!==n?(j=()=>{if(n){const P=n.addEventCallback(_=>{if(_.eventType===R.EventType.LOGIN_SUCCESS&&_.payload){const B=_.payload;C(B.accessToken)}});return()=>{P&&n.removeEventCallback(P)}}return ce},e[15]=n,e[16]=j):j=e[16];let A;e[17]!==D||e[18]!==b||e[19]!==n?(A=[n,D,b],e[17]=D,e[18]=b,e[19]=n,e[20]=A):A=e[20],p.useEffect(j,A);let q;e[21]!==D||e[22]!==b||e[23]!==i?(q=async P=>{P&&await D(P).catch(()=>{b(),i(null)})},e[21]=D,e[22]=b,e[23]=i,e[24]=q):q=e[24];const O=q;let N;e[25]!==f||e[26]!==O?(N=()=>{O(f)},e[25]=f,e[26]=O,e[27]=N):N=e[27];const $=o==null?void 0:o.id;let U;e[28]!==f||e[29]!==O||e[30]!==$?(U=[f,$,O],e[28]=f,e[29]=O,e[30]=$,e[31]=U):U=e[31],p.useEffect(N,U);let H;e[32]!==D||e[33]!==b||e[34]!==k?(H={user:k.user,userLoginState:k,loginUser:D,logoutUser:b},e[32]=D,e[33]=b,e[34]=k,e[35]=H):H=e[35];const G=H;let I;return e[36]!==l||e[37]!==G?(I=S.jsx(s.UserContext.Provider,{value:G,children:l}),e[36]=l,e[37]=G,e[38]=I):I=e[38],I};function ce(){}const K=()=>{const t=s.compilerRuntimeExports.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=S.jsx("p",{children:"Redirecting..."}),t[0]=e):e=t[0];let l;return t[1]===Symbol.for("react.memo_cache_sentinel")?(l=S.jsxs("div",{children:[e,S.jsxs("p",{children:["If you are not redirected within 10 seconds, please click"," ",S.jsx("a",{href:window.location.href.replace("/blank","/"),children:"here"})]})]}),t[1]=l):l=t[1],l},ae=t=>{const e=t==null?void 0:t.getActiveAccount();console.log("getTokenMsal activeAccount",e);const l=t==null?void 0:t.getAllAccounts();console.log("getTokenMsal allAccounts",l);const c=(l==null?void 0:l.at(0))??void 0;return console.log("getTokenMsal account",c),c?(e||t==null||t.setActiveAccount(c),c):null},ue=({...t})=>{const{inProgress:e}=z.useMsal(),{cookieDomain:l}=p.useContext(s.LuminusComponentsContext),[,c]=s.useCookies(["Authorization"]),n=p.useMemo(()=>t.useMsal?t.msalInstance:null,[t.useMsal,t.useMsal?t.msalInstance:null]),u=p.useMemo(()=>t.useMsal?t.msalScopes:[],[t.useMsal,t.useMsal?t.msalScopes:null]),o=p.useMemo(()=>t.useMsal?t.msalExtraScopes:[],[t.useMsal,t.useMsal?t.msalExtraScopes:null]),i=p.useRef(null),v=p.useRef(!1),y=p.useCallback(()=>{const r=localStorage.getItem("token");return r?{token:r,expiresOn:F.addYears(new Date(Date.now()),1)}:null},[]),f=p.useCallback(async()=>{if(console.log("getTokenMsal"),n==null)throw console.log("getTokenMsal throwing error because msalInstance is null"),new Error("getTokenMsal: msalInstance is null");if(i.current)return console.log("getTokenMsal returning tokenRequestPromise.current",i.current),i.current;const r=new Promise((a,d)=>{const g=x=>{const h=ae(n);if(!h){console.log("getTokenMsal no account found. Redirecting to login"),n==null||n.loginRedirect({scopes:u,extraScopesToConsent:o});return}n==null||n.acquireTokenSilent({scopes:u,account:h,redirectUri:t.useMsal?t.msalSilentRedirectUri:void 0}).then(k=>{x(),a({token:k.accessToken,expiresOn:k.expiresOn??new Date(Date.now())})}).catch(k=>{console.error("Error acquiring token",k),k instanceof R.InteractionRequiredAuthError&&(console.log("Silent token acquisition failed. Acquiring token using redirect"),n==null||n.acquireTokenRedirect({scopes:u,extraScopesToConsent:o}),x(),a(null)),x(),d(k)}).finally(()=>{x(),d(new Error("No access token returned from handleRedirectPromise"))})};if(console.log("getTokenMsal promise"),e!==R.InteractionStatus.None){console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None",e),d(new Error("Authentication in progress"));return}v.current?g(()=>{i.current=null}):n.handleRedirectPromise().then(x=>{if(console.log("getTokenMsal tokenResponse",x),!(x!=null&&x.accessToken)){g(()=>{i.current=null,v.current=!0});return}i.current=null,v.current=!0,a({token:x.accessToken,expiresOn:x.expiresOn??new Date(Date.now())})})});return i.current=r,r},[e,o,n,u,t.msalSilentRedirectUri,t.useMsal]),C=p.useCallback(async()=>t.useMsal?f():y(),[y,f,t.useMsal]),m=p.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:n,msalScopes:u,msalExtraScopes:o,getToken:C}),[t.useMsal,n,u,o,C]);return p.useEffect(()=>{if(t.useMsal&&n){const r=n.addEventCallback(a=>{if(a.eventType===R.EventType.LOGIN_SUCCESS||a.eventType===R.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const d=a.payload,g=d.account;n.setActiveAccount(g);const x=d.accessToken,h=d.expiresOn;c("Authorization",x,{path:"/",secure:!0,sameSite:"none",domain:l,expires:h??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{r&&n.removeEventCallback(r)}}return()=>{}},[t.useMsal,n,c,l]),S.jsx(s.AuthContext.Provider,{value:m,children:t.useMsal?S.jsx(z.MsalProvider,{instance:t.msalInstance,children:window.location.pathname==="/blank"?S.jsx(K,{}):t.children}):window.location.pathname==="/blank"?S.jsx(K,{}):t.children})},de=t=>{const e=s.compilerRuntimeExports.c(18),{children:l,relativeEndpoint:c}=t,[n,u,o]=V.useLocalStorageState("user-delegation",null);let i;e:{if(!n){i=null;break e}const w=n.from?s.parseISO(n.from):Z(),E=n.to?s.parseISO(n.to):X();if(!Y(new Date(Date.now()),{start:w,end:E})){u(null),i=null;break e}i=n}const v=i;let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={nullStateBeforeLoad:!1,nullStateOnFail:!0},e[0]=y):y=e[0];const{data:f,setData:C,reloadData:m}=V.useGetApiData(c,y),r=p.useRef(null);let a,d;e[1]!==m?(a=()=>{const w=()=>{m(),r.current=window.setTimeout(w,s.msToStartOfNextDay()+5e3)};return w(),()=>{r.current!==null&&window.clearTimeout(r.current)}},d=[m],e[1]=m,e[2]=a,e[3]=d):(a=e[2],d=e[3]),p.useEffect(a,d);let g;e[4]!==o?(g=()=>{const w=()=>{o()};return window.addEventListener("focus",w),()=>{window.removeEventListener("focus",w)}},e[4]=o,e[5]=g):g=e[5];let x;e[6]!==o||e[7]!==m?(x=[o,m],e[6]=o,e[7]=m,e[8]=x):x=e[8],p.useEffect(g,x);let h;e[9]!==f||e[10]!==m||e[11]!==C||e[12]!==u||e[13]!==v?(h={delegation:v,setDelegation:u,availableDelegations:f,setAvailableDelegations:C,refreshAvailableDelegations:m},e[9]=f,e[10]=m,e[11]=C,e[12]=u,e[13]=v,e[14]=h):h=e[14];const k=h;let T;return e[15]!==l||e[16]!==k?(T=S.jsx(s.DelegationContext.Provider,{value:k,children:l}),e[15]=l,e[16]=k,e[17]=T):T=e[17],T},J=(t,e)=>t?`${t} | ${e}`:e,fe=t=>{const e=s.compilerRuntimeExports.c(18),{defaultHelmet:l,children:c,helmetPrefix:n}=t,u=n??"";let o;e[0]!==l||e[1]!==u?(o=J(u,l),e[0]=l,e[1]=u,e[2]=o):o=e[2];let i;e[3]!==o?(i=[o],e[3]=o,e[4]=i):i=e[4];const[v,y]=p.useState(i);let f;e[5]!==n?(f=T=>{y(w=>[...w,J(n??"",T)])},e[5]=n,e[6]=f):f=e[6];const C=f;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{y(me)},e[7]=m):m=e[7];const r=m;let a;e[8]!==v?(a=v.at(-1)??"",e[8]=v,e[9]=a):a=e[9];const d=a;let g;e[10]!==C?(g={addHelmet:C,removeHelmet:r},e[10]=C,e[11]=g):g=e[11];const x=g;let h;e[12]!==d?(h=S.jsx("title",{children:d}),e[12]=d,e[13]=h):h=e[13];let k;return e[14]!==c||e[15]!==x||e[16]!==h?(k=S.jsxs(s.HelmetContext.Provider,{value:x,children:[h,c]}),e[14]=c,e[15]=x,e[16]=h,e[17]=k):k=e[17],k};function me(t){return t.length>1?t.slice(0,-1):t}const W=50,xe=()=>{const t=s.compilerRuntimeExports.c(22),{texts:e}=p.useContext(s.LuminusComponentsContext),{confirm:l}=e,{onConfirm:c,onCancel:n,text:u,show:o,textSm:i}=s.useConfirm(),v=i===void 0?u.length>W:i,y=u.length>W;let f;t[0]!==n||t[1]!==c||t[2]!==o?(f=h=>{if(o)e:switch(h.key){case"Enter":{h.preventDefault(),h.stopPropagation(),c();break e}case"Escape":{h.preventDefault(),h.stopPropagation(),n();break e}}},t[0]=n,t[1]=c,t[2]=o,t[3]=f):f=t[3];const C=f;s.useKeyPress(C);const m=y?void 0:"sm";let r;t[4]!==v||t[5]!==u?(r=S.jsx(s.Modal.Header,{className:"justify-content-center",children:v?S.jsx(s.Typography,{variant:"body",children:u}):S.jsx(s.Modal.Title,{children:u})}),t[4]=v,t[5]=u,t[6]=r):r=t[6];let a;t[7]!==l.no||t[8]!==n?(a=S.jsx(s.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:n,children:l.no}),t[7]=l.no,t[8]=n,t[9]=a):a=t[9];let d;t[10]!==l.yes||t[11]!==c?(d=S.jsx(s.PrimaryButton,{type:"button",color:"primary",onClick:c,className:"w-100 ml",children:l.yes}),t[10]=l.yes,t[11]=c,t[12]=d):d=t[12];let g;t[13]!==a||t[14]!==d?(g=S.jsx(s.Modal.Body,{children:S.jsxs("div",{className:"w-100 d-flex gap-5",children:[a,d]})}),t[13]=a,t[14]=d,t[15]=g):g=t[15];let x;return t[16]!==n||t[17]!==o||t[18]!==m||t[19]!==r||t[20]!==g?(x=S.jsxs(s.Modal,{show:o,size:m,centered:!0,onHide:n,children:[r,g]}),t[16]=n,t[17]=o,t[18]=m,t[19]=r,t[20]=g,t[21]=x):x=t[21],x};exports.AuthContext=s.AuthContext;exports.DelegationContext=s.DelegationContext;exports.FormDisabledContext=s.FormDisabledContext;exports.HelmetContext=s.HelmetContext;exports.LoadingContext=s.LoadingContext;exports.LuminusComponentsContext=s.LuminusComponentsContext;exports.UserContext=s.UserContext;exports.useFormDisabledContext=s.useFormDisabledContext;exports.FormDisabledProvider=F.FormDisabledProvider;exports.AuthProvider=ue;exports.DelegationProvider=de;exports.HelmetProvider=fe;exports.LoadingProvider=re;exports.LuminusComponentsProvider=le;exports.UserProvider=ie;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as j, bK as ce, c as A, bL as ae, Q as J, am as ue, bM as se, a4 as O, aj as fe, R as V, bN as de, aq as me, ao as he, bc as re, bx as ie, be as G, ap as ge, bO as Se, aE as te, bP as xe, bQ as ye, an as ve, b7 as be, a5 as ke } from "./nivo-bar-BHzU38wt.js";
|
|
2
2
|
import { bR as ct, ag as at } from "./nivo-bar-BHzU38wt.js";
|
|
3
|
-
import { jsxs as D, jsx as
|
|
3
|
+
import { jsxs as D, jsx as b } from "react/jsx-runtime";
|
|
4
4
|
import { useState as _, useContext as H, useEffect as U, useRef as Q, useMemo as K, useCallback as Z } from "react";
|
|
5
5
|
import { EventType as ee, InteractionStatus as we, InteractionRequiredAuthError as Te } from "@azure/msal-browser";
|
|
6
6
|
import { useMsal as pe, MsalProvider as Ce } from "@azure/msal-react";
|
|
@@ -31,28 +31,28 @@ function Oe() {
|
|
|
31
31
|
const Ne = (t) => {
|
|
32
32
|
const e = A.c(10), {
|
|
33
33
|
children: l
|
|
34
|
-
} = t, [i, n] = _(!1), [a, o] = _(""), [
|
|
35
|
-
let
|
|
36
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
37
|
-
n(!0), o(
|
|
38
|
-
}, e[0] =
|
|
39
|
-
const
|
|
34
|
+
} = t, [i, n] = _(!1), [a, o] = _(""), [r, x] = _(void 0);
|
|
35
|
+
let y;
|
|
36
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (y = (m, g) => {
|
|
37
|
+
n(!0), o(m), x(g);
|
|
38
|
+
}, e[0] = y) : y = e[0];
|
|
39
|
+
const f = y;
|
|
40
40
|
let S;
|
|
41
41
|
e[1] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
|
|
42
42
|
n(!1);
|
|
43
43
|
}, e[1] = S) : S = e[1];
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
e[2] !== i || e[3] !== a || e[4] !==
|
|
44
|
+
const d = S;
|
|
45
|
+
let s;
|
|
46
|
+
e[2] !== i || e[3] !== a || e[4] !== r ? (s = {
|
|
47
47
|
show: i,
|
|
48
48
|
text: a,
|
|
49
|
-
showConfirm:
|
|
50
|
-
hideConfirm:
|
|
51
|
-
textSm:
|
|
52
|
-
}, e[2] = i, e[3] = a, e[4] =
|
|
53
|
-
const c =
|
|
49
|
+
showConfirm: f,
|
|
50
|
+
hideConfirm: d,
|
|
51
|
+
textSm: r
|
|
52
|
+
}, e[2] = i, e[3] = a, e[4] = r, e[5] = s) : s = e[5];
|
|
53
|
+
const c = s;
|
|
54
54
|
let u;
|
|
55
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
55
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ b(ze, {}), e[6] = u) : u = e[6];
|
|
56
56
|
let h;
|
|
57
57
|
return e[7] !== l || e[8] !== c ? (h = /* @__PURE__ */ D(ae.Provider, { value: c, children: [
|
|
58
58
|
u,
|
|
@@ -69,63 +69,63 @@ const Ne = (t) => {
|
|
|
69
69
|
onFinish: a
|
|
70
70
|
} = ue(), {
|
|
71
71
|
options: o
|
|
72
|
-
} = H(se), [
|
|
73
|
-
let
|
|
74
|
-
t[0] !== a ? (
|
|
72
|
+
} = H(se), [r, x] = _(o.defaultValue ?? "");
|
|
73
|
+
let y;
|
|
74
|
+
t[0] !== a ? (y = () => {
|
|
75
75
|
a(null);
|
|
76
|
-
}, t[0] = a, t[1] =
|
|
77
|
-
const
|
|
76
|
+
}, t[0] = a, t[1] = y) : y = t[1];
|
|
77
|
+
const f = y;
|
|
78
78
|
let S;
|
|
79
|
-
t[2] !== a || t[3] !== o.required || t[4] !==
|
|
80
|
-
R.preventDefault(), !(o.required && !
|
|
81
|
-
}, t[2] = a, t[3] = o.required, t[4] =
|
|
82
|
-
const
|
|
83
|
-
let
|
|
84
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
79
|
+
t[2] !== a || t[3] !== o.required || t[4] !== r ? (S = (R) => {
|
|
80
|
+
R.preventDefault(), !(o.required && !r) && (a(r), x(""));
|
|
81
|
+
}, t[2] = a, t[3] = o.required, t[4] = r, t[5] = S) : S = t[5];
|
|
82
|
+
const d = S;
|
|
83
|
+
let s;
|
|
84
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (s = (R) => x(R.currentTarget.value), t[6] = s) : s = t[6];
|
|
85
85
|
let c;
|
|
86
|
-
t[7] !==
|
|
87
|
-
value:
|
|
88
|
-
onChange:
|
|
86
|
+
t[7] !== r ? (c = {
|
|
87
|
+
value: r,
|
|
88
|
+
onChange: s,
|
|
89
89
|
className: "w-100",
|
|
90
90
|
autoFocus: !0,
|
|
91
91
|
tabIndex: 0
|
|
92
|
-
}, t[7] =
|
|
92
|
+
}, t[7] = r, t[8] = c) : c = t[8];
|
|
93
93
|
const u = c;
|
|
94
|
-
let h,
|
|
94
|
+
let h, m;
|
|
95
95
|
t[9] !== i || t[10] !== o.defaultValue ? (h = () => {
|
|
96
|
-
i === !0 &&
|
|
97
|
-
},
|
|
98
|
-
let
|
|
99
|
-
t[13] !== n ? (
|
|
100
|
-
let
|
|
101
|
-
t[15] !== u || t[16] !== o.input ? (
|
|
96
|
+
i === !0 && x(o.defaultValue ?? "");
|
|
97
|
+
}, m = [i, o.defaultValue], t[9] = i, t[10] = o.defaultValue, t[11] = h, t[12] = m) : (h = t[11], m = t[12]), U(h, m);
|
|
98
|
+
let g;
|
|
99
|
+
t[13] !== n ? (g = /* @__PURE__ */ b(O.Header, { className: "justify-content-center", children: /* @__PURE__ */ b(O.Title, { children: n }) }), t[13] = n, t[14] = g) : g = t[14];
|
|
100
|
+
let v;
|
|
101
|
+
t[15] !== u || t[16] !== o.input ? (v = o.input === "textarea" ? /* @__PURE__ */ b("textarea", { ...u, rows: 5 }) : void 0, t[15] = u, t[16] = o.input, t[17] = v) : v = t[17];
|
|
102
102
|
let w;
|
|
103
|
-
t[18] !== u || t[19] !== o.input || t[20] !== o.type ? (w = o.input === "input" ? /* @__PURE__ */
|
|
103
|
+
t[18] !== u || t[19] !== o.input || t[20] !== o.type ? (w = o.input === "input" ? /* @__PURE__ */ b(fe, { ...u, type: o.type }) : void 0, t[18] = u, t[19] = o.input, t[20] = o.type, t[21] = w) : w = t[21];
|
|
104
104
|
let k;
|
|
105
|
-
t[22] !==
|
|
106
|
-
|
|
105
|
+
t[22] !== v || t[23] !== w ? (k = /* @__PURE__ */ D(O.Body, { children: [
|
|
106
|
+
v,
|
|
107
107
|
w
|
|
108
|
-
] }), t[22] =
|
|
108
|
+
] }), t[22] = v, t[23] = w, t[24] = k) : k = t[24];
|
|
109
109
|
let P;
|
|
110
|
-
t[25] !== l.cancel || t[26] !==
|
|
111
|
-
const N = o.required && !
|
|
110
|
+
t[25] !== l.cancel || t[26] !== f ? (P = /* @__PURE__ */ b(V, { variant: "outlined", color: "secondary", onClick: f, className: "flex-grow-1", children: l.cancel }), t[25] = l.cancel, t[26] = f, t[27] = P) : P = t[27];
|
|
111
|
+
const N = o.required && !r;
|
|
112
112
|
let T;
|
|
113
|
-
t[28] !== l.confirm || t[29] !== N ? (T = /* @__PURE__ */
|
|
113
|
+
t[28] !== l.confirm || t[29] !== N ? (T = /* @__PURE__ */ b(V, { color: "primary", disabled: N, type: "submit", className: "flex-grow-1", children: l.confirm }), t[28] = l.confirm, t[29] = N, t[30] = T) : T = t[30];
|
|
114
114
|
let M;
|
|
115
115
|
t[31] !== P || t[32] !== T ? (M = /* @__PURE__ */ D(O.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
116
116
|
P,
|
|
117
117
|
T
|
|
118
118
|
] }), t[31] = P, t[32] = T, t[33] = M) : M = t[33];
|
|
119
119
|
let p;
|
|
120
|
-
t[34] !==
|
|
120
|
+
t[34] !== d || t[35] !== k || t[36] !== M ? (p = /* @__PURE__ */ D("form", { onSubmit: d, onKeyDown: Ue, children: [
|
|
121
121
|
k,
|
|
122
122
|
M
|
|
123
|
-
] }), t[34] =
|
|
123
|
+
] }), t[34] = d, t[35] = k, t[36] = M, t[37] = p) : p = t[37];
|
|
124
124
|
let L;
|
|
125
|
-
return t[38] !== i || t[39] !==
|
|
126
|
-
|
|
125
|
+
return t[38] !== i || t[39] !== f || t[40] !== p || t[41] !== g ? (L = /* @__PURE__ */ D(O, { show: i, size: "sm", centered: !0, onHide: f, children: [
|
|
126
|
+
g,
|
|
127
127
|
p
|
|
128
|
-
] }), t[38] = i, t[39] =
|
|
128
|
+
] }), t[38] = i, t[39] = f, t[40] = p, t[41] = g, t[42] = L) : L = t[42], L;
|
|
129
129
|
};
|
|
130
130
|
function Ue(t) {
|
|
131
131
|
return t.stopPropagation();
|
|
@@ -134,40 +134,40 @@ const $e = (t) => {
|
|
|
134
134
|
const e = A.c(11), {
|
|
135
135
|
children: l
|
|
136
136
|
} = t, [i, n] = _(!1), [a, o] = _("");
|
|
137
|
-
let
|
|
138
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
137
|
+
let r;
|
|
138
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {
|
|
139
139
|
input: "textarea",
|
|
140
140
|
type: "text"
|
|
141
|
-
}, e[0] =
|
|
142
|
-
const [
|
|
141
|
+
}, e[0] = r) : r = e[0];
|
|
142
|
+
const [x, y] = _(r), f = Q(Ge);
|
|
143
143
|
let S;
|
|
144
|
-
e[1] === Symbol.for("react.memo_cache_sentinel") ? (S = (
|
|
145
|
-
o(
|
|
144
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (S = (v) => {
|
|
145
|
+
o(v), n(!0);
|
|
146
146
|
}, e[1] = S) : S = e[1];
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
147
|
+
const d = S;
|
|
148
|
+
let s;
|
|
149
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (s = () => {
|
|
150
150
|
n(!1);
|
|
151
|
-
}, e[2] =
|
|
152
|
-
const c =
|
|
151
|
+
}, e[2] = s) : s = e[2];
|
|
152
|
+
const c = s;
|
|
153
153
|
let u;
|
|
154
|
-
e[3] !== i || e[4] !==
|
|
154
|
+
e[3] !== i || e[4] !== x || e[5] !== a ? (u = {
|
|
155
155
|
isShown: i,
|
|
156
156
|
text: a,
|
|
157
|
-
showPrompt:
|
|
157
|
+
showPrompt: d,
|
|
158
158
|
hidePrompt: c,
|
|
159
|
-
resolveRef:
|
|
160
|
-
options:
|
|
161
|
-
setOptions:
|
|
162
|
-
}, e[3] = i, e[4] =
|
|
159
|
+
resolveRef: f,
|
|
160
|
+
options: x,
|
|
161
|
+
setOptions: y
|
|
162
|
+
}, e[3] = i, e[4] = x, e[5] = a, e[6] = u) : u = e[6];
|
|
163
163
|
const h = u;
|
|
164
|
+
let m;
|
|
165
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ b(Re, {}), e[7] = m) : m = e[7];
|
|
164
166
|
let g;
|
|
165
|
-
e[
|
|
166
|
-
let f;
|
|
167
|
-
return e[8] !== l || e[9] !== h ? (f = /* @__PURE__ */ D(se.Provider, { value: h, children: [
|
|
167
|
+
return e[8] !== l || e[9] !== h ? (g = /* @__PURE__ */ D(se.Provider, { value: h, children: [
|
|
168
168
|
l,
|
|
169
|
-
|
|
170
|
-
] }), e[8] = l, e[9] = h, e[10] =
|
|
169
|
+
m
|
|
170
|
+
] }), e[8] = l, e[9] = h, e[10] = g) : g = e[10], g;
|
|
171
171
|
};
|
|
172
172
|
function Ge() {
|
|
173
173
|
}
|
|
@@ -178,30 +178,30 @@ const et = (t) => {
|
|
|
178
178
|
language: n,
|
|
179
179
|
texts: a,
|
|
180
180
|
ProjectIconComponent: o,
|
|
181
|
-
localizationContext:
|
|
182
|
-
chartColorPalette:
|
|
183
|
-
children:
|
|
181
|
+
localizationContext: r,
|
|
182
|
+
chartColorPalette: x,
|
|
183
|
+
children: y
|
|
184
184
|
} = t;
|
|
185
|
-
let
|
|
186
|
-
e[0] !== o || e[1] !== i || e[2] !==
|
|
185
|
+
let f;
|
|
186
|
+
e[0] !== o || e[1] !== i || e[2] !== x || e[3] !== l || e[4] !== n || e[5] !== r || e[6] !== a ? (f = {
|
|
187
187
|
axiosOptions: i,
|
|
188
188
|
cookieDomain: l,
|
|
189
189
|
language: n,
|
|
190
190
|
texts: a,
|
|
191
191
|
ProjectIconComponent: o,
|
|
192
|
-
localizationContext:
|
|
193
|
-
chartColorPalette:
|
|
194
|
-
}, e[0] = o, e[1] = i, e[2] =
|
|
195
|
-
const S =
|
|
196
|
-
let
|
|
197
|
-
e[8] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
198
|
-
let
|
|
199
|
-
e[9] !==
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
] }) }), e[9] =
|
|
192
|
+
localizationContext: r,
|
|
193
|
+
chartColorPalette: x
|
|
194
|
+
}, e[0] = o, e[1] = i, e[2] = x, e[3] = l, e[4] = n, e[5] = r, e[6] = a, e[7] = f) : f = e[7];
|
|
195
|
+
const S = f;
|
|
196
|
+
let d;
|
|
197
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ b(de, {}), e[8] = d) : d = e[8];
|
|
198
|
+
let s;
|
|
199
|
+
e[9] !== y ? (s = /* @__PURE__ */ b(Ne, { children: /* @__PURE__ */ D($e, { children: [
|
|
200
|
+
d,
|
|
201
|
+
y
|
|
202
|
+
] }) }), e[9] = y, e[10] = s) : s = e[10];
|
|
203
203
|
let c;
|
|
204
|
-
return e[11] !== S || e[12] !==
|
|
204
|
+
return e[11] !== S || e[12] !== s ? (c = /* @__PURE__ */ b(J.Provider, { value: S, children: s }), e[11] = S, e[12] = s, e[13] = c) : c = e[13], c;
|
|
205
205
|
}, tt = (t) => {
|
|
206
206
|
const e = A.c(15), {
|
|
207
207
|
children: l
|
|
@@ -209,30 +209,30 @@ const et = (t) => {
|
|
|
209
209
|
let a;
|
|
210
210
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ new Set(), e[0] = a) : a = e[0];
|
|
211
211
|
const [o] = _(a);
|
|
212
|
-
let
|
|
213
|
-
e[1] !== o ? (
|
|
212
|
+
let r;
|
|
213
|
+
e[1] !== o ? (r = (u) => {
|
|
214
214
|
o.add(u), n(!0);
|
|
215
|
-
}, e[1] = o, e[2] =
|
|
216
|
-
const
|
|
217
|
-
let
|
|
218
|
-
e[3] !== o ? (
|
|
215
|
+
}, e[1] = o, e[2] = r) : r = e[2];
|
|
216
|
+
const x = r;
|
|
217
|
+
let y;
|
|
218
|
+
e[3] !== o ? (y = (u) => {
|
|
219
219
|
o.delete(u), o.size === 0 && n(!1);
|
|
220
|
-
}, e[3] = o, e[4] =
|
|
221
|
-
const
|
|
220
|
+
}, e[3] = o, e[4] = y) : y = e[4];
|
|
221
|
+
const f = y;
|
|
222
222
|
let S;
|
|
223
|
-
e[5] !== i || e[6] !==
|
|
223
|
+
e[5] !== i || e[6] !== x || e[7] !== f ? (S = {
|
|
224
224
|
isLoading: i,
|
|
225
|
-
startLoading:
|
|
226
|
-
stopLoading:
|
|
227
|
-
}, e[5] = i, e[6] =
|
|
228
|
-
const
|
|
229
|
-
let
|
|
230
|
-
e[9] !== i ? (
|
|
225
|
+
startLoading: x,
|
|
226
|
+
stopLoading: f
|
|
227
|
+
}, e[5] = i, e[6] = x, e[7] = f, e[8] = S) : S = e[8];
|
|
228
|
+
const d = S;
|
|
229
|
+
let s;
|
|
230
|
+
e[9] !== i ? (s = i && /* @__PURE__ */ b(De, {}), e[9] = i, e[10] = s) : s = e[10];
|
|
231
231
|
let c;
|
|
232
|
-
return e[11] !== l || e[12] !==
|
|
233
|
-
|
|
232
|
+
return e[11] !== l || e[12] !== d || e[13] !== s ? (c = /* @__PURE__ */ D(me.Provider, { value: d, children: [
|
|
233
|
+
s,
|
|
234
234
|
l
|
|
235
|
-
] }), e[11] = l, e[12] =
|
|
235
|
+
] }), e[11] = l, e[12] = d, e[13] = s, e[14] = c) : c = e[14], c;
|
|
236
236
|
}, nt = (t) => {
|
|
237
237
|
const e = A.c(39), {
|
|
238
238
|
children: l
|
|
@@ -241,20 +241,20 @@ const et = (t) => {
|
|
|
241
241
|
getToken: a
|
|
242
242
|
} = H(re), {
|
|
243
243
|
delegation: o,
|
|
244
|
-
setDelegation:
|
|
245
|
-
setAvailableDelegations:
|
|
246
|
-
refreshAvailableDelegations:
|
|
247
|
-
} = H(ie), [
|
|
248
|
-
let
|
|
249
|
-
e[0] !== a ? (
|
|
244
|
+
setDelegation: r,
|
|
245
|
+
setAvailableDelegations: x,
|
|
246
|
+
refreshAvailableDelegations: y
|
|
247
|
+
} = H(ie), [f, S] = _(null);
|
|
248
|
+
let d;
|
|
249
|
+
e[0] !== a ? (d = async () => {
|
|
250
250
|
const C = await a();
|
|
251
251
|
C && S(C.token);
|
|
252
|
-
}, e[0] = a, e[1] =
|
|
253
|
-
const
|
|
252
|
+
}, e[0] = a, e[1] = d) : d = e[1];
|
|
253
|
+
const s = d;
|
|
254
254
|
let c, u;
|
|
255
|
-
e[2] !==
|
|
256
|
-
|
|
257
|
-
}, u = [
|
|
255
|
+
e[2] !== s ? (c = () => {
|
|
256
|
+
s();
|
|
257
|
+
}, u = [s], e[2] = s, e[3] = c, e[4] = u) : (c = e[3], u = e[4]), U(c, u);
|
|
258
258
|
let h;
|
|
259
259
|
if (e[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
260
|
e: {
|
|
@@ -268,13 +268,13 @@ const et = (t) => {
|
|
|
268
268
|
e[5] = h;
|
|
269
269
|
} else
|
|
270
270
|
h = e[5];
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
274
|
-
state:
|
|
275
|
-
user:
|
|
276
|
-
}, e[6] =
|
|
277
|
-
const [
|
|
271
|
+
const m = h;
|
|
272
|
+
let g;
|
|
273
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (g = {
|
|
274
|
+
state: m ? G.LOGGED_IN : G.LOGGED_OUT,
|
|
275
|
+
user: m
|
|
276
|
+
}, e[6] = g) : g = e[6];
|
|
277
|
+
const [v, w] = _(g);
|
|
278
278
|
let k;
|
|
279
279
|
e[7] !== i ? (k = async (C) => {
|
|
280
280
|
let E = null;
|
|
@@ -290,15 +290,15 @@ const et = (t) => {
|
|
|
290
290
|
}, e[7] = i, e[8] = k) : k = e[8];
|
|
291
291
|
const P = k;
|
|
292
292
|
let N;
|
|
293
|
-
e[9] !==
|
|
293
|
+
e[9] !== x || e[10] !== r ? (N = () => {
|
|
294
294
|
localStorage.removeItem("user"), w({
|
|
295
295
|
state: G.LOGGED_OUT,
|
|
296
296
|
user: null
|
|
297
|
-
}),
|
|
298
|
-
}, e[9] =
|
|
297
|
+
}), r(null), x(null);
|
|
298
|
+
}, e[9] = x, e[10] = r, e[11] = N) : N = e[11];
|
|
299
299
|
const T = N;
|
|
300
300
|
let M;
|
|
301
|
-
e[12] !== P || e[13] !==
|
|
301
|
+
e[12] !== P || e[13] !== y ? (M = async (C) => {
|
|
302
302
|
w({
|
|
303
303
|
state: G.LOGGING_IN,
|
|
304
304
|
user: null
|
|
@@ -307,11 +307,11 @@ const et = (t) => {
|
|
|
307
307
|
return E ? (w({
|
|
308
308
|
state: G.LOGGED_IN,
|
|
309
309
|
user: E
|
|
310
|
-
}), localStorage.setItem("user", JSON.stringify(E)), await
|
|
310
|
+
}), localStorage.setItem("user", JSON.stringify(E)), await y(), !0) : (w({
|
|
311
311
|
state: G.LOGIN_FAILED,
|
|
312
312
|
user: null
|
|
313
313
|
}), !1);
|
|
314
|
-
}, e[12] = P, e[13] =
|
|
314
|
+
}, e[12] = P, e[13] = y, e[14] = M) : M = e[14];
|
|
315
315
|
const p = M;
|
|
316
316
|
let L;
|
|
317
317
|
e[15] !== n ? (L = () => {
|
|
@@ -331,43 +331,43 @@ const et = (t) => {
|
|
|
331
331
|
let R;
|
|
332
332
|
e[17] !== p || e[18] !== T || e[19] !== n ? (R = [n, p, T], e[17] = p, e[18] = T, e[19] = n, e[20] = R) : R = e[20], U(L, R);
|
|
333
333
|
let I;
|
|
334
|
-
e[21] !== p || e[22] !== T || e[23] !==
|
|
334
|
+
e[21] !== p || e[22] !== T || e[23] !== r ? (I = async (C) => {
|
|
335
335
|
C && await p(C).catch(() => {
|
|
336
|
-
T(),
|
|
336
|
+
T(), r(null);
|
|
337
337
|
});
|
|
338
|
-
}, e[21] = p, e[22] = T, e[23] =
|
|
338
|
+
}, e[21] = p, e[22] = T, e[23] = r, e[24] = I) : I = e[24];
|
|
339
339
|
const $ = I;
|
|
340
340
|
let q;
|
|
341
|
-
e[25] !==
|
|
342
|
-
$(
|
|
343
|
-
}, e[25] =
|
|
341
|
+
e[25] !== f || e[26] !== $ ? (q = () => {
|
|
342
|
+
$(f);
|
|
343
|
+
}, e[25] = f, e[26] = $, e[27] = q) : q = e[27];
|
|
344
344
|
const W = o == null ? void 0 : o.id;
|
|
345
|
-
let F;
|
|
346
|
-
e[28] !== d || e[29] !== $ || e[30] !== W ? (F = [d, W, $], e[28] = d, e[29] = $, e[30] = W, e[31] = F) : F = e[31], U(q, F);
|
|
347
345
|
let z;
|
|
348
|
-
e[
|
|
349
|
-
|
|
350
|
-
|
|
346
|
+
e[28] !== f || e[29] !== $ || e[30] !== W ? (z = [f, W, $], e[28] = f, e[29] = $, e[30] = W, e[31] = z) : z = e[31], U(q, z);
|
|
347
|
+
let F;
|
|
348
|
+
e[32] !== p || e[33] !== T || e[34] !== v ? (F = {
|
|
349
|
+
user: v.user,
|
|
350
|
+
userLoginState: v,
|
|
351
351
|
loginUser: p,
|
|
352
352
|
logoutUser: T
|
|
353
|
-
}, e[32] = p, e[33] = T, e[34] =
|
|
354
|
-
const X =
|
|
353
|
+
}, e[32] = p, e[33] = T, e[34] = v, e[35] = F) : F = e[35];
|
|
354
|
+
const X = F;
|
|
355
355
|
let B;
|
|
356
|
-
return e[36] !== l || e[37] !== X ? (B = /* @__PURE__ */
|
|
356
|
+
return e[36] !== l || e[37] !== X ? (B = /* @__PURE__ */ b(ge.Provider, { value: X, children: l }), e[36] = l, e[37] = X, e[38] = B) : B = e[38], B;
|
|
357
357
|
};
|
|
358
358
|
function He() {
|
|
359
359
|
}
|
|
360
360
|
const ne = () => {
|
|
361
361
|
const t = A.c(2);
|
|
362
362
|
let e;
|
|
363
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
363
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ b("p", { children: "Redirecting..." }), t[0] = e) : e = t[0];
|
|
364
364
|
let l;
|
|
365
365
|
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ D("div", { children: [
|
|
366
366
|
e,
|
|
367
367
|
/* @__PURE__ */ D("p", { children: [
|
|
368
368
|
"If you are not redirected within 10 seconds, please click",
|
|
369
369
|
" ",
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ b("a", { href: window.location.href.replace("/blank", "/"), children: "here" })
|
|
371
371
|
] })
|
|
372
372
|
] }), t[1] = l) : l = t[1], l;
|
|
373
373
|
}, Ie = (t) => {
|
|
@@ -396,19 +396,19 @@ const ne = () => {
|
|
|
396
396
|
() => t.useMsal ? t.msalExtraScopes : [],
|
|
397
397
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
398
398
|
[t.useMsal, t.useMsal ? t.msalExtraScopes : null]
|
|
399
|
-
),
|
|
400
|
-
const
|
|
401
|
-
return
|
|
402
|
-
token:
|
|
399
|
+
), r = Q(null), x = Q(!1), y = Z(() => {
|
|
400
|
+
const s = localStorage.getItem("token");
|
|
401
|
+
return s ? {
|
|
402
|
+
token: s,
|
|
403
403
|
expiresOn: Pe(new Date(Date.now()), 1)
|
|
404
404
|
} : null;
|
|
405
|
-
}, []),
|
|
405
|
+
}, []), f = Z(async () => {
|
|
406
406
|
if (console.log("getTokenMsal"), n == null)
|
|
407
407
|
throw console.log("getTokenMsal throwing error because msalInstance is null"), new Error("getTokenMsal: msalInstance is null");
|
|
408
|
-
if (
|
|
409
|
-
return console.log("getTokenMsal returning tokenRequestPromise.current",
|
|
410
|
-
const
|
|
411
|
-
const h = () => {
|
|
408
|
+
if (r.current)
|
|
409
|
+
return console.log("getTokenMsal returning tokenRequestPromise.current", r.current), r.current;
|
|
410
|
+
const s = new Promise((c, u) => {
|
|
411
|
+
const h = (m) => {
|
|
412
412
|
const g = Ie(n);
|
|
413
413
|
if (!g) {
|
|
414
414
|
console.log("getTokenMsal no account found. Redirecting to login"), n == null || n.loginRedirect({
|
|
@@ -421,37 +421,41 @@ const ne = () => {
|
|
|
421
421
|
scopes: a,
|
|
422
422
|
account: g,
|
|
423
423
|
redirectUri: t.useMsal ? t.msalSilentRedirectUri : void 0
|
|
424
|
-
}).then((
|
|
425
|
-
|
|
426
|
-
token:
|
|
427
|
-
expiresOn:
|
|
424
|
+
}).then((v) => {
|
|
425
|
+
m(), c({
|
|
426
|
+
token: v.accessToken,
|
|
427
|
+
expiresOn: v.expiresOn ?? new Date(Date.now())
|
|
428
428
|
});
|
|
429
|
-
}).catch((
|
|
430
|
-
console.error("Error acquiring token",
|
|
429
|
+
}).catch((v) => {
|
|
430
|
+
console.error("Error acquiring token", v), v instanceof Te && (console.log("Silent token acquisition failed. Acquiring token using redirect"), n == null || n.acquireTokenRedirect({
|
|
431
431
|
scopes: a,
|
|
432
432
|
extraScopesToConsent: o
|
|
433
|
-
}),
|
|
433
|
+
}), m(), c(null)), m(), u(v);
|
|
434
434
|
}).finally(() => {
|
|
435
|
-
|
|
435
|
+
m(), u(new Error("No access token returned from handleRedirectPromise"));
|
|
436
436
|
});
|
|
437
437
|
};
|
|
438
438
|
if (console.log("getTokenMsal promise"), e !== we.None) {
|
|
439
439
|
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e), u(new Error("Authentication in progress"));
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
x.current ? h(() => {
|
|
443
|
+
r.current = null;
|
|
444
|
+
}) : n.handleRedirectPromise().then((m) => {
|
|
445
|
+
if (console.log("getTokenMsal tokenResponse", m), !(m != null && m.accessToken)) {
|
|
446
|
+
h(() => {
|
|
447
|
+
r.current = null, x.current = !0;
|
|
448
|
+
});
|
|
445
449
|
return;
|
|
446
450
|
}
|
|
447
|
-
|
|
448
|
-
token:
|
|
449
|
-
expiresOn:
|
|
451
|
+
r.current = null, x.current = !0, c({
|
|
452
|
+
token: m.accessToken,
|
|
453
|
+
expiresOn: m.expiresOn ?? new Date(Date.now())
|
|
450
454
|
});
|
|
451
455
|
});
|
|
452
456
|
});
|
|
453
|
-
return
|
|
454
|
-
}, [e, o, n, a, t.msalSilentRedirectUri, t.useMsal]), S = Z(async () => t.useMsal ?
|
|
457
|
+
return r.current = s, s;
|
|
458
|
+
}, [e, o, n, a, t.msalSilentRedirectUri, t.useMsal]), S = Z(async () => t.useMsal ? f() : y(), [y, f, t.useMsal]), d = K(() => ({
|
|
455
459
|
useMsal: t.useMsal ?? !1,
|
|
456
460
|
msalInstance: n,
|
|
457
461
|
msalScopes: a,
|
|
@@ -460,37 +464,37 @@ const ne = () => {
|
|
|
460
464
|
}), [t.useMsal, n, a, o, S]);
|
|
461
465
|
return U(() => {
|
|
462
466
|
if (t.useMsal && n) {
|
|
463
|
-
const
|
|
467
|
+
const s = n.addEventCallback((c) => {
|
|
464
468
|
if (c.eventType === ee.LOGIN_SUCCESS || c.eventType === ee.ACQUIRE_TOKEN_SUCCESS && c.payload) {
|
|
465
469
|
const u = c.payload, h = u.account;
|
|
466
470
|
n.setActiveAccount(h);
|
|
467
|
-
const
|
|
468
|
-
i("Authorization",
|
|
471
|
+
const m = u.accessToken, g = u.expiresOn;
|
|
472
|
+
i("Authorization", m, {
|
|
469
473
|
path: "/",
|
|
470
474
|
secure: !0,
|
|
471
475
|
sameSite: "none",
|
|
472
476
|
domain: l,
|
|
473
|
-
expires:
|
|
477
|
+
expires: g ?? void 0
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
480
|
c.error && console.error("AuthProvider MSAL Error", c);
|
|
477
481
|
});
|
|
478
482
|
return () => {
|
|
479
|
-
|
|
483
|
+
s && n.removeEventCallback(s);
|
|
480
484
|
};
|
|
481
485
|
}
|
|
482
486
|
return () => {
|
|
483
487
|
};
|
|
484
|
-
}, [t.useMsal, n, i, l]), /* @__PURE__ */
|
|
488
|
+
}, [t.useMsal, n, i, l]), /* @__PURE__ */ b(re.Provider, { value: d, children: t.useMsal ? /* @__PURE__ */ b(Ce, { instance: t.msalInstance, children: window.location.pathname === "/blank" ? /* @__PURE__ */ b(ne, {}) : t.children }) : window.location.pathname === "/blank" ? /* @__PURE__ */ b(ne, {}) : t.children });
|
|
485
489
|
}, lt = (t) => {
|
|
486
490
|
const e = A.c(18), {
|
|
487
491
|
children: l,
|
|
488
492
|
relativeEndpoint: i
|
|
489
493
|
} = t, [n, a, o] = _e("user-delegation", null);
|
|
490
|
-
let
|
|
494
|
+
let r;
|
|
491
495
|
e: {
|
|
492
496
|
if (!n) {
|
|
493
|
-
|
|
497
|
+
r = null;
|
|
494
498
|
break e;
|
|
495
499
|
}
|
|
496
500
|
const k = n.from ? te(n.from) : Oe(), P = n.to ? te(n.to) : Ae();
|
|
@@ -498,31 +502,31 @@ const ne = () => {
|
|
|
498
502
|
start: k,
|
|
499
503
|
end: P
|
|
500
504
|
})) {
|
|
501
|
-
a(null),
|
|
505
|
+
a(null), r = null;
|
|
502
506
|
break e;
|
|
503
507
|
}
|
|
504
|
-
|
|
508
|
+
r = n;
|
|
505
509
|
}
|
|
506
|
-
const
|
|
507
|
-
let
|
|
508
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
510
|
+
const x = r;
|
|
511
|
+
let y;
|
|
512
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
509
513
|
nullStateBeforeLoad: !1,
|
|
510
514
|
nullStateOnFail: !0
|
|
511
|
-
}, e[0] =
|
|
515
|
+
}, e[0] = y) : y = e[0];
|
|
512
516
|
const {
|
|
513
|
-
data:
|
|
517
|
+
data: f,
|
|
514
518
|
setData: S,
|
|
515
|
-
reloadData:
|
|
516
|
-
} = Me(i,
|
|
519
|
+
reloadData: d
|
|
520
|
+
} = Me(i, y), s = Q(null);
|
|
517
521
|
let c, u;
|
|
518
|
-
e[1] !==
|
|
522
|
+
e[1] !== d ? (c = () => {
|
|
519
523
|
const k = () => {
|
|
520
|
-
|
|
524
|
+
d(), s.current = window.setTimeout(k, xe() + 5e3);
|
|
521
525
|
};
|
|
522
526
|
return k(), () => {
|
|
523
|
-
|
|
527
|
+
s.current !== null && window.clearTimeout(s.current);
|
|
524
528
|
};
|
|
525
|
-
}, u = [
|
|
529
|
+
}, u = [d], e[1] = d, e[2] = c, e[3] = u) : (c = e[2], u = e[3]), U(c, u);
|
|
526
530
|
let h;
|
|
527
531
|
e[4] !== o ? (h = () => {
|
|
528
532
|
const k = () => {
|
|
@@ -532,19 +536,19 @@ const ne = () => {
|
|
|
532
536
|
window.removeEventListener("focus", k);
|
|
533
537
|
};
|
|
534
538
|
}, e[4] = o, e[5] = h) : h = e[5];
|
|
539
|
+
let m;
|
|
540
|
+
e[6] !== o || e[7] !== d ? (m = [o, d], e[6] = o, e[7] = d, e[8] = m) : m = e[8], U(h, m);
|
|
535
541
|
let g;
|
|
536
|
-
e[
|
|
537
|
-
|
|
538
|
-
e[9] !== d || e[10] !== m || e[11] !== S || e[12] !== a || e[13] !== y ? (f = {
|
|
539
|
-
delegation: y,
|
|
542
|
+
e[9] !== f || e[10] !== d || e[11] !== S || e[12] !== a || e[13] !== x ? (g = {
|
|
543
|
+
delegation: x,
|
|
540
544
|
setDelegation: a,
|
|
541
|
-
availableDelegations:
|
|
545
|
+
availableDelegations: f,
|
|
542
546
|
setAvailableDelegations: S,
|
|
543
|
-
refreshAvailableDelegations:
|
|
544
|
-
}, e[9] =
|
|
545
|
-
const
|
|
547
|
+
refreshAvailableDelegations: d
|
|
548
|
+
}, e[9] = f, e[10] = d, e[11] = S, e[12] = a, e[13] = x, e[14] = g) : g = e[14];
|
|
549
|
+
const v = g;
|
|
546
550
|
let w;
|
|
547
|
-
return e[15] !== l || e[16] !==
|
|
551
|
+
return e[15] !== l || e[16] !== v ? (w = /* @__PURE__ */ b(ie.Provider, { value: v, children: l }), e[15] = l, e[16] = v, e[17] = w) : w = e[17], w;
|
|
548
552
|
}, oe = (t, e) => t ? `${t} | ${e}` : e, st = (t) => {
|
|
549
553
|
const e = A.c(18), {
|
|
550
554
|
defaultHelmet: l,
|
|
@@ -553,40 +557,40 @@ const ne = () => {
|
|
|
553
557
|
} = t, a = n ?? "";
|
|
554
558
|
let o;
|
|
555
559
|
e[0] !== l || e[1] !== a ? (o = oe(a, l), e[0] = l, e[1] = a, e[2] = o) : o = e[2];
|
|
556
|
-
let
|
|
557
|
-
e[3] !== o ? (
|
|
558
|
-
const [
|
|
560
|
+
let r;
|
|
561
|
+
e[3] !== o ? (r = [o], e[3] = o, e[4] = r) : r = e[4];
|
|
562
|
+
const [x, y] = _(r);
|
|
563
|
+
let f;
|
|
564
|
+
e[5] !== n ? (f = (w) => {
|
|
565
|
+
y((k) => [...k, oe(n ?? "", w)]);
|
|
566
|
+
}, e[5] = n, e[6] = f) : f = e[6];
|
|
567
|
+
const S = f;
|
|
559
568
|
let d;
|
|
560
|
-
e[
|
|
561
|
-
|
|
562
|
-
}, e[
|
|
563
|
-
const
|
|
564
|
-
let m;
|
|
565
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (m = () => {
|
|
566
|
-
x(qe);
|
|
567
|
-
}, e[7] = m) : m = e[7];
|
|
568
|
-
const r = m;
|
|
569
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
|
|
570
|
+
y(qe);
|
|
571
|
+
}, e[7] = d) : d = e[7];
|
|
572
|
+
const s = d;
|
|
569
573
|
let c;
|
|
570
|
-
e[8] !==
|
|
574
|
+
e[8] !== x ? (c = x.at(-1) ?? "", e[8] = x, e[9] = c) : c = e[9];
|
|
571
575
|
const u = c;
|
|
572
576
|
let h;
|
|
573
577
|
e[10] !== S ? (h = {
|
|
574
578
|
addHelmet: S,
|
|
575
|
-
removeHelmet:
|
|
579
|
+
removeHelmet: s
|
|
576
580
|
}, e[10] = S, e[11] = h) : h = e[11];
|
|
577
|
-
const
|
|
578
|
-
let
|
|
579
|
-
e[12] !== u ? (
|
|
580
|
-
let
|
|
581
|
-
return e[14] !== i || e[15] !==
|
|
582
|
-
|
|
581
|
+
const m = h;
|
|
582
|
+
let g;
|
|
583
|
+
e[12] !== u ? (g = /* @__PURE__ */ b("title", { children: u }), e[12] = u, e[13] = g) : g = e[13];
|
|
584
|
+
let v;
|
|
585
|
+
return e[14] !== i || e[15] !== m || e[16] !== g ? (v = /* @__PURE__ */ D(ye.Provider, { value: m, children: [
|
|
586
|
+
g,
|
|
583
587
|
i
|
|
584
|
-
] }), e[14] = i, e[15] =
|
|
588
|
+
] }), e[14] = i, e[15] = m, e[16] = g, e[17] = v) : v = e[17], v;
|
|
585
589
|
};
|
|
586
590
|
function qe(t) {
|
|
587
591
|
return t.length > 1 ? t.slice(0, -1) : t;
|
|
588
592
|
}
|
|
589
|
-
const le = 50,
|
|
593
|
+
const le = 50, ze = () => {
|
|
590
594
|
const t = A.c(22), {
|
|
591
595
|
texts: e
|
|
592
596
|
} = H(J), {
|
|
@@ -596,39 +600,39 @@ const le = 50, Fe = () => {
|
|
|
596
600
|
onCancel: n,
|
|
597
601
|
text: a,
|
|
598
602
|
show: o,
|
|
599
|
-
textSm:
|
|
600
|
-
} = ve(),
|
|
601
|
-
let
|
|
602
|
-
t[0] !== n || t[1] !== i || t[2] !== o ? (
|
|
603
|
+
textSm: r
|
|
604
|
+
} = ve(), x = r === void 0 ? a.length > le : r, y = a.length > le;
|
|
605
|
+
let f;
|
|
606
|
+
t[0] !== n || t[1] !== i || t[2] !== o ? (f = (g) => {
|
|
603
607
|
if (o)
|
|
604
|
-
e: switch (
|
|
608
|
+
e: switch (g.key) {
|
|
605
609
|
case "Enter": {
|
|
606
|
-
|
|
610
|
+
g.preventDefault(), g.stopPropagation(), i();
|
|
607
611
|
break e;
|
|
608
612
|
}
|
|
609
613
|
case "Escape": {
|
|
610
|
-
|
|
614
|
+
g.preventDefault(), g.stopPropagation(), n();
|
|
611
615
|
break e;
|
|
612
616
|
}
|
|
613
617
|
}
|
|
614
|
-
}, t[0] = n, t[1] = i, t[2] = o, t[3] =
|
|
615
|
-
const
|
|
616
|
-
let
|
|
617
|
-
t[4] !==
|
|
618
|
+
}, t[0] = n, t[1] = i, t[2] = o, t[3] = f) : f = t[3], be(f);
|
|
619
|
+
const d = y ? void 0 : "sm";
|
|
620
|
+
let s;
|
|
621
|
+
t[4] !== x || t[5] !== a ? (s = /* @__PURE__ */ b(O.Header, { className: "justify-content-center", children: x ? /* @__PURE__ */ b(ke, { variant: "body", children: a }) : /* @__PURE__ */ b(O.Title, { children: a }) }), t[4] = x, t[5] = a, t[6] = s) : s = t[6];
|
|
618
622
|
let c;
|
|
619
|
-
t[7] !== l.no || t[8] !== n ? (c = /* @__PURE__ */
|
|
623
|
+
t[7] !== l.no || t[8] !== n ? (c = /* @__PURE__ */ b(V, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: n, children: l.no }), t[7] = l.no, t[8] = n, t[9] = c) : c = t[9];
|
|
620
624
|
let u;
|
|
621
|
-
t[10] !== l.yes || t[11] !== i ? (u = /* @__PURE__ */
|
|
625
|
+
t[10] !== l.yes || t[11] !== i ? (u = /* @__PURE__ */ b(V, { type: "button", color: "primary", onClick: i, className: "w-100 ml", children: l.yes }), t[10] = l.yes, t[11] = i, t[12] = u) : u = t[12];
|
|
622
626
|
let h;
|
|
623
|
-
t[13] !== c || t[14] !== u ? (h = /* @__PURE__ */
|
|
627
|
+
t[13] !== c || t[14] !== u ? (h = /* @__PURE__ */ b(O.Body, { children: /* @__PURE__ */ D("div", { className: "w-100 d-flex gap-5", children: [
|
|
624
628
|
c,
|
|
625
629
|
u
|
|
626
630
|
] }) }), t[13] = c, t[14] = u, t[15] = h) : h = t[15];
|
|
627
|
-
let
|
|
628
|
-
return t[16] !== n || t[17] !== o || t[18] !==
|
|
629
|
-
|
|
631
|
+
let m;
|
|
632
|
+
return t[16] !== n || t[17] !== o || t[18] !== d || t[19] !== s || t[20] !== h ? (m = /* @__PURE__ */ D(O, { show: o, size: d, centered: !0, onHide: n, children: [
|
|
633
|
+
s,
|
|
630
634
|
h
|
|
631
|
-
] }), t[16] = n, t[17] = o, t[18] =
|
|
635
|
+
] }), t[16] = n, t[17] = o, t[18] = d, t[19] = s, t[20] = h, t[21] = m) : m = t[21], m;
|
|
632
636
|
};
|
|
633
637
|
export {
|
|
634
638
|
re as AuthContext,
|
package/package.json
CHANGED