@g4rcez/components 0.0.39 → 0.0.40

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/index.js CHANGED
@@ -197,5 +197,5 @@ Valid keys: `+JSON.stringify(Object.keys(O),null," "));var W=oe(B,Y,Q,G,j+"."+Y
197
197
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pM(e){if(Array.isArray(e))return iu(e)}function wm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Sm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wm(Object(n),!0).forEach(function(r){r0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ls(e,t){return yM(e)||gM(e,t)||o0(e,t)||mM()}function mM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
198
198
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o0(e,t){if(e){if(typeof e=="string")return iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(e,t)}}function iu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function yM(e){if(Array.isArray(e))return e}var vM="file-invalid-type",bM="file-too-large",xM="file-too-small",wM="too-many-files",SM=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:vM,message:"File type must be ".concat(n)}},Tm=function(t){return{code:bM,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Em=function(t){return{code:xM,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},TM={code:wM,message:"Too many files"};function s0(e,t){var n=e.type==="application/x-moz-file"||dM(e,t);return[n,n?null:SM(t)]}function i0(e,t,n){if(Cr(e.size))if(Cr(t)&&Cr(n)){if(e.size>n)return[!1,Tm(n)];if(e.size<t)return[!1,Em(t)]}else{if(Cr(t)&&e.size<t)return[!1,Em(t)];if(Cr(n)&&e.size>n)return[!1,Tm(n)]}return[!0,null]}function Cr(e){return e!=null}function EM(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(l){var c=s0(l,n),u=Ls(c,1),d=u[0],h=i0(l,r,o),f=Ls(h,1),p=f[0],m=a?a(l):null;return d&&p&&!m})}function da(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ci(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Cm(e){e.preventDefault()}function CM(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function RM(e){return e.indexOf("Edge/")!==-1}function PM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return CM(e)||RM(e)}function un(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(a){return!da(r)&&a&&a.apply(void 0,[r].concat(s)),da(r)})}}function kM(){return"showOpenFilePicker"in window}function IM(e){if(Cr(e)){var t=Object.entries(e).filter(function(n){var r=Ls(n,2),o=r[0],s=r[1],i=!0;return a0(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(l0))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=Ls(r,2),s=o[0],i=o[1];return Sm(Sm({},n),{},r0({},s,i))},{});return[{description:"Files",accept:t}]}return e}function OM(e){if(Cr(e))return Object.entries(e).reduce(function(t,n){var r=Ls(n,2),o=r[0],s=r[1];return[].concat(xm(t),[o],xm(s))},[]).filter(function(t){return a0(t)||l0(t)}).join(",")}function AM(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function _M(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function a0(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function l0(e){return/^.*\.[\w]+$/.test(e)}var MM=["children"],DM=["open"],jM=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],FM=["refKey","onChange","onClick"];function NM(e){return $M(e)||VM(e)||c0(e)||LM()}function LM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
199
199
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $M(e){if(Array.isArray(e))return au(e)}function ic(e,t){return WM(e)||zM(e,t)||c0(e,t)||BM()}function BM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
200
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c0(e,t){if(e){if(typeof e=="string")return au(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return au(e,t)}}function au(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function WM(e){if(Array.isArray(e))return e}function Rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rm(Object(n),!0).forEach(function(r){lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e,t){if(e==null)return{};var n=HM(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HM(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Ld=b.forwardRef(function(e,t){var n=e.children,r=fa(e,MM),o=d0(r),s=o.open,i=fa(o,DM);return b.useImperativeHandle(t,function(){return{open:s}},[s]),b.createElement(b.Fragment,null,n(Xe(Xe({},i),{},{open:s})))});Ld.displayName="Dropzone";var u0={disabled:!1,getFilesFromEvent:nM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ld.defaultProps=u0;Ld.propTypes={children:ze.func,accept:ze.objectOf(ze.arrayOf(ze.string)),multiple:ze.bool,preventDropOnDocument:ze.bool,noClick:ze.bool,noKeyboard:ze.bool,noDrag:ze.bool,noDragEventsBubbling:ze.bool,minSize:ze.number,maxSize:ze.number,maxFiles:ze.number,disabled:ze.bool,getFilesFromEvent:ze.func,onFileDialogCancel:ze.func,onFileDialogOpen:ze.func,useFsAccessApi:ze.bool,autoFocus:ze.bool,onDragEnter:ze.func,onDragLeave:ze.func,onDragOver:ze.func,onDrop:ze.func,onDropAccepted:ze.func,onDropRejected:ze.func,onError:ze.func,validator:ze.func};var cu={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function d0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Xe(Xe({},u0),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,h=t.onDrop,f=t.onDropAccepted,p=t.onDropRejected,m=t.onFileDialogCancel,v=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,g=t.preventDropOnDocument,T=t.noClick,S=t.noKeyboard,E=t.noDrag,k=t.noDragEventsBubbling,R=t.onError,I=t.validator,C=b.useMemo(function(){return OM(n)},[n]),F=b.useMemo(function(){return IM(n)},[n]),M=b.useMemo(function(){return typeof v=="function"?v:Pm},[v]),N=b.useMemo(function(){return typeof m=="function"?m:Pm},[m]),P=b.useRef(null),A=b.useRef(null),D=b.useReducer(UM,cu),L=ic(D,2),H=L[0],U=L[1],O=H.isFocused,$=H.isFileDialogActive,Z=b.useRef(typeof window<"u"&&window.isSecureContext&&y&&kM()),te=function(){!Z.current&&$&&setTimeout(function(){if(A.current){var ie=A.current.files;ie.length||(U({type:"closeDialog"}),N())}},300)};b.useEffect(function(){return window.addEventListener("focus",te,!1),function(){window.removeEventListener("focus",te,!1)}},[A,$,N,Z]);var Q=b.useRef([]),G=function(ie){P.current&&P.current.contains(ie.target)||(ie.preventDefault(),Q.current=[])};b.useEffect(function(){return g&&(document.addEventListener("dragover",Cm,!1),document.addEventListener("drop",G,!1)),function(){g&&(document.removeEventListener("dragover",Cm),document.removeEventListener("drop",G))}},[P,g]),b.useEffect(function(){return!r&&x&&P.current&&P.current.focus(),function(){}},[P,x,r]);var j=b.useCallback(function(J){R?R(J):console.error(J)},[R]),B=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J),Q.current=[].concat(NM(Q.current),[J.target]),Ci(J)&&Promise.resolve(o(J)).then(function(ie){if(!(da(J)&&!k)){var Oe=ie.length,Ue=Oe>0&&EM({files:ie,accept:C,minSize:i,maxSize:s,multiple:a,maxFiles:l,validator:I}),St=Oe>0&&!Ue;U({isDragAccept:Ue,isDragReject:St,isDragActive:!0,type:"setDraggedFiles"}),c&&c(J)}}).catch(function(ie){return j(ie)})},[o,c,j,k,C,i,s,a,l,I]),z=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J);var ie=Ci(J);if(ie&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return ie&&d&&d(J),!1},[d,k]),V=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J);var ie=Q.current.filter(function(Ue){return P.current&&P.current.contains(Ue)}),Oe=ie.indexOf(J.target);Oe!==-1&&ie.splice(Oe,1),Q.current=ie,!(ie.length>0)&&(U({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ci(J)&&u&&u(J))},[P,u,k]),Y=b.useCallback(function(J,ie){var Oe=[],Ue=[];J.forEach(function(St){var kt=s0(St,C),jt=ic(kt,2),gr=jt[0],Hr=jt[1],Ur=i0(St,i,s),di=ic(Ur,2),sl=di[0],il=di[1],al=I?I(St):null;if(gr&&sl&&!al)Oe.push(St);else{var ll=[Hr,il];al&&(ll=ll.concat(al)),Ue.push({file:St,errors:ll.filter(function(sx){return sx})})}}),(!a&&Oe.length>1||a&&l>=1&&Oe.length>l)&&(Oe.forEach(function(St){Ue.push({file:St,errors:[TM]})}),Oe.splice(0)),U({acceptedFiles:Oe,fileRejections:Ue,type:"setFiles"}),h&&h(Oe,Ue,ie),Ue.length>0&&p&&p(Ue,ie),Oe.length>0&&f&&f(Oe,ie)},[U,a,C,i,s,l,h,f,p,I]),oe=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J),Q.current=[],Ci(J)&&Promise.resolve(o(J)).then(function(ie){da(J)&&!k||Y(ie,J)}).catch(function(ie){return j(ie)}),U({type:"reset"})},[o,Y,j,k]),W=b.useCallback(function(){if(Z.current){U({type:"openDialog"}),M();var J={multiple:a,types:F};window.showOpenFilePicker(J).then(function(ie){return o(ie)}).then(function(ie){Y(ie,null),U({type:"closeDialog"})}).catch(function(ie){AM(ie)?(N(ie),U({type:"closeDialog"})):_M(ie)?(Z.current=!1,A.current?(A.current.value=null,A.current.click()):j(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):j(ie)});return}A.current&&(U({type:"openDialog"}),M(),A.current.value=null,A.current.click())},[U,M,N,y,Y,j,F,a]),Ee=b.useCallback(function(J){!P.current||!P.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),W())},[P,W]),et=b.useCallback(function(){U({type:"focus"})},[]),He=b.useCallback(function(){U({type:"blur"})},[]),tt=b.useCallback(function(){T||(PM()?setTimeout(W,0):W())},[T,W]),ce=function(ie){return r?null:ie},Te=function(ie){return S?null:ce(ie)},le=function(ie){return E?null:ce(ie)},Re=function(ie){k&&ie.stopPropagation()},at=b.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=J.refKey,Oe=ie===void 0?"ref":ie,Ue=J.role,St=J.onKeyDown,kt=J.onFocus,jt=J.onBlur,gr=J.onClick,Hr=J.onDragEnter,Ur=J.onDragOver,di=J.onDragLeave,sl=J.onDrop,il=fa(J,jM);return Xe(Xe(lu({onKeyDown:Te(un(St,Ee)),onFocus:Te(un(kt,et)),onBlur:Te(un(jt,He)),onClick:ce(un(gr,tt)),onDragEnter:le(un(Hr,B)),onDragOver:le(un(Ur,z)),onDragLeave:le(un(di,V)),onDrop:le(un(sl,oe)),role:typeof Ue=="string"&&Ue!==""?Ue:"presentation"},Oe,P),!r&&!S?{tabIndex:0}:{}),il)}},[P,Ee,et,He,tt,B,z,V,oe,S,E,r]),Pe=b.useCallback(function(J){J.stopPropagation()},[]),pt=b.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=J.refKey,Oe=ie===void 0?"ref":ie,Ue=J.onChange,St=J.onClick,kt=fa(J,FM),jt=lu({accept:C,multiple:a,type:"file",style:{display:"none"},onChange:ce(un(Ue,oe)),onClick:ce(un(St,Pe)),tabIndex:-1},Oe,A);return Xe(Xe({},jt),kt)}},[A,n,a,oe,r]);return Xe(Xe({},H),{},{isFocused:O&&!r,getRootProps:at,getInputProps:pt,rootRef:P,inputRef:A,open:ce(W)})}function UM(e,t){switch(t.type){case"focus":return Xe(Xe({},e),{},{isFocused:!0});case"blur":return Xe(Xe({},e),{},{isFocused:!1});case"openDialog":return Xe(Xe({},cu),{},{isFileDialogActive:!0});case"closeDialog":return Xe(Xe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Xe(Xe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Xe(Xe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Xe({},cu);default:return e}}function Pm(){}const GM={isImage:e=>e.type.includes("image")},YM=e=>{const[t,n]=b.useState({url:"",type:"",size:""});return b.useEffect(()=>{if(GM.isImage(e.file)){const r=URL.createObjectURL(e.file);return n({url:r,type:"img",size:im(e.file.size)}),()=>{URL.revokeObjectURL(r)}}n({url:"",type:e.file.type,size:im(e.file.size)})},[e.file]),t.type==="img"?w.jsxs("div",{className:"flex flex-row gap-jade-200 items-center justify-between w-full",children:[w.jsxs("header",{className:"flex flex-row gap-jade-200 items-center",children:[w.jsx("img",{src:t.url,className:"size-jade-500 rounded-jade-xsmall",alt:`Miniatura do arquivo ${e.file.name}`}),w.jsxs("div",{className:"flex flex-col",children:[w.jsx("span",{children:e.file.name}),w.jsx("span",{children:t.size})]})]}),w.jsx(mo,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:w.jsx(So,{})})]}):w.jsxs("div",{className:"flex flex-row gap-jade-200 items-center justify-between w-full",children:[w.jsxs("header",{className:"flex flex-row gap-4 items-center",children:[w.jsx(hP,{size:48}),w.jsxs("div",{className:"flex flex-col text-left justify-start items-start",children:[w.jsx("span",{children:e.file.name}),w.jsx("span",{children:t.size})]})]}),w.jsx(mo,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:w.jsx(So,{className:"text-danger"})})]})},qM=e=>w.jsx("ul",{className:"w-full space-y-jade-200",children:e.files.map(t=>w.jsx(YM,{onDeleteFile:e.onDeleteFile,file:t},t.name))}),KM=e=>e.isDragActive?w.jsx("p",{children:"Solte os arquivos selecionados"}):e.files.length>0?w.jsx(qM,{onDeleteFile:e.onDeleteFile,files:e.files}):w.jsx(b.Fragment,{children:e.idle}),ZM=w.jsxs("div",{className:"flex flex-col gap-4 justify-center items-center",children:[w.jsx(bP,{size:64}),w.jsxs("p",{children:["You can drag your files or"," ",w.jsx("button",{className:"text-primary underline",type:"button",children:"drag to here"})]})]}),XM=({idle:e=ZM,onDeleteFile:t,onDrop:n,...r})=>{var u;const[o,s]=b.useState([]),i=d=>{n==null||n(d),s(d)},{getRootProps:a,getInputProps:l,isDragActive:c}=d0({onDrop:i});return w.jsxs("div",{...a(),"data-active":(u=r.files)!=null&&u.length?r.files.length>0:!1,className:"flex text-foreground flex-col items-center justify-center border-2 rounded-lg p-6 border-card-border data-[active=true]:bg-card-background data-[active=true]:border-solid data-[active=false]:border-dashed",children:[w.jsx("input",{...l(r),name:r.name,id:r.name}),w.jsx(KM,{onDeleteFile:t,isDragActive:c,idle:e,files:r.files??o})]})},QM=["INPUT","SELECT"],uu=e=>{if(!e)return;Array.from(e.elements).forEach(n=>{QM.includes(n.tagName)&&(n.tagName==="INPUT"&&(n.value=n.defaultValue),n.tagName==="SELECT"&&(n.value=""),n.setAttribute("data-initialized","false"))})},JM=e=>{const t=n=>{var r;n.persist(),n.preventDefault(),(r=e.onSubmit)==null||r.call(e,n)};return w.jsx("form",{...e,onSubmit:t})},eD=({children:e,className:t="",size:n,...r})=>w.jsxs("label",{"data-disabled":r.disabled,"aria-disabled":r.disabled,className:"group font-normal flex items-center gap-2 data-[disabled=true]:cursor-not-allowed",children:[w.jsx("input",{...r,type:"radio",className:Ve("form-radio rounded-full h-4 w-4 app border-card-border text-primary focus:ring-primary appearance-none inline-block bg-origin-border group-aria-disabled:cursor-not-allowed disabled:opacity-70",t),...r}),e]}),Nr=b.forwardRef(({required:e=!0,options:t,info:n,selectContainer:r="",feedback:o=null,labelClassName:s,interactive:i,rightLabel:a,optionalText:l,container:c,hideLeft:u=!1,right:d,left:h,error:f,...p},m)=>{const v=Wt(),y=b.useRef(null),x=p.id??p.name;b.useImperativeHandle(m,()=>y.current),b.useEffect(()=>{if(y.current===null)return;const T=y.current,S=_a(y.current),E=()=>T.setAttribute("data-selected","true");return T.addEventListener("change",E),()=>{S(),T.removeEventListener("change",E)}},[]);const g=()=>{var T;return(T=y.current)==null?void 0:T.focus()};return w.jsx(Xa,{container:Ve("group inline-block w-full",c),error:f,feedback:o,hideLeft:u,left:h,info:n,optionalText:l,rightLabel:a,interactive:i,form:p.form,id:p.name||p.id,name:p.name,labelClassName:s,title:p.title,placeholder:p.placeholder,required:e,right:w.jsx("label",{htmlFor:x,children:w.jsxs("button",{onClick:g,type:"button",className:"mt-2 transition-colors hover:text-primary",children:[w.jsx(Cv,{size:20}),w.jsx("span",{className:"sr-only",children:v.inputCaretDown})]})}),children:w.jsxs("select",{...p,id:x,name:x,value:p.value,required:e,ref:Nu(m,y),"data-selected":!!p.value||!1,defaultValue:p.value?void 0:"",className:Ve("input appearance-none select group h-10 py-1 px-2 w-full flex-1 rounded-md bg-transparent text-foreground placeholder-input-placeholder outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error","data-[selected=false]:text-input-placeholder",p.className),children:[w.jsx("option",{value:"",disabled:!0,hidden:!0,children:p.placeholder}),t.map(T=>w.jsx("option",{...T,children:T.label??T.value},`${x}-select-option-${T.value}`))]})})}),du=e=>{const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),t},tD=b.forwardRef(({children:e,container:t,error:n,...r},o)=>{const s=b.useId(),[i,a]=b.useState(r.checked??!1),l=i,c=b.useRef(null),u=du(r.onChange);b.useImperativeHandle(o,()=>c.current),b.useEffect(()=>{if(c.current!==null&&u.current){const h=f=>{f.target.checked=!f.target.checked,u.current&&u.current(f)};return c.current.addEventListener("change",h),()=>{var f;return(f=c.current)==null?void 0:f.removeEventListener("change",h)}}},[]);const d=()=>{var f,p;const h=!((f=c.current)!=null&&f.checked);a(h),(p=r==null?void 0:r.onCheck)==null||p.call(r,h),c.current!==null&&(c.current.checked=h,c.current.dispatchEvent(new Event("change",{bubbles:!0})))};return w.jsxs("fieldset",{className:Ve("flex flex-wrap items-center",t),children:[w.jsx("input",{...r,checked:l,"data-checked":l,"data-trigger":"change",hidden:!0,id:r.id||s,onChange:h=>a(h.target.checked),ref:c,type:"checkbox"}),w.jsx("button",{type:"button",role:"switch",onClick:d,"aria-checked":l,"data-checked":l,"aria-labelledby":`${s}-label`,className:"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary",children:w.jsx("span",{"aria-hidden":"true","data-checked":l,className:"inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"})}),w.jsx("label",{htmlFor:r.id||s,className:"ml-3 inline-block text-sm",id:`${s}-label`,children:w.jsx("span",{className:"font-medium text-foreground",children:e})}),w.jsx("span",{className:"mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden",children:n})]})}),nD=e=>{const[t,n]=XR();return b.useEffect(()=>{const r=t.current;if(!r)return;const o=s=>{const i=s.target,a=Array.from(r.querySelectorAll("input")),l=a.every(u=>u.checked&&u.getAttribute("data-task")==="true"),c=a.indexOf(i);l&&c!==-1&&n("input",{scale:[1,1.35,1],rotate:[0,10,-10,0]},{duration:.5,delay:nP(.075,{from:c})})};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),w.jsx("fieldset",{...e,ref:t})},Qa=0,hr=1,es=2,f0=4;function Vs(e,t){return n=>e(t(n))}function rD(e,t){return t(e)}function h0(e,t){return n=>e(t,n)}function km(e,t){return()=>e(t)}function Ja(e,t){return t(e),e}function Ze(...e){return e}function oD(e){e()}function Im(e){return()=>e}function sD(...e){return()=>{e.map(oD)}}function Vd(e){return e!==void 0}function zr(){}function $e(e,t){return e(hr,t)}function ve(e,t){e(Qa,t)}function $d(e){e(es)}function At(e){return e(f0)}function ue(e,t){return $e(e,h0(t,Qa))}function Pn(e,t){const n=e(hr,r=>{n(),t(r)});return n}function Ce(){const e=[];return(t,n)=>{switch(t){case es:e.splice(0,e.length);return;case hr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Qa:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function X(e){let t=e;const n=Ce();return(r,o)=>{switch(r){case hr:o(t);break;case Qa:t=o;break;case f0:return t}return n(r,o)}}function iD(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case hr:return s?n===s?void 0:(r(),n=s,t=$e(e,s),t):(r(),zr);case es:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Gt(e){return Ja(Ce(),t=>ue(e,t))}function _t(e,t){return Ja(X(t),n=>ue(e,n))}function aD(...e){return t=>e.reduceRight(rD,t)}function q(e,...t){const n=aD(...t);return(r,o)=>{switch(r){case hr:return $e(e,n(o));case es:$d(e);return}}}function p0(e,t){return e===t}function Ke(e=p0){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function he(e){return t=>n=>{e(n)&&t(n)}}function se(e){return t=>Vs(t,e)}function pn(e){return t=>()=>t(e)}function bn(e,t){return n=>r=>n(t=e(t,r))}function Oo(e){return t=>n=>{e>0?e--:t(n)}}function Zn(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Om(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function be(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);$e(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>s([i].concat(t));n===o?a():r=a}}function Am(...e){return function(t,n){switch(t){case hr:return sD(...e.map(r=>$e(r,n)));case es:return;default:throw new Error(`unrecognized action ${t}`)}}}function me(e,t=p0){return q(e,Ke(t))}function wt(...e){const t=Ce(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);$e(s,l=>{n[i]=l,r=r|a,r===o&&ve(t,n)})}),function(s,i){switch(s){case hr:return r===o&&i(n),$e(t,i);case es:return $d(t);default:throw new Error(`unrecognized action ${s}`)}}}function De(e,t=[],{singleton:n}={singleton:!0}){return{id:lD(),constructor:e,dependencies:t,singleton:n}}const lD=()=>Symbol();function cD(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const a=o(s.map(l=>n(l)));return i&&t.set(r,a),a};return n(e)}function uD(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Ri=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Bd(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=b.createContext({});function l(y,x){y.propsReady&&ve(y.propsReady,!1);for(const g of r){const T=y[t.required[g]];ve(T,x[g])}for(const g of o)if(g in x){const T=y[t.optional[g]];ve(T,x[g])}y.propsReady&&ve(y.propsReady,!0)}function c(y){return s.reduce((x,g)=>(x[g]=T=>{const S=y[t.methods[g]];ve(S,T)},x),{})}function u(y){return i.reduce((x,g)=>(x[g]=iD(y[t.events[g]]),x),{})}const d=b.forwardRef((y,x)=>{const{children:g,...T}=y,[S]=b.useState(()=>Ja(cD(e),k=>l(k,T))),[E]=b.useState(km(u,S));return Ri(()=>{for(const k of i)k in T&&$e(E[k],T[k]);return()=>{Object.values(E).map($d)}},[T,E,S]),Ri(()=>{l(S,T)}),b.useImperativeHandle(x,Im(c(S))),b.createElement(a.Provider,{value:S},n?b.createElement(n,uD([...r,...o,...i],T),g):g)}),h=y=>b.useCallback(h0(ve,b.useContext(a)[y]),[y]),f=y=>{const g=b.useContext(a)[y],T=b.useCallback(S=>$e(g,S),[g]);return b.useSyncExternalStore(T,()=>At(g),()=>At(g))},p=y=>{const g=b.useContext(a)[y],[T,S]=b.useState(km(At,g));return Ri(()=>$e(g,E=>{E!==T&&S(Im(E))}),[g,T]),T},m=b.version.startsWith("18")?f:p;return{Component:d,usePublisher:h,useEmitterValue:m,useEmitter:(y,x)=>{const T=b.useContext(a)[y];Ri(()=>$e(T,x),[x,T])}}}const dD=typeof document<"u"?b.useLayoutEffect:b.useEffect,fD=dD;var Yt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Yt||{});const hD={0:"debug",1:"log",2:"warn",3:"error"},pD=()=>typeof globalThis>"u"?window:globalThis,pr=De(()=>{const e=X(3);return{log:X((n,r,o=1)=>{var s;const i=(s=pD().VIRTUOSO_LOG_LEVEL)!=null?s:At(e);o>=i&&console[hD[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function zd(e,t=!0){const n=b.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=b.useMemo(()=>new ResizeObserver(s=>{requestAnimationFrame(()=>{const i=s[0].target;i.offsetParent!==null&&e(i)})}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function kn(e,t=!0){return zd(e,t).callbackRef}function m0(e,t,n,r,o,s,i){const a=b.useCallback(l=>{const c=mD(l.children,t,"offsetHeight",o);let u=l.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;const d=u.lastElementChild.dataset.viewportType==="window",h=i?i.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:u.scrollTop,f=i?i.scrollHeight:d?document.documentElement.scrollHeight:u.scrollHeight,p=i?i.offsetHeight:d?window.innerHeight:u.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:p}),s==null||s(gD("row-gap",getComputedStyle(l).rowGap,o)),c!==null&&e(c)},[e,t,o,s,i,r]);return zd(a,n)}function mD(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(!a||a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),u=t(a,n);if(u===0&&r("Zero-sized element, this should not happen",{child:a},Yt.ERROR),u===c)continue;const d=s[s.length-1];s.length===0||d.size!==u||d.endIndex!==l-1?s.push({startIndex:l,endIndex:l,size:u}):s[s.length-1].endIndex++}return s}function gD(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yt.WARN),t==="normal"?0:parseInt(t??"0",10)}function an(e,t){return Math.round(e.getBoundingClientRect()[t])}function g0(e,t){return Math.abs(e-t)<1.01}function y0(e,t,n,r=zr,o){const s=b.useRef(null),i=b.useRef(null),a=b.useRef(null),l=b.useCallback(d=>{const h=d.target,f=h===window||h===document,p=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,m=f?document.documentElement.scrollHeight:h.scrollHeight,v=f?window.innerHeight:h.offsetHeight,y=()=>{e({scrollTop:Math.max(p,0),scrollHeight:m,viewportHeight:v})};d.suppressFlushSync?y():lg.flushSync(y),i.current!==null&&(p===i.current||p<=0||p===m-v)&&(i.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);b.useEffect(()=>{const d=o||s.current;return r(o||s.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[s,l,n,r,o]);function c(d){const h=s.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let p,m,v;h===window?(m=Math.max(an(document.documentElement,"height"),document.documentElement.scrollHeight),p=window.innerHeight,v=document.documentElement.scrollTop):(m=h.scrollHeight,p=an(h,"height"),v=h.scrollTop);const y=m-p;if(d.top=Math.ceil(Math.max(Math.min(y,d.top),0)),g0(p,m)||d.top===v){e({scrollTop:v,scrollHeight:m,viewportHeight:p}),f&&t(!0);return}f?(i.current=d.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,i.current=null,t(!0)},1e3)):i.current=null,h.scrollTo(d)}function u(d){s.current.scrollBy(d)}return{scrollerRef:s,scrollByCallback:u,scrollToCallback:c}}const Lt=De(()=>{const e=Ce(),t=Ce(),n=X(0),r=Ce(),o=X(0),s=Ce(),i=Ce(),a=X(0),l=X(0),c=X(0),u=X(0),d=Ce(),h=Ce(),f=X(!1);return ue(q(e,se(({scrollTop:p})=>p)),t),ue(q(e,se(({scrollHeight:p})=>p)),i),ue(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:a,fixedHeaderHeight:l,fixedFooterHeight:c,footerHeight:u,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:o,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),$s={lvl:0};function v0(e,t,n,r=$s,o=$s){return{k:e,v:t,lvl:n,l:r,r:o}}function We(e){return e===$s}function lo(){return $s}function fu(e,t){if(We(e))return $s;const{k:n,l:r,r:o}=e;if(t===n){if(We(r))return o;if(We(o))return r;{const[s,i]=b0(r);return Ni(gt(e,{k:s,v:i,l:x0(r)}))}}else return t<n?Ni(gt(e,{l:fu(r,t)})):Ni(gt(e,{r:fu(o,t)}))}function Bs(e,t){if(!We(e))return t===e.k?e.v:t<e.k?Bs(e.l,t):Bs(e.r,t)}function ln(e,t,n="k"){if(We(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ln(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ln(e.l,t,n)}function Ut(e,t,n){return We(e)?v0(t,n,1):t===e.k?gt(e,{k:t,v:n}):t<e.k?_m(gt(e,{l:Ut(e.l,t,n)})):_m(gt(e,{r:Ut(e.r,t,n)}))}function hu(e,t,n){if(We(e))return[];const{k:r,v:o,l:s,r:i}=e;let a=[];return r>t&&(a=a.concat(hu(s,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(hu(i,t,n))),a}function Or(e){return We(e)?[]:[...Or(e.l),{k:e.k,v:e.v},...Or(e.r)]}function b0(e){return We(e.r)?[e.k,e.v]:b0(e.r)}function x0(e){return We(e.r)?e.l:Ni(gt(e,{r:x0(e.r)}))}function gt(e,t){return v0(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function ac(e){return We(e)||e.lvl>e.r.lvl}function _m(e){return pu(S0(e))}function Ni(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(ac(t))return S0(gt(e,{lvl:r-1}));if(!We(t)&&!We(t.r))return gt(t.r,{l:gt(t,{r:t.r.l}),r:gt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(ac(e))return pu(gt(e,{lvl:r-1}));if(!We(n)&&!We(n.l)){const o=n.l,s=ac(o)?n.lvl-1:n.lvl;return gt(o,{l:gt(e,{r:o.l,lvl:r-1}),r:pu(gt(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function el(e,t,n){if(We(e))return[];const r=ln(e,t)[0];return yD(hu(e,r,n))}function w0(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({start:r,end:a-1,value:o}),r=a,o=l}return s.push({start:r,end:1/0,value:o}),s}function yD(e){return w0(e,({k:t,v:n})=>({index:t,value:n}))}function pu(e){const{r:t,lvl:n}=e;return!We(t)&&!We(t.r)&&t.lvl===n&&t.r.lvl===n?gt(t,{l:gt(e,{r:t.l}),lvl:n+1}):e}function S0(e){const{l:t}=e;return!We(t)&&t.lvl===e.lvl?gt(t,{r:gt(e,{l:t.r})}):e}function ha(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function T0(e,t,n){return e[ha(e,t,n)]}function vD(e,t,n,r){const o=ha(e,t,r),s=ha(e,n,r,o);return e.slice(o,s+1)}const Wd=De(()=>({recalcInProgress:X(!1)}),[],{singleton:!0});function bD(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Mm(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function xD(e,t){let n=We(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),We(e)){e=Ut(e,0,o);continue}const a=el(e,s-1,i+1);if(a.some(bD(r)))continue;let l=!1,c=!1;for(const{start:u,end:d,value:h}of a)l?(i>=u||o===h)&&(e=fu(e,u)):(c=h!==o,l=!0),d>i&&i>=u&&h!==o&&(e=Ut(e,i+1,h));c&&(e=Ut(e,s,o))}return[e,n]}function wD(){return{offsetTree:[],sizeTree:lo(),groupOffsetTree:lo(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hd({index:e},t){return t===e?0:t<e?-1:1}function SD({offset:e},t){return t===e?0:t<e?-1:1}function TD(e){return{index:e.index,value:e}}function ED(e,t,n,r=0){return r>0&&(t=Math.max(t,T0(e,r,Hd).offset)),w0(vD(e,t,n,SD),TD)}function mu(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=ha(o,t-1,Hd),a=o[l].offset;const u=ln(n,t-1);s=u[0],i=u[1],o.length&&o[l].size===ln(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of el(n,t,1/0)){const d=c-s,h=d*i+a+d*r;o.push({offset:h,size:u,index:c}),s=c,a=h,i=u}return{offsetTree:o,lastIndex:s,lastOffset:a,lastSize:i}}function CD(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Yt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&We(s)&&t.length===2){const h=t[0].size,f=t[1].size;i=n.reduce((p,m)=>Ut(Ut(p,m,h),m+1,f),i)}else[i,a]=xD(i,t);if(i===s)return e;const{offsetTree:l,lastIndex:c,lastSize:u,lastOffset:d}=mu(e.offsetTree,a,i,o);return{sizeTree:i,offsetTree:l,lastIndex:c,lastOffset:d,lastSize:u,groupOffsetTree:n.reduce((h,f)=>Ut(h,f,zs(f,l,o)),lo()),groupIndices:n}}function zs(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=T0(t,e,Hd),i=e-o,a=s*i+(i-1)*n+r;return a>0?a+n:a}function RD(e){return typeof e.groupIndex<"u"}function E0(e,t,n){if(RD(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=C0(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function C0(e,t){if(!tl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function tl(e){return!We(e.groupOffsetTree)}function PD(e){return Or(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const kD={offsetHeight:"height",offsetWidth:"width"},On=De(([{log:e},{recalcInProgress:t}])=>{const n=Ce(),r=Ce(),o=_t(r,0),s=Ce(),i=Ce(),a=X(0),l=X([]),c=X(void 0),u=X(void 0),d=X((S,E)=>an(S,kD[E])),h=X(void 0),f=X(0),p=wD(),m=_t(q(n,be(l,e,f),bn(CD,p),Ke()),p),v=_t(q(l,Ke(),bn((S,E)=>({prev:S.current,current:E}),{prev:[],current:[]}),se(({prev:S})=>S)),[]);ue(q(l,he(S=>S.length>0),be(m,f),se(([S,E,k])=>{const R=S.reduce((I,C,F)=>Ut(I,C,zs(C,E.offsetTree,k)||F),lo());return{...E,groupIndices:S,groupOffsetTree:R}})),m),ue(q(r,be(m),he(([S,{lastIndex:E}])=>S<E),se(([S,{lastIndex:E,lastSize:k}])=>[{startIndex:S,endIndex:E,size:k}])),n),ue(c,u);const y=_t(q(c,se(S=>S===void 0)),!0);ue(q(u,he(S=>S!==void 0&&We(At(m).sizeTree)),se(S=>[{startIndex:0,endIndex:0,size:S}])),n);const x=Gt(q(n,be(m),bn(({sizes:S},[E,k])=>({changed:k!==S,sizes:k}),{changed:!1,sizes:p}),se(S=>S.changed)));$e(q(a,bn((S,E)=>({diff:S.prev-E,prev:E}),{diff:0,prev:0}),se(S=>S.diff)),S=>{const{groupIndices:E}=At(m);if(S>0)ve(t,!0),ve(s,S+Mm(S,E));else if(S<0){const k=At(v);k.length>0&&(S-=Mm(-S,k)),ve(i,S)}}),$e(q(a,be(e)),([S,E])=>{S<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Yt.ERROR)});const g=Gt(s);ue(q(s,be(m),se(([S,E])=>{const k=E.groupIndices.length>0,R=[],I=E.lastSize;if(k){const C=Bs(E.sizeTree,0);let F=0,M=0;for(;F<S;){const A=E.groupIndices[M],D=E.groupIndices.length===M+1?1/0:E.groupIndices[M+1]-A-1;R.push({startIndex:A,endIndex:A,size:C}),R.push({startIndex:A+1,endIndex:A+1+D-1,size:I}),M++,F+=D+1}const N=Or(E.sizeTree);return F!==S&&N.shift(),N.reduce((A,{k:D,v:L})=>{let H=A.ranges;return A.prevSize!==0&&(H=[...A.ranges,{startIndex:A.prevIndex,endIndex:D+S-1,size:A.prevSize}]),{ranges:H,prevIndex:D+S,prevSize:L}},{ranges:R,prevIndex:S,prevSize:0}).ranges}return Or(E.sizeTree).reduce((C,{k:F,v:M})=>({ranges:[...C.ranges,{startIndex:C.prevIndex,endIndex:F+S-1,size:C.prevSize}],prevIndex:F+S,prevSize:M}),{ranges:[],prevIndex:0,prevSize:I}).ranges})),n);const T=Gt(q(i,be(m,f),se(([S,{offsetTree:E},k])=>{const R=-S;return zs(R,E,k)})));return ue(q(i,be(m,f),se(([S,E,k])=>{if(E.groupIndices.length>0){if(We(E.sizeTree))return E;let I=lo();const C=At(v);let F=0,M=0,N=0;for(;F<-S;){N=C[M];const A=C[M+1]-N-1;M++,F+=A+1}if(I=Or(E.sizeTree).reduce((A,{k:D,v:L})=>Ut(A,Math.max(0,D+S),L),I),F!==-S){const A=Bs(E.sizeTree,N);I=Ut(I,0,A);const D=ln(E.sizeTree,-S+1)[1];I=Ut(I,1,D)}return{...E,sizeTree:I,...mu(E.offsetTree,0,I,k)}}else{const I=Or(E.sizeTree).reduce((C,{k:F,v:M})=>Ut(C,Math.max(0,F+S),M),lo());return{...E,sizeTree:I,...mu(E.offsetTree,0,I,k)}}})),m),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:u,fixedItemSize:c,unshiftWith:s,shiftWith:i,shiftWithOffset:T,beforeUnshiftWith:g,firstItemIndex:a,gap:f,sizes:m,listRefresh:x,statefulTotalCount:o,trackItemSizes:y,itemSize:d}},Ze(pr,Wd),{singleton:!0}),ID=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function R0(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!ID)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const li=De(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:a,headerHeight:l,footerHeight:c,fixedHeaderHeight:u,fixedFooterHeight:d},{log:h}])=>{const f=Ce(),p=Ce(),m=X(0);let v=null,y=null,x=null;function g(){v&&(v(),v=null),x&&(x(),x=null),y&&(clearTimeout(y),y=null),ve(o,!1)}return ue(q(f,be(e,s,t,m,l,c,h),be(r,u,d),se(([[T,S,E,k,R,I,C,F],M,N,P])=>{const A=R0(T),{align:D,behavior:L,offset:H}=A,U=k-1,O=E0(A,S,U);let $=zs(O,S.offsetTree,M)+I;D==="end"?($+=N+ln(S.sizeTree,O)[1]-E+P,O===U&&($+=C)):D==="center"?$+=(N+ln(S.sizeTree,O)[1]-E+P)/2:$-=R,H&&($+=H);const Z=te=>{g(),te?(F("retrying to scroll to",{location:T},Yt.DEBUG),ve(f,T)):(ve(p,!0),F("list did not change, scroll successful",{},Yt.DEBUG))};if(g(),L==="smooth"){let te=!1;x=$e(n,Q=>{te=te||Q}),v=Pn(a,()=>{Z(te)})}else v=Pn(q(n,OD(150)),Z);return y=setTimeout(()=>{g()},1200),ve(o,!0),F("scrolling from index to",{index:O,top:$,behavior:L},Yt.DEBUG),{top:$,behavior:L}})),i),{scrollToIndex:f,scrollTargetReached:p,topListHeight:m}},Ze(On,Lt,pr),{singleton:!0});function OD(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ws="up",Rs="down",AD="none",_D={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},MD=0,ci=De(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=X(!1),a=X(!0),l=Ce(),c=Ce(),u=X(4),d=X(MD),h=_t(q(Am(q(me(t),Oo(1),pn(!0)),q(me(t),Oo(1),pn(!1),Om(100))),Ke()),!1),f=_t(q(Am(q(s,pn(!0)),q(s,pn(!1),Om(200))),Ke()),!1);ue(q(wt(me(t),me(d)),se(([x,g])=>x<=g),Ke()),a),ue(q(a,Zn(50)),c);const p=Gt(q(wt(e,me(n),me(r),me(o),me(u)),bn((x,[{scrollTop:g,scrollHeight:T},S,E,k,R])=>{const I=g+S-T>-R,C={viewportHeight:S,scrollTop:g,scrollHeight:T};if(I){let M,N;return g>x.state.scrollTop?(M="SCROLLED_DOWN",N=x.state.scrollTop-g):(M="SIZE_DECREASED",N=x.state.scrollTop-g||x.scrollTopDelta),{atBottom:!0,state:C,atBottomBecause:M,scrollTopDelta:N}}let F;return C.scrollHeight>x.state.scrollHeight?F="SIZE_INCREASED":S<x.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":g<x.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:C}},_D),Ke((x,g)=>x&&x.atBottom===g.atBottom))),m=_t(q(e,bn((x,{scrollTop:g,scrollHeight:T,viewportHeight:S})=>{if(g0(x.scrollHeight,T))return{scrollTop:g,scrollHeight:T,jump:0,changed:!1};{const E=T-(g+S)<1;return x.scrollTop!==g&&E?{scrollHeight:T,scrollTop:g,jump:x.scrollTop-g,changed:!0}:{scrollHeight:T,scrollTop:g,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),he(x=>x.changed),se(x=>x.jump)),0);ue(q(p,se(x=>x.atBottom)),i),ue(q(i,Zn(50)),l);const v=X(Rs);ue(q(e,se(({scrollTop:x})=>x),Ke(),bn((x,g)=>At(f)?{direction:x.direction,prevScrollTop:g}:{direction:g<x.prevScrollTop?Ws:Rs,prevScrollTop:g},{direction:Rs,prevScrollTop:0}),se(x=>x.direction)),v),ue(q(e,Zn(50),pn(AD)),v);const y=X(0);return ue(q(h,he(x=>!x),pn(0)),y),ue(q(t,Zn(100),be(h),he(([x,g])=>!!g),bn(([x,g],[T])=>[g,T],[0,0]),se(([x,g])=>g-x)),y),{isScrolling:h,isAtTop:a,isAtBottom:i,atBottomState:p,atTopStateChange:c,atBottomStateChange:l,scrollDirection:v,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:y,lastJumpDueToItemResize:m}},Ze(Lt)),mr=De(([{log:e}])=>{const t=X(!1),n=Gt(q(t,he(r=>r),Ke()));return $e(t,r=>{r&&At(e)("props updated",{},Yt.DEBUG)}),{propsReady:t,didMount:n}},Ze(pr),{singleton:!0});function Ud(e,t){e==0?t():requestAnimationFrame(()=>Ud(e-1,t))}function Gd(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const ui=De(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o,scrollTargetReached:s},{didMount:i}])=>{const a=X(!0),l=X(0),c=X(!0);return ue(q(i,be(l),he(([u,d])=>!!d),pn(!1)),a),ue(q(i,be(l),he(([u,d])=>!!d),pn(!1)),c),$e(q(wt(t,i),be(a,e,n,c),he(([[,u],d,{sizeTree:h},f,p])=>u&&(!We(h)||Vd(f))&&!d&&!p),be(l)),([,u])=>{Pn(s,()=>{ve(c,!0)}),Ud(4,()=>{Pn(r,()=>{ve(a,!0)}),ve(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:l,initialItemFinalLocationReached:c}},Ze(On,Lt,li,mr),{singleton:!0});function Dm(e){return e?e==="smooth"?"smooth":"auto":!1}const DD=(e,t)=>typeof e=="function"?Dm(e(t)):t&&Dm(e),jD=De(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:a},{log:l},{scrollingInProgress:c}])=>{const u=X(!1),d=Ce();let h=null;function f(m){ve(o,{index:"LAST",align:"end",behavior:m})}$e(q(wt(q(me(e),Oo(1)),a),be(me(u),n,s,c),se(([[m,v],y,x,g,T])=>{let S=v&&g,E="auto";return S&&(E=DD(y,x||T),S=S&&!!E),{totalCount:m,shouldFollow:S,followOutputBehavior:E}}),he(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:v})=>{h&&(h(),h=null),h=Pn(t,()=>{At(l)("following output to ",{totalCount:m},Yt.DEBUG),f(v),h=null})});function p(m){const v=Pn(r,y=>{m&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(At(l)("scrolling to bottom due to increased size",{},Yt.DEBUG),f("auto"))});setTimeout(v,100)}return $e(q(wt(me(u),e,i),he(([m,,v])=>m&&v),bn(({value:m},[,v])=>({refreshed:m===v,value:v}),{refreshed:!1,value:0}),he(({refreshed:m})=>m),be(u,e)),([,m])=>{At(s)&&p(m!==!1)}),$e(d,()=>{p(At(u)!==!1)}),$e(wt(me(u),r),([m,v])=>{m&&!v.atBottom&&v.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:u,autoscrollToBottom:d}},Ze(On,ci,li,ui,mr,pr,Lt));function FD(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const P0=De(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Ce(),i=Ce(),a=Gt(q(s,se(FD)));return ue(q(a,se(l=>l.totalCount)),e),ue(q(a,se(l=>l.groupIndices)),t),ue(q(wt(r,n,o),he(([l,c])=>tl(c)),se(([l,c,u])=>ln(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),Ke(),se(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},Ze(On,Lt));function Hs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function k0(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const pa="top",ma="bottom",jm="none";function Fm(e,t,n){return typeof e=="number"?n===Ws&&t===pa||n===Rs&&t===ma?e:0:n===Ws?t===pa?e.main:e.reverse:t===ma?e.main:e.reverse}function Nm(e,t){return typeof e=="number"?e:e[t]||0}const Yd=De(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Ce(),i=X(0),a=X(0),l=X(0),c=_t(q(wt(me(e),me(t),me(r),me(s,Hs),me(l),me(i),me(o),me(n),me(a)),se(([u,d,h,[f,p],m,v,y,x,g])=>{const T=u-x,S=v+y,E=Math.max(h-T,0);let k=jm;const R=Nm(g,pa),I=Nm(g,ma);return f-=x,f+=h+y,p+=h+y,p-=x,f>u+S-R&&(k=Ws),p<u-E+d+I&&(k=Rs),k!==jm?[Math.max(T-h-Fm(m,pa,k)-R,0),T-E-y+d+Fm(m,ma,k)+I]:null}),he(u=>u!=null),Ke(Hs)),[0,0]);return{listBoundary:s,overscan:l,topListHeight:i,increaseViewportBy:a,visibleRange:c}},Ze(Lt),{singleton:!0});function ND(e,t,n){if(tl(t)){const r=C0(e,t);return[{index:ln(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const lc={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Lm(e,t,n){if(e.length===0)return[];if(!tl(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=el(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let u;c.index===a.start?u={type:"group",index:l}:u={index:c.index-(l+1)+n,groupIndex:l},s.push({...u,size:c.size,offset:c.offset,originalIndex:c.index,data:c.data})}return s}function Li(e,t,n,r,o,s){const{lastSize:i,lastOffset:a,lastIndex:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const m=e[e.length-1];u=m.offset+m.size}const d=n-l,h=a+d*i+(d-1)*r,f=c,p=h-u;return{items:Lm(e,o,s),topItems:Lm(t,o,s),topListHeight:t.reduce((m,v)=>v.size+m,0),offsetTop:c,offsetBottom:p,top:f,bottom:u,totalCount:n,firstItemIndex:s}}function I0(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-i>=e)break;i++}const a=e+i,l=Gd(t,a),c=Array.from({length:a}).map((u,d)=>({index:d+l,size:0,offset:0,data:s[d+l]}));return Li(c,[],a,o,n,r)}const Wr=De(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:a,topListHeight:l},{scrolledToInitialItem:c,initialTopMostItemIndex:u},{topListHeight:d},h,{didMount:f},{recalcInProgress:p}])=>{const m=X([]),v=X(0),y=Ce();ue(s.topItemsIndexes,m);const x=_t(q(wt(f,p,me(i,Hs),me(t),me(e),me(u),c,me(m),me(r),me(o),n),he(([E,k,,R,,,,,,,I])=>{const C=I&&I.length!==R;return E&&!k&&!C}),se(([,,[E,k],R,I,C,F,M,N,P,A])=>{const D=I,{sizeTree:L,offsetTree:H}=D,U=At(v);if(R===0)return{...lc,totalCount:R};if(E===0&&k===0)return U===0?{...lc,totalCount:R}:I0(U,C,I,N,P,A||[]);if(We(L))return U>0?null:Li(ND(Gd(C,R),D,A),[],R,P,D,N);const O=[];if(M.length>0){const G=M[0],j=M[M.length-1];let B=0;for(const z of el(L,G,j)){const V=z.value,Y=Math.max(z.start,G),oe=Math.min(z.end,j);for(let W=Y;W<=oe;W++)O.push({index:W,size:V,offset:B,data:A&&A[W]}),B+=V}}if(!F)return Li([],O,R,P,D,N);const $=M.length>0?M[M.length-1]+1:0,Z=ED(H,E,k,$);if(Z.length===0)return null;const te=R-1,Q=Ja([],G=>{for(const j of Z){const B=j.value;let z=B.offset,V=j.start;const Y=B.size;if(B.offset<E){V+=Math.floor((E-B.offset+P)/(Y+P));const W=V-j.start;z+=W*Y+W*P}V<$&&(z+=($-V)*Y,V=$);const oe=Math.min(j.end,te);for(let W=V;W<=oe&&!(z>=k);W++)G.push({index:W,size:Y,offset:z,data:A&&A[W]}),z+=Y+P}});return Li(Q,O,R,P,D,N)}),he(E=>E!==null),Ke()),lc);ue(q(n,he(Vd),se(E=>E==null?void 0:E.length)),t),ue(q(x,se(E=>E.topListHeight)),d),ue(d,l),ue(q(x,se(E=>[E.top,E.bottom])),a),ue(q(x,se(E=>E.items)),y);const g=Gt(q(x,he(({items:E})=>E.length>0),be(t,n),he(([{items:E},k])=>E[E.length-1].originalIndex===k-1),se(([,E,k])=>[E-1,k]),Ke(Hs),se(([E])=>E))),T=Gt(q(x,Zn(200),he(({items:E,topItems:k})=>E.length>0&&E[0].originalIndex===k.length),se(({items:E})=>E[0].index),Ke())),S=Gt(q(x,he(({items:E})=>E.length>0),se(({items:E})=>{let k=0,R=E.length-1;for(;E[k].type==="group"&&k<R;)k++;for(;E[R].type==="group"&&R>k;)R--;return{startIndex:E[k].index,endIndex:E[R].index}}),Ke(k0)));return{listState:x,topItemsIndexes:m,endReached:g,startReached:T,rangeChanged:S,itemsRendered:y,initialItemCount:v,...h}},Ze(On,P0,Yd,ui,li,ci,mr,Wd),{singleton:!0}),LD=De(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(ue(q(a,be(s),he(([,l])=>l!==0),be(o,e,t,r,n),se(([[,l],c,u,d,h,f=[]])=>I0(l,c,u,d,h,f))),i),{}),Ze(On,ui,Wr,mr),{singleton:!0}),O0=De(([{scrollVelocity:e}])=>{const t=X(!1),n=Ce(),r=X(!1);return ue(q(e,be(r,t,n),he(([o,s])=>!!s),se(([o,s,i,a])=>{const{exit:l,enter:c}=s;if(i){if(l(o,a))return!1}else if(c(o,a))return!0;return i}),Ke()),t),$e(q(wt(t,e,n),be(r)),([[o,s,i],a])=>o&&a&&a.change&&a.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Ze(ci),{singleton:!0}),VD=De(([{topItemsIndexes:e}])=>{const t=X(0);return ue(q(t,he(n=>n>0),se(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},Ze(Wr)),A0=De(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Ce(),i=_t(q(wt(e,r,t,n,o),se(([a,l,c,u,d])=>a+l+c+u+d.offsetBottom+d.bottom)),0);return ue(me(i),s),{totalListHeight:i,totalListHeightChanged:s}},Ze(Lt,Wr),{singleton:!0});function _0(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const $D=_0(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),BD=De(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:a},{listState:l},{beforeUnshiftWith:c,shiftWithOffset:u,sizes:d,gap:h},{log:f},{recalcInProgress:p}])=>{const m=Gt(q(l,be(a),bn(([,y,x,g],[{items:T,totalCount:S,bottom:E,offsetBottom:k},R])=>{const I=E+k;let C=0;return x===S&&y.length>0&&T.length>0&&(T[0].originalIndex===0&&y[0].originalIndex===0||(C=I-g,C!==0&&(C+=R))),[C,T,S,I]},[0,[],0,0]),he(([y])=>y!==0),be(t,i,r,s,f,p),he(([,y,x,g,,,T])=>!T&&!g&&y!==0&&x===Ws),se(([[y],,,,,x])=>(x("Upward scrolling compensation",{amount:y},Yt.DEBUG),y))));function v(y){y>0?(ve(e,{top:-y,behavior:"auto"}),ve(n,0)):(ve(n,0),ve(e,{top:-y,behavior:"auto"}))}return $e(q(m,be(n,o)),([y,x,g])=>{g&&$D()?ve(n,x-y):v(-y)}),$e(q(wt(_t(o,!1),n,p),he(([y,x,g])=>!y&&!g&&x!==0),se(([y,x])=>x),Zn(1)),v),ue(q(u,se(y=>({top:-y}))),e),$e(q(c,be(d,h),se(([y,{lastSize:x,groupIndices:g,sizeTree:T},S])=>{function E(k){return k*(x+S)}if(g.length===0)return E(y);{let k=0;const R=Bs(T,0);let I=0,C=0;for(;I<y;){I++,k+=R;let F=g.length===C+1?1/0:g[C+1]-g[C]-1;I+F>y&&(k-=R,F=y-I+1),I+=F,k+=E(F),C++}return k}})),y=>{ve(n,y),requestAnimationFrame(()=>{ve(e,{top:y}),requestAnimationFrame(()=>{ve(n,0),ve(p,!1)})})}),{deviation:n}},Ze(Lt,ci,Wr,On,pr,Wd)),zD=De(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=X(0);return $e(q(e,be(r),he(([,o])=>o!==0),se(([,o])=>({top:o}))),o=>{Pn(q(n,Oo(1),he(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{ve(t,o)})})}),{initialScrollTop:r}},Ze(mr,Lt,Wr),{singleton:!0}),WD=De(([{viewportHeight:e},{totalListHeight:t}])=>{const n=X(!1),r=_t(q(wt(n,e,t),he(([o])=>o),se(([,o,s])=>Math.max(0,o-s)),Zn(0),Ke()),0);return{alignToBottom:n,paddingTopAddition:r}},Ze(Lt,A0),{singleton:!0}),qd=De(([{scrollTo:e,scrollContainerState:t}])=>{const n=Ce(),r=Ce(),o=Ce(),s=X(!1),i=X(void 0);return ue(q(wt(n,r),se(([{viewportHeight:a,scrollTop:l,scrollHeight:c},{offsetTop:u}])=>({scrollTop:Math.max(0,l-u),scrollHeight:c,viewportHeight:a}))),t),ue(q(e,be(r),se(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Ze(Lt)),HD=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,UD=De(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:a,scrollingInProgress:l},{scrollToIndex:c}])=>{const u=Ce();return ue(q(u,be(e,o,t,s,i,a,r),be(n),se(([[d,h,f,p,m,v,y,x],g])=>{const{done:T,behavior:S,align:E,calculateViewLocation:k=HD,...R}=d,I=E0(d,h,p-1),C=zs(I,h.offsetTree,g)+m+v,F=C+ln(h.sizeTree,I)[1],M=x+v,N=x+f-y,P=k({itemTop:C,itemBottom:F,viewportTop:M,viewportBottom:N,locationParams:{behavior:S,align:E,...R}});return P?T&&Pn(q(l,he(A=>A===!1),Oo(At(l)?1:2)),T):T&&T(),P}),he(d=>d!==null)),c),{scrollIntoView:u}},Ze(On,Lt,li,Wr,pr),{singleton:!0}),GD=De(([{sizes:e,sizeRanges:t},{scrollTop:n,headerHeight:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=Ce(),u=X(void 0),d=X(null),h=X(null);return ue(a,d),ue(l,h),$e(q(c,be(e,n,i,d,h,r)),([f,p,m,v,y,x,g])=>{const T=PD(p.sizeTree);v&&y!==null&&x!==null&&(m=y.scrollTop-x.offsetTop),m-=g,f({ranges:T,scrollTop:m})}),ue(q(u,he(Vd),se(YD)),o),ue(q(s,be(u),he(([,f])=>f!==void 0),Ke(),se(([,f])=>f.ranges)),t),{getState:c,restoreStateFrom:u}},Ze(On,Lt,ui,mr,qd));function YD(e){return{offset:e.scrollTop,index:0,align:"start"}}const qD=De(([e,t,n,r,o,s,i,a,l,c])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c}),Ze(Yd,LD,mr,O0,A0,zD,WD,qd,UD,pr)),M0=De(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:a,groupIndices:l,statefulTotalCount:c,gap:u,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:p},m,v,y,{listState:x,topItemsIndexes:g,...T},{scrollToIndex:S},E,{topItemCount:k},{groupCounts:R},I])=>(ue(T.rangeChanged,I.scrollSeekRangeChanged),ue(q(I.windowViewportRect,se(C=>C.visibleHeight)),m.viewportHeight),{totalCount:e,data:i,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:p,topItemsIndexes:g,topItemCount:k,groupCounts:R,fixedItemHeight:n,defaultItemHeight:r,gap:u,...y,statefulTotalCount:c,listState:x,scrollToIndex:S,trackItemSizes:o,itemSize:s,groupIndices:l,...T,...I,...m,sizes:d,...v}),Ze(On,ui,Lt,GD,jD,Wr,li,BD,VD,P0,qD)),cc="-webkit-sticky",Vm="sticky",D0=_0(()=>{if(typeof document>"u")return Vm;const e=document.createElement("div");return e.style.position=cc,e.style.position===cc?cc:Vm});function Kd(e,t){const n=b.useRef(null),r=b.useCallback(a=>{if(a===null||!a.offsetParent)return;const l=a.getBoundingClientRect(),c=l.width;let u,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;u=h.height-Math.max(0,f),d=f+t.scrollTop}else u=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:u,visibleWidth:c},e(n.current)},[e,t]),{callbackRef:o,ref:s}=zd(r),i=b.useCallback(()=>{r(s.current)},[r,s]);return b.useEffect(()=>{if(t){t.addEventListener("scroll",i);const a=new ResizeObserver(()=>{requestAnimationFrame(i)});return a.observe(t),()=>{t.removeEventListener("scroll",i),a.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const nl=b.createContext(void 0),j0=b.createContext(void 0);function Zd(e){return e}const KD=De(()=>{const e=X(l=>`Item ${l}`),t=X(null),n=X(l=>`Group ${l}`),r=X({}),o=X(Zd),s=X("div"),i=X(zr),a=(l,c=null)=>_t(q(r,se(u=>u[l]),Ke()),c);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}),ZD=De(([e,t])=>({...e,...t}),Ze(M0,KD)),XD=({height:e})=>b.createElement("div",{style:{height:e}}),QD={position:D0(),zIndex:1,overflowAnchor:"none"},JD={overflowAnchor:"none"},$m=b.memo(function({showTopList:t=!1}){const n=Se("listState"),r=Jt("sizeRanges"),o=Se("useWindowScroll"),s=Se("customScrollParent"),i=Jt("windowScrollContainerState"),a=Jt("scrollContainerState"),l=s||o?i:a,c=Se("itemContent"),u=Se("context"),d=Se("groupContent"),h=Se("trackItemSizes"),f=Se("itemSize"),p=Se("log"),m=Jt("gap"),{callbackRef:v}=m0(r,f,h,t?zr:l,p,m,s),[y,x]=b.useState(0);Jd("deviation",P=>{y!==P&&x(P)});const g=Se("EmptyPlaceholder"),T=Se("ScrollSeekPlaceholder")||XD,S=Se("ListComponent"),E=Se("ItemComponent"),k=Se("GroupComponent"),R=Se("computeItemKey"),I=Se("isSeeking"),C=Se("groupIndices").length>0,F=Se("alignToBottom"),M=Se("initialItemFinalLocationReached"),N=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:y!==0?y:F?"auto":0,...M?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&g?b.createElement(g,ot(g,u)):b.createElement(S,{...ot(S,u),ref:v,style:N,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(P=>{const A=P.originalIndex,D=R(A+n.firstItemIndex,P.data,u);return I?b.createElement(T,{...ot(T,u),key:D,index:P.index,height:P.size,type:P.type||"item",...P.type==="group"?{}:{groupIndex:P.groupIndex}}):P.type==="group"?b.createElement(k,{...ot(k,u),key:D,"data-index":A,"data-known-size":P.size,"data-item-index":P.index,style:QD},d(P.index,u)):b.createElement(E,{...ot(E,u),...F0(E,P.data),key:D,"data-index":A,"data-known-size":P.size,"data-item-index":P.index,"data-item-group-index":P.groupIndex,style:JD},C?c(P.index,P.groupIndex,P.data,u):c(P.index,P.data,u))}))}),ej={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ts=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),tj={width:"100%",position:D0(),top:0,zIndex:1};function ot(e,t){if(typeof e!="string")return{context:t}}function F0(e,t){return{item:typeof e=="string"?void 0:t}}const nj=b.memo(function(){const t=Se("HeaderComponent"),n=Jt("headerHeight"),r=Se("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Se("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),rj=b.memo(function(){const t=Se("FooterComponent"),n=Jt("footerHeight"),r=Se("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Se("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null});function Xd({usePublisher:e,useEmitter:t,useEmitterValue:n}){return b.memo(function({style:s,children:i,...a}){const l=e("scrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:p,scrollToCallback:m}=y0(l,u,c,d);return t("scrollTo",m),t("scrollBy",p),b.createElement(c,{ref:f,style:{...ej,...s},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...ot(c,h)},i)})}function Qd({usePublisher:e,useEmitter:t,useEmitterValue:n}){return b.memo(function({style:s,children:i,...a}){const l=e("windowScrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),p=n("context"),{scrollerRef:m,scrollByCallback:v,scrollToCallback:y}=y0(l,u,c,zr,f);return fD(()=>(m.current=f||window,()=>{m.current=null}),[m,f]),t("windowScrollTo",y),t("scrollBy",v),b.createElement(c,{style:{position:"relative",...s,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...a,...ot(c,p)},i)})}const oj=({children:e})=>{const t=b.useContext(nl),n=Jt("viewportHeight"),r=Jt("fixedItemHeight"),o=Se("alignToBottom"),s=kn(b.useMemo(()=>Vs(n,i=>an(i,"height")),[n]));return b.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),b.createElement("div",{style:ts(o),ref:s,"data-viewport-type":"element"},e)},sj=({children:e})=>{const t=b.useContext(nl),n=Jt("windowViewportRect"),r=Jt("fixedItemHeight"),o=Se("customScrollParent"),s=Kd(n,o),i=Se("alignToBottom");return b.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(i),"data-viewport-type":"window"},e)},ij=({children:e})=>{const t=Se("TopItemListComponent")||"div",n=Se("headerHeight"),r={...tj,marginTop:`${n}px`},o=Se("context");return b.createElement(t,{style:r,...ot(t,o)},e)},aj=b.memo(function(t){const n=Se("useWindowScroll"),r=Se("topItemsIndexes").length>0,o=Se("customScrollParent"),s=o||n?uj:cj,i=o||n?sj:oj;return b.createElement(s,{...t},r&&b.createElement(ij,null,b.createElement($m,{showTopList:!0})),b.createElement(i,null,b.createElement(nj,null),b.createElement($m,null),b.createElement(rj,null)))}),{Component:lj,usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}=Bd(ZD,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},aj),cj=Xd({usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}),uj=Qd({usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}),dj=lj,Bm={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},fj={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:zm,ceil:Wm,floor:ga,min:uc,max:Ps}=Math;function hj(e){return{...fj,items:e}}function Hm(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function pj(e,t){return e&&e.column===t.column&&e.row===t.row}function Pi(e,t){return e&&e.width===t.width&&e.height===t.height}const mj=De(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:a,scrollContainerState:l,footerHeight:c,headerHeight:u},d,h,{propsReady:f,didMount:p},{windowViewportRect:m,useWindowScroll:v,customScrollParent:y,windowScrollContainerState:x,windowScrollTo:g},T])=>{const S=X(0),E=X(0),k=X(Bm),R=X({height:0,width:0}),I=X({height:0,width:0}),C=Ce(),F=Ce(),M=X(0),N=X(null),P=X({row:0,column:0}),A=Ce(),D=Ce(),L=X(!1),H=X(0),U=X(!0),O=X(!1);$e(q(p,be(H),he(([j,B])=>!!B)),()=>{ve(U,!1),ve(E,0)}),$e(q(wt(p,U,I,R,H,O),he(([j,B,z,V,,Y])=>j&&!B&&z.height!==0&&V.height!==0&&!Y)),([,,,,j])=>{ve(O,!0),Ud(1,()=>{ve(C,j)}),Pn(q(r),()=>{ve(n,[0,0]),ve(U,!0)})}),ue(q(D,he(j=>j!=null&&j.scrollTop>0),pn(0)),E),$e(q(p,be(D),he(([,j])=>j!=null)),([,j])=>{j&&(ve(R,j.viewport),ve(I,j==null?void 0:j.item),ve(P,j.gap),j.scrollTop>0&&(ve(L,!0),Pn(q(r,Oo(1)),B=>{ve(L,!1)}),ve(i,{top:j.scrollTop})))}),ue(q(R,se(({height:j})=>j)),o),ue(q(wt(me(R,Pi),me(I,Pi),me(P,(j,B)=>j&&j.column===B.column&&j.row===B.row),me(r)),se(([j,B,z,V])=>({viewport:j,item:B,gap:z,scrollTop:V}))),A),ue(q(wt(me(S),t,me(P,pj),me(I,Pi),me(R,Pi),me(N),me(E),me(L),me(U),me(H)),he(([,,,,,,,j])=>!j),se(([j,[B,z],V,Y,oe,W,Ee,,et,He])=>{const{row:tt,column:ce}=V,{height:Te,width:le}=Y,{width:Re}=oe;if(Ee===0&&(j===0||Re===0))return Bm;if(le===0){const jt=Gd(He,j),gr=jt===0?Math.max(Ee-1,0):jt;return hj(Hm(jt,gr,W))}const at=N0(Re,le,ce);let Pe,pt;et?B===0&&z===0&&Ee>0?(Pe=0,pt=Ee-1):(Pe=at*ga((B+tt)/(Te+tt)),pt=at*Wm((z+tt)/(Te+tt))-1,pt=uc(j-1,Ps(pt,at-1)),Pe=uc(pt,Ps(0,Pe))):(Pe=0,pt=-1);const J=Hm(Pe,pt,W),{top:ie,bottom:Oe}=Um(oe,V,Y,J),Ue=Wm(j/at),kt=Ue*Te+(Ue-1)*tt-Oe;return{items:J,offsetTop:ie,offsetBottom:kt,top:ie,bottom:Oe,itemHeight:Te,itemWidth:le}})),k),ue(q(N,he(j=>j!==null),se(j=>j.length)),S),ue(q(wt(R,I,k,P),he(([j,B,{items:z}])=>z.length>0&&B.height!==0&&j.height!==0),se(([j,B,{items:z},V])=>{const{top:Y,bottom:oe}=Um(j,V,B,z);return[Y,oe]}),Ke(Hs)),n);const $=X(!1);ue(q(r,be($),se(([j,B])=>B||j!==0)),$);const Z=Gt(q(me(k),he(({items:j})=>j.length>0),be(S,$),he(([{items:j},B,z])=>z&&j[j.length-1].index===B-1),se(([,j])=>j-1),Ke())),te=Gt(q(me(k),he(({items:j})=>j.length>0&&j[0].index===0),pn(0),Ke())),Q=Gt(q(me(k),be(L),he(([{items:j},B])=>j.length>0&&!B),se(([{items:j}])=>({startIndex:j[0].index,endIndex:j[j.length-1].index})),Ke(k0),Zn(0)));ue(Q,h.scrollSeekRangeChanged),ue(q(C,be(R,I,S,P),se(([j,B,z,V,Y])=>{const oe=R0(j),{align:W,behavior:Ee,offset:et}=oe;let He=oe.index;He==="LAST"&&(He=V-1),He=Ps(0,He,uc(V-1,He));let tt=gu(B,Y,z,He);return W==="end"?tt=zm(tt-B.height+z.height):W==="center"&&(tt=zm(tt-B.height/2+z.height/2)),et&&(tt+=et),{top:tt,behavior:Ee}})),i);const G=_t(q(k,se(j=>j.offsetBottom+j.bottom)),0);return ue(q(m,se(j=>({width:j.visibleWidth,height:j.visibleHeight}))),R),{data:N,totalCount:S,viewportDimensions:R,itemDimensions:I,scrollTop:r,scrollHeight:F,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:C,smoothScrollTargetReached:a,windowViewportRect:m,windowScrollTo:g,useWindowScroll:v,customScrollParent:y,windowScrollContainerState:x,deviation:M,scrollContainerState:l,footerHeight:c,headerHeight:u,initialItemCount:E,gap:P,restoreStateFrom:D,...h,initialTopMostItemIndex:H,gridState:k,totalListHeight:G,...d,startReached:te,endReached:Z,rangeChanged:Q,stateChanged:A,propsReady:f,stateRestoreInProgress:L,...T}},Ze(Yd,Lt,ci,O0,mr,qd,pr));function Um(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=gu(e,t,n,r[0].index),i=gu(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function gu(e,t,n,r){const o=N0(e.width,n.width,t.column),s=ga(r/o),i=s*n.height+Ps(0,s-1)*t.row;return i>0?i+t.row:i}function N0(e,t,n){return Ps(1,ga((e+n)/(ga(t)+n)))}const gj=De(()=>{const e=X(c=>`Item ${c}`),t=X({}),n=X(null),r=X("virtuoso-grid-item"),o=X("virtuoso-grid-list"),s=X(Zd),i=X("div"),a=X(zr),l=(c,u=null)=>_t(q(t,se(d=>d[c]),Ke()),u);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),yj=De(([e,t])=>({...e,...t}),Ze(mj,gj)),vj=b.memo(function(){const t=Qe("gridState"),n=Qe("listClassName"),r=Qe("itemClassName"),o=Qe("itemContent"),s=Qe("computeItemKey"),i=Qe("isSeeking"),a=rn("scrollHeight"),l=Qe("ItemComponent"),c=Qe("ListComponent"),u=Qe("ScrollSeekPlaceholder"),d=Qe("context"),h=rn("itemDimensions"),f=rn("gap"),p=Qe("log"),m=Qe("stateRestoreInProgress"),v=kn(b.useMemo(()=>y=>{const x=y.parentElement.parentElement.scrollHeight;a(x);const g=y.firstChild;if(g){const{width:T,height:S}=g.getBoundingClientRect();h({width:T,height:S})}f({row:Gm("row-gap",getComputedStyle(y).rowGap,p),column:Gm("column-gap",getComputedStyle(y).columnGap,p)})},[a,h,f,p]));return m?null:b.createElement(c,{ref:v,className:n,...ot(c,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(y=>{const x=s(y.index,y.data,d);return i?b.createElement(u,{key:x,...ot(u,d),index:y.index,height:t.itemHeight,width:t.itemWidth}):b.createElement(l,{...ot(l,d),className:r,"data-index":y.index,key:x},o(y.index,y.data,d))}))}),bj=b.memo(function(){const t=Qe("HeaderComponent"),n=rn("headerHeight"),r=Qe("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Qe("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),xj=b.memo(function(){const t=Qe("FooterComponent"),n=rn("footerHeight"),r=Qe("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Qe("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),wj=({children:e})=>{const t=b.useContext(j0),n=rn("itemDimensions"),r=rn("viewportDimensions"),o=kn(b.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]));return b.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),b.createElement("div",{style:ts(!1),ref:o},e)},Sj=({children:e})=>{const t=b.useContext(j0),n=rn("windowViewportRect"),r=rn("itemDimensions"),o=Qe("customScrollParent"),s=Kd(n,o);return b.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(!1)},e)},Tj=b.memo(function({...t}){const n=Qe("useWindowScroll"),r=Qe("customScrollParent"),o=r||n?Cj:Ej,s=r||n?Sj:wj;return b.createElement(o,{...t},b.createElement(s,null,b.createElement(bj,null),b.createElement(vj,null),b.createElement(xj,null)))}),{Component:UN,usePublisher:rn,useEmitterValue:Qe,useEmitter:L0}=Bd(yj,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},Tj),Ej=Xd({usePublisher:rn,useEmitterValue:Qe,useEmitter:L0}),Cj=Qd({usePublisher:rn,useEmitterValue:Qe,useEmitter:L0});function Gm(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yt.WARN),t==="normal"?0:parseInt(t??"0",10)}const Rj=De(()=>{const e=X(l=>b.createElement("td",null,"Item $",l)),t=X(null),n=X(null),r=X(null),o=X({}),s=X(Zd),i=X(zr),a=(l,c=null)=>_t(q(o,se(u=>u[l]),Ke()),c);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:o,computeItemKey:s,scrollerRef:i,TableComponent:a("Table","table"),TableHeadComponent:a("TableHead","thead"),TableFooterComponent:a("TableFoot","tfoot"),TableBodyComponent:a("TableBody","tbody"),TableRowComponent:a("TableRow","tr"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),FillerRow:a("FillerRow")}}),Pj=De(([e,t])=>({...e,...t}),Ze(M0,Rj)),kj=({height:e})=>b.createElement("tr",null,b.createElement("td",{style:{height:e}})),Ij=({height:e})=>b.createElement("tr",null,b.createElement("td",{style:{height:e,padding:0,border:0}})),Oj={overflowAnchor:"none"},Aj=b.memo(function(){const t=Ne("listState"),n=on("sizeRanges"),r=Ne("useWindowScroll"),o=Ne("customScrollParent"),s=on("windowScrollContainerState"),i=on("scrollContainerState"),a=o||r?s:i,l=Ne("itemContent"),c=Ne("trackItemSizes"),u=Ne("itemSize"),d=Ne("log"),{callbackRef:h,ref:f}=m0(n,u,c,a,d,void 0,o),[p,m]=b.useState(0);ef("deviation",D=>{p!==D&&(f.current.style.marginTop=`${D}px`,m(D))});const v=Ne("EmptyPlaceholder"),y=Ne("ScrollSeekPlaceholder")||kj,x=Ne("FillerRow")||Ij,g=Ne("TableBodyComponent"),T=Ne("TableRowComponent"),S=Ne("computeItemKey"),E=Ne("isSeeking"),k=Ne("paddingTopAddition"),R=Ne("firstItemIndex"),I=Ne("statefulTotalCount"),C=Ne("context");if(I===0&&v)return b.createElement(v,ot(v,C));const F=t.offsetTop+k+p,M=t.offsetBottom,N=F>0?b.createElement(x,{height:F,key:"padding-top",context:C}):null,P=M>0?b.createElement(x,{height:M,key:"padding-bottom",context:C}):null,A=t.items.map(D=>{const L=D.originalIndex,H=S(L+R,D.data,C);return E?b.createElement(y,{...ot(y,C),key:H,index:D.index,height:D.size,type:D.type||"item"}):b.createElement(T,{...ot(T,C),...F0(T,D.data),key:H,"data-index":L,"data-known-size":D.size,"data-item-index":D.index,style:Oj},l(D.index,D.data,C))});return b.createElement(g,{ref:h,"data-testid":"virtuoso-item-list",...ot(g,C)},[N,...A,P])}),_j=({children:e})=>{const t=b.useContext(nl),n=on("viewportHeight"),r=on("fixedItemHeight"),o=kn(b.useMemo(()=>Vs(n,s=>an(s,"height")),[n]));return b.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),b.createElement("div",{style:ts(!1),ref:o,"data-viewport-type":"element"},e)},Mj=({children:e})=>{const t=b.useContext(nl),n=on("windowViewportRect"),r=on("fixedItemHeight"),o=Ne("customScrollParent"),s=Kd(n,o);return b.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(!1),"data-viewport-type":"window"},e)},Dj=b.memo(function(t){const n=Ne("useWindowScroll"),r=Ne("customScrollParent"),o=on("fixedHeaderHeight"),s=on("fixedFooterHeight"),i=Ne("fixedHeaderContent"),a=Ne("fixedFooterContent"),l=Ne("context"),c=kn(b.useMemo(()=>Vs(o,x=>an(x,"height")),[o])),u=kn(b.useMemo(()=>Vs(s,x=>an(x,"height")),[s])),d=r||n?Nj:Fj,h=r||n?Mj:_j,f=Ne("TableComponent"),p=Ne("TableHeadComponent"),m=Ne("TableFooterComponent"),v=i?b.createElement(p,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:c,...ot(p,l)},i()):null,y=a?b.createElement(m,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:u,...ot(m,l)},a()):null;return b.createElement(d,{...t},b.createElement(h,null,b.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...ot(f,l)},[v,b.createElement(Aj,{key:"TableBody"}),y])))}),{Component:jj,usePublisher:on,useEmitterValue:Ne,useEmitter:ef}=Bd(Pj,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Dj),Fj=Xd({usePublisher:on,useEmitterValue:Ne,useEmitter:ef}),Nj=Qd({usePublisher:on,useEmitterValue:Ne,useEmitter:ef}),Lj=jj,Vj=e=>{const[t,n]=b.useState(0);return b.useEffect(()=>{const r=e.current;if(!r)return;const o=r.parentElement;if(!o)return;const s=()=>{n(o.clientHeight)};return o.addEventListener("resize",s),s(),()=>{o.removeEventListener("resize",s)}},[]),t},$j={Item:b.forwardRef(function(t,n){return w.jsx("li",{...t,ref:n,className:"flex items-center gap-1 justify-between"})}),List:b.forwardRef(function(t,n){return w.jsx("ul",{...t,ref:n,className:"space-y-3"})})},Bj=e=>{const t=b.useRef(null),n=Vj(t);return w.jsxs("div",{className:"flex flex-row gap-4",ref:t,children:[w.jsxs("div",{className:"py-8 space-y-4 min-w-64 w-fit flex flex-col whitespace-nowrap rounded-lg border border-card-border",children:[w.jsx("header",{className:"border-b border-card-border pb-2"}),w.jsxs("div",{className:"px-8 space-y-2",children:[w.jsx(ii,{rightLabel:"",title:"Search",placeholder:"Looking for..."}),w.jsx(dj,{height:n,useWindowScroll:!0,data:e.source,components:$j,itemContent:(r,o)=>w.jsx(b.Fragment,{children:w.jsx(Qb,{children:w.jsx(e.Item,{data:o})})})})]})]}),w.jsx("div",{children:w.jsx(mo,{children:w.jsx(hd,{})})}),w.jsx("div",{})]})};var zj=Object.defineProperty,Ym=Object.getOwnPropertySymbols,Wj=Object.prototype.hasOwnProperty,Hj=Object.prototype.propertyIsEnumerable,qm=(e,t,n)=>t in e?zj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uj=(e,t)=>{for(var n in t||(t={}))Wj.call(t,n)&&qm(e,n,t[n]);if(Ym)for(var n of Ym(t))Hj.call(t,n)&&qm(e,n,t[n]);return e},tf=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return!0;return!1},Gj=(e,t,n,r)=>rl(tf,e,t,n,r),Ao=e=>typeof e=="object",Jn=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||!Ao(e)&&!Ao(t))return e===t;if(e.prototype!==t.prototype)return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Jn(e[r],t[r]))},Yj=(e,t)=>(Ao(e)||Array.isArray(e))&&t?e[t]:e,qj=e=>(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1,ya=e=>/[0-9.]+/.test(e),Km=e=>["string","number"].includes(typeof e),Zm=e=>e==null||(e==null?void 0:e.length)===0||e==="",Xm={eq:Jn,is:Object.is,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,includes:(e,t)=>`${e}`.includes(t),notIncludes:(e,t)=>!`${e}`.includes(t),startsWith:(e,t)=>`${e}`.startsWith(t),endsWith:(e,t)=>`${e}`.endsWith(t),like:(e,t)=>new RegExp(`.*${t}.*`,"gi").test(`${e}`),alphabetical:(e,t)=>e.toString().localeCompare(t.toString()),empty:Zm,notEmpty:e=>!Zm(e),in:(e,t)=>tf(t,n=>Jn(e,n)),notIn:(e,t)=>V0(t,n=>!Jn(e,n))},Kj=e=>{if(e in Xm)return Xm[e];throw new Error("Linq - Symbol not found")},co=(e,t)=>{const n=[],r=e.length;for(let o=0;o<r;o++)t(e[o],o,e)&&n.push(e[o]);return n},rl=(e,t,n,r,o)=>{if(typeof n=="function")return e(t,n);const s=Kj(r);return n&&r&&o!==void 0?e(t,i=>s(i[n],o)):e(t,i=>s(i,o))},Zj=(e,t,n,r)=>rl(co,e,t,n,r),V0=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Xj=(e,t,n,r)=>rl(V0,e,t,n,r),$0=e=>{if(e===null)return null;const t=Uj({},e);return Object.keys(t).forEach(n=>t[n]=Ao(e[n])?$0(e[n]):e[n]),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},Qm=(e,t)=>{if(Ao(t)){for(let n=0;n<e.length;n++){const r=e[n];if(Jn(t,r))return!0}return!1}for(let n=0;n<e.length;n++){const r=e[n];if(Jn(t,r))return!0}return!1},Qj=(e,t)=>{const n=new Map(e.map(r=>[r[t],r]));return Object.fromEntries(n.entries())},Jj=e=>co(e,(t,n,r)=>Ao(t)?n===r.findIndex(o=>Jn(o,t)):n===r.indexOf(t)),eF=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return e[r]},B0=(e,t)=>{const n=new Map;return e.forEach(r=>{const o=t(r),s=n.get(o)||[];s.push(r),n.set(o,s)}),Object.fromEntries(n.entries())},tF=(e,t)=>B0(e,n=>n[t]),Jm=(e,t)=>{const n=[];let r=0;const o=e.length;for(r;r<o;r++){const s=t(e[r],r,e);n.push(s)}return n},nF=(e,t)=>{let n=Number.parseInt(e,10),r=Number.parseInt(t,10);return n>r?[r,n]:[n,r]},rF=(e,t,n=1)=>{const r=[];let o=e.charCodeAt(0);const s=t.charCodeAt(0);for(;o<=s;o+=n)r.push(String.fromCharCode(o));return ya(e)&&ya(t)?r.map(i=>Number.parseInt(i)):r},dc=(e,t,n=1)=>{let r=Math.abs(n);if((e.length>1||t.length>1)&&ya(e)&&ya(t)){const o=[],[s,i]=nF(e,t);for(let a=s;a<=i;a+=r)o.push(a);return o}return rF(e,t,r)},oF=(e,t,n=1)=>{if(t===void 0){const[r,o,s]=e.split("..");return s===void 0?dc(r,o,1):dc(r,s,Number.parseInt(o,10))}return Km(e)&&Km(t)?dc(`${e}`,`${t}`,n):Array.from({length:e},(r,o)=>o*Math.abs(t))},fc=(e,t,n)=>{let r=t;const o=n.length;for(let s=0;s<o;s++){const i=n[s];r=e(r,i,s,n)}return r},eg=e=>{const t=Array.from(e.values());let n=null,r=null,o=t.length;for(n=0;n<o/2;n+=1){r=o-1-n;let s=t[n];t[n]=t[r],t[r]=s}return t},sF=(e,t)=>{if(typeof t=="number")return e.slice(t);let n=e.length;for(let r=0;r<n;r++){const o=e[r];if(t(o,r,e))return e.slice(r)}return e.slice(0)},iF=(e,t,n,r)=>rl(sF,e,t,n,r),tg=(e,t)=>{const n=[...e];return t===void 0?n.sort():typeof t=="function"?n.toSorted(t):n.toSorted(qj(t))},z0=(e=>(e.Asc="asc",e.Desc="desc",e))(z0||{}),aF=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.key,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),lF=(e,t)=>e.sort(aF(t)),cF=(e,t)=>{if(t===void 0)return[...new Set(e).values()];const n=new Set;return Array.isArray(t)?[...new Set(t)]:co(e,r=>{const o=t?n.has(r[t]):n.has(t);return t&&(o||n.add(r[t])),!o})},uF=class yu{constructor(t=[]){this.array=t}static Range(...t){return oF(...t)}static New(t){return new yu(t)}Where(t,n,r){return this.array=Zj(this.array,t,n,r),this}Some(t,n,r){return Gj(this.array,t,n,r)}All(t,n,r){return Xj(this.array,t,n,r)}Reverse(){return this.array=eg(this.array),this}Add(t){return this.array=Array.isArray(t)?this.array.concat(t):this.array.concat([t]),this}Prepend(t){return this.array=Array.isArray(t)?t.concat(this.array):[t].concat(this.array),this}Select(t){return t===void 0?this.array:this.array.map(t)}Take(t,n){return n!==void 0?this.array=this.array.slice(t,Math.max(0,n)):this.array=this.array.slice(t),this}Head(){return this.array[0]}Tail(){return this.Skip(1)}Skip(t,n,r){return this.array=iF(this.array,t,n,r),this}Distinct(){return this.array=Jj(this.array),this}First(t){return t===void 0?this.array[0]:eF(this.array,t)||null}Last(t){const n=this.array.length;if(t===void 0)return this.array[n-1];for(let r=n;r!==0;r--)if(t(this.array[r],r,this.array))return this.array[r]}Sum(t){return t===void 0?fc((n,r)=>n+r,0,this.array):fc((n,r)=>n+Yj(r,t),0,this.array)}Average(t){return this.Sum(t)/this.array.length}GroupBy(t){return tF(this.array,t)}GroupWith(t){return B0(this.array,t)}Except(t){return co(this.array,n=>!Qm(t,n))}Intersect(t){return co(this.array,n=>Qm(t,n))}OrderBy(t,n){let r;return r=t?tg(this.array,t):this.array.toSorted(),this.array=n==="desc"?eg(r):r,this}Includes(t){return tf(this.array,n=>Jn(n,t))}In(t){const n=t.length;for(let r=0;r<n;r++){const o=t[r];if(this.Includes(o))return!0}return!1}Reduce(t,n){return fc(t,n??this.array[0],this.array)}Empty(){return this.array.length===0}ToMap(t){return new Map(Jm(this.array,n=>[t,n]))}Zip(t,n){return Jm(this.array,(r,o)=>n(r,t[o]))}Count(t){return t===void 0?this.array.length:co(this.array,t).length}Get(t){return this.array[t]}Clone(){return new yu($0(this.array))}ToObject(t){return Qj(this.array,t)}Sort(t){return Array.isArray(t)?lF(this.array,t):tg(this.array,t)}Unique(t){return cF(this.array,t)}},W0=uF,vu={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=(v,y)=>{try{Object.keys(v).forEach(y)}catch(x){window.console.log(x)}},n=v=>v==null,r=v=>{const y=typeof v;return y==="string"||y==="number"||y==="boolean"||n(v)},o=(v,y)=>{const x=y.getItem(v);try{return JSON.parse(x)}catch{return x??null}},s=v=>Object.keys(v).reduce((y,x)=>({...y,[x]:o(x,v)}),{}),i=v=>v instanceof Date?v:typeof v=="number"?new Date(new Date*1+v*864e5):v,a="1969-12-31T23:59:59.000Z",l=()=>document.cookie===""?{}:document.cookie.split("; ").map(v=>v.split("=")).reduce((v,y)=>(v[decodeURIComponent(y[0].trim())]=decodeURIComponent(y[1].trim()),v),{}),c=new Set,u=()=>{const v=l();c.forEach(y=>y(v))},d=[{name:"expires",parse:v=>`expires=${i(v.expires??a)}`},{name:"maxAge",parse:v=>v.maxAge?`max-age=${i(v.expires??a)}`:""},{name:"path",parse:v=>`path=${v.path??"/"}`},{name:"sameSite",parse:v=>`samesite=${v.sameSite??"strict"}`},{name:"useSecure",parse:v=>`${v.useSecure??!0?"secure":""}`},{name:"domain",parse:v=>{const y=v.domain??"";return y===""?"":`domain=${v.multiDomain?".":""}${y}`}},{name:"partitioned",parse:v=>v.partitioned?"Partitioned":""}],h={json:l,listener:v=>(c.add(v),()=>c.delete(v)),clearListeners:()=>c.clear(),has:v=>document.cookie.split(";").some(y=>y.trim().startsWith(`${v}=`)),deleteAll:()=>{document.cookie.split(";").forEach(v=>{document.cookie=v.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}),u()},get:v=>{const y=h.json()[v];if(n(y))return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}},delete:v=>{document.cookie=`${encodeURIComponent(v)}=;expires=${new Date().toUTCString()}`,u()},set:(v,y,x={})=>{const g=r(y)?y:encodeURIComponent(JSON.stringify(y)),T=d.reduce((S,E)=>{const k=E.parse(x);return k===""?S:S.concat(k)},[`${encodeURIComponent(v)}=${g}`]).join(";");document.cookie=T,u()}},f=v=>{const y=new Set,x=g=>{v().removeItem(g);const T=s(v());y.forEach(S=>S(T))};return{delete:x,listener:g=>(y.add(g),()=>y.delete(g)),clearListeners:()=>y.clear(),json:(g=!1)=>g?s(v()):v(),has:g=>{const T=v().getItem(g);return!n(T)},deleteAll:()=>{t(v(),x),y.forEach(g=>g(v()))},get:g=>o(g,v()),set:(g,T)=>{v().setItem(g,JSON.stringify(T)),y.forEach(S=>S(v()))}}},p=f(()=>window.sessionStorage),m=f(()=>window.localStorage);e.Cookie=h,e.LocalStorage=m,e.SessionStorage=p,e.createStorage=f})(vu);const nf=e=>e.headerLabel??e.thead??e.id,rf=e=>e.map(t=>({value:t.id,label:t.thead??t.headerLabel??t.id}));var uo=(e=>(e.Boolean="boolean",e.Number="number",e.Select="select",e.Text="text",e))(uo||{});const of=e=>e.type==="number"?e.valueAsNumber:e.value,dF=e=>{let t=[];return e({add:(o,s,i)=>t.push({...i,id:o,thead:s}),remove:o=>t=t.filter(s=>s.id!==o)}),t},fF={},hF=(e,t=fF)=>{const n=ea()?null:vu.LocalStorage.get(`@unamed/table-${e}`)||null,[r,o]=bd({name:e,groups:t.groups||(n==null?void 0:n.groups)||[],sorters:t.sorters||(n==null?void 0:n.sorters)||[],filters:t.filters||(n==null?void 0:n.filters)||[],cols:t.cols||(n==null?void 0:n.cols)||[]},s=>{const i=a=>{const l=s.state(),c={...l,...a};return ea()||vu.LocalStorage.set(`@unamed/table-${l.name}`,c),c};return{set:a=>i(a)}});return{...r,...o,name:e}},bu=(e,t,n,r={})=>{var l;const o=e.id,s=e.type??uo.Text,i=(l=t[s])==null?void 0:l[0].value,a=n[i];return{id:Ha(),operation:a,label:nf(e),name:o,type:s,value:"",...r}},sf=()=>{const e=Wt(),t=b.useMemo(()=>({contains:{value:"contains",label:e.tableFilterTypeContains,symbol:"includes"},is:{value:"is",label:e.tableFilterTypeIs,symbol:"is"},isNot:{value:"isNot",label:e.tableFilterTypeIsNot,symbol:"!=="},notContains:{value:"notContains",label:e.tableFilterTypeNotContains,symbol:"notIncludes"},lessThan:{value:"lessThan",label:e.tableFilterTypeLessThan,symbol:"<="},greaterThan:{value:"greaterThan",label:e.tableFilterTypeGreaterThan,symbol:">="},startsWith:{value:"startsWith",label:e.tableFilterTypeStartsWith,symbol:"startsWith"},endsWith:{value:"endsWith",label:e.tableFilterTypeEndsWith,symbol:"endsWith"}}),[e]);return{operationOptions:b.useMemo(()=>({[uo.Text]:[t.is,t.isNot,t.contains,t.notContains,t.startsWith,t.endsWith],[uo.Boolean]:[t.is,t.isNot],[uo.Number]:[t.is,t.isNot,t.greaterThan,t.lessThan]}),[e]),operations:t}},pF=e=>{const t=Wt(),{operationOptions:n,operations:r}=sf(),o=()=>{const c=e.cols.at(0);e.set(u=>[...u,bu(c,n,r)])},s=c=>{const u=c.target.dataset.id||"",d=c.target.value;e.set(h=>h.map(f=>{if(u!==f.id)return f;const p=e.cols.find(m=>d===m.id);return bu(p,n,r,{value:""})}))},i=c=>{const u=c.target.dataset.id||"",d=c.target.value;e.set(h=>h.map(f=>f.id===u?{...f,operation:r[d]}:f))},a=c=>{const u=c.currentTarget.dataset.id||"";e.set(d=>d.filter(h=>h.id!==u))},l=c=>{const u=c.target.dataset.id||"",d=of(c.target);e.set(h=>h.map(f=>f.id===u?{...f,value:d}:f))};return w.jsx(b.Fragment,{children:w.jsx(Xo,{arrow:!0,title:t.tableFilterDropdownTitle,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(mP,{size:14}),t.tableFilterLabel," ",e.filters.length===0?"":` (${e.filters.length})`]}),children:w.jsxs("ul",{className:"mt-4 space-y-2",children:[e.filters.map(c=>{const u=n[c.type];return w.jsxs("li",{className:"flex flex-nowrap gap-3",children:[w.jsx(Nr,{options:e.options,title:t.tableFilterColumnTitle,placeholder:t.tableFilterColumnPlaceholder,value:c.name,"data-id":c.id,onChange:s}),w.jsx(Nr,{"data-id":c.id,onChange:i,value:c.operation.value,options:u,title:t.tableFilterOperatorTitle,placeholder:t.tableFilterOperatorPlaceholder}),w.jsx(ii,{"data-id":c.id,onChange:l,title:t.tableFilterValueTitle,placeholder:t.tableFilterValuePlaceholder,type:c.type,value:c.value,optionalText:""}),w.jsx("div",{className:"flex items-center justify-center mt-5",children:w.jsx("button",{"data-id":c.id,type:"button",onClick:a,children:w.jsx(So,{className:"text-danger",size:16})})})]},`filter-select-${c.id}`)}),w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[w.jsx(pd,{size:14})," ",t.tableFilterNewFilter]})})]})})})},mF=({filter:e,onDelete:t,set:n})=>{const r=Wt(),{operationOptions:o,operations:s}=sf(),i=l=>{const c=l.target.value,u=l.target.dataset.id||"";n(d=>d.map(h=>h.id===u?{...h,operation:s[c]}:h))},a=l=>{const c=l.target.dataset.id||"",u=of(l.target);n(d=>d.map(h=>h.id===c?{...h,value:u}:h))};return w.jsxs("div",{className:"flex flex-nowrap items-center gap-4 py-2",children:[w.jsx(Nr,{"data-id":e.id,onChange:i,options:o[e.type],title:r.tableFilterColumnTitle,placeholder:r.tableFilterColumnPlaceholder,value:e.operation.value}),w.jsx(ii,{"data-id":e.id,onChange:a,type:e.type,value:e.value,title:r.tableFilterValueTitle,placeholder:r.tableFilterValueTitle}),w.jsx("button",{onClick:t,"data-id":e.id,type:"button",className:"mt-4",children:w.jsx(So,{className:"text-danger",size:14})})]})},gF=({item:e,onPointerDown:t})=>{const n=wo(0);return w.jsxs(za.Item,{onPointerDown:t,id:e.groupId,className:"flex flex-row items-center gap-2",value:e,style:{y:n},children:[w.jsx("button",{type:"button",className:"cursor-grab",children:w.jsx(pP,{size:14})}),w.jsx("span",{children:e.groupName})]},e.groupId)},yF=e=>{var l;const t=Wt(),n=rf(e.cols),r=eP(),[o,s]=b.useState(((l=e.groups[0])==null?void 0:l.thead)||""),i=c=>{var v;const u=c.target,d=u.value,h=u.options.selectedIndex,f=((v=u.options.item(h))==null?void 0:v.label)||"";s(f);const p=new W0(e.rows).GroupBy(d),m=e.cols.find(y=>y.id===d);e.setGroups(y1(p).map((y,x)=>{const g=p[y];return{...m,groupId:Ha(),groupKey:d,index:x,rows:g,groupName:y}}))},a=()=>e.setGroups([]);return w.jsx(b.Fragment,{children:w.jsxs(Xo,{arrow:!1,title:t.tableGroupLabel,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(vP,{size:14}),t.tableGroupLabelWithCount,e.groups.length>0?` - ${o}(${e.groups.length})`:""]}),children:[w.jsxs("div",{className:"flex flex-nowrap items-center",children:[w.jsx(Nr,{value:o,title:"Tipo de agrupamento",onChange:i,options:n,placeholder:"Agrupar por..."}),w.jsx(mo,{className:"mt-4",onClick:a,theme:"raw","data-id":o,children:w.jsx(So,{size:16,className:"text-danger"})})]}),e.groups.length>0?w.jsxs("section",{className:"my-4",children:[w.jsx("header",{children:w.jsx("h2",{className:"text-xl font-medium",children:"Order groups"})}),w.jsx(wR,{children:w.jsx(za.Group,{axis:"y",className:"relative space-y-2",drag:!0,dragControls:r,dragListener:!1,layoutScroll:!0,onReorder:e.setGroups,values:e.groups,children:e.groups.map(c=>w.jsx(gF,{item:c,onPointerDown:u=>{r.start(u),e.setGroups([...e.groups])}},c.groupId))})})]}):null]})})},vF=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.value,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),bF=(e,t)=>e.toSorted(vF(t)),H0=(e,t,n)=>({id:Ha(),type:n,value:e.id,label:t}),xF=e=>{const t=Wt(),n={asc:{label:t.tableSortAsc,value:"asc"},desc:{label:t.tableSortDesc,value:"desc"}},r=[n.asc,n.desc],o=()=>{const l=e.cols[0];l&&e.set(c=>[...c,H0(l,n.asc.label,n.asc.value)])},s=l=>c=>{const u=c.target.value;e.set(d=>d.map(h=>h.id===l?{...h,value:u}:h))},i=l=>c=>{const u=c.target.value;e.set(d=>d.map(h=>h.id===l?{...h,type:u}:h))},a=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))};return w.jsx(b.Fragment,{children:w.jsx(Xo,{title:t.tableSortDropdownTitle,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(Ev,{size:14}),t.tableSortOrderByLabel," ",e.sorters.length===0?"":` (${e.sorters.length})`]}),children:w.jsxs("ul",{className:"mt-4 space-y-2",children:[e.sorters.map(l=>w.jsxs("li",{className:"flex flex-nowrap gap-3",children:[w.jsx(Nr,{options:e.options,value:l.value,onChange:s(l.id),title:t.tableSortOrderInputTitle,placeholder:t.tableSortOrderInputPlaceholder}),w.jsx(Nr,{onChange:i(l.id),value:l.type,options:r,title:t.tableSortTypeInputTitle,placeholder:t.tableSortTypeInputPlaceholder}),w.jsx("button",{className:"mt-4","data-id":l.id,onClick:a,children:w.jsx(So,{className:"text-danger",size:14})})]},`sorter-select-${l.id}`)),w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[w.jsx(pd,{size:14})," ",t.tableSortAddButton]})})]})})})},wF=e=>{const t=Wt(),[n,r]=b.useState(()=>{const a=e.sorters.find(l=>l.value===e.col.id);return a?a.type:"undefined"}),o=()=>r(a=>a==="undefined"?"asc":a==="asc"?"desc":"undefined");b.useEffect(()=>{e.setSorters(a=>{if(n==="undefined")return a.filter(u=>u.value!==e.col.id);const l=a.findIndex(u=>u.value===e.col.id),c=H0(e.col,n,n);return l===-1?[...a,c]:(a[l]=c,[...a])})},[n,e.col]);const s=`${e.col.id}-sorter-id`,i=nf(e.col);return w.jsxs("button",{"aria-labelledby":s,className:"isolate flex items-center",onClick:o,type:"button",children:[w.jsxs("span",{id:s,className:"sr-only",children:[t.tableSortDropdownTitle," ",i]}),n==="asc"?w.jsx(aP,{size:14}):null,n==="desc"?w.jsx(iP,{size:14}):null,n==="undefined"?w.jsx(Ev,{size:14}):null]})},SF=e=>w.jsx("header",{className:"min-w-full mb-1",children:w.jsxs("div",{className:"flex flex-wrap min-w-full items-center justify-between gap-x-4 gap-y-1",children:[w.jsxs("div",{className:"flex w-fit items-centeend gap-4 whitespace-nowrap py-2",children:[w.jsx("span",{children:w.jsx(pF,{cols:e.cols,options:e.options,filters:e.filters,set:e.setFilters})}),w.jsx("span",{children:w.jsx(xF,{options:e.options,cols:e.cols,sorters:e.sorters,set:e.setSorters})}),w.jsx("span",{children:w.jsx(yF,{rows:e.rows,groups:e.groups,setGroups:e.setGroups,options:e.options,cols:e.cols})})]}),w.jsx("ul",{className:"flex flex-wrap w-full flex-1 flex-grow flex-row items-center md:justify-end gap-4",children:e.filters.map(t=>w.jsxs("li",{className:"flex gap-1 items-center rounded-xl border border-card-border px-4 py-0.5",children:[w.jsxs("span",{children:[w.jsx("span",{className:"size-3 mr-2 aspect-square bg-primary inline-block rounded-full","aria-hidden":"true"}),t.label," ",t.operation.label.toLowerCase(),":"]}),w.jsxs("div",{className:"relative w-min min-w-[1ch]",children:[w.jsx("span",{"aria-hidden":"true",className:"invisible whitespace-pre p-0",children:t.value||" "}),w.jsx("input",{type:t.type,value:t.value,className:"absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-none [appearance:textfield] after:empty:text-primary/70 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onChange:n=>{const r=of(n.target);e.setFilters(o=>o.map(s=>t.id===s.id?{...s,value:r}:s))}})]})]},`filter-table-${t.id}`))})]})});function TF(e,t){if(!e||!t)return[];const n=[1];if(e===1&&t===1)return n;e>4&&n.push("-");let r=2;const o=e-r,s=e+r;for(let a=o>2?o:2;a<=Math.min(t,s);a++)n.push(a);const i=t-2;return s+1!==i&&s+1<t&&n.push("_"),s<t&&(n.push(t-2),n.push(t-1),n.push(t)),Array.from(new Set(n))}const EF=e=>{const t=b.useId(),n=Wt(),r=e.asLink||"button",o=b.useMemo(()=>TF(e.current,e.pages),[e.current,e.pages]),s=e.current<e.pages;return w.jsxs("footer",{className:"flex px-1 py-4 items-center justify-center gap-4 lg:justify-between flex-wrap lg:flex-nowrap",children:[w.jsx("p",{children:w.jsx(n.tablePaginationFooter,{...e,sizes:e.sizes,select:e.onChangeSize&&Array.isArray(e.sizes)?w.jsxs(b.Fragment,{children:[w.jsx("label",{htmlFor:t,children:n.tablePaginationSelectLabel}),w.jsx("select",{id:t,value:e.size,className:"cursor-pointer bg-transparent",onChange:i=>{var a;(a=e.onChangeSize)==null||a.call(e,Number(i.target.value))},children:e.sizes.map(i=>w.jsx("option",{value:i,children:i},`pagination-opt-${i}`))})," "]}):null})}),w.jsx("nav",{children:w.jsxs("ul",{className:"flex items-center gap-2",children:[e.current>1?w.jsx("li",{children:w.jsx(r,{href:"previous",className:"",children:n.tablePaginationPrevious})}):null,o.map(i=>i===null?null:w.jsx(b.Fragment,{children:typeof i=="string"?w.jsx("li",{children:"..."}):w.jsx("li",{children:w.jsx(r,{href:i,className:`cursor-pointer px-3 py-1 transition-colors border-b-2 hover:text-primary-subtle hover:border-primary-subtle proportional-nums ${i===e.current?"text-primary border-primary":"border-transparent"}`,children:i})})},`pagination-${i}`)),s?w.jsx("li",{children:w.jsx(r,{href:"next",className:"",children:n.tablePaginationNext})}):null]})})]})},CF={opacity:1},RF={opacity:.75,backgroundColor:"var(--table-border)"},PF={opacity:0,transition:{duration:.4,type:"spring"}},kF=e=>{var d;const t=Wt(),n=e.filters.filter(h=>h.name===e.header.id),o=n.length>0?gP:yP,{operationOptions:s,operations:i}=sf(),a=h=>{const f=h.currentTarget.dataset.id||"";return e.setFilters(p=>p.filter(m=>m.id!==f))},l=e.sorters.find(h=>e.header.id===h.value),c=l!=null&&l.type?l.type===z0.Asc?"ascending":"descending":"none",u=nf(e.header);return w.jsx(za.Item,{...e.header.thProps,as:"th",layout:!0,exit:PF,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,role:"columnheader",value:e.header,whileDrag:RF,"aria-sort":c,"aria-busy":e.loading,animate:CF,className:`hidden px-2 py-4 font-medium first:table-cell md:table-cell ${((d=e.header.thProps)==null?void 0:d.className)??""}`,children:w.jsx("span",{className:"flex items-center justify-between",children:w.jsxs("span",{className:"flex items-center gap-1",children:[w.jsx(Xo,{arrow:!0,trigger:w.jsxs("span",{children:[w.jsxs("span",{id:`${e.header.id}-filter-dropdown-button`,className:"sr-only",children:[t.tableFilterDropdownTitleUnique," ",u]}),e.inlineFilter?w.jsx(o,{"aria-labelledby":`${e.header.id}-filter-dropdown-button`,size:14}):null]}),title:w.jsxs("span",{className:"font-medium text-lg",children:[t.tableFilterDropdownTitleUnique," ",w.jsx("span",{className:"text-primary",children:u})]}),children:n.length===0===null?null:w.jsxs("ul",{className:"font-medium",children:[n.map(h=>w.jsx("li",{className:"my-1",children:w.jsx(mF,{onDelete:a,filter:h,set:e.setFilters})},`thead-filter-${h.id}`)),w.jsx("li",{children:w.jsxs("button",{onClick:()=>e.setFilters(h=>h.concat(bu(e.header,s,i))),type:"button",className:"flex items-center gap-1 text-primary",children:[w.jsx(pd,{size:14})," ",t.tableFilterNewFilter]})})]})}),w.jsx("span",{className:"pointer-events-auto text-balance text-base",children:e.header.thead}),e.inlineSorter?w.jsx(wF,{col:e.header,setSorters:e.setSorters,sorters:e.sorters}):null]})})})},IF=e=>w.jsx(za.Group,{as:"tr",role:"row",axis:"x",drag:!0,layout:!0,layoutRoot:!0,layoutScroll:!0,initial:!1,values:e.headers,onReorder:e.setCols,className:"border-none bg-table-background text-lg",children:w.jsx(ni,{children:e.headers.map(t=>w.jsx(kF,{inlineFilter:e.inlineFilter,inlineSorter:e.inlineSorter,loading:e.loading,setFilters:e.setFilters,filters:e.filters,setSorters:e.setSorters,sorters:e.sorters,header:t},`header-child-item-${t.id}`))})}),U0=b.createContext({}),OF=()=>b.useContext(U0),AF=b.forwardRef((e,t)=>w.jsx("tbody",{...e,role:"rowgroup",className:`divide-y divide-table-border ${e.className??""}`,ref:t,children:w.jsx(ni,{children:e.children})})),_F=b.forwardRef((e,t)=>w.jsx("table",{...e,ref:t,role:"table",className:`table min-w-full table-auto divide-y divide-table-border text-left ${e.className??""}`})),MF=b.forwardRef(({context:e,...t},n)=>{var s;const r=OF(),o={...t==null?void 0:t.style,sticky:xn.number(r.sticky)?`${r.sticky}px`:(s=t==null?void 0:t.style)==null?void 0:s.sticky};return w.jsx("thead",{...t,style:o,role:"rowgroup",className:"shadow-xs group:sticky top-0 bg-card-background",ref:n})}),DF=b.forwardRef(({context:e,item:t,...n},r)=>w.jsx("tr",{...n,role:"row",ref:r,className:`table-row ${(n==null?void 0:n.className)??""}`})),jF=b.forwardRef((e,t)=>e.context.loadingMore?w.jsx("tfoot",{...e,ref:t,className:"bg-card-background",children:w.jsx("tr",{role:"row",className:"bg-card-background",children:w.jsx("td",{colSpan:999,className:"h-14 bg-card-background px-2",children:w.jsx("span",{className:"block h-2 w-full animate-pulse rounded bg-foreground opacity-60"})})})}):null),FF={TableHead:MF,Table:_F,TableBody:AF,TableRow:DF,TableFoot:jF},NF=[0,0,0,0,0,0,0,0,0,0],LF=(e,t,n)=>{const r=n.cols,o=n.loading;return w.jsx(b.Fragment,{children:r.map((s,i)=>{var d;const a=`${i},${e}`,l=ib(t,s.id),c=s.Element,u=((d=s.cellProps)==null?void 0:d.className)||"";return b.createElement("td",{...s.cellProps,role:"cell","data-matrix":a,key:`accessor-${e}-${i}`,className:`hidden h-14 border-none px-2 first:table-cell md:table-cell ${u}`},o?w.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}):c?w.jsx(c,{row:t,matrix:a,col:s,rowIndex:e,value:l}):w.jsx(b.Fragment,{children:xn.nil(l)?"":l}))})})},VF=()=>w.jsx(b.Fragment,{}),ng=({filters:e,pagination:t=null,onScrollEnd:n,useControl:r=!1,setCols:o,setFilters:s,sorters:i,cols:a,border:l=!1,setSorters:c,...u})=>{const d=b.useRef(null),[h,f]=b.useState(!1),p=du(n),m=du(u.loadingMore),v=b.useMemo(()=>{if(u.loading)return NF;if(r)return u.rows;const y=new W0(u.rows);return e.length>0&&e.forEach(x=>x.value===""||Number.isNaN(x.value)?void 0:y.Where(x.name,x.operation.symbol,x.value)),i.length===0?y.Select():bF(y.Select(),i)},[u.rows,e,i,u.loading]);return b.useEffect(()=>{if(d.current===null)return()=>{};const y=d.current,x=new IntersectionObserver(g=>{var E;return g[g.length-1].isIntersecting&&m.current?((E=p.current)==null||E.call(p),void f(!0)):f(!1)});return x.observe(y),()=>x.disconnect()},[]),w.jsxs("div",{className:"min-w-full",children:[w.jsxs("div",{className:`group rounded-lg px-1 ${l?"border border-table-border":""}`,children:[w.jsx(Lj,{data:v,useWindowScroll:!0,components:FF,totalCount:v.length,itemContent:LF,context:{loading:u.loading,loadingMore:u.loadingMore,cols:a},fixedFooterContent:h?VF:null,fixedHeaderContent:()=>w.jsx(IF,{filters:e,headers:a,inlineFilter:u.inlineFilter,inlineSorter:u.inlineSorter,loading:!!u.loading,setCols:o,setFilters:s,setSorters:c,sorters:i})}),w.jsx("div",{"aria-hidden":"true",ref:d,className:"h-0.5 w-full"})]}),t!==null?w.jsx(EF,{...t}):null]})},$F=(e,t)=>typeof t=="function"?t(e):t,ki=(e,t,n)=>e===t||n==null?void 0:n(t),BF=e=>{const t=b.useMemo(()=>({sticky:e.sticky}),[e.sticky]),n=e.operations??!0,r=b.useMemo(()=>rf(e.cols),[e.cols]),[o,s]=bd({cols:e.cols,filters:e.filters??[],groups:e.groups??[],sorters:e.sorters??[]},i=>{const a=l=>c=>{const u=i.state();return{...u,[l]:$F(u[l],c)}};return{cols:a("cols"),filters:a("filters"),groups:a("groups"),sorters:a("sorters")}},{postMiddleware:[(i,a)=>{var l;return(l=e.set)==null||l.call(e,i),ki(a.filters??[],i.filters??[],e.setFilters),ki(a.sorters??[],i.sorters??[],e.setSorters),ki(a.groups??[],i.groups??[],e.setGroups),ki(a.cols??[],i.cols??[],e.setCols),i}]});return w.jsx(U0.Provider,{value:t,children:w.jsxs("div",{className:"relative min-w-full",children:[n?w.jsx(SF,{cols:o.cols,filters:o.filters,groups:o.groups,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,options:r,pagination:e.pagination??null,rows:e.rows,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters}):null,o.groups.length===0?w.jsx(ng,{...e,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,onScrollEnd:e.onScrollEnd,cols:o.cols,filters:o.filters,groups:o.groups,index:0,optionCols:r,options:r,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters,pagination:e.pagination??null}):w.jsx("div",{className:"flex flex-wrap gap-4",children:o.groups.map((i,a)=>w.jsx(Ct.div,{className:"min-w-full",children:w.jsx(ng,{...e,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,pagination:null,onScrollEnd:e.onScrollEnd,cols:o.cols,filters:o.filters,group:i,groups:o.groups,index:a,optionCols:r,options:r,rows:i.rows,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters})},`group-${i.groupId}`))})]})})};var zF=String.prototype.replace,WF=/%20/g,hc={RFC1738:"RFC1738",RFC3986:"RFC3986"},af={default:hc.RFC3986,formatters:{RFC1738:function(e){return zF.call(e,WF,"+")},RFC3986:function(e){return String(e)}},RFC1738:hc.RFC1738,RFC3986:hc.RFC3986},HF=af,pc=Object.prototype.hasOwnProperty,Rr=Array.isArray,dn=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),UF=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(Rr(r)){for(var o=[],s=0;s<r.length;++s)typeof r[s]<"u"&&o.push(r[s]);n.obj[n.prop]=o}}},G0=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(r[o]=t[o]);return r},GF=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(Rr(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!pc.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var o=t;return Rr(t)&&!Rr(n)&&(o=G0(t,r)),Rr(t)&&Rr(n)?(n.forEach(function(s,i){if(pc.call(t,i)){var a=t[i];a&&typeof a=="object"&&s&&typeof s=="object"?t[i]=e(a,s,r):t.push(s)}else t[i]=s}),t):Object.keys(n).reduce(function(s,i){var a=n[i];return pc.call(s,i)?s[i]=e(s[i],a,r):s[i]=a,s},o)},YF=function(t,n){return Object.keys(n).reduce(function(r,o){return r[o]=n[o],r},t)},qF=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},mc=1024,KF=function(t,n,r,o,s){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=mc){for(var c=i.length>=mc?i.slice(l,l+mc):i,u=[],d=0;d<c.length;++d){var h=c.charCodeAt(d);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===HF.RFC1738&&(h===40||h===41)){u[u.length]=c.charAt(d);continue}if(h<128){u[u.length]=dn[h];continue}if(h<2048){u[u.length]=dn[192|h>>6]+dn[128|h&63];continue}if(h<55296||h>=57344){u[u.length]=dn[224|h>>12]+dn[128|h>>6&63]+dn[128|h&63];continue}d+=1,h=65536+((h&1023)<<10|c.charCodeAt(d)&1023),u[u.length]=dn[240|h>>18]+dn[128|h>>12&63]+dn[128|h>>6&63]+dn[128|h&63]}a+=u.join("")}return a},ZF=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o<n.length;++o)for(var s=n[o],i=s.obj[s.prop],a=Object.keys(i),l=0;l<a.length;++l){var c=a[l],u=i[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:i,prop:c}),r.push(u))}return UF(n),t},XF=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},QF=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},JF=function(t,n){return[].concat(t,n)},eN=function(t,n){if(Rr(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(n(t[o]));return r}return n(t)},Y0={arrayToObject:G0,assign:YF,combine:JF,compact:ZF,decode:qF,encode:KF,isBuffer:QF,isRegExp:XF,maybeMap:eN,merge:GF},q0=Zw,Vi=Y0,ks=af,tN=Object.prototype.hasOwnProperty,K0={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},fn=Array.isArray,nN=Array.prototype.push,Z0=function(e,t){nN.apply(e,fn(t)?t:[t])},rN=Date.prototype.toISOString,rg=ks.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Vi.encode,encodeValuesOnly:!1,format:rg,formatter:ks.formatters[rg],indices:!1,serializeDate:function(t){return rN.call(t)},skipNulls:!1,strictNullHandling:!1},oN=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},gc={},sN=function e(t,n,r,o,s,i,a,l,c,u,d,h,f,p,m,v,y,x){for(var g=t,T=x,S=0,E=!1;(T=T.get(gc))!==void 0&&!E;){var k=T.get(t);if(S+=1,typeof k<"u"){if(k===S)throw new RangeError("Cyclic object value");E=!0}typeof T.get(gc)>"u"&&(S=0)}if(typeof u=="function"?g=u(n,g):g instanceof Date?g=f(g):r==="comma"&&fn(g)&&(g=Vi.maybeMap(g,function(O){return O instanceof Date?f(O):O})),g===null){if(i)return c&&!v?c(n,mt.encoder,y,"key",p):n;g=""}if(oN(g)||Vi.isBuffer(g)){if(c){var R=v?n:c(n,mt.encoder,y,"key",p);return[m(R)+"="+m(c(g,mt.encoder,y,"value",p))]}return[m(n)+"="+m(String(g))]}var I=[];if(typeof g>"u")return I;var C;if(r==="comma"&&fn(g))v&&c&&(g=Vi.maybeMap(g,c)),C=[{value:g.length>0?g.join(",")||null:void 0}];else if(fn(u))C=u;else{var F=Object.keys(g);C=d?F.sort(d):F}var M=l?n.replace(/\./g,"%2E"):n,N=o&&fn(g)&&g.length===1?M+"[]":M;if(s&&fn(g)&&g.length===0)return N+"[]";for(var P=0;P<C.length;++P){var A=C[P],D=typeof A=="object"&&typeof A.value<"u"?A.value:g[A];if(!(a&&D===null)){var L=h&&l?A.replace(/\./g,"%2E"):A,H=fn(g)?typeof r=="function"?r(N,L):N:N+(h?"."+L:"["+L+"]");x.set(t,S);var U=q0();U.set(gc,x),Z0(I,e(D,H,r,o,s,i,a,l,r==="comma"&&v&&fn(g)?null:c,u,d,h,f,p,m,v,y,U))}}return I},iN=function(t){if(!t)return mt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||mt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=ks.default;if(typeof t.format<"u"){if(!tN.call(ks.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=ks.formatters[r],s=mt.filter;(typeof t.filter=="function"||fn(t.filter))&&(s=t.filter);var i;if(t.arrayFormat in K0?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=mt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:mt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:mt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:mt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?mt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:mt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:mt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:mt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:mt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:mt.strictNullHandling}},aN=function(e,t){var n=e,r=iN(t),o,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):fn(r.filter)&&(s=r.filter,o=s);var i=[];if(typeof n!="object"||n===null)return"";var a=K0[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;o||(o=Object.keys(n)),r.sort&&o.sort(r.sort);for(var c=q0(),u=0;u<o.length;++u){var d=o[u];r.skipNulls&&n[d]===null||Z0(i,sN(n[d],d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,c))}var h=i.join(r.delimiter),f=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),h.length>0?f+h:""},_o=Y0,xu=Object.prototype.hasOwnProperty,lN=Array.isArray,lt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},cN=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},X0=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},uN="utf8=%26%2310003%3B",dN="utf8=%E2%9C%93",fN=function(t,n){var r={__proto__:null},o=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=n.parameterLimit===1/0?void 0:n.parameterLimit,i=o.split(n.delimiter,s),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===dN?c="utf-8":i[l]===uN&&(c="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var u=i[l],d=u.indexOf("]="),h=d===-1?u.indexOf("="):d+1,f,p;h===-1?(f=n.decoder(u,lt.decoder,c,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(u.slice(0,h),lt.decoder,c,"key"),p=_o.maybeMap(X0(u.slice(h+1),n),function(v){return n.decoder(v,lt.decoder,c,"value")})),p&&n.interpretNumericEntities&&c==="iso-8859-1"&&(p=cN(p)),u.indexOf("[]=")>-1&&(p=lN(p)?[p]:p);var m=xu.call(r,f);m&&n.duplicates==="combine"?r[f]=_o.combine(r[f],p):(!m||n.duplicates==="last")&&(r[f]=p)}return r},hN=function(e,t,n,r){for(var o=r?t:X0(t,n),s=e.length-1;s>=0;--s){var i,a=e[s];if(a==="[]"&&n.parseArrays)i=n.allowEmptyArrays&&(o===""||n.strictNullHandling&&o===null)?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=n.decodeDotInKeys?l.replace(/%2E/g,"."):l,u=parseInt(c,10);!n.parseArrays&&c===""?i={0:o}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[],i[u]=o):c!=="__proto__"&&(i[c]=o)}o=i}return o},pN=function(t,n,r,o){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&i.exec(s),c=l?s.slice(0,l.index):s,u=[];if(c){if(!r.plainObjects&&xu.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var d=0;r.depth>0&&(l=a.exec(s))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&xu.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+s.slice(l.index)+"]"),hN(u,n,r,o)}},mN=function(t){if(!t)return lt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?lt.charset:t.charset,r=typeof t.duplicates>"u"?lt.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:lt.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:lt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:lt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:lt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:lt.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:lt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:lt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:lt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:lt.decoder,delimiter:typeof t.delimiter=="string"||_o.isRegExp(t.delimiter)?t.delimiter:lt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:lt.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:lt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:lt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:lt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:lt.strictNullHandling}},gN=function(e,t){var n=mN(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?fN(e,n):e,o=n.plainObjects?Object.create(null):{},s=Object.keys(r),i=0;i<s.length;++i){var a=s[i],l=pN(a,r[a],n,typeof e=="string");o=_o.merge(o,l,n)}return n.allowSparse===!0?o:_o.compact(o)},yN=aN,vN=gN,bN=af,xN={formats:bN,parse:vN,stringify:yN},Ie;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Ie||(Ie={}));var og;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(og||(og={}));const re=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},K=Ie.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"]);class en extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof en))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}en.create=e=>new en(e);const Us=(e,t)=>{let n;switch(e.code){case K.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ie.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(e.keys,", ")}`;break;case K.invalid_union:n="Invalid input";break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n="Invalid function arguments";break;case K.invalid_return_type:n="Invalid function return type";break;case K.invalid_date:n="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ie.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case K.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case K.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case K.custom:n="Invalid input";break;case K.invalid_intersection_types:n="Intersection results could not be merged";break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ie.assertNever(e)}return{message:n}};let wN=Us;function wu(){return wN}const Su=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function ee(e,t){const n=wu(),r=Su({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Us?void 0:Us].filter(o=>!!o)});e.common.issues.push(r)}class Nt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return Nt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const pe=Object.freeze({status:"aborted"}),ds=e=>({status:"dirty",value:e}),Bt=e=>({status:"valid",value:e}),sg=e=>e.status==="aborted",ig=e=>e.status==="dirty",va=e=>e.status==="valid",ba=e=>typeof Promise<"u"&&e instanceof Promise;function xa(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Q0(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ae||(ae={}));var fs,hs;class In{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 ag=(e,t)=>{if(va(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new en(e.common.issues);return this._error=n,this._error}}};function ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{var l,c;const{message:u}=e;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:o}}class xe{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return Pr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Nt,ctx:{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ba(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pr(t)},s=this._parseSync({data:t,path:o.path,parent:o});return ag(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pr(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(ba(o)?o:Promise.resolve(o));return ag(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:K.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new $n({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Nn.create(this,this._def)}nullable(){return $r.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return Ys.create(this,this._def)}or(t){return Ta.create([this,t],this._def)}and(t){return Ea.create(this,t,this._def)}transform(t){return new $n({...ge(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Ia({...ge(this._def),innerType:this,defaultValue:n,typeName:fe.ZodDefault})}brand(){return new nx({typeName:fe.ZodBranded,type:this,...ge(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Oa({...ge(this._def),innerType:this,catchValue:n,typeName:fe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ol.create(this,t)}readonly(){return Aa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SN=/^c[^\s-]{8,}$/i,TN=/^[0-9a-z]+$/,EN=/^[0-9A-HJKMNP-TV-Z]{26}$/,CN=/^[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,RN=/^[a-z0-9_-]{21}$/i,PN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let yc;const ON=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,AN=/^(([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})))$/,_N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",MN=new RegExp(`^${J0}$`);function ex(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function DN(e){return new RegExp(`^${ex(e)}$`)}function jN(e){let t=`${J0}T${ex(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function FN(e,t){return!!((t==="v4"||!t)&&ON.test(e)||(t==="v6"||!t)&&AN.test(e))}class Dn extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.string,received:s.parsedType}),pe}const r=new Nt;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?ee(o,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ee(o,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")kN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")yc||(yc=new RegExp(IN,"u")),yc.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")CN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")RN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")SN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")TN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")EN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?jN(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?MN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?DN(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?PN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?FN(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?_N.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:s.message}),r.dirty()):Ie.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:K.invalid_string,...ae.errToObj(r)})}_addCheck(t){return new Dn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...ae.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ae.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ae.errToObj(n)})}nonempty(t){return this.min(1,ae.errToObj(t))}trim(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Dn.create=e=>{var t;return new Dn({checks:[],typeName:fe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ge(e)})};function NN(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Lr extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.number,received:s.parsedType}),pe}let r;const o=new Nt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?NN(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_finite,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,o){return new Lr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(o)}]})}_addCheck(t){return new Lr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ie.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Lr.create=e=>new Lr({checks:[],typeName:fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ge(e)});class Mo extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==re.bigint){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.bigint,received:s.parsedType}),pe}let r;const o=new Nt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,o){return new Mo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(o)}]})}_addCheck(t){return new Mo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Mo.create=e=>{var t;return new Mo({checks:[],typeName:fe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ge(e)})};class Tu extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.boolean,received:r.parsedType}),pe}return Bt(t.data)}}Tu.create=e=>new Tu({typeName:fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ge(e)});class Gs extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.date,received:s.parsedType}),pe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_date}),pe}const r=new Nt;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ie.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Gs.create=e=>new Gs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:fe.ZodDate,...ge(e)});class Eu extends xe{_parse(t){if(this._getType(t)!==re.symbol){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.symbol,received:r.parsedType}),pe}return Bt(t.data)}}Eu.create=e=>new Eu({typeName:fe.ZodSymbol,...ge(e)});class wa extends xe{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.undefined,received:r.parsedType}),pe}return Bt(t.data)}}wa.create=e=>new wa({typeName:fe.ZodUndefined,...ge(e)});class Sa extends xe{_parse(t){if(this._getType(t)!==re.null){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.null,received:r.parsedType}),pe}return Bt(t.data)}}Sa.create=e=>new Sa({typeName:fe.ZodNull,...ge(e)});class Cu extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return Bt(t.data)}}Cu.create=e=>new Cu({typeName:fe.ZodAny,...ge(e)});class fo extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Bt(t.data)}}fo.create=e=>new fo({typeName:fe.ZodUnknown,...ge(e)});class ir extends xe{_parse(t){const n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.never,received:n.parsedType}),pe}}ir.create=e=>new ir({typeName:fe.ZodNever,...ge(e)});class Ru extends xe{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.void,received:r.parsedType}),pe}return Bt(t.data)}}Ru.create=e=>new Ru({typeName:fe.ZodVoid,...ge(e)});class sn extends xe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),pe;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(ee(n,{code:i?K.too_big:K.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ee(n,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ee(n,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new In(n,i,n.path,a)))).then(i=>Nt.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new In(n,i,n.path,a)));return Nt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new sn({...this._def,minLength:{value:t,message:ae.toString(n)}})}max(t,n){return new sn({...this._def,maxLength:{value:t,message:ae.toString(n)}})}length(t,n){return new sn({...this._def,exactLength:{value:t,message:ae.toString(n)}})}nonempty(t){return this.min(1,t)}}sn.create=(e,t)=>new sn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...ge(t)});function Jr(e){if(e instanceof rt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Nn.create(Jr(r))}return new rt({...e._def,shape:()=>t})}else return e instanceof sn?new sn({...e._def,type:Jr(e.element)}):e instanceof Nn?Nn.create(Jr(e.unwrap())):e instanceof $r?$r.create(Jr(e.unwrap())):e instanceof Vn?Vn.create(e.items.map(t=>Jr(t))):e}class rt extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ie.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==re.object){const c=this._getOrReturnCtx(t);return ee(c,{code:K.invalid_type,expected:re.object,received:c.parsedType}),pe}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(const c in o.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=s[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new In(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ir){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(ee(o,{code:K.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new In(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>Nt.mergeObjectSync(r,c)):Nt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ae.errToObj,new rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ae.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:fe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new rt({...this._def,catchall:t})}pick(t){const n={};return Ie.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new rt({...this._def,shape:()=>n})}omit(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new rt({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new rt({...this._def,shape:()=>n})}required(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Nn;)s=s._def.innerType;n[r]=s}}),new rt({...this._def,shape:()=>n})}keyof(){return tx(Ie.objectKeys(this.shape))}}rt.create=(e,t)=>new rt({shape:()=>e,unknownKeys:"strip",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});rt.strictCreate=(e,t)=>new rt({shape:()=>e,unknownKeys:"strict",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});rt.lazycreate=(e,t)=>new rt({shape:e,unknownKeys:"strip",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});class Ta extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new en(a.ctx.common.issues));return ee(n,{code:K.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new en(l));return ee(n,{code:K.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}}Ta.create=(e,t)=>new Ta({options:e,typeName:fe.ZodUnion,...ge(t)});const _n=e=>e instanceof Ra?_n(e.schema):e instanceof $n?_n(e.innerType()):e instanceof Pa?[e.value]:e instanceof Vr?e.options:e instanceof ka?Ie.objectValues(e.enum):e instanceof Ia?_n(e._def.innerType):e instanceof wa?[void 0]:e instanceof Sa?[null]:e instanceof Nn?[void 0,..._n(e.unwrap())]:e instanceof $r?[null,..._n(e.unwrap())]:e instanceof nx||e instanceof Aa?_n(e.unwrap()):e instanceof Oa?_n(e._def.innerType):[];class lf extends xe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),pe;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=_n(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new lf({typeName:fe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...ge(r)})}}function Pu(e,t){const n=Pr(e),r=Pr(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&r===re.object){const o=Ie.objectKeys(t),s=Ie.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=Pu(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===re.array&&r===re.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=Pu(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===re.date&&r===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ea extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(sg(s)||sg(i))return pe;const a=Pu(s.value,i.value);return a.valid?((ig(s)||ig(i))&&n.dirty(),{status:n.value,value:a.data}):(ee(r,{code:K.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ea.create=(e,t,n)=>new Ea({left:e,right:t,typeName:fe.ZodIntersection,...ge(n)});class Vn extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return ee(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new In(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Nt.mergeArray(n,i)):Nt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Vn({...this._def,rest:t})}}Vn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:e,typeName:fe.ZodTuple,rest:null,...ge(t)})};class Ca extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),pe;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new In(r,a,r.path,a)),value:i._parse(new In(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Nt.mergeObjectAsync(n,o):Nt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof xe?new Ca({keyType:t,valueType:n,typeName:fe.ZodRecord,...ge(r)}):new Ca({keyType:Dn.create(),valueType:t,typeName:fe.ZodRecord,...ge(n)})}}class ku extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.map)return ee(r,{code:K.invalid_type,expected:re.map,received:r.parsedType}),pe;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new In(r,a,r.path,[c,"key"])),value:s._parse(new In(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}ku.create=(e,t,n)=>new ku({valueType:t,keyType:e,typeName:fe.ZodMap,...ge(n)});class Do extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.set)return ee(r,{code:K.invalid_type,expected:re.set,received:r.parsedType}),pe;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ee(r,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ee(r,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return pe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new In(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new Do({...this._def,minSize:{value:t,message:ae.toString(n)}})}max(t,n){return new Do({...this._def,maxSize:{value:t,message:ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Do.create=(e,t)=>new Do({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...ge(t)});class Is extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return ee(n,{code:K.invalid_type,expected:re.function,received:n.parsedType}),pe;function r(a,l){return Su({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wu(),Us].filter(c=>!!c),issueData:{code:K.invalid_arguments,argumentsError:l}})}function o(a,l){return Su({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wu(),Us].filter(c=>!!c),issueData:{code:K.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Ys){const a=this;return Bt(async function(...l){const c=new en([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(o(d,f)),c})})}else{const a=this;return Bt(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new en([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new en([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Is({...this._def,args:Vn.create(t).rest(fo.create())})}returns(t){return new Is({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Is({args:t||Vn.create([]).rest(fo.create()),returns:n||fo.create(),typeName:fe.ZodFunction,...ge(r)})}}class Ra extends xe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ra.create=(e,t)=>new Ra({getter:e,typeName:fe.ZodLazy,...ge(t)});class Pa extends xe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:t.data}}get value(){return this._def.value}}Pa.create=(e,t)=>new Pa({value:e,typeName:fe.ZodLiteral,...ge(t)});function tx(e,t){return new Vr({values:e,typeName:fe.ZodEnum,...ge(t)})}class Vr extends xe{constructor(){super(...arguments),fs.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{expected:Ie.joinValues(r),received:n.parsedType,code:K.invalid_type}),pe}if(xa(this,fs)||Q0(this,fs,new Set(this._def.values)),!xa(this,fs).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{received:n.data,code:K.invalid_enum_value,options:r}),pe}return Bt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Vr.create(t,{...this._def,...n})}exclude(t,n=this._def){return Vr.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}fs=new WeakMap;Vr.create=tx;class ka extends xe{constructor(){super(...arguments),hs.set(this,void 0)}_parse(t){const n=Ie.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==re.string&&r.parsedType!==re.number){const o=Ie.objectValues(n);return ee(r,{expected:Ie.joinValues(o),received:r.parsedType,code:K.invalid_type}),pe}if(xa(this,hs)||Q0(this,hs,new Set(Ie.getValidEnumValues(this._def.values))),!xa(this,hs).has(t.data)){const o=Ie.objectValues(n);return ee(r,{received:r.data,code:K.invalid_enum_value,options:o}),pe}return Bt(t.data)}get enum(){return this._def.values}}hs=new WeakMap;ka.create=(e,t)=>new ka({values:e,typeName:fe.ZodNativeEnum,...ge(t)});class Ys extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return ee(n,{code:K.invalid_type,expected:re.promise,received:n.parsedType}),pe;const r=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return Bt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ys.create=(e,t)=>new Ys({type:e,typeName:fe.ZodPromise,...ge(t)});class $n extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{ee(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?pe:l.status==="dirty"||n.value==="dirty"?ds(l.value):l});{if(n.value==="aborted")return pe;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"||n.value==="dirty"?ds(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!va(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>va(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);Ie.assertNever(o)}}$n.create=(e,t,n)=>new $n({schema:e,typeName:fe.ZodEffects,effect:t,...ge(n)});$n.createWithPreprocess=(e,t,n)=>new $n({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...ge(n)});class Nn extends xe{_parse(t){return this._getType(t)===re.undefined?Bt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Nn.create=(e,t)=>new Nn({innerType:e,typeName:fe.ZodOptional,...ge(t)});class $r extends xe{_parse(t){return this._getType(t)===re.null?Bt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:fe.ZodNullable,...ge(t)});class Ia extends xe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ia.create=(e,t)=>new Ia({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ge(t)});class Oa extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ba(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new en(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new en(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oa.create=(e,t)=>new Oa({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ge(t)});class Iu extends xe{_parse(t){if(this._getType(t)!==re.nan){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.nan,received:r.parsedType}),pe}return{status:"valid",value:t.data}}}Iu.create=e=>new Iu({typeName:fe.ZodNaN,...ge(e)});class nx extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ol extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),ds(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new ol({in:t,out:n,typeName:fe.ZodPipeline})}}class Aa extends xe{_parse(t){const n=this._def.innerType._parse(t),r=o=>(va(o)&&(o.value=Object.freeze(o.value)),o);return ba(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Aa.create=(e,t)=>new Aa({innerType:e,typeName:fe.ZodReadonly,...ge(t)});rt.lazycreate;var fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));Dn.create;Lr.create;Iu.create;Mo.create;Tu.create;Gs.create;Eu.create;wa.create;Sa.create;Cu.create;fo.create;ir.create;Ru.create;sn.create;rt.create;rt.strictCreate;Ta.create;lf.create;Ea.create;Vn.create;Ca.create;ku.create;Do.create;Is.create;Ra.create;Pa.create;Vr.create;ka.create;Ys.create;$n.create;Nn.create;$r.create;$n.createWithPreprocess;ol.create;const LN=(e,t)=>e.localeCompare(t),VN={sort:LN,allowDots:!0,charset:"utf-8",parseArrays:!0,plainObjects:!0,charsetSentinel:!0,allowPrototypes:!1,depth:Number.MAX_SAFE_INTEGER,arrayLimit:Number.MAX_SAFE_INTEGER,parameterLimit:Number.MAX_SAFE_INTEGER},rx=e=>{const t=new FormData(e),n=new URLSearchParams(t);return xN.parse(n.toString(),VN)},ox=e=>e.replace("[",".").replace("]","").split("."),ps=(e,t)=>ox(e).reduce((n,r)=>{var s;if(r==="")return n;const o=((s=n.shape)==null?void 0:s[r])||n;return o instanceof sn?o.element:o},t),ls=e=>e.dataset.value?e.dataset.value:e.type==="checkbox"?e.checked:e.type==="number"?e.valueAsNumber:e.value||e.getAttribute("value"),$N=e=>{const[t,n]=b.useState(null),r=b.useRef({}),o=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},s=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},i=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},a=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),type:xn.instance(h,Lr)?"number":(d==null?void 0:d.type)??"text",error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}};b.useEffect(()=>{const u=Object.values(r.current).map(h=>{const f=h.element.dataset.origin?document.querySelector(`[data-target=${h.element.name}]`):h.element,p=h.schema.safeParse(ls(f)),m=y=>{const x=f.dataset.target||f.name;if(!x)return;const g=ls(y.target)||(y.relatedTarget?ls(y.relatedTarget):""),T=h.schema.safeParse(g);if(T.success)return f.setCustomValidity(""),n(S=>{const{[x]:E,...k}=S||{};return k===null||xn.empty(k)?null:k});if(f.required){const S=T.error.issues[0].message;f.setCustomValidity(S),n(E=>({...E,[x]:S}))}},v=f.getAttribute("data-trigger")||"blur";return f.addEventListener(v,m),f.tagName==="SELECT"&&f.addEventListener("change",m),{input:h,hasInitialError:f.required?!p.success:!1,unsubscribe:()=>{f.removeEventListener(v,m),f.tagName==="SELECT"&&f.addEventListener("change",m)}}});return u.some(h=>h.hasInitialError)&&n(h=>h===null?{}:h),()=>u.forEach(h=>h.unsubscribe())});const l=b.useCallback(u=>d=>{const h=d.currentTarget,f=Object.values(r.current).reduce((m,v)=>{const y=v.element,x=v.schema.safeParse(ls(y));if(y.dataset.ignore==="ignore"||x.success)return m;const g=x.error.issues[0].message;y.setAttribute("data-initialized","true");const T=y.dataset.name||y.name||"";return{...m,[T]:g}},{}),p=xn.empty(f)?null:f;n(p),u==null||u({form:h,errors:p||{}})},[]),c=b.useCallback(u=>d=>{d.preventDefault();const h=d.currentTarget;let f=rx(h);Array.from(h.elements).forEach(m=>{if(m.tagName==="SELECT"){const v=m;f=Ff(f,v.name,v.value)}if(m.tagName==="INPUT"){const v=m;f=Ff(f,v.name,ls(v))}});const p=e.safeParse(f);return p.success?u({form:h,json:f,data:p.data,event:d,reset:()=>uu(h),success:!0,errors:[]}):u({form:h,json:f,event:d,data:f,success:!1,reset:()=>uu(h),errors:p.error.issues.map(m=>({message:m.message,path:m.path.map(v=>String(v))}))})},[]);return{input:a,datepicker:o,checkbox:i,select:s,onSubmit:c,errors:t,onInvalid:l,disabled:t!==null}},BN=e=>{const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current};exports.Alert=SP;exports.Autocomplete=N_;exports.Button=mo;exports.Calendar=cb;exports.Card=ub;exports.Checkbox=Qb;exports.ColType=uo;exports.Collapse=Iv;exports.ComponentsProvider=lO;exports.DatePicker=V_;exports.Dropdown=Xo;exports.Expand=p_;exports.FileUpload=XM;exports.Form=JM;exports.Input=ii;exports.InputFeedback=Zb;exports.InputField=Xa;exports.Menu=T_;exports.MenuItem=S_;exports.Modal=__;exports.Option=Xb;exports.Polymorph=Lo;exports.Radiobox=eD;exports.Select=Nr;exports.Stats=hO;exports.Switch=tD;exports.Tab=yO;exports.Table=BF;exports.Tabs=mO;exports.Tag=nS;exports.TaskList=nD;exports.Toolbar=M_;exports.Tooltip=Kb;exports.TransferList=Bj;exports.convertPath=ox;exports.createColumns=dF;exports.createDesignTokens=nb;exports.createOptionCols=rf;exports.createStyles=oO;exports.createTheme=sO;exports.css=Ve;exports.defaultDarkTheme=iO;exports.defaultLightTheme=aO;exports.dispatchInput=Rc;exports.formReset=uu;exports.formToJson=rx;exports.getSchemaShape=ps;exports.initializeInputDataset=_a;exports.isReactComponent=X1;exports.isReactFC=Q1;exports.isSsr=ea;exports.mergeRefs=Nu;exports.parsers=xd;exports.path=ib;exports.reduceTokens=Ts;exports.safeRegex=qc;exports.splitInto=ab;exports.useForm=$N;exports.usePrevious=BN;exports.useReactive=db;exports.useTablePreferences=hF;exports.useTranslations=Wt;exports.uuid=Ha;
200
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c0(e,t){if(e){if(typeof e=="string")return au(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return au(e,t)}}function au(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,a;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(l){s=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function WM(e){if(Array.isArray(e))return e}function Rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rm(Object(n),!0).forEach(function(r){lu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e,t){if(e==null)return{};var n=HM(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HM(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Ld=b.forwardRef(function(e,t){var n=e.children,r=fa(e,MM),o=d0(r),s=o.open,i=fa(o,DM);return b.useImperativeHandle(t,function(){return{open:s}},[s]),b.createElement(b.Fragment,null,n(Xe(Xe({},i),{},{open:s})))});Ld.displayName="Dropzone";var u0={disabled:!1,getFilesFromEvent:nM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Ld.defaultProps=u0;Ld.propTypes={children:ze.func,accept:ze.objectOf(ze.arrayOf(ze.string)),multiple:ze.bool,preventDropOnDocument:ze.bool,noClick:ze.bool,noKeyboard:ze.bool,noDrag:ze.bool,noDragEventsBubbling:ze.bool,minSize:ze.number,maxSize:ze.number,maxFiles:ze.number,disabled:ze.bool,getFilesFromEvent:ze.func,onFileDialogCancel:ze.func,onFileDialogOpen:ze.func,useFsAccessApi:ze.bool,autoFocus:ze.bool,onDragEnter:ze.func,onDragLeave:ze.func,onDragOver:ze.func,onDrop:ze.func,onDropAccepted:ze.func,onDropRejected:ze.func,onError:ze.func,validator:ze.func};var cu={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function d0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Xe(Xe({},u0),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,h=t.onDrop,f=t.onDropAccepted,p=t.onDropRejected,m=t.onFileDialogCancel,v=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,g=t.preventDropOnDocument,T=t.noClick,S=t.noKeyboard,E=t.noDrag,k=t.noDragEventsBubbling,R=t.onError,I=t.validator,C=b.useMemo(function(){return OM(n)},[n]),F=b.useMemo(function(){return IM(n)},[n]),M=b.useMemo(function(){return typeof v=="function"?v:Pm},[v]),N=b.useMemo(function(){return typeof m=="function"?m:Pm},[m]),P=b.useRef(null),A=b.useRef(null),D=b.useReducer(UM,cu),L=ic(D,2),H=L[0],U=L[1],O=H.isFocused,$=H.isFileDialogActive,Z=b.useRef(typeof window<"u"&&window.isSecureContext&&y&&kM()),te=function(){!Z.current&&$&&setTimeout(function(){if(A.current){var ie=A.current.files;ie.length||(U({type:"closeDialog"}),N())}},300)};b.useEffect(function(){return window.addEventListener("focus",te,!1),function(){window.removeEventListener("focus",te,!1)}},[A,$,N,Z]);var Q=b.useRef([]),G=function(ie){P.current&&P.current.contains(ie.target)||(ie.preventDefault(),Q.current=[])};b.useEffect(function(){return g&&(document.addEventListener("dragover",Cm,!1),document.addEventListener("drop",G,!1)),function(){g&&(document.removeEventListener("dragover",Cm),document.removeEventListener("drop",G))}},[P,g]),b.useEffect(function(){return!r&&x&&P.current&&P.current.focus(),function(){}},[P,x,r]);var j=b.useCallback(function(J){R?R(J):console.error(J)},[R]),B=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J),Q.current=[].concat(NM(Q.current),[J.target]),Ci(J)&&Promise.resolve(o(J)).then(function(ie){if(!(da(J)&&!k)){var Oe=ie.length,Ue=Oe>0&&EM({files:ie,accept:C,minSize:i,maxSize:s,multiple:a,maxFiles:l,validator:I}),St=Oe>0&&!Ue;U({isDragAccept:Ue,isDragReject:St,isDragActive:!0,type:"setDraggedFiles"}),c&&c(J)}}).catch(function(ie){return j(ie)})},[o,c,j,k,C,i,s,a,l,I]),z=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J);var ie=Ci(J);if(ie&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return ie&&d&&d(J),!1},[d,k]),V=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J);var ie=Q.current.filter(function(Ue){return P.current&&P.current.contains(Ue)}),Oe=ie.indexOf(J.target);Oe!==-1&&ie.splice(Oe,1),Q.current=ie,!(ie.length>0)&&(U({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ci(J)&&u&&u(J))},[P,u,k]),Y=b.useCallback(function(J,ie){var Oe=[],Ue=[];J.forEach(function(St){var kt=s0(St,C),jt=ic(kt,2),gr=jt[0],Hr=jt[1],Ur=i0(St,i,s),di=ic(Ur,2),sl=di[0],il=di[1],al=I?I(St):null;if(gr&&sl&&!al)Oe.push(St);else{var ll=[Hr,il];al&&(ll=ll.concat(al)),Ue.push({file:St,errors:ll.filter(function(sx){return sx})})}}),(!a&&Oe.length>1||a&&l>=1&&Oe.length>l)&&(Oe.forEach(function(St){Ue.push({file:St,errors:[TM]})}),Oe.splice(0)),U({acceptedFiles:Oe,fileRejections:Ue,type:"setFiles"}),h&&h(Oe,Ue,ie),Ue.length>0&&p&&p(Ue,ie),Oe.length>0&&f&&f(Oe,ie)},[U,a,C,i,s,l,h,f,p,I]),oe=b.useCallback(function(J){J.preventDefault(),J.persist(),Re(J),Q.current=[],Ci(J)&&Promise.resolve(o(J)).then(function(ie){da(J)&&!k||Y(ie,J)}).catch(function(ie){return j(ie)}),U({type:"reset"})},[o,Y,j,k]),W=b.useCallback(function(){if(Z.current){U({type:"openDialog"}),M();var J={multiple:a,types:F};window.showOpenFilePicker(J).then(function(ie){return o(ie)}).then(function(ie){Y(ie,null),U({type:"closeDialog"})}).catch(function(ie){AM(ie)?(N(ie),U({type:"closeDialog"})):_M(ie)?(Z.current=!1,A.current?(A.current.value=null,A.current.click()):j(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):j(ie)});return}A.current&&(U({type:"openDialog"}),M(),A.current.value=null,A.current.click())},[U,M,N,y,Y,j,F,a]),Ee=b.useCallback(function(J){!P.current||!P.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),W())},[P,W]),et=b.useCallback(function(){U({type:"focus"})},[]),He=b.useCallback(function(){U({type:"blur"})},[]),tt=b.useCallback(function(){T||(PM()?setTimeout(W,0):W())},[T,W]),ce=function(ie){return r?null:ie},Te=function(ie){return S?null:ce(ie)},le=function(ie){return E?null:ce(ie)},Re=function(ie){k&&ie.stopPropagation()},at=b.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=J.refKey,Oe=ie===void 0?"ref":ie,Ue=J.role,St=J.onKeyDown,kt=J.onFocus,jt=J.onBlur,gr=J.onClick,Hr=J.onDragEnter,Ur=J.onDragOver,di=J.onDragLeave,sl=J.onDrop,il=fa(J,jM);return Xe(Xe(lu({onKeyDown:Te(un(St,Ee)),onFocus:Te(un(kt,et)),onBlur:Te(un(jt,He)),onClick:ce(un(gr,tt)),onDragEnter:le(un(Hr,B)),onDragOver:le(un(Ur,z)),onDragLeave:le(un(di,V)),onDrop:le(un(sl,oe)),role:typeof Ue=="string"&&Ue!==""?Ue:"presentation"},Oe,P),!r&&!S?{tabIndex:0}:{}),il)}},[P,Ee,et,He,tt,B,z,V,oe,S,E,r]),Pe=b.useCallback(function(J){J.stopPropagation()},[]),pt=b.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=J.refKey,Oe=ie===void 0?"ref":ie,Ue=J.onChange,St=J.onClick,kt=fa(J,FM),jt=lu({accept:C,multiple:a,type:"file",style:{display:"none"},onChange:ce(un(Ue,oe)),onClick:ce(un(St,Pe)),tabIndex:-1},Oe,A);return Xe(Xe({},jt),kt)}},[A,n,a,oe,r]);return Xe(Xe({},H),{},{isFocused:O&&!r,getRootProps:at,getInputProps:pt,rootRef:P,inputRef:A,open:ce(W)})}function UM(e,t){switch(t.type){case"focus":return Xe(Xe({},e),{},{isFocused:!0});case"blur":return Xe(Xe({},e),{},{isFocused:!1});case"openDialog":return Xe(Xe({},cu),{},{isFileDialogActive:!0});case"closeDialog":return Xe(Xe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Xe(Xe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Xe(Xe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Xe({},cu);default:return e}}function Pm(){}const GM={isImage:e=>e.type.includes("image")},YM=e=>{const[t,n]=b.useState({url:"",type:"",size:""});return b.useEffect(()=>{if(GM.isImage(e.file)){const r=URL.createObjectURL(e.file);return n({url:r,type:"img",size:im(e.file.size)}),()=>{URL.revokeObjectURL(r)}}n({url:"",type:e.file.type,size:im(e.file.size)})},[e.file]),t.type==="img"?w.jsxs("div",{className:"flex flex-row gap-jade-200 items-center justify-between w-full",children:[w.jsxs("header",{className:"flex flex-row gap-jade-200 items-center",children:[w.jsx("img",{src:t.url,className:"size-jade-500 rounded-jade-xsmall",alt:`Miniatura do arquivo ${e.file.name}`}),w.jsxs("div",{className:"flex flex-col",children:[w.jsx("span",{children:e.file.name}),w.jsx("span",{children:t.size})]})]}),w.jsx(mo,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:w.jsx(So,{})})]}):w.jsxs("div",{className:"flex flex-row gap-jade-200 items-center justify-between w-full",children:[w.jsxs("header",{className:"flex flex-row gap-4 items-center",children:[w.jsx(hP,{size:48}),w.jsxs("div",{className:"flex flex-col text-left justify-start items-start",children:[w.jsx("span",{children:e.file.name}),w.jsx("span",{children:t.size})]})]}),w.jsx(mo,{className:"isolate",type:"button",theme:"raw",onClick:r=>{var o;r.stopPropagation(),(o=e.onDeleteFile)==null||o.call(e,e.file)},children:w.jsx(So,{className:"text-danger"})})]})},qM=e=>w.jsx("ul",{className:"w-full space-y-jade-200",children:e.files.map(t=>w.jsx(YM,{onDeleteFile:e.onDeleteFile,file:t},t.name))}),KM=e=>e.isDragActive?w.jsx("p",{children:"Solte os arquivos selecionados"}):e.files.length>0?w.jsx(qM,{onDeleteFile:e.onDeleteFile,files:e.files}):w.jsx(b.Fragment,{children:e.idle}),ZM=w.jsxs("div",{className:"flex flex-col gap-4 justify-center items-center",children:[w.jsx(bP,{size:64}),w.jsxs("p",{children:["You can drag your files or"," ",w.jsx("button",{className:"text-primary underline",type:"button",children:"drag to here"})]})]}),XM=({idle:e=ZM,onDeleteFile:t,onDrop:n,...r})=>{var u;const[o,s]=b.useState([]),i=d=>{n==null||n(d),s(d)},{getRootProps:a,getInputProps:l,isDragActive:c}=d0({onDrop:i});return w.jsxs("div",{...a(),"data-active":(u=r.files)!=null&&u.length?r.files.length>0:!1,className:"flex text-foreground flex-col items-center justify-center border-2 rounded-lg p-6 border-card-border data-[active=true]:bg-card-background data-[active=true]:border-solid data-[active=false]:border-dashed",children:[w.jsx("input",{...l(r),name:r.name,id:r.name}),w.jsx(KM,{onDeleteFile:t,isDragActive:c,idle:e,files:r.files??o})]})},QM=["INPUT","SELECT"],uu=e=>{if(!e)return;Array.from(e.elements).forEach(n=>{QM.includes(n.tagName)&&(n.tagName==="INPUT"&&(n.value=n.defaultValue),n.tagName==="SELECT"&&(n.value=""),n.setAttribute("data-initialized","false"))})},JM=e=>{const t=n=>{var r;n.persist(),n.preventDefault(),(r=e.onSubmit)==null||r.call(e,n)};return w.jsx("form",{...e,onSubmit:t})},eD=({children:e,className:t="",size:n,...r})=>w.jsxs("label",{"data-disabled":r.disabled,"aria-disabled":r.disabled,className:"group font-normal flex items-center gap-2 data-[disabled=true]:cursor-not-allowed",children:[w.jsx("input",{...r,type:"radio",className:Ve("form-radio rounded-full h-4 w-4 app border-card-border text-primary focus:ring-primary appearance-none inline-block bg-origin-border group-aria-disabled:cursor-not-allowed disabled:opacity-70",t),...r}),e]}),Nr=b.forwardRef(({required:e=!0,options:t,info:n,selectContainer:r="",feedback:o=null,labelClassName:s,interactive:i,rightLabel:a,optionalText:l,container:c,hideLeft:u=!1,right:d,left:h,error:f,...p},m)=>{const v=Wt(),y=b.useRef(null),x=p.id??p.name;b.useImperativeHandle(m,()=>y.current),b.useEffect(()=>{if(y.current===null)return;const T=y.current,S=_a(y.current),E=()=>T.setAttribute("data-selected","true");return T.addEventListener("change",E),()=>{S(),T.removeEventListener("change",E)}},[]);const g=()=>{var T;return(T=y.current)==null?void 0:T.focus()};return w.jsx(Xa,{container:Ve("group inline-block w-full",c),error:f,feedback:o,hideLeft:u,left:h,info:n,optionalText:l,rightLabel:a,interactive:i,form:p.form,id:p.name||p.id,name:p.name,labelClassName:s,title:p.title,placeholder:p.placeholder,required:e,right:w.jsx("label",{htmlFor:x,children:w.jsxs("button",{onClick:g,type:"button",className:"mt-2 transition-colors hover:text-primary",children:[w.jsx(Cv,{size:20}),w.jsx("span",{className:"sr-only",children:v.inputCaretDown})]})}),children:w.jsxs("select",{...p,id:x,name:x,value:p.value,required:e,ref:Nu(m,y),"data-selected":!!p.value||!1,defaultValue:p.value?void 0:"",className:Ve("input appearance-none select group h-10 py-1 px-2 w-full flex-1 rounded-md bg-transparent text-foreground placeholder-input-placeholder outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error","data-[selected=false]:text-input-placeholder",p.className),children:[w.jsx("option",{value:"",disabled:!0,hidden:!0,children:p.placeholder}),t.map(T=>w.jsx("option",{...T,children:T.label??T.value},`${x}-select-option-${T.value}`))]})})}),du=e=>{const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),t},tD=b.forwardRef(({children:e,container:t,error:n,...r},o)=>{const s=b.useId(),[i,a]=b.useState(r.checked??!1),l=i,c=b.useRef(null),u=du(r.onChange);b.useImperativeHandle(o,()=>c.current),b.useEffect(()=>{if(c.current!==null&&u.current){const h=f=>{f.target.checked=!f.target.checked,u.current&&u.current(f)};return c.current.addEventListener("change",h),()=>{var f;return(f=c.current)==null?void 0:f.removeEventListener("change",h)}}},[]);const d=()=>{var f,p;const h=!((f=c.current)!=null&&f.checked);a(h),(p=r==null?void 0:r.onCheck)==null||p.call(r,h),c.current!==null&&(c.current.checked=h,c.current.dispatchEvent(new Event("change",{bubbles:!0})))};return w.jsxs("fieldset",{className:Ve("flex flex-wrap items-center",t),children:[w.jsx("input",{...r,checked:l,"data-checked":l,"data-trigger":"change",hidden:!0,id:r.id||s,onChange:h=>a(h.target.checked),ref:c,type:"checkbox"}),w.jsx("button",{type:"button",role:"switch",onClick:d,"aria-checked":l,"data-checked":l,"aria-labelledby":`${s}-label`,className:"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary",children:w.jsx("span",{"aria-hidden":"true","data-checked":l,className:"inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"})}),w.jsx("label",{htmlFor:r.id||s,className:"ml-3 inline-block text-sm",id:`${s}-label`,children:w.jsx("span",{className:"font-medium text-foreground",children:e})}),w.jsx("span",{className:"mt-1 flex-1 whitespace-nowrap text-xs text-danger empty:mt-0 empty:hidden",children:n})]})}),nD=e=>{const[t,n]=XR();return b.useEffect(()=>{const r=t.current;if(!r)return;const o=s=>{const i=s.target,a=Array.from(r.querySelectorAll("input")),l=a.every(u=>u.checked&&u.getAttribute("data-task")==="true"),c=a.indexOf(i);l&&c!==-1&&n("input",{scale:[1,1.35,1],rotate:[0,10,-10,0]},{duration:.5,delay:nP(.075,{from:c})})};return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[]),w.jsx("fieldset",{...e,ref:t})},Qa=0,hr=1,es=2,f0=4;function Vs(e,t){return n=>e(t(n))}function rD(e,t){return t(e)}function h0(e,t){return n=>e(t,n)}function km(e,t){return()=>e(t)}function Ja(e,t){return t(e),e}function Ze(...e){return e}function oD(e){e()}function Im(e){return()=>e}function sD(...e){return()=>{e.map(oD)}}function Vd(e){return e!==void 0}function zr(){}function $e(e,t){return e(hr,t)}function ve(e,t){e(Qa,t)}function $d(e){e(es)}function At(e){return e(f0)}function ue(e,t){return $e(e,h0(t,Qa))}function Pn(e,t){const n=e(hr,r=>{n(),t(r)});return n}function Ce(){const e=[];return(t,n)=>{switch(t){case es:e.splice(0,e.length);return;case hr:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Qa:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function X(e){let t=e;const n=Ce();return(r,o)=>{switch(r){case hr:o(t);break;case Qa:t=o;break;case f0:return t}return n(r,o)}}function iD(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case hr:return s?n===s?void 0:(r(),n=s,t=$e(e,s),t):(r(),zr);case es:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Gt(e){return Ja(Ce(),t=>ue(e,t))}function _t(e,t){return Ja(X(t),n=>ue(e,n))}function aD(...e){return t=>e.reduceRight(rD,t)}function q(e,...t){const n=aD(...t);return(r,o)=>{switch(r){case hr:return $e(e,n(o));case es:$d(e);return}}}function p0(e,t){return e===t}function Ke(e=p0){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function he(e){return t=>n=>{e(n)&&t(n)}}function se(e){return t=>Vs(t,e)}function pn(e){return t=>()=>t(e)}function bn(e,t){return n=>r=>n(t=e(t,r))}function Oo(e){return t=>n=>{e>0?e--:t(n)}}function Zn(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Om(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function be(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);$e(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>s([i].concat(t));n===o?a():r=a}}function Am(...e){return function(t,n){switch(t){case hr:return sD(...e.map(r=>$e(r,n)));case es:return;default:throw new Error(`unrecognized action ${t}`)}}}function me(e,t=p0){return q(e,Ke(t))}function wt(...e){const t=Ce(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);$e(s,l=>{n[i]=l,r=r|a,r===o&&ve(t,n)})}),function(s,i){switch(s){case hr:return r===o&&i(n),$e(t,i);case es:return $d(t);default:throw new Error(`unrecognized action ${s}`)}}}function De(e,t=[],{singleton:n}={singleton:!0}){return{id:lD(),constructor:e,dependencies:t,singleton:n}}const lD=()=>Symbol();function cD(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const a=o(s.map(l=>n(l)));return i&&t.set(r,a),a};return n(e)}function uD(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Ri=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Bd(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=b.createContext({});function l(y,x){y.propsReady&&ve(y.propsReady,!1);for(const g of r){const T=y[t.required[g]];ve(T,x[g])}for(const g of o)if(g in x){const T=y[t.optional[g]];ve(T,x[g])}y.propsReady&&ve(y.propsReady,!0)}function c(y){return s.reduce((x,g)=>(x[g]=T=>{const S=y[t.methods[g]];ve(S,T)},x),{})}function u(y){return i.reduce((x,g)=>(x[g]=iD(y[t.events[g]]),x),{})}const d=b.forwardRef((y,x)=>{const{children:g,...T}=y,[S]=b.useState(()=>Ja(cD(e),k=>l(k,T))),[E]=b.useState(km(u,S));return Ri(()=>{for(const k of i)k in T&&$e(E[k],T[k]);return()=>{Object.values(E).map($d)}},[T,E,S]),Ri(()=>{l(S,T)}),b.useImperativeHandle(x,Im(c(S))),b.createElement(a.Provider,{value:S},n?b.createElement(n,uD([...r,...o,...i],T),g):g)}),h=y=>b.useCallback(h0(ve,b.useContext(a)[y]),[y]),f=y=>{const g=b.useContext(a)[y],T=b.useCallback(S=>$e(g,S),[g]);return b.useSyncExternalStore(T,()=>At(g),()=>At(g))},p=y=>{const g=b.useContext(a)[y],[T,S]=b.useState(km(At,g));return Ri(()=>$e(g,E=>{E!==T&&S(Im(E))}),[g,T]),T},m=b.version.startsWith("18")?f:p;return{Component:d,usePublisher:h,useEmitterValue:m,useEmitter:(y,x)=>{const T=b.useContext(a)[y];Ri(()=>$e(T,x),[x,T])}}}const dD=typeof document<"u"?b.useLayoutEffect:b.useEffect,fD=dD;var Yt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Yt||{});const hD={0:"debug",1:"log",2:"warn",3:"error"},pD=()=>typeof globalThis>"u"?window:globalThis,pr=De(()=>{const e=X(3);return{log:X((n,r,o=1)=>{var s;const i=(s=pD().VIRTUOSO_LOG_LEVEL)!=null?s:At(e);o>=i&&console[hD[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function zd(e,t=!0){const n=b.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=b.useMemo(()=>new ResizeObserver(s=>{requestAnimationFrame(()=>{const i=s[0].target;i.offsetParent!==null&&e(i)})}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function kn(e,t=!0){return zd(e,t).callbackRef}function m0(e,t,n,r,o,s,i){const a=b.useCallback(l=>{const c=mD(l.children,t,"offsetHeight",o);let u=l.parentElement;for(;!u.dataset.virtuosoScroller;)u=u.parentElement;const d=u.lastElementChild.dataset.viewportType==="window",h=i?i.scrollTop:d?window.pageYOffset||document.documentElement.scrollTop:u.scrollTop,f=i?i.scrollHeight:d?document.documentElement.scrollHeight:u.scrollHeight,p=i?i.offsetHeight:d?window.innerHeight:u.offsetHeight;r({scrollTop:Math.max(h,0),scrollHeight:f,viewportHeight:p}),s==null||s(gD("row-gap",getComputedStyle(l).rowGap,o)),c!==null&&e(c)},[e,t,o,s,i,r]);return zd(a,n)}function mD(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(!a||a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),u=t(a,n);if(u===0&&r("Zero-sized element, this should not happen",{child:a},Yt.ERROR),u===c)continue;const d=s[s.length-1];s.length===0||d.size!==u||d.endIndex!==l-1?s.push({startIndex:l,endIndex:l,size:u}):s[s.length-1].endIndex++}return s}function gD(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yt.WARN),t==="normal"?0:parseInt(t??"0",10)}function an(e,t){return Math.round(e.getBoundingClientRect()[t])}function g0(e,t){return Math.abs(e-t)<1.01}function y0(e,t,n,r=zr,o){const s=b.useRef(null),i=b.useRef(null),a=b.useRef(null),l=b.useCallback(d=>{const h=d.target,f=h===window||h===document,p=f?window.pageYOffset||document.documentElement.scrollTop:h.scrollTop,m=f?document.documentElement.scrollHeight:h.scrollHeight,v=f?window.innerHeight:h.offsetHeight,y=()=>{e({scrollTop:Math.max(p,0),scrollHeight:m,viewportHeight:v})};d.suppressFlushSync?y():lg.flushSync(y),i.current!==null&&(p===i.current||p<=0||p===m-v)&&(i.current=null,t(!0),a.current&&(clearTimeout(a.current),a.current=null))},[e,t]);b.useEffect(()=>{const d=o||s.current;return r(o||s.current),l({target:d,suppressFlushSync:!0}),d.addEventListener("scroll",l,{passive:!0}),()=>{r(null),d.removeEventListener("scroll",l)}},[s,l,n,r,o]);function c(d){const h=s.current;if(!h||"offsetHeight"in h&&h.offsetHeight===0)return;const f=d.behavior==="smooth";let p,m,v;h===window?(m=Math.max(an(document.documentElement,"height"),document.documentElement.scrollHeight),p=window.innerHeight,v=document.documentElement.scrollTop):(m=h.scrollHeight,p=an(h,"height"),v=h.scrollTop);const y=m-p;if(d.top=Math.ceil(Math.max(Math.min(y,d.top),0)),g0(p,m)||d.top===v){e({scrollTop:v,scrollHeight:m,viewportHeight:p}),f&&t(!0);return}f?(i.current=d.top,a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,i.current=null,t(!0)},1e3)):i.current=null,h.scrollTo(d)}function u(d){s.current.scrollBy(d)}return{scrollerRef:s,scrollByCallback:u,scrollToCallback:c}}const Lt=De(()=>{const e=Ce(),t=Ce(),n=X(0),r=Ce(),o=X(0),s=Ce(),i=Ce(),a=X(0),l=X(0),c=X(0),u=X(0),d=Ce(),h=Ce(),f=X(!1);return ue(q(e,se(({scrollTop:p})=>p)),t),ue(q(e,se(({scrollHeight:p})=>p)),i),ue(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:a,fixedHeaderHeight:l,fixedFooterHeight:c,footerHeight:u,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:d,scrollBy:h,statefulScrollTop:o,deviation:n,scrollingInProgress:f}},[],{singleton:!0}),$s={lvl:0};function v0(e,t,n,r=$s,o=$s){return{k:e,v:t,lvl:n,l:r,r:o}}function We(e){return e===$s}function lo(){return $s}function fu(e,t){if(We(e))return $s;const{k:n,l:r,r:o}=e;if(t===n){if(We(r))return o;if(We(o))return r;{const[s,i]=b0(r);return Ni(gt(e,{k:s,v:i,l:x0(r)}))}}else return t<n?Ni(gt(e,{l:fu(r,t)})):Ni(gt(e,{r:fu(o,t)}))}function Bs(e,t){if(!We(e))return t===e.k?e.v:t<e.k?Bs(e.l,t):Bs(e.r,t)}function ln(e,t,n="k"){if(We(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=ln(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return ln(e.l,t,n)}function Ut(e,t,n){return We(e)?v0(t,n,1):t===e.k?gt(e,{k:t,v:n}):t<e.k?_m(gt(e,{l:Ut(e.l,t,n)})):_m(gt(e,{r:Ut(e.r,t,n)}))}function hu(e,t,n){if(We(e))return[];const{k:r,v:o,l:s,r:i}=e;let a=[];return r>t&&(a=a.concat(hu(s,t,n))),r>=t&&r<=n&&a.push({k:r,v:o}),r<=n&&(a=a.concat(hu(i,t,n))),a}function Or(e){return We(e)?[]:[...Or(e.l),{k:e.k,v:e.v},...Or(e.r)]}function b0(e){return We(e.r)?[e.k,e.v]:b0(e.r)}function x0(e){return We(e.r)?e.l:Ni(gt(e,{r:x0(e.r)}))}function gt(e,t){return v0(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function ac(e){return We(e)||e.lvl>e.r.lvl}function _m(e){return pu(S0(e))}function Ni(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(ac(t))return S0(gt(e,{lvl:r-1}));if(!We(t)&&!We(t.r))return gt(t.r,{l:gt(t,{r:t.r.l}),r:gt(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(ac(e))return pu(gt(e,{lvl:r-1}));if(!We(n)&&!We(n.l)){const o=n.l,s=ac(o)?n.lvl-1:n.lvl;return gt(o,{l:gt(e,{r:o.l,lvl:r-1}),r:pu(gt(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function el(e,t,n){if(We(e))return[];const r=ln(e,t)[0];return yD(hu(e,r,n))}function w0(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({start:r,end:a-1,value:o}),r=a,o=l}return s.push({start:r,end:1/0,value:o}),s}function yD(e){return w0(e,({k:t,v:n})=>({index:t,value:n}))}function pu(e){const{r:t,lvl:n}=e;return!We(t)&&!We(t.r)&&t.lvl===n&&t.r.lvl===n?gt(t,{l:gt(e,{r:t.l}),lvl:n+1}):e}function S0(e){const{l:t}=e;return!We(t)&&t.lvl===e.lvl?gt(t,{r:gt(e,{l:t.r})}):e}function ha(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function T0(e,t,n){return e[ha(e,t,n)]}function vD(e,t,n,r){const o=ha(e,t,r),s=ha(e,n,r,o);return e.slice(o,s+1)}const Wd=De(()=>({recalcInProgress:X(!1)}),[],{singleton:!0});function bD(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function Mm(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function xD(e,t){let n=We(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:i}=r;if(n=Math.min(n,s),We(e)){e=Ut(e,0,o);continue}const a=el(e,s-1,i+1);if(a.some(bD(r)))continue;let l=!1,c=!1;for(const{start:u,end:d,value:h}of a)l?(i>=u||o===h)&&(e=fu(e,u)):(c=h!==o,l=!0),d>i&&i>=u&&h!==o&&(e=Ut(e,i+1,h));c&&(e=Ut(e,s,o))}return[e,n]}function wD(){return{offsetTree:[],sizeTree:lo(),groupOffsetTree:lo(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Hd({index:e},t){return t===e?0:t<e?-1:1}function SD({offset:e},t){return t===e?0:t<e?-1:1}function TD(e){return{index:e.index,value:e}}function ED(e,t,n,r=0){return r>0&&(t=Math.max(t,T0(e,r,Hd).offset)),w0(vD(e,t,n,SD),TD)}function mu(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=ha(o,t-1,Hd),a=o[l].offset;const u=ln(n,t-1);s=u[0],i=u[1],o.length&&o[l].size===ln(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:u}of el(n,t,1/0)){const d=c-s,h=d*i+a+d*r;o.push({offset:h,size:u,index:c}),s=c,a=h,i=u}return{offsetTree:o,lastIndex:s,lastOffset:a,lastSize:i}}function CD(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Yt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&We(s)&&t.length===2){const h=t[0].size,f=t[1].size;i=n.reduce((p,m)=>Ut(Ut(p,m,h),m+1,f),i)}else[i,a]=xD(i,t);if(i===s)return e;const{offsetTree:l,lastIndex:c,lastSize:u,lastOffset:d}=mu(e.offsetTree,a,i,o);return{sizeTree:i,offsetTree:l,lastIndex:c,lastOffset:d,lastSize:u,groupOffsetTree:n.reduce((h,f)=>Ut(h,f,zs(f,l,o)),lo()),groupIndices:n}}function zs(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=T0(t,e,Hd),i=e-o,a=s*i+(i-1)*n+r;return a>0?a+n:a}function RD(e){return typeof e.groupIndex<"u"}function E0(e,t,n){if(RD(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=C0(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function C0(e,t){if(!tl(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function tl(e){return!We(e.groupOffsetTree)}function PD(e){return Or(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],i=s?s.k-1:1/0;return{startIndex:t,endIndex:i,size:n}})}const kD={offsetHeight:"height",offsetWidth:"width"},On=De(([{log:e},{recalcInProgress:t}])=>{const n=Ce(),r=Ce(),o=_t(r,0),s=Ce(),i=Ce(),a=X(0),l=X([]),c=X(void 0),u=X(void 0),d=X((S,E)=>an(S,kD[E])),h=X(void 0),f=X(0),p=wD(),m=_t(q(n,be(l,e,f),bn(CD,p),Ke()),p),v=_t(q(l,Ke(),bn((S,E)=>({prev:S.current,current:E}),{prev:[],current:[]}),se(({prev:S})=>S)),[]);ue(q(l,he(S=>S.length>0),be(m,f),se(([S,E,k])=>{const R=S.reduce((I,C,F)=>Ut(I,C,zs(C,E.offsetTree,k)||F),lo());return{...E,groupIndices:S,groupOffsetTree:R}})),m),ue(q(r,be(m),he(([S,{lastIndex:E}])=>S<E),se(([S,{lastIndex:E,lastSize:k}])=>[{startIndex:S,endIndex:E,size:k}])),n),ue(c,u);const y=_t(q(c,se(S=>S===void 0)),!0);ue(q(u,he(S=>S!==void 0&&We(At(m).sizeTree)),se(S=>[{startIndex:0,endIndex:0,size:S}])),n);const x=Gt(q(n,be(m),bn(({sizes:S},[E,k])=>({changed:k!==S,sizes:k}),{changed:!1,sizes:p}),se(S=>S.changed)));$e(q(a,bn((S,E)=>({diff:S.prev-E,prev:E}),{diff:0,prev:0}),se(S=>S.diff)),S=>{const{groupIndices:E}=At(m);if(S>0)ve(t,!0),ve(s,S+Mm(S,E));else if(S<0){const k=At(v);k.length>0&&(S-=Mm(-S,k)),ve(i,S)}}),$e(q(a,be(e)),([S,E])=>{S<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Yt.ERROR)});const g=Gt(s);ue(q(s,be(m),se(([S,E])=>{const k=E.groupIndices.length>0,R=[],I=E.lastSize;if(k){const C=Bs(E.sizeTree,0);let F=0,M=0;for(;F<S;){const A=E.groupIndices[M],D=E.groupIndices.length===M+1?1/0:E.groupIndices[M+1]-A-1;R.push({startIndex:A,endIndex:A,size:C}),R.push({startIndex:A+1,endIndex:A+1+D-1,size:I}),M++,F+=D+1}const N=Or(E.sizeTree);return F!==S&&N.shift(),N.reduce((A,{k:D,v:L})=>{let H=A.ranges;return A.prevSize!==0&&(H=[...A.ranges,{startIndex:A.prevIndex,endIndex:D+S-1,size:A.prevSize}]),{ranges:H,prevIndex:D+S,prevSize:L}},{ranges:R,prevIndex:S,prevSize:0}).ranges}return Or(E.sizeTree).reduce((C,{k:F,v:M})=>({ranges:[...C.ranges,{startIndex:C.prevIndex,endIndex:F+S-1,size:C.prevSize}],prevIndex:F+S,prevSize:M}),{ranges:[],prevIndex:0,prevSize:I}).ranges})),n);const T=Gt(q(i,be(m,f),se(([S,{offsetTree:E},k])=>{const R=-S;return zs(R,E,k)})));return ue(q(i,be(m,f),se(([S,E,k])=>{if(E.groupIndices.length>0){if(We(E.sizeTree))return E;let I=lo();const C=At(v);let F=0,M=0,N=0;for(;F<-S;){N=C[M];const A=C[M+1]-N-1;M++,F+=A+1}if(I=Or(E.sizeTree).reduce((A,{k:D,v:L})=>Ut(A,Math.max(0,D+S),L),I),F!==-S){const A=Bs(E.sizeTree,N);I=Ut(I,0,A);const D=ln(E.sizeTree,-S+1)[1];I=Ut(I,1,D)}return{...E,sizeTree:I,...mu(E.offsetTree,0,I,k)}}else{const I=Or(E.sizeTree).reduce((C,{k:F,v:M})=>Ut(C,Math.max(0,F+S),M),lo());return{...E,sizeTree:I,...mu(E.offsetTree,0,I,k)}}})),m),{data:h,totalCount:r,sizeRanges:n,groupIndices:l,defaultItemSize:u,fixedItemSize:c,unshiftWith:s,shiftWith:i,shiftWithOffset:T,beforeUnshiftWith:g,firstItemIndex:a,gap:f,sizes:m,listRefresh:x,statefulTotalCount:o,trackItemSizes:y,itemSize:d}},Ze(pr,Wd),{singleton:!0}),ID=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function R0(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!ID)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const li=De(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:i,smoothScrollTargetReached:a,headerHeight:l,footerHeight:c,fixedHeaderHeight:u,fixedFooterHeight:d},{log:h}])=>{const f=Ce(),p=Ce(),m=X(0);let v=null,y=null,x=null;function g(){v&&(v(),v=null),x&&(x(),x=null),y&&(clearTimeout(y),y=null),ve(o,!1)}return ue(q(f,be(e,s,t,m,l,c,h),be(r,u,d),se(([[T,S,E,k,R,I,C,F],M,N,P])=>{const A=R0(T),{align:D,behavior:L,offset:H}=A,U=k-1,O=E0(A,S,U);let $=zs(O,S.offsetTree,M)+I;D==="end"?($+=N+ln(S.sizeTree,O)[1]-E+P,O===U&&($+=C)):D==="center"?$+=(N+ln(S.sizeTree,O)[1]-E+P)/2:$-=R,H&&($+=H);const Z=te=>{g(),te?(F("retrying to scroll to",{location:T},Yt.DEBUG),ve(f,T)):(ve(p,!0),F("list did not change, scroll successful",{},Yt.DEBUG))};if(g(),L==="smooth"){let te=!1;x=$e(n,Q=>{te=te||Q}),v=Pn(a,()=>{Z(te)})}else v=Pn(q(n,OD(150)),Z);return y=setTimeout(()=>{g()},1200),ve(o,!0),F("scrolling from index to",{index:O,top:$,behavior:L},Yt.DEBUG),{top:$,behavior:L}})),i),{scrollToIndex:f,scrollTargetReached:p,topListHeight:m}},Ze(On,Lt,pr),{singleton:!0});function OD(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const Ws="up",Rs="down",AD="none",_D={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},MD=0,ci=De(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=X(!1),a=X(!0),l=Ce(),c=Ce(),u=X(4),d=X(MD),h=_t(q(Am(q(me(t),Oo(1),pn(!0)),q(me(t),Oo(1),pn(!1),Om(100))),Ke()),!1),f=_t(q(Am(q(s,pn(!0)),q(s,pn(!1),Om(200))),Ke()),!1);ue(q(wt(me(t),me(d)),se(([x,g])=>x<=g),Ke()),a),ue(q(a,Zn(50)),c);const p=Gt(q(wt(e,me(n),me(r),me(o),me(u)),bn((x,[{scrollTop:g,scrollHeight:T},S,E,k,R])=>{const I=g+S-T>-R,C={viewportHeight:S,scrollTop:g,scrollHeight:T};if(I){let M,N;return g>x.state.scrollTop?(M="SCROLLED_DOWN",N=x.state.scrollTop-g):(M="SIZE_DECREASED",N=x.state.scrollTop-g||x.scrollTopDelta),{atBottom:!0,state:C,atBottomBecause:M,scrollTopDelta:N}}let F;return C.scrollHeight>x.state.scrollHeight?F="SIZE_INCREASED":S<x.state.viewportHeight?F="VIEWPORT_HEIGHT_DECREASING":g<x.state.scrollTop?F="SCROLLING_UPWARDS":F="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:F,state:C}},_D),Ke((x,g)=>x&&x.atBottom===g.atBottom))),m=_t(q(e,bn((x,{scrollTop:g,scrollHeight:T,viewportHeight:S})=>{if(g0(x.scrollHeight,T))return{scrollTop:g,scrollHeight:T,jump:0,changed:!1};{const E=T-(g+S)<1;return x.scrollTop!==g&&E?{scrollHeight:T,scrollTop:g,jump:x.scrollTop-g,changed:!0}:{scrollHeight:T,scrollTop:g,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),he(x=>x.changed),se(x=>x.jump)),0);ue(q(p,se(x=>x.atBottom)),i),ue(q(i,Zn(50)),l);const v=X(Rs);ue(q(e,se(({scrollTop:x})=>x),Ke(),bn((x,g)=>At(f)?{direction:x.direction,prevScrollTop:g}:{direction:g<x.prevScrollTop?Ws:Rs,prevScrollTop:g},{direction:Rs,prevScrollTop:0}),se(x=>x.direction)),v),ue(q(e,Zn(50),pn(AD)),v);const y=X(0);return ue(q(h,he(x=>!x),pn(0)),y),ue(q(t,Zn(100),be(h),he(([x,g])=>!!g),bn(([x,g],[T])=>[g,T],[0,0]),se(([x,g])=>g-x)),y),{isScrolling:h,isAtTop:a,isAtBottom:i,atBottomState:p,atTopStateChange:c,atBottomStateChange:l,scrollDirection:v,atBottomThreshold:u,atTopThreshold:d,scrollVelocity:y,lastJumpDueToItemResize:m}},Ze(Lt)),mr=De(([{log:e}])=>{const t=X(!1),n=Gt(q(t,he(r=>r),Ke()));return $e(t,r=>{r&&At(e)("props updated",{},Yt.DEBUG)}),{propsReady:t,didMount:n}},Ze(pr),{singleton:!0});function Ud(e,t){e==0?t():requestAnimationFrame(()=>Ud(e-1,t))}function Gd(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const ui=De(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o,scrollTargetReached:s},{didMount:i}])=>{const a=X(!0),l=X(0),c=X(!0);return ue(q(i,be(l),he(([u,d])=>!!d),pn(!1)),a),ue(q(i,be(l),he(([u,d])=>!!d),pn(!1)),c),$e(q(wt(t,i),be(a,e,n,c),he(([[,u],d,{sizeTree:h},f,p])=>u&&(!We(h)||Vd(f))&&!d&&!p),be(l)),([,u])=>{Pn(s,()=>{ve(c,!0)}),Ud(4,()=>{Pn(r,()=>{ve(a,!0)}),ve(o,u)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:l,initialItemFinalLocationReached:c}},Ze(On,Lt,li,mr),{singleton:!0});function Dm(e){return e?e==="smooth"?"smooth":"auto":!1}const DD=(e,t)=>typeof e=="function"?Dm(e(t)):t&&Dm(e),jD=De(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:i,didMount:a},{log:l},{scrollingInProgress:c}])=>{const u=X(!1),d=Ce();let h=null;function f(m){ve(o,{index:"LAST",align:"end",behavior:m})}$e(q(wt(q(me(e),Oo(1)),a),be(me(u),n,s,c),se(([[m,v],y,x,g,T])=>{let S=v&&g,E="auto";return S&&(E=DD(y,x||T),S=S&&!!E),{totalCount:m,shouldFollow:S,followOutputBehavior:E}}),he(({shouldFollow:m})=>m)),({totalCount:m,followOutputBehavior:v})=>{h&&(h(),h=null),h=Pn(t,()=>{At(l)("following output to ",{totalCount:m},Yt.DEBUG),f(v),h=null})});function p(m){const v=Pn(r,y=>{m&&!y.atBottom&&y.notAtBottomBecause==="SIZE_INCREASED"&&!h&&(At(l)("scrolling to bottom due to increased size",{},Yt.DEBUG),f("auto"))});setTimeout(v,100)}return $e(q(wt(me(u),e,i),he(([m,,v])=>m&&v),bn(({value:m},[,v])=>({refreshed:m===v,value:v}),{refreshed:!1,value:0}),he(({refreshed:m})=>m),be(u,e)),([,m])=>{At(s)&&p(m!==!1)}),$e(d,()=>{p(At(u)!==!1)}),$e(wt(me(u),r),([m,v])=>{m&&!v.atBottom&&v.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&f("auto")}),{followOutput:u,autoscrollToBottom:d}},Ze(On,ci,li,ui,mr,pr,Lt));function FD(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const P0=De(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Ce(),i=Ce(),a=Gt(q(s,se(FD)));return ue(q(a,se(l=>l.totalCount)),e),ue(q(a,se(l=>l.groupIndices)),t),ue(q(wt(r,n,o),he(([l,c])=>tl(c)),se(([l,c,u])=>ln(c.groupOffsetTree,Math.max(l-u,0),"v")[0]),Ke(),se(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},Ze(On,Lt));function Hs(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function k0(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const pa="top",ma="bottom",jm="none";function Fm(e,t,n){return typeof e=="number"?n===Ws&&t===pa||n===Rs&&t===ma?e:0:n===Ws?t===pa?e.main:e.reverse:t===ma?e.main:e.reverse}function Nm(e,t){return typeof e=="number"?e:e[t]||0}const Yd=De(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Ce(),i=X(0),a=X(0),l=X(0),c=_t(q(wt(me(e),me(t),me(r),me(s,Hs),me(l),me(i),me(o),me(n),me(a)),se(([u,d,h,[f,p],m,v,y,x,g])=>{const T=u-x,S=v+y,E=Math.max(h-T,0);let k=jm;const R=Nm(g,pa),I=Nm(g,ma);return f-=x,f+=h+y,p+=h+y,p-=x,f>u+S-R&&(k=Ws),p<u-E+d+I&&(k=Rs),k!==jm?[Math.max(T-h-Fm(m,pa,k)-R,0),T-E-y+d+Fm(m,ma,k)+I]:null}),he(u=>u!=null),Ke(Hs)),[0,0]);return{listBoundary:s,overscan:l,topListHeight:i,increaseViewportBy:a,visibleRange:c}},Ze(Lt),{singleton:!0});function ND(e,t,n){if(tl(t)){const r=C0(e,t);return[{index:ln(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const lc={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function Lm(e,t,n){if(e.length===0)return[];if(!tl(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=el(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let u;c.index===a.start?u={type:"group",index:l}:u={index:c.index-(l+1)+n,groupIndex:l},s.push({...u,size:c.size,offset:c.offset,originalIndex:c.index,data:c.data})}return s}function Li(e,t,n,r,o,s){const{lastSize:i,lastOffset:a,lastIndex:l}=o;let c=0,u=0;if(e.length>0){c=e[0].offset;const m=e[e.length-1];u=m.offset+m.size}const d=n-l,h=a+d*i+(d-1)*r,f=c,p=h-u;return{items:Lm(e,o,s),topItems:Lm(t,o,s),topListHeight:t.reduce((m,v)=>v.size+m,0),offsetTop:c,offsetBottom:p,top:f,bottom:u,totalCount:n,firstItemIndex:s}}function I0(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const u of n.groupIndices){if(u-i>=e)break;i++}const a=e+i,l=Gd(t,a),c=Array.from({length:a}).map((u,d)=>({index:d+l,size:0,offset:0,data:s[d+l]}));return Li(c,[],a,o,n,r)}const Wr=De(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:i,listBoundary:a,topListHeight:l},{scrolledToInitialItem:c,initialTopMostItemIndex:u},{topListHeight:d},h,{didMount:f},{recalcInProgress:p}])=>{const m=X([]),v=X(0),y=Ce();ue(s.topItemsIndexes,m);const x=_t(q(wt(f,p,me(i,Hs),me(t),me(e),me(u),c,me(m),me(r),me(o),n),he(([E,k,,R,,,,,,,I])=>{const C=I&&I.length!==R;return E&&!k&&!C}),se(([,,[E,k],R,I,C,F,M,N,P,A])=>{const D=I,{sizeTree:L,offsetTree:H}=D,U=At(v);if(R===0)return{...lc,totalCount:R};if(E===0&&k===0)return U===0?{...lc,totalCount:R}:I0(U,C,I,N,P,A||[]);if(We(L))return U>0?null:Li(ND(Gd(C,R),D,A),[],R,P,D,N);const O=[];if(M.length>0){const G=M[0],j=M[M.length-1];let B=0;for(const z of el(L,G,j)){const V=z.value,Y=Math.max(z.start,G),oe=Math.min(z.end,j);for(let W=Y;W<=oe;W++)O.push({index:W,size:V,offset:B,data:A&&A[W]}),B+=V}}if(!F)return Li([],O,R,P,D,N);const $=M.length>0?M[M.length-1]+1:0,Z=ED(H,E,k,$);if(Z.length===0)return null;const te=R-1,Q=Ja([],G=>{for(const j of Z){const B=j.value;let z=B.offset,V=j.start;const Y=B.size;if(B.offset<E){V+=Math.floor((E-B.offset+P)/(Y+P));const W=V-j.start;z+=W*Y+W*P}V<$&&(z+=($-V)*Y,V=$);const oe=Math.min(j.end,te);for(let W=V;W<=oe&&!(z>=k);W++)G.push({index:W,size:Y,offset:z,data:A&&A[W]}),z+=Y+P}});return Li(Q,O,R,P,D,N)}),he(E=>E!==null),Ke()),lc);ue(q(n,he(Vd),se(E=>E==null?void 0:E.length)),t),ue(q(x,se(E=>E.topListHeight)),d),ue(d,l),ue(q(x,se(E=>[E.top,E.bottom])),a),ue(q(x,se(E=>E.items)),y);const g=Gt(q(x,he(({items:E})=>E.length>0),be(t,n),he(([{items:E},k])=>E[E.length-1].originalIndex===k-1),se(([,E,k])=>[E-1,k]),Ke(Hs),se(([E])=>E))),T=Gt(q(x,Zn(200),he(({items:E,topItems:k})=>E.length>0&&E[0].originalIndex===k.length),se(({items:E})=>E[0].index),Ke())),S=Gt(q(x,he(({items:E})=>E.length>0),se(({items:E})=>{let k=0,R=E.length-1;for(;E[k].type==="group"&&k<R;)k++;for(;E[R].type==="group"&&R>k;)R--;return{startIndex:E[k].index,endIndex:E[R].index}}),Ke(k0)));return{listState:x,topItemsIndexes:m,endReached:g,startReached:T,rangeChanged:S,itemsRendered:y,initialItemCount:v,...h}},Ze(On,P0,Yd,ui,li,ci,mr,Wd),{singleton:!0}),LD=De(([{sizes:e,firstItemIndex:t,data:n,gap:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(ue(q(a,be(s),he(([,l])=>l!==0),be(o,e,t,r,n),se(([[,l],c,u,d,h,f=[]])=>I0(l,c,u,d,h,f))),i),{}),Ze(On,ui,Wr,mr),{singleton:!0}),O0=De(([{scrollVelocity:e}])=>{const t=X(!1),n=Ce(),r=X(!1);return ue(q(e,be(r,t,n),he(([o,s])=>!!s),se(([o,s,i,a])=>{const{exit:l,enter:c}=s;if(i){if(l(o,a))return!1}else if(c(o,a))return!0;return i}),Ke()),t),$e(q(wt(t,e,n),be(r)),([[o,s,i],a])=>o&&a&&a.change&&a.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Ze(ci),{singleton:!0}),VD=De(([{topItemsIndexes:e}])=>{const t=X(0);return ue(q(t,he(n=>n>0),se(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},Ze(Wr)),A0=De(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Ce(),i=_t(q(wt(e,r,t,n,o),se(([a,l,c,u,d])=>a+l+c+u+d.offsetBottom+d.bottom)),0);return ue(me(i),s),{totalListHeight:i,totalListHeightChanged:s}},Ze(Lt,Wr),{singleton:!0});function _0(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const $D=_0(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),BD=De(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:i,lastJumpDueToItemResize:a},{listState:l},{beforeUnshiftWith:c,shiftWithOffset:u,sizes:d,gap:h},{log:f},{recalcInProgress:p}])=>{const m=Gt(q(l,be(a),bn(([,y,x,g],[{items:T,totalCount:S,bottom:E,offsetBottom:k},R])=>{const I=E+k;let C=0;return x===S&&y.length>0&&T.length>0&&(T[0].originalIndex===0&&y[0].originalIndex===0||(C=I-g,C!==0&&(C+=R))),[C,T,S,I]},[0,[],0,0]),he(([y])=>y!==0),be(t,i,r,s,f,p),he(([,y,x,g,,,T])=>!T&&!g&&y!==0&&x===Ws),se(([[y],,,,,x])=>(x("Upward scrolling compensation",{amount:y},Yt.DEBUG),y))));function v(y){y>0?(ve(e,{top:-y,behavior:"auto"}),ve(n,0)):(ve(n,0),ve(e,{top:-y,behavior:"auto"}))}return $e(q(m,be(n,o)),([y,x,g])=>{g&&$D()?ve(n,x-y):v(-y)}),$e(q(wt(_t(o,!1),n,p),he(([y,x,g])=>!y&&!g&&x!==0),se(([y,x])=>x),Zn(1)),v),ue(q(u,se(y=>({top:-y}))),e),$e(q(c,be(d,h),se(([y,{lastSize:x,groupIndices:g,sizeTree:T},S])=>{function E(k){return k*(x+S)}if(g.length===0)return E(y);{let k=0;const R=Bs(T,0);let I=0,C=0;for(;I<y;){I++,k+=R;let F=g.length===C+1?1/0:g[C+1]-g[C]-1;I+F>y&&(k-=R,F=y-I+1),I+=F,k+=E(F),C++}return k}})),y=>{ve(n,y),requestAnimationFrame(()=>{ve(e,{top:y}),requestAnimationFrame(()=>{ve(n,0),ve(p,!1)})})}),{deviation:n}},Ze(Lt,ci,Wr,On,pr,Wd)),zD=De(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=X(0);return $e(q(e,be(r),he(([,o])=>o!==0),se(([,o])=>({top:o}))),o=>{Pn(q(n,Oo(1),he(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{ve(t,o)})})}),{initialScrollTop:r}},Ze(mr,Lt,Wr),{singleton:!0}),WD=De(([{viewportHeight:e},{totalListHeight:t}])=>{const n=X(!1),r=_t(q(wt(n,e,t),he(([o])=>o),se(([,o,s])=>Math.max(0,o-s)),Zn(0),Ke()),0);return{alignToBottom:n,paddingTopAddition:r}},Ze(Lt,A0),{singleton:!0}),qd=De(([{scrollTo:e,scrollContainerState:t}])=>{const n=Ce(),r=Ce(),o=Ce(),s=X(!1),i=X(void 0);return ue(q(wt(n,r),se(([{viewportHeight:a,scrollTop:l,scrollHeight:c},{offsetTop:u}])=>({scrollTop:Math.max(0,l-u),scrollHeight:c,viewportHeight:a}))),t),ue(q(e,be(r),se(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Ze(Lt)),HD=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...i}})=>e<n?{...i,behavior:o,align:s??"start"}:t>r?{...i,behavior:o,align:s??"end"}:null,UD=De(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:i,fixedFooterHeight:a,scrollingInProgress:l},{scrollToIndex:c}])=>{const u=Ce();return ue(q(u,be(e,o,t,s,i,a,r),be(n),se(([[d,h,f,p,m,v,y,x],g])=>{const{done:T,behavior:S,align:E,calculateViewLocation:k=HD,...R}=d,I=E0(d,h,p-1),C=zs(I,h.offsetTree,g)+m+v,F=C+ln(h.sizeTree,I)[1],M=x+v,N=x+f-y,P=k({itemTop:C,itemBottom:F,viewportTop:M,viewportBottom:N,locationParams:{behavior:S,align:E,...R}});return P?T&&Pn(q(l,he(A=>A===!1),Oo(At(l)?1:2)),T):T&&T(),P}),he(d=>d!==null)),c),{scrollIntoView:u}},Ze(On,Lt,li,Wr,pr),{singleton:!0}),GD=De(([{sizes:e,sizeRanges:t},{scrollTop:n,headerHeight:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=Ce(),u=X(void 0),d=X(null),h=X(null);return ue(a,d),ue(l,h),$e(q(c,be(e,n,i,d,h,r)),([f,p,m,v,y,x,g])=>{const T=PD(p.sizeTree);v&&y!==null&&x!==null&&(m=y.scrollTop-x.offsetTop),m-=g,f({ranges:T,scrollTop:m})}),ue(q(u,he(Vd),se(YD)),o),ue(q(s,be(u),he(([,f])=>f!==void 0),Ke(),se(([,f])=>f.ranges)),t),{getState:c,restoreStateFrom:u}},Ze(On,Lt,ui,mr,qd));function YD(e){return{offset:e.scrollTop,index:0,align:"start"}}const qD=De(([e,t,n,r,o,s,i,a,l,c])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c}),Ze(Yd,LD,mr,O0,A0,zD,WD,qd,UD,pr)),M0=De(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:i,firstItemIndex:a,groupIndices:l,statefulTotalCount:c,gap:u,sizes:d},{initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:p},m,v,y,{listState:x,topItemsIndexes:g,...T},{scrollToIndex:S},E,{topItemCount:k},{groupCounts:R},I])=>(ue(T.rangeChanged,I.scrollSeekRangeChanged),ue(q(I.windowViewportRect,se(C=>C.visibleHeight)),m.viewportHeight),{totalCount:e,data:i,firstItemIndex:a,sizeRanges:t,initialTopMostItemIndex:h,scrolledToInitialItem:f,initialItemFinalLocationReached:p,topItemsIndexes:g,topItemCount:k,groupCounts:R,fixedItemHeight:n,defaultItemHeight:r,gap:u,...y,statefulTotalCount:c,listState:x,scrollToIndex:S,trackItemSizes:o,itemSize:s,groupIndices:l,...T,...I,...m,sizes:d,...v}),Ze(On,ui,Lt,GD,jD,Wr,li,BD,VD,P0,qD)),cc="-webkit-sticky",Vm="sticky",D0=_0(()=>{if(typeof document>"u")return Vm;const e=document.createElement("div");return e.style.position=cc,e.style.position===cc?cc:Vm});function Kd(e,t){const n=b.useRef(null),r=b.useCallback(a=>{if(a===null||!a.offsetParent)return;const l=a.getBoundingClientRect(),c=l.width;let u,d;if(t){const h=t.getBoundingClientRect(),f=l.top-h.top;u=h.height-Math.max(0,f),d=f+t.scrollTop}else u=window.innerHeight-Math.max(0,l.top),d=l.top+window.pageYOffset;n.current={offsetTop:d,visibleHeight:u,visibleWidth:c},e(n.current)},[e,t]),{callbackRef:o,ref:s}=zd(r),i=b.useCallback(()=>{r(s.current)},[r,s]);return b.useEffect(()=>{if(t){t.addEventListener("scroll",i);const a=new ResizeObserver(()=>{requestAnimationFrame(i)});return a.observe(t),()=>{t.removeEventListener("scroll",i),a.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}const nl=b.createContext(void 0),j0=b.createContext(void 0);function Zd(e){return e}const KD=De(()=>{const e=X(l=>`Item ${l}`),t=X(null),n=X(l=>`Group ${l}`),r=X({}),o=X(Zd),s=X("div"),i=X(zr),a=(l,c=null)=>_t(q(r,se(u=>u[l]),Ke()),c);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:i,FooterComponent:a("Footer"),HeaderComponent:a("Header"),TopItemListComponent:a("TopItemList"),ListComponent:a("List","div"),ItemComponent:a("Item","div"),GroupComponent:a("Group","div"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder")}}),ZD=De(([e,t])=>({...e,...t}),Ze(M0,KD)),XD=({height:e})=>b.createElement("div",{style:{height:e}}),QD={position:D0(),zIndex:1,overflowAnchor:"none"},JD={overflowAnchor:"none"},$m=b.memo(function({showTopList:t=!1}){const n=Se("listState"),r=Jt("sizeRanges"),o=Se("useWindowScroll"),s=Se("customScrollParent"),i=Jt("windowScrollContainerState"),a=Jt("scrollContainerState"),l=s||o?i:a,c=Se("itemContent"),u=Se("context"),d=Se("groupContent"),h=Se("trackItemSizes"),f=Se("itemSize"),p=Se("log"),m=Jt("gap"),{callbackRef:v}=m0(r,f,h,t?zr:l,p,m,s),[y,x]=b.useState(0);Jd("deviation",P=>{y!==P&&x(P)});const g=Se("EmptyPlaceholder"),T=Se("ScrollSeekPlaceholder")||XD,S=Se("ListComponent"),E=Se("ItemComponent"),k=Se("GroupComponent"),R=Se("computeItemKey"),I=Se("isSeeking"),C=Se("groupIndices").length>0,F=Se("alignToBottom"),M=Se("initialItemFinalLocationReached"),N=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop,paddingBottom:n.offsetBottom,marginTop:y!==0?y:F?"auto":0,...M?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&g?b.createElement(g,ot(g,u)):b.createElement(S,{...ot(S,u),ref:v,style:N,"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(P=>{const A=P.originalIndex,D=R(A+n.firstItemIndex,P.data,u);return I?b.createElement(T,{...ot(T,u),key:D,index:P.index,height:P.size,type:P.type||"item",...P.type==="group"?{}:{groupIndex:P.groupIndex}}):P.type==="group"?b.createElement(k,{...ot(k,u),key:D,"data-index":A,"data-known-size":P.size,"data-item-index":P.index,style:QD},d(P.index,u)):b.createElement(E,{...ot(E,u),...F0(E,P.data),key:D,"data-index":A,"data-known-size":P.size,"data-item-index":P.index,"data-item-group-index":P.groupIndex,style:JD},C?c(P.index,P.groupIndex,P.data,u):c(P.index,P.data,u))}))}),ej={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ts=e=>({width:"100%",height:"100%",position:"absolute",top:0,...e?{display:"flex",flexDirection:"column"}:{}}),tj={width:"100%",position:D0(),top:0,zIndex:1};function ot(e,t){if(typeof e!="string")return{context:t}}function F0(e,t){return{item:typeof e=="string"?void 0:t}}const nj=b.memo(function(){const t=Se("HeaderComponent"),n=Jt("headerHeight"),r=Se("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Se("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),rj=b.memo(function(){const t=Se("FooterComponent"),n=Jt("footerHeight"),r=Se("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Se("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null});function Xd({usePublisher:e,useEmitter:t,useEmitterValue:n}){return b.memo(function({style:s,children:i,...a}){const l=e("scrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("scrollerRef"),h=n("context"),{scrollerRef:f,scrollByCallback:p,scrollToCallback:m}=y0(l,u,c,d);return t("scrollTo",m),t("scrollBy",p),b.createElement(c,{ref:f,style:{...ej,...s},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...ot(c,h)},i)})}function Qd({usePublisher:e,useEmitter:t,useEmitterValue:n}){return b.memo(function({style:s,children:i,...a}){const l=e("windowScrollContainerState"),c=n("ScrollerComponent"),u=e("smoothScrollTargetReached"),d=n("totalListHeight"),h=n("deviation"),f=n("customScrollParent"),p=n("context"),{scrollerRef:m,scrollByCallback:v,scrollToCallback:y}=y0(l,u,c,zr,f);return fD(()=>(m.current=f||window,()=>{m.current=null}),[m,f]),t("windowScrollTo",y),t("scrollBy",v),b.createElement(c,{style:{position:"relative",...s,...d!==0?{height:d+h}:{}},"data-virtuoso-scroller":!0,...a,...ot(c,p)},i)})}const oj=({children:e})=>{const t=b.useContext(nl),n=Jt("viewportHeight"),r=Jt("fixedItemHeight"),o=Se("alignToBottom"),s=kn(b.useMemo(()=>Vs(n,i=>an(i,"height")),[n]));return b.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),b.createElement("div",{style:ts(o),ref:s,"data-viewport-type":"element"},e)},sj=({children:e})=>{const t=b.useContext(nl),n=Jt("windowViewportRect"),r=Jt("fixedItemHeight"),o=Se("customScrollParent"),s=Kd(n,o),i=Se("alignToBottom");return b.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(i),"data-viewport-type":"window"},e)},ij=({children:e})=>{const t=Se("TopItemListComponent")||"div",n=Se("headerHeight"),r={...tj,marginTop:`${n}px`},o=Se("context");return b.createElement(t,{style:r,...ot(t,o)},e)},aj=b.memo(function(t){const n=Se("useWindowScroll"),r=Se("topItemsIndexes").length>0,o=Se("customScrollParent"),s=o||n?uj:cj,i=o||n?sj:oj;return b.createElement(s,{...t},r&&b.createElement(ij,null,b.createElement($m,{showTopList:!0})),b.createElement(i,null,b.createElement(nj,null),b.createElement($m,null),b.createElement(rj,null)))}),{Component:lj,usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}=Bd(ZD,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},aj),cj=Xd({usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}),uj=Qd({usePublisher:Jt,useEmitterValue:Se,useEmitter:Jd}),dj=lj,Bm={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},fj={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:zm,ceil:Wm,floor:ga,min:uc,max:Ps}=Math;function hj(e){return{...fj,items:e}}function Hm(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function pj(e,t){return e&&e.column===t.column&&e.row===t.row}function Pi(e,t){return e&&e.width===t.width&&e.height===t.height}const mj=De(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:a,scrollContainerState:l,footerHeight:c,headerHeight:u},d,h,{propsReady:f,didMount:p},{windowViewportRect:m,useWindowScroll:v,customScrollParent:y,windowScrollContainerState:x,windowScrollTo:g},T])=>{const S=X(0),E=X(0),k=X(Bm),R=X({height:0,width:0}),I=X({height:0,width:0}),C=Ce(),F=Ce(),M=X(0),N=X(null),P=X({row:0,column:0}),A=Ce(),D=Ce(),L=X(!1),H=X(0),U=X(!0),O=X(!1);$e(q(p,be(H),he(([j,B])=>!!B)),()=>{ve(U,!1),ve(E,0)}),$e(q(wt(p,U,I,R,H,O),he(([j,B,z,V,,Y])=>j&&!B&&z.height!==0&&V.height!==0&&!Y)),([,,,,j])=>{ve(O,!0),Ud(1,()=>{ve(C,j)}),Pn(q(r),()=>{ve(n,[0,0]),ve(U,!0)})}),ue(q(D,he(j=>j!=null&&j.scrollTop>0),pn(0)),E),$e(q(p,be(D),he(([,j])=>j!=null)),([,j])=>{j&&(ve(R,j.viewport),ve(I,j==null?void 0:j.item),ve(P,j.gap),j.scrollTop>0&&(ve(L,!0),Pn(q(r,Oo(1)),B=>{ve(L,!1)}),ve(i,{top:j.scrollTop})))}),ue(q(R,se(({height:j})=>j)),o),ue(q(wt(me(R,Pi),me(I,Pi),me(P,(j,B)=>j&&j.column===B.column&&j.row===B.row),me(r)),se(([j,B,z,V])=>({viewport:j,item:B,gap:z,scrollTop:V}))),A),ue(q(wt(me(S),t,me(P,pj),me(I,Pi),me(R,Pi),me(N),me(E),me(L),me(U),me(H)),he(([,,,,,,,j])=>!j),se(([j,[B,z],V,Y,oe,W,Ee,,et,He])=>{const{row:tt,column:ce}=V,{height:Te,width:le}=Y,{width:Re}=oe;if(Ee===0&&(j===0||Re===0))return Bm;if(le===0){const jt=Gd(He,j),gr=jt===0?Math.max(Ee-1,0):jt;return hj(Hm(jt,gr,W))}const at=N0(Re,le,ce);let Pe,pt;et?B===0&&z===0&&Ee>0?(Pe=0,pt=Ee-1):(Pe=at*ga((B+tt)/(Te+tt)),pt=at*Wm((z+tt)/(Te+tt))-1,pt=uc(j-1,Ps(pt,at-1)),Pe=uc(pt,Ps(0,Pe))):(Pe=0,pt=-1);const J=Hm(Pe,pt,W),{top:ie,bottom:Oe}=Um(oe,V,Y,J),Ue=Wm(j/at),kt=Ue*Te+(Ue-1)*tt-Oe;return{items:J,offsetTop:ie,offsetBottom:kt,top:ie,bottom:Oe,itemHeight:Te,itemWidth:le}})),k),ue(q(N,he(j=>j!==null),se(j=>j.length)),S),ue(q(wt(R,I,k,P),he(([j,B,{items:z}])=>z.length>0&&B.height!==0&&j.height!==0),se(([j,B,{items:z},V])=>{const{top:Y,bottom:oe}=Um(j,V,B,z);return[Y,oe]}),Ke(Hs)),n);const $=X(!1);ue(q(r,be($),se(([j,B])=>B||j!==0)),$);const Z=Gt(q(me(k),he(({items:j})=>j.length>0),be(S,$),he(([{items:j},B,z])=>z&&j[j.length-1].index===B-1),se(([,j])=>j-1),Ke())),te=Gt(q(me(k),he(({items:j})=>j.length>0&&j[0].index===0),pn(0),Ke())),Q=Gt(q(me(k),be(L),he(([{items:j},B])=>j.length>0&&!B),se(([{items:j}])=>({startIndex:j[0].index,endIndex:j[j.length-1].index})),Ke(k0),Zn(0)));ue(Q,h.scrollSeekRangeChanged),ue(q(C,be(R,I,S,P),se(([j,B,z,V,Y])=>{const oe=R0(j),{align:W,behavior:Ee,offset:et}=oe;let He=oe.index;He==="LAST"&&(He=V-1),He=Ps(0,He,uc(V-1,He));let tt=gu(B,Y,z,He);return W==="end"?tt=zm(tt-B.height+z.height):W==="center"&&(tt=zm(tt-B.height/2+z.height/2)),et&&(tt+=et),{top:tt,behavior:Ee}})),i);const G=_t(q(k,se(j=>j.offsetBottom+j.bottom)),0);return ue(q(m,se(j=>({width:j.visibleWidth,height:j.visibleHeight}))),R),{data:N,totalCount:S,viewportDimensions:R,itemDimensions:I,scrollTop:r,scrollHeight:F,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:C,smoothScrollTargetReached:a,windowViewportRect:m,windowScrollTo:g,useWindowScroll:v,customScrollParent:y,windowScrollContainerState:x,deviation:M,scrollContainerState:l,footerHeight:c,headerHeight:u,initialItemCount:E,gap:P,restoreStateFrom:D,...h,initialTopMostItemIndex:H,gridState:k,totalListHeight:G,...d,startReached:te,endReached:Z,rangeChanged:Q,stateChanged:A,propsReady:f,stateRestoreInProgress:L,...T}},Ze(Yd,Lt,ci,O0,mr,qd,pr));function Um(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=gu(e,t,n,r[0].index),i=gu(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function gu(e,t,n,r){const o=N0(e.width,n.width,t.column),s=ga(r/o),i=s*n.height+Ps(0,s-1)*t.row;return i>0?i+t.row:i}function N0(e,t,n){return Ps(1,ga((e+n)/(ga(t)+n)))}const gj=De(()=>{const e=X(c=>`Item ${c}`),t=X({}),n=X(null),r=X("virtuoso-grid-item"),o=X("virtuoso-grid-list"),s=X(Zd),i=X("div"),a=X(zr),l=(c,u=null)=>_t(q(t,se(d=>d[c]),Ke()),u);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),yj=De(([e,t])=>({...e,...t}),Ze(mj,gj)),vj=b.memo(function(){const t=Qe("gridState"),n=Qe("listClassName"),r=Qe("itemClassName"),o=Qe("itemContent"),s=Qe("computeItemKey"),i=Qe("isSeeking"),a=rn("scrollHeight"),l=Qe("ItemComponent"),c=Qe("ListComponent"),u=Qe("ScrollSeekPlaceholder"),d=Qe("context"),h=rn("itemDimensions"),f=rn("gap"),p=Qe("log"),m=Qe("stateRestoreInProgress"),v=kn(b.useMemo(()=>y=>{const x=y.parentElement.parentElement.scrollHeight;a(x);const g=y.firstChild;if(g){const{width:T,height:S}=g.getBoundingClientRect();h({width:T,height:S})}f({row:Gm("row-gap",getComputedStyle(y).rowGap,p),column:Gm("column-gap",getComputedStyle(y).columnGap,p)})},[a,h,f,p]));return m?null:b.createElement(c,{ref:v,className:n,...ot(c,d),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list"},t.items.map(y=>{const x=s(y.index,y.data,d);return i?b.createElement(u,{key:x,...ot(u,d),index:y.index,height:t.itemHeight,width:t.itemWidth}):b.createElement(l,{...ot(l,d),className:r,"data-index":y.index,key:x},o(y.index,y.data,d))}))}),bj=b.memo(function(){const t=Qe("HeaderComponent"),n=rn("headerHeight"),r=Qe("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Qe("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),xj=b.memo(function(){const t=Qe("FooterComponent"),n=rn("footerHeight"),r=Qe("headerFooterTag"),o=kn(b.useMemo(()=>i=>n(an(i,"height")),[n])),s=Qe("context");return t?b.createElement(r,{ref:o},b.createElement(t,ot(t,s))):null}),wj=({children:e})=>{const t=b.useContext(j0),n=rn("itemDimensions"),r=rn("viewportDimensions"),o=kn(b.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]));return b.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),b.createElement("div",{style:ts(!1),ref:o},e)},Sj=({children:e})=>{const t=b.useContext(j0),n=rn("windowViewportRect"),r=rn("itemDimensions"),o=Qe("customScrollParent"),s=Kd(n,o);return b.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(!1)},e)},Tj=b.memo(function({...t}){const n=Qe("useWindowScroll"),r=Qe("customScrollParent"),o=r||n?Cj:Ej,s=r||n?Sj:wj;return b.createElement(o,{...t},b.createElement(s,null,b.createElement(bj,null),b.createElement(vj,null),b.createElement(xj,null)))}),{Component:UN,usePublisher:rn,useEmitterValue:Qe,useEmitter:L0}=Bd(yj,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},Tj),Ej=Xd({usePublisher:rn,useEmitterValue:Qe,useEmitter:L0}),Cj=Qd({usePublisher:rn,useEmitterValue:Qe,useEmitter:L0});function Gm(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Yt.WARN),t==="normal"?0:parseInt(t??"0",10)}const Rj=De(()=>{const e=X(l=>b.createElement("td",null,"Item $",l)),t=X(null),n=X(null),r=X(null),o=X({}),s=X(Zd),i=X(zr),a=(l,c=null)=>_t(q(o,se(u=>u[l]),Ke()),c);return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:o,computeItemKey:s,scrollerRef:i,TableComponent:a("Table","table"),TableHeadComponent:a("TableHead","thead"),TableFooterComponent:a("TableFoot","tfoot"),TableBodyComponent:a("TableBody","tbody"),TableRowComponent:a("TableRow","tr"),ScrollerComponent:a("Scroller","div"),EmptyPlaceholder:a("EmptyPlaceholder"),ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),FillerRow:a("FillerRow")}}),Pj=De(([e,t])=>({...e,...t}),Ze(M0,Rj)),kj=({height:e})=>b.createElement("tr",null,b.createElement("td",{style:{height:e}})),Ij=({height:e})=>b.createElement("tr",null,b.createElement("td",{style:{height:e,padding:0,border:0}})),Oj={overflowAnchor:"none"},Aj=b.memo(function(){const t=Ne("listState"),n=on("sizeRanges"),r=Ne("useWindowScroll"),o=Ne("customScrollParent"),s=on("windowScrollContainerState"),i=on("scrollContainerState"),a=o||r?s:i,l=Ne("itemContent"),c=Ne("trackItemSizes"),u=Ne("itemSize"),d=Ne("log"),{callbackRef:h,ref:f}=m0(n,u,c,a,d,void 0,o),[p,m]=b.useState(0);ef("deviation",D=>{p!==D&&(f.current.style.marginTop=`${D}px`,m(D))});const v=Ne("EmptyPlaceholder"),y=Ne("ScrollSeekPlaceholder")||kj,x=Ne("FillerRow")||Ij,g=Ne("TableBodyComponent"),T=Ne("TableRowComponent"),S=Ne("computeItemKey"),E=Ne("isSeeking"),k=Ne("paddingTopAddition"),R=Ne("firstItemIndex"),I=Ne("statefulTotalCount"),C=Ne("context");if(I===0&&v)return b.createElement(v,ot(v,C));const F=t.offsetTop+k+p,M=t.offsetBottom,N=F>0?b.createElement(x,{height:F,key:"padding-top",context:C}):null,P=M>0?b.createElement(x,{height:M,key:"padding-bottom",context:C}):null,A=t.items.map(D=>{const L=D.originalIndex,H=S(L+R,D.data,C);return E?b.createElement(y,{...ot(y,C),key:H,index:D.index,height:D.size,type:D.type||"item"}):b.createElement(T,{...ot(T,C),...F0(T,D.data),key:H,"data-index":L,"data-known-size":D.size,"data-item-index":D.index,style:Oj},l(D.index,D.data,C))});return b.createElement(g,{ref:h,"data-testid":"virtuoso-item-list",...ot(g,C)},[N,...A,P])}),_j=({children:e})=>{const t=b.useContext(nl),n=on("viewportHeight"),r=on("fixedItemHeight"),o=kn(b.useMemo(()=>Vs(n,s=>an(s,"height")),[n]));return b.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),b.createElement("div",{style:ts(!1),ref:o,"data-viewport-type":"element"},e)},Mj=({children:e})=>{const t=b.useContext(nl),n=on("windowViewportRect"),r=on("fixedItemHeight"),o=Ne("customScrollParent"),s=Kd(n,o);return b.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),b.createElement("div",{ref:s,style:ts(!1),"data-viewport-type":"window"},e)},Dj=b.memo(function(t){const n=Ne("useWindowScroll"),r=Ne("customScrollParent"),o=on("fixedHeaderHeight"),s=on("fixedFooterHeight"),i=Ne("fixedHeaderContent"),a=Ne("fixedFooterContent"),l=Ne("context"),c=kn(b.useMemo(()=>Vs(o,x=>an(x,"height")),[o])),u=kn(b.useMemo(()=>Vs(s,x=>an(x,"height")),[s])),d=r||n?Nj:Fj,h=r||n?Mj:_j,f=Ne("TableComponent"),p=Ne("TableHeadComponent"),m=Ne("TableFooterComponent"),v=i?b.createElement(p,{key:"TableHead",style:{zIndex:2,position:"sticky",top:0},ref:c,...ot(p,l)},i()):null,y=a?b.createElement(m,{key:"TableFoot",style:{zIndex:1,position:"sticky",bottom:0},ref:u,...ot(m,l)},a()):null;return b.createElement(d,{...t},b.createElement(h,null,b.createElement(f,{style:{borderSpacing:0,overflowAnchor:"none"},...ot(f,l)},[v,b.createElement(Aj,{key:"TableBody"}),y])))}),{Component:jj,usePublisher:on,useEmitterValue:Ne,useEmitter:ef}=Bd(Pj,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Dj),Fj=Xd({usePublisher:on,useEmitterValue:Ne,useEmitter:ef}),Nj=Qd({usePublisher:on,useEmitterValue:Ne,useEmitter:ef}),Lj=jj,Vj=e=>{const[t,n]=b.useState(0);return b.useEffect(()=>{const r=e.current;if(!r)return;const o=r.parentElement;if(!o)return;const s=()=>{n(o.clientHeight)};return o.addEventListener("resize",s),s(),()=>{o.removeEventListener("resize",s)}},[]),t},$j={Item:b.forwardRef(function(t,n){return w.jsx("li",{...t,ref:n,className:"flex items-center gap-1 justify-between"})}),List:b.forwardRef(function(t,n){return w.jsx("ul",{...t,ref:n,className:"space-y-3"})})},Bj=e=>{const t=b.useRef(null),n=Vj(t);return w.jsxs("div",{className:"flex flex-row gap-4",ref:t,children:[w.jsxs("div",{className:"py-8 space-y-4 min-w-64 w-fit flex flex-col whitespace-nowrap rounded-lg border border-card-border",children:[w.jsx("header",{className:"border-b border-card-border pb-2"}),w.jsxs("div",{className:"px-8 space-y-2",children:[w.jsx(ii,{rightLabel:"",title:"Search",placeholder:"Looking for..."}),w.jsx(dj,{height:n,useWindowScroll:!0,data:e.source,components:$j,itemContent:(r,o)=>w.jsx(b.Fragment,{children:w.jsx(Qb,{children:w.jsx(e.Item,{data:o})})})})]})]}),w.jsx("div",{children:w.jsx(mo,{children:w.jsx(hd,{})})}),w.jsx("div",{})]})};var zj=Object.defineProperty,Ym=Object.getOwnPropertySymbols,Wj=Object.prototype.hasOwnProperty,Hj=Object.prototype.propertyIsEnumerable,qm=(e,t,n)=>t in e?zj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uj=(e,t)=>{for(var n in t||(t={}))Wj.call(t,n)&&qm(e,n,t[n]);if(Ym)for(var n of Ym(t))Hj.call(t,n)&&qm(e,n,t[n]);return e},tf=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return!0;return!1},Gj=(e,t,n,r)=>rl(tf,e,t,n,r),Ao=e=>typeof e=="object",Jn=(e,t)=>{if(e===t)return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(!e||!t||!Ao(e)&&!Ao(t))return e===t;if(e.prototype!==t.prototype)return!1;const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>Jn(e[r],t[r]))},Yj=(e,t)=>(Ao(e)||Array.isArray(e))&&t?e[t]:e,qj=e=>(t,n)=>t[e]===n[e]?0:t[e]>n[e]?1:-1,ya=e=>/[0-9.]+/.test(e),Km=e=>["string","number"].includes(typeof e),Zm=e=>e==null||(e==null?void 0:e.length)===0||e==="",Xm={eq:Jn,is:Object.is,"!=":(e,t)=>e!=t,"!==":(e,t)=>e!==t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"==":(e,t)=>e==t,"===":(e,t)=>e===t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,includes:(e,t)=>`${e}`.includes(t),notIncludes:(e,t)=>!`${e}`.includes(t),startsWith:(e,t)=>`${e}`.startsWith(t),endsWith:(e,t)=>`${e}`.endsWith(t),like:(e,t)=>new RegExp(`.*${t}.*`,"gi").test(`${e}`),alphabetical:(e,t)=>e.toString().localeCompare(t.toString()),empty:Zm,notEmpty:e=>!Zm(e),in:(e,t)=>tf(t,n=>Jn(e,n)),notIn:(e,t)=>V0(t,n=>!Jn(e,n))},Kj=e=>{if(e in Xm)return Xm[e];throw new Error("Linq - Symbol not found")},co=(e,t)=>{const n=[],r=e.length;for(let o=0;o<r;o++)t(e[o],o,e)&&n.push(e[o]);return n},rl=(e,t,n,r,o)=>{if(typeof n=="function")return e(t,n);const s=Kj(r);return n&&r&&o!==void 0?e(t,i=>s(i[n],o)):e(t,i=>s(i,o))},Zj=(e,t,n,r)=>rl(co,e,t,n,r),V0=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},Xj=(e,t,n,r)=>rl(V0,e,t,n,r),$0=e=>{if(e===null)return null;const t=Uj({},e);return Object.keys(t).forEach(n=>t[n]=Ao(e[n])?$0(e[n]):e[n]),Array.isArray(e)&&e.length?(t.length=e.length)&&Array.from(t):Array.isArray(e)?Array.from(e):t},Qm=(e,t)=>{if(Ao(t)){for(let n=0;n<e.length;n++){const r=e[n];if(Jn(t,r))return!0}return!1}for(let n=0;n<e.length;n++){const r=e[n];if(Jn(t,r))return!0}return!1},Qj=(e,t)=>{const n=new Map(e.map(r=>[r[t],r]));return Object.fromEntries(n.entries())},Jj=e=>co(e,(t,n,r)=>Ao(t)?n===r.findIndex(o=>Jn(o,t)):n===r.indexOf(t)),eF=(e,t)=>{const n=e.length;for(let r=0;r<n;r++)if(t(e[r],r,e))return e[r]},B0=(e,t)=>{const n=new Map;return e.forEach(r=>{const o=t(r),s=n.get(o)||[];s.push(r),n.set(o,s)}),Object.fromEntries(n.entries())},tF=(e,t)=>B0(e,n=>n[t]),Jm=(e,t)=>{const n=[];let r=0;const o=e.length;for(r;r<o;r++){const s=t(e[r],r,e);n.push(s)}return n},nF=(e,t)=>{let n=Number.parseInt(e,10),r=Number.parseInt(t,10);return n>r?[r,n]:[n,r]},rF=(e,t,n=1)=>{const r=[];let o=e.charCodeAt(0);const s=t.charCodeAt(0);for(;o<=s;o+=n)r.push(String.fromCharCode(o));return ya(e)&&ya(t)?r.map(i=>Number.parseInt(i)):r},dc=(e,t,n=1)=>{let r=Math.abs(n);if((e.length>1||t.length>1)&&ya(e)&&ya(t)){const o=[],[s,i]=nF(e,t);for(let a=s;a<=i;a+=r)o.push(a);return o}return rF(e,t,r)},oF=(e,t,n=1)=>{if(t===void 0){const[r,o,s]=e.split("..");return s===void 0?dc(r,o,1):dc(r,s,Number.parseInt(o,10))}return Km(e)&&Km(t)?dc(`${e}`,`${t}`,n):Array.from({length:e},(r,o)=>o*Math.abs(t))},fc=(e,t,n)=>{let r=t;const o=n.length;for(let s=0;s<o;s++){const i=n[s];r=e(r,i,s,n)}return r},eg=e=>{const t=Array.from(e.values());let n=null,r=null,o=t.length;for(n=0;n<o/2;n+=1){r=o-1-n;let s=t[n];t[n]=t[r],t[r]=s}return t},sF=(e,t)=>{if(typeof t=="number")return e.slice(t);let n=e.length;for(let r=0;r<n;r++){const o=e[r];if(t(o,r,e))return e.slice(r)}return e.slice(0)},iF=(e,t,n,r)=>rl(sF,e,t,n,r),tg=(e,t)=>{const n=[...e];return t===void 0?n.sort():typeof t=="function"?n.toSorted(t):n.toSorted(qj(t))},z0=(e=>(e.Asc="asc",e.Desc="desc",e))(z0||{}),aF=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.key,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),lF=(e,t)=>e.sort(aF(t)),cF=(e,t)=>{if(t===void 0)return[...new Set(e).values()];const n=new Set;return Array.isArray(t)?[...new Set(t)]:co(e,r=>{const o=t?n.has(r[t]):n.has(t);return t&&(o||n.add(r[t])),!o})},uF=class yu{constructor(t=[]){this.array=t}static Range(...t){return oF(...t)}static New(t){return new yu(t)}Where(t,n,r){return this.array=Zj(this.array,t,n,r),this}Some(t,n,r){return Gj(this.array,t,n,r)}All(t,n,r){return Xj(this.array,t,n,r)}Reverse(){return this.array=eg(this.array),this}Add(t){return this.array=Array.isArray(t)?this.array.concat(t):this.array.concat([t]),this}Prepend(t){return this.array=Array.isArray(t)?t.concat(this.array):[t].concat(this.array),this}Select(t){return t===void 0?this.array:this.array.map(t)}Take(t,n){return n!==void 0?this.array=this.array.slice(t,Math.max(0,n)):this.array=this.array.slice(t),this}Head(){return this.array[0]}Tail(){return this.Skip(1)}Skip(t,n,r){return this.array=iF(this.array,t,n,r),this}Distinct(){return this.array=Jj(this.array),this}First(t){return t===void 0?this.array[0]:eF(this.array,t)||null}Last(t){const n=this.array.length;if(t===void 0)return this.array[n-1];for(let r=n;r!==0;r--)if(t(this.array[r],r,this.array))return this.array[r]}Sum(t){return t===void 0?fc((n,r)=>n+r,0,this.array):fc((n,r)=>n+Yj(r,t),0,this.array)}Average(t){return this.Sum(t)/this.array.length}GroupBy(t){return tF(this.array,t)}GroupWith(t){return B0(this.array,t)}Except(t){return co(this.array,n=>!Qm(t,n))}Intersect(t){return co(this.array,n=>Qm(t,n))}OrderBy(t,n){let r;return r=t?tg(this.array,t):this.array.toSorted(),this.array=n==="desc"?eg(r):r,this}Includes(t){return tf(this.array,n=>Jn(n,t))}In(t){const n=t.length;for(let r=0;r<n;r++){const o=t[r];if(this.Includes(o))return!0}return!1}Reduce(t,n){return fc(t,n??this.array[0],this.array)}Empty(){return this.array.length===0}ToMap(t){return new Map(Jm(this.array,n=>[t,n]))}Zip(t,n){return Jm(this.array,(r,o)=>n(r,t[o]))}Count(t){return t===void 0?this.array.length:co(this.array,t).length}Get(t){return this.array[t]}Clone(){return new yu($0(this.array))}ToObject(t){return Qj(this.array,t)}Sort(t){return Array.isArray(t)?lF(this.array,t):tg(this.array,t)}Unique(t){return cF(this.array,t)}},W0=uF,vu={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=(v,y)=>{try{Object.keys(v).forEach(y)}catch(x){window.console.log(x)}},n=v=>v==null,r=v=>{const y=typeof v;return y==="string"||y==="number"||y==="boolean"||n(v)},o=(v,y)=>{const x=y.getItem(v);try{return JSON.parse(x)}catch{return x??null}},s=v=>Object.keys(v).reduce((y,x)=>({...y,[x]:o(x,v)}),{}),i=v=>v instanceof Date?v:typeof v=="number"?new Date(new Date*1+v*864e5):v,a="1969-12-31T23:59:59.000Z",l=()=>document.cookie===""?{}:document.cookie.split("; ").map(v=>v.split("=")).reduce((v,y)=>(v[decodeURIComponent(y[0].trim())]=decodeURIComponent(y[1].trim()),v),{}),c=new Set,u=()=>{const v=l();c.forEach(y=>y(v))},d=[{name:"expires",parse:v=>`expires=${i(v.expires??a)}`},{name:"maxAge",parse:v=>v.maxAge?`max-age=${i(v.expires??a)}`:""},{name:"path",parse:v=>`path=${v.path??"/"}`},{name:"sameSite",parse:v=>`samesite=${v.sameSite??"strict"}`},{name:"useSecure",parse:v=>`${v.useSecure??!0?"secure":""}`},{name:"domain",parse:v=>{const y=v.domain??"";return y===""?"":`domain=${v.multiDomain?".":""}${y}`}},{name:"partitioned",parse:v=>v.partitioned?"Partitioned":""}],h={json:l,listener:v=>(c.add(v),()=>c.delete(v)),clearListeners:()=>c.clear(),has:v=>document.cookie.split(";").some(y=>y.trim().startsWith(`${v}=`)),deleteAll:()=>{document.cookie.split(";").forEach(v=>{document.cookie=v.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}),u()},get:v=>{const y=h.json()[v];if(n(y))return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}},delete:v=>{document.cookie=`${encodeURIComponent(v)}=;expires=${new Date().toUTCString()}`,u()},set:(v,y,x={})=>{const g=r(y)?y:encodeURIComponent(JSON.stringify(y)),T=d.reduce((S,E)=>{const k=E.parse(x);return k===""?S:S.concat(k)},[`${encodeURIComponent(v)}=${g}`]).join(";");document.cookie=T,u()}},f=v=>{const y=new Set,x=g=>{v().removeItem(g);const T=s(v());y.forEach(S=>S(T))};return{delete:x,listener:g=>(y.add(g),()=>y.delete(g)),clearListeners:()=>y.clear(),json:(g=!1)=>g?s(v()):v(),has:g=>{const T=v().getItem(g);return!n(T)},deleteAll:()=>{t(v(),x),y.forEach(g=>g(v()))},get:g=>o(g,v()),set:(g,T)=>{v().setItem(g,JSON.stringify(T)),y.forEach(S=>S(v()))}}},p=f(()=>window.sessionStorage),m=f(()=>window.localStorage);e.Cookie=h,e.LocalStorage=m,e.SessionStorage=p,e.createStorage=f})(vu);const nf=e=>e.headerLabel??e.thead??e.id,rf=e=>e.map(t=>({value:t.id,label:t.thead??t.headerLabel??t.id}));var uo=(e=>(e.Boolean="boolean",e.Number="number",e.Select="select",e.Text="text",e))(uo||{});const of=e=>e.type==="number"?e.valueAsNumber:e.value,dF=e=>{let t=[];return e({add:(o,s,i)=>t.push({...i,id:o,thead:s}),remove:o=>t=t.filter(s=>s.id!==o)}),t},fF={},hF=(e,t=fF)=>{const n=ea()?null:vu.LocalStorage.get(`@unamed/table-${e}`)||null,[r,o]=bd({name:e,groups:t.groups||(n==null?void 0:n.groups)||[],sorters:t.sorters||(n==null?void 0:n.sorters)||[],filters:t.filters||(n==null?void 0:n.filters)||[],cols:t.cols||(n==null?void 0:n.cols)||[]},s=>{const i=a=>{const l=s.state(),c={...l,...a};return ea()||vu.LocalStorage.set(`@unamed/table-${l.name}`,c),c};return{set:a=>i(a)}});return{...r,...o,name:e}},bu=(e,t,n,r={})=>{var l;const o=e.id,s=e.type??uo.Text,i=(l=t[s])==null?void 0:l[0].value,a=n[i];return{id:Ha(),operation:a,label:nf(e),name:o,type:s,value:"",...r}},sf=()=>{const e=Wt(),t=b.useMemo(()=>({contains:{value:"contains",label:e.tableFilterTypeContains,symbol:"includes"},is:{value:"is",label:e.tableFilterTypeIs,symbol:"is"},isNot:{value:"isNot",label:e.tableFilterTypeIsNot,symbol:"!=="},notContains:{value:"notContains",label:e.tableFilterTypeNotContains,symbol:"notIncludes"},lessThan:{value:"lessThan",label:e.tableFilterTypeLessThan,symbol:"<="},greaterThan:{value:"greaterThan",label:e.tableFilterTypeGreaterThan,symbol:">="},startsWith:{value:"startsWith",label:e.tableFilterTypeStartsWith,symbol:"startsWith"},endsWith:{value:"endsWith",label:e.tableFilterTypeEndsWith,symbol:"endsWith"}}),[e]);return{operationOptions:b.useMemo(()=>({[uo.Text]:[t.is,t.isNot,t.contains,t.notContains,t.startsWith,t.endsWith],[uo.Boolean]:[t.is,t.isNot],[uo.Number]:[t.is,t.isNot,t.greaterThan,t.lessThan]}),[e]),operations:t}},pF=e=>{const t=Wt(),{operationOptions:n,operations:r}=sf(),o=()=>{const c=e.cols.at(0);e.set(u=>[...u,bu(c,n,r)])},s=c=>{const u=c.target.dataset.id||"",d=c.target.value;e.set(h=>h.map(f=>{if(u!==f.id)return f;const p=e.cols.find(m=>d===m.id);return bu(p,n,r,{value:""})}))},i=c=>{const u=c.target.dataset.id||"",d=c.target.value;e.set(h=>h.map(f=>f.id===u?{...f,operation:r[d]}:f))},a=c=>{const u=c.currentTarget.dataset.id||"";e.set(d=>d.filter(h=>h.id!==u))},l=c=>{const u=c.target.dataset.id||"",d=of(c.target);e.set(h=>h.map(f=>f.id===u?{...f,value:d}:f))};return w.jsx(b.Fragment,{children:w.jsx(Xo,{arrow:!0,title:t.tableFilterDropdownTitle,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(mP,{size:14}),t.tableFilterLabel," ",e.filters.length===0?"":` (${e.filters.length})`]}),children:w.jsxs("ul",{className:"mt-4 space-y-2",children:[e.filters.map(c=>{const u=n[c.type];return w.jsxs("li",{className:"flex flex-nowrap gap-3",children:[w.jsx(Nr,{options:e.options,title:t.tableFilterColumnTitle,placeholder:t.tableFilterColumnPlaceholder,value:c.name,"data-id":c.id,onChange:s}),w.jsx(Nr,{"data-id":c.id,onChange:i,value:c.operation.value,options:u,title:t.tableFilterOperatorTitle,placeholder:t.tableFilterOperatorPlaceholder}),w.jsx(ii,{"data-id":c.id,onChange:l,title:t.tableFilterValueTitle,placeholder:t.tableFilterValuePlaceholder,type:c.type,value:c.value,optionalText:""}),w.jsx("div",{className:"flex items-center justify-center mt-5",children:w.jsx("button",{"data-id":c.id,type:"button",onClick:a,children:w.jsx(So,{className:"text-danger",size:16})})})]},`filter-select-${c.id}`)}),w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[w.jsx(pd,{size:14})," ",t.tableFilterNewFilter]})})]})})})},mF=({filter:e,onDelete:t,set:n})=>{const r=Wt(),{operationOptions:o,operations:s}=sf(),i=l=>{const c=l.target.value,u=l.target.dataset.id||"";n(d=>d.map(h=>h.id===u?{...h,operation:s[c]}:h))},a=l=>{const c=l.target.dataset.id||"",u=of(l.target);n(d=>d.map(h=>h.id===c?{...h,value:u}:h))};return w.jsxs("div",{className:"flex flex-nowrap items-center gap-4 py-2",children:[w.jsx(Nr,{"data-id":e.id,onChange:i,options:o[e.type],title:r.tableFilterColumnTitle,placeholder:r.tableFilterColumnPlaceholder,value:e.operation.value}),w.jsx(ii,{"data-id":e.id,onChange:a,type:e.type,value:e.value,title:r.tableFilterValueTitle,placeholder:r.tableFilterValueTitle}),w.jsx("button",{onClick:t,"data-id":e.id,type:"button",className:"mt-4",children:w.jsx(So,{className:"text-danger",size:14})})]})},gF=({item:e,onPointerDown:t})=>{const n=wo(0);return w.jsxs(za.Item,{onPointerDown:t,id:e.groupId,className:"flex flex-row items-center gap-2",value:e,style:{y:n},children:[w.jsx("button",{type:"button",className:"cursor-grab",children:w.jsx(pP,{size:14})}),w.jsx("span",{children:e.groupName})]},e.groupId)},yF=e=>{var l;const t=Wt(),n=rf(e.cols),r=eP(),[o,s]=b.useState(((l=e.groups[0])==null?void 0:l.thead)||""),i=c=>{var v;const u=c.target,d=u.value,h=u.options.selectedIndex,f=((v=u.options.item(h))==null?void 0:v.label)||"";s(f);const p=new W0(e.rows).GroupBy(d),m=e.cols.find(y=>y.id===d);e.setGroups(y1(p).map((y,x)=>{const g=p[y];return{...m,groupId:Ha(),groupKey:d,index:x,rows:g,groupName:y}}))},a=()=>e.setGroups([]);return w.jsx(b.Fragment,{children:w.jsxs(Xo,{arrow:!1,title:t.tableGroupLabel,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(vP,{size:14}),t.tableGroupLabelWithCount,e.groups.length>0?` - ${o}(${e.groups.length})`:""]}),children:[w.jsxs("div",{className:"flex flex-nowrap items-center",children:[w.jsx(Nr,{value:o,title:"Tipo de agrupamento",onChange:i,options:n,placeholder:"Agrupar por..."}),w.jsx(mo,{className:"mt-4",onClick:a,theme:"raw","data-id":o,children:w.jsx(So,{size:16,className:"text-danger"})})]}),e.groups.length>0?w.jsxs("section",{className:"my-4",children:[w.jsx("header",{children:w.jsx("h2",{className:"text-xl font-medium",children:"Order groups"})}),w.jsx(wR,{children:w.jsx(za.Group,{axis:"y",className:"relative space-y-2",drag:!0,dragControls:r,dragListener:!1,layoutScroll:!0,onReorder:e.setGroups,values:e.groups,children:e.groups.map(c=>w.jsx(gF,{item:c,onPointerDown:u=>{r.start(u),e.setGroups([...e.groups])}},c.groupId))})})]}):null]})})},vF=e=>(t,n)=>e.reduce((r,o)=>{const s=o.type==="desc"?-1:1,i=o.value,a=t[i]>n[i]?s:t[i]<n[i]?-s:0;return r!==0?r:a},0),bF=(e,t)=>e.toSorted(vF(t)),H0=(e,t,n)=>({id:Ha(),type:n,value:e.id,label:t}),xF=e=>{const t=Wt(),n={asc:{label:t.tableSortAsc,value:"asc"},desc:{label:t.tableSortDesc,value:"desc"}},r=[n.asc,n.desc],o=()=>{const l=e.cols[0];l&&e.set(c=>[...c,H0(l,n.asc.label,n.asc.value)])},s=l=>c=>{const u=c.target.value;e.set(d=>d.map(h=>h.id===l?{...h,value:u}:h))},i=l=>c=>{const u=c.target.value;e.set(d=>d.map(h=>h.id===l?{...h,type:u}:h))},a=l=>{const c=l.currentTarget.dataset.id||"";e.set(u=>u.filter(d=>d.id!==c))};return w.jsx(b.Fragment,{children:w.jsx(Xo,{title:t.tableSortDropdownTitle,trigger:w.jsxs("span",{className:"flex items-center gap-1 proportional-nums",children:[w.jsx(Ev,{size:14}),t.tableSortOrderByLabel," ",e.sorters.length===0?"":` (${e.sorters.length})`]}),children:w.jsxs("ul",{className:"mt-4 space-y-2",children:[e.sorters.map(l=>w.jsxs("li",{className:"flex flex-nowrap gap-3",children:[w.jsx(Nr,{options:e.options,value:l.value,onChange:s(l.id),title:t.tableSortOrderInputTitle,placeholder:t.tableSortOrderInputPlaceholder}),w.jsx(Nr,{onChange:i(l.id),value:l.type,options:r,title:t.tableSortTypeInputTitle,placeholder:t.tableSortTypeInputPlaceholder}),w.jsx("button",{className:"mt-4","data-id":l.id,onClick:a,children:w.jsx(So,{className:"text-danger",size:14})})]},`sorter-select-${l.id}`)),w.jsx("li",{children:w.jsxs("button",{type:"button",onClick:o,className:"text-primary flex items-center gap-1",children:[w.jsx(pd,{size:14})," ",t.tableSortAddButton]})})]})})})},wF=e=>{const t=Wt(),[n,r]=b.useState(()=>{const a=e.sorters.find(l=>l.value===e.col.id);return a?a.type:"undefined"}),o=()=>r(a=>a==="undefined"?"asc":a==="asc"?"desc":"undefined");b.useEffect(()=>{e.setSorters(a=>{if(n==="undefined")return a.filter(u=>u.value!==e.col.id);const l=a.findIndex(u=>u.value===e.col.id),c=H0(e.col,n,n);return l===-1?[...a,c]:(a[l]=c,[...a])})},[n,e.col]);const s=`${e.col.id}-sorter-id`,i=nf(e.col);return w.jsxs("button",{"aria-labelledby":s,className:"isolate flex items-center",onClick:o,type:"button",children:[w.jsxs("span",{id:s,className:"sr-only",children:[t.tableSortDropdownTitle," ",i]}),n==="asc"?w.jsx(aP,{size:14}):null,n==="desc"?w.jsx(iP,{size:14}):null,n==="undefined"?w.jsx(Ev,{size:14}):null]})},SF=e=>w.jsx("header",{className:"min-w-full mb-1",children:w.jsxs("div",{className:"flex flex-wrap min-w-full items-center justify-between gap-x-4 gap-y-1",children:[w.jsxs("div",{className:"flex w-fit items-centeend gap-4 whitespace-nowrap py-2",children:[w.jsx("span",{children:w.jsx(pF,{cols:e.cols,options:e.options,filters:e.filters,set:e.setFilters})}),w.jsx("span",{children:w.jsx(xF,{options:e.options,cols:e.cols,sorters:e.sorters,set:e.setSorters})}),w.jsx("span",{children:w.jsx(yF,{rows:e.rows,groups:e.groups,setGroups:e.setGroups,options:e.options,cols:e.cols})})]}),w.jsx("ul",{className:"flex flex-wrap w-full flex-1 flex-grow flex-row items-center md:justify-end gap-4",children:e.filters.map(t=>w.jsxs("li",{className:"flex gap-1 items-center rounded-xl border border-card-border px-4 py-0.5",children:[w.jsxs("span",{children:[w.jsx("span",{className:"size-3 mr-2 aspect-square bg-primary inline-block rounded-full","aria-hidden":"true"}),t.label," ",t.operation.label.toLowerCase(),":"]}),w.jsxs("div",{className:"relative w-min min-w-[1ch]",children:[w.jsx("span",{"aria-hidden":"true",className:"invisible whitespace-pre p-0",children:t.value||" "}),w.jsx("input",{type:t.type,value:t.value,className:"absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-none [appearance:textfield] after:empty:text-primary/70 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onChange:n=>{const r=of(n.target);e.setFilters(o=>o.map(s=>t.id===s.id?{...s,value:r}:s))}})]})]},`filter-table-${t.id}`))})]})});function TF(e,t){if(!e||!t)return[];const n=[1];if(e===1&&t===1)return n;e>4&&n.push("-");let r=2;const o=e-r,s=e+r;for(let a=o>2?o:2;a<=Math.min(t,s);a++)n.push(a);const i=t-2;return s+1!==i&&s+1<t&&n.push("_"),s<t&&(n.push(t-2),n.push(t-1),n.push(t)),Array.from(new Set(n))}const EF=e=>{const t=b.useId(),n=Wt(),r=e.asLink||"button",o=b.useMemo(()=>TF(e.current,e.pages),[e.current,e.pages]),s=e.current<e.pages;return w.jsxs("footer",{className:"flex px-1 py-4 items-center justify-center gap-4 lg:justify-between flex-wrap lg:flex-nowrap",children:[w.jsx("p",{children:w.jsx(n.tablePaginationFooter,{...e,sizes:e.sizes,select:e.onChangeSize&&Array.isArray(e.sizes)?w.jsxs(b.Fragment,{children:[w.jsx("label",{htmlFor:t,children:n.tablePaginationSelectLabel}),w.jsx("select",{id:t,value:e.size,className:"cursor-pointer bg-transparent",onChange:i=>{var a;(a=e.onChangeSize)==null||a.call(e,Number(i.target.value))},children:e.sizes.map(i=>w.jsx("option",{value:i,children:i},`pagination-opt-${i}`))})," "]}):null})}),w.jsx("nav",{children:w.jsxs("ul",{className:"flex items-center gap-2",children:[e.current>1?w.jsx("li",{children:w.jsx(r,{href:"previous",className:"",children:n.tablePaginationPrevious})}):null,o.map(i=>i===null?null:w.jsx(b.Fragment,{children:typeof i=="string"?w.jsx("li",{children:"..."}):w.jsx("li",{children:w.jsx(r,{href:i,className:`cursor-pointer px-3 py-1 transition-colors border-b-2 hover:text-primary-subtle hover:border-primary-subtle proportional-nums ${i===e.current?"text-primary border-primary":"border-transparent"}`,children:i})})},`pagination-${i}`)),s?w.jsx("li",{children:w.jsx(r,{href:"next",className:"",children:n.tablePaginationNext})}):null]})})]})},CF={opacity:1},RF={opacity:.75,backgroundColor:"var(--table-border)"},PF={opacity:0,transition:{duration:.4,type:"spring"}},kF=e=>{var d;const t=Wt(),n=e.filters.filter(h=>h.name===e.header.id),o=n.length>0?gP:yP,{operationOptions:s,operations:i}=sf(),a=h=>{const f=h.currentTarget.dataset.id||"";return e.setFilters(p=>p.filter(m=>m.id!==f))},l=e.sorters.find(h=>e.header.id===h.value),c=l!=null&&l.type?l.type===z0.Asc?"ascending":"descending":"none",u=nf(e.header);return w.jsx(za.Item,{...e.header.thProps,as:"th",layout:!0,exit:PF,initial:!1,dragSnapToOrigin:!0,dragDirectionLock:!0,role:"columnheader",value:e.header,whileDrag:RF,"aria-sort":c,"aria-busy":e.loading,animate:CF,className:`hidden px-2 py-4 font-medium first:table-cell md:table-cell ${((d=e.header.thProps)==null?void 0:d.className)??""}`,children:w.jsx("span",{className:"flex items-center justify-between",children:w.jsxs("span",{className:"flex items-center gap-1",children:[w.jsx(Xo,{arrow:!0,trigger:w.jsxs("span",{children:[w.jsxs("span",{id:`${e.header.id}-filter-dropdown-button`,className:"sr-only",children:[t.tableFilterDropdownTitleUnique," ",u]}),e.inlineFilter?w.jsx(o,{"aria-labelledby":`${e.header.id}-filter-dropdown-button`,size:14}):null]}),title:w.jsxs("span",{className:"font-medium text-lg",children:[t.tableFilterDropdownTitleUnique," ",w.jsx("span",{className:"text-primary",children:u})]}),children:n.length===0===null?null:w.jsxs("ul",{className:"font-medium",children:[n.map(h=>w.jsx("li",{className:"my-1",children:w.jsx(mF,{onDelete:a,filter:h,set:e.setFilters})},`thead-filter-${h.id}`)),w.jsx("li",{children:w.jsxs("button",{onClick:()=>e.setFilters(h=>h.concat(bu(e.header,s,i))),type:"button",className:"flex items-center gap-1 text-primary",children:[w.jsx(pd,{size:14})," ",t.tableFilterNewFilter]})})]})}),w.jsx("span",{className:"pointer-events-auto text-balance text-base",children:e.header.thead}),e.inlineSorter?w.jsx(wF,{col:e.header,setSorters:e.setSorters,sorters:e.sorters}):null]})})})},IF=e=>w.jsx(za.Group,{as:"tr",role:"row",axis:"x",drag:!0,layout:!0,layoutRoot:!0,layoutScroll:!0,initial:!1,values:e.headers,onReorder:e.setCols,className:"border-none bg-table-background text-lg",children:w.jsx(ni,{children:e.headers.map(t=>w.jsx(kF,{inlineFilter:e.inlineFilter,inlineSorter:e.inlineSorter,loading:e.loading,setFilters:e.setFilters,filters:e.filters,setSorters:e.setSorters,sorters:e.sorters,header:t},`header-child-item-${t.id}`))})}),U0=b.createContext({}),OF=()=>b.useContext(U0),AF=b.forwardRef((e,t)=>w.jsx("tbody",{...e,role:"rowgroup",className:`divide-y divide-table-border ${e.className??""}`,ref:t,children:w.jsx(ni,{children:e.children})})),_F=b.forwardRef((e,t)=>w.jsx("table",{...e,ref:t,role:"table",className:`table min-w-full table-auto divide-y divide-table-border text-left ${e.className??""}`})),MF=b.forwardRef(({context:e,...t},n)=>{var s;const r=OF(),o={...t==null?void 0:t.style,sticky:xn.number(r.sticky)?`${r.sticky}px`:(s=t==null?void 0:t.style)==null?void 0:s.sticky};return w.jsx("thead",{...t,style:o,role:"rowgroup",className:"shadow-xs group:sticky top-0 bg-card-background",ref:n})}),DF=b.forwardRef(({context:e,item:t,...n},r)=>w.jsx("tr",{...n,role:"row",ref:r,className:`table-row ${(n==null?void 0:n.className)??""}`})),jF=b.forwardRef((e,t)=>e.context.loadingMore?w.jsx("tfoot",{...e,ref:t,className:"bg-card-background",children:w.jsx("tr",{role:"row",className:"bg-card-background",children:w.jsx("td",{colSpan:999,className:"h-14 bg-card-background px-2",children:w.jsx("span",{className:"block h-2 w-full animate-pulse rounded bg-foreground opacity-60"})})})}):null),FF={TableHead:MF,Table:_F,TableBody:AF,TableRow:DF,TableFoot:jF},NF=[0,0,0,0,0,0,0,0,0,0],LF=(e,t,n)=>{const r=n.cols,o=n.loading;return w.jsx(b.Fragment,{children:r.map((s,i)=>{var d;const a=`${i},${e}`,l=ib(t,s.id),c=s.Element,u=((d=s.cellProps)==null?void 0:d.className)||"";return b.createElement("td",{...s.cellProps,role:"cell","data-matrix":a,key:`accessor-${e}-${i}`,className:`hidden h-14 border-none px-2 first:table-cell md:table-cell ${u}`},o?w.jsx("div",{className:"h-2 w-10/12 animate-pulse rounded bg-table-border"}):c?w.jsx(c,{row:t,matrix:a,col:s,rowIndex:e,value:l}):w.jsx(b.Fragment,{children:xn.nil(l)?"":l}))})})},VF=()=>w.jsx(b.Fragment,{}),ng=({filters:e,pagination:t=null,onScrollEnd:n,useControl:r=!1,setCols:o,setFilters:s,sorters:i,cols:a,border:l=!1,setSorters:c,...u})=>{const d=b.useRef(null),[h,f]=b.useState(!1),p=du(n),m=du(u.loadingMore),v=b.useMemo(()=>{if(u.loading)return NF;if(r)return u.rows;const y=new W0(u.rows);return e.length>0&&e.forEach(x=>x.value===""||Number.isNaN(x.value)?void 0:y.Where(x.name,x.operation.symbol,x.value)),i.length===0?y.Select():bF(y.Select(),i)},[u.rows,e,i,u.loading]);return b.useEffect(()=>{if(d.current===null)return()=>{};const y=d.current,x=new IntersectionObserver(g=>{var E;return g[g.length-1].isIntersecting&&m.current?((E=p.current)==null||E.call(p),void f(!0)):f(!1)});return x.observe(y),()=>x.disconnect()},[]),w.jsxs("div",{className:"min-w-full",children:[w.jsxs("div",{className:`group rounded-lg px-1 ${l?"border border-table-border":""}`,children:[w.jsx(Lj,{data:v,useWindowScroll:!0,components:FF,totalCount:v.length,itemContent:LF,context:{loading:u.loading,loadingMore:u.loadingMore,cols:a},fixedFooterContent:h?VF:null,fixedHeaderContent:()=>w.jsx(IF,{filters:e,headers:a,inlineFilter:u.inlineFilter,inlineSorter:u.inlineSorter,loading:!!u.loading,setCols:o,setFilters:s,setSorters:c,sorters:i})}),w.jsx("div",{"aria-hidden":"true",ref:d,className:"h-0.5 w-full"})]}),t!==null?w.jsx(EF,{...t}):null]})},$F=(e,t)=>typeof t=="function"?t(e):t,ki=(e,t,n)=>e===t||n==null?void 0:n(t),BF=e=>{const t=b.useMemo(()=>({sticky:e.sticky}),[e.sticky]),n=e.operations??!0,r=b.useMemo(()=>rf(e.cols),[e.cols]),[o,s]=bd({cols:e.cols,filters:e.filters??[],groups:e.groups??[],sorters:e.sorters??[]},i=>{const a=l=>c=>{const u=i.state();return{...u,[l]:$F(u[l],c)}};return{cols:a("cols"),filters:a("filters"),groups:a("groups"),sorters:a("sorters")}},{postMiddleware:[(i,a)=>{var l;return console.log("->",i,a),(l=e.set)==null||l.call(e,i),ki((a==null?void 0:a.filters)??[],i.filters??[],e.setFilters),ki((a==null?void 0:a.sorters)??[],i.sorters??[],e.setSorters),ki((a==null?void 0:a.groups)??[],i.groups??[],e.setGroups),ki((a==null?void 0:a.cols)??[],i.cols??[],e.setCols),i}]});return w.jsx(U0.Provider,{value:t,children:w.jsxs("div",{className:"relative min-w-full",children:[n?w.jsx(SF,{cols:o.cols,filters:o.filters,groups:o.groups,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,options:r,pagination:e.pagination??null,rows:e.rows,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters}):null,o.groups.length===0?w.jsx(ng,{...e,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,onScrollEnd:e.onScrollEnd,cols:o.cols,filters:o.filters,groups:o.groups,index:0,optionCols:r,options:r,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters,pagination:e.pagination??null}):w.jsx("div",{className:"flex flex-wrap gap-4",children:o.groups.map((i,a)=>w.jsx(Ct.div,{className:"min-w-full",children:w.jsx(ng,{...e,inlineFilter:e.inlineFilter??!0,inlineSorter:e.inlineSorter??!0,pagination:null,onScrollEnd:e.onScrollEnd,cols:o.cols,filters:o.filters,group:i,groups:o.groups,index:a,optionCols:r,options:r,rows:i.rows,setCols:s.cols,setFilters:s.filters,setGroups:s.groups,setSorters:s.sorters,sorters:o.sorters})},`group-${i.groupId}`))})]})})};var zF=String.prototype.replace,WF=/%20/g,hc={RFC1738:"RFC1738",RFC3986:"RFC3986"},af={default:hc.RFC3986,formatters:{RFC1738:function(e){return zF.call(e,WF,"+")},RFC3986:function(e){return String(e)}},RFC1738:hc.RFC1738,RFC3986:hc.RFC3986},HF=af,pc=Object.prototype.hasOwnProperty,Rr=Array.isArray,dn=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),UF=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(Rr(r)){for(var o=[],s=0;s<r.length;++s)typeof r[s]<"u"&&o.push(r[s]);n.obj[n.prop]=o}}},G0=function(t,n){for(var r=n&&n.plainObjects?Object.create(null):{},o=0;o<t.length;++o)typeof t[o]<"u"&&(r[o]=t[o]);return r},GF=function e(t,n,r){if(!n)return t;if(typeof n!="object"){if(Rr(t))t.push(n);else if(t&&typeof t=="object")(r&&(r.plainObjects||r.allowPrototypes)||!pc.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!="object")return[t].concat(n);var o=t;return Rr(t)&&!Rr(n)&&(o=G0(t,r)),Rr(t)&&Rr(n)?(n.forEach(function(s,i){if(pc.call(t,i)){var a=t[i];a&&typeof a=="object"&&s&&typeof s=="object"?t[i]=e(a,s,r):t.push(s)}else t[i]=s}),t):Object.keys(n).reduce(function(s,i){var a=n[i];return pc.call(s,i)?s[i]=e(s[i],a,r):s[i]=a,s},o)},YF=function(t,n){return Object.keys(n).reduce(function(r,o){return r[o]=n[o],r},t)},qF=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},mc=1024,KF=function(t,n,r,o,s){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var a="",l=0;l<i.length;l+=mc){for(var c=i.length>=mc?i.slice(l,l+mc):i,u=[],d=0;d<c.length;++d){var h=c.charCodeAt(d);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===HF.RFC1738&&(h===40||h===41)){u[u.length]=c.charAt(d);continue}if(h<128){u[u.length]=dn[h];continue}if(h<2048){u[u.length]=dn[192|h>>6]+dn[128|h&63];continue}if(h<55296||h>=57344){u[u.length]=dn[224|h>>12]+dn[128|h>>6&63]+dn[128|h&63];continue}d+=1,h=65536+((h&1023)<<10|c.charCodeAt(d)&1023),u[u.length]=dn[240|h>>18]+dn[128|h>>12&63]+dn[128|h>>6&63]+dn[128|h&63]}a+=u.join("")}return a},ZF=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=[],o=0;o<n.length;++o)for(var s=n[o],i=s.obj[s.prop],a=Object.keys(i),l=0;l<a.length;++l){var c=a[l],u=i[c];typeof u=="object"&&u!==null&&r.indexOf(u)===-1&&(n.push({obj:i,prop:c}),r.push(u))}return UF(n),t},XF=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},QF=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},JF=function(t,n){return[].concat(t,n)},eN=function(t,n){if(Rr(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(n(t[o]));return r}return n(t)},Y0={arrayToObject:G0,assign:YF,combine:JF,compact:ZF,decode:qF,encode:KF,isBuffer:QF,isRegExp:XF,maybeMap:eN,merge:GF},q0=Zw,Vi=Y0,ks=af,tN=Object.prototype.hasOwnProperty,K0={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},fn=Array.isArray,nN=Array.prototype.push,Z0=function(e,t){nN.apply(e,fn(t)?t:[t])},rN=Date.prototype.toISOString,rg=ks.default,mt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Vi.encode,encodeValuesOnly:!1,format:rg,formatter:ks.formatters[rg],indices:!1,serializeDate:function(t){return rN.call(t)},skipNulls:!1,strictNullHandling:!1},oN=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},gc={},sN=function e(t,n,r,o,s,i,a,l,c,u,d,h,f,p,m,v,y,x){for(var g=t,T=x,S=0,E=!1;(T=T.get(gc))!==void 0&&!E;){var k=T.get(t);if(S+=1,typeof k<"u"){if(k===S)throw new RangeError("Cyclic object value");E=!0}typeof T.get(gc)>"u"&&(S=0)}if(typeof u=="function"?g=u(n,g):g instanceof Date?g=f(g):r==="comma"&&fn(g)&&(g=Vi.maybeMap(g,function(O){return O instanceof Date?f(O):O})),g===null){if(i)return c&&!v?c(n,mt.encoder,y,"key",p):n;g=""}if(oN(g)||Vi.isBuffer(g)){if(c){var R=v?n:c(n,mt.encoder,y,"key",p);return[m(R)+"="+m(c(g,mt.encoder,y,"value",p))]}return[m(n)+"="+m(String(g))]}var I=[];if(typeof g>"u")return I;var C;if(r==="comma"&&fn(g))v&&c&&(g=Vi.maybeMap(g,c)),C=[{value:g.length>0?g.join(",")||null:void 0}];else if(fn(u))C=u;else{var F=Object.keys(g);C=d?F.sort(d):F}var M=l?n.replace(/\./g,"%2E"):n,N=o&&fn(g)&&g.length===1?M+"[]":M;if(s&&fn(g)&&g.length===0)return N+"[]";for(var P=0;P<C.length;++P){var A=C[P],D=typeof A=="object"&&typeof A.value<"u"?A.value:g[A];if(!(a&&D===null)){var L=h&&l?A.replace(/\./g,"%2E"):A,H=fn(g)?typeof r=="function"?r(N,L):N:N+(h?"."+L:"["+L+"]");x.set(t,S);var U=q0();U.set(gc,x),Z0(I,e(D,H,r,o,s,i,a,l,r==="comma"&&v&&fn(g)?null:c,u,d,h,f,p,m,v,y,U))}}return I},iN=function(t){if(!t)return mt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||mt.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=ks.default;if(typeof t.format<"u"){if(!tN.call(ks.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=ks.formatters[r],s=mt.filter;(typeof t.filter=="function"||fn(t.filter))&&(s=t.filter);var i;if(t.arrayFormat in K0?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=mt.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:mt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:mt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:mt.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:mt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?mt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:mt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:mt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:mt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:mt.encodeValuesOnly,filter:s,format:r,formatter:o,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:mt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:mt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:mt.strictNullHandling}},aN=function(e,t){var n=e,r=iN(t),o,s;typeof r.filter=="function"?(s=r.filter,n=s("",n)):fn(r.filter)&&(s=r.filter,o=s);var i=[];if(typeof n!="object"||n===null)return"";var a=K0[r.arrayFormat],l=a==="comma"&&r.commaRoundTrip;o||(o=Object.keys(n)),r.sort&&o.sort(r.sort);for(var c=q0(),u=0;u<o.length;++u){var d=o[u];r.skipNulls&&n[d]===null||Z0(i,sN(n[d],d,a,l,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,c))}var h=i.join(r.delimiter),f=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),h.length>0?f+h:""},_o=Y0,xu=Object.prototype.hasOwnProperty,lN=Array.isArray,lt={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},cN=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},X0=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},uN="utf8=%26%2310003%3B",dN="utf8=%E2%9C%93",fN=function(t,n){var r={__proto__:null},o=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=n.parameterLimit===1/0?void 0:n.parameterLimit,i=o.split(n.delimiter,s),a=-1,l,c=n.charset;if(n.charsetSentinel)for(l=0;l<i.length;++l)i[l].indexOf("utf8=")===0&&(i[l]===dN?c="utf-8":i[l]===uN&&(c="iso-8859-1"),a=l,l=i.length);for(l=0;l<i.length;++l)if(l!==a){var u=i[l],d=u.indexOf("]="),h=d===-1?u.indexOf("="):d+1,f,p;h===-1?(f=n.decoder(u,lt.decoder,c,"key"),p=n.strictNullHandling?null:""):(f=n.decoder(u.slice(0,h),lt.decoder,c,"key"),p=_o.maybeMap(X0(u.slice(h+1),n),function(v){return n.decoder(v,lt.decoder,c,"value")})),p&&n.interpretNumericEntities&&c==="iso-8859-1"&&(p=cN(p)),u.indexOf("[]=")>-1&&(p=lN(p)?[p]:p);var m=xu.call(r,f);m&&n.duplicates==="combine"?r[f]=_o.combine(r[f],p):(!m||n.duplicates==="last")&&(r[f]=p)}return r},hN=function(e,t,n,r){for(var o=r?t:X0(t,n),s=e.length-1;s>=0;--s){var i,a=e[s];if(a==="[]"&&n.parseArrays)i=n.allowEmptyArrays&&(o===""||n.strictNullHandling&&o===null)?[]:[].concat(o);else{i=n.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=n.decodeDotInKeys?l.replace(/%2E/g,"."):l,u=parseInt(c,10);!n.parseArrays&&c===""?i={0:o}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(i=[],i[u]=o):c!=="__proto__"&&(i[c]=o)}o=i}return o},pN=function(t,n,r,o){if(t){var s=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&i.exec(s),c=l?s.slice(0,l.index):s,u=[];if(c){if(!r.plainObjects&&xu.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var d=0;r.depth>0&&(l=a.exec(s))!==null&&d<r.depth;){if(d+=1,!r.plainObjects&&xu.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(l[1])}return l&&u.push("["+s.slice(l.index)+"]"),hN(u,n,r,o)}},mN=function(t){if(!t)return lt;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=typeof t.charset>"u"?lt.charset:t.charset,r=typeof t.duplicates>"u"?lt.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:lt.allowDots:!!t.allowDots;return{allowDots:o,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:lt.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:lt.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:lt.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:lt.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:lt.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:lt.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:lt.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:lt.decoder,delimiter:typeof t.delimiter=="string"||_o.isRegExp(t.delimiter)?t.delimiter:lt.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:lt.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:lt.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:lt.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:lt.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:lt.strictNullHandling}},gN=function(e,t){var n=mN(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof e=="string"?fN(e,n):e,o=n.plainObjects?Object.create(null):{},s=Object.keys(r),i=0;i<s.length;++i){var a=s[i],l=pN(a,r[a],n,typeof e=="string");o=_o.merge(o,l,n)}return n.allowSparse===!0?o:_o.compact(o)},yN=aN,vN=gN,bN=af,xN={formats:bN,parse:vN,stringify:yN},Ie;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Ie||(Ie={}));var og;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(og||(og={}));const re=Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},K=Ie.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"]);class en extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof en))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}en.create=e=>new en(e);const Us=(e,t)=>{let n;switch(e.code){case K.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ie.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ie.joinValues(e.keys,", ")}`;break;case K.invalid_union:n="Invalid input";break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ie.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Ie.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n="Invalid function arguments";break;case K.invalid_return_type:n="Invalid function return type";break;case K.invalid_date:n="Invalid date";break;case K.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ie.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case K.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case K.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case K.custom:n="Invalid input";break;case K.invalid_intersection_types:n="Intersection results could not be merged";break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ie.assertNever(e)}return{message:n}};let wN=Us;function wu(){return wN}const Su=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function ee(e,t){const n=wu(),r=Su({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Us?void 0:Us].filter(o=>!!o)});e.common.issues.push(r)}class Nt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return Nt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const pe=Object.freeze({status:"aborted"}),ds=e=>({status:"dirty",value:e}),Bt=e=>({status:"valid",value:e}),sg=e=>e.status==="aborted",ig=e=>e.status==="dirty",va=e=>e.status==="valid",ba=e=>typeof Promise<"u"&&e instanceof Promise;function xa(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Q0(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ae||(ae={}));var fs,hs;class In{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 ag=(e,t)=>{if(va(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new en(e.common.issues);return this._error=n,this._error}}};function ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{var l,c;const{message:u}=e;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:o}}class xe{constructor(t){this.spa=this.safeParseAsync,this._def=t,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(t){return Pr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Nt,ctx:{common:t.parent.common,data:t.data,parsedType:Pr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ba(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pr(t)},s=this._parseSync({data:t,path:o.path,parent:o});return ag(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pr(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(ba(o)?o:Promise.resolve(o));return ag(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:K.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new $n({schema:this,typeName:fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Nn.create(this,this._def)}nullable(){return $r.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this,this._def)}promise(){return Ys.create(this,this._def)}or(t){return Ta.create([this,t],this._def)}and(t){return Ea.create(this,t,this._def)}transform(t){return new $n({...ge(this._def),schema:this,typeName:fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Ia({...ge(this._def),innerType:this,defaultValue:n,typeName:fe.ZodDefault})}brand(){return new nx({typeName:fe.ZodBranded,type:this,...ge(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Oa({...ge(this._def),innerType:this,catchValue:n,typeName:fe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ol.create(this,t)}readonly(){return Aa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SN=/^c[^\s-]{8,}$/i,TN=/^[0-9a-z]+$/,EN=/^[0-9A-HJKMNP-TV-Z]{26}$/,CN=/^[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,RN=/^[a-z0-9_-]{21}$/i,PN=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kN=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let yc;const ON=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,AN=/^(([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})))$/,_N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J0="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",MN=new RegExp(`^${J0}$`);function ex(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function DN(e){return new RegExp(`^${ex(e)}$`)}function jN(e){let t=`${J0}T${ex(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function FN(e,t){return!!((t==="v4"||!t)&&ON.test(e)||(t==="v6"||!t)&&AN.test(e))}class Dn extends xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.string,received:s.parsedType}),pe}const r=new Nt;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?ee(o,{code:K.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ee(o,{code:K.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")kN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"email",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")yc||(yc=new RegExp(IN,"u")),yc.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"emoji",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")CN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"uuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")RN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"nanoid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")SN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")TN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"cuid2",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")EN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ulid",code:K.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ee(o,{validation:"url",code:K.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"regex",code:K.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?jN(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?MN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?DN(s).test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{code:K.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?PN.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"duration",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?FN(t.data,s.version)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"ip",code:K.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?_N.test(t.data)||(o=this._getOrReturnCtx(t,o),ee(o,{validation:"base64",code:K.invalid_string,message:s.message}),r.dirty()):Ie.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:K.invalid_string,...ae.errToObj(r)})}_addCheck(t){return new Dn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...ae.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ae.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ae.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ae.errToObj(n)})}nonempty(t){return this.min(1,ae.errToObj(t))}trim(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Dn.create=e=>{var t;return new Dn({checks:[],typeName:fe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ge(e)})};function NN(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class Lr extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.number,received:s.parsedType}),pe}let r;const o=new Nt;for(const s of this._def.checks)s.kind==="int"?Ie.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?NN(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_finite,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,o){return new Lr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(o)}]})}_addCheck(t){return new Lr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ie.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Lr.create=e=>new Lr({checks:[],typeName:fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ge(e)});class Mo extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==re.bigint){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.bigint,received:s.parsedType}),pe}let r;const o=new Nt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ee(r,{code:K.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Ie.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,o){return new Mo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(o)}]})}_addCheck(t){return new Mo({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Mo.create=e=>{var t;return new Mo({checks:[],typeName:fe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ge(e)})};class Tu extends xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.boolean,received:r.parsedType}),pe}return Bt(t.data)}}Tu.create=e=>new Tu({typeName:fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ge(e)});class Gs extends xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_type,expected:re.date,received:s.parsedType}),pe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ee(s,{code:K.invalid_date}),pe}const r=new Nt;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),ee(o,{code:K.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ie.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Gs({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ae.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Gs.create=e=>new Gs({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:fe.ZodDate,...ge(e)});class Eu extends xe{_parse(t){if(this._getType(t)!==re.symbol){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.symbol,received:r.parsedType}),pe}return Bt(t.data)}}Eu.create=e=>new Eu({typeName:fe.ZodSymbol,...ge(e)});class wa extends xe{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.undefined,received:r.parsedType}),pe}return Bt(t.data)}}wa.create=e=>new wa({typeName:fe.ZodUndefined,...ge(e)});class Sa extends xe{_parse(t){if(this._getType(t)!==re.null){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.null,received:r.parsedType}),pe}return Bt(t.data)}}Sa.create=e=>new Sa({typeName:fe.ZodNull,...ge(e)});class Cu extends xe{constructor(){super(...arguments),this._any=!0}_parse(t){return Bt(t.data)}}Cu.create=e=>new Cu({typeName:fe.ZodAny,...ge(e)});class fo extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Bt(t.data)}}fo.create=e=>new fo({typeName:fe.ZodUnknown,...ge(e)});class ir extends xe{_parse(t){const n=this._getOrReturnCtx(t);return ee(n,{code:K.invalid_type,expected:re.never,received:n.parsedType}),pe}}ir.create=e=>new ir({typeName:fe.ZodNever,...ge(e)});class Ru extends xe{_parse(t){if(this._getType(t)!==re.undefined){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.void,received:r.parsedType}),pe}return Bt(t.data)}}Ru.create=e=>new Ru({typeName:fe.ZodVoid,...ge(e)});class sn extends xe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==re.array)return ee(n,{code:K.invalid_type,expected:re.array,received:n.parsedType}),pe;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(ee(n,{code:i?K.too_big:K.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ee(n,{code:K.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ee(n,{code:K.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new In(n,i,n.path,a)))).then(i=>Nt.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new In(n,i,n.path,a)));return Nt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new sn({...this._def,minLength:{value:t,message:ae.toString(n)}})}max(t,n){return new sn({...this._def,maxLength:{value:t,message:ae.toString(n)}})}length(t,n){return new sn({...this._def,exactLength:{value:t,message:ae.toString(n)}})}nonempty(t){return this.min(1,t)}}sn.create=(e,t)=>new sn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:fe.ZodArray,...ge(t)});function Jr(e){if(e instanceof rt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Nn.create(Jr(r))}return new rt({...e._def,shape:()=>t})}else return e instanceof sn?new sn({...e._def,type:Jr(e.element)}):e instanceof Nn?Nn.create(Jr(e.unwrap())):e instanceof $r?$r.create(Jr(e.unwrap())):e instanceof Vn?Vn.create(e.items.map(t=>Jr(t))):e}class rt extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ie.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==re.object){const c=this._getOrReturnCtx(t);return ee(c,{code:K.invalid_type,expected:re.object,received:c.parsedType}),pe}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(const c in o.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=s[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new In(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof ir){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(ee(o,{code:K.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new In(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>Nt.mergeObjectSync(r,c)):Nt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ae.errToObj,new rt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,a;const l=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ae.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new rt({...this._def,unknownKeys:"strip"})}passthrough(){return new rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:fe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new rt({...this._def,catchall:t})}pick(t){const n={};return Ie.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new rt({...this._def,shape:()=>n})}omit(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new rt({...this._def,shape:()=>n})}deepPartial(){return Jr(this)}partial(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new rt({...this._def,shape:()=>n})}required(t){const n={};return Ie.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Nn;)s=s._def.innerType;n[r]=s}}),new rt({...this._def,shape:()=>n})}keyof(){return tx(Ie.objectKeys(this.shape))}}rt.create=(e,t)=>new rt({shape:()=>e,unknownKeys:"strip",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});rt.strictCreate=(e,t)=>new rt({shape:()=>e,unknownKeys:"strict",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});rt.lazycreate=(e,t)=>new rt({shape:e,unknownKeys:"strip",catchall:ir.create(),typeName:fe.ZodObject,...ge(t)});class Ta extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new en(a.ctx.common.issues));return ee(n,{code:K.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new en(l));return ee(n,{code:K.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}}Ta.create=(e,t)=>new Ta({options:e,typeName:fe.ZodUnion,...ge(t)});const _n=e=>e instanceof Ra?_n(e.schema):e instanceof $n?_n(e.innerType()):e instanceof Pa?[e.value]:e instanceof Vr?e.options:e instanceof ka?Ie.objectValues(e.enum):e instanceof Ia?_n(e._def.innerType):e instanceof wa?[void 0]:e instanceof Sa?[null]:e instanceof Nn?[void 0,..._n(e.unwrap())]:e instanceof $r?[null,..._n(e.unwrap())]:e instanceof nx||e instanceof Aa?_n(e.unwrap()):e instanceof Oa?_n(e._def.innerType):[];class lf extends xe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return ee(n,{code:K.invalid_type,expected:re.object,received:n.parsedType}),pe;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=_n(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new lf({typeName:fe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...ge(r)})}}function Pu(e,t){const n=Pr(e),r=Pr(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&r===re.object){const o=Ie.objectKeys(t),s=Ie.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=Pu(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===re.array&&r===re.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=Pu(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===re.date&&r===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ea extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(sg(s)||sg(i))return pe;const a=Pu(s.value,i.value);return a.valid?((ig(s)||ig(i))&&n.dirty(),{status:n.value,value:a.data}):(ee(r,{code:K.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ea.create=(e,t,n)=>new Ea({left:e,right:t,typeName:fe.ZodIntersection,...ge(n)});class Vn extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.array)return ee(r,{code:K.invalid_type,expected:re.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return ee(r,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new In(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Nt.mergeArray(n,i)):Nt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Vn({...this._def,rest:t})}}Vn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vn({items:e,typeName:fe.ZodTuple,rest:null,...ge(t)})};class Ca extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.object)return ee(r,{code:K.invalid_type,expected:re.object,received:r.parsedType}),pe;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new In(r,a,r.path,a)),value:i._parse(new In(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Nt.mergeObjectAsync(n,o):Nt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof xe?new Ca({keyType:t,valueType:n,typeName:fe.ZodRecord,...ge(r)}):new Ca({keyType:Dn.create(),valueType:t,typeName:fe.ZodRecord,...ge(n)})}}class ku extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.map)return ee(r,{code:K.invalid_type,expected:re.map,received:r.parsedType}),pe;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new In(r,a,r.path,[c,"key"])),value:s._parse(new In(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}ku.create=(e,t,n)=>new ku({valueType:t,keyType:e,typeName:fe.ZodMap,...ge(n)});class Do extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.set)return ee(r,{code:K.invalid_type,expected:re.set,received:r.parsedType}),pe;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ee(r,{code:K.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ee(r,{code:K.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return pe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new In(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new Do({...this._def,minSize:{value:t,message:ae.toString(n)}})}max(t,n){return new Do({...this._def,maxSize:{value:t,message:ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Do.create=(e,t)=>new Do({valueType:e,minSize:null,maxSize:null,typeName:fe.ZodSet,...ge(t)});class Is extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return ee(n,{code:K.invalid_type,expected:re.function,received:n.parsedType}),pe;function r(a,l){return Su({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wu(),Us].filter(c=>!!c),issueData:{code:K.invalid_arguments,argumentsError:l}})}function o(a,l){return Su({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,wu(),Us].filter(c=>!!c),issueData:{code:K.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Ys){const a=this;return Bt(async function(...l){const c=new en([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(o(d,f)),c})})}else{const a=this;return Bt(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new en([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new en([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Is({...this._def,args:Vn.create(t).rest(fo.create())})}returns(t){return new Is({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Is({args:t||Vn.create([]).rest(fo.create()),returns:n||fo.create(),typeName:fe.ZodFunction,...ge(r)})}}class Ra extends xe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ra.create=(e,t)=>new Ra({getter:e,typeName:fe.ZodLazy,...ge(t)});class Pa extends xe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ee(n,{received:n.data,code:K.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:t.data}}get value(){return this._def.value}}Pa.create=(e,t)=>new Pa({value:e,typeName:fe.ZodLiteral,...ge(t)});function tx(e,t){return new Vr({values:e,typeName:fe.ZodEnum,...ge(t)})}class Vr extends xe{constructor(){super(...arguments),fs.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{expected:Ie.joinValues(r),received:n.parsedType,code:K.invalid_type}),pe}if(xa(this,fs)||Q0(this,fs,new Set(this._def.values)),!xa(this,fs).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ee(n,{received:n.data,code:K.invalid_enum_value,options:r}),pe}return Bt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Vr.create(t,{...this._def,...n})}exclude(t,n=this._def){return Vr.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}fs=new WeakMap;Vr.create=tx;class ka extends xe{constructor(){super(...arguments),hs.set(this,void 0)}_parse(t){const n=Ie.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==re.string&&r.parsedType!==re.number){const o=Ie.objectValues(n);return ee(r,{expected:Ie.joinValues(o),received:r.parsedType,code:K.invalid_type}),pe}if(xa(this,hs)||Q0(this,hs,new Set(Ie.getValidEnumValues(this._def.values))),!xa(this,hs).has(t.data)){const o=Ie.objectValues(n);return ee(r,{received:r.data,code:K.invalid_enum_value,options:o}),pe}return Bt(t.data)}get enum(){return this._def.values}}hs=new WeakMap;ka.create=(e,t)=>new ka({values:e,typeName:fe.ZodNativeEnum,...ge(t)});class Ys extends xe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return ee(n,{code:K.invalid_type,expected:re.promise,received:n.parsedType}),pe;const r=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return Bt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ys.create=(e,t)=>new Ys({type:e,typeName:fe.ZodPromise,...ge(t)});class $n extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{ee(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?pe:l.status==="dirty"||n.value==="dirty"?ds(l.value):l});{if(n.value==="aborted")return pe;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"||n.value==="dirty"?ds(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!va(i))return i;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>va(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);Ie.assertNever(o)}}$n.create=(e,t,n)=>new $n({schema:e,typeName:fe.ZodEffects,effect:t,...ge(n)});$n.createWithPreprocess=(e,t,n)=>new $n({schema:t,effect:{type:"preprocess",transform:e},typeName:fe.ZodEffects,...ge(n)});class Nn extends xe{_parse(t){return this._getType(t)===re.undefined?Bt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Nn.create=(e,t)=>new Nn({innerType:e,typeName:fe.ZodOptional,...ge(t)});class $r extends xe{_parse(t){return this._getType(t)===re.null?Bt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$r.create=(e,t)=>new $r({innerType:e,typeName:fe.ZodNullable,...ge(t)});class Ia extends xe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ia.create=(e,t)=>new Ia({innerType:e,typeName:fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ge(t)});class Oa extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ba(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new en(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new en(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oa.create=(e,t)=>new Oa({innerType:e,typeName:fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ge(t)});class Iu extends xe{_parse(t){if(this._getType(t)!==re.nan){const r=this._getOrReturnCtx(t);return ee(r,{code:K.invalid_type,expected:re.nan,received:r.parsedType}),pe}return{status:"valid",value:t.data}}}Iu.create=e=>new Iu({typeName:fe.ZodNaN,...ge(e)});class nx extends xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ol extends xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),ds(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new ol({in:t,out:n,typeName:fe.ZodPipeline})}}class Aa extends xe{_parse(t){const n=this._def.innerType._parse(t),r=o=>(va(o)&&(o.value=Object.freeze(o.value)),o);return ba(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Aa.create=(e,t)=>new Aa({innerType:e,typeName:fe.ZodReadonly,...ge(t)});rt.lazycreate;var fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(fe||(fe={}));Dn.create;Lr.create;Iu.create;Mo.create;Tu.create;Gs.create;Eu.create;wa.create;Sa.create;Cu.create;fo.create;ir.create;Ru.create;sn.create;rt.create;rt.strictCreate;Ta.create;lf.create;Ea.create;Vn.create;Ca.create;ku.create;Do.create;Is.create;Ra.create;Pa.create;Vr.create;ka.create;Ys.create;$n.create;Nn.create;$r.create;$n.createWithPreprocess;ol.create;const LN=(e,t)=>e.localeCompare(t),VN={sort:LN,allowDots:!0,charset:"utf-8",parseArrays:!0,plainObjects:!0,charsetSentinel:!0,allowPrototypes:!1,depth:Number.MAX_SAFE_INTEGER,arrayLimit:Number.MAX_SAFE_INTEGER,parameterLimit:Number.MAX_SAFE_INTEGER},rx=e=>{const t=new FormData(e),n=new URLSearchParams(t);return xN.parse(n.toString(),VN)},ox=e=>e.replace("[",".").replace("]","").split("."),ps=(e,t)=>ox(e).reduce((n,r)=>{var s;if(r==="")return n;const o=((s=n.shape)==null?void 0:s[r])||n;return o instanceof sn?o.element:o},t),ls=e=>e.dataset.value?e.dataset.value:e.type==="checkbox"?e.checked:e.type==="number"?e.valueAsNumber:e.value||e.getAttribute("value"),$N=e=>{const[t,n]=b.useState(null),r=b.useRef({}),o=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},s=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},i=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}},a=(u,d)=>{const h=ps(u,e);return{...d,name:u,id:u,required:!h.isOptional(),type:xn.instance(h,Lr)?"number":(d==null?void 0:d.type)??"text",error:t==null?void 0:t[u],ref:f=>{f!==null&&(r.current[u]={element:f,schema:h})}}};b.useEffect(()=>{const u=Object.values(r.current).map(h=>{const f=h.element.dataset.origin?document.querySelector(`[data-target=${h.element.name}]`):h.element,p=h.schema.safeParse(ls(f)),m=y=>{const x=f.dataset.target||f.name;if(!x)return;const g=ls(y.target)||(y.relatedTarget?ls(y.relatedTarget):""),T=h.schema.safeParse(g);if(T.success)return f.setCustomValidity(""),n(S=>{const{[x]:E,...k}=S||{};return k===null||xn.empty(k)?null:k});if(f.required){const S=T.error.issues[0].message;f.setCustomValidity(S),n(E=>({...E,[x]:S}))}},v=f.getAttribute("data-trigger")||"blur";return f.addEventListener(v,m),f.tagName==="SELECT"&&f.addEventListener("change",m),{input:h,hasInitialError:f.required?!p.success:!1,unsubscribe:()=>{f.removeEventListener(v,m),f.tagName==="SELECT"&&f.addEventListener("change",m)}}});return u.some(h=>h.hasInitialError)&&n(h=>h===null?{}:h),()=>u.forEach(h=>h.unsubscribe())});const l=b.useCallback(u=>d=>{const h=d.currentTarget,f=Object.values(r.current).reduce((m,v)=>{const y=v.element,x=v.schema.safeParse(ls(y));if(y.dataset.ignore==="ignore"||x.success)return m;const g=x.error.issues[0].message;y.setAttribute("data-initialized","true");const T=y.dataset.name||y.name||"";return{...m,[T]:g}},{}),p=xn.empty(f)?null:f;n(p),u==null||u({form:h,errors:p||{}})},[]),c=b.useCallback(u=>d=>{d.preventDefault();const h=d.currentTarget;let f=rx(h);Array.from(h.elements).forEach(m=>{if(m.tagName==="SELECT"){const v=m;f=Ff(f,v.name,v.value)}if(m.tagName==="INPUT"){const v=m;f=Ff(f,v.name,ls(v))}});const p=e.safeParse(f);return p.success?u({form:h,json:f,data:p.data,event:d,reset:()=>uu(h),success:!0,errors:[]}):u({form:h,json:f,event:d,data:f,success:!1,reset:()=>uu(h),errors:p.error.issues.map(m=>({message:m.message,path:m.path.map(v=>String(v))}))})},[]);return{input:a,datepicker:o,checkbox:i,select:s,onSubmit:c,errors:t,onInvalid:l,disabled:t!==null}},BN=e=>{const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current};exports.Alert=SP;exports.Autocomplete=N_;exports.Button=mo;exports.Calendar=cb;exports.Card=ub;exports.Checkbox=Qb;exports.ColType=uo;exports.Collapse=Iv;exports.ComponentsProvider=lO;exports.DatePicker=V_;exports.Dropdown=Xo;exports.Expand=p_;exports.FileUpload=XM;exports.Form=JM;exports.Input=ii;exports.InputFeedback=Zb;exports.InputField=Xa;exports.Menu=T_;exports.MenuItem=S_;exports.Modal=__;exports.Option=Xb;exports.Polymorph=Lo;exports.Radiobox=eD;exports.Select=Nr;exports.Stats=hO;exports.Switch=tD;exports.Tab=yO;exports.Table=BF;exports.Tabs=mO;exports.Tag=nS;exports.TaskList=nD;exports.Toolbar=M_;exports.Tooltip=Kb;exports.TransferList=Bj;exports.convertPath=ox;exports.createColumns=dF;exports.createDesignTokens=nb;exports.createOptionCols=rf;exports.createStyles=oO;exports.createTheme=sO;exports.css=Ve;exports.defaultDarkTheme=iO;exports.defaultLightTheme=aO;exports.dispatchInput=Rc;exports.formReset=uu;exports.formToJson=rx;exports.getSchemaShape=ps;exports.initializeInputDataset=_a;exports.isReactComponent=X1;exports.isReactFC=Q1;exports.isSsr=ea;exports.mergeRefs=Nu;exports.parsers=xd;exports.path=ib;exports.reduceTokens=Ts;exports.safeRegex=qc;exports.splitInto=ab;exports.useForm=$N;exports.usePrevious=BN;exports.useReactive=db;exports.useTablePreferences=hF;exports.useTranslations=Wt;exports.uuid=Ha;
201
201
  //# sourceMappingURL=index.js.map