react-luminus-components 1.1.27 → 1.2.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/dist/.vite/manifest.json +41 -41
- package/dist/{DataKey-BW7pVEN-.cjs → DataKey-CCnWsp5R.cjs} +1 -1
- package/dist/{DataKey-DLEAAtqJ.js → DataKey-DEvxfpG4.js} +1 -1
- package/dist/{SimpleTooltip-Bclp93h0.js → SimpleTooltip-Bgsx47Y0.js} +1 -1
- package/dist/{SimpleTooltip-SKI6LrMC.cjs → SimpleTooltip-D3yt_5sa.cjs} +1 -1
- package/dist/{Typography-yDv-w5KK.cjs → Typography-CwxdFDrh.cjs} +1 -1
- package/dist/{Typography-CmC4x8yQ.js → Typography-dPh0BYIU.js} +9 -9
- package/dist/{UserAvatarToggle-B7PDqhFk.cjs → UserAvatarToggle-D8sQZp-d.cjs} +41 -41
- package/dist/{UserAvatarToggle-CsMWlplC.js → UserAvatarToggle-DgGJIRzY.js} +67 -63
- package/dist/components/Buttons/ContextButton/ContextButton.d.ts +1 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +1 -1
- package/dist/components/Form/CheckInput/CheckInput.d.ts +2 -10
- package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +2 -17
- package/dist/components/Form/SelectInput/SelectInput.d.ts +2 -17
- package/dist/components/Form/TextInput/TextInput.d.ts +2 -16
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +2 -2
- package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +2 -10
- package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +2 -13
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +2 -2
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +2 -2
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +2 -2
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +2 -2
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +4 -0
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +4 -0
- package/dist/components/InputContainers/index.d.ts +2 -0
- package/dist/components/common/Card/Card.d.ts +28 -0
- package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +1 -2
- package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +10 -0
- package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +13 -0
- package/dist/components/common/index.d.ts +3 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +4 -4
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +6 -2
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +652 -652
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +5 -2
- package/dist/main.es.js +2109 -1952
- package/dist/models/index.d.ts +26 -7
- package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +11 -0
- package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +6 -0
- package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +6 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +4 -0
- package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +4 -0
- package/dist/models/prop-types/InputContainerProps.d.ts +23 -0
- package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +5 -0
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +14 -0
- package/dist/models/prop-types/InputProps/FileInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +15 -0
- package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +8 -0
- package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +6 -0
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +6 -0
- package/dist/models/types/PhotoAction.d.ts +9 -0
- package/dist/models/types/PhotoLibraryItemModel.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/{useConfirm-DtEg0CeZ.cjs → useConfirm-Bm2_Ub3h.cjs} +1 -1
- package/dist/{useConfirm-CXFo5fIW.js → useConfirm-ClKBi_ok.js} +1 -1
- package/package.json +1 -1
- package/dist/components/common/InputContainer/InputContainer.d.ts +0 -10
- package/dist/models/prop-types/HookFormCheckInputProps.d.ts +0 -10
- package/dist/models/prop-types/HookFormDropdownPickerProps.d.ts +0 -13
- package/dist/models/prop-types/HookFormRadioInputProps.d.ts +0 -10
- package/dist/models/prop-types/HookFormSelectInputProps.d.ts +0 -16
- package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +0 -13
- package/dist/models/prop-types/HookFormTextInputProps.d.ts +0 -14
- /package/dist/models/prop-types/{HookFormInputProps.d.ts → HookFormInputProps/HookFormInputProps.d.ts} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PhotoAction, PhotoLibraryItemModel } from '@models/index';
|
|
3
|
+
type Props = {
|
|
4
|
+
show: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
photos: PhotoLibraryItemModel[];
|
|
7
|
+
defaultIndex: number;
|
|
8
|
+
uploadPhotosText?: string;
|
|
9
|
+
onUploadPhotos?: (files: File[]) => void;
|
|
10
|
+
photoActions?: PhotoAction[];
|
|
11
|
+
};
|
|
12
|
+
declare const PhotoLightbox: ({ show, onClose, photos, defaultIndex, uploadPhotosText, onUploadPhotos, photoActions, }: Props) => import("react").JSX.Element | null;
|
|
13
|
+
export default PhotoLightbox;
|
|
@@ -7,7 +7,9 @@ export { default as HomeDashboard } from './HomeDashboard/HomeDashboard';
|
|
|
7
7
|
export { default as ConfirmDialog } from './ConfirmDialog/ConfirmDialog';
|
|
8
8
|
export { default as Badge } from './Badge/Badge';
|
|
9
9
|
export { default as Collapse } from './Collapse/Collapse';
|
|
10
|
-
export { default as InputContainer } from './InputContainer/InputContainer';
|
|
11
10
|
export { default as InvalidFeedback } from './InvalidFeedback/InvalidFeedback';
|
|
12
11
|
export { default as SimplePicker } from './SimplePicker/SimplePicker';
|
|
13
12
|
export { default as AppSearch } from './AppSearch/AppSearch';
|
|
13
|
+
export { default as Card } from './Card/Card';
|
|
14
|
+
export { default as PhotoLightbox } from './PhotoLightbox/PhotoLightbox';
|
|
15
|
+
export { default as PhotoLibrary } from './PhotoLibrary/PhotoLibrary';
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./UserAvatarToggle-B7PDqhFk.cjs"),a=require("react"),ve=require("./useConfirm-DtEg0CeZ.cjs"),Fe=require("./Typography-yDv-w5KK.cjs"),v=require("./DataKey-BW7pVEN-.cjs"),Ie=require("react-dom");function Pe(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return e.default=s,Object.freeze(e)}const h=Pe(a),Ue=s=>h.forwardRef((e,n)=>t.jsxRuntimeExports.jsx("div",{...e,ref:n,className:t.classNames(e.className,s)})),We={"aria-label":t.PropTypes.string,onClick:t.PropTypes.func,variant:t.PropTypes.oneOf(["white"])},me=h.forwardRef(({className:s,variant:e,"aria-label":n="Close",...o},r)=>t.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:t.classNames("btn-close",e&&`btn-close-${e}`,s),"aria-label":n,...o}));me.displayName="CloseButton";me.propTypes=We;const $e=me;var J;function he(s){if((!J&&J!==0||s)&&t.canUseDOM){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),J=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return J}function ce(s){s===void 0&&(s=t.ownerDocument());try{var e=s.activeElement;return!e||!e.nodeName?null:e}catch{return s.body}}function He(s=document){const e=s.defaultView;return Math.abs(e.innerWidth-s.documentElement.clientWidth)}const ge=v.dataAttr("modal-open");class _e{constructor({ownerDocument:e,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return He(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[o]:r.style[o]},e.scrollBarWidth&&(n[o]=`${parseInt(t.style(r,o)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(ge,""),t.style(r,n)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const n=this.getElement();n.removeAttribute(ge),Object.assign(n.style,e.style)}add(e){let n=this.modals.indexOf(e);return n!==-1||(n=this.modals.length,this.modals.push(e),this.setModalAttributes(e),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(e){const n=this.modals.indexOf(e);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const fe=_e,qe=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Ke(s,e){if(s==null)return{};var n={},o=Object.keys(s),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=s[r]);return n}let ue;function ze(s){return ue||(ue=new fe({ownerDocument:s==null?void 0:s.document})),ue}function Ge(s){const e=t.useWindow(),n=s||ze(e),o=a.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:a.useCallback(r=>{o.current.dialog=r},[]),setBackdropRef:a.useCallback(r=>{o.current.backdrop=r},[])})}const Re=a.forwardRef((s,e)=>{let{show:n=!1,role:o="dialog",className:r,style:i,children:u,backdrop:c=!0,keyboard:f=!0,onBackdropClick:p,onEscapeKeyDown:m,transition:E,runTransition:C,backdropTransition:w,runBackdropTransition:Q,autoFocus:W=!0,enforceFocus:Z=!0,restoreFocus:M=!0,restoreFocusOptions:ee,renderDialog:$,renderBackdrop:te=d=>t.jsxRuntimeExports.jsx("div",Object.assign({},d)),manager:se,container:ne,onShow:H,onHide:A=()=>{},onExit:oe,onExited:D,onExiting:_,onEnter:q,onEntering:K,onEntered:z}=s,re=Ke(s,qe);const R=t.useWindow(),N=t.useWaitForDOMRef(ne),x=Ge(se),ae=t.useMounted(),G=v.usePrevious(n),[y,T]=a.useState(!n),g=a.useRef(null);a.useImperativeHandle(e,()=>x,[x]),t.canUseDOM&&!G&&n&&(g.current=ce(R==null?void 0:R.document)),n&&y&&T(!1);const j=t.useEventCallback(()=>{if(x.add(),k.current=t.listen(document,"keydown",le),I.current=t.listen(document,"focus",()=>setTimeout(ie),!0),H&&H(),W){var d,Y;const U=ce((d=(Y=x.dialog)==null?void 0:Y.ownerDocument)!=null?d:R==null?void 0:R.document);x.dialog&&U&&!t.contains(x.dialog,U)&&(g.current=U,x.dialog.focus())}}),F=t.useEventCallback(()=>{if(x.remove(),k.current==null||k.current(),I.current==null||I.current(),M){var d;(d=g.current)==null||d.focus==null||d.focus(ee),g.current=null}});a.useEffect(()=>{!n||!N||j()},[n,N,j]),a.useEffect(()=>{y&&F()},[y,F]),t.useWillUnmount(()=>{F()});const ie=t.useEventCallback(()=>{if(!Z||!ae()||!x.isTopModal())return;const d=ce(R==null?void 0:R.document);x.dialog&&d&&!t.contains(x.dialog,d)&&x.dialog.focus()}),V=t.useEventCallback(d=>{d.target===d.currentTarget&&(p==null||p(d),c===!0&&A())}),le=t.useEventCallback(d=>{f&&t.isEscKey(d)&&x.isTopModal()&&(m==null||m(d),d.defaultPrevented||A())}),I=a.useRef(),k=a.useRef(),X=(...d)=>{T(!0),D==null||D(...d)};if(!N)return null;const S=Object.assign({role:o,ref:x.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},re,{style:i,className:r,tabIndex:-1});let P=$?$(S):t.jsxRuntimeExports.jsx("div",Object.assign({},S,{children:h.cloneElement(u,{role:"document"})}));P=t.renderTransition(E,C,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:oe,onExiting:_,onExited:X,onEnter:q,onEntering:K,onEntered:z,children:P});let O=null;return c&&(O=te({ref:x.setBackdropRef,onClick:V}),O=t.renderTransition(w,Q,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:O})),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Ie.createPortal(t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[O,P]}),N)})});Re.displayName="Modal";const Ve=Object.assign(Re,{Manager:fe});function Xe(s,e){s.classList?s.classList.add(e):t.hasClass(s,e)||(typeof s.className=="string"?s.className=s.className+" "+e:s.setAttribute("class",(s.className&&s.className.baseVal||"")+" "+e))}function Ee(s,e){return s.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Ye(s,e){s.classList?s.classList.remove(e):typeof s.className=="string"?s.className=Ee(s.className,e):s.setAttribute("class",Ee(s.className&&s.className.baseVal||"",e))}const L={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Je extends fe{adjustAndStore(e,n,o){const r=n.style[e];n.dataset[e]=r,t.style(n,{[e]:`${parseFloat(t.style(n,e))+o}px`})}restore(e,n){const o=n.dataset[e];o!==void 0&&(delete n.dataset[e],t.style(n,{[e]:o}))}setContainerStyle(e){super.setContainerStyle(e);const n=this.getElement();if(Xe(n,"modal-open"),!e.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.adjustAndStore(o,i,e.scrollBarWidth)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.adjustAndStore(r,i,-e.scrollBarWidth)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(r,i,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const n=this.getElement();Ye(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.restore(o,i)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.restore(r,i)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.restore(r,i))}}let de;function Qe(s){return de||(de=new Je(s)),de}const je=h.forwardRef(({className:s,bsPrefix:e,as:n="div",...o},r)=>(e=t.useBootstrapPrefix(e,"modal-body"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));je.displayName="ModalBody";const Ze=je,et=h.createContext({onHide(){}}),Ce=et,ye=h.forwardRef(({bsPrefix:s,className:e,contentClassName:n,centered:o,size:r,fullscreen:i,children:u,scrollable:c,...f},p)=>{s=t.useBootstrapPrefix(s,"modal");const m=`${s}-dialog`,E=typeof i=="string"?`${s}-fullscreen-${i}`:`${s}-fullscreen`;return t.jsxRuntimeExports.jsx("div",{...f,ref:p,className:t.classNames(m,e,r&&`${s}-${r}`,o&&`${m}-centered`,c&&`${m}-scrollable`,i&&E),children:t.jsxRuntimeExports.jsx("div",{className:t.classNames(`${s}-content`,n),children:u})})});ye.displayName="ModalDialog";const be=ye,we=h.forwardRef(({className:s,bsPrefix:e,as:n="div",...o},r)=>(e=t.useBootstrapPrefix(e,"modal-footer"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));we.displayName="ModalFooter";const tt=we,st=h.forwardRef(({closeLabel:s="Close",closeVariant:e,closeButton:n=!1,onHide:o,children:r,...i},u)=>{const c=a.useContext(Ce),f=t.useEventCallback(()=>{c==null||c.onHide(),o==null||o()});return t.jsxRuntimeExports.jsxs("div",{ref:u,...i,children:[r,n&&t.jsxRuntimeExports.jsx($e,{"aria-label":s,variant:e,onClick:f})]})}),nt=st,Me=h.forwardRef(({bsPrefix:s,className:e,closeLabel:n="Close",closeButton:o=!1,...r},i)=>(s=t.useBootstrapPrefix(s,"modal-header"),t.jsxRuntimeExports.jsx(nt,{ref:i,...r,className:t.classNames(e,s),closeLabel:n,closeButton:o})));Me.displayName="ModalHeader";const ot=Me,rt=Ue("h4"),Ne=h.forwardRef(({className:s,bsPrefix:e,as:n=rt,...o},r)=>(e=t.useBootstrapPrefix(e,"modal-title"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));Ne.displayName="ModalTitle";const at=Ne;function it(s){return t.jsxRuntimeExports.jsx(t.Fade,{...s,timeout:null})}function lt(s){return t.jsxRuntimeExports.jsx(t.Fade,{...s,timeout:null})}const Te=h.forwardRef(({bsPrefix:s,className:e,style:n,dialogClassName:o,contentClassName:r,children:i,dialogAs:u=be,"data-bs-theme":c,"aria-labelledby":f,"aria-describedby":p,"aria-label":m,show:E=!1,animation:C=!0,backdrop:w=!0,keyboard:Q=!0,onEscapeKeyDown:W,onShow:Z,onHide:M,container:ee,autoFocus:$=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:H,onExit:A,onExiting:oe,onEnter:D,onEntering:_,onExited:q,backdropClassName:K,manager:z,...re},R)=>{const[N,x]=a.useState({}),[ae,G]=a.useState(!1),y=a.useRef(!1),T=a.useRef(!1),g=a.useRef(null),[j,F]=t.useCallbackRef(),ie=t.useMergedRefs(R,F),V=t.useEventCallback(M),le=t.useIsRTL();s=t.useBootstrapPrefix(s,"modal");const I=a.useMemo(()=>({onHide:V}),[V]);function k(){return z||Qe({isRTL:le})}function X(l){if(!t.canUseDOM)return;const B=k().getScrollbarWidth()>0,pe=l.scrollHeight>t.ownerDocument(l).documentElement.clientHeight;x({paddingRight:B&&!pe?he():void 0,paddingLeft:!B&&pe?he():void 0})}const S=t.useEventCallback(()=>{j&&X(j.dialog)});t.useWillUnmount(()=>{t.removeEventListener(window,"resize",S),g.current==null||g.current()});const P=()=>{y.current=!0},O=l=>{y.current&&j&&l.target===j.dialog&&(T.current=!0),y.current=!1},d=()=>{G(!0),g.current=t.transitionEnd(j.dialog,()=>{G(!1)})},Y=l=>{l.target===l.currentTarget&&d()},U=l=>{if(w==="static"){Y(l);return}if(T.current||l.target!==l.currentTarget){T.current=!1;return}M==null||M()},ke=l=>{Q?W==null||W(l):(l.preventDefault(),w==="static"&&d())},Se=(l,B)=>{l&&X(l),D==null||D(l,B)},Oe=l=>{g.current==null||g.current(),A==null||A(l)},Be=(l,B)=>{_==null||_(l,B),t.addEventListener(window,"resize",S)},Le=l=>{l&&(l.style.display=""),q==null||q(l),t.removeEventListener(window,"resize",S)},Ae=a.useCallback(l=>t.jsxRuntimeExports.jsx("div",{...l,className:t.classNames(`${s}-backdrop`,K,!C&&"show")}),[C,K,s]),xe={...n,...N};xe.display="block";const De=l=>t.jsxRuntimeExports.jsx("div",{role:"dialog",...l,style:xe,className:t.classNames(e,s,ae&&`${s}-static`,!C&&"show"),onClick:w?U:void 0,onMouseUp:O,"data-bs-theme":c,"aria-label":m,"aria-labelledby":f,"aria-describedby":p,children:t.jsxRuntimeExports.jsx(u,{...re,onMouseDown:P,className:o,contentClassName:r,children:i})});return t.jsxRuntimeExports.jsx(Ce.Provider,{value:I,children:t.jsxRuntimeExports.jsx(Ve,{show:E,ref:ie,backdrop:w,container:ee,keyboard:!0,autoFocus:$,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:ke,onShow:Z,onHide:M,onEnter:Se,onEntering:Be,onEntered:H,onExit:Oe,onExiting:oe,onExited:Le,manager:k(),transition:C?it:void 0,backdropTransition:C?lt:void 0,renderBackdrop:Ae,renderDialog:De})})});Te.displayName="Modal";const b=Object.assign(Te,{Body:Ze,Header:ot,Title:at,Footer:tt,Dialog:be,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),ct=()=>{const{confirmTexts:s}=a.useContext(t.LuminusComponentsContext),{isShown:e,text:n,onFinish:o}=ve.usePrompt(),[r,i]=a.useState(""),u=a.useCallback(()=>{o(null)},[o]),c=a.useCallback(()=>{o(r)},[o,r]);return a.useEffect(()=>{e===!0&&i("")},[e]),t.jsxRuntimeExports.jsxs(b,{show:e,size:"sm",centered:!0,onHide:u,children:[t.jsxRuntimeExports.jsx(b.Header,{children:t.jsxRuntimeExports.jsx(b.Title,{children:n})}),t.jsxRuntimeExports.jsx(b.Body,{children:t.jsxRuntimeExports.jsx("textarea",{autoFocus:!0,tabIndex:0,value:r,onChange:f=>i(f.currentTarget.value),className:"w-100",rows:5})}),t.jsxRuntimeExports.jsxs(b.Footer,{children:[t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:u,children:s.cancel}),t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:c,children:s.confirm})]})]})},ut=({children:s})=>{const[e,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useRef(()=>{}),u=a.useCallback(p=>{r(p),n(!0),console.log("showprompt")},[]),c=a.useCallback(()=>{n(!1)},[]),f=a.useMemo(()=>({isShown:e,text:o,showPrompt:u,hidePrompt:c,resolveRef:i}),[c,e,u,o,i]);return t.jsxRuntimeExports.jsxs(t.PromptContext.Provider,{value:f,children:[s,t.jsxRuntimeExports.jsx(ct,{})]})},dt=({children:s})=>{const[e,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useCallback(f=>{n(!0),r(f)},[]),u=a.useCallback(()=>{n(!1)},[]),c=a.useMemo(()=>({show:e,text:o,showConfirm:i,hideConfirm:u}),[e,o,i,u]);return t.jsxRuntimeExports.jsxs(t.ConfirmContext.Provider,{value:c,children:[t.jsxRuntimeExports.jsx(pt,{}),s]})},mt=({cookieDomain:s,axiosInstance:e,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p,children:m})=>{const E=a.useMemo(()=>({axiosInstance:e,cookieDomain:s,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p}),[e,s,n,o,r,i,u,c,f,p]);return t.jsxRuntimeExports.jsx(t.LuminusComponentsContext.Provider,{value:E,children:t.jsxRuntimeExports.jsx(dt,{children:t.jsxRuntimeExports.jsxs(ut,{children:[t.jsxRuntimeExports.jsx(t.Ie,{}),m]})})})},ft=({children:s})=>{const[e,n]=a.useState(!1),[o]=a.useState(new Set),r=a.useCallback(c=>{o.add(c),n(!0)},[o]),i=a.useCallback(c=>{o.delete(c),o.size===0&&n(!1)},[o]),u=a.useMemo(()=>({isLoading:e,startLoading:r,stopLoading:i}),[e,r,i]);return t.jsxRuntimeExports.jsxs(t.LoadingContext.Provider,{value:u,children:[e&&t.jsxRuntimeExports.jsx(v.Loading,{}),s]})},xt=({children:s})=>{const e=t.useAxios(),n=a.useCallback(()=>{const m=localStorage.getItem("user")??null;return m?JSON.parse(m):null},[]),[o,r]=a.useState(n()),i=a.useCallback(async()=>{let m=null;return await e.get("/user/detail").then(E=>{m=E.data}).catch(()=>{m=null}),localStorage.setItem("user",JSON.stringify(m)),m},[e]),u=a.useCallback(()=>{localStorage.removeItem("user")},[]),c=a.useCallback(async()=>{const m=await i();return m?(r(m),!0):!1},[i]),f=a.useCallback(()=>{u(),r(null)},[u]),p=a.useMemo(()=>({user:o,loginUser:c,logoutUser:f}),[o,c,f]);return a.useEffect(()=>{r(n())},[n]),t.jsxRuntimeExports.jsx(t.UserContext.Provider,{value:p,children:s})},pt=()=>{const{confirmTexts:s}=a.useContext(t.LuminusComponentsContext),{onConfirm:e,onCancel:n,text:o,show:r}=ve.useConfirm();return t.jsxRuntimeExports.jsx(b,{show:r,size:"sm",centered:!0,onHide:n,children:t.jsxRuntimeExports.jsxs(b.Body,{children:[t.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:t.jsxRuntimeExports.jsx(Fe.Typography,{variant:"h6",children:o})}),t.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:n,children:s.no}),t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:e,children:s.yes})]})]})})};exports.LoadingContext=t.LoadingContext;exports.LuminusComponentsContext=t.LuminusComponentsContext;exports.UserContext=t.UserContext;exports.LoadingProvider=ft;exports.LuminusComponentsProvider=mt;exports.UserProvider=xt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./UserAvatarToggle-D8sQZp-d.cjs"),a=require("react"),ve=require("./useConfirm-Bm2_Ub3h.cjs"),Fe=require("./Typography-CwxdFDrh.cjs"),v=require("./DataKey-CCnWsp5R.cjs"),Ie=require("react-dom");function Pe(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>s[n]})}}return e.default=s,Object.freeze(e)}const h=Pe(a),Ue=s=>h.forwardRef((e,n)=>t.jsxRuntimeExports.jsx("div",{...e,ref:n,className:t.classNames(e.className,s)})),We={"aria-label":t.PropTypes.string,onClick:t.PropTypes.func,variant:t.PropTypes.oneOf(["white"])},me=h.forwardRef(({className:s,variant:e,"aria-label":n="Close",...o},r)=>t.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:t.classNames("btn-close",e&&`btn-close-${e}`,s),"aria-label":n,...o}));me.displayName="CloseButton";me.propTypes=We;const $e=me;var J;function he(s){if((!J&&J!==0||s)&&t.canUseDOM){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),J=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return J}function ce(s){s===void 0&&(s=t.ownerDocument());try{var e=s.activeElement;return!e||!e.nodeName?null:e}catch{return s.body}}function He(s=document){const e=s.defaultView;return Math.abs(e.innerWidth-s.documentElement.clientWidth)}const ge=v.dataAttr("modal-open");class _e{constructor({ownerDocument:e,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return He(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[o]:r.style[o]},e.scrollBarWidth&&(n[o]=`${parseInt(t.style(r,o)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(ge,""),t.style(r,n)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const n=this.getElement();n.removeAttribute(ge),Object.assign(n.style,e.style)}add(e){let n=this.modals.indexOf(e);return n!==-1||(n=this.modals.length,this.modals.push(e),this.setModalAttributes(e),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(e){const n=this.modals.indexOf(e);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const fe=_e,qe=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Ke(s,e){if(s==null)return{};var n={},o=Object.keys(s),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=s[r]);return n}let ue;function ze(s){return ue||(ue=new fe({ownerDocument:s==null?void 0:s.document})),ue}function Ge(s){const e=t.useWindow(),n=s||ze(e),o=a.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:a.useCallback(r=>{o.current.dialog=r},[]),setBackdropRef:a.useCallback(r=>{o.current.backdrop=r},[])})}const Re=a.forwardRef((s,e)=>{let{show:n=!1,role:o="dialog",className:r,style:i,children:u,backdrop:c=!0,keyboard:f=!0,onBackdropClick:p,onEscapeKeyDown:m,transition:E,runTransition:C,backdropTransition:w,runBackdropTransition:Q,autoFocus:W=!0,enforceFocus:Z=!0,restoreFocus:M=!0,restoreFocusOptions:ee,renderDialog:$,renderBackdrop:te=d=>t.jsxRuntimeExports.jsx("div",Object.assign({},d)),manager:se,container:ne,onShow:H,onHide:A=()=>{},onExit:oe,onExited:D,onExiting:_,onEnter:q,onEntering:K,onEntered:z}=s,re=Ke(s,qe);const R=t.useWindow(),N=t.useWaitForDOMRef(ne),x=Ge(se),ae=t.useMounted(),G=v.usePrevious(n),[y,T]=a.useState(!n),g=a.useRef(null);a.useImperativeHandle(e,()=>x,[x]),t.canUseDOM&&!G&&n&&(g.current=ce(R==null?void 0:R.document)),n&&y&&T(!1);const j=t.useEventCallback(()=>{if(x.add(),k.current=t.listen(document,"keydown",le),I.current=t.listen(document,"focus",()=>setTimeout(ie),!0),H&&H(),W){var d,Y;const U=ce((d=(Y=x.dialog)==null?void 0:Y.ownerDocument)!=null?d:R==null?void 0:R.document);x.dialog&&U&&!t.contains(x.dialog,U)&&(g.current=U,x.dialog.focus())}}),F=t.useEventCallback(()=>{if(x.remove(),k.current==null||k.current(),I.current==null||I.current(),M){var d;(d=g.current)==null||d.focus==null||d.focus(ee),g.current=null}});a.useEffect(()=>{!n||!N||j()},[n,N,j]),a.useEffect(()=>{y&&F()},[y,F]),t.useWillUnmount(()=>{F()});const ie=t.useEventCallback(()=>{if(!Z||!ae()||!x.isTopModal())return;const d=ce(R==null?void 0:R.document);x.dialog&&d&&!t.contains(x.dialog,d)&&x.dialog.focus()}),V=t.useEventCallback(d=>{d.target===d.currentTarget&&(p==null||p(d),c===!0&&A())}),le=t.useEventCallback(d=>{f&&t.isEscKey(d)&&x.isTopModal()&&(m==null||m(d),d.defaultPrevented||A())}),I=a.useRef(),k=a.useRef(),X=(...d)=>{T(!0),D==null||D(...d)};if(!N)return null;const S=Object.assign({role:o,ref:x.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},re,{style:i,className:r,tabIndex:-1});let P=$?$(S):t.jsxRuntimeExports.jsx("div",Object.assign({},S,{children:h.cloneElement(u,{role:"document"})}));P=t.renderTransition(E,C,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:oe,onExiting:_,onExited:X,onEnter:q,onEntering:K,onEntered:z,children:P});let O=null;return c&&(O=te({ref:x.setBackdropRef,onClick:V}),O=t.renderTransition(w,Q,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:O})),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Ie.createPortal(t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[O,P]}),N)})});Re.displayName="Modal";const Ve=Object.assign(Re,{Manager:fe});function Xe(s,e){s.classList?s.classList.add(e):t.hasClass(s,e)||(typeof s.className=="string"?s.className=s.className+" "+e:s.setAttribute("class",(s.className&&s.className.baseVal||"")+" "+e))}function Ee(s,e){return s.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Ye(s,e){s.classList?s.classList.remove(e):typeof s.className=="string"?s.className=Ee(s.className,e):s.setAttribute("class",Ee(s.className&&s.className.baseVal||"",e))}const L={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Je extends fe{adjustAndStore(e,n,o){const r=n.style[e];n.dataset[e]=r,t.style(n,{[e]:`${parseFloat(t.style(n,e))+o}px`})}restore(e,n){const o=n.dataset[e];o!==void 0&&(delete n.dataset[e],t.style(n,{[e]:o}))}setContainerStyle(e){super.setContainerStyle(e);const n=this.getElement();if(Xe(n,"modal-open"),!e.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.adjustAndStore(o,i,e.scrollBarWidth)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.adjustAndStore(r,i,-e.scrollBarWidth)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(r,i,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const n=this.getElement();Ye(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v.qsa(n,L.FIXED_CONTENT).forEach(i=>this.restore(o,i)),v.qsa(n,L.STICKY_CONTENT).forEach(i=>this.restore(r,i)),v.qsa(n,L.NAVBAR_TOGGLER).forEach(i=>this.restore(r,i))}}let de;function Qe(s){return de||(de=new Je(s)),de}const je=h.forwardRef(({className:s,bsPrefix:e,as:n="div",...o},r)=>(e=t.useBootstrapPrefix(e,"modal-body"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));je.displayName="ModalBody";const Ze=je,et=h.createContext({onHide(){}}),Ce=et,ye=h.forwardRef(({bsPrefix:s,className:e,contentClassName:n,centered:o,size:r,fullscreen:i,children:u,scrollable:c,...f},p)=>{s=t.useBootstrapPrefix(s,"modal");const m=`${s}-dialog`,E=typeof i=="string"?`${s}-fullscreen-${i}`:`${s}-fullscreen`;return t.jsxRuntimeExports.jsx("div",{...f,ref:p,className:t.classNames(m,e,r&&`${s}-${r}`,o&&`${m}-centered`,c&&`${m}-scrollable`,i&&E),children:t.jsxRuntimeExports.jsx("div",{className:t.classNames(`${s}-content`,n),children:u})})});ye.displayName="ModalDialog";const be=ye,we=h.forwardRef(({className:s,bsPrefix:e,as:n="div",...o},r)=>(e=t.useBootstrapPrefix(e,"modal-footer"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));we.displayName="ModalFooter";const tt=we,st=h.forwardRef(({closeLabel:s="Close",closeVariant:e,closeButton:n=!1,onHide:o,children:r,...i},u)=>{const c=a.useContext(Ce),f=t.useEventCallback(()=>{c==null||c.onHide(),o==null||o()});return t.jsxRuntimeExports.jsxs("div",{ref:u,...i,children:[r,n&&t.jsxRuntimeExports.jsx($e,{"aria-label":s,variant:e,onClick:f})]})}),nt=st,Me=h.forwardRef(({bsPrefix:s,className:e,closeLabel:n="Close",closeButton:o=!1,...r},i)=>(s=t.useBootstrapPrefix(s,"modal-header"),t.jsxRuntimeExports.jsx(nt,{ref:i,...r,className:t.classNames(e,s),closeLabel:n,closeButton:o})));Me.displayName="ModalHeader";const ot=Me,rt=Ue("h4"),Ne=h.forwardRef(({className:s,bsPrefix:e,as:n=rt,...o},r)=>(e=t.useBootstrapPrefix(e,"modal-title"),t.jsxRuntimeExports.jsx(n,{ref:r,className:t.classNames(s,e),...o})));Ne.displayName="ModalTitle";const at=Ne;function it(s){return t.jsxRuntimeExports.jsx(t.Fade,{...s,timeout:null})}function lt(s){return t.jsxRuntimeExports.jsx(t.Fade,{...s,timeout:null})}const Te=h.forwardRef(({bsPrefix:s,className:e,style:n,dialogClassName:o,contentClassName:r,children:i,dialogAs:u=be,"data-bs-theme":c,"aria-labelledby":f,"aria-describedby":p,"aria-label":m,show:E=!1,animation:C=!0,backdrop:w=!0,keyboard:Q=!0,onEscapeKeyDown:W,onShow:Z,onHide:M,container:ee,autoFocus:$=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:H,onExit:A,onExiting:oe,onEnter:D,onEntering:_,onExited:q,backdropClassName:K,manager:z,...re},R)=>{const[N,x]=a.useState({}),[ae,G]=a.useState(!1),y=a.useRef(!1),T=a.useRef(!1),g=a.useRef(null),[j,F]=t.useCallbackRef(),ie=t.useMergedRefs(R,F),V=t.useEventCallback(M),le=t.useIsRTL();s=t.useBootstrapPrefix(s,"modal");const I=a.useMemo(()=>({onHide:V}),[V]);function k(){return z||Qe({isRTL:le})}function X(l){if(!t.canUseDOM)return;const B=k().getScrollbarWidth()>0,pe=l.scrollHeight>t.ownerDocument(l).documentElement.clientHeight;x({paddingRight:B&&!pe?he():void 0,paddingLeft:!B&&pe?he():void 0})}const S=t.useEventCallback(()=>{j&&X(j.dialog)});t.useWillUnmount(()=>{t.removeEventListener(window,"resize",S),g.current==null||g.current()});const P=()=>{y.current=!0},O=l=>{y.current&&j&&l.target===j.dialog&&(T.current=!0),y.current=!1},d=()=>{G(!0),g.current=t.transitionEnd(j.dialog,()=>{G(!1)})},Y=l=>{l.target===l.currentTarget&&d()},U=l=>{if(w==="static"){Y(l);return}if(T.current||l.target!==l.currentTarget){T.current=!1;return}M==null||M()},ke=l=>{Q?W==null||W(l):(l.preventDefault(),w==="static"&&d())},Se=(l,B)=>{l&&X(l),D==null||D(l,B)},Oe=l=>{g.current==null||g.current(),A==null||A(l)},Be=(l,B)=>{_==null||_(l,B),t.addEventListener(window,"resize",S)},Le=l=>{l&&(l.style.display=""),q==null||q(l),t.removeEventListener(window,"resize",S)},Ae=a.useCallback(l=>t.jsxRuntimeExports.jsx("div",{...l,className:t.classNames(`${s}-backdrop`,K,!C&&"show")}),[C,K,s]),xe={...n,...N};xe.display="block";const De=l=>t.jsxRuntimeExports.jsx("div",{role:"dialog",...l,style:xe,className:t.classNames(e,s,ae&&`${s}-static`,!C&&"show"),onClick:w?U:void 0,onMouseUp:O,"data-bs-theme":c,"aria-label":m,"aria-labelledby":f,"aria-describedby":p,children:t.jsxRuntimeExports.jsx(u,{...re,onMouseDown:P,className:o,contentClassName:r,children:i})});return t.jsxRuntimeExports.jsx(Ce.Provider,{value:I,children:t.jsxRuntimeExports.jsx(Ve,{show:E,ref:ie,backdrop:w,container:ee,keyboard:!0,autoFocus:$,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:ke,onShow:Z,onHide:M,onEnter:Se,onEntering:Be,onEntered:H,onExit:Oe,onExiting:oe,onExited:Le,manager:k(),transition:C?it:void 0,backdropTransition:C?lt:void 0,renderBackdrop:Ae,renderDialog:De})})});Te.displayName="Modal";const b=Object.assign(Te,{Body:Ze,Header:ot,Title:at,Footer:tt,Dialog:be,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),ct=()=>{const{confirmTexts:s}=a.useContext(t.LuminusComponentsContext),{isShown:e,text:n,onFinish:o}=ve.usePrompt(),[r,i]=a.useState(""),u=a.useCallback(()=>{o(null)},[o]),c=a.useCallback(()=>{o(r)},[o,r]);return a.useEffect(()=>{e===!0&&i("")},[e]),t.jsxRuntimeExports.jsxs(b,{show:e,size:"sm",centered:!0,onHide:u,children:[t.jsxRuntimeExports.jsx(b.Header,{children:t.jsxRuntimeExports.jsx(b.Title,{children:n})}),t.jsxRuntimeExports.jsx(b.Body,{children:t.jsxRuntimeExports.jsx("textarea",{autoFocus:!0,tabIndex:0,value:r,onChange:f=>i(f.currentTarget.value),className:"w-100",rows:5})}),t.jsxRuntimeExports.jsxs(b.Footer,{children:[t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary",onClick:u,children:s.cancel}),t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary ml",onClick:c,children:s.confirm})]})]})},ut=({children:s})=>{const[e,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useRef(()=>{}),u=a.useCallback(p=>{r(p),n(!0),console.log("showprompt")},[]),c=a.useCallback(()=>{n(!1)},[]),f=a.useMemo(()=>({isShown:e,text:o,showPrompt:u,hidePrompt:c,resolveRef:i}),[c,e,u,o,i]);return t.jsxRuntimeExports.jsxs(t.PromptContext.Provider,{value:f,children:[s,t.jsxRuntimeExports.jsx(ct,{})]})},dt=({children:s})=>{const[e,n]=a.useState(!1),[o,r]=a.useState(""),i=a.useCallback(f=>{n(!0),r(f)},[]),u=a.useCallback(()=>{n(!1)},[]),c=a.useMemo(()=>({show:e,text:o,showConfirm:i,hideConfirm:u}),[e,o,i,u]);return t.jsxRuntimeExports.jsxs(t.ConfirmContext.Provider,{value:c,children:[t.jsxRuntimeExports.jsx(pt,{}),s]})},mt=({cookieDomain:s,axiosInstance:e,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p,children:m})=>{const E=a.useMemo(()=>({axiosInstance:e,cookieDomain:s,LinkComponent:n,language:o,axiosTexts:r,confirmTexts:i,formValidationTexts:u,homeDashboardTexts:c,formSubmitTexts:f,appSearchTexts:p}),[e,s,n,o,r,i,u,c,f,p]);return t.jsxRuntimeExports.jsx(t.LuminusComponentsContext.Provider,{value:E,children:t.jsxRuntimeExports.jsx(dt,{children:t.jsxRuntimeExports.jsxs(ut,{children:[t.jsxRuntimeExports.jsx(t.Ie,{}),m]})})})},ft=({children:s})=>{const[e,n]=a.useState(!1),[o]=a.useState(new Set),r=a.useCallback(c=>{o.add(c),n(!0)},[o]),i=a.useCallback(c=>{o.delete(c),o.size===0&&n(!1)},[o]),u=a.useMemo(()=>({isLoading:e,startLoading:r,stopLoading:i}),[e,r,i]);return t.jsxRuntimeExports.jsxs(t.LoadingContext.Provider,{value:u,children:[e&&t.jsxRuntimeExports.jsx(v.Loading,{}),s]})},xt=({children:s})=>{const e=t.useAxios(),n=a.useCallback(()=>{const m=localStorage.getItem("user")??null;return m?JSON.parse(m):null},[]),[o,r]=a.useState(n()),i=a.useCallback(async()=>{let m=null;return await e.get("/user/detail").then(E=>{m=E.data}).catch(()=>{m=null}),localStorage.setItem("user",JSON.stringify(m)),m},[e]),u=a.useCallback(()=>{localStorage.removeItem("user")},[]),c=a.useCallback(async()=>{const m=await i();return m?(r(m),!0):!1},[i]),f=a.useCallback(()=>{u(),r(null)},[u]),p=a.useMemo(()=>({user:o,loginUser:c,logoutUser:f}),[o,c,f]);return a.useEffect(()=>{r(n())},[n]),t.jsxRuntimeExports.jsx(t.UserContext.Provider,{value:p,children:s})},pt=()=>{const{confirmTexts:s}=a.useContext(t.LuminusComponentsContext),{onConfirm:e,onCancel:n,text:o,show:r}=ve.useConfirm();return t.jsxRuntimeExports.jsx(b,{show:r,size:"sm",centered:!0,onHide:n,children:t.jsxRuntimeExports.jsxs(b.Body,{children:[t.jsxRuntimeExports.jsx("div",{className:"mb-5 text-center",children:t.jsxRuntimeExports.jsx(Fe.Typography,{variant:"h6",children:o})}),t.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-secondary w-100",onClick:n,children:s.no}),t.jsxRuntimeExports.jsx("button",{type:"button",className:"btn btn-primary w-100 ml",onClick:e,children:s.yes})]})]})})};exports.LoadingContext=t.LoadingContext;exports.LuminusComponentsContext=t.LuminusComponentsContext;exports.UserContext=t.UserContext;exports.LoadingProvider=ft;exports.LuminusComponentsProvider=mt;exports.UserProvider=xt;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as r, c as x, e as ve, f as Ce, o as Fe, s as G, g as Ie, h as tt, i as nt, k as b, l as Re, m as ke, n as De, p as ot, r as Oe, q as st, t as $, v as rt, w as at, x as it, y as Se, F as $e, z as lt, A as dt, L as Ee, P as ct, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-
|
|
1
|
+
import { j as r, c as x, e as ve, f as Ce, o as Fe, s as G, g as Ie, h as tt, i as nt, k as b, l as Re, m as ke, n as De, p as ot, r as Oe, q as st, t as $, v as rt, w as at, x as it, y as Se, F as $e, z as lt, A as dt, L as Ee, P as ct, C as ut, I as ft, B as ht, b as mt, U as gt } from "./UserAvatarToggle-DgGJIRzY.js";
|
|
2
2
|
import * as v from "react";
|
|
3
3
|
import { forwardRef as pt, useState as p, useRef as M, useImperativeHandle as vt, useEffect as re, useCallback as m, useContext as be, useMemo as W } from "react";
|
|
4
|
-
import { a as yt, u as xt } from "./useConfirm-
|
|
5
|
-
import { T as wt } from "./Typography-
|
|
6
|
-
import { d as Ct, u as Et, q as I, L as bt } from "./DataKey-
|
|
4
|
+
import { a as yt, u as xt } from "./useConfirm-ClKBi_ok.js";
|
|
5
|
+
import { T as wt } from "./Typography-dPh0BYIU.js";
|
|
6
|
+
import { d as Ct, u as Et, q as I, L as bt } from "./DataKey-DEvxfpG4.js";
|
|
7
7
|
import Mt from "react-dom";
|
|
8
8
|
const Tt = (t) => /* @__PURE__ */ v.forwardRef((e, n) => /* @__PURE__ */ r.jsx("div", {
|
|
9
9
|
...e,
|
|
@@ -2,6 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
type CustomTypeProps = {
|
|
3
3
|
useCoerce?: boolean;
|
|
4
4
|
};
|
|
5
|
+
type NumberTypeProps = CustomTypeProps & {
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
};
|
|
5
9
|
type ZFileProps = {
|
|
6
10
|
required: boolean;
|
|
7
11
|
multiple: boolean;
|
|
@@ -10,8 +14,8 @@ type ZFileProps = {
|
|
|
10
14
|
declare const useZodSchemaTypes: () => {
|
|
11
15
|
zString: (props?: CustomTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>, string | null, string | null | undefined>;
|
|
12
16
|
zStringRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodString, string, string>;
|
|
13
|
-
zNumber: (props?:
|
|
14
|
-
zNumberRequired: (props?:
|
|
17
|
+
zNumber: (props?: NumberTypeProps) => z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, number, number>>>, number | null, number | null | undefined>;
|
|
18
|
+
zNumberRequired: (props?: NumberTypeProps) => z.ZodEffects<z.ZodNumber, number, number>;
|
|
15
19
|
zBool: (props?: CustomTypeProps) => z.ZodEffects<z.ZodBoolean, boolean, boolean>;
|
|
16
20
|
zDate: (props?: CustomTypeProps) => z.ZodEffects<z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>, string | null, string | null>;
|
|
17
21
|
zDateRequired: (props?: CustomTypeProps) => z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("./UserAvatarToggle-B7PDqhFk.cjs"),Ne=require("./useConfirm-DtEg0CeZ.cjs"),Le=require("react"),De=require("./textUtils-CHVVh2oi.cjs"),Ue=require("./utils.cjs.js"),qe=require("./useClickOutside-DsVG12Cs.cjs");var g;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var ke;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ke||(ke={}));const u=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return u.undefined;case"string":return u.string;case"number":return isNaN(r)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(r)?u.array:r===null?u.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?u.promise:typeof Map<"u"&&r instanceof Map?u.map:typeof Set<"u"&&r instanceof Set?u.set:typeof Date<"u"&&r instanceof Date?u.date:u.object;default:return u.unknown}},c=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Be=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class E extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,f=0;for(;f<i.path.length;){const d=i.path[f];f===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],f++}}};return n(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,g.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}E.create=r=>new E(r);const G=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===u.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,g.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:g.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(r)}return{message:t}};let Ee=G;function We(r){Ee=r}function le(){return Ee}const fe=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};let o="";const f=s.filter(d=>!!d).slice().reverse();for(const d of f)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:n.message||o}},Je=[];function l(r,e){const t=fe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,le(),G].filter(s=>!!s)});r.common.issues.push(t)}class Z{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t)s.push({key:await n.key,value:await n.value});return Z.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const m=Object.freeze({status:"aborted"}),Ie=r=>({status:"dirty",value:r}),S=r=>({status:"valid",value:r}),we=r=>r.status==="aborted",Te=r=>r.status==="dirty",X=r=>r.status==="valid",he=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class j{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ce=(r,e)=>{if(X(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new E(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:s??o.defaultError}:{message:t??o.defaultError},description:n}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Z,ctx:{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(he(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Ce(n,a)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(he(n)?n:Promise.resolve(n));return Ce(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new R({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return M.create(this,this._def)}nullable(){return B.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this,this._def)}promise(){return H.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new R({...y(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new je({typeName:p.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ve({...y(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ce.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ye=/^c[^\s-]{8,}$/i,He=/^[a-z][a-z0-9]*$/,Ge=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qe=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let be;const Fe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,et=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tt=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function rt(r,e){return!!((e==="v4"||!e)&&Fe.test(r)||(e==="v6"||!e)&&et.test(r))}class N extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),m}const s=new Z;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Qe.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")be||(be=new RegExp(Ke,"u")),be.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")Xe.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")Ye.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")He.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")Ge.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?tt(a).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="ip"?rt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):g.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...h.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new N({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}N.create=r=>{var e;return new N({checks:[],typeName:p.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function st(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class V extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),m}let s;const n=new Z;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?st(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}V.create=r=>new V({checks:[],typeName:p.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class $ extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==u.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.bigint,received:a.parsedType}),m}let s;const n=new Z;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}$.create=r=>{var e;return new $({checks:[],typeName:p.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};class Q extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.boolean,received:s.parsedType}),m}return S(e.data)}}Q.create=r=>new Q({typeName:p.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class U extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),m}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),m}const s=new Z;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):g.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}U.create=r=>new U({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:p.ZodDate,...y(r)});class pe extends v{_parse(e){if(this._getType(e)!==u.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.symbol,received:s.parsedType}),m}return S(e.data)}}pe.create=r=>new pe({typeName:p.ZodSymbol,...y(r)});class K extends v{_parse(e){if(this._getType(e)!==u.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.undefined,received:s.parsedType}),m}return S(e.data)}}K.create=r=>new K({typeName:p.ZodUndefined,...y(r)});class F extends v{_parse(e){if(this._getType(e)!==u.null){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.null,received:s.parsedType}),m}return S(e.data)}}F.create=r=>new F({typeName:p.ZodNull,...y(r)});class Y extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}Y.create=r=>new Y({typeName:p.ZodAny,...y(r)});class D extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}D.create=r=>new D({typeName:p.ZodUnknown,...y(r)});class P extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:u.never,received:t.parsedType}),m}}P.create=r=>new P({typeName:p.ZodNever,...y(r)});class me extends v{_parse(e){if(this._getType(e)!==u.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.void,received:s.parsedType}),m}return S(e.data)}}me.create=r=>new me({typeName:p.ZodVoid,...y(r)});class I extends v{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return l(t,{code:c.invalid_type,expected:u.array,received:t.parsedType}),m;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new j(t,i,t.path,o)))).then(i=>Z.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new j(t,i,t.path,o)));return Z.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}I.create=(r,e)=>new I({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...y(e)});function W(r){if(r instanceof b){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=M.create(W(s))}return new b({...r._def,shape:()=>e})}else return r instanceof I?new I({...r._def,type:W(r.element)}):r instanceof M?M.create(W(r.unwrap())):r instanceof B?B.create(W(r.unwrap())):r instanceof A?A.create(r.items.map(e=>W(e))):r}class b extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.object){const d=this._getOrReturnCtx(e);return l(d,{code:c.invalid_type,expected:u.object,received:d.parsedType}),m}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const f=[];for(const d of i){const _=a[d],O=n.data[d];f.push({key:{status:"valid",value:d},value:_._parse(new j(n,O,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof P){const d=this._def.unknownKeys;if(d==="passthrough")for(const _ of o)f.push({key:{status:"valid",value:_},value:{status:"valid",value:n.data[_]}});else if(d==="strict")o.length>0&&(l(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const _ of o){const O=n.data[_];f.push({key:{status:"valid",value:_},value:d._parse(new j(n,O,n.path,_)),alwaysSet:_ in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const _ of f){const O=await _.key;d.push({key:O,value:await _.value,alwaysSet:_.alwaysSet})}return d}).then(d=>Z.mergeObjectSync(s,d)):Z.mergeObjectSync(s,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const f=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:f}:{message:f}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new b({...this._def,catchall:e})}pick(e){const t={};return g.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return g.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new b({...this._def,shape:()=>t})}deepPartial(){return W(this)}partial(e){const t={};return g.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return g.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof M;)a=a._def.innerType;t[s]=a}}),new b({...this._def,shape:()=>t})}keyof(){return Re(g.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:P.create(),typeName:p.ZodObject,...y(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:P.create(),typeName:p.ZodObject,...y(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:P.create(),typeName:p.ZodObject,...y(e)});class ee extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new E(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const f of s){const d={...t,common:{...t.common,issues:[]},parent:null},_=f._parseSync({data:t.data,path:t.path,parent:d});if(_.status==="valid")return _;_.status==="dirty"&&!a&&(a={result:_,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new E(f));return l(t,{code:c.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ee.create=(r,e)=>new ee({options:r,typeName:p.ZodUnion,...y(e)});const ue=r=>r instanceof se?ue(r.schema):r instanceof R?ue(r.innerType()):r instanceof ne?[r.value]:r instanceof L?r.options:r instanceof ae?Object.keys(r.enum):r instanceof ie?ue(r._def.innerType):r instanceof K?[void 0]:r instanceof F?[null]:null;class xe extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return l(t,{code:c.invalid_type,expected:u.object,received:t.parsedType}),m;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=ue(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new xe({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}}function Ze(r,e){const t=z(r),s=z(e);if(r===e)return{valid:!0,data:r};if(t===u.object&&s===u.object){const n=g.objectKeys(e),a=g.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const f=Ze(r[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&s===u.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],f=Ze(i,o);if(!f.valid)return{valid:!1};n.push(f.data)}return{valid:!0,data:n}}else return t===u.date&&s===u.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class te extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(we(a)||we(i))return m;const o=Ze(a.value,i.value);return o.valid?((Te(a)||Te(i))&&t.dirty(),{status:t.value,value:o.data}):(l(s,{code:c.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}te.create=(r,e,t)=>new te({left:r,right:e,typeName:p.ZodIntersection,...y(t)});class A extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.array)return l(s,{code:c.invalid_type,expected:u.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return l(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new j(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>Z.mergeArray(t,i)):Z.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}}A.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new A({items:r,typeName:p.ZodTuple,rest:null,...y(e)})};class re extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.object)return l(s,{code:c.invalid_type,expected:u.object,received:s.parsedType}),m;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new j(s,o,s.path,o)),value:i._parse(new j(s,s.data[o],s.path,o))});return s.common.async?Z.mergeObjectAsync(t,n):Z.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new re({keyType:e,valueType:t,typeName:p.ZodRecord,...y(s)}):new re({keyType:N.create(),valueType:e,typeName:p.ZodRecord,...y(t)})}}class ye extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.map)return l(s,{code:c.invalid_type,expected:u.map,received:s.parsedType}),m;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,f],d)=>({key:n._parse(new j(s,o,s.path,[d,"key"])),value:a._parse(new j(s,f,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const d=await f.key,_=await f.value;if(d.status==="aborted"||_.status==="aborted")return m;(d.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(d.value,_.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const d=f.key,_=f.value;if(d.status==="aborted"||_.status==="aborted")return m;(d.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(d.value,_.value)}return{status:t.value,value:o}}}}ye.create=(r,e,t)=>new ye({valueType:e,keyType:r,typeName:p.ZodMap,...y(t)});class q extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==u.set)return l(s,{code:c.invalid_type,expected:u.set,received:s.parsedType}),m;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(l(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(l(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const d=new Set;for(const _ of f){if(_.status==="aborted")return m;_.status==="dirty"&&t.dirty(),d.add(_.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((f,d)=>a._parse(new j(s,f,s.path,d)));return s.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new q({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new q({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}q.create=(r,e)=>new q({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...y(e)});class J extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return l(t,{code:c.invalid_type,expected:u.function,received:t.parsedType}),m;function s(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),G].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:f}})}function n(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),G].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof H){const o=this;return S(async function(...f){const d=new E([]),_=await o._def.args.parseAsync(f,a).catch(de=>{throw d.addIssue(s(f,de)),d}),O=await Reflect.apply(i,this,_);return await o._def.returns._def.type.parseAsync(O,a).catch(de=>{throw d.addIssue(n(O,de)),d})})}else{const o=this;return S(function(...f){const d=o._def.args.safeParse(f,a);if(!d.success)throw new E([s(f,d.error)]);const _=Reflect.apply(i,this,d.data),O=o._def.returns.safeParse(_,a);if(!O.success)throw new E([n(_,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new J({...this._def,args:A.create(e).rest(D.create())})}returns(e){return new J({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new J({args:e||A.create([]).rest(D.create()),returns:t||D.create(),typeName:p.ZodFunction,...y(s)})}}class se extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}se.create=(r,e)=>new se({getter:r,typeName:p.ZodLazy,...y(e)});class ne extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}ne.create=(r,e)=>new ne({value:r,typeName:p.ZodLiteral,...y(e)});function Re(r,e){return new L({values:r,typeName:p.ZodEnum,...y(e)})}class L extends v{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{expected:g.joinValues(s),received:t.parsedType,code:c.invalid_type}),m}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),s=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:s}),m}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return L.create(e)}exclude(e){return L.create(this.options.filter(t=>!e.includes(t)))}}L.create=Re;class ae extends v{_parse(e){const t=g.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==u.string&&s.parsedType!==u.number){const n=g.objectValues(t);return l(s,{expected:g.joinValues(n),received:s.parsedType,code:c.invalid_type}),m}if(t.indexOf(e.data)===-1){const n=g.objectValues(t);return l(s,{received:s.data,code:c.invalid_enum_value,options:n}),m}return S(e.data)}get enum(){return this._def.values}}ae.create=(r,e)=>new ae({values:r,typeName:p.ZodNativeEnum,...y(e)});class H extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:u.promise,received:t.parsedType}),m;const s=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return S(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}H.create=(r,e)=>new H({type:r,typeName:p.ZodPromise,...y(e)});class R extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:s.path,parent:s})):this._def.schema._parseSync({data:i,path:s.path,parent:s})}if(n.type==="refinement"){const i=o=>{const f=n.refinement(o,a);if(s.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!X(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>X(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}R.create=(r,e,t)=>new R({schema:r,typeName:p.ZodEffects,effect:e,...y(t)});R.createWithPreprocess=(r,e,t)=>new R({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...y(t)});class M extends v{_parse(e){return this._getType(e)===u.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(r,e)=>new M({innerType:r,typeName:p.ZodOptional,...y(e)});class B extends v{_parse(e){return this._getType(e)===u.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}B.create=(r,e)=>new B({innerType:r,typeName:p.ZodNullable,...y(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===u.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ie.create=(r,e)=>new ie({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ve extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return he(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new E(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new E(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ve.create=(r,e)=>new ve({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class _e extends v{_parse(e){if(this._getType(e)!==u.nan){const s=this._getOrReturnCtx(e);return l(s,{code:c.invalid_type,expected:u.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}}_e.create=r=>new _e({typeName:p.ZodNaN,...y(r)});const nt=Symbol("zod_brand");class je extends v{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ce extends v{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),Ie(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ce({in:e,out:t,typeName:p.ZodPipeline})}}class ge extends v{_parse(e){const t=this._def.innerType._parse(e);return X(t)&&(t.value=Object.freeze(t.value)),t}}ge.create=(r,e)=>new ge({innerType:r,typeName:p.ZodReadonly,...y(e)});const Ae=(r,e={},t)=>r?Y.create().superRefine((s,n)=>{var a,i;if(!r(s)){const o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,f=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...d,fatal:f})}}):Y.create(),at={object:b.lazycreate};var p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));const it=(r,e={message:`Input not instance of ${r.name}`})=>Ae(t=>t instanceof r,e),Me=N.create,Pe=V.create,ot=_e.create,ct=$.create,ze=Q.create,dt=U.create,ut=pe.create,lt=K.create,ft=F.create,ht=Y.create,pt=D.create,mt=P.create,yt=me.create,vt=I.create,_t=b.create,gt=b.strictCreate,xt=ee.create,bt=xe.create,kt=te.create,wt=A.create,Tt=re.create,Zt=ye.create,St=q.create,Ct=J.create,Ot=se.create,Nt=ne.create,Et=L.create,It=ae.create,Rt=H.create,Oe=R.create,jt=M.create,At=B.create,Mt=R.createWithPreprocess,Pt=ce.create,zt=()=>Me().optional(),Vt=()=>Pe().optional(),$t=()=>ze().optional(),Lt={string:r=>N.create({...r,coerce:!0}),number:r=>V.create({...r,coerce:!0}),boolean:r=>Q.create({...r,coerce:!0}),bigint:r=>$.create({...r,coerce:!0}),date:r=>U.create({...r,coerce:!0})},Dt=m;var C=Object.freeze({__proto__:null,defaultErrorMap:G,setErrorMap:We,getErrorMap:le,makeIssue:fe,EMPTY_PATH:Je,addIssueToContext:l,ParseStatus:Z,INVALID:m,DIRTY:Ie,OK:S,isAborted:we,isDirty:Te,isValid:X,isAsync:he,get util(){return g},get objectUtil(){return ke},ZodParsedType:u,getParsedType:z,ZodType:v,ZodString:N,ZodNumber:V,ZodBigInt:$,ZodBoolean:Q,ZodDate:U,ZodSymbol:pe,ZodUndefined:K,ZodNull:F,ZodAny:Y,ZodUnknown:D,ZodNever:P,ZodVoid:me,ZodArray:I,ZodObject:b,ZodUnion:ee,ZodDiscriminatedUnion:xe,ZodIntersection:te,ZodTuple:A,ZodRecord:re,ZodMap:ye,ZodSet:q,ZodFunction:J,ZodLazy:se,ZodLiteral:ne,ZodEnum:L,ZodNativeEnum:ae,ZodPromise:H,ZodEffects:R,ZodTransformer:R,ZodOptional:M,ZodNullable:B,ZodDefault:ie,ZodCatch:ve,ZodNaN:_e,BRAND:nt,ZodBranded:je,ZodPipeline:ce,ZodReadonly:ge,custom:Ae,Schema:v,ZodSchema:v,late:at,get ZodFirstPartyTypeKind(){return p},coerce:Lt,any:ht,array:vt,bigint:ct,boolean:ze,date:dt,discriminatedUnion:bt,effect:Oe,enum:Et,function:Ct,instanceof:it,intersection:kt,lazy:Ot,literal:Nt,map:Zt,nan:ot,nativeEnum:It,never:mt,null:ft,nullable:At,number:Pe,object:_t,oboolean:$t,onumber:Vt,optional:jt,ostring:zt,pipeline:Pt,preprocess:Mt,promise:Rt,record:Tt,set:St,strictObject:gt,string:Me,symbol:ut,transformer:Oe,tuple:wt,undefined:lt,union:xt,unknown:pt,void:yt,NEVER:Dt,ZodIssueCode:c,quotelessJson:Be,ZodError:E});const Ut=()=>{const{formValidationTexts:r}=Le.useContext(oe.LuminusComponentsContext),e=x=>(x!=null&&x.useCoerce?C.coerce:C).string({invalid_type_error:r.required}).transform(w=>w??null),t=x=>e(x).nullable().optional().transform(k=>k??null),s=x=>(x!=null&&x.useCoerce?C.coerce:C).number({invalid_type_error:r.required}).transform(w=>w??null),n=x=>s(x).nullable().optional().transform(k=>k??null),a=x=>(x!=null&&x.useCoerce?C.coerce:C).boolean({invalid_type_error:r.required}).transform(k=>k??null),i=x=>(x!=null&&x.useCoerce?C.coerce:C).string({invalid_type_error:r.required}).refine(Ue.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=x=>i(x).nullable().transform(k=>k??null),f=(x,k)=>C.enum(x,{invalid_type_error:r.required}).transform(Se=>Se??null);return{zString:t,zStringRequired:e,zNumber:n,zNumberRequired:s,zBool:a,zDate:o,zDateRequired:i,zEnum:(x,k)=>f(x).nullable().transform(w=>w??null),zEnumRequired:f,zObjectIdInt:x=>C.object({id:n({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:x=>C.object({id:s()}).transform(w=>w??null),zObjectIdStr:x=>C.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:x=>C.object({id:e()}).transform(w=>w??null),zFile:({required:x,multiple:k,maxFileSize:w})=>C.any().transform(T=>Array.from(T??[])).refine(T=>!x||(T==null?void 0:T.length)>0,"File is required.").refine(T=>k||(T==null?void 0:T.length)<=1,"Multiple files not allowed.").refine(T=>T.every($e=>$e.size<=w),`Maximum file size is ${De.formatFileSize(w)}.`).transform(T=>(k?T:T==null?void 0:T[0])??null)}};exports.cancelToken=oe.cancelToken;exports.useAuth=oe.useAuth;exports.useAxios=oe.useAxios;exports.useNotifications=oe.useNotifications;exports.useConfirm=Ne.useConfirm;exports.usePrompt=Ne.usePrompt;exports.useClickOutside=qe.useClickOutside;exports.useZodSchemaTypes=Ut;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("./UserAvatarToggle-D8sQZp-d.cjs"),Oe=require("./useConfirm-Bm2_Ub3h.cjs"),Le=require("react"),De=require("./textUtils-CHVVh2oi.cjs"),Ue=require("./utils.cjs.js"),qe=require("./useClickOutside-DsVG12Cs.cjs");var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var ke;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ke||(ke={}));const u=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=r=>{switch(typeof r){case"undefined":return u.undefined;case"string":return u.string;case"number":return isNaN(r)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(r)?u.array:r===null?u.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?u.promise:typeof Map<"u"&&r instanceof Map?u.map:typeof Set<"u"&&r instanceof Set?u.set:typeof Date<"u"&&r instanceof Date?u.date:u.object;default:return u.unknown}},c=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Be=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class I extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,f=0;for(;f<i.path.length;){const d=i.path[f];f===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],f++}}};return s(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}I.create=r=>new I(r);const H=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===u.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let Ie=H;function We(r){Ie=r}function le(){return Ie}const fe=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};let o="";const f=n.filter(d=>!!d).slice().reverse();for(const d of f)o=d(i,{data:e,defaultError:o}).message;return{...s,path:a,message:s.message||o}},Ye=[];function l(r,e){const t=fe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,le(),H].filter(n=>!!n)});r.common.issues.push(t)}class Z{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return p;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t)n.push({key:await s.key,value:await s.value});return Z.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const p=Object.freeze({status:"aborted"}),Ee=r=>({status:"dirty",value:r}),S=r=>({status:"valid",value:r}),we=r=>r.status==="aborted",Te=r=>r.status==="dirty",X=r=>r.status==="valid",he=r=>typeof Promise<"u"&&r instanceof Promise;var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));class j{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ne=(r,e)=>{if(X(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new I(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:t??o.defaultError},description:s}}class v{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Z,ctx:{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(he(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Ne(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(he(s)?s:Promise.resolve(s));return Ne(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new R({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return M.create(this,this._def)}nullable(){return B.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this,this._def)}promise(){return G.create(this,this._def)}or(e){return ee.create([this,e],this._def)}and(e){return te.create(this,e,this._def)}transform(e){return new R({...y(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ie({...y(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new je({typeName:m.ZodBranded,type:this,...y(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ve({...y(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ce.create(this,e)}readonly(){return ge.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Je=/^c[^\s-]{8,}$/i,Ge=/^[a-z][a-z0-9]*$/,He=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Qe=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ke="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let be;const Fe=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,et=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tt=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function rt(r,e){return!!((e==="v4"||!e)&&Fe.test(r)||(e==="v6"||!e)&&et.test(r))}class O extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.string,received:a.parsedType}),p}const n=new Z;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Qe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")be||(be=new RegExp(Ke,"u")),be.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Xe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Je.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ge.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")He.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?tt(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="ip"?rt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...h.errToObj(n)})}_addCheck(e){return new O({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,...h.errToObj(e==null?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new O({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}O.create=r=>{var e;return new O({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function nt(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class V extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.number,received:a.parsedType}),p}let n;const s=new Z;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?nt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,n,s){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}V.create=r=>new V({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class $ extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==u.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.bigint,received:a.parsedType}),p}let n;const s=new Z;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,n,s){return new $({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:h.toString(s)}]})}_addCheck(e){return new $({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}$.create=r=>{var e;return new $({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...y(r)})};class Q extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.boolean,received:n.parsedType}),p}return S(e.data)}}Q.create=r=>new Q({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...y(r)});class U extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:u.date,received:a.parsedType}),p}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),p}const n=new Z;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new U({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}U.create=r=>new U({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,...y(r)});class me extends v{_parse(e){if(this._getType(e)!==u.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.symbol,received:n.parsedType}),p}return S(e.data)}}me.create=r=>new me({typeName:m.ZodSymbol,...y(r)});class K extends v{_parse(e){if(this._getType(e)!==u.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.undefined,received:n.parsedType}),p}return S(e.data)}}K.create=r=>new K({typeName:m.ZodUndefined,...y(r)});class F extends v{_parse(e){if(this._getType(e)!==u.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.null,received:n.parsedType}),p}return S(e.data)}}F.create=r=>new F({typeName:m.ZodNull,...y(r)});class J extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}J.create=r=>new J({typeName:m.ZodAny,...y(r)});class D extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}D.create=r=>new D({typeName:m.ZodUnknown,...y(r)});class P extends v{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:u.never,received:t.parsedType}),p}}P.create=r=>new P({typeName:m.ZodNever,...y(r)});class pe extends v{_parse(e){if(this._getType(e)!==u.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.void,received:n.parsedType}),p}return S(e.data)}}pe.create=r=>new pe({typeName:m.ZodVoid,...y(r)});class E extends v{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==u.array)return l(t,{code:c.invalid_type,expected:u.array,received:t.parsedType}),p;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new j(t,i,t.path,o)))).then(i=>Z.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new j(t,i,t.path,o)));return Z.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new E({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new E({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new E({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}E.create=(r,e)=>new E({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...y(e)});function W(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=M.create(W(n))}return new b({...r._def,shape:()=>e})}else return r instanceof E?new E({...r._def,type:W(r.element)}):r instanceof M?M.create(W(r.unwrap())):r instanceof B?B.create(W(r.unwrap())):r instanceof A?A.create(r.items.map(e=>W(e))):r}class b extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==u.object){const d=this._getOrReturnCtx(e);return l(d,{code:c.invalid_type,expected:u.object,received:d.parsedType}),p}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof P&&this._def.unknownKeys==="strip"))for(const d in s.data)i.includes(d)||o.push(d);const f=[];for(const d of i){const _=a[d],C=s.data[d];f.push({key:{status:"valid",value:d},value:_._parse(new j(s,C,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof P){const d=this._def.unknownKeys;if(d==="passthrough")for(const _ of o)f.push({key:{status:"valid",value:_},value:{status:"valid",value:s.data[_]}});else if(d==="strict")o.length>0&&(l(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const _ of o){const C=s.data[_];f.push({key:{status:"valid",value:_},value:d._parse(new j(s,C,s.path,_)),alwaysSet:_ in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const _ of f){const C=await _.key;d.push({key:C,value:await _.value,alwaysSet:_.alwaysSet})}return d}).then(d=>Z.mergeObjectSync(n,d)):Z.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,i,o;const f=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&i!==void 0?i:n.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:f}:{message:f}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new b({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}deepPartial(){return W(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof M;)a=a._def.innerType;t[n]=a}}),new b({...this._def,shape:()=>t})}keyof(){return Re(x.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:P.create(),typeName:m.ZodObject,...y(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:P.create(),typeName:m.ZodObject,...y(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:P.create(),typeName:m.ZodObject,...y(e)});class ee extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new I(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const f of n){const d={...t,common:{...t.common,issues:[]},parent:null},_=f._parseSync({data:t.data,path:t.path,parent:d});if(_.status==="valid")return _;_.status==="dirty"&&!a&&(a={result:_,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new I(f));return l(t,{code:c.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}ee.create=(r,e)=>new ee({options:r,typeName:m.ZodUnion,...y(e)});const ue=r=>r instanceof ne?ue(r.schema):r instanceof R?ue(r.innerType()):r instanceof se?[r.value]:r instanceof L?r.options:r instanceof ae?Object.keys(r.enum):r instanceof ie?ue(r._def.innerType):r instanceof K?[void 0]:r instanceof F?[null]:null;class xe extends v{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.object)return l(t,{code:c.invalid_type,expected:u.object,received:t.parsedType}),p;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const i=ue(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new xe({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...y(n)})}}function Ze(r,e){const t=z(r),n=z(e);if(r===e)return{valid:!0,data:r};if(t===u.object&&n===u.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const f=Ze(r[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===u.array&&n===u.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],f=Ze(i,o);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return t===u.date&&n===u.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class te extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(we(a)||we(i))return p;const o=Ze(a.value,i.value);return o.valid?((Te(a)||Te(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:c.invalid_intersection_types}),p)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}te.create=(r,e,t)=>new te({left:r,right:e,typeName:m.ZodIntersection,...y(t)});class A extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.array)return l(n,{code:c.invalid_type,expected:u.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new j(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Z.mergeArray(t,i)):Z.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}}A.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new A({items:r,typeName:m.ZodTuple,rest:null,...y(e)})};class re extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.object)return l(n,{code:c.invalid_type,expected:u.object,received:n.parsedType}),p;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:a._parse(new j(n,o,n.path,o)),value:i._parse(new j(n,n.data[o],n.path,o))});return n.common.async?Z.mergeObjectAsync(t,s):Z.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof v?new re({keyType:e,valueType:t,typeName:m.ZodRecord,...y(n)}):new re({keyType:O.create(),valueType:e,typeName:m.ZodRecord,...y(t)})}}class ye extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.map)return l(n,{code:c.invalid_type,expected:u.map,received:n.parsedType}),p;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,f],d)=>({key:s._parse(new j(n,o,n.path,[d,"key"])),value:a._parse(new j(n,f,n.path,[d,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const d=await f.key,_=await f.value;if(d.status==="aborted"||_.status==="aborted")return p;(d.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(d.value,_.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const d=f.key,_=f.value;if(d.status==="aborted"||_.status==="aborted")return p;(d.status==="dirty"||_.status==="dirty")&&t.dirty(),o.set(d.value,_.value)}return{status:t.value,value:o}}}}ye.create=(r,e,t)=>new ye({valueType:e,keyType:r,typeName:m.ZodMap,...y(t)});class q extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==u.set)return l(n,{code:c.invalid_type,expected:u.set,received:n.parsedType}),p;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const d=new Set;for(const _ of f){if(_.status==="aborted")return p;_.status==="dirty"&&t.dirty(),d.add(_.value)}return{status:t.value,value:d}}const o=[...n.data.values()].map((f,d)=>a._parse(new j(n,f,n.path,d)));return n.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new q({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new q({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}q.create=(r,e)=>new q({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...y(e)});class Y extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.function)return l(t,{code:c.invalid_type,expected:u.function,received:t.parsedType}),p;function n(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),H].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:f}})}function s(o,f){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),H].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof G){const o=this;return S(async function(...f){const d=new I([]),_=await o._def.args.parseAsync(f,a).catch(de=>{throw d.addIssue(n(f,de)),d}),C=await Reflect.apply(i,this,_);return await o._def.returns._def.type.parseAsync(C,a).catch(de=>{throw d.addIssue(s(C,de)),d})})}else{const o=this;return S(function(...f){const d=o._def.args.safeParse(f,a);if(!d.success)throw new I([n(f,d.error)]);const _=Reflect.apply(i,this,d.data),C=o._def.returns.safeParse(_,a);if(!C.success)throw new I([s(_,C.error)]);return C.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Y({...this._def,args:A.create(e).rest(D.create())})}returns(e){return new Y({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Y({args:e||A.create([]).rest(D.create()),returns:t||D.create(),typeName:m.ZodFunction,...y(n)})}}class ne extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ne.create=(r,e)=>new ne({getter:r,typeName:m.ZodLazy,...y(e)});class se extends v{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(r,e)=>new se({value:r,typeName:m.ZodLiteral,...y(e)});function Re(r,e){return new L({values:r,typeName:m.ZodEnum,...y(e)})}class L extends v{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:c.invalid_type}),p}if(this._def.values.indexOf(e.data)===-1){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),p}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return L.create(e)}exclude(e){return L.create(this.options.filter(t=>!e.includes(t)))}}L.create=Re;class ae extends v{_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==u.string&&n.parsedType!==u.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:c.invalid_type}),p}if(t.indexOf(e.data)===-1){const s=x.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),p}return S(e.data)}get enum(){return this._def.values}}ae.create=(r,e)=>new ae({values:r,typeName:m.ZodNativeEnum,...y(e)});class G extends v{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:u.promise,received:t.parsedType}),p;const n=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return S(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}G.create=(r,e)=>new G({type:r,typeName:m.ZodPromise,...y(e)});class R extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}if(s.type==="refinement"){const i=o=>{const f=s.refinement(o,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!X(i))return i;const o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>X(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(s)}}R.create=(r,e,t)=>new R({schema:r,typeName:m.ZodEffects,effect:e,...y(t)});R.createWithPreprocess=(r,e,t)=>new R({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...y(t)});class M extends v{_parse(e){return this._getType(e)===u.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(r,e)=>new M({innerType:r,typeName:m.ZodOptional,...y(e)});class B extends v{_parse(e){return this._getType(e)===u.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}B.create=(r,e)=>new B({innerType:r,typeName:m.ZodNullable,...y(e)});class ie extends v{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===u.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ie.create=(r,e)=>new ie({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});class ve extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return he(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new I(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new I(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ve.create=(r,e)=>new ve({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});class _e extends v{_parse(e){if(this._getType(e)!==u.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:u.nan,received:n.parsedType}),p}return{status:"valid",value:e.data}}}_e.create=r=>new _e({typeName:m.ZodNaN,...y(r)});const st=Symbol("zod_brand");class je extends v{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ce extends v{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),Ee(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?p:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ce({in:e,out:t,typeName:m.ZodPipeline})}}class ge extends v{_parse(e){const t=this._def.innerType._parse(e);return X(t)&&(t.value=Object.freeze(t.value)),t}}ge.create=(r,e)=>new ge({innerType:r,typeName:m.ZodReadonly,...y(e)});const Ae=(r,e={},t)=>r?J.create().superRefine((n,s)=>{var a,i;if(!r(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,f=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...d,fatal:f})}}):J.create(),at={object:b.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const it=(r,e={message:`Input not instance of ${r.name}`})=>Ae(t=>t instanceof r,e),Me=O.create,Pe=V.create,ot=_e.create,ct=$.create,ze=Q.create,dt=U.create,ut=me.create,lt=K.create,ft=F.create,ht=J.create,mt=D.create,pt=P.create,yt=pe.create,vt=E.create,_t=b.create,gt=b.strictCreate,xt=ee.create,bt=xe.create,kt=te.create,wt=A.create,Tt=re.create,Zt=ye.create,St=q.create,Nt=Y.create,Ct=ne.create,Ot=se.create,It=L.create,Et=ae.create,Rt=G.create,Ce=R.create,jt=M.create,At=B.create,Mt=R.createWithPreprocess,Pt=ce.create,zt=()=>Me().optional(),Vt=()=>Pe().optional(),$t=()=>ze().optional(),Lt={string:r=>O.create({...r,coerce:!0}),number:r=>V.create({...r,coerce:!0}),boolean:r=>Q.create({...r,coerce:!0}),bigint:r=>$.create({...r,coerce:!0}),date:r=>U.create({...r,coerce:!0})},Dt=p;var N=Object.freeze({__proto__:null,defaultErrorMap:H,setErrorMap:We,getErrorMap:le,makeIssue:fe,EMPTY_PATH:Ye,addIssueToContext:l,ParseStatus:Z,INVALID:p,DIRTY:Ee,OK:S,isAborted:we,isDirty:Te,isValid:X,isAsync:he,get util(){return x},get objectUtil(){return ke},ZodParsedType:u,getParsedType:z,ZodType:v,ZodString:O,ZodNumber:V,ZodBigInt:$,ZodBoolean:Q,ZodDate:U,ZodSymbol:me,ZodUndefined:K,ZodNull:F,ZodAny:J,ZodUnknown:D,ZodNever:P,ZodVoid:pe,ZodArray:E,ZodObject:b,ZodUnion:ee,ZodDiscriminatedUnion:xe,ZodIntersection:te,ZodTuple:A,ZodRecord:re,ZodMap:ye,ZodSet:q,ZodFunction:Y,ZodLazy:ne,ZodLiteral:se,ZodEnum:L,ZodNativeEnum:ae,ZodPromise:G,ZodEffects:R,ZodTransformer:R,ZodOptional:M,ZodNullable:B,ZodDefault:ie,ZodCatch:ve,ZodNaN:_e,BRAND:st,ZodBranded:je,ZodPipeline:ce,ZodReadonly:ge,custom:Ae,Schema:v,ZodSchema:v,late:at,get ZodFirstPartyTypeKind(){return m},coerce:Lt,any:ht,array:vt,bigint:ct,boolean:ze,date:dt,discriminatedUnion:bt,effect:Ce,enum:It,function:Nt,instanceof:it,intersection:kt,lazy:Ct,literal:Ot,map:Zt,nan:ot,nativeEnum:Et,never:pt,null:ft,nullable:At,number:Pe,object:_t,oboolean:$t,onumber:Vt,optional:jt,ostring:zt,pipeline:Pt,preprocess:Mt,promise:Rt,record:Tt,set:St,strictObject:gt,string:Me,symbol:ut,transformer:Ce,tuple:wt,undefined:lt,union:xt,unknown:mt,void:yt,NEVER:Dt,ZodIssueCode:c,quotelessJson:Be,ZodError:I});const Ut=()=>{const{formValidationTexts:r}=Le.useContext(oe.LuminusComponentsContext),e=g=>(g!=null&&g.useCoerce?N.coerce:N).string({invalid_type_error:r.required}).transform(w=>w??null),t=g=>e(g).nullable().optional().transform(k=>k??null),n=g=>(g!=null&&g.useCoerce?N.coerce:N).number({invalid_type_error:r.required}).min((g==null?void 0:g.min)??Number.NEGATIVE_INFINITY).max((g==null?void 0:g.max)??Number.POSITIVE_INFINITY).transform(w=>w??null),s=g=>n(g).nullable().optional().transform(k=>k??null),a=g=>(g!=null&&g.useCoerce?N.coerce:N).boolean({invalid_type_error:r.required}).transform(k=>k??null),i=g=>(g!=null&&g.useCoerce?N.coerce:N).string({invalid_type_error:r.required}).refine(Ue.isISODate,{message:r.invalidDate}).transform(w=>w??null),o=g=>i(g).nullable().transform(k=>k??null),f=(g,k)=>N.enum(g,{invalid_type_error:r.required}).transform(Se=>Se??null);return{zString:t,zStringRequired:e,zNumber:s,zNumberRequired:n,zBool:a,zDate:o,zDateRequired:i,zEnum:(g,k)=>f(g).nullable().transform(w=>w??null),zEnumRequired:f,zObjectIdInt:g=>N.object({id:s({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdIntRequired:g=>N.object({id:n()}).transform(w=>w??null),zObjectIdStr:g=>N.object({id:t({useCoerce:!0})}).nullable().transform(w=>w??null),zObjectIdStrRequired:g=>N.object({id:e()}).transform(w=>w??null),zFile:({required:g,multiple:k,maxFileSize:w})=>N.any().transform(T=>Array.from(T??[])).refine(T=>!g||(T==null?void 0:T.length)>0,"File is required.").refine(T=>k||(T==null?void 0:T.length)<=1,"Multiple files not allowed.").refine(T=>T.every($e=>$e.size<=w),`Maximum file size is ${De.formatFileSize(w)}.`).transform(T=>(k?T:T==null?void 0:T[0])??null)}};exports.cancelToken=oe.cancelToken;exports.useAuth=oe.useAuth;exports.useAxios=oe.useAxios;exports.useNotifications=oe.useNotifications;exports.useConfirm=Oe.useConfirm;exports.usePrompt=Oe.usePrompt;exports.useClickOutside=qe.useClickOutside;exports.useZodSchemaTypes=Ut;
|