react-luminus-components 1.0.0
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/README.md +3 -0
- package/dist/.vite/manifest.json +133 -0
- package/dist/Modal-JLnYbEat.js +1 -0
- package/dist/Modal-_FnSEPRk.mjs +623 -0
- package/dist/SimpleTooltip-BjlbHsKC.mjs +1767 -0
- package/dist/SimpleTooltip-D9shMl1R.js +1 -0
- package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +7 -0
- package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +9 -0
- package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +7 -0
- package/dist/components/EmployeePicker/comps/index.d.ts +1 -0
- package/dist/components/EmployeePicker/index.d.ts +2 -0
- package/dist/components/Form/CheckInput/CheckInput.d.ts +11 -0
- package/dist/components/Form/Container/InputContainer.d.ts +8 -0
- package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +12 -0
- package/dist/components/Form/SelectInput/SelectInput.d.ts +17 -0
- package/dist/components/Form/TextInput/TextInput.d.ts +16 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +9 -0
- package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +9 -0
- package/dist/components/HookForm/FloatingSubmit/FloatingFormSubmit.d.ts +6 -0
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +9 -0
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +9 -0
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +9 -0
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +9 -0
- package/dist/components/HookForm/index.d.ts +7 -0
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +10 -0
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +8 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +8 -0
- package/dist/components/UserAvatar/UserAvatarDropdown/UserAvatarDropdown.d.ts +7 -0
- package/dist/components/UserAvatar/UserAvatarToggle/UserAvatarToggle.d.ts +8 -0
- package/dist/components/UserAvatar/index.d.ts +2 -0
- package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
- package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +3 -0
- package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +9 -0
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +6 -0
- package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
- package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +6 -0
- package/dist/components/common/Loading/Loading.d.ts +3 -0
- package/dist/components/common/MonthPicker/MonthPicker.d.ts +9 -0
- package/dist/components/common/Typography/Typography.d.ts +9 -0
- package/dist/components/common/index.d.ts +6 -0
- package/dist/constants-CT2hnPeO.js +1 -0
- package/dist/constants-CzNy5yO3.mjs +7 -0
- package/dist/contexts/confirm/ConfirmContext.d.ts +9 -0
- package/dist/contexts/confirm/ConfirmProvider.d.ts +6 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/loading/LoadingContext.d.ts +8 -0
- package/dist/contexts/loading/LoadingProvider.d.ts +6 -0
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +15 -0
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +16 -0
- package/dist/contexts/user/UserContext.d.ts +9 -0
- package/dist/contexts/user/UserProvider.d.ts +6 -0
- package/dist/contexts.cjs.js +1 -0
- package/dist/contexts.d.ts +1 -0
- package/dist/contexts.es.js +86 -0
- package/dist/hasClass-3JW9Qluf.mjs +1482 -0
- package/dist/hasClass-6m1Qq_DA.js +20 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useAuth/useAuth.d.ts +7 -0
- package/dist/hooks/useAxios/useAxios.d.ts +3 -0
- package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
- package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +44 -0
- package/dist/hooks.cjs.js +1 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.es.js +2781 -0
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
- package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
- package/dist/layout/SideContentBar/SideContentBar.d.ts +7 -0
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +10 -0
- package/dist/layout/SideMenu/SideMenu.d.ts +10 -0
- package/dist/layout/TopBar/TopBar.d.ts +7 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout.cjs.js +1 -0
- package/dist/layout.d.ts +1 -0
- package/dist/layout.es.js +164 -0
- package/dist/main.cjs.js +1 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.es.js +2788 -0
- package/dist/models/index.d.ts +23 -0
- package/dist/models/prop-types/ContainerProps.d.ts +6 -0
- package/dist/models/prop-types/HookFormCheckInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormEmployeePickerProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormRadioInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormSelectInputProps.d.ts +12 -0
- package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormTextInputProps.d.ts +11 -0
- package/dist/models/texts/AxiosTexts.d.ts +6 -0
- package/dist/models/texts/ConfirmTexts.d.ts +5 -0
- package/dist/models/texts/EmployeeSearchModalTexts.d.ts +6 -0
- package/dist/models/texts/FormValidationTexts.d.ts +5 -0
- package/dist/models/texts/HomeDashboardTexts.d.ts +5 -0
- package/dist/models/types/ApiErrorResult.d.ts +7 -0
- package/dist/models/types/DashboardConfig.d.ts +5 -0
- package/dist/models/types/DashboardWidget.d.ts +7 -0
- package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
- package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
- package/dist/models/types/ErrorField.d.ts +5 -0
- package/dist/models/types/FormSelectOption.d.ts +5 -0
- package/dist/models/types/HookFormInputProps.d.ts +9 -0
- package/dist/models/types/MenuItemType.d.ts +9 -0
- package/dist/models/types/NameIdIntModel.d.ts +5 -0
- package/dist/models/types/NameIdStringModel.d.ts +5 -0
- package/dist/models/types/UserModel.d.ts +13 -0
- package/dist/style.css +1 -0
- package/dist/textUtils-9KFqOvA8.mjs +27 -0
- package/dist/textUtils-C0nqWp3S.js +1 -0
- package/dist/useAxios-BU-BqYrK.mjs +2663 -0
- package/dist/useAxios-ZEhq7C_H.js +212 -0
- package/dist/useConfirm-BazFQNRI.js +1 -0
- package/dist/useConfirm-DH9Pmz_w.mjs +18 -0
- package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +4 -0
- package/dist/utils/date/dateUtils.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/object/objectUtils.d.ts +2 -0
- package/dist/utils/text/textUtils.d.ts +1 -0
- package/dist/utils.cjs.js +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.es.js +137 -0
- package/package.json +94 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";const j=require("react"),Wt=require("./textUtils-C0nqWp3S.js");function Xr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const N=Xr(j);function Vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}},ne={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Pt;function Zr(){if(Pt)return ne;Pt=1;var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,l,h){var p,f={},E=null,x=null;h!==void 0&&(E=""+h),l.key!==void 0&&(E=""+l.key),l.ref!==void 0&&(x=l.ref);for(p in l)n.call(l,p)&&!o.hasOwnProperty(p)&&(f[p]=l[p]);if(c&&c.defaultProps)for(p in l=c.defaultProps,l)f[p]===void 0&&(f[p]=l[p]);return{$$typeof:t,type:c,key:E,ref:x,props:f,_owner:s.current}}return ne.Fragment=r,ne.jsx=a,ne.jsxs=a,ne}var oe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var kt;function Qr(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&function(){var e=j,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),y=Symbol.iterator,b="@@iterator";function k(i){if(i===null||typeof i!="object")return null;var d=y&&i[y]||i[b];return typeof d=="function"?d:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(i){{for(var d=arguments.length,m=new Array(d>1?d-1:0),g=1;g<d;g++)m[g-1]=arguments[g];U("error",i,m)}}function U(i,d,m){{var g=T.ReactDebugCurrentFrame,R=g.getStackAddendum();R!==""&&(d+="%s",m=m.concat([R]));var O=m.map(function(v){return String(v)});O.unshift("Warning: "+d),Function.prototype.apply.call(console[i],console,O)}}var ke=!1,wr=!1,vr=!1,_r=!1,Rr=!1,it;it=Symbol.for("react.module.reference");function xr(i){return!!(typeof i=="string"||typeof i=="function"||i===n||i===o||Rr||i===s||i===h||i===p||_r||i===x||ke||wr||vr||typeof i=="object"&&i!==null&&(i.$$typeof===E||i.$$typeof===f||i.$$typeof===a||i.$$typeof===c||i.$$typeof===l||i.$$typeof===it||i.getModuleId!==void 0))}function Or(i,d,m){var g=i.displayName;if(g)return g;var R=d.displayName||d.name||"";return R!==""?m+"("+R+")":m}function at(i){return i.displayName||"Context"}function M(i){if(i==null)return null;if(typeof i.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case s:return"StrictMode";case h:return"Suspense";case p:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case c:var d=i;return at(d)+".Consumer";case a:var m=i;return at(m._context)+".Provider";case l:return Or(i,i.render,"ForwardRef");case f:var g=i.displayName||null;return g!==null?g:M(i.type)||"Memo";case E:{var R=i,O=R._payload,v=R._init;try{return M(v(O))}catch{return null}}}return null}var G=Object.assign,te=0,ct,lt,ut,ft,dt,pt,ht;function mt(){}mt.__reactDisabledLog=!0;function Sr(){{if(te===0){ct=console.log,lt=console.info,ut=console.warn,ft=console.error,dt=console.group,pt=console.groupCollapsed,ht=console.groupEnd;var i={configurable:!0,enumerable:!0,value:mt,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}te++}}function Tr(){{if(te--,te===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},i,{value:ct}),info:G({},i,{value:lt}),warn:G({},i,{value:ut}),error:G({},i,{value:ft}),group:G({},i,{value:dt}),groupCollapsed:G({},i,{value:pt}),groupEnd:G({},i,{value:ht})})}te<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var je=T.ReactCurrentDispatcher,Ne;function ue(i,d,m){{if(Ne===void 0)try{throw Error()}catch(R){var g=R.stack.trim().match(/\n( *(at )?)/);Ne=g&&g[1]||""}return`
|
|
18
|
+
`+Ne+i}}var Fe=!1,fe;{var Cr=typeof WeakMap=="function"?WeakMap:Map;fe=new Cr}function yt(i,d){if(!i||Fe)return"";{var m=fe.get(i);if(m!==void 0)return m}var g;Fe=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var O;O=je.current,je.current=null,Sr();try{if(d){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(q){g=q}Reflect.construct(i,[],v)}else{try{v.call()}catch(q){g=q}i.call(v.prototype)}}else{try{throw Error()}catch(q){g=q}i()}}catch(q){if(q&&g&&typeof q.stack=="string"){for(var w=q.stack.split(`
|
|
19
|
+
`),F=g.stack.split(`
|
|
20
|
+
`),A=w.length-1,P=F.length-1;A>=1&&P>=0&&w[A]!==F[P];)P--;for(;A>=1&&P>=0;A--,P--)if(w[A]!==F[P]){if(A!==1||P!==1)do if(A--,P--,P<0||w[A]!==F[P]){var L=`
|
|
21
|
+
`+w[A].replace(" at new "," at ");return i.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",i.displayName)),typeof i=="function"&&fe.set(i,L),L}while(A>=1&&P>=0);break}}}finally{Fe=!1,je.current=O,Tr(),Error.prepareStackTrace=R}var Z=i?i.displayName||i.name:"",At=Z?ue(Z):"";return typeof i=="function"&&fe.set(i,At),At}function Ar(i,d,m){return yt(i,!1)}function Pr(i){var d=i.prototype;return!!(d&&d.isReactComponent)}function de(i,d,m){if(i==null)return"";if(typeof i=="function")return yt(i,Pr(i));if(typeof i=="string")return ue(i);switch(i){case h:return ue("Suspense");case p:return ue("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case l:return Ar(i.render);case f:return de(i.type,d,m);case E:{var g=i,R=g._payload,O=g._init;try{return de(O(R),d,m)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,bt={},gt=T.ReactDebugCurrentFrame;function he(i){if(i){var d=i._owner,m=de(i.type,i._source,d?d.type:null);gt.setExtraStackFrame(m)}else gt.setExtraStackFrame(null)}function kr(i,d,m,g,R){{var O=Function.call.bind(pe);for(var v in i)if(O(i,v)){var w=void 0;try{if(typeof i[v]!="function"){var F=Error((g||"React class")+": "+m+" type `"+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[v]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}w=i[v](d,v,g,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){w=A}w&&!(w instanceof Error)&&(he(R),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",g||"React class",m,v,typeof w),he(null)),w instanceof Error&&!(w.message in bt)&&(bt[w.message]=!0,he(R),S("Failed %s type: %s",m,w.message),he(null))}}}var jr=Array.isArray;function De(i){return jr(i)}function Nr(i){{var d=typeof Symbol=="function"&&Symbol.toStringTag,m=d&&i[Symbol.toStringTag]||i.constructor.name||"Object";return m}}function Fr(i){try{return Et(i),!1}catch{return!0}}function Et(i){return""+i}function wt(i){if(Fr(i))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Nr(i)),Et(i)}var re=T.ReactCurrentOwner,Dr={key:!0,ref:!0,__self:!0,__source:!0},vt,_t,Le;Le={};function Lr(i){if(pe.call(i,"ref")){var d=Object.getOwnPropertyDescriptor(i,"ref").get;if(d&&d.isReactWarning)return!1}return i.ref!==void 0}function Ir(i){if(pe.call(i,"key")){var d=Object.getOwnPropertyDescriptor(i,"key").get;if(d&&d.isReactWarning)return!1}return i.key!==void 0}function Ur(i,d){if(typeof i.ref=="string"&&re.current&&d&&re.current.stateNode!==d){var m=M(re.current.type);Le[m]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(re.current.type),i.ref),Le[m]=!0)}}function Br(i,d){{var m=function(){vt||(vt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};m.isReactWarning=!0,Object.defineProperty(i,"key",{get:m,configurable:!0})}}function $r(i,d){{var m=function(){_t||(_t=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};m.isReactWarning=!0,Object.defineProperty(i,"ref",{get:m,configurable:!0})}}var Mr=function(i,d,m,g,R,O,v){var w={$$typeof:t,type:i,key:d,ref:m,props:v,_owner:O};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function qr(i,d,m,g,R){{var O,v={},w=null,F=null;m!==void 0&&(wt(m),w=""+m),Ir(d)&&(wt(d.key),w=""+d.key),Lr(d)&&(F=d.ref,Ur(d,R));for(O in d)pe.call(d,O)&&!Dr.hasOwnProperty(O)&&(v[O]=d[O]);if(i&&i.defaultProps){var A=i.defaultProps;for(O in A)v[O]===void 0&&(v[O]=A[O])}if(w||F){var P=typeof i=="function"?i.displayName||i.name||"Unknown":i;w&&Br(v,P),F&&$r(v,P)}return Mr(i,w,F,R,g,re.current,v)}}var Ie=T.ReactCurrentOwner,Rt=T.ReactDebugCurrentFrame;function X(i){if(i){var d=i._owner,m=de(i.type,i._source,d?d.type:null);Rt.setExtraStackFrame(m)}else Rt.setExtraStackFrame(null)}var Ue;Ue=!1;function Be(i){return typeof i=="object"&&i!==null&&i.$$typeof===t}function xt(){{if(Ie.current){var i=M(Ie.current.type);if(i)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+i+"`."}return""}}function Hr(i){{if(i!==void 0){var d=i.fileName.replace(/^.*[\\\/]/,""),m=i.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+d+":"+m+"."}return""}}var Ot={};function zr(i){{var d=xt();if(!d){var m=typeof i=="string"?i:i.displayName||i.name;m&&(d=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+m+">.")}return d}}function St(i,d){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var m=zr(d);if(Ot[m])return;Ot[m]=!0;var g="";i&&i._owner&&i._owner!==Ie.current&&(g=" It was passed a child from "+M(i._owner.type)+"."),X(i),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,g),X(null)}}function Tt(i,d){{if(typeof i!="object")return;if(De(i))for(var m=0;m<i.length;m++){var g=i[m];Be(g)&&St(g,d)}else if(Be(i))i._store&&(i._store.validated=!0);else if(i){var R=k(i);if(typeof R=="function"&&R!==i.entries)for(var O=R.call(i),v;!(v=O.next()).done;)Be(v.value)&&St(v.value,d)}}}function Wr(i){{var d=i.type;if(d==null||typeof d=="string")return;var m;if(typeof d=="function")m=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===l||d.$$typeof===f))m=d.propTypes;else return;if(m){var g=M(d);kr(m,i.props,"prop",g,i)}else if(d.PropTypes!==void 0&&!Ue){Ue=!0;var R=M(d);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vr(i){{for(var d=Object.keys(i.props),m=0;m<d.length;m++){var g=d[m];if(g!=="children"&&g!=="key"){X(i),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",g),X(null);break}}i.ref!==null&&(X(i),S("Invalid attribute `ref` supplied to `React.Fragment`."),X(null))}}function Ct(i,d,m,g,R,O){{var v=xr(i);if(!v){var w="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(w+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var F=Hr(R);F?w+=F:w+=xt();var A;i===null?A="null":De(i)?A="array":i!==void 0&&i.$$typeof===t?(A="<"+(M(i.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof i,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var P=qr(i,d,m,R,O);if(P==null)return P;if(v){var L=d.children;if(L!==void 0)if(g)if(De(L)){for(var Z=0;Z<L.length;Z++)Tt(L[Z],i);Object.freeze&&Object.freeze(L)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Tt(L,i)}return i===n?Vr(P):Wr(P),P}}function Jr(i,d,m){return Ct(i,d,m,!0)}function Yr(i,d,m){return Ct(i,d,m,!1)}var Gr=Yr,Kr=Jr;oe.Fragment=n,oe.jsx=Gr,oe.jsxs=Kr}()),oe}process.env.NODE_ENV==="production"?ze.exports=Zr():ze.exports=Qr();var en=ze.exports,Jt={exports:{}};/*!
|
|
28
|
+
Copyright (c) 2018 Jed Watson.
|
|
29
|
+
Licensed under the MIT License (MIT), see
|
|
30
|
+
http://jedwatson.github.io/classnames
|
|
31
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(o=s(o,n(c)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var c in o)t.call(o,c)&&o[c]&&(a=s(a,c));return a}function s(o,a){return a?o?o+" "+a:o+a:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Jt);var tn=Jt.exports;const rn=Vt(tn),nn="_loading_14qfh_1",on="_spinner-grow_14qfh_10",sn="_second_14qfh_14",an="_third_14qfh_17",cn={loading:nn,"spinner-grow":"_spinner-grow_14qfh_10",spinnerGrow:on,second:sn,third:an},ln="_h1_8gr7h_1",un="_h3_8gr7h_8",fn="_h6_8gr7h_15",dn="_subtitle_8gr7h_22",pn="_body_8gr7h_29",hn="_body2_8gr7h_36",mn="_caption_8gr7h_43",yn={h1:ln,h3:un,h6:fn,subtitle:dn,body:pn,body2:hn,caption:mn},bn="_widget_1sdw8_1",gn={widget:bn},En="_dashboard_1ikl9_1",wn="_widgets-grid_1ikl9_1",vn="_widget-wrapper_1ikl9_7",_n="_full-width_1ikl9_12",Rn="_widget-edit_1ikl9_15",xn="_remove-icon_1ikl9_18",On="_full-width-icon_1ikl9_25",Sn="_widget-edit-overlay_1ikl9_35",Tn={dashboard:En,"widgets-grid":"_widgets-grid_1ikl9_1",widgetsGrid:wn,"widget-wrapper":"_widget-wrapper_1ikl9_7",widgetWrapper:vn,"full-width":"_full-width_1ikl9_12",fullWidth:_n,"widget-edit":"_widget-edit_1ikl9_15",widgetEdit:Rn,"remove-icon":"_remove-icon_1ikl9_18",removeIcon:xn,"full-width-icon":"_full-width-icon_1ikl9_25",fullWidthIcon:On,"widget-edit-overlay":"_widget-edit-overlay_1ikl9_35",widgetEditOverlay:Sn},Qe=j.createContext({axiosInstance:{},LinkComponent:{},language:"",axiosTexts:{},confirmTexts:{},formValidationTexts:{},employeePickerModalTexts:{}});let Cn={data:""},An=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||Cn,Pn=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,kn=/\/\*[^]*?\*\/| +/g,jt=/\n+/g,J=(e,t)=>{let r="",n="",s="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+a+";":n+=o[1]=="f"?J(a,o):o+"{"+J(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=J(a,t?t.replace(/([^,])+/g,c=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=J.p?J.p(o,a):o+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},H={},Yt=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Yt(e[r]);return t}return e},jn=(e,t,r,n,s)=>{let o=Yt(e),a=H[o]||(H[o]=(l=>{let h=0,p=11;for(;h<l.length;)p=101*p+l.charCodeAt(h++)>>>0;return"go"+p})(o));if(!H[a]){let l=o!==e?e:(h=>{let p,f,E=[{}];for(;p=Pn.exec(h.replace(kn,""));)p[4]?E.shift():p[3]?(f=p[3].replace(jt," ").trim(),E.unshift(E[0][f]=E[0][f]||{})):E[0][p[1]]=p[2].replace(jt," ").trim();return E[0]})(e);H[a]=J(s?{["@keyframes "+a]:l}:l,r?"":"."+a)}let c=r&&H.g?H.g:null;return r&&(H.g=H[a]),((l,h,p,f)=>{f?h.data=h.data.replace(f,l):h.data.indexOf(l)===-1&&(h.data=p?l+h.data:h.data+l)})(H[a],t,n,c),a},Nn=(e,t,r)=>e.reduce((n,s,o)=>{let a=t[o];if(a&&a.call){let c=a(r),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;a=l?"."+l:c&&typeof c=="object"?c.props?"":J(c,""):c===!1?"":c}return n+s+(a??"")},"");function Oe(e){let t=this||{},r=e.call?e(t.p):e;return jn(r.unshift?r.raw?Nn(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,An(t.target),t.g,t.o,t.k)}let Gt,We,Ve;Oe.bind({g:1});let W=Oe.bind({k:1});function Fn(e,t,r,n){J.p=t,Gt=e,We=r,Ve=n}function Y(e,t){let r=this||{};return function(){let n=arguments;function s(o,a){let c=Object.assign({},o),l=c.className||s.className;r.p=Object.assign({theme:We&&We()},c),r.o=/ *go\d+/.test(l),c.className=Oe.apply(r,n)+(l?" "+l:""),t&&(c.ref=a);let h=e;return e[0]&&(h=c.as||e,delete c.as),Ve&&h[0]&&Ve(c),Gt(h,c)}return t?t(s):s}}var Dn=e=>typeof e=="function",Re=(e,t)=>Dn(e)?e(t):e,Ln=(()=>{let e=0;return()=>(++e).toString()})(),Kt=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),In=20,be=new Map,Un=1e3,Nt=e=>{if(be.has(e))return;let t=setTimeout(()=>{be.delete(e),K({type:4,toastId:e})},Un);be.set(e,t)},Bn=e=>{let t=be.get(e);t&&clearTimeout(t)},Je=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,In)};case 1:return t.toast.id&&Bn(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return e.toasts.find(o=>o.id===r.id)?Je(e,{type:1,toast:r}):Je(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?Nt(n):e.toasts.forEach(o=>{Nt(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===n||n===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+s}))}}},ge=[],Ee={toasts:[],pausedAt:void 0},K=e=>{Ee=Je(Ee,e),ge.forEach(t=>{t(Ee)})},$n={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Mn=(e={})=>{let[t,r]=j.useState(Ee);j.useEffect(()=>(ge.push(r),()=>{let s=ge.indexOf(r);s>-1&&ge.splice(s,1)}),[t]);let n=t.toasts.map(s=>{var o,a;return{...e,...e[s.type],...s,duration:s.duration||((o=e[s.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||$n[s.type],style:{...e.style,...(a=e[s.type])==null?void 0:a.style,...s.style}}});return{...t,toasts:n}},qn=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||Ln()}),ae=e=>(t,r)=>{let n=qn(t,e,r);return K({type:2,toast:n}),n.id},D=(e,t)=>ae("blank")(e,t);D.error=ae("error");D.success=ae("success");D.loading=ae("loading");D.custom=ae("custom");D.dismiss=e=>{K({type:3,toastId:e})};D.remove=e=>K({type:4,toastId:e});D.promise=(e,t,r)=>{let n=D.loading(t.loading,{...r,...r==null?void 0:r.loading});return e.then(s=>(D.success(Re(t.success,s),{id:n,...r,...r==null?void 0:r.success}),s)).catch(s=>{D.error(Re(t.error,s),{id:n,...r,...r==null?void 0:r.error})}),e};var Hn=(e,t)=>{K({type:1,toast:{id:e,height:t}})},zn=()=>{K({type:5,time:Date.now()})},Wn=e=>{let{toasts:t,pausedAt:r}=Mn(e);j.useEffect(()=>{if(r)return;let o=Date.now(),a=t.map(c=>{if(c.duration===1/0)return;let l=(c.duration||0)+c.pauseDuration-(o-c.createdAt);if(l<0){c.visible&&D.dismiss(c.id);return}return setTimeout(()=>D.dismiss(c.id),l)});return()=>{a.forEach(c=>c&&clearTimeout(c))}},[t,r]);let n=j.useCallback(()=>{r&&K({type:6,time:Date.now()})},[r]),s=j.useCallback((o,a)=>{let{reverseOrder:c=!1,gutter:l=8,defaultPosition:h}=a||{},p=t.filter(x=>(x.position||h)===(o.position||h)&&x.height),f=p.findIndex(x=>x.id===o.id),E=p.filter((x,y)=>y<f&&x.visible).length;return p.filter(x=>x.visible).slice(...c?[E+1]:[0,E]).reduce((x,y)=>x+(y.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:Hn,startPause:zn,endPause:n,calculateOffset:s}}},Vn=W`
|
|
32
|
+
from {
|
|
33
|
+
transform: scale(0) rotate(45deg);
|
|
34
|
+
opacity: 0;
|
|
35
|
+
}
|
|
36
|
+
to {
|
|
37
|
+
transform: scale(1) rotate(45deg);
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}`,Jn=W`
|
|
40
|
+
from {
|
|
41
|
+
transform: scale(0);
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
to {
|
|
45
|
+
transform: scale(1);
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}`,Yn=W`
|
|
48
|
+
from {
|
|
49
|
+
transform: scale(0) rotate(90deg);
|
|
50
|
+
opacity: 0;
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
transform: scale(1) rotate(90deg);
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}`,Gn=Y("div")`
|
|
56
|
+
width: 20px;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
height: 20px;
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
61
|
+
position: relative;
|
|
62
|
+
transform: rotate(45deg);
|
|
63
|
+
|
|
64
|
+
animation: ${Vn} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
65
|
+
forwards;
|
|
66
|
+
animation-delay: 100ms;
|
|
67
|
+
|
|
68
|
+
&:after,
|
|
69
|
+
&:before {
|
|
70
|
+
content: '';
|
|
71
|
+
animation: ${Jn} 0.15s ease-out forwards;
|
|
72
|
+
animation-delay: 150ms;
|
|
73
|
+
position: absolute;
|
|
74
|
+
border-radius: 3px;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
background: ${e=>e.secondary||"#fff"};
|
|
77
|
+
bottom: 9px;
|
|
78
|
+
left: 4px;
|
|
79
|
+
height: 2px;
|
|
80
|
+
width: 12px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&:before {
|
|
84
|
+
animation: ${Yn} 0.15s ease-out forwards;
|
|
85
|
+
animation-delay: 180ms;
|
|
86
|
+
transform: rotate(90deg);
|
|
87
|
+
}
|
|
88
|
+
`,Kn=W`
|
|
89
|
+
from {
|
|
90
|
+
transform: rotate(0deg);
|
|
91
|
+
}
|
|
92
|
+
to {
|
|
93
|
+
transform: rotate(360deg);
|
|
94
|
+
}
|
|
95
|
+
`,Xn=Y("div")`
|
|
96
|
+
width: 12px;
|
|
97
|
+
height: 12px;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
border: 2px solid;
|
|
100
|
+
border-radius: 100%;
|
|
101
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
102
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
103
|
+
animation: ${Kn} 1s linear infinite;
|
|
104
|
+
`,Zn=W`
|
|
105
|
+
from {
|
|
106
|
+
transform: scale(0) rotate(45deg);
|
|
107
|
+
opacity: 0;
|
|
108
|
+
}
|
|
109
|
+
to {
|
|
110
|
+
transform: scale(1) rotate(45deg);
|
|
111
|
+
opacity: 1;
|
|
112
|
+
}`,Qn=W`
|
|
113
|
+
0% {
|
|
114
|
+
height: 0;
|
|
115
|
+
width: 0;
|
|
116
|
+
opacity: 0;
|
|
117
|
+
}
|
|
118
|
+
40% {
|
|
119
|
+
height: 0;
|
|
120
|
+
width: 6px;
|
|
121
|
+
opacity: 1;
|
|
122
|
+
}
|
|
123
|
+
100% {
|
|
124
|
+
opacity: 1;
|
|
125
|
+
height: 10px;
|
|
126
|
+
}`,eo=Y("div")`
|
|
127
|
+
width: 20px;
|
|
128
|
+
opacity: 0;
|
|
129
|
+
height: 20px;
|
|
130
|
+
border-radius: 10px;
|
|
131
|
+
background: ${e=>e.primary||"#61d345"};
|
|
132
|
+
position: relative;
|
|
133
|
+
transform: rotate(45deg);
|
|
134
|
+
|
|
135
|
+
animation: ${Zn} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
136
|
+
forwards;
|
|
137
|
+
animation-delay: 100ms;
|
|
138
|
+
&:after {
|
|
139
|
+
content: '';
|
|
140
|
+
box-sizing: border-box;
|
|
141
|
+
animation: ${Qn} 0.2s ease-out forwards;
|
|
142
|
+
opacity: 0;
|
|
143
|
+
animation-delay: 200ms;
|
|
144
|
+
position: absolute;
|
|
145
|
+
border-right: 2px solid;
|
|
146
|
+
border-bottom: 2px solid;
|
|
147
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
148
|
+
bottom: 6px;
|
|
149
|
+
left: 6px;
|
|
150
|
+
height: 10px;
|
|
151
|
+
width: 6px;
|
|
152
|
+
}
|
|
153
|
+
`,to=Y("div")`
|
|
154
|
+
position: absolute;
|
|
155
|
+
`,ro=Y("div")`
|
|
156
|
+
position: relative;
|
|
157
|
+
display: flex;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
align-items: center;
|
|
160
|
+
min-width: 20px;
|
|
161
|
+
min-height: 20px;
|
|
162
|
+
`,no=W`
|
|
163
|
+
from {
|
|
164
|
+
transform: scale(0.6);
|
|
165
|
+
opacity: 0.4;
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
transform: scale(1);
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}`,oo=Y("div")`
|
|
171
|
+
position: relative;
|
|
172
|
+
transform: scale(0.6);
|
|
173
|
+
opacity: 0.4;
|
|
174
|
+
min-width: 20px;
|
|
175
|
+
animation: ${no} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
176
|
+
forwards;
|
|
177
|
+
`,so=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?N.createElement(oo,null,t):t:r==="blank"?null:N.createElement(ro,null,N.createElement(Xn,{...n}),r!=="loading"&&N.createElement(to,null,r==="error"?N.createElement(Gn,{...n}):N.createElement(eo,{...n})))},io=e=>`
|
|
178
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
179
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
180
|
+
`,ao=e=>`
|
|
181
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
182
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
183
|
+
`,co="0%{opacity:0;} 100%{opacity:1;}",lo="0%{opacity:1;} 100%{opacity:0;}",uo=Y("div")`
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
background: #fff;
|
|
187
|
+
color: #363636;
|
|
188
|
+
line-height: 1.3;
|
|
189
|
+
will-change: transform;
|
|
190
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
191
|
+
max-width: 350px;
|
|
192
|
+
pointer-events: auto;
|
|
193
|
+
padding: 8px 10px;
|
|
194
|
+
border-radius: 8px;
|
|
195
|
+
`,fo=Y("div")`
|
|
196
|
+
display: flex;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
margin: 4px 10px;
|
|
199
|
+
color: inherit;
|
|
200
|
+
flex: 1 1 auto;
|
|
201
|
+
white-space: pre-line;
|
|
202
|
+
`,po=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=Kt()?[co,lo]:[io(r),ao(r)];return{animation:t?`${W(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${W(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},ho=N.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?po(e.position||t||"top-center",e.visible):{opacity:0},o=N.createElement(so,{toast:e}),a=N.createElement(fo,{...e.ariaProps},Re(e.message,e));return N.createElement(uo,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:o,message:a}):N.createElement(N.Fragment,null,o,a))});Fn(N.createElement);var mo=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let o=N.useCallback(a=>{if(a){let c=()=>{let l=a.getBoundingClientRect().height;n(e,l)};c(),new MutationObserver(c).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return N.createElement("div",{ref:o,className:t,style:r},s)},yo=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Kt()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},bo=Oe`
|
|
203
|
+
z-index: 9999;
|
|
204
|
+
> * {
|
|
205
|
+
pointer-events: auto;
|
|
206
|
+
}
|
|
207
|
+
`,me=16,go=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,containerStyle:o,containerClassName:a})=>{let{toasts:c,handlers:l}=Wn(r);return N.createElement("div",{style:{position:"fixed",zIndex:9999,top:me,left:me,right:me,bottom:me,pointerEvents:"none",...o},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map(h=>{let p=h.position||t,f=l.calculateOffset(h,{reverseOrder:e,gutter:n,defaultPosition:t}),E=yo(p,f);return N.createElement(mo,{id:h.id,key:h.id,onHeightUpdate:l.updateHeight,className:h.visible?bo:"",style:E},h.type==="custom"?Re(h.message,h):s?s(h):N.createElement(ho,{toast:h,position:p}))}))},ye=D;const Eo=j.createContext({show:!1,text:"",showConfirm:e=>{},hideConfirm:()=>{}}),wo=j.createContext({isLoading:!1,startLoading:e=>{},stopLoading:e=>{}}),vo=j.createContext({user:null,loginUser:()=>Promise.resolve(!0),logoutUser:()=>{}}),Xt=()=>{const{axiosInstance:e}=j.useContext(Qe),t=j.useCallback(()=>localStorage.getItem("token")??null,[]),r=j.useCallback(()=>{const o=t();return o!==null&&o.length>0},[t]),n=j.useCallback(async(o,a)=>{let c=!1;return await e.post("/user/login",{kid:o,password:a}).then(l=>{localStorage.setItem("token",l.data),c=!0}).catch(l=>{console.log(l),c=!1}),c},[e]),s=j.useCallback(()=>{localStorage.removeItem("token"),localStorage.removeItem("user")},[]);return{isAuthenticated:r,getToken:t,authenticate:n,logout:s}},_o=e=>{switch(e){case"success":return 5e3;case"warning":return 7e3;case"danger":return 1e4;default:return 5e3}},Zt=()=>({addNotification:(t,r)=>{const n=Wt.truncateText(t),s=_o(r);switch(r){case"success":{ye.success(n,{duration:s,position:"bottom-center",className:"toast-success"});break}case"danger":{ye.error(n,{duration:s,position:"top-center",className:"toast-danger"});break}case"warning":{ye.error(n,{duration:s,position:"top-center",className:"toast-warning"});break}default:{ye(n,{duration:s,position:"top-center",className:"toast-default"});break}}}});function Qt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ro}=Object.prototype,{getPrototypeOf:et}=Object,Se=(e=>t=>{const r=Ro.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$=e=>(e=e.toLowerCase(),t=>Se(t)===e),Te=e=>t=>typeof t===e,{isArray:ee}=Array,ie=Te("undefined");function xo(e){return e!==null&&!ie(e)&&e.constructor!==null&&!ie(e.constructor)&&I(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const er=$("ArrayBuffer");function Oo(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&er(e.buffer),t}const So=Te("string"),I=Te("function"),tr=Te("number"),Ce=e=>e!==null&&typeof e=="object",To=e=>e===!0||e===!1,we=e=>{if(Se(e)!=="object")return!1;const t=et(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Co=$("Date"),Ao=$("File"),Po=$("Blob"),ko=$("FileList"),jo=e=>Ce(e)&&I(e.pipe),No=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||I(e.append)&&((t=Se(e))==="formdata"||t==="object"&&I(e.toString)&&e.toString()==="[object FormData]"))},Fo=$("URLSearchParams"),Do=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),ee(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(n=0;n<a;n++)c=o[n],t.call(null,e[c],c,e)}}function rr(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,or=e=>!ie(e)&&e!==nr;function Ye(){const{caseless:e}=or(this)&&this||{},t={},r=(n,s)=>{const o=e&&rr(t,s)||s;we(t[o])&&we(n)?t[o]=Ye(t[o],n):we(n)?t[o]=Ye({},n):ee(n)?t[o]=n.slice():t[o]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&ce(arguments[n],r);return t}const Lo=(e,t,r,{allOwnKeys:n}={})=>(ce(t,(s,o)=>{r&&I(s)?e[o]=Qt(s,r):e[o]=s},{allOwnKeys:n}),e),Io=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Uo=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},Bo=(e,t,r,n)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=r!==!1&&et(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},$o=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Mo=e=>{if(!e)return null;if(ee(e))return e;let t=e.length;if(!tr(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},qo=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&et(Uint8Array)),Ho=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},zo=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Wo=$("HTMLFormElement"),Vo=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Ft=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Jo=$("RegExp"),sr=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ce(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},Yo=e=>{sr(e,(t,r)=>{if(I(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(I(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Go=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return ee(e)?n(e):n(String(e).split(t)),r},Ko=()=>{},Xo=(e,t)=>(e=+e,Number.isFinite(e)?e:t),$e="abcdefghijklmnopqrstuvwxyz",Dt="0123456789",ir={DIGIT:Dt,ALPHA:$e,ALPHA_DIGIT:$e+$e.toUpperCase()+Dt},Zo=(e=16,t=ir.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Qo(e){return!!(e&&I(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const es=e=>{const t=new Array(10),r=(n,s)=>{if(Ce(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const o=ee(n)?[]:{};return ce(n,(a,c)=>{const l=r(a,s+1);!ie(l)&&(o[c]=l)}),t[s]=void 0,o}}return n};return r(e,0)},ts=$("AsyncFunction"),rs=e=>e&&(Ce(e)||I(e))&&I(e.then)&&I(e.catch),u={isArray:ee,isArrayBuffer:er,isBuffer:xo,isFormData:No,isArrayBufferView:Oo,isString:So,isNumber:tr,isBoolean:To,isObject:Ce,isPlainObject:we,isUndefined:ie,isDate:Co,isFile:Ao,isBlob:Po,isRegExp:Jo,isFunction:I,isStream:jo,isURLSearchParams:Fo,isTypedArray:qo,isFileList:ko,forEach:ce,merge:Ye,extend:Lo,trim:Do,stripBOM:Io,inherits:Uo,toFlatObject:Bo,kindOf:Se,kindOfTest:$,endsWith:$o,toArray:Mo,forEachEntry:Ho,matchAll:zo,isHTMLForm:Wo,hasOwnProperty:Ft,hasOwnProp:Ft,reduceDescriptors:sr,freezeMethods:Yo,toObjectSet:Go,toCamelCase:Vo,noop:Ko,toFiniteNumber:Xo,findKey:rr,global:nr,isContextDefined:or,ALPHABET:ir,generateString:Zo,isSpecCompliantForm:Qo,toJSONObject:es,isAsyncFn:ts,isThenable:rs};function _(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s)}u.inherits(_,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ar=_.prototype,cr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{cr[e]={value:e}});Object.defineProperties(_,cr);Object.defineProperty(ar,"isAxiosError",{value:!0});_.from=(e,t,r,n,s,o)=>{const a=Object.create(ar);return u.toFlatObject(e,a,function(l){return l!==Error.prototype},c=>c!=="isAxiosError"),_.call(a,e.message,t,r,n,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const ns=null;function Ge(e){return u.isPlainObject(e)||u.isArray(e)}function lr(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function Lt(e,t,r){return e?e.concat(t).map(function(s,o){return s=lr(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function os(e){return u.isArray(e)&&!e.some(Ge)}const ss=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function Ae(e,t,r){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,k){return!u.isUndefined(k[b])});const n=r.metaTokens,s=r.visitor||p,o=r.dots,a=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(t);if(!u.isFunction(s))throw new TypeError("visitor must be a function");function h(y){if(y===null)return"";if(u.isDate(y))return y.toISOString();if(!l&&u.isBlob(y))throw new _("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(y)||u.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,b,k){let T=y;if(y&&!k&&typeof y=="object"){if(u.endsWith(b,"{}"))b=n?b:b.slice(0,-2),y=JSON.stringify(y);else if(u.isArray(y)&&os(y)||(u.isFileList(y)||u.endsWith(b,"[]"))&&(T=u.toArray(y)))return b=lr(b),T.forEach(function(U,ke){!(u.isUndefined(U)||U===null)&&t.append(a===!0?Lt([b],ke,o):a===null?b:b+"[]",h(U))}),!1}return Ge(y)?!0:(t.append(Lt(k,b,o),h(y)),!1)}const f=[],E=Object.assign(ss,{defaultVisitor:p,convertValue:h,isVisitable:Ge});function x(y,b){if(!u.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));f.push(y),u.forEach(y,function(T,S){(!(u.isUndefined(T)||T===null)&&s.call(t,T,u.isString(S)?S.trim():S,b,E))===!0&&x(T,b?b.concat(S):[S])}),f.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return x(e),t}function It(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function tt(e,t){this._pairs=[],e&&Ae(e,this,t)}const ur=tt.prototype;ur.append=function(t,r){this._pairs.push([t,r])};ur.toString=function(t){const r=t?function(n){return t.call(this,n,It)}:It;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function is(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fr(e,t,r){if(!t)return e;const n=r&&r.encode||is,s=r&&r.serialize;let o;if(s?o=s(t,r):o=u.isURLSearchParams(t)?t.toString():new tt(t,r).toString(n),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ut{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},as=typeof URLSearchParams<"u"?URLSearchParams:tt,cs=typeof FormData<"u"?FormData:null,ls=typeof Blob<"u"?Blob:null,us={isBrowser:!0,classes:{URLSearchParams:as,FormData:cs,Blob:ls},protocols:["http","https","file","blob","url","data"]},pr=typeof window<"u"&&typeof document<"u",fs=(e=>pr&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),ds=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ps=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pr,hasStandardBrowserEnv:fs,hasStandardBrowserWebWorkerEnv:ds},Symbol.toStringTag,{value:"Module"})),B={...ps,...us};function hs(e,t){return Ae(e,new B.classes.URLSearchParams,Object.assign({visitor:function(r,n,s,o){return B.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function ms(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ys(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function hr(e){function t(r,n,s,o){let a=r[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),l=o>=r.length;return a=!a&&u.isArray(s)?s.length:a,l?(u.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!c):((!s[a]||!u.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&u.isArray(s[a])&&(s[a]=ys(s[a])),!c)}if(u.isFormData(e)&&u.isFunction(e.entries)){const r={};return u.forEachEntry(e,(n,s)=>{t(ms(n),s,r,0)}),r}return null}function bs(e,t,r){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const rt={transitional:dr,adapter:["xhr","http"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=u.isObject(t);if(o&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(hr(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return hs(t,this.formSerializer).toString();if((c=u.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ae(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),bs(t)):t}],transformResponse:[function(t){const r=this.transitional||rt.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(t&&u.isString(t)&&(n&&!this.responseType||s)){const a=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?_.from(c,_.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],e=>{rt.headers[e]={}});const nt=rt,gs=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Es=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
208
|
+
`).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&gs[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Bt=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ve(e){return e===!1||e==null?e:u.isArray(e)?e.map(ve):String(e)}function ws(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const vs=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Me(e,t,r,n,s){if(u.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!u.isString(t)){if(u.isString(n))return t.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(t)}}function _s(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Rs(e,t){const r=u.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}class Pe{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,l,h){const p=se(l);if(!p)throw new Error("header name must be a non-empty string");const f=u.findKey(s,p);(!f||s[f]===void 0||h===!0||h===void 0&&s[f]!==!1)&&(s[f||l]=ve(c))}const a=(c,l)=>u.forEach(c,(h,p)=>o(h,p,l));return u.isPlainObject(t)||t instanceof this.constructor?a(t,r):u.isString(t)&&(t=t.trim())&&!vs(t)?a(Es(t),r):t!=null&&o(r,t,n),this}get(t,r){if(t=se(t),t){const n=u.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return ws(s);if(u.isFunction(r))return r.call(this,s,n);if(u.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=se(t),t){const n=u.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Me(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=se(a),a){const c=u.findKey(n,a);c&&(!r||Me(n,n[c],c,r))&&(delete n[c],s=!0)}}return u.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||Me(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return u.forEach(this,(s,o)=>{const a=u.findKey(n,o);if(a){r[a]=ve(s),delete r[o];return}const c=t?_s(o):String(o).trim();c!==o&&delete r[o],r[c]=ve(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return u.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
209
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Bt]=this[Bt]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=se(a);n[c]||(Rs(s,a),n[c]=!0)}return u.isArray(t)?t.forEach(o):o(t),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(Pe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});u.freezeMethods(Pe);const z=Pe;function qe(e,t){const r=this||nt,n=t||r,s=z.from(n.headers);let o=n.data;return u.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function mr(e){return!!(e&&e.__CANCEL__)}function le(e,t,r){_.call(this,e??"canceled",_.ERR_CANCELED,t,r),this.name="CanceledError"}u.inherits(le,_,{__CANCEL__:!0});function xs(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new _("Request failed with status code "+r.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const Os=B.hasStandardBrowserEnv?{write(e,t,r,n,s,o){const a=[e+"="+encodeURIComponent(t)];u.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),u.isString(n)&&a.push("path="+n),u.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ss(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ts(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function yr(e,t){return e&&!Ss(t)?Ts(e,t):t}const Cs=B.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function s(o){let a=o;return t&&(r.setAttribute("href",a),a=r.href),r.setAttribute("href",a),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(a){const c=u.isString(a)?s(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}();function As(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ps(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const h=Date.now(),p=n[o];a||(a=h),r[s]=l,n[s]=h;let f=o,E=0;for(;f!==s;)E+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),h-a<t)return;const x=p&&h-p;return x?Math.round(E*1e3/x):void 0}}function $t(e,t){let r=0;const n=Ps(50,250);return s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-r,l=n(c),h=o<=a;r=o;const p={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&h?(a-o)/l:void 0,event:s};p[t?"download":"upload"]=!0,e(p)}}const ks=typeof XMLHttpRequest<"u",js=ks&&function(e){return new Promise(function(r,n){let s=e.data;const o=z.from(e.headers).normalize();let{responseType:a,withXSRFToken:c}=e,l;function h(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let p;if(u.isFormData(s)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((p=o.getContentType())!==!1){const[b,...k]=p?p.split(";").map(T=>T.trim()).filter(Boolean):[];o.setContentType([b||"multipart/form-data",...k].join("; "))}}let f=new XMLHttpRequest;if(e.auth){const b=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(b+":"+k))}const E=yr(e.baseURL,e.url);f.open(e.method.toUpperCase(),fr(E,e.params,e.paramsSerializer),!0),f.timeout=e.timeout;function x(){if(!f)return;const b=z.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),T={data:!a||a==="text"||a==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:b,config:e,request:f};xs(function(U){r(U),h()},function(U){n(U),h()},T),f=null}if("onloadend"in f?f.onloadend=x:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(x)},f.onabort=function(){f&&(n(new _("Request aborted",_.ECONNABORTED,e,f)),f=null)},f.onerror=function(){n(new _("Network Error",_.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const T=e.transitional||dr;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),n(new _(k,T.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,f)),f=null},B.hasStandardBrowserEnv&&(c&&u.isFunction(c)&&(c=c(e)),c||c!==!1&&Cs(E))){const b=e.xsrfHeaderName&&e.xsrfCookieName&&Os.read(e.xsrfCookieName);b&&o.set(e.xsrfHeaderName,b)}s===void 0&&o.setContentType(null),"setRequestHeader"in f&&u.forEach(o.toJSON(),function(k,T){f.setRequestHeader(T,k)}),u.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),a&&a!=="json"&&(f.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&f.addEventListener("progress",$t(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",$t(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=b=>{f&&(n(!b||b.type?new le(null,e,f):b),f.abort(),f=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const y=As(E);if(y&&B.protocols.indexOf(y)===-1){n(new _("Unsupported protocol "+y+":",_.ERR_BAD_REQUEST,e));return}f.send(s||null)})},Ke={http:ns,xhr:js};u.forEach(Ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Mt=e=>`- ${e}`,Ns=e=>u.isFunction(e)||e===null||e===!1,br={getAdapter:e=>{e=u.isArray(e)?e:[e];const{length:t}=e;let r,n;const s={};for(let o=0;o<t;o++){r=e[o];let a;if(n=r,!Ns(r)&&(n=Ke[(a=String(r)).toLowerCase()],n===void 0))throw new _(`Unknown adapter '${a}'`);if(n)break;s[a||"#"+o]=n}if(!n){const o=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
|
|
210
|
+
`+o.map(Mt).join(`
|
|
211
|
+
`):" "+Mt(o[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Ke};function He(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new le(null,e)}function qt(e){return He(e),e.headers=z.from(e.headers),e.data=qe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),br.getAdapter(e.adapter||nt.adapter)(e).then(function(n){return He(e),n.data=qe.call(e,e.transformResponse,n),n.headers=z.from(n.headers),n},function(n){return mr(n)||(He(e),n&&n.response&&(n.response.data=qe.call(e,e.transformResponse,n.response),n.response.headers=z.from(n.response.headers))),Promise.reject(n)})}const Ht=e=>e instanceof z?{...e}:e;function Q(e,t){t=t||{};const r={};function n(h,p,f){return u.isPlainObject(h)&&u.isPlainObject(p)?u.merge.call({caseless:f},h,p):u.isPlainObject(p)?u.merge({},p):u.isArray(p)?p.slice():p}function s(h,p,f){if(u.isUndefined(p)){if(!u.isUndefined(h))return n(void 0,h,f)}else return n(h,p,f)}function o(h,p){if(!u.isUndefined(p))return n(void 0,p)}function a(h,p){if(u.isUndefined(p)){if(!u.isUndefined(h))return n(void 0,h)}else return n(void 0,p)}function c(h,p,f){if(f in t)return n(h,p);if(f in e)return n(void 0,h)}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(h,p)=>s(Ht(h),Ht(p),!0)};return u.forEach(Object.keys(Object.assign({},e,t)),function(p){const f=l[p]||s,E=f(e[p],t[p],p);u.isUndefined(E)&&f!==c||(r[p]=E)}),r}const gr="1.6.8",ot={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ot[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const zt={};ot.transitional=function(t,r,n){function s(o,a){return"[Axios v"+gr+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,c)=>{if(t===!1)throw new _(s(a," has been removed"+(r?" in "+r:"")),_.ERR_DEPRECATED);return r&&!zt[a]&&(zt[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Fs(e,t,r){if(typeof e!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=t[o];if(a){const c=e[o],l=c===void 0||a(c,o,e);if(l!==!0)throw new _("option "+o+" must be "+l,_.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new _("Unknown option "+o,_.ERR_BAD_OPTION)}}const Xe={assertOptions:Fs,validators:ot},V=Xe.validators;class xe{constructor(t){this.defaults=t,this.interceptors={request:new Ut,response:new Ut}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
212
|
+
`+o):n.stack=o}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Q(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Xe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),s!=null&&(u.isFunction(s)?r.paramsSerializer={serialize:s}:Xe.assertOptions(s,{encode:V.function,serialize:V.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&u.merge(o.common,o[r.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),r.headers=z.concat(a,o);const c=[];let l=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(l=l&&b.synchronous,c.unshift(b.fulfilled,b.rejected))});const h=[];this.interceptors.response.forEach(function(b){h.push(b.fulfilled,b.rejected)});let p,f=0,E;if(!l){const y=[qt.bind(this),void 0];for(y.unshift.apply(y,c),y.push.apply(y,h),E=y.length,p=Promise.resolve(r);f<E;)p=p.then(y[f++],y[f++]);return p}E=c.length;let x=r;for(f=0;f<E;){const y=c[f++],b=c[f++];try{x=y(x)}catch(k){b.call(this,k);break}}try{p=qt.call(this,x)}catch(y){return Promise.reject(y)}for(f=0,E=h.length;f<E;)p=p.then(h[f++],h[f++]);return p}getUri(t){t=Q(this.defaults,t);const r=yr(t.baseURL,t.url);return fr(r,t.params,t.paramsSerializer)}}u.forEach(["delete","get","head","options"],function(t){xe.prototype[t]=function(r,n){return this.request(Q(n||{},{method:t,url:r,data:(n||{}).data}))}});u.forEach(["post","put","patch"],function(t){function r(n){return function(o,a,c){return this.request(Q(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}xe.prototype[t]=r(),xe.prototype[t+"Form"]=r(!0)});const _e=xe;class st{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{n.subscribe(c),o=c}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,c){n.reason||(n.reason=new le(o,a,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new st(function(s){t=s}),cancel:t}}}const Ds=st;function Ls(e){return function(r){return e.apply(null,r)}}function Is(e){return u.isObject(e)&&e.isAxiosError===!0}const Ze={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ze).forEach(([e,t])=>{Ze[t]=e});const Us=Ze;function Er(e){const t=new _e(e),r=Qt(_e.prototype.request,t);return u.extend(r,_e.prototype,t,{allOwnKeys:!0}),u.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Er(Q(e,s))},r}const C=Er(nt);C.Axios=_e;C.CanceledError=le;C.CancelToken=Ds;C.isCancel=mr;C.VERSION=gr;C.toFormData=Ae;C.AxiosError=_;C.Cancel=C.CanceledError;C.all=function(t){return Promise.all(t)};C.spread=Ls;C.isAxiosError=Is;C.mergeConfig=Q;C.AxiosHeaders=z;C.formToJSON=e=>hr(u.isHTMLForm(e)?new FormData(e):e);C.getAdapter=br.getAdapter;C.HttpStatusCode=Us;C.default=C;const Bs=C.CancelToken,$s=(e=!0)=>{const{axiosInstance:t,language:r,axiosTexts:n}=j.useContext(Qe),{addNotification:s}=Zt(),{getToken:o}=Xt();return j.useEffect(()=>{t.interceptors.request.clear(),t.interceptors.response.clear();const a=t.interceptors.request.use(l=>{var h,p,f;return e&&!l.headers.Authorization&&(l.headers.Authorization=`Bearer ${o()}`),(h=l.url)!=null&&h.includes("culture=")?l.url=(p=l.url)==null?void 0:p.replace(/culture=[a-z]{2}/,`culture=${r}`):l.url=`${l.url}${(f=l.url)!=null&&f.includes("?")?"&":"?"}culture=${r}`,l},l=>Promise.reject(l)),c=t.interceptors.response.use(l=>l,l=>{if(C.isCancel(l))return Promise.reject(l);const h=Wt.extractErrorsFromResponse(l);if(h.length>0){const p=h.find(f=>f.name.toLowerCase()==="others");return p?(s(p.errors,"danger"),Promise.reject(l)):(s(n.validationError,"warning"),Promise.reject(l))}return l.message&&l.message==="Network Error"?(s(n.networkError,"danger"),Promise.reject(l)):(C.isCancel(l)||s(n.unexpectedError,"danger"),Promise.reject(l))});return()=>{t.interceptors.request.eject(a),t.interceptors.response.eject(c)}},[t,s,r,o,e,n]),t};exports.ConfirmContext=Eo;exports.Ie=go;exports.LoadingContext=wo;exports.LuminusComponentsContext=Qe;exports.UserContext=vo;exports.cancelToken=Bs;exports.classNames=rn;exports.classes=cn;exports.classes$1=yn;exports.classes$2=gn;exports.classes$3=Tn;exports.getDefaultExportFromCjs=Vt;exports.jsxRuntimeExports=en;exports.useAuth=Xt;exports.useAxios=$s;exports.useNotifications=Zt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const C=require("./useAxios-ZEhq7C_H.js"),f=require("react");let n;const m=()=>{const{show:e,text:r,showConfirm:s,hideConfirm:t}=f.useContext(C.ConfirmContext),o=()=>{t()};return{confirm:async c=>(s(c),new Promise(i=>{n=i})),onConfirm:()=>{o(),n(!0)},onCancel:()=>{o(),n(!1)},show:e,text:r}};exports.useConfirm=m;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { C as i } from "./useAxios-BU-BqYrK.mjs";
|
|
2
|
+
import { useContext as C } from "react";
|
|
3
|
+
let o;
|
|
4
|
+
const h = () => {
|
|
5
|
+
const { show: r, text: e, showConfirm: t, hideConfirm: s } = C(i), n = () => {
|
|
6
|
+
s();
|
|
7
|
+
};
|
|
8
|
+
return { confirm: async (m) => (t(m), new Promise((c) => {
|
|
9
|
+
o = c;
|
|
10
|
+
})), onConfirm: () => {
|
|
11
|
+
n(), o(!0);
|
|
12
|
+
}, onCancel: () => {
|
|
13
|
+
n(), o(!1);
|
|
14
|
+
}, show: r, text: e };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
h as u
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isISODate: (dateString: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const truncateText: (str: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./textUtils-C0nqWp3S.js"),m=require("./constants-CT2hnPeO.js");function g(t,e){const r=(e==null?void 0:e.additionalDigits)??2,n=x(t);let i;if(n.date){const s=U(n.date,r);i=h(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const a=i.getTime();let o=0,c;if(n.time&&(o=w(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(c=S(n.timezone),isNaN(c))return new Date(NaN)}else{const s=new Date(a+o),u=new Date(0);return u.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),u.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),u}return new Date(a+o+c)}const d={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},p=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,T=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,I=/^([+-])(\d{2})(?::?(\d{2}))?$/;function x(t){const e={},r=t.split(d.dateTimeDelimiter);let n;if(r.length>2)return e;if(/:/.test(r[0])?n=r[0]:(e.date=r[0],n=r[1],d.timeZoneDelimiter.test(e.date)&&(e.date=t.split(d.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){const i=d.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function U(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:t.slice((n[1]||n[2]).length)}}function h(t,e){if(e===null)return new Date(NaN);const r=t.match(p);if(!r)return new Date(NaN);const n=!!r[4],i=l(r[1]),a=l(r[2])-1,o=l(r[3]),c=l(r[4]),s=l(r[5])-1;if(n)return Y(e,c,s)?C(e,c,s):new Date(NaN);{const u=new Date(0);return!F(e,a,o)||!O(e,i)?new Date(NaN):(u.setUTCFullYear(e,a,Math.max(i,o)),u)}}function l(t){return t?parseInt(t):1}function w(t){const e=t.match(T);if(!e)return NaN;const r=D(e[1]),n=D(e[2]),i=D(e[3]);return v(r,n,i)?r*m.millisecondsInHour+n*m.millisecondsInMinute+i*1e3:NaN}function D(t){return t&&parseFloat(t.replace(",","."))||0}function S(t){if(t==="Z")return 0;const e=t.match(I);if(!e)return 0;const r=e[1]==="+"?-1:1,n=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return M(n,i)?r*(n*m.millisecondsInHour+i*m.millisecondsInMinute):NaN}function C(t,e,r){const n=new Date(0);n.setUTCFullYear(t,0,4);const i=n.getUTCDay()||7,a=(e-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}const y=[31,null,31,30,31,30,31,31,30,31,30,31];function N(t){return t%400===0||t%4===0&&t%100!==0}function F(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(y[e]||(N(t)?29:28))}function O(t,e){return e>=1&&e<=(N(t)?366:365)}function Y(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function v(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function M(t,e){return e>=0&&e<=59}const k=t=>{const e=g(t);return!isNaN(e.getTime())};exports.extractErrorsFromResponse=f.extractErrorsFromResponse;exports.fixNameIdNulls=f.fixNameIdNulls;exports.hookFormSetServerErrors=f.hookFormSetServerErrors;exports.isPrimitive=f.isPrimitive;exports.truncateText=f.truncateText;exports.isISODate=k;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils/index'
|
package/dist/utils.es.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { e as W, f as $, h as E, i as H, t as b } from "./textUtils-9KFqOvA8.mjs";
|
|
2
|
+
import { b as m, c as D } from "./constants-CzNy5yO3.mjs";
|
|
3
|
+
function p(t, e) {
|
|
4
|
+
const r = (e == null ? void 0 : e.additionalDigits) ?? 2, n = U(t);
|
|
5
|
+
let a;
|
|
6
|
+
if (n.date) {
|
|
7
|
+
const s = w(n.date, r);
|
|
8
|
+
a = x(s.restDateString, s.year);
|
|
9
|
+
}
|
|
10
|
+
if (!a || isNaN(a.getTime()))
|
|
11
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
12
|
+
const i = a.getTime();
|
|
13
|
+
let o = 0, c;
|
|
14
|
+
if (n.time && (o = I(n.time), isNaN(o)))
|
|
15
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
16
|
+
if (n.timezone) {
|
|
17
|
+
if (c = C(n.timezone), isNaN(c))
|
|
18
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
19
|
+
} else {
|
|
20
|
+
const s = new Date(i + o), u = /* @__PURE__ */ new Date(0);
|
|
21
|
+
return u.setFullYear(
|
|
22
|
+
s.getUTCFullYear(),
|
|
23
|
+
s.getUTCMonth(),
|
|
24
|
+
s.getUTCDate()
|
|
25
|
+
), u.setHours(
|
|
26
|
+
s.getUTCHours(),
|
|
27
|
+
s.getUTCMinutes(),
|
|
28
|
+
s.getUTCSeconds(),
|
|
29
|
+
s.getUTCMilliseconds()
|
|
30
|
+
), u;
|
|
31
|
+
}
|
|
32
|
+
return new Date(i + o + c);
|
|
33
|
+
}
|
|
34
|
+
const f = {
|
|
35
|
+
dateTimeDelimiter: /[T ]/,
|
|
36
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
37
|
+
timezone: /([Z+-].*)$/
|
|
38
|
+
}, g = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, T = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, h = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
39
|
+
function U(t) {
|
|
40
|
+
const e = {}, r = t.split(f.dateTimeDelimiter);
|
|
41
|
+
let n;
|
|
42
|
+
if (r.length > 2)
|
|
43
|
+
return e;
|
|
44
|
+
if (/:/.test(r[0]) ? n = r[0] : (e.date = r[0], n = r[1], f.timeZoneDelimiter.test(e.date) && (e.date = t.split(f.timeZoneDelimiter)[0], n = t.substr(
|
|
45
|
+
e.date.length,
|
|
46
|
+
t.length
|
|
47
|
+
))), n) {
|
|
48
|
+
const a = f.timezone.exec(n);
|
|
49
|
+
a ? (e.time = n.replace(a[1], ""), e.timezone = a[1]) : e.time = n;
|
|
50
|
+
}
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
function w(t, e) {
|
|
54
|
+
const r = new RegExp(
|
|
55
|
+
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
56
|
+
), n = t.match(r);
|
|
57
|
+
if (!n)
|
|
58
|
+
return { year: NaN, restDateString: "" };
|
|
59
|
+
const a = n[1] ? parseInt(n[1]) : null, i = n[2] ? parseInt(n[2]) : null;
|
|
60
|
+
return {
|
|
61
|
+
year: i === null ? a : i * 100,
|
|
62
|
+
restDateString: t.slice((n[1] || n[2]).length)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function x(t, e) {
|
|
66
|
+
if (e === null)
|
|
67
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
68
|
+
const r = t.match(g);
|
|
69
|
+
if (!r)
|
|
70
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
71
|
+
const n = !!r[4], a = l(r[1]), i = l(r[2]) - 1, o = l(r[3]), c = l(r[4]), s = l(r[5]) - 1;
|
|
72
|
+
if (n)
|
|
73
|
+
return F(e, c, s) ? Y(e, c, s) : /* @__PURE__ */ new Date(NaN);
|
|
74
|
+
{
|
|
75
|
+
const u = /* @__PURE__ */ new Date(0);
|
|
76
|
+
return !S(e, i, o) || !z(e, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, i, Math.max(a, o)), u);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function l(t) {
|
|
80
|
+
return t ? parseInt(t) : 1;
|
|
81
|
+
}
|
|
82
|
+
function I(t) {
|
|
83
|
+
const e = t.match(T);
|
|
84
|
+
if (!e)
|
|
85
|
+
return NaN;
|
|
86
|
+
const r = d(e[1]), n = d(e[2]), a = d(e[3]);
|
|
87
|
+
return O(r, n, a) ? r * m + n * D + a * 1e3 : NaN;
|
|
88
|
+
}
|
|
89
|
+
function d(t) {
|
|
90
|
+
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
91
|
+
}
|
|
92
|
+
function C(t) {
|
|
93
|
+
if (t === "Z")
|
|
94
|
+
return 0;
|
|
95
|
+
const e = t.match(h);
|
|
96
|
+
if (!e)
|
|
97
|
+
return 0;
|
|
98
|
+
const r = e[1] === "+" ? -1 : 1, n = parseInt(e[2]), a = e[3] && parseInt(e[3]) || 0;
|
|
99
|
+
return k(n, a) ? r * (n * m + a * D) : NaN;
|
|
100
|
+
}
|
|
101
|
+
function Y(t, e, r) {
|
|
102
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
103
|
+
n.setUTCFullYear(t, 0, 4);
|
|
104
|
+
const a = n.getUTCDay() || 7, i = (e - 1) * 7 + r + 1 - a;
|
|
105
|
+
return n.setUTCDate(n.getUTCDate() + i), n;
|
|
106
|
+
}
|
|
107
|
+
const y = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
108
|
+
function N(t) {
|
|
109
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
110
|
+
}
|
|
111
|
+
function S(t, e, r) {
|
|
112
|
+
return e >= 0 && e <= 11 && r >= 1 && r <= (y[e] || (N(t) ? 29 : 28));
|
|
113
|
+
}
|
|
114
|
+
function z(t, e) {
|
|
115
|
+
return e >= 1 && e <= (N(t) ? 366 : 365);
|
|
116
|
+
}
|
|
117
|
+
function F(t, e, r) {
|
|
118
|
+
return e >= 1 && e <= 53 && r >= 0 && r <= 6;
|
|
119
|
+
}
|
|
120
|
+
function O(t, e, r) {
|
|
121
|
+
return t === 24 ? e === 0 && r === 0 : r >= 0 && r < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
122
|
+
}
|
|
123
|
+
function k(t, e) {
|
|
124
|
+
return e >= 0 && e <= 59;
|
|
125
|
+
}
|
|
126
|
+
const R = (t) => {
|
|
127
|
+
const e = p(t);
|
|
128
|
+
return !isNaN(e.getTime());
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
W as extractErrorsFromResponse,
|
|
132
|
+
$ as fixNameIdNulls,
|
|
133
|
+
E as hookFormSetServerErrors,
|
|
134
|
+
R as isISODate,
|
|
135
|
+
H as isPrimitive,
|
|
136
|
+
b as truncateText
|
|
137
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-luminus-components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/BenefitCZ/react-luminus-components.git"
|
|
8
|
+
},
|
|
9
|
+
"author": "triskacik",
|
|
10
|
+
"homepage": "https://github.com/BenefitCZ/react-luminus-components#readme",
|
|
11
|
+
"main": "./dist/main.cjs.js",
|
|
12
|
+
"module": "./dist/main.es.js",
|
|
13
|
+
"typings": "./dist/main.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/main.es.js",
|
|
17
|
+
"require": "./dist/main.cjs.js",
|
|
18
|
+
"types": "./dist/main.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./layout": {
|
|
21
|
+
"import": "./dist/layout.es.js",
|
|
22
|
+
"require": "./dist/layout.cjs.js",
|
|
23
|
+
"types": "./dist/layout.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./contexts": {
|
|
26
|
+
"import": "./dist/contexts.es.js",
|
|
27
|
+
"require": "./dist/contexts.cjs.js",
|
|
28
|
+
"types": "./dist/contexts.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./hooks": {
|
|
31
|
+
"import": "./dist/hooks.es.js",
|
|
32
|
+
"require": "./dist/hooks.cjs.js",
|
|
33
|
+
"types": "./dist/hooks.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./utils": {
|
|
36
|
+
"import": "./dist/utils.es.js",
|
|
37
|
+
"require": "./dist/utils.cjs.js",
|
|
38
|
+
"types": "./dist/utils.d.ts"
|
|
39
|
+
},
|
|
40
|
+
"./types": "./dist/models/index.d.ts",
|
|
41
|
+
"./styles": "./dist/style.css"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc && vite build",
|
|
48
|
+
"build:watch": "tsc && vite build --watch",
|
|
49
|
+
"dev": "vite",
|
|
50
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --cache"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"axios": "^1.6.8",
|
|
54
|
+
"react": ">=18",
|
|
55
|
+
"react-bootstrap": ">=2",
|
|
56
|
+
"react-hook-form": ">=7",
|
|
57
|
+
"react-router-dom": ">=6",
|
|
58
|
+
"zod": ">=3"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"classnames": "^2.5.1",
|
|
62
|
+
"date-fns": "^3.6.0",
|
|
63
|
+
"react-hot-toast": "^2.4.1",
|
|
64
|
+
"react-icons": "^5.0.1",
|
|
65
|
+
"use-debounce": "^10.0.0"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
69
|
+
"@types/node": "^20.11.29",
|
|
70
|
+
"@types/react": "^18.2.56",
|
|
71
|
+
"@types/react-dom": "^18.2.19",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^7.3.1",
|
|
73
|
+
"@typescript-eslint/parser": "^7.3.1",
|
|
74
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
75
|
+
"eslint": "^8.57.0",
|
|
76
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
77
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
78
|
+
"eslint-config-prettier": "^9.1.0",
|
|
79
|
+
"eslint-plugin-import": "^2.29.1",
|
|
80
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
81
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
82
|
+
"eslint-plugin-react": "^7.34.1",
|
|
83
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
84
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
85
|
+
"prettier": "^3.2.5",
|
|
86
|
+
"rollup-plugin-typescript-paths": "^1.5.0",
|
|
87
|
+
"sass": "^1.72.0",
|
|
88
|
+
"sass-loader": "^14.1.1",
|
|
89
|
+
"tslib": "^2.6.2",
|
|
90
|
+
"typescript": "^5.2.2",
|
|
91
|
+
"vite": "^5.1.4",
|
|
92
|
+
"vite-plugin-dts": "^3.7.3"
|
|
93
|
+
}
|
|
94
|
+
}
|