react-luminus-components 1.3.171 → 1.3.172
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/helmet/HelmetProvider.d.ts +2 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +244 -242
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
defaultHelmet: string;
|
|
3
|
+
helmetPrefix?: string;
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
};
|
|
5
|
-
declare const HelmetProvider: ({ defaultHelmet, children }: Props) => import("react").JSX.Element;
|
|
6
|
+
declare const HelmetProvider: ({ defaultHelmet, children, helmetPrefix }: Props) => import("react").JSX.Element;
|
|
6
7
|
export default HelmetProvider;
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var ae=(e,t,r)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ae(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ResponsiveContextDropdown-ChSWGvhl.cjs"),u=require("react"),N=require("@azure/msal-browser"),ie=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const le=require("./Loading--_5eZS-P.cjs"),ue=require("./useGetApiData-g4OYYC4j.cjs"),ce=require("./useLocalStorageState-BFc8Gc8H.cjs");function fe(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function de(){return fe(Date.now())}function me(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,f)=>a-f);return r>=n&&r<=s}function pe(){return o.startOfDay(Date.now())}const he=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(l=>{r(!0),s(l)},[]),f=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:f}),[t,n,a,f]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Ze,{}),e]})},xe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,f]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),l=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&f(s.defaultValue??"")},[t,s.defaultValue]);const c=u.useMemo(()=>({value:a,onChange:d=>f(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:l,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...c,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...c,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ge=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,f]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),l=u.useCallback(m=>{s(m),r(!0)},[]),c=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:l,hidePrompt:c,resolveRef:i,options:a,setOptions:f}),[t,n,l,c,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(xe,{})]})},ye=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f,children:i})=>{const l=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:f}),[t,e,r,s,a,n,f]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:l,children:o.jsxRuntimeExports.jsx(he,{children:o.jsxRuntimeExports.jsxs(ge,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},ve=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),f=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:f,children:[t&&o.jsxRuntimeExports.jsx(le.Loading,{}),e]})},Te=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:f}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[l,c]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&c(x)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await f(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,f]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;c(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(l)},[l,n==null?void 0:n.id,K]);const se=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:se,children:e})},Ce=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const f=a.payload,i=f.account;e.msalInstance.setActiveAccount(i);const l=f.accessToken,c=f.expiresOn;r("Authorization",l,{path:"/",secure:!0,sameSite:"none",domain:t,expires:c??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(ie.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Ee=({children:e,relativeEndpoint:t})=>{const[r,n,s]=ce.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):pe(),h=r.to?o.parseISO(r.to):de();return me(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:f,setData:i,reloadData:l}=ue.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),c=u.useRef(null);u.useEffect(()=>{const m=()=>{l(),c.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{c.current!==null&&window.clearTimeout(c.current)}},[l]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,l]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:f,setAvailableDelegations:i,refreshAvailableDelegations:l}),[a,n,f,i,l]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var Se=typeof Element<"u",be=typeof Map=="function",Ae=typeof Set=="function",je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!k(e[n],t[n]))return!1;return!0}var a;if(be&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!k(n.value[1],t.get(n.value[0])))return!1;return!0}if(Ae&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(je&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(Se&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var Oe=function(t,r){try{return k(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const we=o.getDefaultExportFromCjs(Oe);var Pe=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var f=Object.keys(t),i=Object.keys(r);if(f.length!==i.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c<f.length;c++){var d=f[c];if(!l(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const Re=o.getDefaultExportFromCjs(Pe);var Z=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Z||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Z),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},De=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},Ie=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},ke=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),_=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Le=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),Me=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&Me(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const f={};a.filter(l=>{let c;const d=Object.keys(l);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(c==="rel"&&l[c].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(c=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(c=p)}if(!c||!l[c])return!1;const m=l[c].toLowerCase();return n[c]||(n[c]={}),f[c]||(f[c]={}),n[c][m]?!1:(f[c][m]=!0,!0)}).reverse().forEach(l=>s.push(l));const i=Object.keys(f);for(let l=0;l<i.length;l+=1){const c=i[l],d={...n[c],...f[c]};n[c]=d}return s},[]).reverse()},He=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Le(["href"],e),bodyAttributes:_("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:_("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:ke(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:Ie(e),titleAttributes:_("titleAttributes",e),prioritizeSeoTags:He(e,O.PRIORITIZE_SEO_TAGS)}),Q=e=>Array.isArray(e)?e.join(""):e,$e=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},$=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>($e(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ue=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),X=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),Ne=(e,t,r,n)=>{const s=X(r),a=Q(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},qe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,f=Object.keys(a).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return c?`${c} ${m}`:m},""),i=a.innerHTML||a.cssText||"",l=Ue.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${f}${l?"/>":`>${i}</${e}>`}`},""),ee=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Fe=(e,t,r)=>{const n={key:t,[T]:!0},s=ee(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const l=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Fe(e,t.title,t.titleAttributes),toString:()=>Ne(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ee(t),toString:()=>X(t)};default:return{toComponent:()=>L(e,t),toString:()=>qe(e,t,r)}}},Ge=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=$(e,H.meta),a=$(t,H.link),f=$(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",f.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",f.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:f.default}},ze=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:f,title:i="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=Ge(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",f,n),title:y("title",{title:i,titleAttributes:l},n)}},F=ze,I=[],te=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",te);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?I:this.instances,add:e=>{(this.canUseDOM?I:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?I:this.instances).indexOf(e);(this.canUseDOM?I:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Be={},re=u.createContext(Be),A,ne=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(re.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",te),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let f;return t&&t.length&&t.forEach(i=>{const l=document.createElement(e);for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c))if(c==="innerHTML")l.innerHTML=i.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=i.cssText:l.appendChild(document.createTextNode(i.cssText));else{const d=c,m=typeof i[d]>"u"?"":i[d];l.setAttribute(c,m)}l.setAttribute(T,"true"),s.some((c,d)=>(f=d,l.isEqualNode(c)))?s.splice(f,1):a.push(l)}),s.forEach(i=>{var l;return(l=i.parentNode)==null?void 0:l.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],f=Object.keys(t);for(const i of f){const l=t[i]||"";r.getAttribute(i)!==l&&r.setAttribute(i,l),s.indexOf(i)===-1&&s.push(i);const c=a.indexOf(i);c!==-1&&a.splice(c,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==f.join(",")&&r.setAttribute(T,f.join(","))},Ke=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Q(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:f,noscriptTags:i,onChangeClientState:l,scriptTags:c,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ke(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",f),noscriptTags:j("noscript",i),scriptTags:j("script",c),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),l(e,g,P)},D=null,Ve=e=>{D&&cancelAnimationFrame(D),e.defer?D=requestAnimationFrame(()=>{J(e,()=>{D=null})}):(J(e),D=null)},Ye=Ve,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!Re(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const f={...a.props};return delete f.context,f}));ne.canUseDOM?Ye(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,Je=(U=class extends u.Component{shouldComponentUpdate(e){return!we(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,f=Object.keys(a).reduce((l,c)=>(l[De[c]||c]=a[c],l),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,f,s);break;default:t=this.mapObjectTypeChildren(n,t,f,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(W,{...r,context:n.value}):u.createElement(re.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const We=({defaultHelmet:e,children:t})=>{const[r,n]=u.useState([e]),s=u.useCallback(l=>{n(c=>[...c,l])},[]),a=u.useCallback(()=>{n(l=>l.length>1?l.slice(0,-1):l)},[n]),f=u.useMemo(()=>r.at(-1)??"",[r]),i=u.useMemo(()=>({addHelmet:s,removeHelmet:a}),[s,a]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:i,children:o.jsxRuntimeExports.jsxs(ne,{children:[o.jsxRuntimeExports.jsx(Je,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:f})}),t]})})},Ze=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ce;exports.DelegationProvider=Ee;exports.HelmetProvider=We;exports.LoadingProvider=ve;exports.LuminusComponentsProvider=ye;exports.UserProvider=Te;
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var ie=(e,t,r)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>ie(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ResponsiveContextDropdown-ChSWGvhl.cjs"),u=require("react"),N=require("@azure/msal-browser"),le=require("@azure/msal-react");require("react-router-dom");require("react-hook-form");require("react-flexmonster");const ue=require("./Loading--_5eZS-P.cjs"),ce=require("./useGetApiData-g4OYYC4j.cjs"),fe=require("./useLocalStorageState-BFc8Gc8H.cjs");function de(e){const t=o.toDate(e);return t.setHours(23,59,59,999),t}function me(){return de(Date.now())}function pe(e,t){const r=+o.toDate(e),[n,s]=[+o.toDate(t.start),+o.toDate(t.end)].sort((a,c)=>a-c);return r>=n&&r<=s}function he(){return o.startOfDay(Date.now())}const xe=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),a=u.useCallback(f=>{r(!0),s(f)},[]),c=u.useCallback(()=>{r(!1)},[]),i=u.useMemo(()=>({show:t,text:n,showConfirm:a,hideConfirm:c}),[t,n,a,c]);return o.jsxRuntimeExports.jsxs(o.ConfirmContext.Provider,{value:i,children:[o.jsxRuntimeExports.jsx(Qe,{}),e]})},ge=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{isShown:t,text:r,onFinish:n}=o.usePrompt(),{options:s}=u.useContext(o.PromptContext),[a,c]=u.useState(s.defaultValue??""),i=u.useCallback(()=>{n(null)},[n]),f=u.useCallback(d=>{d.preventDefault(),!(s.required&&!a)&&n(a)},[n,s.required,a]);u.useEffect(()=>{t===!0&&c(s.defaultValue??"")},[t,s.defaultValue]);const l=u.useMemo(()=>({value:a,onChange:d=>c(d.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[a]);return o.jsxRuntimeExports.jsxs(o.Modal,{show:t,size:"sm",centered:!0,onHide:i,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:r})}),o.jsxRuntimeExports.jsxs("form",{onSubmit:f,children:[o.jsxRuntimeExports.jsxs(o.Modal.Body,{children:[s.input==="textarea"?o.jsxRuntimeExports.jsx("textarea",{...l,rows:5}):void 0,s.input==="input"?o.jsxRuntimeExports.jsx(o.FormControl,{...l,type:s.type}):void 0]}),o.jsxRuntimeExports.jsxs(o.Modal.Footer,{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:e.cancel}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{color:"primary",disabled:s.required&&!a,type:"submit",className:"flex-grow-1",children:e.confirm})]})]})]})},ye=({children:e})=>{const[t,r]=u.useState(!1),[n,s]=u.useState(""),[a,c]=u.useState({input:"textarea",type:"text"}),i=u.useRef(()=>{}),f=u.useCallback(m=>{s(m),r(!0)},[]),l=u.useCallback(()=>{r(!1)},[]),d=u.useMemo(()=>({isShown:t,text:n,showPrompt:f,hidePrompt:l,resolveRef:i,options:a,setOptions:c}),[t,n,f,l,a]);return o.jsxRuntimeExports.jsxs(o.PromptContext.Provider,{value:d,children:[e,o.jsxRuntimeExports.jsx(ge,{})]})},ve=({cookieDomain:e,axiosOptions:t,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c,children:i})=>{const f=u.useMemo(()=>({axiosOptions:t,cookieDomain:e,language:r,texts:n,ProjectIconComponent:s,localizationContext:a,chartColorPalette:c}),[t,e,r,s,a,n,c]);return o.jsxRuntimeExports.jsx(o.LuminusComponentsContext.Provider,{value:f,children:o.jsxRuntimeExports.jsx(xe,{children:o.jsxRuntimeExports.jsxs(ye,{children:[o.jsxRuntimeExports.jsx(o.Ie,{}),i]})})})},Te=({children:e})=>{const[t,r]=u.useState(!1),[n]=u.useState(new Set),s=u.useCallback(i=>{n.add(i),r(!0)},[n]),a=u.useCallback(i=>{n.delete(i),n.size===0&&r(!1)},[n]),c=u.useMemo(()=>({isLoading:t,startLoading:s,stopLoading:a}),[t,s,a]);return o.jsxRuntimeExports.jsxs(o.LoadingContext.Provider,{value:c,children:[t&&o.jsxRuntimeExports.jsx(ue.Loading,{}),e]})},Ce=({children:e})=>{const t=o.useAxios(),{msalInstance:r}=u.useContext(o.AuthContext),{delegation:n,setDelegation:s,setAvailableDelegations:a,refreshAvailableDelegations:c}=u.useContext(o.DelegationContext),{getToken:i}=o.useAuth(),[f,l]=u.useState(null),d=u.useCallback(async()=>{const x=await i();x&&l(x)},[i]);u.useEffect(()=>{d()},[d]);const h=u.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,g]=u.useState({state:h?o.LoginState.LOGGED_IN:o.LoginState.LOGGING_IN,user:h}),P=u.useCallback(async x=>{let v=null;return await t.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(M=>{v=M.data}).catch(()=>{v=null}),v},[t]),S=u.useCallback(()=>{localStorage.removeItem("user"),g({state:o.LoginState.LOGGED_OUT,user:null}),s(null),a(null)},[a,s]),E=u.useCallback(async x=>{g({state:o.LoginState.LOGGING_IN,user:null});const v=await P(x);return v?(g({state:o.LoginState.LOGGED_IN,user:v}),localStorage.setItem("user",JSON.stringify(v)),await c(),!0):(g({state:o.LoginState.LOGIN_FAILED,user:null}),!1)},[P,c]),b=u.useCallback(()=>{S()},[S]);u.useEffect(()=>{if(r){const x=r.addEventCallback(v=>{if(v.eventType===N.EventType.LOGIN_SUCCESS&&v.payload){const M=v.payload;l(M.accessToken)}});return()=>{x&&r.removeEventCallback(x)}}return()=>{}},[r,E,b]);const K=u.useCallback(async x=>{x&&await E(x).catch(()=>{b(),s(null)})},[E,b,s]);u.useEffect(()=>{K(f)},[f,n==null?void 0:n.id,K]);const oe=u.useMemo(()=>({user:p.user,userLoginState:p,loginUser:E,logoutUser:b}),[p,E,b]);return o.jsxRuntimeExports.jsx(o.UserContext.Provider,{value:oe,children:e})},Ee=({...e})=>{const{cookieDomain:t}=u.useContext(o.LuminusComponentsContext),[,r]=o.useCookies(["Authorization"]),n=u.useMemo(()=>({useMsal:e.useMsal??!1,msalInstance:e.useMsal?e.msalInstance??null:null,msalScopes:e.useMsal?e.msalScopes??[]:[]}),[e]);return u.useEffect(()=>{if(e.useMsal){const s=e.msalInstance.addEventCallback(a=>{if(a.eventType===N.EventType.LOGIN_SUCCESS||a.eventType===N.EventType.ACQUIRE_TOKEN_SUCCESS&&a.payload){const c=a.payload,i=c.account;e.msalInstance.setActiveAccount(i);const f=c.accessToken,l=c.expiresOn;r("Authorization",f,{path:"/",secure:!0,sameSite:"none",domain:t,expires:l??void 0})}a.error&&console.error("AuthProvider MSAL Error",a)});return()=>{s&&e.msalInstance.removeEventCallback(s)}}return()=>{}},[e,r,t]),o.jsxRuntimeExports.jsx(o.AuthContext.Provider,{value:n,children:e.useMsal?o.jsxRuntimeExports.jsx(le.MsalProvider,{instance:e.msalInstance,children:e.children}):e.children})},Se=({children:e,relativeEndpoint:t})=>{const[r,n,s]=fe.useLocalStorageState("user-delegation",null),a=u.useMemo(()=>{if(!r)return null;const m=r.from?o.parseISO(r.from):he(),h=r.to?o.parseISO(r.to):me();return pe(new Date(Date.now()),{start:m,end:h})?r:(n(null),null)},[r,n]),{data:c,setData:i,reloadData:f}=ce.useGetApiData(t,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),l=u.useRef(null);u.useEffect(()=>{const m=()=>{f(),l.current=window.setTimeout(m,o.msToStartOfNextDay()+5e3)};return m(),()=>{l.current!==null&&window.clearTimeout(l.current)}},[f]),u.useEffect(()=>{const m=()=>{s()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[s,f]);const d=u.useMemo(()=>({delegation:a,setDelegation:n,availableDelegations:c,setAvailableDelegations:i,refreshAvailableDelegations:f}),[a,n,c,i,f]);return o.jsxRuntimeExports.jsx(o.DelegationContext.Provider,{value:d,children:e})};var be=typeof Element<"u",Ae=typeof Map=="function",je=typeof Set=="function",Oe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,s;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!k(e[n],t[n]))return!1;return!0}var a;if(Ae&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!k(n.value[1],t.get(n.value[0])))return!1;return!0}if(je&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(Oe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[n]))return!1;if(be&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&e.$$typeof)&&!k(e[s[n]],t[s[n]]))return!1;return!0}return e!==e&&t!==t}var we=function(t,r){try{return k(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const Pe=o.getDefaultExportFromCjs(we);var Re=function(t,r,n,s){var a=n?n.call(s,t,r):void 0;if(a!==void 0)return!!a;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var c=Object.keys(t),i=Object.keys(r);if(c.length!==i.length)return!1;for(var f=Object.prototype.hasOwnProperty.bind(r),l=0;l<c.length;l++){var d=c[l];if(!f(d))return!1;var m=t[d],h=r[d];if(a=n?n.call(s,m,h,d):void 0,a===!1||a===void 0&&m!==h)return!1}return!0};const De=o.getDefaultExportFromCjs(Re);var Q=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Q||{}),H={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},V=Object.values(Q),B={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Ie=Object.entries(B).reduce((e,[t,r])=>(e[r]=t,e),{}),T="data-rh",O={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},w=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},ke=e=>{let t=w(e,"title");const r=w(e,O.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=w(e,O.DEFAULT_TITLE);return t||n||void 0},Le=e=>w(e,O.ON_CHANGE_CLIENT_STATE)||(()=>{}),$=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),Me=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let a=0;a<s.length;a+=1){const i=s[a].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),He=e=>console&&typeof console.warn=="function"&&console.warn(e),R=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&He(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const c={};a.filter(f=>{let l;const d=Object.keys(f);for(let h=0;h<d.length;h+=1){const p=d[h],g=p.toLowerCase();t.indexOf(g)!==-1&&!(l==="rel"&&f[l].toLowerCase()==="canonical")&&!(g==="rel"&&f[g].toLowerCase()==="stylesheet")&&(l=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(l=p)}if(!l||!f[l])return!1;const m=f[l].toLowerCase();return n[l]||(n[l]={}),c[l]||(c[l]={}),n[l][m]?!1:(c[l][m]=!0,!0)}).reverse().forEach(f=>s.push(f));const i=Object.keys(c);for(let f=0;f<i.length;f+=1){const l=i[f],d={...n[l],...c[l]};n[l]=d}return s},[]).reverse()},$e=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},_e=e=>({baseTag:Me(["href"],e),bodyAttributes:$("bodyAttributes",e),defer:w(e,O.DEFER),encode:w(e,O.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:$("htmlAttributes",e),linkTags:R("link",["rel","href"],e),metaTags:R("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:R("noscript",["innerHTML"],e),onChangeClientState:Le(e),scriptTags:R("script",["src","innerHTML"],e),styleTags:R("style",["cssText"],e),title:ke(e),titleAttributes:$("titleAttributes",e),prioritizeSeoTags:$e(e,O.PRIORITIZE_SEO_TAGS)}),X=e=>Array.isArray(e)?e.join(""):e,Ue=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},_=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(Ue(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Y=(e,t)=>({...e,[t]:void 0}),Ne=["noscript","script","style"],q=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),ee=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),qe=(e,t,r,n)=>{const s=ee(r),a=X(t);return s?`<${e} ${T}="true" ${s}>${q(a,n)}</${e}>`:`<${e} ${T}="true">${q(a,n)}</${e}>`},Fe=(e,t,r=!0)=>t.reduce((n,s)=>{const a=s,c=Object.keys(a).filter(l=>!(l==="innerHTML"||l==="cssText")).reduce((l,d)=>{const m=typeof a[d]>"u"?d:`${d}="${q(a[d],r)}"`;return l?`${l} ${m}`:m},""),i=a.innerHTML||a.cssText||"",f=Ne.indexOf(e)===-1;return`${n}<${e} ${T}="true" ${c}${f?"/>":`>${i}</${e}>`}`},""),te=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=B[n];return r[s||n]=e[n],r},t),Ge=(e,t,r)=>{const n={key:t,[T]:!0},s=te(r,n);return[u.createElement("title",s,t)]},L=(e,t)=>t.map((r,n)=>{const s={key:n,[T]:!0};return Object.keys(r).forEach(a=>{const i=B[a]||a;if(i==="innerHTML"||i==="cssText"){const f=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:f}}else s[i]=r[a]}),u.createElement(e,s)}),y=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>Ge(e,t.title,t.titleAttributes),toString:()=>qe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>te(t),toString:()=>ee(t)};default:return{toComponent:()=>L(e,t),toString:()=>Fe(e,t,r)}}},ze=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=_(e,H.meta),a=_(t,H.link),c=_(r,H.script);return{priorityMethods:{toComponent:()=>[...L("meta",s.priority),...L("link",a.priority),...L("script",c.priority)],toString:()=>`${y("meta",s.priority,n)} ${y("link",a.priority,n)} ${y("script",c.priority,n)}`},metaTags:s.default,linkTags:a.default,scriptTags:c.default}},Be=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:a,styleTags:c,title:i="",titleAttributes:f,prioritizeSeoTags:l}=e;let{linkTags:d,metaTags:m,scriptTags:h}=e,p={toComponent:()=>{},toString:()=>""};return l&&({priorityMethods:p,linkTags:d,metaTags:m,scriptTags:h}=ze(e)),{priority:p,base:y("base",t,n),bodyAttributes:y("bodyAttributes",r,n),htmlAttributes:y("htmlAttributes",s,n),link:y("link",d,n),meta:y("meta",m,n),noscript:y("noscript",a,n),script:y("script",h,n),style:y("style",c,n),title:y("title",{title:i,titleAttributes:f},n)}},F=Be,I=[],re=!!(typeof window<"u"&&window.document&&window.document.createElement),G=class{constructor(e,t){C(this,"instances",[]);C(this,"canUseDOM",re);C(this,"context");C(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?I:this.instances,add:e=>{(this.canUseDOM?I:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?I:this.instances).indexOf(e);(this.canUseDOM?I:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=F({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ke={},ne=u.createContext(Ke),A,se=(A=class extends u.Component{constructor(r){super(r);C(this,"helmetData");this.helmetData=new G(this.props.context||{},A.canUseDOM)}render(){return u.createElement(ne.Provider,{value:this.helmetData.value},this.props.children)}},C(A,"canUseDOM",re),A),j=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${T}]`),s=[].slice.call(n),a=[];let c;return t&&t.length&&t.forEach(i=>{const f=document.createElement(e);for(const l in i)if(Object.prototype.hasOwnProperty.call(i,l))if(l==="innerHTML")f.innerHTML=i.innerHTML;else if(l==="cssText")f.styleSheet?f.styleSheet.cssText=i.cssText:f.appendChild(document.createTextNode(i.cssText));else{const d=l,m=typeof i[d]>"u"?"":i[d];f.setAttribute(l,m)}f.setAttribute(T,"true"),s.some((l,d)=>(c=d,f.isEqualNode(l)))?s.splice(c,1):a.push(f)}),s.forEach(i=>{var f;return(f=i.parentNode)==null?void 0:f.removeChild(i)}),a.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:a}},z=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(T),s=n?n.split(","):[],a=[...s],c=Object.keys(t);for(const i of c){const f=t[i]||"";r.getAttribute(i)!==f&&r.setAttribute(i,f),s.indexOf(i)===-1&&s.push(i);const l=a.indexOf(i);l!==-1&&a.splice(l,1)}for(let i=a.length-1;i>=0;i-=1)r.removeAttribute(a[i]);s.length===a.length?r.removeAttribute(T):r.getAttribute(T)!==c.join(",")&&r.setAttribute(T,c.join(","))},Ve=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=X(e)),z("title",t)},J=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:a,metaTags:c,noscriptTags:i,onChangeClientState:f,scriptTags:l,styleTags:d,title:m,titleAttributes:h}=e;z("body",n),z("html",s),Ve(m,h);const p={baseTag:j("base",r),linkTags:j("link",a),metaTags:j("meta",c),noscriptTags:j("noscript",i),scriptTags:j("script",l),styleTags:j("style",d)},g={},P={};Object.keys(p).forEach(S=>{const{newTags:E,oldTags:b}=p[S];E.length&&(g[S]=E),b.length&&(P[S]=p[S].oldTags)}),t&&t(),f(e,g,P)},D=null,Ye=e=>{D&&cancelAnimationFrame(D),e.defer?D=requestAnimationFrame(()=>{J(e,()=>{D=null})}):(J(e),D=null)},Je=Ye,W=class extends u.Component{constructor(){super(...arguments);C(this,"rendered",!1)}shouldComponentUpdate(t){return!De(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=_e(t.get().map(a=>{const c={...a.props};return delete c.context,c}));se.canUseDOM?Je(s):F&&(n=F(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},U,We=(U=class extends u.Component{shouldComponentUpdate(e){return!Pe(Y(this.props,"helmetData"),Y(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return o.invariant(V.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${V.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),o.invariant(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return u.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...a}=n.props,c=Object.keys(a).reduce((f,l)=>(f[Ie[l]||l]=a[l],f),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof G)){const s=n;n=new G(s.context,!0),delete r.helmetData}return n?u.createElement(W,{...r,context:n.value}):u.createElement(ne.Consumer,null,s=>u.createElement(W,{...r,context:s}))}},C(U,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),U);const Z=(e,t)=>e?`${e} | ${t}`:t,Ze=({defaultHelmet:e,children:t,helmetPrefix:r})=>{const[n,s]=u.useState([Z(r??"",e)]),a=u.useCallback(l=>{s(d=>[...d,Z(r??"",l)])},[r]),c=u.useCallback(()=>{s(l=>l.length>1?l.slice(0,-1):l)},[s]),i=u.useMemo(()=>n.at(-1)??"",[n]),f=u.useMemo(()=>({addHelmet:a,removeHelmet:c}),[a,c]);return o.jsxRuntimeExports.jsx(o.HelmetContext.Provider,{value:f,children:o.jsxRuntimeExports.jsxs(se,{children:[o.jsxRuntimeExports.jsx(We,{defer:!1,children:o.jsxRuntimeExports.jsx("title",{children:i})}),t]})})},Qe=()=>{const{texts:{confirm:e}}=u.useContext(o.LuminusComponentsContext),{onConfirm:t,onCancel:r,text:n,show:s}=o.useConfirm();return o.jsxRuntimeExports.jsxs(o.Modal,{show:s,size:"sm",centered:!0,onHide:r,children:[o.jsxRuntimeExports.jsx(o.Modal.Header,{className:"justify-content-center",children:o.jsxRuntimeExports.jsx(o.Modal.Title,{children:n})}),o.jsxRuntimeExports.jsx(o.Modal.Body,{children:o.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:r,children:e.no}),o.jsxRuntimeExports.jsx(o.PrimaryButton,{type:"button",color:"primary",onClick:t,className:"w-100 ml",children:e.yes})]})})]})};exports.AuthContext=o.AuthContext;exports.DelegationContext=o.DelegationContext;exports.HelmetContext=o.HelmetContext;exports.LoadingContext=o.LoadingContext;exports.LuminusComponentsContext=o.LuminusComponentsContext;exports.UserContext=o.UserContext;exports.AuthProvider=Ee;exports.DelegationProvider=Se;exports.HelmetProvider=Ze;exports.LoadingProvider=Te;exports.LuminusComponentsProvider=ve;exports.UserProvider=Ce;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (e, t, r) =>
|
|
4
|
-
import { t as N, bi as
|
|
5
|
-
import E, { useState as C, useCallback as p, useMemo as b, useContext as
|
|
1
|
+
var Se = Object.defineProperty;
|
|
2
|
+
var Oe = (e, t, r) => t in e ? Se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var A = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { t as N, bi as Ee, j as f, bj as we, $ as z, b3 as Ie, bk as fe, ab as S, b2 as je, a0 as G, bl as De, aT as Pe, as as ke, aA as de, bm as me, aB as Le, aD as P, aC as He, bn as $e, aR as se, bo as _e, bp as pe, bq as oe, br as Me, aV as Re } from "./ResponsiveContextDropdown-BCX5qj18.js";
|
|
5
|
+
import E, { useState as C, useCallback as p, useMemo as b, useContext as $, useEffect as D, useRef as he, Component as te } from "react";
|
|
6
6
|
import { EventType as W } from "@azure/msal-browser";
|
|
7
|
-
import { MsalProvider as
|
|
7
|
+
import { MsalProvider as Ue } from "@azure/msal-react";
|
|
8
8
|
import "react-router-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as
|
|
12
|
-
import { u as
|
|
13
|
-
import { u as
|
|
14
|
-
function
|
|
11
|
+
import { L as Ne } from "./Loading-DgeMjQjb.js";
|
|
12
|
+
import { u as Fe } from "./useGetApiData-DAQ3VavP.js";
|
|
13
|
+
import { u as qe } from "./useLocalStorageState-Bt99kkCr.js";
|
|
14
|
+
function Ge(e) {
|
|
15
15
|
const t = N(e);
|
|
16
16
|
return t.setHours(23, 59, 59, 999), t;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function ze() {
|
|
19
|
+
return Ge(Date.now());
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ke(e, t) {
|
|
22
22
|
const r = +N(e), [n, s] = [
|
|
23
23
|
+N(t.start),
|
|
24
24
|
+N(t.end)
|
|
25
|
-
].sort((o,
|
|
25
|
+
].sort((o, l) => o - l);
|
|
26
26
|
return r >= n && r <= s;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function Ve() {
|
|
29
|
+
return Ee(Date.now());
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const [t, r] = C(!1), [n, s] = C(""), o = p((
|
|
33
|
-
r(!0), s(
|
|
34
|
-
}, []),
|
|
31
|
+
const Be = ({ children: e }) => {
|
|
32
|
+
const [t, r] = C(!1), [n, s] = C(""), o = p((c) => {
|
|
33
|
+
r(!0), s(c);
|
|
34
|
+
}, []), l = p(() => {
|
|
35
35
|
r(!1);
|
|
36
|
-
}, []), a = b(() => ({ show: t, text: n, showConfirm: o, hideConfirm:
|
|
37
|
-
return /* @__PURE__ */ f.jsxs(
|
|
38
|
-
/* @__PURE__ */ f.jsx(
|
|
36
|
+
}, []), a = b(() => ({ show: t, text: n, showConfirm: o, hideConfirm: l }), [t, n, o, l]);
|
|
37
|
+
return /* @__PURE__ */ f.jsxs(we.Provider, { value: a, children: [
|
|
38
|
+
/* @__PURE__ */ f.jsx(At, {}),
|
|
39
39
|
e
|
|
40
40
|
] });
|
|
41
|
-
},
|
|
42
|
-
const { texts: { confirm: e } } =
|
|
41
|
+
}, Ye = () => {
|
|
42
|
+
const { texts: { confirm: e } } = $(z), { isShown: t, text: r, onFinish: n } = Ie(), { options: s } = $(fe), [o, l] = C(s.defaultValue ?? ""), a = p(() => {
|
|
43
43
|
n(null);
|
|
44
|
-
}, [n]),
|
|
44
|
+
}, [n]), c = p((u) => {
|
|
45
45
|
u.preventDefault(), !(s.required && !o) && n(o);
|
|
46
46
|
}, [n, s.required, o]);
|
|
47
|
-
|
|
48
|
-
t === !0 &&
|
|
47
|
+
D(() => {
|
|
48
|
+
t === !0 && l(s.defaultValue ?? "");
|
|
49
49
|
}, [t, s.defaultValue]);
|
|
50
|
-
const
|
|
50
|
+
const i = b(() => ({
|
|
51
51
|
value: o,
|
|
52
|
-
onChange: (u) =>
|
|
52
|
+
onChange: (u) => l(u.currentTarget.value),
|
|
53
53
|
className: "w-100",
|
|
54
54
|
autoFocus: !0,
|
|
55
55
|
tabIndex: 0
|
|
56
56
|
}), [o]);
|
|
57
57
|
return /* @__PURE__ */ f.jsxs(S, { show: t, size: "sm", centered: !0, onHide: a, children: [
|
|
58
58
|
/* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: r }) }),
|
|
59
|
-
/* @__PURE__ */ f.jsxs("form", { onSubmit:
|
|
59
|
+
/* @__PURE__ */ f.jsxs("form", { onSubmit: c, children: [
|
|
60
60
|
/* @__PURE__ */ f.jsxs(S.Body, { children: [
|
|
61
|
-
s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...
|
|
62
|
-
s.input === "input" ? /* @__PURE__ */ f.jsx(
|
|
61
|
+
s.input === "textarea" ? /* @__PURE__ */ f.jsx("textarea", { ...i, rows: 5 }) : void 0,
|
|
62
|
+
s.input === "input" ? /* @__PURE__ */ f.jsx(je, { ...i, type: s.type }) : void 0
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ f.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
65
65
|
/* @__PURE__ */ f.jsx(G, { variant: "outlined", color: "secondary", onClick: a, className: "flex-grow-1", children: e.cancel }),
|
|
@@ -67,34 +67,34 @@ const Ve = ({ children: e }) => {
|
|
|
67
67
|
] })
|
|
68
68
|
] })
|
|
69
69
|
] });
|
|
70
|
-
},
|
|
71
|
-
const [t, r] = C(!1), [n, s] = C(""), [o,
|
|
72
|
-
}),
|
|
70
|
+
}, Je = ({ children: e }) => {
|
|
71
|
+
const [t, r] = C(!1), [n, s] = C(""), [o, l] = C({ input: "textarea", type: "text" }), a = he(() => {
|
|
72
|
+
}), c = p((d) => {
|
|
73
73
|
s(d), r(!0);
|
|
74
|
-
}, []),
|
|
74
|
+
}, []), i = p(() => {
|
|
75
75
|
r(!1);
|
|
76
76
|
}, []), u = b(() => ({
|
|
77
77
|
isShown: t,
|
|
78
78
|
text: n,
|
|
79
|
-
showPrompt:
|
|
80
|
-
hidePrompt:
|
|
79
|
+
showPrompt: c,
|
|
80
|
+
hidePrompt: i,
|
|
81
81
|
resolveRef: a,
|
|
82
82
|
options: o,
|
|
83
|
-
setOptions:
|
|
84
|
-
}), [t, n,
|
|
85
|
-
return /* @__PURE__ */ f.jsxs(
|
|
83
|
+
setOptions: l
|
|
84
|
+
}), [t, n, c, i, o]);
|
|
85
|
+
return /* @__PURE__ */ f.jsxs(fe.Provider, { value: u, children: [
|
|
86
86
|
e,
|
|
87
|
-
/* @__PURE__ */ f.jsx(
|
|
87
|
+
/* @__PURE__ */ f.jsx(Ye, {})
|
|
88
88
|
] });
|
|
89
|
-
},
|
|
90
|
-
const
|
|
89
|
+
}, $t = ({ cookieDomain: e, axiosOptions: t, language: r, texts: n, ProjectIconComponent: s, localizationContext: o, chartColorPalette: l, children: a }) => {
|
|
90
|
+
const c = b(() => ({
|
|
91
91
|
axiosOptions: t,
|
|
92
92
|
cookieDomain: e,
|
|
93
93
|
language: r,
|
|
94
94
|
texts: n,
|
|
95
95
|
ProjectIconComponent: s,
|
|
96
96
|
localizationContext: o,
|
|
97
|
-
chartColorPalette:
|
|
97
|
+
chartColorPalette: l
|
|
98
98
|
}), [
|
|
99
99
|
t,
|
|
100
100
|
e,
|
|
@@ -102,10 +102,10 @@ const Ve = ({ children: e }) => {
|
|
|
102
102
|
s,
|
|
103
103
|
o,
|
|
104
104
|
n,
|
|
105
|
-
|
|
105
|
+
l
|
|
106
106
|
]);
|
|
107
|
-
return /* @__PURE__ */ f.jsx(z.Provider, { value:
|
|
108
|
-
/* @__PURE__ */ f.jsx(
|
|
107
|
+
return /* @__PURE__ */ f.jsx(z.Provider, { value: c, children: /* @__PURE__ */ f.jsx(Be, { children: /* @__PURE__ */ f.jsxs(Je, { children: [
|
|
108
|
+
/* @__PURE__ */ f.jsx(De, {}),
|
|
109
109
|
a
|
|
110
110
|
] }) }) });
|
|
111
111
|
}, _t = ({ children: e }) => {
|
|
@@ -113,26 +113,26 @@ const Ve = ({ children: e }) => {
|
|
|
113
113
|
n.add(a), r(!0);
|
|
114
114
|
}, [n]), o = p((a) => {
|
|
115
115
|
n.delete(a), n.size === 0 && r(!1);
|
|
116
|
-
}, [n]),
|
|
117
|
-
return /* @__PURE__ */ f.jsxs(Pe.Provider, { value:
|
|
118
|
-
t && /* @__PURE__ */ f.jsx(
|
|
116
|
+
}, [n]), l = b(() => ({ isLoading: t, startLoading: s, stopLoading: o }), [t, s, o]);
|
|
117
|
+
return /* @__PURE__ */ f.jsxs(Pe.Provider, { value: l, children: [
|
|
118
|
+
t && /* @__PURE__ */ f.jsx(Ne, {}),
|
|
119
119
|
e
|
|
120
120
|
] });
|
|
121
|
-
},
|
|
122
|
-
const t =
|
|
121
|
+
}, Mt = ({ children: e }) => {
|
|
122
|
+
const t = ke(), { msalInstance: r } = $(de), { delegation: n, setDelegation: s, setAvailableDelegations: o, refreshAvailableDelegations: l } = $(me), { getToken: a } = Le(), [c, i] = C(null), u = p(async () => {
|
|
123
123
|
const y = await a();
|
|
124
|
-
y &&
|
|
124
|
+
y && i(y);
|
|
125
125
|
}, [a]);
|
|
126
|
-
|
|
126
|
+
D(() => {
|
|
127
127
|
u();
|
|
128
128
|
}, [u]);
|
|
129
129
|
const h = p(() => {
|
|
130
130
|
const y = localStorage.getItem("user") ?? null;
|
|
131
131
|
return y ? JSON.parse(y ?? "") : null;
|
|
132
132
|
}, [])(), [m, g] = C({
|
|
133
|
-
state: h ?
|
|
133
|
+
state: h ? P.LOGGED_IN : P.LOGGING_IN,
|
|
134
134
|
user: h
|
|
135
|
-
}),
|
|
135
|
+
}), _ = p(async (y) => {
|
|
136
136
|
let v = null;
|
|
137
137
|
return await t.get("/user/detail", y ? { headers: { Authorization: `Bearer ${y}` } } : void 0).then((K) => {
|
|
138
138
|
v = K.data;
|
|
@@ -141,31 +141,31 @@ const Ve = ({ children: e }) => {
|
|
|
141
141
|
}), v;
|
|
142
142
|
}, [t]), w = p(() => {
|
|
143
143
|
localStorage.removeItem("user"), g({
|
|
144
|
-
state:
|
|
144
|
+
state: P.LOGGED_OUT,
|
|
145
145
|
user: null
|
|
146
146
|
}), s(null), o(null);
|
|
147
147
|
}, [o, s]), O = p(async (y) => {
|
|
148
148
|
g({
|
|
149
|
-
state:
|
|
149
|
+
state: P.LOGGING_IN,
|
|
150
150
|
user: null
|
|
151
151
|
});
|
|
152
|
-
const v = await
|
|
152
|
+
const v = await _(y);
|
|
153
153
|
return v ? (g({
|
|
154
|
-
state:
|
|
154
|
+
state: P.LOGGED_IN,
|
|
155
155
|
user: v
|
|
156
|
-
}), localStorage.setItem("user", JSON.stringify(v)), await
|
|
157
|
-
state:
|
|
156
|
+
}), localStorage.setItem("user", JSON.stringify(v)), await l(), !0) : (g({
|
|
157
|
+
state: P.LOGIN_FAILED,
|
|
158
158
|
user: null
|
|
159
159
|
}), !1);
|
|
160
|
-
}, [
|
|
160
|
+
}, [_, l]), I = p(() => {
|
|
161
161
|
w();
|
|
162
162
|
}, [w]);
|
|
163
|
-
|
|
163
|
+
D(() => {
|
|
164
164
|
if (r) {
|
|
165
165
|
const y = r.addEventCallback((v) => {
|
|
166
166
|
if (v.eventType === W.LOGIN_SUCCESS && v.payload) {
|
|
167
167
|
const K = v.payload;
|
|
168
|
-
|
|
168
|
+
i(K.accessToken);
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
return () => {
|
|
@@ -180,35 +180,35 @@ const Ve = ({ children: e }) => {
|
|
|
180
180
|
I(), s(null);
|
|
181
181
|
});
|
|
182
182
|
}, [O, I, s]);
|
|
183
|
-
|
|
184
|
-
ne(
|
|
185
|
-
}, [
|
|
186
|
-
const
|
|
183
|
+
D(() => {
|
|
184
|
+
ne(c);
|
|
185
|
+
}, [c, n == null ? void 0 : n.id, ne]);
|
|
186
|
+
const Ae = b(() => ({
|
|
187
187
|
user: m.user,
|
|
188
188
|
userLoginState: m,
|
|
189
189
|
loginUser: O,
|
|
190
190
|
logoutUser: I
|
|
191
191
|
}), [m, O, I]);
|
|
192
|
-
return /* @__PURE__ */ f.jsx(
|
|
193
|
-
},
|
|
194
|
-
const { cookieDomain: t } =
|
|
192
|
+
return /* @__PURE__ */ f.jsx(He.Provider, { value: Ae, children: e });
|
|
193
|
+
}, Rt = ({ ...e }) => {
|
|
194
|
+
const { cookieDomain: t } = $(z), [, r] = $e(["Authorization"]), n = b(() => ({
|
|
195
195
|
useMsal: e.useMsal ?? !1,
|
|
196
196
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
197
197
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
198
198
|
}), [e]);
|
|
199
|
-
return
|
|
199
|
+
return D(() => {
|
|
200
200
|
if (e.useMsal) {
|
|
201
201
|
const s = e.msalInstance.addEventCallback((o) => {
|
|
202
202
|
if (o.eventType === W.LOGIN_SUCCESS || o.eventType === W.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
203
|
-
const
|
|
203
|
+
const l = o.payload, a = l.account;
|
|
204
204
|
e.msalInstance.setActiveAccount(a);
|
|
205
|
-
const
|
|
206
|
-
r("Authorization",
|
|
205
|
+
const c = l.accessToken, i = l.expiresOn;
|
|
206
|
+
r("Authorization", c, {
|
|
207
207
|
path: "/",
|
|
208
208
|
secure: !0,
|
|
209
209
|
sameSite: "none",
|
|
210
210
|
domain: t,
|
|
211
|
-
expires:
|
|
211
|
+
expires: i ?? void 0
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
o.error && console.error("AuthProvider MSAL Error", o);
|
|
@@ -219,48 +219,48 @@ const Ve = ({ children: e }) => {
|
|
|
219
219
|
}
|
|
220
220
|
return () => {
|
|
221
221
|
};
|
|
222
|
-
}, [e, r, t]), /* @__PURE__ */ f.jsx(
|
|
223
|
-
},
|
|
224
|
-
const [r, n, s] =
|
|
222
|
+
}, [e, r, t]), /* @__PURE__ */ f.jsx(de.Provider, { value: n, children: e.useMsal ? /* @__PURE__ */ f.jsx(Ue, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
223
|
+
}, Ut = ({ children: e, relativeEndpoint: t }) => {
|
|
224
|
+
const [r, n, s] = qe("user-delegation", null), o = b(() => {
|
|
225
225
|
if (!r)
|
|
226
226
|
return null;
|
|
227
|
-
const d = r.from ? se(r.from) :
|
|
228
|
-
return
|
|
229
|
-
}, [r, n]), { data:
|
|
227
|
+
const d = r.from ? se(r.from) : Ve(), h = r.to ? se(r.to) : ze();
|
|
228
|
+
return Ke(new Date(Date.now()), { start: d, end: h }) ? r : (n(null), null);
|
|
229
|
+
}, [r, n]), { data: l, setData: a, reloadData: c } = Fe(t, {
|
|
230
230
|
nullStateBeforeLoad: !1,
|
|
231
231
|
nullStateOnFail: !0
|
|
232
|
-
}),
|
|
233
|
-
|
|
232
|
+
}), i = he(null);
|
|
233
|
+
D(() => {
|
|
234
234
|
const d = () => {
|
|
235
|
-
|
|
235
|
+
c(), i.current = window.setTimeout(d, _e() + 5e3);
|
|
236
236
|
};
|
|
237
237
|
return d(), () => {
|
|
238
|
-
|
|
238
|
+
i.current !== null && window.clearTimeout(i.current);
|
|
239
239
|
};
|
|
240
|
-
}, [
|
|
240
|
+
}, [c]), D(() => {
|
|
241
241
|
const d = () => {
|
|
242
242
|
s();
|
|
243
243
|
};
|
|
244
244
|
return window.addEventListener("focus", d), () => {
|
|
245
245
|
window.removeEventListener("focus", d);
|
|
246
246
|
};
|
|
247
|
-
}, [s,
|
|
247
|
+
}, [s, c]);
|
|
248
248
|
const u = b(() => ({
|
|
249
249
|
delegation: o,
|
|
250
250
|
setDelegation: n,
|
|
251
|
-
availableDelegations:
|
|
251
|
+
availableDelegations: l,
|
|
252
252
|
setAvailableDelegations: a,
|
|
253
|
-
refreshAvailableDelegations:
|
|
253
|
+
refreshAvailableDelegations: c
|
|
254
254
|
}), [
|
|
255
255
|
o,
|
|
256
256
|
n,
|
|
257
|
-
|
|
257
|
+
l,
|
|
258
258
|
a,
|
|
259
|
-
|
|
259
|
+
c
|
|
260
260
|
]);
|
|
261
|
-
return /* @__PURE__ */ f.jsx(
|
|
261
|
+
return /* @__PURE__ */ f.jsx(me.Provider, { value: u, children: e });
|
|
262
262
|
};
|
|
263
|
-
var
|
|
263
|
+
var We = typeof Element < "u", Ze = typeof Map == "function", Qe = typeof Set == "function", Xe = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
|
|
264
264
|
function F(e, t) {
|
|
265
265
|
if (e === t) return !0;
|
|
266
266
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -273,7 +273,7 @@ function F(e, t) {
|
|
|
273
273
|
return !0;
|
|
274
274
|
}
|
|
275
275
|
var o;
|
|
276
|
-
if (
|
|
276
|
+
if (Ze && e instanceof Map && t instanceof Map) {
|
|
277
277
|
if (e.size !== t.size) return !1;
|
|
278
278
|
for (o = e.entries(); !(n = o.next()).done; )
|
|
279
279
|
if (!t.has(n.value[0])) return !1;
|
|
@@ -281,13 +281,13 @@ function F(e, t) {
|
|
|
281
281
|
if (!F(n.value[1], t.get(n.value[0]))) return !1;
|
|
282
282
|
return !0;
|
|
283
283
|
}
|
|
284
|
-
if (
|
|
284
|
+
if (Qe && e instanceof Set && t instanceof Set) {
|
|
285
285
|
if (e.size !== t.size) return !1;
|
|
286
286
|
for (o = e.entries(); !(n = o.next()).done; )
|
|
287
287
|
if (!t.has(n.value[0])) return !1;
|
|
288
288
|
return !0;
|
|
289
289
|
}
|
|
290
|
-
if (
|
|
290
|
+
if (Xe && ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
|
|
291
291
|
if (r = e.length, r != t.length) return !1;
|
|
292
292
|
for (n = r; n-- !== 0; )
|
|
293
293
|
if (e[n] !== t[n]) return !1;
|
|
@@ -299,7 +299,7 @@ function F(e, t) {
|
|
|
299
299
|
if (s = Object.keys(e), r = s.length, r !== Object.keys(t).length) return !1;
|
|
300
300
|
for (n = r; n-- !== 0; )
|
|
301
301
|
if (!Object.prototype.hasOwnProperty.call(t, s[n])) return !1;
|
|
302
|
-
if (
|
|
302
|
+
if (We && e instanceof Element) return !1;
|
|
303
303
|
for (n = r; n-- !== 0; )
|
|
304
304
|
if (!((s[n] === "_owner" || s[n] === "__v" || s[n] === "__o") && e.$$typeof) && !F(e[s[n]], t[s[n]]))
|
|
305
305
|
return !1;
|
|
@@ -307,7 +307,7 @@ function F(e, t) {
|
|
|
307
307
|
}
|
|
308
308
|
return e !== e && t !== t;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var et = function(t, r) {
|
|
311
311
|
try {
|
|
312
312
|
return F(t, r);
|
|
313
313
|
} catch (n) {
|
|
@@ -316,8 +316,8 @@ var Xe = function(t, r) {
|
|
|
316
316
|
throw n;
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
const
|
|
320
|
-
var
|
|
319
|
+
const tt = /* @__PURE__ */ pe(et);
|
|
320
|
+
var rt = function(t, r, n, s) {
|
|
321
321
|
var o = n ? n.call(s, t, r) : void 0;
|
|
322
322
|
if (o !== void 0)
|
|
323
323
|
return !!o;
|
|
@@ -325,12 +325,12 @@ var tt = function(t, r, n, s) {
|
|
|
325
325
|
return !0;
|
|
326
326
|
if (typeof t != "object" || !t || typeof r != "object" || !r)
|
|
327
327
|
return !1;
|
|
328
|
-
var
|
|
329
|
-
if (
|
|
328
|
+
var l = Object.keys(t), a = Object.keys(r);
|
|
329
|
+
if (l.length !== a.length)
|
|
330
330
|
return !1;
|
|
331
|
-
for (var
|
|
332
|
-
var u =
|
|
333
|
-
if (!
|
|
331
|
+
for (var c = Object.prototype.hasOwnProperty.bind(r), i = 0; i < l.length; i++) {
|
|
332
|
+
var u = l[i];
|
|
333
|
+
if (!c(u))
|
|
334
334
|
return !1;
|
|
335
335
|
var d = t[u], h = r[u];
|
|
336
336
|
if (o = n ? n.call(s, d, h, u) : void 0, o === !1 || o === void 0 && d !== h)
|
|
@@ -338,8 +338,8 @@ var tt = function(t, r, n, s) {
|
|
|
338
338
|
}
|
|
339
339
|
return !0;
|
|
340
340
|
};
|
|
341
|
-
const
|
|
342
|
-
var
|
|
341
|
+
const nt = /* @__PURE__ */ pe(rt);
|
|
342
|
+
var ye = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(ye || {}), V = {
|
|
343
343
|
link: { rel: ["amphtml", "canonical", "alternate"] },
|
|
344
344
|
script: { type: ["application/ld+json"] },
|
|
345
345
|
meta: {
|
|
@@ -361,7 +361,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
361
361
|
"twitter:site"
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
|
-
}, ae = Object.values(
|
|
364
|
+
}, ae = Object.values(ye), re = {
|
|
365
365
|
accesskey: "accessKey",
|
|
366
366
|
charset: "charSet",
|
|
367
367
|
class: "className",
|
|
@@ -370,7 +370,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
370
370
|
"http-equiv": "httpEquiv",
|
|
371
371
|
itemprop: "itemProp",
|
|
372
372
|
tabindex: "tabIndex"
|
|
373
|
-
},
|
|
373
|
+
}, st = Object.entries(re).reduce(
|
|
374
374
|
(e, [t, r]) => (e[r] = t, e),
|
|
375
375
|
{}
|
|
376
376
|
), x = "data-rh", L = {
|
|
@@ -387,7 +387,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
387
387
|
return n[t];
|
|
388
388
|
}
|
|
389
389
|
return null;
|
|
390
|
-
},
|
|
390
|
+
}, ot = (e) => {
|
|
391
391
|
let t = H(
|
|
392
392
|
e,
|
|
393
393
|
"title"
|
|
@@ -398,8 +398,8 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
398
398
|
return r.replace(/%s/g, () => t);
|
|
399
399
|
const n = H(e, L.DEFAULT_TITLE);
|
|
400
400
|
return t || n || void 0;
|
|
401
|
-
},
|
|
402
|
-
}), B = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}),
|
|
401
|
+
}, at = (e) => H(e, L.ON_CHANGE_CLIENT_STATE) || (() => {
|
|
402
|
+
}), B = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), it = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
|
|
403
403
|
if (!r.length) {
|
|
404
404
|
const s = Object.keys(n);
|
|
405
405
|
for (let o = 0; o < s.length; o += 1) {
|
|
@@ -409,43 +409,43 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
return r;
|
|
412
|
-
}, []),
|
|
412
|
+
}, []), lt = (e) => console && typeof console.warn == "function" && console.warn(e), M = (e, t, r) => {
|
|
413
413
|
const n = {};
|
|
414
|
-
return r.filter((s) => Array.isArray(s[e]) ? !0 : (typeof s[e] < "u" &&
|
|
414
|
+
return r.filter((s) => Array.isArray(s[e]) ? !0 : (typeof s[e] < "u" && lt(
|
|
415
415
|
`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`
|
|
416
416
|
), !1)).map((s) => s[e]).reverse().reduce((s, o) => {
|
|
417
|
-
const
|
|
418
|
-
o.filter((
|
|
419
|
-
let
|
|
420
|
-
const u = Object.keys(
|
|
417
|
+
const l = {};
|
|
418
|
+
o.filter((c) => {
|
|
419
|
+
let i;
|
|
420
|
+
const u = Object.keys(c);
|
|
421
421
|
for (let h = 0; h < u.length; h += 1) {
|
|
422
422
|
const m = u[h], g = m.toLowerCase();
|
|
423
|
-
t.indexOf(g) !== -1 && !(
|
|
423
|
+
t.indexOf(g) !== -1 && !(i === "rel" && c[i].toLowerCase() === "canonical") && !(g === "rel" && c[g].toLowerCase() === "stylesheet") && (i = g), t.indexOf(m) !== -1 && (m === "innerHTML" || m === "cssText" || m === "itemprop") && (i = m);
|
|
424
424
|
}
|
|
425
|
-
if (!
|
|
425
|
+
if (!i || !c[i])
|
|
426
426
|
return !1;
|
|
427
|
-
const d = i
|
|
428
|
-
return n[
|
|
429
|
-
}).reverse().forEach((
|
|
430
|
-
const a = Object.keys(
|
|
431
|
-
for (let
|
|
432
|
-
const
|
|
433
|
-
...n[
|
|
434
|
-
...
|
|
427
|
+
const d = c[i].toLowerCase();
|
|
428
|
+
return n[i] || (n[i] = {}), l[i] || (l[i] = {}), n[i][d] ? !1 : (l[i][d] = !0, !0);
|
|
429
|
+
}).reverse().forEach((c) => s.push(c));
|
|
430
|
+
const a = Object.keys(l);
|
|
431
|
+
for (let c = 0; c < a.length; c += 1) {
|
|
432
|
+
const i = a[c], u = {
|
|
433
|
+
...n[i],
|
|
434
|
+
...l[i]
|
|
435
435
|
};
|
|
436
|
-
n[
|
|
436
|
+
n[i] = u;
|
|
437
437
|
}
|
|
438
438
|
return s;
|
|
439
439
|
}, []).reverse();
|
|
440
|
-
},
|
|
440
|
+
}, ct = (e, t) => {
|
|
441
441
|
if (Array.isArray(e) && e.length) {
|
|
442
442
|
for (let r = 0; r < e.length; r += 1)
|
|
443
443
|
if (e[r][t])
|
|
444
444
|
return !0;
|
|
445
445
|
}
|
|
446
446
|
return !1;
|
|
447
|
-
},
|
|
448
|
-
baseTag:
|
|
447
|
+
}, ut = (e) => ({
|
|
448
|
+
baseTag: it([
|
|
449
449
|
"href"
|
|
450
450
|
/* HREF */
|
|
451
451
|
], e),
|
|
@@ -478,7 +478,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
478
478
|
"innerHTML"
|
|
479
479
|
/* INNER_HTML */
|
|
480
480
|
], e),
|
|
481
|
-
onChangeClientState:
|
|
481
|
+
onChangeClientState: at(e),
|
|
482
482
|
scriptTags: M(
|
|
483
483
|
"script",
|
|
484
484
|
[
|
|
@@ -492,31 +492,31 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
492
492
|
"cssText"
|
|
493
493
|
/* CSS_TEXT */
|
|
494
494
|
], e),
|
|
495
|
-
title:
|
|
495
|
+
title: ot(e),
|
|
496
496
|
titleAttributes: B("titleAttributes", e),
|
|
497
|
-
prioritizeSeoTags:
|
|
498
|
-
}),
|
|
497
|
+
prioritizeSeoTags: ct(e, L.PRIORITIZE_SEO_TAGS)
|
|
498
|
+
}), ge = (e) => Array.isArray(e) ? e.join("") : e, ft = (e, t) => {
|
|
499
499
|
const r = Object.keys(e);
|
|
500
500
|
for (let n = 0; n < r.length; n += 1)
|
|
501
501
|
if (t[r[n]] && t[r[n]].includes(e[r[n]]))
|
|
502
502
|
return !0;
|
|
503
503
|
return !1;
|
|
504
504
|
}, Y = (e, t) => Array.isArray(e) ? e.reduce(
|
|
505
|
-
(r, n) => (
|
|
505
|
+
(r, n) => (ft(n, t) ? r.priority.push(n) : r.default.push(n), r),
|
|
506
506
|
{ priority: [], default: [] }
|
|
507
507
|
) : { default: e, priority: [] }, ie = (e, t) => ({
|
|
508
508
|
...e,
|
|
509
509
|
[t]: void 0
|
|
510
|
-
}),
|
|
510
|
+
}), dt = [
|
|
511
511
|
"noscript",
|
|
512
512
|
"script",
|
|
513
513
|
"style"
|
|
514
514
|
/* STYLE */
|
|
515
|
-
], Z = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"),
|
|
515
|
+
], Z = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), Te = (e) => Object.keys(e).reduce((t, r) => {
|
|
516
516
|
const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
|
|
517
517
|
return t ? `${t} ${n}` : n;
|
|
518
|
-
}, ""),
|
|
519
|
-
const s =
|
|
518
|
+
}, ""), mt = (e, t, r, n) => {
|
|
519
|
+
const s = Te(r), o = ge(t);
|
|
520
520
|
return s ? `<${e} ${x}="true" ${s}>${Z(
|
|
521
521
|
o,
|
|
522
522
|
n
|
|
@@ -524,22 +524,22 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
524
524
|
o,
|
|
525
525
|
n
|
|
526
526
|
)}</${e}>`;
|
|
527
|
-
},
|
|
528
|
-
const o = s,
|
|
529
|
-
(
|
|
530
|
-
).reduce((
|
|
527
|
+
}, pt = (e, t, r = !0) => t.reduce((n, s) => {
|
|
528
|
+
const o = s, l = Object.keys(o).filter(
|
|
529
|
+
(i) => !(i === "innerHTML" || i === "cssText")
|
|
530
|
+
).reduce((i, u) => {
|
|
531
531
|
const d = typeof o[u] > "u" ? u : `${u}="${Z(o[u], r)}"`;
|
|
532
|
-
return
|
|
533
|
-
}, ""), a = o.innerHTML || o.cssText || "",
|
|
534
|
-
return `${n}<${e} ${x}="true" ${
|
|
535
|
-
}, ""),
|
|
532
|
+
return i ? `${i} ${d}` : d;
|
|
533
|
+
}, ""), a = o.innerHTML || o.cssText || "", c = dt.indexOf(e) === -1;
|
|
534
|
+
return `${n}<${e} ${x}="true" ${l}${c ? "/>" : `>${a}</${e}>`}`;
|
|
535
|
+
}, ""), ve = (e, t = {}) => Object.keys(e).reduce((r, n) => {
|
|
536
536
|
const s = re[n];
|
|
537
537
|
return r[s || n] = e[n], r;
|
|
538
|
-
}, t),
|
|
538
|
+
}, t), ht = (e, t, r) => {
|
|
539
539
|
const n = {
|
|
540
540
|
key: t,
|
|
541
541
|
[x]: !0
|
|
542
|
-
}, s =
|
|
542
|
+
}, s = ve(r, n);
|
|
543
543
|
return [E.createElement("title", s, t)];
|
|
544
544
|
}, q = (e, t) => t.map((r, n) => {
|
|
545
545
|
const s = {
|
|
@@ -549,8 +549,8 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
549
549
|
return Object.keys(r).forEach((o) => {
|
|
550
550
|
const a = re[o] || o;
|
|
551
551
|
if (a === "innerHTML" || a === "cssText") {
|
|
552
|
-
const
|
|
553
|
-
s.dangerouslySetInnerHTML = { __html:
|
|
552
|
+
const c = r.innerHTML || r.cssText;
|
|
553
|
+
s.dangerouslySetInnerHTML = { __html: c };
|
|
554
554
|
} else
|
|
555
555
|
s[a] = r[o];
|
|
556
556
|
}), E.createElement(e, s);
|
|
@@ -558,29 +558,29 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
558
558
|
switch (e) {
|
|
559
559
|
case "title":
|
|
560
560
|
return {
|
|
561
|
-
toComponent: () =>
|
|
562
|
-
toString: () =>
|
|
561
|
+
toComponent: () => ht(e, t.title, t.titleAttributes),
|
|
562
|
+
toString: () => mt(e, t.title, t.titleAttributes, r)
|
|
563
563
|
};
|
|
564
564
|
case "bodyAttributes":
|
|
565
565
|
case "htmlAttributes":
|
|
566
566
|
return {
|
|
567
|
-
toComponent: () =>
|
|
568
|
-
toString: () =>
|
|
567
|
+
toComponent: () => ve(t),
|
|
568
|
+
toString: () => Te(t)
|
|
569
569
|
};
|
|
570
570
|
default:
|
|
571
571
|
return {
|
|
572
572
|
toComponent: () => q(e, t),
|
|
573
|
-
toString: () =>
|
|
573
|
+
toString: () => pt(e, t, r)
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
|
-
},
|
|
577
|
-
const s = Y(e, V.meta), o = Y(t, V.link),
|
|
576
|
+
}, yt = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
|
|
577
|
+
const s = Y(e, V.meta), o = Y(t, V.link), l = Y(r, V.script);
|
|
578
578
|
return {
|
|
579
579
|
priorityMethods: {
|
|
580
580
|
toComponent: () => [
|
|
581
581
|
...q("meta", s.priority),
|
|
582
582
|
...q("link", o.priority),
|
|
583
|
-
...q("script",
|
|
583
|
+
...q("script", l.priority)
|
|
584
584
|
],
|
|
585
585
|
toString: () => (
|
|
586
586
|
// generate all the tags as strings and concatenate them
|
|
@@ -588,31 +588,31 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
588
588
|
"link",
|
|
589
589
|
o.priority,
|
|
590
590
|
n
|
|
591
|
-
)} ${T("script",
|
|
591
|
+
)} ${T("script", l.priority, n)}`
|
|
592
592
|
)
|
|
593
593
|
},
|
|
594
594
|
metaTags: s.default,
|
|
595
595
|
linkTags: o.default,
|
|
596
|
-
scriptTags:
|
|
596
|
+
scriptTags: l.default
|
|
597
597
|
};
|
|
598
|
-
},
|
|
598
|
+
}, gt = (e) => {
|
|
599
599
|
const {
|
|
600
600
|
baseTag: t,
|
|
601
601
|
bodyAttributes: r,
|
|
602
602
|
encode: n = !0,
|
|
603
603
|
htmlAttributes: s,
|
|
604
604
|
noscriptTags: o,
|
|
605
|
-
styleTags:
|
|
605
|
+
styleTags: l,
|
|
606
606
|
title: a = "",
|
|
607
|
-
titleAttributes:
|
|
608
|
-
prioritizeSeoTags:
|
|
607
|
+
titleAttributes: c,
|
|
608
|
+
prioritizeSeoTags: i
|
|
609
609
|
} = e;
|
|
610
610
|
let { linkTags: u, metaTags: d, scriptTags: h } = e, m = {
|
|
611
611
|
toComponent: () => {
|
|
612
612
|
},
|
|
613
613
|
toString: () => ""
|
|
614
614
|
};
|
|
615
|
-
return
|
|
615
|
+
return i && ({ priorityMethods: m, linkTags: u, metaTags: d, scriptTags: h } = yt(e)), {
|
|
616
616
|
priority: m,
|
|
617
617
|
base: T("base", t, n),
|
|
618
618
|
bodyAttributes: T("bodyAttributes", r, n),
|
|
@@ -621,13 +621,13 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
621
621
|
meta: T("meta", d, n),
|
|
622
622
|
noscript: T("noscript", o, n),
|
|
623
623
|
script: T("script", h, n),
|
|
624
|
-
style: T("style",
|
|
625
|
-
title: T("title", { title: a, titleAttributes:
|
|
624
|
+
style: T("style", l, n),
|
|
625
|
+
title: T("title", { title: a, titleAttributes: c }, n)
|
|
626
626
|
};
|
|
627
|
-
}, Q =
|
|
627
|
+
}, Q = gt, U = [], xe = !!(typeof window < "u" && window.document && window.document.createElement), X = class {
|
|
628
628
|
constructor(e, t) {
|
|
629
629
|
A(this, "instances", []);
|
|
630
|
-
A(this, "canUseDOM",
|
|
630
|
+
A(this, "canUseDOM", xe);
|
|
631
631
|
A(this, "context");
|
|
632
632
|
A(this, "value", {
|
|
633
633
|
setHelmet: (e) => {
|
|
@@ -658,37 +658,37 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
658
658
|
titleAttributes: {}
|
|
659
659
|
}));
|
|
660
660
|
}
|
|
661
|
-
},
|
|
661
|
+
}, Tt = {}, Ce = E.createContext(Tt), j, be = (j = class extends te {
|
|
662
662
|
constructor(r) {
|
|
663
663
|
super(r);
|
|
664
664
|
A(this, "helmetData");
|
|
665
665
|
this.helmetData = new X(this.props.context || {}, j.canUseDOM);
|
|
666
666
|
}
|
|
667
667
|
render() {
|
|
668
|
-
return /* @__PURE__ */ E.createElement(
|
|
668
|
+
return /* @__PURE__ */ E.createElement(Ce.Provider, { value: this.helmetData.value }, this.props.children);
|
|
669
669
|
}
|
|
670
|
-
}, A(j, "canUseDOM",
|
|
670
|
+
}, A(j, "canUseDOM", xe), j), k = (e, t) => {
|
|
671
671
|
const r = document.head || document.querySelector(
|
|
672
672
|
"head"
|
|
673
673
|
/* HEAD */
|
|
674
674
|
), n = r.querySelectorAll(`${e}[${x}]`), s = [].slice.call(n), o = [];
|
|
675
|
-
let
|
|
675
|
+
let l;
|
|
676
676
|
return t && t.length && t.forEach((a) => {
|
|
677
|
-
const
|
|
678
|
-
for (const
|
|
679
|
-
if (Object.prototype.hasOwnProperty.call(a,
|
|
680
|
-
if (
|
|
681
|
-
|
|
682
|
-
else if (
|
|
683
|
-
|
|
677
|
+
const c = document.createElement(e);
|
|
678
|
+
for (const i in a)
|
|
679
|
+
if (Object.prototype.hasOwnProperty.call(a, i))
|
|
680
|
+
if (i === "innerHTML")
|
|
681
|
+
c.innerHTML = a.innerHTML;
|
|
682
|
+
else if (i === "cssText")
|
|
683
|
+
c.styleSheet ? c.styleSheet.cssText = a.cssText : c.appendChild(document.createTextNode(a.cssText));
|
|
684
684
|
else {
|
|
685
|
-
const u =
|
|
686
|
-
|
|
685
|
+
const u = i, d = typeof a[u] > "u" ? "" : a[u];
|
|
686
|
+
c.setAttribute(i, d);
|
|
687
687
|
}
|
|
688
|
-
|
|
688
|
+
c.setAttribute(x, "true"), s.some((i, u) => (l = u, c.isEqualNode(i))) ? s.splice(l, 1) : o.push(c);
|
|
689
689
|
}), s.forEach((a) => {
|
|
690
|
-
var
|
|
691
|
-
return (
|
|
690
|
+
var c;
|
|
691
|
+
return (c = a.parentNode) == null ? void 0 : c.removeChild(a);
|
|
692
692
|
}), o.forEach((a) => r.appendChild(a)), {
|
|
693
693
|
oldTags: s,
|
|
694
694
|
newTags: o
|
|
@@ -697,58 +697,58 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
697
697
|
const r = document.getElementsByTagName(e)[0];
|
|
698
698
|
if (!r)
|
|
699
699
|
return;
|
|
700
|
-
const n = r.getAttribute(x), s = n ? n.split(",") : [], o = [...s],
|
|
701
|
-
for (const a of
|
|
702
|
-
const
|
|
703
|
-
r.getAttribute(a) !==
|
|
704
|
-
const
|
|
705
|
-
|
|
700
|
+
const n = r.getAttribute(x), s = n ? n.split(",") : [], o = [...s], l = Object.keys(t);
|
|
701
|
+
for (const a of l) {
|
|
702
|
+
const c = t[a] || "";
|
|
703
|
+
r.getAttribute(a) !== c && r.setAttribute(a, c), s.indexOf(a) === -1 && s.push(a);
|
|
704
|
+
const i = o.indexOf(a);
|
|
705
|
+
i !== -1 && o.splice(i, 1);
|
|
706
706
|
}
|
|
707
707
|
for (let a = o.length - 1; a >= 0; a -= 1)
|
|
708
708
|
r.removeAttribute(o[a]);
|
|
709
|
-
s.length === o.length ? r.removeAttribute(x) : r.getAttribute(x) !==
|
|
710
|
-
},
|
|
711
|
-
typeof e < "u" && document.title !== e && (document.title =
|
|
709
|
+
s.length === o.length ? r.removeAttribute(x) : r.getAttribute(x) !== l.join(",") && r.setAttribute(x, l.join(","));
|
|
710
|
+
}, vt = (e, t) => {
|
|
711
|
+
typeof e < "u" && document.title !== e && (document.title = ge(e)), ee("title", t);
|
|
712
712
|
}, le = (e, t) => {
|
|
713
713
|
const {
|
|
714
714
|
baseTag: r,
|
|
715
715
|
bodyAttributes: n,
|
|
716
716
|
htmlAttributes: s,
|
|
717
717
|
linkTags: o,
|
|
718
|
-
metaTags:
|
|
718
|
+
metaTags: l,
|
|
719
719
|
noscriptTags: a,
|
|
720
|
-
onChangeClientState:
|
|
721
|
-
scriptTags:
|
|
720
|
+
onChangeClientState: c,
|
|
721
|
+
scriptTags: i,
|
|
722
722
|
styleTags: u,
|
|
723
723
|
title: d,
|
|
724
724
|
titleAttributes: h
|
|
725
725
|
} = e;
|
|
726
|
-
ee("body", n), ee("html", s),
|
|
726
|
+
ee("body", n), ee("html", s), vt(d, h);
|
|
727
727
|
const m = {
|
|
728
728
|
baseTag: k("base", r),
|
|
729
729
|
linkTags: k("link", o),
|
|
730
|
-
metaTags: k("meta",
|
|
730
|
+
metaTags: k("meta", l),
|
|
731
731
|
noscriptTags: k("noscript", a),
|
|
732
|
-
scriptTags: k("script",
|
|
732
|
+
scriptTags: k("script", i),
|
|
733
733
|
styleTags: k("style", u)
|
|
734
|
-
}, g = {},
|
|
734
|
+
}, g = {}, _ = {};
|
|
735
735
|
Object.keys(m).forEach((w) => {
|
|
736
736
|
const { newTags: O, oldTags: I } = m[w];
|
|
737
|
-
O.length && (g[w] = O), I.length && (
|
|
738
|
-
}), t && t(),
|
|
739
|
-
}, R = null,
|
|
737
|
+
O.length && (g[w] = O), I.length && (_[w] = m[w].oldTags);
|
|
738
|
+
}), t && t(), c(e, g, _);
|
|
739
|
+
}, R = null, xt = (e) => {
|
|
740
740
|
R && cancelAnimationFrame(R), e.defer ? R = requestAnimationFrame(() => {
|
|
741
741
|
le(e, () => {
|
|
742
742
|
R = null;
|
|
743
743
|
});
|
|
744
744
|
}) : (le(e), R = null);
|
|
745
|
-
},
|
|
745
|
+
}, Ct = xt, ce = class extends te {
|
|
746
746
|
constructor() {
|
|
747
747
|
super(...arguments);
|
|
748
748
|
A(this, "rendered", !1);
|
|
749
749
|
}
|
|
750
750
|
shouldComponentUpdate(t) {
|
|
751
|
-
return !
|
|
751
|
+
return !nt(t, this.props);
|
|
752
752
|
}
|
|
753
753
|
componentDidUpdate() {
|
|
754
754
|
this.emitChange();
|
|
@@ -760,13 +760,13 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
760
760
|
emitChange() {
|
|
761
761
|
const { helmetInstances: t, setHelmet: r } = this.props.context;
|
|
762
762
|
let n = null;
|
|
763
|
-
const s =
|
|
763
|
+
const s = ut(
|
|
764
764
|
t.get().map((o) => {
|
|
765
|
-
const
|
|
766
|
-
return delete
|
|
765
|
+
const l = { ...o.props };
|
|
766
|
+
return delete l.context, l;
|
|
767
767
|
})
|
|
768
768
|
);
|
|
769
|
-
|
|
769
|
+
be.canUseDOM ? Ct(s) : Q && (n = Q(s)), r(n);
|
|
770
770
|
}
|
|
771
771
|
// componentWillMount will be deprecated
|
|
772
772
|
// for SSR, initialize on first render
|
|
@@ -781,9 +781,9 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
781
781
|
render() {
|
|
782
782
|
return this.init(), null;
|
|
783
783
|
}
|
|
784
|
-
}, J,
|
|
784
|
+
}, J, bt = (J = class extends te {
|
|
785
785
|
shouldComponentUpdate(e) {
|
|
786
|
-
return !
|
|
786
|
+
return !tt(ie(this.props, "helmetData"), ie(e, "helmetData"));
|
|
787
787
|
}
|
|
788
788
|
mapNestedChildrenToProps(e, t) {
|
|
789
789
|
if (!t)
|
|
@@ -866,7 +866,7 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
866
866
|
return E.Children.forEach(e, (n) => {
|
|
867
867
|
if (!n || !n.props)
|
|
868
868
|
return;
|
|
869
|
-
const { children: s, ...o } = n.props,
|
|
869
|
+
const { children: s, ...o } = n.props, l = Object.keys(o).reduce((c, i) => (c[st[i] || i] = o[i], c), {});
|
|
870
870
|
let { type: a } = n;
|
|
871
871
|
switch (typeof a == "symbol" ? a = a.toString() : this.warnOnInvalidChildren(n, s), a) {
|
|
872
872
|
case "Symbol(react.fragment)":
|
|
@@ -880,12 +880,12 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
880
880
|
r = this.flattenArrayTypeChildren(
|
|
881
881
|
n,
|
|
882
882
|
r,
|
|
883
|
-
|
|
883
|
+
l,
|
|
884
884
|
s
|
|
885
885
|
);
|
|
886
886
|
break;
|
|
887
887
|
default:
|
|
888
|
-
t = this.mapObjectTypeChildren(n, t,
|
|
888
|
+
t = this.mapObjectTypeChildren(n, t, l, s);
|
|
889
889
|
break;
|
|
890
890
|
}
|
|
891
891
|
}), this.mapArrayTypeChildrenToProps(r, t);
|
|
@@ -897,25 +897,27 @@ var he = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "he
|
|
|
897
897
|
const s = n;
|
|
898
898
|
n = new X(s.context, !0), delete r.helmetData;
|
|
899
899
|
}
|
|
900
|
-
return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(
|
|
900
|
+
return n ? /* @__PURE__ */ E.createElement(ce, { ...r, context: n.value }) : /* @__PURE__ */ E.createElement(Ce.Consumer, null, (s) => /* @__PURE__ */ E.createElement(ce, { ...r, context: s }));
|
|
901
901
|
}
|
|
902
902
|
}, A(J, "defaultProps", {
|
|
903
903
|
defer: !0,
|
|
904
904
|
encodeSpecialCharacters: !0,
|
|
905
905
|
prioritizeSeoTags: !1
|
|
906
906
|
}), J);
|
|
907
|
-
const
|
|
908
|
-
const [
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}, [
|
|
913
|
-
|
|
914
|
-
|
|
907
|
+
const ue = (e, t) => e ? `${e} | ${t}` : t, Nt = ({ defaultHelmet: e, children: t, helmetPrefix: r }) => {
|
|
908
|
+
const [n, s] = C([
|
|
909
|
+
ue(r ?? "", e)
|
|
910
|
+
]), o = p((i) => {
|
|
911
|
+
s((u) => [...u, ue(r ?? "", i)]);
|
|
912
|
+
}, [r]), l = p(() => {
|
|
913
|
+
s((i) => i.length > 1 ? i.slice(0, -1) : i);
|
|
914
|
+
}, [s]), a = b(() => n.at(-1) ?? "", [n]), c = b(() => ({ addHelmet: o, removeHelmet: l }), [o, l]);
|
|
915
|
+
return /* @__PURE__ */ f.jsx(Me.Provider, { value: c, children: /* @__PURE__ */ f.jsxs(be, { children: [
|
|
916
|
+
/* @__PURE__ */ f.jsx(bt, { defer: !1, children: /* @__PURE__ */ f.jsx("title", { children: a }) }),
|
|
915
917
|
t
|
|
916
918
|
] }) });
|
|
917
|
-
},
|
|
918
|
-
const { texts: { confirm: e } } =
|
|
919
|
+
}, At = () => {
|
|
920
|
+
const { texts: { confirm: e } } = $(z), { onConfirm: t, onCancel: r, text: n, show: s } = Re();
|
|
919
921
|
return /* @__PURE__ */ f.jsxs(S, { show: s, size: "sm", centered: !0, onHide: r, children: [
|
|
920
922
|
/* @__PURE__ */ f.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ f.jsx(S.Title, { children: n }) }),
|
|
921
923
|
/* @__PURE__ */ f.jsx(S.Body, { children: /* @__PURE__ */ f.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
@@ -925,16 +927,16 @@ const Ut = ({ defaultHelmet: e, children: t }) => {
|
|
|
925
927
|
] });
|
|
926
928
|
};
|
|
927
929
|
export {
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
930
|
+
de as AuthContext,
|
|
931
|
+
Rt as AuthProvider,
|
|
932
|
+
me as DelegationContext,
|
|
933
|
+
Ut as DelegationProvider,
|
|
934
|
+
Me as HelmetContext,
|
|
935
|
+
Nt as HelmetProvider,
|
|
934
936
|
Pe as LoadingContext,
|
|
935
937
|
_t as LoadingProvider,
|
|
936
938
|
z as LuminusComponentsContext,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
939
|
+
$t as LuminusComponentsProvider,
|
|
940
|
+
He as UserContext,
|
|
941
|
+
Mt as UserProvider
|
|
940
942
|
};
|