react-luminus-components 2.0.11 → 2.0.13
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/.vite/manifest.json +36 -36
- package/dist/{FormDisabledProvider-fcsY00Co.js → FormDisabledProvider-BEWNUfwU.js} +1 -1
- package/dist/{FormDisabledProvider-CLjqr5Jf.cjs → FormDisabledProvider-CfffF5hp.cjs} +1 -1
- package/dist/{ShortcutLinksContext-Bcm2lZLq.cjs → ShortcutLinksContext-C9ApadFv.cjs} +20 -20
- package/dist/{ShortcutLinksContext-D-mrO3DX.js → ShortcutLinksContext-uD20RgYr.js} +55 -54
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +4 -2
- package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateEditModal.d.ts +4 -2
- package/dist/components/NotifCenter/Actions/hooks/useNotifTemplateUtils.d.ts +4 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +33 -33
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +26 -26
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +47 -47
- package/dist/main.cjs.js +8 -8
- package/dist/main.es.js +5644 -5567
- package/dist/models/index.d.ts +2 -0
- package/dist/models/texts/NotifCentrumTexts.d.ts +3 -0
- package/dist/models/types/notifCenter/EmailViewModel.d.ts +7 -0
- package/dist/models/types/notifCenter/NotificationPreviewModel.d.ts +8 -0
- package/dist/{useIsFormDirty-CbVdltTT.js → useIsFormDirty-CHV-JRlA.js} +1 -1
- package/dist/{useIsFormDirty-CKndC8-E.cjs → useIsFormDirty-DL0Prrkw.cjs} +1 -1
- package/dist/{useLocalStorageState-PRMfAjRj.cjs → useLocalStorageState-C3FCErU9.cjs} +1 -1
- package/dist/{useLocalStorageState-C9QfQgB4.js → useLocalStorageState-C9lOp75w.js} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +13 -13
- package/package.json +1 -1
|
@@ -37362,7 +37362,7 @@ export {
|
|
|
37362
37362
|
Zg as ay,
|
|
37363
37363
|
Vfe as az,
|
|
37364
37364
|
Xi as b,
|
|
37365
|
-
|
|
37365
|
+
qO as b$,
|
|
37366
37366
|
Ehe as b0,
|
|
37367
37367
|
Fg as b1,
|
|
37368
37368
|
hb as b2,
|
|
@@ -37375,31 +37375,31 @@ export {
|
|
|
37375
37375
|
fx as b9,
|
|
37376
37376
|
Ufe as bA,
|
|
37377
37377
|
fpe as bB,
|
|
37378
|
-
|
|
37379
|
-
|
|
37380
|
-
|
|
37381
|
-
|
|
37382
|
-
|
|
37383
|
-
|
|
37384
|
-
|
|
37385
|
-
|
|
37386
|
-
|
|
37387
|
-
|
|
37388
|
-
|
|
37389
|
-
|
|
37390
|
-
|
|
37391
|
-
|
|
37392
|
-
|
|
37393
|
-
|
|
37394
|
-
|
|
37395
|
-
|
|
37396
|
-
|
|
37397
|
-
|
|
37398
|
-
|
|
37399
|
-
|
|
37400
|
-
|
|
37401
|
-
|
|
37402
|
-
|
|
37378
|
+
Iv as bC,
|
|
37379
|
+
aS as bD,
|
|
37380
|
+
ln as bE,
|
|
37381
|
+
nfe as bF,
|
|
37382
|
+
Yfe as bG,
|
|
37383
|
+
DA as bH,
|
|
37384
|
+
x_ as bI,
|
|
37385
|
+
rpe as bJ,
|
|
37386
|
+
dpe as bK,
|
|
37387
|
+
cpe as bL,
|
|
37388
|
+
lpe as bM,
|
|
37389
|
+
ohe as bN,
|
|
37390
|
+
Hae as bO,
|
|
37391
|
+
qv as bP,
|
|
37392
|
+
X7 as bQ,
|
|
37393
|
+
K7 as bR,
|
|
37394
|
+
che as bS,
|
|
37395
|
+
o4 as bT,
|
|
37396
|
+
whe as bU,
|
|
37397
|
+
FA as bV,
|
|
37398
|
+
jA as bW,
|
|
37399
|
+
Khe as bX,
|
|
37400
|
+
y4 as bY,
|
|
37401
|
+
LA as bZ,
|
|
37402
|
+
VO as b_,
|
|
37403
37403
|
C4 as ba,
|
|
37404
37404
|
upe as bb,
|
|
37405
37405
|
YO as bc,
|
|
@@ -37427,34 +37427,35 @@ export {
|
|
|
37427
37427
|
Jx as by,
|
|
37428
37428
|
Hfe as bz,
|
|
37429
37429
|
We as c,
|
|
37430
|
-
|
|
37431
|
-
|
|
37432
|
-
|
|
37433
|
-
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
37453
|
-
|
|
37454
|
-
|
|
37455
|
-
|
|
37456
|
-
|
|
37457
|
-
|
|
37430
|
+
oM as c0,
|
|
37431
|
+
sM as c1,
|
|
37432
|
+
xhe as c2,
|
|
37433
|
+
_he as c3,
|
|
37434
|
+
Che as c4,
|
|
37435
|
+
She as c5,
|
|
37436
|
+
cM as c6,
|
|
37437
|
+
The as c7,
|
|
37438
|
+
$he as c8,
|
|
37439
|
+
Ohe as c9,
|
|
37440
|
+
Mhe as ca,
|
|
37441
|
+
uM as cb,
|
|
37442
|
+
hM as cc,
|
|
37443
|
+
pM as cd,
|
|
37444
|
+
tm as ce,
|
|
37445
|
+
HO as cf,
|
|
37446
|
+
dhe as cg,
|
|
37447
|
+
j1 as ch,
|
|
37448
|
+
mM as ci,
|
|
37449
|
+
mhe as cj,
|
|
37450
|
+
ghe as ck,
|
|
37451
|
+
vhe as cl,
|
|
37452
|
+
bhe as cm,
|
|
37453
|
+
yhe as cn,
|
|
37454
|
+
aM as co,
|
|
37455
|
+
iM as cp,
|
|
37456
|
+
Al as cq,
|
|
37457
|
+
F1 as cr,
|
|
37458
|
+
hhe as cs,
|
|
37458
37459
|
NS as d,
|
|
37459
37460
|
WS as e,
|
|
37460
37461
|
dg as f,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { NameIdIntModel, NotificationHistoryModel, NotificationModel, NotificationTarget, NotifTargetModel, NotifTemplateCreateModel, NotifTemplateEditModel } from '../../../models/index';
|
|
1
|
+
import { EmailViewModel, NameIdIntModel, NameIdStringModel, NotificationHistoryModel, NotificationModel, NotificationPreviewModel, NotificationTarget, NotifTargetModel, NotifTemplateCreateModel, NotifTemplateEditModel } from '../../../models/index';
|
|
2
2
|
import { default as NotificationKindFullModel } from './types/NotificationKindFullModel';
|
|
3
3
|
|
|
4
4
|
export type Props = {
|
|
5
5
|
kinds: NotificationKindFullModel[];
|
|
6
6
|
styles: NameIdIntModel[];
|
|
7
|
+
entities: NameIdStringModel[];
|
|
7
8
|
targetSystem: 1 | 2 | 4;
|
|
8
9
|
reloadActions: (kindId: number) => Promise<Array<NotificationModel>>;
|
|
9
10
|
reloadHistory: (actionId: number, templateId: number) => Promise<Array<NotificationHistoryModel>>;
|
|
@@ -14,7 +15,8 @@ export type Props = {
|
|
|
14
15
|
onTemplateDelete: (id: number) => Promise<void>;
|
|
15
16
|
onNotifActionAdd: (id: number, name: string, kind: number) => Promise<boolean>;
|
|
16
17
|
onNotifTemplateAdd: (tpl: NotifTemplateCreateModel) => Promise<boolean>;
|
|
18
|
+
onPreview: (p: NotificationPreviewModel) => Promise<EmailViewModel | null>;
|
|
17
19
|
EmployeePicker: React.ElementType;
|
|
18
20
|
};
|
|
19
|
-
declare const NotificationActions: ({ kinds, styles, targetSystem, reloadActions, reloadHistory, reloadRoles, onRemoveTarget, onPostTarget, onTemplateEdit, onTemplateDelete, onNotifActionAdd, onNotifTemplateAdd, EmployeePicker, }: Props) => import("react").JSX.Element;
|
|
21
|
+
declare const NotificationActions: ({ kinds, styles, entities, targetSystem, reloadActions, reloadHistory, reloadRoles, onRemoveTarget, onPostTarget, onTemplateEdit, onTemplateDelete, onNotifActionAdd, onNotifTemplateAdd, onPreview, EmployeePicker, }: Props) => import("react").JSX.Element;
|
|
20
22
|
export default NotificationActions;
|
package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateEditModal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NameIdIntModel, NotificationTemplate } from '../../../../../models/index';
|
|
1
|
+
import { EmailViewModel, NameIdIntModel, NameIdStringModel, NotificationPreviewModel, NotificationTemplate } from '../../../../../models/index';
|
|
2
2
|
import { default as NotifTemplateEditModel } from '../../../../../models/types/notifCenter/NotifTemplateEditModel';
|
|
3
3
|
|
|
4
4
|
type Props = {
|
|
@@ -6,7 +6,9 @@ type Props = {
|
|
|
6
6
|
onHide: () => void;
|
|
7
7
|
template: NotificationTemplate;
|
|
8
8
|
onEdit: (t: NotifTemplateEditModel) => Promise<void>;
|
|
9
|
+
onPreview: (p: NotificationPreviewModel) => Promise<EmailViewModel | null>;
|
|
9
10
|
styles: NameIdIntModel[];
|
|
11
|
+
entities: NameIdStringModel[];
|
|
10
12
|
};
|
|
11
|
-
declare const NotificationTemplateEditModal: ({ show, onHide, template, onEdit, styles }: Props) => import("react").JSX.Element;
|
|
13
|
+
declare const NotificationTemplateEditModal: ({ show, onHide, template, onEdit, onPreview, styles, entities, }: Props) => import("react").JSX.Element;
|
|
12
14
|
export default NotificationTemplateEditModal;
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./ShortcutLinksContext-Bcm2lZLq.cjs"),S=require("react/jsx-runtime"),k=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-CLjqr5Jf.cjs"),V=require("./useLocalStorageState-PRMfAjRj.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]=k.useState(!1),[u,o]=k.useState(""),[i,v]=k.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}=k.useContext(s.LuminusComponentsContext),{confirm:l}=e,{isShown:c,text:n,onFinish:u}=s.usePrompt(),{options:o}=k.useContext(s.PromptContext),[i,v]=k.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]),k.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 p;t[15]!==d||t[16]!==o.input?(p=o.input==="textarea"?S.jsx("textarea",{...d,rows:5}):void 0,t[15]=d,t[16]=o.input,t[17]=p):p=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]!==p||t[23]!==T?(w=S.jsxs(s.Modal.Body,{children:[p,T]}),t[22]=p,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 j=o.required&&!i;let b;t[28]!==l.confirm||t[29]!==j?(b=S.jsx(s.PrimaryButton,{color:"primary",disabled:j,type:"submit",className:"flex-grow-1",children:l.confirm}),t[28]=l.confirm,t[29]=j,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 L;return t[38]!==c||t[39]!==f||t[40]!==D||t[41]!==h?(L=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]=L):L=t[42],L};function ne(t){return t.stopPropagation()}const oe=t=>{const e=s.compilerRuntimeExports.c(11),{children:l}=t,[c,n]=k.useState(!1),[u,o]=k.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]=k.useState(i),f=k.useRef(se);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=p=>{o(p),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]=k.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[0]=u):u=e[0];const[o]=k.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(B.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}=k.useContext(s.AuthContext),{delegation:o,setDelegation:i,setAvailableDelegations:v,refreshAvailableDelegations:y}=k.useContext(s.DelegationContext),[f,C]=k.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]),k.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[p,T]=k.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(F=>{_=F.data}).catch(()=>{_=null}),_},e[7]=c,e[8]=w):w=e[8];const E=w;let j;e[9]!==v||e[10]!==i?(j=()=>{localStorage.removeItem("user"),T({state:s.LoginState.LOGGED_OUT,user:null}),i(null),v(null)},e[9]=v,e[10]=i,e[11]=j):j=e[11];const b=j;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 L;e[15]!==n?(L=()=>{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]=L):L=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],k.useEffect(L,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],k.useEffect(N,U);let H;e[32]!==D||e[33]!==b||e[34]!==p?(H={user:p.user,userLoginState:p,loginUser:D,logoutUser:b},e[32]=D,e[33]=b,e[34]=p,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}=k.useContext(s.LuminusComponentsContext),[,c]=s.useCookies(["Authorization"]),n=k.useMemo(()=>t.useMsal?t.msalInstance:null,[t.useMsal,t.useMsal?t.msalInstance:null]),u=k.useMemo(()=>t.useMsal?t.msalScopes:[],[t.useMsal,t.useMsal?t.msalScopes:null]),o=k.useMemo(()=>t.useMsal?t.msalExtraScopes:[],[t.useMsal,t.useMsal?t.msalExtraScopes:null]),i=k.useRef(null),v=k.useRef(!1),y=k.useCallback(()=>{const r=localStorage.getItem("token");return r?{token:r,expiresOn:B.addYears(new Date(Date.now()),1)}:null},[]),f=k.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(p=>{x(),a({token:p.accessToken,expiresOn:p.expiresOn??new Date(Date.now())})}).catch(p=>{console.error("Error acquiring token",p),p 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(p)}).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=k.useCallback(async()=>t.useMsal?f():y(),[y,f,t.useMsal]),m=k.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:n,msalScopes:u,msalExtraScopes:o,getToken:C}),[t.useMsal,n,u,o,C]);return k.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=k.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]),k.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],k.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 p=h;let T;return e[15]!==l||e[16]!==p?(T=S.jsx(s.DelegationContext.Provider,{value:p,children:l}),e[15]=l,e[16]=p,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]=k.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 p;return e[14]!==c||e[15]!==x||e[16]!==h?(p=S.jsxs(s.HelmetContext.Provider,{value:x,children:[h,c]}),e[14]=c,e[15]=x,e[16]=h,e[17]=p):p=e[17],p};function me(t){return t.length>1?t.slice(0,-1):t}const W=50,xe=()=>{const t=s.compilerRuntimeExports.c(22),{texts:e}=k.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=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("./ShortcutLinksContext-C9ApadFv.cjs"),S=require("react/jsx-runtime"),k=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-CfffF5hp.cjs"),V=require("./useLocalStorageState-C3FCErU9.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]=k.useState(!1),[u,o]=k.useState(""),[i,v]=k.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}=k.useContext(s.LuminusComponentsContext),{confirm:l}=e,{isShown:c,text:n,onFinish:u}=s.usePrompt(),{options:o}=k.useContext(s.PromptContext),[i,v]=k.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]),k.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 p;t[15]!==d||t[16]!==o.input?(p=o.input==="textarea"?S.jsx("textarea",{...d,rows:5}):void 0,t[15]=d,t[16]=o.input,t[17]=p):p=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]!==p||t[23]!==T?(w=S.jsxs(s.Modal.Body,{children:[p,T]}),t[22]=p,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 j=o.required&&!i;let b;t[28]!==l.confirm||t[29]!==j?(b=S.jsx(s.PrimaryButton,{color:"primary",disabled:j,type:"submit",className:"flex-grow-1",children:l.confirm}),t[28]=l.confirm,t[29]=j,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 L;return t[38]!==c||t[39]!==f||t[40]!==D||t[41]!==h?(L=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]=L):L=t[42],L};function ne(t){return t.stopPropagation()}const oe=t=>{const e=s.compilerRuntimeExports.c(11),{children:l}=t,[c,n]=k.useState(!1),[u,o]=k.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]=k.useState(i),f=k.useRef(se);let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=p=>{o(p),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]=k.useState(!1);let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[0]=u):u=e[0];const[o]=k.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(B.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}=k.useContext(s.AuthContext),{delegation:o,setDelegation:i,setAvailableDelegations:v,refreshAvailableDelegations:y}=k.useContext(s.DelegationContext),[f,C]=k.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]),k.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[p,T]=k.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(F=>{_=F.data}).catch(()=>{_=null}),_},e[7]=c,e[8]=w):w=e[8];const E=w;let j;e[9]!==v||e[10]!==i?(j=()=>{localStorage.removeItem("user"),T({state:s.LoginState.LOGGED_OUT,user:null}),i(null),v(null)},e[9]=v,e[10]=i,e[11]=j):j=e[11];const b=j;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 L;e[15]!==n?(L=()=>{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]=L):L=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],k.useEffect(L,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],k.useEffect(N,U);let H;e[32]!==D||e[33]!==b||e[34]!==p?(H={user:p.user,userLoginState:p,loginUser:D,logoutUser:b},e[32]=D,e[33]=b,e[34]=p,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}=k.useContext(s.LuminusComponentsContext),[,c]=s.useCookies(["Authorization"]),n=k.useMemo(()=>t.useMsal?t.msalInstance:null,[t.useMsal,t.useMsal?t.msalInstance:null]),u=k.useMemo(()=>t.useMsal?t.msalScopes:[],[t.useMsal,t.useMsal?t.msalScopes:null]),o=k.useMemo(()=>t.useMsal?t.msalExtraScopes:[],[t.useMsal,t.useMsal?t.msalExtraScopes:null]),i=k.useRef(null),v=k.useRef(!1),y=k.useCallback(()=>{const r=localStorage.getItem("token");return r?{token:r,expiresOn:B.addYears(new Date(Date.now()),1)}:null},[]),f=k.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(p=>{x(),a({token:p.accessToken,expiresOn:p.expiresOn??new Date(Date.now())})}).catch(p=>{console.error("Error acquiring token",p),p 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(p)}).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=k.useCallback(async()=>t.useMsal?f():y(),[y,f,t.useMsal]),m=k.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:n,msalScopes:u,msalExtraScopes:o,getToken:C}),[t.useMsal,n,u,o,C]);return k.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=k.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]),k.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],k.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 p=h;let T;return e[15]!==l||e[16]!==p?(T=S.jsx(s.DelegationContext.Provider,{value:p,children:l}),e[15]=l,e[16]=p,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]=k.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 p;return e[14]!==c||e[15]!==x||e[16]!==h?(p=S.jsxs(s.HelmetContext.Provider,{value:x,children:[h,c]}),e[14]=c,e[15]=x,e[16]=h,e[17]=p):p=e[17],p};function me(t){return t.length>1?t.slice(0,-1):t}const W=50,xe=()=>{const t=s.compilerRuntimeExports.c(22),{texts:e}=k.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=B.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,16 +1,16 @@
|
|
|
1
|
-
import { t as j,
|
|
2
|
-
import {
|
|
1
|
+
import { t as j, bP as ce, c as A, bQ as ae, R as J, bx as ue, bR as se, a1 as O, bj as fe, S as K, bS as de, a_ as me, aA as he, au as re, bl as ie, ax as G, aw as ge, bT as Se, aS as te, bU as xe, bV as ye, aU as ve, al as be, a3 as ke } from "./ShortcutLinksContext-uD20RgYr.js";
|
|
2
|
+
import { bW as ct, bg as at } from "./ShortcutLinksContext-uD20RgYr.js";
|
|
3
3
|
import { jsxs as _, jsx as b } from "react/jsx-runtime";
|
|
4
|
-
import { useState as P, useContext as H, useEffect as R, useRef as
|
|
4
|
+
import { useState as P, useContext as H, useEffect as R, useRef as W, useMemo as V, 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";
|
|
7
7
|
import "react-router";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as _e, b as De } from "./FormDisabledProvider-
|
|
12
|
-
import { F as ft } from "./FormDisabledProvider-
|
|
13
|
-
import { a as Pe, u as Me } from "./useLocalStorageState-
|
|
11
|
+
import { L as _e, b as De } from "./FormDisabledProvider-BEWNUfwU.js";
|
|
12
|
+
import { F as ft } from "./FormDisabledProvider-BEWNUfwU.js";
|
|
13
|
+
import { a as Pe, u as Me } from "./useLocalStorageState-C9lOp75w.js";
|
|
14
14
|
function Ee(t) {
|
|
15
15
|
const e = j(t);
|
|
16
16
|
return e.setHours(23, 59, 59, 999), e;
|
|
@@ -18,14 +18,14 @@ function Ee(t) {
|
|
|
18
18
|
function Ae() {
|
|
19
19
|
return Ee(Date.now());
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Le(t, e) {
|
|
22
22
|
const l = +j(t), [i, n] = [
|
|
23
23
|
+j(e.start),
|
|
24
24
|
+j(e.end)
|
|
25
25
|
].sort((a, o) => a - o);
|
|
26
26
|
return l >= i && l <= n;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Oe() {
|
|
29
29
|
return ce(Date.now());
|
|
30
30
|
}
|
|
31
31
|
const Ne = (t) => {
|
|
@@ -61,7 +61,7 @@ const Ne = (t) => {
|
|
|
61
61
|
}, Ue = () => {
|
|
62
62
|
const t = A.c(43), {
|
|
63
63
|
texts: e
|
|
64
|
-
} = H(
|
|
64
|
+
} = H(J), {
|
|
65
65
|
confirm: l
|
|
66
66
|
} = e, {
|
|
67
67
|
isShown: i,
|
|
@@ -96,13 +96,13 @@ const Ne = (t) => {
|
|
|
96
96
|
i === !0 && x(o.defaultValue ?? "");
|
|
97
97
|
}, m = [i, o.defaultValue], t[9] = i, t[10] = o.defaultValue, t[11] = h, t[12] = m) : (h = t[11], m = t[12]), R(h, m);
|
|
98
98
|
let g;
|
|
99
|
-
t[13] !== n ? (g = /* @__PURE__ */ b(
|
|
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
100
|
let v;
|
|
101
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
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] !== v || t[23] !== w ? (k = /* @__PURE__ */ _(
|
|
105
|
+
t[22] !== v || t[23] !== w ? (k = /* @__PURE__ */ _(O.Body, { children: [
|
|
106
106
|
v,
|
|
107
107
|
w
|
|
108
108
|
] }), t[22] = v, t[23] = w, t[24] = k) : k = t[24];
|
|
@@ -112,7 +112,7 @@ const Ne = (t) => {
|
|
|
112
112
|
let T;
|
|
113
113
|
t[28] !== l.confirm || t[29] !== N ? (T = /* @__PURE__ */ b(K, { 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
|
-
t[31] !== D || t[32] !== T ? (M = /* @__PURE__ */ _(
|
|
115
|
+
t[31] !== D || t[32] !== T ? (M = /* @__PURE__ */ _(O.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
116
116
|
D,
|
|
117
117
|
T
|
|
118
118
|
] }), t[31] = D, t[32] = T, t[33] = M) : M = t[33];
|
|
@@ -121,11 +121,11 @@ const Ne = (t) => {
|
|
|
121
121
|
k,
|
|
122
122
|
M
|
|
123
123
|
] }), t[34] = d, t[35] = k, t[36] = M, t[37] = p) : p = t[37];
|
|
124
|
-
let
|
|
125
|
-
return t[38] !== i || t[39] !== f || t[40] !== p || t[41] !== g ? (
|
|
124
|
+
let L;
|
|
125
|
+
return t[38] !== i || t[39] !== f || t[40] !== p || t[41] !== g ? (L = /* @__PURE__ */ _(O, { show: i, size: "sm", centered: !0, onHide: f, children: [
|
|
126
126
|
g,
|
|
127
127
|
p
|
|
128
|
-
] }), t[38] = i, t[39] = f, t[40] = p, t[41] = g, t[42] =
|
|
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 Re(t) {
|
|
131
131
|
return t.stopPropagation();
|
|
@@ -139,7 +139,7 @@ const $e = (t) => {
|
|
|
139
139
|
input: "textarea",
|
|
140
140
|
type: "text"
|
|
141
141
|
}, e[0] = r) : r = e[0];
|
|
142
|
-
const [x, y] = P(r), f =
|
|
142
|
+
const [x, y] = P(r), f = W(Ge);
|
|
143
143
|
let S;
|
|
144
144
|
e[1] === Symbol.for("react.memo_cache_sentinel") ? (S = (v) => {
|
|
145
145
|
o(v), n(!0);
|
|
@@ -201,7 +201,7 @@ const et = (t) => {
|
|
|
201
201
|
y
|
|
202
202
|
] }) }), e[9] = y, e[10] = s) : s = e[10];
|
|
203
203
|
let c;
|
|
204
|
-
return e[11] !== S || e[12] !== s ? (c = /* @__PURE__ */ b(
|
|
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
|
|
@@ -313,8 +313,8 @@ const et = (t) => {
|
|
|
313
313
|
}), !1);
|
|
314
314
|
}, e[12] = D, e[13] = y, e[14] = M) : M = e[14];
|
|
315
315
|
const p = M;
|
|
316
|
-
let
|
|
317
|
-
e[15] !== n ? (
|
|
316
|
+
let L;
|
|
317
|
+
e[15] !== n ? (L = () => {
|
|
318
318
|
if (n) {
|
|
319
319
|
const C = n.addEventCallback((E) => {
|
|
320
320
|
if (E.eventType === ee.LOGIN_SUCCESS && E.payload) {
|
|
@@ -327,9 +327,9 @@ const et = (t) => {
|
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
return He;
|
|
330
|
-
}, e[15] = n, e[16] =
|
|
330
|
+
}, e[15] = n, e[16] = L) : L = e[16];
|
|
331
331
|
let U;
|
|
332
|
-
e[17] !== p || e[18] !== T || e[19] !== n ? (U = [n, p, T], e[17] = p, e[18] = T, e[19] = n, e[20] = U) : U = e[20], R(
|
|
332
|
+
e[17] !== p || e[18] !== T || e[19] !== n ? (U = [n, p, T], e[17] = p, e[18] = T, e[19] = n, e[20] = U) : U = e[20], R(L, U);
|
|
333
333
|
let I;
|
|
334
334
|
e[21] !== p || e[22] !== T || e[23] !== r ? (I = async (C) => {
|
|
335
335
|
C && await p(C).catch(() => {
|
|
@@ -341,9 +341,9 @@ const et = (t) => {
|
|
|
341
341
|
e[25] !== f || e[26] !== $ ? (q = () => {
|
|
342
342
|
$(f);
|
|
343
343
|
}, e[25] = f, e[26] = $, e[27] = q) : q = e[27];
|
|
344
|
-
const
|
|
344
|
+
const Q = o == null ? void 0 : o.id;
|
|
345
345
|
let z;
|
|
346
|
-
e[28] !== f || e[29] !== $ || e[30] !==
|
|
346
|
+
e[28] !== f || e[29] !== $ || e[30] !== Q ? (z = [f, Q, $], e[28] = f, e[29] = $, e[30] = Q, e[31] = z) : z = e[31], R(q, z);
|
|
347
347
|
let F;
|
|
348
348
|
e[32] !== p || e[33] !== T || e[34] !== v ? (F = {
|
|
349
349
|
user: v.user,
|
|
@@ -384,7 +384,7 @@ const ne = () => {
|
|
|
384
384
|
inProgress: e
|
|
385
385
|
} = pe(), {
|
|
386
386
|
cookieDomain: l
|
|
387
|
-
} = H(
|
|
387
|
+
} = H(J), [, i] = Se(["Authorization"]), n = V(
|
|
388
388
|
() => t.useMsal ? t.msalInstance : null,
|
|
389
389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
390
390
|
[t.useMsal, t.useMsal ? t.msalInstance : null]
|
|
@@ -396,7 +396,7 @@ 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
|
-
), r =
|
|
399
|
+
), r = W(null), x = W(!1), y = Z(() => {
|
|
400
400
|
const s = localStorage.getItem("token");
|
|
401
401
|
return s ? {
|
|
402
402
|
token: s,
|
|
@@ -497,8 +497,8 @@ const ne = () => {
|
|
|
497
497
|
r = null;
|
|
498
498
|
break e;
|
|
499
499
|
}
|
|
500
|
-
const k = n.from ? te(n.from) :
|
|
501
|
-
if (!
|
|
500
|
+
const k = n.from ? te(n.from) : Oe(), D = n.to ? te(n.to) : Ae();
|
|
501
|
+
if (!Le(new Date(Date.now()), {
|
|
502
502
|
start: k,
|
|
503
503
|
end: D
|
|
504
504
|
})) {
|
|
@@ -517,7 +517,7 @@ const ne = () => {
|
|
|
517
517
|
data: f,
|
|
518
518
|
setData: S,
|
|
519
519
|
reloadData: d
|
|
520
|
-
} = Me(i, y), s =
|
|
520
|
+
} = Me(i, y), s = W(null);
|
|
521
521
|
let c, u;
|
|
522
522
|
e[1] !== d ? (c = () => {
|
|
523
523
|
const k = () => {
|
|
@@ -593,7 +593,7 @@ function qe(t) {
|
|
|
593
593
|
const le = 50, ze = () => {
|
|
594
594
|
const t = A.c(22), {
|
|
595
595
|
texts: e
|
|
596
|
-
} = H(
|
|
596
|
+
} = H(J), {
|
|
597
597
|
confirm: l
|
|
598
598
|
} = e, {
|
|
599
599
|
onConfirm: i,
|
|
@@ -618,18 +618,18 @@ const le = 50, ze = () => {
|
|
|
618
618
|
}, t[0] = n, t[1] = i, t[2] = o, t[3] = f) : f = t[3], be(f);
|
|
619
619
|
const d = y ? void 0 : "sm";
|
|
620
620
|
let s;
|
|
621
|
-
t[4] !== x || t[5] !== a ? (s = /* @__PURE__ */ b(
|
|
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];
|
|
622
622
|
let c;
|
|
623
623
|
t[7] !== l.no || t[8] !== n ? (c = /* @__PURE__ */ b(K, { 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];
|
|
624
624
|
let u;
|
|
625
625
|
t[10] !== l.yes || t[11] !== i ? (u = /* @__PURE__ */ b(K, { 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];
|
|
626
626
|
let h;
|
|
627
|
-
t[13] !== c || t[14] !== u ? (h = /* @__PURE__ */ b(
|
|
627
|
+
t[13] !== c || t[14] !== u ? (h = /* @__PURE__ */ b(O.Body, { children: /* @__PURE__ */ _("div", { className: "w-100 d-flex gap-5", children: [
|
|
628
628
|
c,
|
|
629
629
|
u
|
|
630
630
|
] }) }), t[13] = c, t[14] = u, t[15] = h) : h = t[15];
|
|
631
631
|
let m;
|
|
632
|
-
return t[16] !== n || t[17] !== o || t[18] !== d || t[19] !== s || t[20] !== h ? (m = /* @__PURE__ */ _(
|
|
632
|
+
return t[16] !== n || t[17] !== o || t[18] !== d || t[19] !== s || t[20] !== h ? (m = /* @__PURE__ */ _(O, { show: o, size: d, centered: !0, onHide: n, children: [
|
|
633
633
|
s,
|
|
634
634
|
h
|
|
635
635
|
] }), t[16] = n, t[17] = o, t[18] = d, t[19] = s, t[20] = h, t[21] = m) : m = t[21], m;
|
|
@@ -645,7 +645,7 @@ export {
|
|
|
645
645
|
st as HelmetProvider,
|
|
646
646
|
me as LoadingContext,
|
|
647
647
|
tt as LoadingProvider,
|
|
648
|
-
|
|
648
|
+
J as LuminusComponentsContext,
|
|
649
649
|
et as LuminusComponentsProvider,
|
|
650
650
|
ge as UserContext,
|
|
651
651
|
nt as UserProvider,
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./ShortcutLinksContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./ShortcutLinksContext-C9ApadFv.cjs"),U=require("./useLocalStorageState-C3FCErU9.cjs"),f=require("react"),F=require("./useIsFormDirty-DL0Prrkw.cjs");require("react/jsx-runtime");require("react-router");const H=require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-react");require("@azure/msal-browser");const T=new Map;function Q(s,r){const e=a.useAxios({silent:!0,differentBaseUrl:r==null?void 0:r.customBaseUrl,customToken:r==null?void 0:r.customToken}),t=f.useRef(null);if(!T.has(s)){if(!e.interceptorsUsed)return null;const m=e.get(s).then(n=>(T.set(s,{status:"success",data:n.data}),t.current=setTimeout(()=>{T.delete(s),t.current=null},1e3*10),n.data)).catch(n=>{throw T.set(s,{status:"error",error:n}),t.current=setTimeout(()=>{T.delete(s),t.current=null},1e3*1),n});throw T.set(s,{status:"pending",promise:m}),m}const o=T.get(s);if(o.status==="pending")throw o.promise;if(o.status==="error")throw o.error;return o.data}const _=s=>r=>(window.addEventListener(`storage_${s}`,r),()=>window.removeEventListener(`storage_${s}`,r)),J=(s,r,e)=>{const t=a.compilerRuntimeExports.c(15),o=e===void 0?localStorage:e,[m]=f.useState(r);let n;t[0]!==r?(n=JSON.stringify(r),t[0]=r,t[1]=n):n=t[1];const l=f.useRef(n),w=f.useRef(r);let h;t[2]!==s||t[3]!==m||t[4]!==o?(h=()=>{const i=o.getItem(s);return i!==l.current&&(l.current=i,w.current=l.current?JSON.parse(l.current):m),w.current},t[2]=s,t[3]=m,t[4]=o,t[5]=h):h=t[5];const y=h;let g;t[6]!==s?(g=_(s),t[6]=s,t[7]=g):g=t[7];const D=g,c=f.useSyncExternalStore(D,y);let u;t[8]!==y||t[9]!==s||t[10]!==o?(u=i=>{const E=typeof i=="function"?i(y()):i;o.setItem(s,JSON.stringify(E)),window.dispatchEvent(new Event(`storage_${s}`))},t[8]=y,t[9]=s,t[10]=o,t[11]=u):u=t[11];const d=u;let v;return t[12]!==d||t[13]!==c?(v=[c,d],t[12]=d,t[13]=c,t[14]=v):v=t[14],v},M=(s,r,e)=>{let t="pending",o;const m=s.then(n=>{t="success",o=n},n=>{const l=n==null?void 0:n.response;(l==null?void 0:l.status)===404&&e?(t="error-404",o=n):(t="error",o=n)});return()=>{switch(t){case"pending":throw m;case"success":return o;case"error":if(o.code==="ERR_CANCELED")return null;throw o;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},b={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},W=(s,r)=>{const e=a.compilerRuntimeExports.c(26),{loadOnInit:t,enabled:o,silent:m,nullStateBeforeLoad:n,nullStateOnFail:l,customApiUrl:w,customBearerToken:h,dataTransformer:y,errorBoundaryOn404:g}=r===void 0?b:r,D=t===void 0?b.loadOnInit:t,c=o===void 0?b.enabled:o,u=m===void 0?b.silent:m,d=n===void 0?b.nullStateBeforeLoad:n,v=l===void 0?b.nullStateOnFail:l;let p;e[0]!==g?(p=g?[404]:void 0,e[0]=g,e[1]=p):p=e[1];let i;e[2]!==w||e[3]!==h||e[4]!==u||e[5]!==p?(i={silent:u,customToken:h,differentBaseUrl:w,noToastOnStatus:p},e[2]=w,e[3]=h,e[4]=u,e[5]=p,e[6]=i):i=e[6];const E=a.useAxios(i),{startLoading:I,stopLoading:S}=f.useContext(a.LoadingContext),C=f.useRef(0),{isAuthenticated:P}=a.useAuth(),[R,N]=f.useState(null);let A;e[7]!==E||e[8]!==y||e[9]!==c||e[10]!==g||e[11]!==P||e[12]!==d||e[13]!==v||e[14]!==u||e[15]!==I||e[16]!==S||e[17]!==s?(A=async(B,G)=>{if(!P()||c===!1)return;!u&&I(`loadData-${s}-${G}`),d&&N(null);const V=E.get(s,{signal:B}).then(K=>y?y(K.data):K.data).finally(()=>!u&&S(`loadData-${s}-${G}`));N(M(V,v??!1,g??!1))},e[7]=E,e[8]=y,e[9]=c,e[10]=g,e[11]=P,e[12]=d,e[13]=v,e[14]=u,e[15]=I,e[16]=S,e[17]=s,e[18]=A):A=e[18];const O=A;let q,L;e[19]!==O||e[20]!==D?(L=()=>{if(D===!1)return;const B=new AbortController;return O(B.signal,C.current=C.current+1),()=>{B.abort()}},q=[O,D],e[19]=O,e[20]=D,e[21]=q,e[22]=L):(q=e[21],L=e[22]),f.useEffect(L,q);let x;return e[23]!==R||e[24]!==O?(x={data:R,setData:N,reloadData:O},e[23]=R,e[24]=O,e[25]=x):x=e[25],x},z=()=>{const s=f.useRef({}).current;return f.useEffect(()=>{const r=document.createElement("div");return r.style.position="absolute",r.style.pointerEvents="none",r.style.top="0",r.style.width="100%",r.style.height="100%",s.elt=r,document.body.appendChild(r),()=>{document.body.removeChild(r)}},[s]),r=>(e,...t)=>{const o=r(e,...t);return e.draggableProps.style.position==="fixed"?H.createPortal(o,s.elt):o}},$={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},Z=(s,r)=>{const e=a.compilerRuntimeExports.c(18),{storageKey:t,requiredHeight:o,retryInterval:m}=r===void 0?$:r,n=t===void 0?$.storageKey:t,l=o===void 0?$.requiredHeight:o,w=m===void 0?$.retryInterval:m,[h,y]=f.useState(!1),g=f.useRef(null);let D;e[0]!==n?(D=()=>{const S=localStorage.getItem(n);return localStorage.removeItem(n),S===null?null:Number(S)},e[0]=n,e[1]=D):D=e[1];const c=D;let u;e[2]!==n?(u=S=>{localStorage.setItem(n,S)},e[2]=n,e[3]=u):u=e[3];const d=u;let v,p;e[4]!==h||e[5]!==l||e[6]!==c||e[7]!==w||e[8]!==s?(v=()=>{const S=window.setInterval(()=>{if(!h&&s.current!==null&&s.current.getBoundingClientRect().height>l){y(!0);const C=c();C!==null&&s.current.scrollTo({top:C}),window.clearInterval(S)}},w);return()=>{window.clearTimeout(S)}},p=[h,l,c,w,s],e[4]=h,e[5]=l,e[6]=c,e[7]=w,e[8]=s,e[9]=v,e[10]=p):(v=e[9],p=e[10]),f.useEffect(v,p);let i,E;e[11]!==d||e[12]!==s?(i=()=>{var C;const S=new AbortController;return(C=s.current)==null||C.addEventListener("scrollend",()=>{var P;g.current=((P=s.current)==null?void 0:P.scrollTop)??0,d((g.current??0).toString())},{signal:S.signal}),()=>S.abort()},E=[d,s],e[11]=d,e[12]=s,e[13]=i,e[14]=E):(i=e[13],E=e[14]),f.useEffect(i,E);let I;return e[15]!==c||e[16]!==d?(I={saveValue:d,retrieveValue:c},e[15]=c,e[16]=d,e[17]=I):I=e[17],I};exports.cancelToken=a.cancelToken;exports.useAuth=a.useAuth;exports.useAxios=a.useAxios;exports.useClickOutside=a.useClickOutside;exports.useClipboard=a.useClipboard;exports.useConfirm=a.useConfirm;exports.useFormControlType=a.useFormControlType;exports.useKeyPress=a.useKeyPress;exports.useNotifications=a.useNotifications;exports.usePermissions=a.usePermissions;exports.usePrompt=a.usePrompt;exports.useWindowSize=a.useWindowSize;exports.useZodSchemaTypes=a.useZodSchemaTypes;exports.useGetApiData=U.useGetApiData;exports.useLocalStorageState=U.useLocalStorageState;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useIsFormDirty=F.useIsFormDirty;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.useGetApiDataBound=W;exports.useGetDataBound=Q;exports.usePersistentState=J;exports.useRenderDraggableInPortal=z;exports.useScrollSave=Z;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { aA as
|
|
2
|
-
import {
|
|
3
|
-
import { u as Ct, a as Et } from "./useLocalStorageState-
|
|
4
|
-
import { useRef as D, useState as
|
|
5
|
-
import { b as xt, c as Bt, u as Lt, a as $t } from "./useIsFormDirty-
|
|
1
|
+
import { aA as q, c as H, a_ as J, av as Q } from "./ShortcutLinksContext-uD20RgYr.js";
|
|
2
|
+
import { bX as mt, bH as gt, bZ as pt, aU as vt, bY as St, al as ht, a$ as wt, bd as bt, bx as yt, a5 as It, bk as Ot } from "./ShortcutLinksContext-uD20RgYr.js";
|
|
3
|
+
import { u as Ct, a as Et } from "./useLocalStorageState-C9lOp75w.js";
|
|
4
|
+
import { useRef as D, useState as K, useSyncExternalStore as W, useContext as Z, useEffect as F } from "react";
|
|
5
|
+
import { b as xt, c as Bt, u as Lt, a as $t } from "./useIsFormDirty-CHV-JRlA.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "react-router";
|
|
8
|
-
import { createPortal as
|
|
8
|
+
import { createPortal as z } from "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
11
|
import "@azure/msal-react";
|
|
12
12
|
import "@azure/msal-browser";
|
|
13
13
|
const T = /* @__PURE__ */ new Map();
|
|
14
14
|
function at(s, n) {
|
|
15
|
-
const t =
|
|
15
|
+
const t = q({
|
|
16
16
|
silent: !0,
|
|
17
17
|
differentBaseUrl: n == null ? void 0 : n.customBaseUrl,
|
|
18
18
|
customToken: n == null ? void 0 : n.customToken
|
|
@@ -45,8 +45,8 @@ function at(s, n) {
|
|
|
45
45
|
throw o.error;
|
|
46
46
|
return o.data;
|
|
47
47
|
}
|
|
48
|
-
const
|
|
49
|
-
const e =
|
|
48
|
+
const M = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => window.removeEventListener(`storage_${s}`, n)), lt = (s, n, t) => {
|
|
49
|
+
const e = H.c(15), o = t === void 0 ? localStorage : t, [d] = K(n);
|
|
50
50
|
let r;
|
|
51
51
|
e[0] !== n ? (r = JSON.stringify(n), e[0] = n, e[1] = r) : r = e[1];
|
|
52
52
|
const l = D(r), S = D(n);
|
|
@@ -57,8 +57,8 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
57
57
|
}, e[2] = s, e[3] = d, e[4] = o, e[5] = g) : g = e[5];
|
|
58
58
|
const h = g;
|
|
59
59
|
let f;
|
|
60
|
-
e[6] !== s ? (f =
|
|
61
|
-
const i =
|
|
60
|
+
e[6] !== s ? (f = M(s), e[6] = s, e[7] = f) : f = e[7];
|
|
61
|
+
const i = W(f, h);
|
|
62
62
|
let a;
|
|
63
63
|
e[8] !== h || e[9] !== s || e[10] !== o ? (a = (u) => {
|
|
64
64
|
const b = typeof u == "function" ? u(h()) : u;
|
|
@@ -67,7 +67,7 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
67
67
|
const c = a;
|
|
68
68
|
let p;
|
|
69
69
|
return e[12] !== c || e[13] !== i ? (p = [i, c], e[12] = c, e[13] = i, e[14] = p) : p = e[14], p;
|
|
70
|
-
},
|
|
70
|
+
}, X = (s, n, t) => {
|
|
71
71
|
let e = "pending", o;
|
|
72
72
|
const d = s.then((r) => {
|
|
73
73
|
e = "success", o = r;
|
|
@@ -97,7 +97,7 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
97
97
|
nullStateBeforeLoad: !0,
|
|
98
98
|
nullStateOnFail: !1
|
|
99
99
|
}, ut = (s, n) => {
|
|
100
|
-
const t =
|
|
100
|
+
const t = H.c(26), {
|
|
101
101
|
loadOnInit: e,
|
|
102
102
|
enabled: o,
|
|
103
103
|
silent: d,
|
|
@@ -117,21 +117,21 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
117
117
|
differentBaseUrl: S,
|
|
118
118
|
noToastOnStatus: v
|
|
119
119
|
}, t[2] = S, t[3] = g, t[4] = a, t[5] = v, t[6] = u) : u = t[6];
|
|
120
|
-
const b =
|
|
120
|
+
const b = q(u), {
|
|
121
121
|
startLoading: y,
|
|
122
122
|
stopLoading: m
|
|
123
|
-
} =
|
|
123
|
+
} = Z(J), I = D(0), {
|
|
124
124
|
isAuthenticated: C
|
|
125
|
-
} =
|
|
125
|
+
} = Q(), [N, U] = K(null);
|
|
126
126
|
let x;
|
|
127
|
-
t[7] !== b || t[8] !== h || t[9] !== i || t[10] !== f || t[11] !== C || t[12] !== c || t[13] !== p || t[14] !== a || t[15] !== y || t[16] !== m || t[17] !== s ? (x = async (A,
|
|
127
|
+
t[7] !== b || t[8] !== h || t[9] !== i || t[10] !== f || t[11] !== C || t[12] !== c || t[13] !== p || t[14] !== a || t[15] !== y || t[16] !== m || t[17] !== s ? (x = async (A, V) => {
|
|
128
128
|
if (!C() || i === !1)
|
|
129
129
|
return;
|
|
130
|
-
!a && y(`loadData-${s}-${
|
|
131
|
-
const
|
|
130
|
+
!a && y(`loadData-${s}-${V}`), c && U(null);
|
|
131
|
+
const G = b.get(s, {
|
|
132
132
|
signal: A
|
|
133
|
-
}).then((
|
|
134
|
-
U(
|
|
133
|
+
}).then((_) => h ? h(_.data) : _.data).finally(() => !a && m(`loadData-${s}-${V}`));
|
|
134
|
+
U(X(G, p ?? !1, f ?? !1));
|
|
135
135
|
}, t[7] = b, t[8] = h, t[9] = i, t[10] = f, t[11] = C, t[12] = c, t[13] = p, t[14] = a, t[15] = y, t[16] = m, t[17] = s, t[18] = x) : x = t[18];
|
|
136
136
|
const O = x;
|
|
137
137
|
let B, L;
|
|
@@ -158,18 +158,18 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
158
158
|
};
|
|
159
159
|
}, [s]), (n) => (t, ...e) => {
|
|
160
160
|
const o = n(t, ...e);
|
|
161
|
-
return t.draggableProps.style.position === "fixed" ?
|
|
161
|
+
return t.draggableProps.style.position === "fixed" ? z(o, s.elt) : o;
|
|
162
162
|
};
|
|
163
163
|
}, P = {
|
|
164
164
|
storageKey: "--tmp-scroll-save--",
|
|
165
165
|
requiredHeight: 100,
|
|
166
166
|
retryInterval: 50
|
|
167
167
|
}, ct = (s, n) => {
|
|
168
|
-
const t =
|
|
168
|
+
const t = H.c(18), {
|
|
169
169
|
storageKey: e,
|
|
170
170
|
requiredHeight: o,
|
|
171
171
|
retryInterval: d
|
|
172
|
-
} = n === void 0 ? P : n, r = e === void 0 ? P.storageKey : e, l = o === void 0 ? P.requiredHeight : o, S = d === void 0 ? P.retryInterval : d, [g, h] =
|
|
172
|
+
} = n === void 0 ? P : n, r = e === void 0 ? P.storageKey : e, l = o === void 0 ? P.requiredHeight : o, S = d === void 0 ? P.retryInterval : d, [g, h] = K(!1), f = D(null);
|
|
173
173
|
let w;
|
|
174
174
|
t[0] !== r ? (w = () => {
|
|
175
175
|
const m = localStorage.getItem(r);
|
|
@@ -215,8 +215,8 @@ const X = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
215
215
|
};
|
|
216
216
|
export {
|
|
217
217
|
mt as cancelToken,
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
Q as useAuth,
|
|
219
|
+
q as useAxios,
|
|
220
220
|
gt as useClickOutside,
|
|
221
221
|
pt as useClipboard,
|
|
222
222
|
vt as useConfirm,
|