@unizap/uniui 1.0.24 → 1.0.25
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/components/Typography/Typography.types.d.ts +2 -1
- package/dist/uniui.css +1 -1
- package/dist/uniui.js +224 -231
- package/dist/uniui.umd.cjs +17 -17
- package/package.json +94 -94
package/dist/uniui.umd.cjs
CHANGED
|
@@ -80,7 +80,7 @@ Valid keys: `+JSON.stringify(Object.keys(h),null," "));var k=j(P,W,D,H,z+"."+W,
|
|
|
80
80
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ko(e){if(Array.isArray(e))return $t(e)}function Tn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,r)}return t}function zn(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Tn(Object(t),!0).forEach(function(r){On(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tn(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function On(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Ie(e,n){return Eo(e)||Ro(e,n)||In(e,n)||$o()}function $o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
81
81
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function In(e,n){if(e){if(typeof e=="string")return $t(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return $t(e,n)}}function $t(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Ro(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var r=[],o=!0,a=!1,i,l;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(r.push(i.value),!(n&&r.length===n));o=!0);}catch(c){a=!0,l=c}finally{try{!o&&t.return!=null&&t.return()}finally{if(a)throw l}}return r}}function Eo(e){if(Array.isArray(e))return e}var _o=typeof kt=="function"?kt:kt.default,Po="file-invalid-type",Mo="file-too-large",Lo="file-too-small",Fo="too-many-files",Ao=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=n.split(","),r=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:Po,message:"File type must be ".concat(r)}},Vn=function(n){return{code:Mo,message:"File is larger than ".concat(n," ").concat(n===1?"byte":"bytes")}},Hn=function(n){return{code:Lo,message:"File is smaller than ".concat(n," ").concat(n===1?"byte":"bytes")}},No={code:Fo,message:"Too many files"};function Bn(e,n){var t=e.type==="application/x-moz-file"||_o(e,n);return[t,t?null:Ao(n)]}function qn(e,n,t){if(Le(e.size))if(Le(n)&&Le(t)){if(e.size>t)return[!1,Vn(t)];if(e.size<n)return[!1,Hn(n)]}else{if(Le(n)&&e.size<n)return[!1,Hn(n)];if(Le(t)&&e.size>t)return[!1,Vn(t)]}return[!0,null]}function Le(e){return e!=null}function Do(e){var n=e.files,t=e.accept,r=e.minSize,o=e.maxSize,a=e.multiple,i=e.maxFiles,l=e.validator;return!a&&n.length>1||a&&i>=1&&n.length>i?!1:n.every(function(c){var u=Bn(c,t),d=Ie(u,1),g=d[0],p=qn(c,r,o),f=Ie(p,1),v=f[0],m=l?l(c):null;return g&&v&&!m})}function Qe(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function et(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Gn(e){e.preventDefault()}function To(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function zo(e){return e.indexOf("Edge/")!==-1}function Oo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return To(e)||zo(e)}function Ce(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return n.some(function(l){return!Qe(r)&&l&&l.apply(void 0,[r].concat(a)),Qe(r)})}}function Io(){return"showOpenFilePicker"in window}function Vo(e){if(Le(e)){var n=Object.entries(e).filter(function(t){var r=Ie(t,2),o=r[0],a=r[1],i=!0;return Wn(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(a)||!a.every(Un))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(t,r){var o=Ie(r,2),a=o[0],i=o[1];return zn(zn({},t),{},On({},a,i))},{});return[{description:"Files",accept:n}]}return e}function Ho(e){if(Le(e))return Object.entries(e).reduce(function(n,t){var r=Ie(t,2),o=r[0],a=r[1];return[].concat(Dn(n),[o],Dn(a))},[]).filter(function(n){return Wn(n)||Un(n)}).join(",")}function Bo(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function qo(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Wn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Un(e){return/^.*\.[\w]+$/.test(e)}var Go=["children"],Wo=["open"],Uo=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Yo=["refKey","onChange","onClick"];function Zo(e){return Jo(e)||Xo(e)||Yn(e)||Ko()}function Ko(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
82
82
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jo(e){if(Array.isArray(e))return Et(e)}function Rt(e,n){return ta(e)||ea(e,n)||Yn(e,n)||Qo()}function Qo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
83
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yn(e,n){if(e){if(typeof e=="string")return Et(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Et(e,n)}}function Et(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function ea(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var r=[],o=!0,a=!1,i,l;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(r.push(i.value),!(n&&r.length===n));o=!0);}catch(c){a=!0,l=c}finally{try{!o&&t.return!=null&&t.return()}finally{if(a)throw l}}return r}}function ta(e){if(Array.isArray(e))return e}function Zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,r)}return t}function le(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Zn(Object(t),!0).forEach(function(r){_t(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zn(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function tt(e,n){if(e==null)return{};var t=na(e,n),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function na(e,n){if(e==null)return{};var t={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(n.indexOf(o)>=0)&&(t[o]=e[o]);return t}var Pt=w.forwardRef(function(e,n){var t=e.children,r=tt(e,Go),o=Xn(r),a=o.open,i=tt(o,Wo);return w.useImperativeHandle(n,function(){return{open:a}},[a]),w.createElement(w.Fragment,null,t(le(le({},i),{},{open:a})))});Pt.displayName="Dropzone";var Kn={disabled:!1,getFilesFromEvent:po,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Pt.defaultProps=Kn,Pt.propTypes={children:ie.func,accept:ie.objectOf(ie.arrayOf(ie.string)),multiple:ie.bool,preventDropOnDocument:ie.bool,noClick:ie.bool,noKeyboard:ie.bool,noDrag:ie.bool,noDragEventsBubbling:ie.bool,minSize:ie.number,maxSize:ie.number,maxFiles:ie.number,disabled:ie.bool,getFilesFromEvent:ie.func,onFileDialogCancel:ie.func,onFileDialogOpen:ie.func,useFsAccessApi:ie.bool,autoFocus:ie.bool,onDragEnter:ie.func,onDragLeave:ie.func,onDragOver:ie.func,onDrop:ie.func,onDropAccepted:ie.func,onDropRejected:ie.func,onError:ie.func,validator:ie.func};var Mt={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Xn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=le(le({},Kn),e),t=n.accept,r=n.disabled,o=n.getFilesFromEvent,a=n.maxSize,i=n.minSize,l=n.multiple,c=n.maxFiles,u=n.onDragEnter,d=n.onDragLeave,g=n.onDragOver,p=n.onDrop,f=n.onDropAccepted,v=n.onDropRejected,m=n.onFileDialogCancel,b=n.onFileDialogOpen,x=n.useFsAccessApi,R=n.autoFocus,y=n.preventDropOnDocument,E=n.noClick,C=n.noKeyboard,V=n.noDrag,T=n.noDragEventsBubbling,B=n.onError,A=n.validator,X=w.useMemo(function(){return Ho(t)},[t]),ae=w.useMemo(function(){return Vo(t)},[t]),se=w.useMemo(function(){return typeof b=="function"?b:Jn},[b]),ee=w.useMemo(function(){return typeof m=="function"?m:Jn},[m]),q=w.useRef(null),K=w.useRef(null),O=w.useReducer(ra,Mt),ne=Rt(O,2),ue=ne[0],J=ne[1],h=ue.isFocused,S=ue.isFileDialogActive,F=w.useRef(typeof window<"u"&&window.isSecureContext&&x&&Io()),L=function(){!F.current&&S&&setTimeout(function(){if(K.current){var U=K.current.files;U.length||(J({type:"closeDialog"}),ee())}},300)};w.useEffect(function(){return window.addEventListener("focus",L,!1),function(){window.removeEventListener("focus",L,!1)}},[K,S,ee,F]);var D=w.useRef([]),H=function(U){q.current&&q.current.contains(U.target)||(U.preventDefault(),D.current=[])};w.useEffect(function(){return y&&(document.addEventListener("dragover",Gn,!1),document.addEventListener("drop",H,!1)),function(){y&&(document.removeEventListener("dragover",Gn),document.removeEventListener("drop",H))}},[q,y]),w.useEffect(function(){return!r&&R&&q.current&&q.current.focus(),function(){}},[q,R,r]);var z=w.useCallback(function(N){B?B(N):console.error(N)},[B]),P=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N),D.current=[].concat(Zo(D.current),[N.target]),et(N)&&Promise.resolve(o(N)).then(function(U){if(!(Qe(N)&&!T)){var pe=U.length,me=pe>0&&Do({files:U,accept:X,minSize:i,maxSize:a,multiple:l,maxFiles:c,validator:A}),be=pe>0&&!me;J({isDragAccept:me,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),u&&u(N)}}).catch(function(U){return z(U)})},[o,u,z,T,X,i,a,l,c,A]),M=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N);var U=et(N);if(U&&N.dataTransfer)try{N.dataTransfer.dropEffect="copy"}catch{}return U&&g&&g(N),!1},[g,T]),G=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N);var U=D.current.filter(function(me){return q.current&&q.current.contains(me)}),pe=U.indexOf(N.target);pe!==-1&&U.splice(pe,1),D.current=U,!(U.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),et(N)&&d&&d(N))},[q,d,T]),W=w.useCallback(function(N,U){var pe=[],me=[];N.forEach(function(be){var Ge=Bn(be,X),De=Rt(Ge,2),ln=De[0],sn=De[1],cn=qn(be,i,a),vt=Rt(cn,2),un=vt[0],dn=vt[1],pn=A?A(be):null;if(ln&&un&&!pn)pe.push(be);else{var fn=[sn,dn];pn&&(fn=fn.concat(pn)),me.push({file:be,errors:fn.filter(function(Ul){return Ul})})}}),(!l&&pe.length>1||l&&c>=1&&pe.length>c)&&(pe.forEach(function(be){me.push({file:be,errors:[No]})}),pe.splice(0)),J({acceptedFiles:pe,fileRejections:me,isDragReject:me.length>0,type:"setFiles"}),p&&p(pe,me,U),me.length>0&&v&&v(me,U),pe.length>0&&f&&f(pe,U)},[J,l,X,i,a,c,p,f,v,A]),j=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N),D.current=[],et(N)&&Promise.resolve(o(N)).then(function(U){Qe(N)&&!T||W(U,N)}).catch(function(U){return z(U)}),J({type:"reset"})},[o,W,z,T]),k=w.useCallback(function(){if(F.current){J({type:"openDialog"}),se();var N={multiple:l,types:ae};window.showOpenFilePicker(N).then(function(U){return o(U)}).then(function(U){W(U,null),J({type:"closeDialog"})}).catch(function(U){Bo(U)?(ee(U),J({type:"closeDialog"})):qo(U)?(F.current=!1,K.current?(K.current.value=null,K.current.click()):z(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."))):z(U)});return}K.current&&(J({type:"openDialog"}),se(),K.current.value=null,K.current.click())},[J,se,ee,x,W,z,ae,l]),_=w.useCallback(function(N){!q.current||!q.current.isEqualNode(N.target)||(N.key===" "||N.key==="Enter"||N.keyCode===32||N.keyCode===13)&&(N.preventDefault(),k())},[q,k]),Q=w.useCallback(function(){J({type:"focus"})},[]),te=w.useCallback(function(){J({type:"blur"})},[]),ce=w.useCallback(function(){E||(Oo()?setTimeout(k,0):k())},[E,k]),de=function(U){return r?null:U},he=function(U){return C?null:de(U)},mt=function(U){return V?null:de(U)},gt=function(U){T&&U.stopPropagation()},ql=w.useMemo(function(){return function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=N.refKey,pe=U===void 0?"ref":U,me=N.role,be=N.onKeyDown,Ge=N.onFocus,De=N.onBlur,ln=N.onClick,sn=N.onDragEnter,cn=N.onDragOver,vt=N.onDragLeave,un=N.onDrop,dn=tt(N,Uo);return le(le(_t({onKeyDown:he(Ce(be,_)),onFocus:he(Ce(Ge,Q)),onBlur:he(Ce(De,te)),onClick:de(Ce(ln,ce)),onDragEnter:mt(Ce(sn,P)),onDragOver:mt(Ce(cn,M)),onDragLeave:mt(Ce(vt,G)),onDrop:mt(Ce(un,j)),role:typeof me=="string"&&me!==""?me:"presentation"},pe,q),!r&&!C?{tabIndex:0}:{}),dn)}},[q,_,Q,te,ce,P,M,G,j,C,V,r]),Gl=w.useCallback(function(N){N.stopPropagation()},[]),Wl=w.useMemo(function(){return function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=N.refKey,pe=U===void 0?"ref":U,me=N.onChange,be=N.onClick,Ge=tt(N,Yo),De=_t({accept:X,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:de(Ce(me,j)),onClick:de(Ce(be,Gl)),tabIndex:-1},pe,K);return le(le({},De),Ge)}},[K,t,l,j,r]);return le(le({},ue),{},{isFocused:h&&!r,getRootProps:ql,getInputProps:Wl,rootRef:q,inputRef:K,open:de(k)})}function ra(e,n){switch(n.type){case"focus":return le(le({},e),{},{isFocused:!0});case"blur":return le(le({},e),{},{isFocused:!1});case"openDialog":return le(le({},Mt),{},{isFileDialogActive:!0});case"closeDialog":return le(le({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return le(le({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return le(le({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return le({},Mt);default:return e}}function Jn(){}const oa=({onFilesAccepted:e,onError:n,accept:t={"image/*":[],"application/pdf":[],"application/msword":[],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[]},multiple:r=!1,maxSizeInBytes:o=1*1024*1024,maxFiles:a=void 0,disabled:i=!1,label:l="Upload PDF",subLabel:c="Maximum size: 2 MB",icon:u=s.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"})}),wrapperClass:d="",iconClass:g="",labelClass:p="",subLabelClass:f="",showList:v=!0,listView:m=!0,showListImage:b=!1,uploadedFiles:x=[],onDeleteCallback:R=()=>{}})=>{const[y,E]=w.useState(x),[C,V]=w.useState([]);w.useEffect(()=>{E(x)},[x]);const T=w.useCallback((ee,q)=>{const K=[];if(q.length>0&&q.forEach(O=>{O.errors.forEach(ne=>{ne.code==="file-too-large"&&K.push(`${O.file.name} is too large (max ${(o/1024/1024).toFixed(2)}MB)`),ne.code==="file-invalid-type"&&K.push(`${O.file.name} has an invalid file type`)})}),a!==void 0&&(r?y.length:0)+ee.length>a&&K.push(`You can only upload up to ${a} file${a>1?"s":""}.`),K.length>0){V(K),n==null||n(K);return}else V([]);ee.length>0&&(E(O=>r?[...O,...ee]:ee),e(ee))},[e,n,o,a,y,r]),B=ee=>{E(q=>q.filter((K,O)=>O!==ee)),R(y)},{getRootProps:A,getInputProps:X,isDragActive:ae,isDragReject:se}=Xn({onDrop:T,accept:t,multiple:r,maxSize:o,disabled:i});return s.jsxs("div",{className:`
|
|
83
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yn(e,n){if(e){if(typeof e=="string")return Et(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Et(e,n)}}function Et(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function ea(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var r=[],o=!0,a=!1,i,l;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(r.push(i.value),!(n&&r.length===n));o=!0);}catch(c){a=!0,l=c}finally{try{!o&&t.return!=null&&t.return()}finally{if(a)throw l}}return r}}function ta(e){if(Array.isArray(e))return e}function Zn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,r)}return t}function le(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Zn(Object(t),!0).forEach(function(r){_t(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zn(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function tt(e,n){if(e==null)return{};var t=na(e,n),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function na(e,n){if(e==null)return{};var t={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(n.indexOf(o)>=0)&&(t[o]=e[o]);return t}var Pt=w.forwardRef(function(e,n){var t=e.children,r=tt(e,Go),o=Xn(r),a=o.open,i=tt(o,Wo);return w.useImperativeHandle(n,function(){return{open:a}},[a]),w.createElement(w.Fragment,null,t(le(le({},i),{},{open:a})))});Pt.displayName="Dropzone";var Kn={disabled:!1,getFilesFromEvent:po,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Pt.defaultProps=Kn,Pt.propTypes={children:ie.func,accept:ie.objectOf(ie.arrayOf(ie.string)),multiple:ie.bool,preventDropOnDocument:ie.bool,noClick:ie.bool,noKeyboard:ie.bool,noDrag:ie.bool,noDragEventsBubbling:ie.bool,minSize:ie.number,maxSize:ie.number,maxFiles:ie.number,disabled:ie.bool,getFilesFromEvent:ie.func,onFileDialogCancel:ie.func,onFileDialogOpen:ie.func,useFsAccessApi:ie.bool,autoFocus:ie.bool,onDragEnter:ie.func,onDragLeave:ie.func,onDragOver:ie.func,onDrop:ie.func,onDropAccepted:ie.func,onDropRejected:ie.func,onError:ie.func,validator:ie.func};var Mt={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Xn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=le(le({},Kn),e),t=n.accept,r=n.disabled,o=n.getFilesFromEvent,a=n.maxSize,i=n.minSize,l=n.multiple,c=n.maxFiles,u=n.onDragEnter,d=n.onDragLeave,g=n.onDragOver,p=n.onDrop,f=n.onDropAccepted,v=n.onDropRejected,m=n.onFileDialogCancel,b=n.onFileDialogOpen,x=n.useFsAccessApi,R=n.autoFocus,y=n.preventDropOnDocument,E=n.noClick,C=n.noKeyboard,V=n.noDrag,T=n.noDragEventsBubbling,B=n.onError,A=n.validator,X=w.useMemo(function(){return Ho(t)},[t]),ae=w.useMemo(function(){return Vo(t)},[t]),se=w.useMemo(function(){return typeof b=="function"?b:Jn},[b]),ee=w.useMemo(function(){return typeof m=="function"?m:Jn},[m]),q=w.useRef(null),K=w.useRef(null),O=w.useReducer(ra,Mt),ne=Rt(O,2),ue=ne[0],J=ne[1],h=ue.isFocused,S=ue.isFileDialogActive,F=w.useRef(typeof window<"u"&&window.isSecureContext&&x&&Io()),L=function(){!F.current&&S&&setTimeout(function(){if(K.current){var U=K.current.files;U.length||(J({type:"closeDialog"}),ee())}},300)};w.useEffect(function(){return window.addEventListener("focus",L,!1),function(){window.removeEventListener("focus",L,!1)}},[K,S,ee,F]);var D=w.useRef([]),H=function(U){q.current&&q.current.contains(U.target)||(U.preventDefault(),D.current=[])};w.useEffect(function(){return y&&(document.addEventListener("dragover",Gn,!1),document.addEventListener("drop",H,!1)),function(){y&&(document.removeEventListener("dragover",Gn),document.removeEventListener("drop",H))}},[q,y]),w.useEffect(function(){return!r&&R&&q.current&&q.current.focus(),function(){}},[q,R,r]);var z=w.useCallback(function(N){B?B(N):console.error(N)},[B]),P=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N),D.current=[].concat(Zo(D.current),[N.target]),et(N)&&Promise.resolve(o(N)).then(function(U){if(!(Qe(N)&&!T)){var pe=U.length,me=pe>0&&Do({files:U,accept:X,minSize:i,maxSize:a,multiple:l,maxFiles:c,validator:A}),be=pe>0&&!me;J({isDragAccept:me,isDragReject:be,isDragActive:!0,type:"setDraggedFiles"}),u&&u(N)}}).catch(function(U){return z(U)})},[o,u,z,T,X,i,a,l,c,A]),M=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N);var U=et(N);if(U&&N.dataTransfer)try{N.dataTransfer.dropEffect="copy"}catch{}return U&&g&&g(N),!1},[g,T]),G=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N);var U=D.current.filter(function(me){return q.current&&q.current.contains(me)}),pe=U.indexOf(N.target);pe!==-1&&U.splice(pe,1),D.current=U,!(U.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),et(N)&&d&&d(N))},[q,d,T]),W=w.useCallback(function(N,U){var pe=[],me=[];N.forEach(function(be){var Ge=Bn(be,X),De=Rt(Ge,2),ln=De[0],sn=De[1],cn=qn(be,i,a),vt=Rt(cn,2),un=vt[0],dn=vt[1],pn=A?A(be):null;if(ln&&un&&!pn)pe.push(be);else{var fn=[sn,dn];pn&&(fn=fn.concat(pn)),me.push({file:be,errors:fn.filter(function(Wl){return Wl})})}}),(!l&&pe.length>1||l&&c>=1&&pe.length>c)&&(pe.forEach(function(be){me.push({file:be,errors:[No]})}),pe.splice(0)),J({acceptedFiles:pe,fileRejections:me,isDragReject:me.length>0,type:"setFiles"}),p&&p(pe,me,U),me.length>0&&v&&v(me,U),pe.length>0&&f&&f(pe,U)},[J,l,X,i,a,c,p,f,v,A]),j=w.useCallback(function(N){N.preventDefault(),N.persist(),gt(N),D.current=[],et(N)&&Promise.resolve(o(N)).then(function(U){Qe(N)&&!T||W(U,N)}).catch(function(U){return z(U)}),J({type:"reset"})},[o,W,z,T]),k=w.useCallback(function(){if(F.current){J({type:"openDialog"}),se();var N={multiple:l,types:ae};window.showOpenFilePicker(N).then(function(U){return o(U)}).then(function(U){W(U,null),J({type:"closeDialog"})}).catch(function(U){Bo(U)?(ee(U),J({type:"closeDialog"})):qo(U)?(F.current=!1,K.current?(K.current.value=null,K.current.click()):z(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."))):z(U)});return}K.current&&(J({type:"openDialog"}),se(),K.current.value=null,K.current.click())},[J,se,ee,x,W,z,ae,l]),_=w.useCallback(function(N){!q.current||!q.current.isEqualNode(N.target)||(N.key===" "||N.key==="Enter"||N.keyCode===32||N.keyCode===13)&&(N.preventDefault(),k())},[q,k]),Q=w.useCallback(function(){J({type:"focus"})},[]),te=w.useCallback(function(){J({type:"blur"})},[]),ce=w.useCallback(function(){E||(Oo()?setTimeout(k,0):k())},[E,k]),de=function(U){return r?null:U},he=function(U){return C?null:de(U)},mt=function(U){return V?null:de(U)},gt=function(U){T&&U.stopPropagation()},Bl=w.useMemo(function(){return function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=N.refKey,pe=U===void 0?"ref":U,me=N.role,be=N.onKeyDown,Ge=N.onFocus,De=N.onBlur,ln=N.onClick,sn=N.onDragEnter,cn=N.onDragOver,vt=N.onDragLeave,un=N.onDrop,dn=tt(N,Uo);return le(le(_t({onKeyDown:he(Ce(be,_)),onFocus:he(Ce(Ge,Q)),onBlur:he(Ce(De,te)),onClick:de(Ce(ln,ce)),onDragEnter:mt(Ce(sn,P)),onDragOver:mt(Ce(cn,M)),onDragLeave:mt(Ce(vt,G)),onDrop:mt(Ce(un,j)),role:typeof me=="string"&&me!==""?me:"presentation"},pe,q),!r&&!C?{tabIndex:0}:{}),dn)}},[q,_,Q,te,ce,P,M,G,j,C,V,r]),ql=w.useCallback(function(N){N.stopPropagation()},[]),Gl=w.useMemo(function(){return function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=N.refKey,pe=U===void 0?"ref":U,me=N.onChange,be=N.onClick,Ge=tt(N,Yo),De=_t({accept:X,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:de(Ce(me,j)),onClick:de(Ce(be,ql)),tabIndex:-1},pe,K);return le(le({},De),Ge)}},[K,t,l,j,r]);return le(le({},ue),{},{isFocused:h&&!r,getRootProps:Bl,getInputProps:Gl,rootRef:q,inputRef:K,open:de(k)})}function ra(e,n){switch(n.type){case"focus":return le(le({},e),{},{isFocused:!0});case"blur":return le(le({},e),{},{isFocused:!1});case"openDialog":return le(le({},Mt),{},{isFileDialogActive:!0});case"closeDialog":return le(le({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return le(le({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return le(le({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return le({},Mt);default:return e}}function Jn(){}const oa=({onFilesAccepted:e,onError:n,accept:t={"image/*":[],"application/pdf":[],"application/msword":[],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[]},multiple:r=!1,maxSizeInBytes:o=1*1024*1024,maxFiles:a=void 0,disabled:i=!1,label:l="Upload PDF",subLabel:c="Maximum size: 2 MB",icon:u=s.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"})}),wrapperClass:d="",iconClass:g="",labelClass:p="",subLabelClass:f="",showList:v=!0,listView:m=!0,showListImage:b=!1,uploadedFiles:x=[],onDeleteCallback:R=()=>{}})=>{const[y,E]=w.useState(x),[C,V]=w.useState([]);w.useEffect(()=>{E(x)},[x]);const T=w.useCallback((ee,q)=>{const K=[];if(q.length>0&&q.forEach(O=>{O.errors.forEach(ne=>{ne.code==="file-too-large"&&K.push(`${O.file.name} is too large (max ${(o/1024/1024).toFixed(2)}MB)`),ne.code==="file-invalid-type"&&K.push(`${O.file.name} has an invalid file type`)})}),a!==void 0&&(r?y.length:0)+ee.length>a&&K.push(`You can only upload up to ${a} file${a>1?"s":""}.`),K.length>0){V(K),n==null||n(K);return}else V([]);ee.length>0&&(E(O=>r?[...O,...ee]:ee),e(ee))},[e,n,o,a,y,r]),B=ee=>{E(q=>q.filter((K,O)=>O!==ee)),R(y)},{getRootProps:A,getInputProps:X,isDragActive:ae,isDragReject:se}=Xn({onDrop:T,accept:t,multiple:r,maxSize:o,disabled:i});return s.jsxs("div",{className:`
|
|
84
84
|
border border-style-dashed rounded-lg p-0 overflow-hidden transition
|
|
85
85
|
${ae?"border-color-blue-500 bg-color-blue-50":"border-color-gray-200 bg-color-gray-50"}
|
|
86
86
|
${se?"border-color-red-500 bg-color-red-50":""}
|
|
@@ -123,13 +123,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
123
123
|
* LICENSE.md file in the root directory of this source tree.
|
|
124
124
|
*
|
|
125
125
|
* @license MIT
|
|
126
|
-
*/function qa(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=$.useState(()=>({current:Ha(n)})),[r,o]=$.useState(()=>t.current.initialState);return t.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),t.current}const Ga={h1:"text-5xl font-bold",h2:"text-4xl font-bold",h3:"text-3xl font-bold",h4:"text-2xl font-semibold",h5:"text-xl font-semibold",h6:"text-lg font-semibold",subtitle1:"text-base font-medium",subtitle2:"text-sm font-normal",body1:"text-base",body2:"text-sm",caption:"text-xs",overline:"text-xs uppercase tracking-wide"},
|
|
126
|
+
*/function qa(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=$.useState(()=>({current:Ha(n)})),[r,o]=$.useState(()=>t.current.initialState);return t.current.setOptions(a=>({...a,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),t.current}const Ga={h1:"text-5xl font-bold",h2:"text-4xl font-bold",h3:"text-3xl font-bold",h4:"text-2xl font-semibold",h5:"text-xl font-semibold",h6:"text-lg font-semibold",subtitle1:"text-base font-medium",subtitle2:"text-sm font-normal",body1:"text-base",body2:"text-sm",caption:"text-xs",overline:"text-xs uppercase tracking-wide"},mr=({variant:e="body1",component:n,className:t="",children:r,color:o="dark"})=>{var l;const i=n||{h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"p",subtitle2:"p",body1:"p",body2:"p",caption:"span",overline:"span"}[e]||"p";return s.jsx(i,{className:`${Ga[e]} ${(l=fe[o])==null?void 0:l.transparent} ${t}`,children:r})},gr=({total:e,currentPage:n,pageSize:t=10,onPageChange:r,hideEdgeButtons:o=!1,className:a=""})=>{const i=Math.ceil(e/t),l=n===1,c=n===i;return i<=1?null:s.jsxs("div",{className:`flex items-center space-x-1 ${a}`,children:[!o&&s.jsx(we,{color:"dark",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4.83582 12L11.0429 18.2071L12.4571 16.7929L7.66424 12L12.4571 7.20712L11.0429 5.79291L4.83582 12ZM10.4857 12L16.6928 18.2071L18.107 16.7929L13.3141 12L18.107 7.20712L16.6928 5.79291L10.4857 12Z"})}),onClick:()=>r(1),disabled:l,roundedFull:!0,size:"small",variant:"transparent"}),s.jsx(we,{color:"dark",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})}),onClick:()=>r(n-1),disabled:l,roundedFull:!0,size:"small",variant:"transparent"}),s.jsxs("span",{className:"text-sm text-color-gray-800",children:["Page ",n," of ",i]}),s.jsx(we,{color:"dark",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})}),onClick:()=>r(n+1),disabled:c,roundedFull:!0,size:"small",variant:"transparent"}),!o&&s.jsx(we,{color:"dark",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M19.1642 12L12.9571 5.79291L11.5429 7.20712L16.3358 12L11.5429 16.7929L12.9571 18.2071L19.1642 12ZM13.5143 12L7.30722 5.79291L5.89301 7.20712L10.6859 12L5.89301 16.7929L7.30722 18.2071L13.5143 12Z"})}),onClick:()=>r(i),disabled:c,roundedFull:!0,size:"small",variant:"transparent"})]})},Wa=({data:e,columns:n=[],pageSize:t,pageIndex:r,onPageSizeChange:o,onPageChange:a,rowOptionArray:i=[5,10,15],totalRecords:l=e.length,className:c="",paginationClassName:u="",tdClassName:d="",thClassName:g=""})=>{const p=qa({data:e,columns:n,getCoreRowModel:Ba(),manualPagination:!0,pageCount:Math.ceil(l/t),state:{pagination:{pageIndex:r,pageSize:t}}});return s.jsx(s.Fragment,{children:s.jsxs("div",{className:`relative overflow-y-auto flex flex-col ${c} `,children:[s.jsxs("table",{className:"w-full relative border-collapse",children:[s.jsx("thead",{className:"sticky top-0 left-0 rounded-xl bg-color-[#FAFBFB] z-10 h-10",children:p.getHeaderGroups().map(f=>s.jsx("tr",{children:f.headers.map(v=>s.jsx("th",{className:`bg-color-[#FAFBFB] p-2 text-left text-xs font-semibold text-color-gray-500 border-b border-color-gray-200 ${g}`,children:v.isPlaceholder?null:v.column.columnDef.header instanceof Function?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},f.id))}),s.jsx("tbody",{className:"",children:p.getRowModel().rows.map(f=>s.jsx("tr",{className:"border-b border-color-gray-200",children:f.getVisibleCells().map(v=>s.jsx("td",{className:`px-2 py-4 font-normal text-sm text-color-gray-800 ${d}`,children:v.column.columnDef.cell instanceof Function?v.column.columnDef.cell(v.getContext()):v.getValue()},v.id))},f.id))})]}),s.jsxs("div",{className:`w-full py-4 px-2 border-t border-color-gray-200 bg-color-[#FAFBFB] flex justify-between items-center ${u} sticky bottom-0 z-10`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mr,{variant:"body2",className:"hidden md:!flex",children:"Rows per page"}),s.jsx(Qn,{options:i,selectedValue:t,placementTop:!0,onChange:f=>{o(f),a(0)}})]}),s.jsx(gr,{total:l,pageSize:t,currentPage:r+1,onPageChange:f=>a(f-1)})]})]})})},Ua=({children:e,className:n=""})=>s.jsx("ul",{className:`divide-y divide-color-gray-200 rounded-md bg-color-white shadow-sm border border-color-gray-200 ${n}`,children:e}),Ya=({children:e,secondaryAction:n,className:t=""})=>s.jsxs("li",{className:`flex items-center justify-between overflow-hidden px-4 py-3 hover:bg-color-gray-50 transition ${t}`,children:[s.jsx("div",{className:"flex-1",children:e}),n&&s.jsx("div",{className:"ml-4",children:n})]}),Za=({animation:e="pulse",variant:n="rectangular",width:t,height:r,className:o=""})=>{const a="bg-color-gray-200 dark:bg-color-gray-700",i={pulse:"animate-pulse",wave:"relative overflow-hidden"},l=()=>{switch(n){case"circular":return{classes:"rounded-full",defaultWidth:40,defaultHeight:40};case"rectangular":return{classes:"",defaultWidth:200,defaultHeight:100};case"rounded":return{classes:"rounded-lg",defaultWidth:200,defaultHeight:100};case"text":return{classes:"rounded-sm",defaultWidth:void 0,defaultHeight:16};default:return{classes:"",defaultWidth:200,defaultHeight:100}}},{classes:c,defaultWidth:u,defaultHeight:d}=l(),g=t??u,p=r??d,f={};g!==void 0&&(f.width=`${g}px`),p!==void 0&&(f.height=`${p}px`),n==="text"&&t===void 0&&(f.width="100%");const v=[a,c,i[e],o].filter(Boolean).join(" ");return s.jsx("div",{className:v,style:f,children:e==="wave"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.35)_50%,_rgba(255,_255,_255,_0)_100%)] dark:bg-gradient-[linear-gradient(90deg,_rgba(255,_255,_255,_0)_0%,_rgba(255,_255,_255,_0.1)_50%,_rgba(255,_255,_255,_0)_100%)]",style:{animation:"skeleton-wave 2s ease-in-out infinite"}}),s.jsx("style",{children:`
|
|
127
127
|
@keyframes skeleton-wave {
|
|
128
128
|
0% { transform: translateX(-100%); }
|
|
129
129
|
50% { transform: translateX(100%); }
|
|
130
130
|
100% { transform: translateX(100%); }
|
|
131
131
|
}
|
|
132
|
-
`})]})})},
|
|
132
|
+
`})]})})},Ka=({label:e,error:n,className:t="",inputClass:r="",labelClass:o="",...a})=>s.jsxs("div",{className:`flex flex-col gap-1 ${t}`,children:[e&&s.jsx("label",{className:`text-sm font-medium ${o}`,children:e}),s.jsx("textarea",{className:`border border-color-gray-300 rounded-md px-3 py-2 resize-none focus:ring-1 focus:outline-none ${r}`,...a}),n&&s.jsx("span",{className:"text-xs text-color-red-500",children:n})]}),vr={small:{track:"h-1",thumb:"w-3 h-3"},medium:{track:"h-2",thumb:"w-4 h-4"},large:{track:"h-3",thumb:"w-5 h-5"}};function Xa(e){const n=w.useRef(null),t=w.useRef(null),r=w.useRef(null),o=(c,u)=>{if(c===u)return!0;if(Array.isArray(c)&&Array.isArray(u)){if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==u[d])return!1;return!0}return!1},a=w.useCallback(c=>{e&&(o(c,r.current)||(r.current=c,e(c)))},[e]),i=w.useCallback(c=>{t.current=c,n.current==null&&(n.current=requestAnimationFrame(()=>{n.current=null,t.current!=null&&a(t.current)}))},[a]),l=w.useCallback(()=>{n.current!=null&&cancelAnimationFrame(n.current),n.current=null},[]);return{schedule:i,flush:a,cancel:l,last:t}}const Ja=w.memo(function({value:n,defaultValue:t,onChange:r,onChangeEnd:o,min:a=0,max:i=100,step:l=1,color:c="blue",size:u="medium",disabled:d=!1,className:g="",showValue:p=!0,showMarks:f=!1,marks:v=[],range:m=!1,minDistance:b=0}){const x=n!==void 0,[R,y]=w.useState(()=>t!==void 0?t:m?[a,i]:a),E=x?n:R,C=Array.isArray(E)?E[0]:E,[V,T]=Array.isArray(E)?E:[E,E],B=Ue[c]||Ue.blue,A=vr[u]??vr.medium,X=w.useCallback(_=>(_-a)/(i-a)*100,[a,i]),ae=X(C),se=X(V),ee=X(T),q=w.useCallback(_=>Math.max(a,Math.min(i,_)),[a,i]),K=w.useCallback(_=>Math.round(_/l)*l,[l]),O=Xa(r),ne=w.useCallback((_,Q=!0)=>{x||y(_),Q?O.schedule(_):O.flush(_)},[x,O]),ue=w.useCallback(()=>{const _=O.last.current;_!=null&&(O.flush(_),o==null||o(_))},[O,o]),J=w.useCallback((_,Q)=>{if(m&&Array.isArray(_)){let[te,ce]=_,de=K(q(te)),he=K(q(ce));return he-de<b&&(Q==="min"?he=q(de+b):Q==="max"&&(de=q(he-b))),de>he&&(Q==="min"?de=he:he=de),[de,he]}else if(!m&&typeof _=="number")return K(q(_));return _},[m,q,K,b]),h=w.useRef(null),S=w.useCallback(_=>{var ce;const Q=(ce=h.current)==null?void 0:ce.getBoundingClientRect();if(!Q)return m?a:C;const te=Math.max(0,Math.min(1,(_-Q.left)/Q.width));return a+te*(i-a)},[a,i,m,C]),F=w.useCallback(_=>{const Q=Math.abs(_-V),te=Math.abs(_-T);return Q<=te?"min":"max"},[V,T]),[L,D]=w.useState(null),[H,z]=w.useState(null),[P,M]=w.useState(null),G=w.useCallback((_,Q)=>{var ce,de;if(d)return;_.preventDefault(),(de=(ce=_.currentTarget).setPointerCapture)==null||de.call(ce,_.pointerId),M(_.pointerId);const te=S(_.clientX);if(m){const he=Q||F(te);D(he),ne(he==="min"?J([te,T],"min"):J([V,te],"max"))}else D("single"),ne(J(te,"single"))},[d,m,S,F,J,V,T,ne]),W=w.useCallback(_=>{if(d||P==null||L==null)return;const Q=S(_.clientX);m?L==="min"?ne(J([Q,T],"min")):L==="max"&&ne(J([V,Q],"max")):ne(J(Q,"single"))},[d,P,L,m,S,J,V,T,ne]),j=w.useCallback(()=>{L!=null&&(D(null),M(null),ue())},[L,ue]),k=w.useCallback((_,Q)=>{if(d)return;const te=m?Q==="min"?V:T:C;let ce=te;const de=(i-a)/10;switch(_.key){case"ArrowLeft":case"ArrowDown":ce=te-l;break;case"ArrowRight":case"ArrowUp":ce=te+l;break;case"PageDown":ce=te-de;break;case"PageUp":ce=te+de;break;case"Home":ce=a;break;case"End":ce=i;break;default:return}_.preventDefault(),ne(m?Q==="min"?J([ce,T],"min"):J([V,ce],"max"):J(ce,"single"),!1),o==null||o(x?n:E)},[d,m,C,V,T,l,a,i,J,ne,o,x,n,E]);return w.useEffect(()=>{if(!L)return;const _=document.body.style.userSelect;return document.body.style.userSelect="none",()=>{document.body.style.userSelect=_}},[L]),s.jsx("div",{className:`w-full ${g}`,children:s.jsxs("div",{className:"relative flex items-center",children:[m&&s.jsx("div",{className:"mr-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem]",children:s.jsx("div",{className:"range-min",children:s.jsx("div",{children:V})})}),s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{ref:h,className:`
|
|
133
133
|
relative w-full ${A.track} ${B.track} rounded-full
|
|
134
134
|
${d?"opacity-60 cursor-not-allowed":"cursor-pointer"}
|
|
135
135
|
`,onPointerDown:_=>G(_),onPointerMove:W,onPointerUp:j,onPointerCancel:j,children:[m?s.jsx("div",{className:`absolute top-0 ${A.track} ${B.progress} rounded-full ${L?"":"transition-all duration-150"}`,style:{left:`${se}%`,width:`${ee-se}%`}}):s.jsx("div",{className:`absolute top-0 left-0 ${A.track} ${B.progress} rounded-full ${L?"":"transition-all duration-150"}`,style:{width:`${ae}%`}}),f&&v.map((_,Q)=>{const te=X(_.value);return s.jsx("div",{className:"absolute top-1/2 transform -translate-y-1/2 w-1 h-1 bg-gray-400 rounded-full",style:{left:`${te}%`}},Q)}),!m&&s.jsx("div",{className:`
|
|
@@ -153,26 +153,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
153
153
|
${L==="max"?"cursor-grabbing scale-110 z-20":L?"":"transition-all duration-150"}
|
|
154
154
|
${H==="max"?"ring-2 ring-offset-1 ring-blue-300":""}
|
|
155
155
|
shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
|
|
156
|
-
`,style:{left:`${ee}%`},tabIndex:d?-1:0,role:"slider","aria-orientation":"horizontal","aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":T,"aria-disabled":d,"aria-label":"Maximum value",onKeyDown:_=>k(_,"max"),onFocus:()=>z("max"),onBlur:()=>z(null),onPointerDown:_=>G(_,"max")})]})]}),f&&v.length>0&&s.jsx("div",{className:"relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",children:v.map((_,Q)=>{const te=X(_.value);return s.jsx("div",{className:"absolute transform -translate-x-1/2 text-xs",style:{left:`${te}%`},children:_.label||_.value},Q)})})]}),p&&s.jsx("div",{className:"ml-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem] text-right",children:m?s.jsx("div",{className:"range-max",children:s.jsx("div",{children:T})}):s.jsx("span",{children:C})})]})})}),
|
|
157
|
-
${u(r)} ${d} ${l}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[s.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:n}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i&&s.jsx("div",{className:"flex items-center",children:i}),a&&s.jsx(we,{color:"light",size:"small",icon:s.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),onClick:c,roundedFull:!0,className:"hover:!bg-color-white/10 -mr-1",variant:"transparent"})]})]})]}):null},
|
|
156
|
+
`,style:{left:`${ee}%`},tabIndex:d?-1:0,role:"slider","aria-orientation":"horizontal","aria-valuemin":a,"aria-valuemax":i,"aria-valuenow":T,"aria-disabled":d,"aria-label":"Maximum value",onKeyDown:_=>k(_,"max"),onFocus:()=>z("max"),onBlur:()=>z(null),onPointerDown:_=>G(_,"max")})]})]}),f&&v.length>0&&s.jsx("div",{className:"relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",children:v.map((_,Q)=>{const te=X(_.value);return s.jsx("div",{className:"absolute transform -translate-x-1/2 text-xs",style:{left:`${te}%`},children:_.label||_.value},Q)})})]}),p&&s.jsx("div",{className:"ml-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem] text-right",children:m?s.jsx("div",{className:"range-max",children:s.jsx("div",{children:T})}):s.jsx("span",{children:C})})]})})}),Qa=({open:e=!1,message:n,autoHideDuration:t=4e3,position:r="bottom-center",color:o="dark",onClose:a,action:i,className:l=""})=>{var g;w.useEffect(()=>{if(e&&t>0&&a){const p=setTimeout(()=>{a()},t);return()=>clearTimeout(p)}},[e,t,a]),w.useEffect(()=>{const p=f=>{f.key==="Escape"&&e&&a&&a()};if(e)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,a]);const c=w.useCallback(()=>{a&&a()},[a]),u=p=>{const f="fixed z-50 transform transition-all duration-300 ease-in-out";switch(p){case"top-center":return`${f} top-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-left":return`${f} top-4 left-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-right":return`${f} top-4 right-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"bottom-left":return`${f} bottom-4 left-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-right":return`${f} bottom-4 right-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-center":default:return`${f} bottom-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`}},d=(g=fe[o])==null?void 0:g.filled;return e?s.jsxs(s.Fragment,{children:[e&&s.jsx("div",{className:"fixed inset-0 z-40 bg-color-black/10 backdrop-blur-[1px] md:hidden",onClick:c}),s.jsxs("div",{className:`min-w-72 max-w-lg mx-4 px-4 py-2 rounded-lg shadow-xl flex items-center justify-between gap-3 backdrop-blur-sm border border-color-white/20
|
|
157
|
+
${u(r)} ${d} ${l}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[s.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:n}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i&&s.jsx("div",{className:"flex items-center",children:i}),a&&s.jsx(we,{color:"light",size:"small",icon:s.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),onClick:c,roundedFull:!0,className:"hover:!bg-color-white/10 -mr-1",variant:"transparent"})]})]})]}):null},ei=({variant:e="linear",value:n=0,color:t="blue",determinate:r=!0,className:o="",...a})=>{var g,p;const i="inline-block",l=(g=fe[t])==null?void 0:g.transparent,c=(p=fe[t])==null?void 0:p.filled,u=Math.min(Math.max(n,0),100);if(e==="circular"){const{size:f=40,thickness:v=3.6}=a,m=(f-v)/2,b=2*Math.PI*m,x=`${b} ${b}`,R=b-u/100*b;return s.jsx("div",{className:`${i} ${o}`,style:{width:f,height:f},role:"progressbar","aria-valuenow":r?u:void 0,"aria-valuemin":0,"aria-valuemax":100,children:s.jsxs("svg",{className:"transform -rotate-90",width:f,height:f,viewBox:`0 0 ${f} ${f}`,children:[s.jsx("circle",{cx:f/2,cy:f/2,r:m,stroke:"currentColor",strokeWidth:v,fill:"none",className:"text-color-gray-200 dark:text-color-gray-700"}),s.jsx("circle",{cx:f/2,cy:f/2,r:m,stroke:"currentColor",strokeWidth:v,fill:"none",strokeLinecap:"round",className:`${l} transition-all duration-300 ease-out ${r?"":"animate-spin"}`,style:{strokeDasharray:x,strokeDashoffset:r?R:b*.75,transformOrigin:"center"}})]})})}const{thickness:d=4}=a;return s.jsx("div",{className:`${i} w-full ${o}`,role:"progressbar","aria-valuenow":r?u:void 0,"aria-valuemin":0,"aria-valuemax":100,children:s.jsx("div",{className:"w-full bg-color-gray-200 dark:bg-color-gray-700 rounded-full overflow-hidden relative",style:{height:`${d}px`},children:r?s.jsx("div",{className:`h-full ${c} transition-all duration-300 ease-out`,style:{width:`${u}%`}}):s.jsx("div",{className:`absolute left-0 top-0 h-full ${c} animate-progress-indeterminate`,style:{width:"40%"}})})})},hr=s.jsx("svg",{className:"w-5 h-5 fill-color-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),xr=s.jsx("svg",{className:"w-5 h-5 fill-color-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{d:"M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.561-.955L10 0l2.951 5.955 6.561.955-4.756 4.635 1.122 6.545z"})}),it={small:"w-4 h-4",medium:"w-6 h-6",large:"w-8 h-8"},ti=({value:e,onChange:n,readOnly:t=!1,disabled:r=!1,precision:o=1,max:a=5,size:i="medium",icon:l,emptyIcon:c,className:u="",showHoverValue:d=!1,showValue:g=!1,labels:p={}})=>{const[f,v]=w.useState(null),m=(y,E)=>{if(t||r||!n)return;const{left:C,width:V}=y.target.getBoundingClientRect(),T=(y.clientX-C)/V;let B=E-1+Math.ceil(T/o)*o;B=Math.min(a,Math.max(o,Math.round(B/o)*o)),n(B)},b=(y,E)=>{if(t||r)return;const{left:C,width:V}=y.target.getBoundingClientRect(),T=(y.clientX-C)/V;let B=E-1+Math.ceil(T/o)*o;B=Math.min(a,Math.max(o,Math.round(B/o)*o)),v(B)},x=()=>v(null),R=[];for(let y=1;y<=a;y++){let E=(f!==null?f:e)>=y,C=!E&&(f!==null?f:e)>y-1,V=E?l||w.cloneElement(hr,{className:`fill-color-yellow-500 ${it[i]}`}):c||w.cloneElement(xr,{className:`stroke-color-gray-300 ${it[i]}`});if(C){const T=((f!==null?f:e)-(y-1))*100;V=s.jsxs("span",{className:"relative block",children:[s.jsx("span",{className:"absolute top-0 left-0 overflow-hidden",style:{width:`${T}%`},children:l||w.cloneElement(hr,{className:`fill-color-yellow-500 ${it[i]}`})}),c||w.cloneElement(xr,{className:`stroke-color-gray-300 ${it[i]}`})]})}R.push(s.jsx("span",{className:`inline-block ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:T=>m(T,y),onMouseMove:T=>b(T,y),onMouseLeave:x,tabIndex:t||r?-1:0,"aria-label":`Rate ${y}`,role:"radio","aria-checked":e===y,children:V},y))}return s.jsxs("div",{className:`flex items-center gap-1 ${u}`,role:"radiogroup","aria-disabled":r,children:[R,d&&f!==null?s.jsx("span",{className:"ml-2 text-xs text-gray-500",children:p[f]||f}):g?s.jsx("span",{className:"ml-2 text-xs text-gray-500",children:p[e]||e}):null]})},ni=({children:e,width:n="100%",height:t="auto",showIndicators:r=!0,showArrows:o=!0,autoplay:a=!1,interval:i=3e3,infiniteLoop:l=!1,perview:c=1,gap:u=0,onClickItem:d,showThumbs:g=!1,pauseOnHover:p=!1,swipeable:f=!0,thumbWidth:v=60,orientation:m="horizontal",nextIcon:b,prevIcon:x,className:R})=>{const y=e.length,E=Math.min(Math.max(c,.1),y),[C,V]=w.useState(0),[T,B]=w.useState(!1),[A,X]=w.useState(!1),[ae,se]=w.useState(0),ee=w.useRef(null),q=w.useRef(0),K=w.useRef(0),O=E>=y?0:Math.max(0,y-E),ne=P=>Math.max(0,Math.min(P,O)),ue=P=>V(l&&O>0?(P%(O+1)+(O+1))%(O+1):ne(P)),J=()=>{l&&O>0?V(C===0?O:C-1):ue(C-1)},h=()=>{l&&O>0?V(C>=O?0:C+1):ue(C+1)};w.useEffect(()=>{if(!a||p&&T||A||O===0)return;const P=setInterval(()=>{V(M=>{const G=M+1;return G>O?l?0:M:G})},i);return()=>clearInterval(P)},[a,i,T,p,A,O,l]);const S=(P,M)=>{!f||O===0||(X(!0),q.current=m==="horizontal"?P:M,K.current=q.current)},F=(P,M)=>{A&&(K.current=m==="horizontal"?P:M,se(K.current-q.current))},L=()=>{if(!A)return;Math.abs(K.current-q.current)>50&&(K.current<q.current?h():J()),X(!1),se(0)},D=()=>{const P=m==="horizontal"?"X":"Y";let M=0;if(A&&ee.current&&O>0){const Q=m==="horizontal"?ee.current.offsetWidth:ee.current.offsetHeight;M=ae/Q*100*(E/y)}const W=Math.min(C,O)*(100/y)-M,j=C>=O,_=C<=0?0:j?u/(c/2):u/c;return`translate${P}(calc(-${W}% - ${_}px))`},H=()=>E>=y?1:Math.floor(O)+1,z=()=>O===0?0:Math.round(C/O*(H()-1));return s.jsxs("div",{className:`relative flex flex-col items-center select-none ${R}`,style:{width:n,height:t},onMouseEnter:()=>p&&B(!0),onMouseLeave:()=>p&&B(!1),children:[s.jsxs("div",{ref:ee,className:`w-full overflow-hidden relative ${f&&O>0?A?"cursor-grabbing":"cursor-grab":"cursor-default"}`,style:{height:g?`calc(${t} - ${v+20}px)`:t},onMouseDown:P=>{P.preventDefault(),S(P.clientX,P.clientY)},onMouseMove:P=>F(P.clientX,P.clientY),onMouseUp:L,onMouseLeave:L,onTouchStart:P=>S(P.touches[0].clientX,P.touches[0].clientY),onTouchMove:P=>F(P.touches[0].clientX,P.touches[0].clientY),onTouchEnd:L,children:[s.jsx("div",{className:`flex ${m==="horizontal"?"flex-row":"flex-col"} transition-transform duration-300 ease-in-out`,style:{width:m==="horizontal"?`${y*100/E}%`:"100%",height:m==="vertical"?`${y*100/E}%`:"100%",transform:D(),gap:`${u}px`,transitionProperty:A?"none":"transform"},children:e.map((P,M)=>s.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:m==="horizontal"?`calc(${100/y}% - ${u/c}px)`:"100%",height:m==="vertical"?`calc(${100/y}% - ${u*(y-1)/y}px)`:"100%"},onClick:()=>!A&&(d==null?void 0:d(M)),children:P},M))}),o&&O>0&&s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":"prev",onClick:J,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-10 h-10 flex items-center justify-center text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
|
|
158
158
|
${m==="horizontal"?"left-2 top-1/2 -translate-y-1/2":"left-1/2 top-2 -translate-x-1/2"}`,children:x||(m==="horizontal"?"‹":"↑")}),s.jsx("button",{"aria-label":"next",onClick:h,className:`absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-10 h-10 flex items-center justify-center text-lg font-bold text-color-gray-800 hover:bg-color-white transition-colo cursor-pointer
|
|
159
|
-
${m==="horizontal"?"right-2 top-1/2 -translate-y-1/2":"left-1/2 bottom-2 -translate-x-1/2"}`,children:b||(m==="horizontal"?"›":"↓")})]}),r&&H()>1&&s.jsx("div",{className:`flex gap-1 mt-3 justify-center absolute bg-color-white/90 py-1 px-[5px] rounded-full ${m==="horizontal"?"bottom-3 left-1/2 -translate-x-1/2":"top-1/2 right-3 -translate-y-1/2 rotate-90"} z-10`,children:Array.from({length:H()}).map((P,M)=>s.jsx("button",{onClick:()=>ue(Math.round(M/(H()-1)*O)),className:`size-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${M===z()?"bg-color-gray-800":"bg-color-gray-400"}`},M))})]}),g&&s.jsx("div",{className:"flex gap-2 mt-3 justify-center flex-wrap",children:e.map((P,M)=>{const G=M===Math.round(C);return s.jsx("div",{onClick:()=>{const W=Math.max(0,Math.min(O,M-Math.floor(E/2)));ue(W)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${G?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:v,height:v},children:P},M)})})]})},
|
|
160
|
-
} ${t?"bg-color-gray-200 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[s.jsx("span",{className:`absolute rounded-full inset-0 opacity-50 ${i?`${(g=fe[o])==null?void 0:g.filled}`:"bg-color-gray-400"}`}),s.jsx("div",{className:`flex justify-center items-center absolute shadow-md top-0.5 left-0.5 size-5 rounded-full shadow transition-all duration-300 ${i?`translate-x-5 ${(p=fe[o])==null?void 0:p.filled}`:"translate-x-0 bg-color-white"}`,children:c?s.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})]}):s.jsx("button",{onClick:d,type:r,disabled:t,className:`relative w-11 h-6 flex items-center rounded-full transition-color duration-300 ${i?(f=fe[o])==null?void 0:f.filled:"bg-color-gray-300"} ${t?"bg-color-gray-300 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:s.jsx("div",{className:`absolute top-[4px] left-1 w-4 h-4 bg-color-white rounded-full flex items-center justify-center transition-all duration-300 ${i?"translate-x-[19px]":"-translate-x-0"}`,children:c?s.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})})},
|
|
159
|
+
${m==="horizontal"?"right-2 top-1/2 -translate-y-1/2":"left-1/2 bottom-2 -translate-x-1/2"}`,children:b||(m==="horizontal"?"›":"↓")})]}),r&&H()>1&&s.jsx("div",{className:`flex gap-1 mt-3 justify-center absolute bg-color-white/90 py-1 px-[5px] rounded-full ${m==="horizontal"?"bottom-3 left-1/2 -translate-x-1/2":"top-1/2 right-3 -translate-y-1/2 rotate-90"} z-10`,children:Array.from({length:H()}).map((P,M)=>s.jsx("button",{onClick:()=>ue(Math.round(M/(H()-1)*O)),className:`size-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${M===z()?"bg-color-gray-800":"bg-color-gray-400"}`},M))})]}),g&&s.jsx("div",{className:"flex gap-2 mt-3 justify-center flex-wrap",children:e.map((P,M)=>{const G=M===Math.round(C);return s.jsx("div",{onClick:()=>{const W=Math.max(0,Math.min(O,M-Math.floor(E/2)));ue(W)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${G?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:v,height:v},children:P},M)})})]})},ri=({title:e,description:n,actionLabel:t,onAction:r,illustration:o,illustrationWidth:a=120,children:i,color:l="gray"})=>s.jsxs("section",{className:"flex flex-col items-center justify-center text-center p-6 max-w-md",role:"status","aria-live":"polite",children:[o&&s.jsx("div",{className:"flex items-center justify-center",style:{width:a},children:typeof o=="string"?s.jsx("img",{src:o,alt:"",className:"object-contain"}):o}),s.jsx("h2",{className:"text-lg mt-4 font-semibold text-color-gray-800",children:e}),n&&s.jsx("p",{className:"text-sm mt-2 text-color-gray-600",children:n}),t&&r&&s.jsx(Ye,{onClick:r,color:l,className:"mt-4",children:t}),i]}),oi=({initialState:e=!1,onToggle:n,disabled:t=!1,type:r="button",color:o="green",variant:a="ios"})=>{var g,p,f;const[i,l]=w.useState(e),[c,u]=w.useState(!1),d=async()=>{if(!(t||c))if(n){u(!0);try{await n(!i),l(!i)}catch(v){console.error("Toggle failed",v)}finally{u(!1)}}else l(!i)};return a==="android"?s.jsxs("button",{onClick:d,type:r,disabled:t,className:`relative w-10 h-3 flex items-center transition-color duration-300
|
|
160
|
+
} ${t?"bg-color-gray-200 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[s.jsx("span",{className:`absolute rounded-full inset-0 opacity-50 ${i?`${(g=fe[o])==null?void 0:g.filled}`:"bg-color-gray-400"}`}),s.jsx("div",{className:`flex justify-center items-center absolute shadow-md top-0.5 left-0.5 size-5 rounded-full shadow transition-all duration-300 ${i?`translate-x-5 ${(p=fe[o])==null?void 0:p.filled}`:"translate-x-0 bg-color-white"}`,children:c?s.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})]}):s.jsx("button",{onClick:d,type:r,disabled:t,className:`relative w-11 h-6 flex items-center rounded-full transition-color duration-300 ${i?(f=fe[o])==null?void 0:f.filled:"bg-color-gray-300"} ${t?"bg-color-gray-300 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:s.jsx("div",{className:`absolute top-[4px] left-1 w-4 h-4 bg-color-white rounded-full flex items-center justify-center transition-all duration-300 ${i?"translate-x-[19px]":"-translate-x-0"}`,children:c?s.jsx("svg",{className:"animate-spin text-color-gray-500 size-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z"})}):null})})},ai={small:"px-2 py-1 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"},ii=({value:e,onChange:n,options:t,multiple:r=!1,size:o="medium",color:a="blue",orientation:i="horizontal",className:l="",buttonClass:c="",disabled:u=!1})=>{const d=p=>Array.isArray(e)?e.includes(p):e===p,g=p=>{if(!u)if(r){if(!Array.isArray(e))return;e.includes(p)?n(e.filter(f=>f!==p)):n([...e,p])}else n(p)};return s.jsx("div",{className:`inline-flex ${i==="vertical"?"flex-col":"flex-row"} rounded-md overflow-hidden border border-color-gray-200 bg-color-white ${l}`,role:"group","aria-disabled":u,children:t.map((p,f)=>{var v;return s.jsxs("button",{type:"button",disabled:u||p.disabled,className:`
|
|
161
161
|
flex items-center justify-center gap-2 border-0 ${i==="vertical"?"not-last:border-b-1":"not-last:border-r-1"} border-color-gray-200
|
|
162
|
-
${
|
|
162
|
+
${ai[o]}
|
|
163
163
|
${d(p.value)?((v=fe[a])==null?void 0:v.filled)||a:"bg-color-transparent text-color-gray-700"}
|
|
164
164
|
${u||p.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
165
165
|
${c}
|
|
166
|
-
`,"aria-pressed":d(p.value),onClick:()=>!(u||p.disabled)&&g(p.value),children:[p.icon,p.label]},p.value)})})},br={small:"p-2",medium:"p-4",large:"p-6",none:"p-0"},wr={default:"shadow-xs",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"},yr={small:"rounded-md",medium:"rounded-xl",large:"rounded-2xl"},Cr=({title:e,subtitle:n,space:t="medium",shadow:r="small",roundness:o="medium",image:a,actionMenu:i,divider:l=!0,children:c,className:u="",hoverable:d=!1,bordered:g=!1,onClick:p,loaderJsx:f=!1})=>{const v=["relative","bg-white","overflow-hidden",br[t]||br.medium,wr[r]||wr.small,yr[o]||yr.medium,d?"hover:shadow-xl transition-shadow duration-300 cursor-pointer":"",g?"border border-color-gray-200":"",u].join(" ").trim();return s.jsxs("div",{className:v,onClick:p,children:[a&&s.jsx("img",{src:a,alt:"Card",className:"w-full h-auto mb-4 rounded"}),(e||n)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between items-start mb-2",children:[s.jsxs("div",{children:[e&&s.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&s.jsx("p",{className:"text-color-gray-500 text-sm",children:n})]}),i&&s.jsx("div",{className:"ml-2",children:i})]}),l&&s.jsx("hr",{className:"h-px my-5 bg-color-gray-200 border-0"})]}),s.jsx("div",{children:c}),f&&s.jsx("div",{className:"absolute w-full h-full top-0 left-0 flex items-center justify-center bg-color-white bg-opacity-50",children:f})]})},
|
|
166
|
+
`,"aria-pressed":d(p.value),onClick:()=>!(u||p.disabled)&&g(p.value),children:[p.icon,p.label]},p.value)})})},br={small:"p-2",medium:"p-4",large:"p-6",none:"p-0"},wr={default:"shadow-xs",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"},yr={small:"rounded-md",medium:"rounded-xl",large:"rounded-2xl"},Cr=({title:e,subtitle:n,space:t="medium",shadow:r="small",roundness:o="medium",image:a,actionMenu:i,divider:l=!0,children:c,className:u="",hoverable:d=!1,bordered:g=!1,onClick:p,loaderJsx:f=!1})=>{const v=["relative","bg-white","overflow-hidden",br[t]||br.medium,wr[r]||wr.small,yr[o]||yr.medium,d?"hover:shadow-xl transition-shadow duration-300 cursor-pointer":"",g?"border border-color-gray-200":"",u].join(" ").trim();return s.jsxs("div",{className:v,onClick:p,children:[a&&s.jsx("img",{src:a,alt:"Card",className:"w-full h-auto mb-4 rounded"}),(e||n)&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between items-start mb-2",children:[s.jsxs("div",{children:[e&&s.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&s.jsx("p",{className:"text-color-gray-500 text-sm",children:n})]}),i&&s.jsx("div",{className:"ml-2",children:i})]}),l&&s.jsx("hr",{className:"h-px my-5 bg-color-gray-200 border-0"})]}),s.jsx("div",{children:c}),f&&s.jsx("div",{className:"absolute w-full h-full top-0 left-0 flex items-center justify-center bg-color-white bg-opacity-50",children:f})]})},li=({orientation:e="horizontal",variant:n="fullWidth",children:t,className:r=""})=>{const o=e==="horizontal";if(t){const i=["flex items-center gap-2 text-sm text-color-gray-500 w-full",o?"flex-row":"flex-col"].filter(Boolean).join(" "),l=o?"flex-1 border-t border-color-gray-300":"h-4 border-l border-color-gray-300";return s.jsx("div",{role:"separator",className:`flex ${o?"w-full items-center":"h-full flex-col justify-center"}
|
|
167
167
|
${r}
|
|
168
168
|
${n==="inset"?o?"pl-4":"pt-4":""}`,children:s.jsxs("div",{className:i,children:[s.jsx("div",{className:l}),s.jsx("span",{children:t}),s.jsx("div",{className:l})]})})}const a=o?"h-px w-full bg-color-gray-300":"w-px h-full bg-color-gray-300";return s.jsx("div",{role:"separator",className:`flex ${o?"w-full items-center":"h-full flex-col justify-center"}
|
|
169
169
|
${r}
|
|
170
|
-
${n==="inset"?o?"pl-4":"pt-4":""} ${a}`})},
|
|
170
|
+
${n==="inset"?o?"pl-4":"pt-4":""} ${a}`})},si=({name:e,options:n,selectedValue:t,onChange:r,direction:o="column",disabled:a=!1,color:i="blue",className:l="",radioClass:c})=>s.jsx("div",{className:`flex ${o==="row"?"flex-row gap-6":"flex-col gap-3"} ${l}`,children:n.map(({label:u,value:d,disabled:g})=>{var f,v;const p=a||g;return s.jsxs("label",{className:`relative flex items-center cursor-pointer select-none transition ${p?"opacity-50 cursor-not-allowed":"hover:opacity-90"}`,children:[s.jsx("input",{type:"radio",name:e,value:d,disabled:p,checked:t===d,onChange:()=>!p&&(r==null?void 0:r(d)),className:"sr-only peer"}),s.jsx("div",{className:`w-5 h-5 rounded-full border-2 border-color-gray-400 peer-checked:border-[7px] transition-all duration-150 ${(f=fe[i])==null?void 0:f.peer} ${c}`}),s.jsx("span",{className:`ml-2 text-sm text-color-gray-800 ${(v=fe[i])==null?void 0:v.peer}`,children:u})]},d)})}),ci=({label:e,value:n,onChange:t,options:r,className:o="",labelClass:a="",disabled:i=!1,size:l="medium",variant:c="outlined",rounded:u="medium",shadow:d=!1})=>{const g={small:"p-2",medium:"p-3",large:"p-4"},p={small:"rounded-md",medium:"rounded-lg",full:"rounded-full"},f={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-300 bg-color-transparent"};return s.jsxs("div",{className:`relative w-full ${o}`,children:[e&&s.jsx("label",{className:`text-sm text-color-gray-500 pointer-events-none block mb-1 ${a}`,children:e}),s.jsxs("div",{className:"relative",children:[s.jsx("select",{disabled:i,value:n,onChange:v=>t(v.target.value),className:`appearance-none focus:ring-1 text-color-gray-800 w-full border outline-none transition-all ${p[u]} ${g[l]} ${f[c]} ${i?"!bg-color-gray-50 opacity-60 cursor-not-allowed":""} ${d?"shadow-md shadow-color-zinc-100":""}`,children:r.map(v=>s.jsx("option",{value:v.value,className:"text-color-gray-900",children:v.label},v.value))}),s.jsx("span",{className:`absolute right-3 text-sm top-1/2 -translate-y-1/2 ${i?"opacity-60":""}`,children:s.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})})})]})]})},ui=({content:e,children:n,position:t="top"})=>{const[r,o]=w.useState(!1),[a,i]=w.useState({top:0,left:0}),l=w.useRef(null),c=w.useRef(null);return w.useEffect(()=>{if(r&&l.current&&c.current){const u=l.current.getBoundingClientRect(),d=c.current.getBoundingClientRect();let g=0,p=0;switch(t){case"top":g=u.top-d.height-8,p=u.left+u.width/2-d.width/2;break;case"bottom":g=u.bottom+8,p=u.left+u.width/2-d.width/2;break;case"left":g=u.top+u.height/2-d.height/2,p=u.left-d.width-8;break;case"right":g=u.top+u.height/2-d.height/2,p=u.right+8;break}i({top:g,left:p})}},[r,t]),s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:l,className:"inline-block",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:n}),r&&Te.createPortal(s.jsx("div",{ref:c,style:{top:a.top,left:a.left},className:"fixed z-50 px-2 py-1 text-sm text-color-white bg-color-gray-800 rounded shadow-md whitespace-nowrap pointer-events-none",children:e}),document.body)]})};function di(...e){return e.filter(Boolean).join(" ")}const pi={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl"},Sr=w.forwardRef(({open:e,onClose:n,className:t,title:r,children:o,actions:a,showCloseIcon:i=!0,fullscreen:l=!1,fullWidth:c=!1,maxWidth:u},d)=>{const[g,p]=w.useState(e||!1),[f,v]=w.useState(!1),[m,b]=w.useState(!1);w.useEffect(()=>{e!==void 0&&p(e)},[e]),w.useImperativeHandle(d,()=>({open:()=>p(!0),close:()=>{b(!1),setTimeout(()=>p(!1),300)}})),w.useEffect(()=>{let R;return g?(v(!0),R=setTimeout(()=>b(!0),10)):b(!1),()=>clearTimeout(R)},[g]);const x=()=>{g||v(!1)};return w.useEffect(()=>{const R=y=>{y.key==="Escape"&&(n==null||n())};return g&&document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[g,n]),w.useEffect(()=>(g?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="",document.documentElement.style.overflow=""),()=>{document.body.style.overflow="",document.documentElement.style.overflow=""}),[g]),f?Te.createPortal(s.jsxs("div",{className:di("fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300",m?"opacity-100":"opacity-0 pointer-events-none"),children:[s.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:()=>{n==null||n(),p(!1)}}),s.jsxs("div",{className:`relative flex flex-col z-50 bg-color-white rounded-xl shadow-lg transition-all duration-300 transform p-6 ${m?"opacity-100 scale-100":"opacity-0 scale-95"} ${l?"w-full h-[calc(100%_-_40px)] m-5":`${c?"w-full":"w-auto"} ${u?pi[u]:""} mx-5`} ${t}`,onTransitionEnd:x,children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r&&s.jsx("h2",{className:"text-xl font-semibold",children:r}),i&&s.jsx(we,{color:"gray",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,onClick:()=>{n==null||n(),p(!1)},variant:"transparent"})]}),s.jsx("div",{className:"grow lg:max-h-[calc(100vh_-_200px)] max-h-[calc(100vh_-_130px)] overflow-y-auto",children:o}),a&&s.jsx("div",{className:"mt-8",children:a})]})]}),document.body):null});function fi({items:e,trigger:n,className:t,dropdownItemClass:r}){const[o,a]=w.useState(!1),[i,l]=w.useState({top:0,left:0}),[c,u]=w.useState(!1),d=w.useRef(null),g=w.useRef(null),p=v=>{v.stopPropagation(),a(m=>!m),u(!1)};w.useLayoutEffect(()=>{if(o&&d.current&&g.current){const v=d.current.getBoundingClientRect(),m=g.current.getBoundingClientRect(),b=window.innerWidth,x=window.innerHeight;let R=v.left+window.scrollX,y=v.bottom+window.scrollY;v.right+m.width>b&&(R=v.right+window.scrollX-m.width),R+m.width>b&&(R=b-m.width-12),y+m.height>x&&(y=v.top+window.scrollY-m.height),l({top:y,left:R}),setTimeout(()=>{u(!0)},150)}},[o]),w.useEffect(()=>{const v=m=>{var b;g.current&&!g.current.contains(m.target)&&!((b=d.current)!=null&&b.contains(m.target))&&a(!1)};return o&&document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[o]);const f=s.jsx("div",{ref:g,className:`absolute mt-2 z-50 rounded-xl bg-color-white shadow-xl p-2 min-w-[160px] transition-all duration-200 transform ${c?"opacity-100 scale-100":"opacity-0 scale-95"} ${t}`,style:{top:i.top,left:i.left},children:e.map((v,m)=>s.jsxs("button",{disabled:v.disabled,onClick:()=>{var b;(b=v.onClick)==null||b.call(v),a(!1)},className:`flex items-center gap-3 w-full text-left px-3 py-2 bg-color-transparent hover:bg-color-gray-100 transition-all cursor-pointer rounded-md text-md text-color-gray-700 ${v.disabled?"opacity-50 hover:bg-color-transparent !cursor-not-allowed":""} ${r} ${v.itemClass}`,children:[v.icon&&s.jsx("span",{children:v.icon}),s.jsx("span",{children:v.label})]},m))});return s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:d,onClick:p,className:"cursor-pointer",children:n}),o&&Te.createPortal(f,document.body)]})}function mi(...e){return e.filter(Boolean).join(" ")}const jr=({open:e,onClose:n,className:t,title:r,children:o,childrenClass:a,actions:i,showCloseIcon:l=!0,anchor:c="left"})=>{const[u,d]=w.useState(!1),[g,p]=w.useState(!1);w.useEffect(()=>{let b;return e?(d(!0),b=setTimeout(()=>{p(!0)},10)):p(!1),()=>clearTimeout(b)},[e]);const f=()=>{e||d(!1)};if(w.useEffect(()=>{const b=x=>{x.key==="Escape"&&(n==null||n())};return e&&document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,n]),w.useEffect(()=>(e?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="",document.documentElement.style.overflow=""),()=>{document.body.style.overflow="",document.documentElement.style.overflow=""}),[e]),!u)return null;const v={left:"left-0 top-0 h-full min-w-96 transition-all duration-300",right:"right-0 top-0 h-full min-w-96 transition-all duration-300",top:"top-0 left-0 w-full min-h-40 transition-all duration-300",bottom:"bottom-0 left-0 w-full min-h-40 transition-all duration-300"},m={left:g?"translate-x-0":"-translate-x-full",right:g?"translate-x-0":"translate-x-full",top:g?"translate-y-0":"-translate-y-full",bottom:g?"translate-y-0":"translate-y-full"};return Te.createPortal(s.jsxs("div",{className:mi("fixed inset-0 z-50 transition-opacity duration-300",g?"opacity-100":"opacity-0 pointer-events-none"),children:[s.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:n}),s.jsxs("div",{className:`
|
|
171
171
|
fixed bg-color-white shadow-lg z-50 p-6 flex flex-col
|
|
172
172
|
${v[c]}
|
|
173
173
|
${m[c]}
|
|
174
174
|
${t}
|
|
175
|
-
`,onTransitionEnd:f,children:[l&&s.jsx(we,{color:"gray",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,className:"!absolute right-3 top-3",onClick:n,variant:"transparent"}),r&&s.jsx("h2",{className:"text-xl font-semibold mb-4",children:r}),s.jsx("div",{className:`grow overflow-y-auto ${a}`,children:o}),i&&s.jsx("div",{className:"mt-4",children:i})]})]}),document.body)},
|
|
175
|
+
`,onTransitionEnd:f,children:[l&&s.jsx(we,{color:"gray",icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})}),size:"small",roundedFull:!0,className:"!absolute right-3 top-3",onClick:n,variant:"transparent"}),r&&s.jsx("h2",{className:"text-xl font-semibold mb-4",children:r}),s.jsx("div",{className:`grow overflow-y-auto ${a}`,children:o}),i&&s.jsx("div",{className:"mt-4",children:i})]})]}),document.body)},gi=({title:e,content:n,expandIcon:t,collapseIcon:r,isOpen:o,defaultExpanded:a=!1,onToggle:i,className:l="",titleClass:c="",contentClass:u=""})=>{const[d,g]=w.useState(a),p=o!==void 0,f=p?o:d,v=()=>{const m=!f;p||g(m),i==null||i(m)};return w.useEffect(()=>{p&&g(o)},[o]),s.jsxs("div",{className:`overflow-hidden ${l}`,children:[s.jsxs("button",{onClick:v,className:`flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,children:[s.jsx("div",{className:"text-left text-sm font-medium",children:e}),s.jsx("div",{className:"transition-transform duration-300",children:f?t:r})]}),s.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-in-out grid-rows-[0fr] ${f?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:s.jsx("div",{className:"overflow-hidden",children:s.jsx("div",{className:`p-4 text-sm text-color-gray-700 ${u}`,children:n})})})]})},vi={info:"bg-color-blue-50 border-color-blue-300 text-color-blue-800",success:"bg-color-green-50 border-color-green-300 text-color-green-800",danger:"bg-color-red-50 border-color-red-300 text-color-red-800",warning:"bg-color-yellow-50 border-color-yellow-300 text-color-yellow-800",dark:"bg-color-gray-100 border-color-gray-300 text-color-gray-800"},hi={info:s.jsx("svg",{className:"text-color-blue-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})}),success:s.jsx("svg",{className:"text-color-green-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})}),danger:s.jsx("svg",{className:"text-color-red-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"})}),warning:s.jsx("svg",{className:"text-color-yellow-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})}),dark:s.jsx("svg",{className:"text-color-gray-800 shrink-0 size-7",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})})},xi={info:"bg-color-blue-500",success:"bg-color-green-500",danger:"bg-color-red-500",warning:"bg-color-yellow-500",dark:"bg-color-gray-700"},bi=({message:e,variant:n="info",onClose:t,autoClose:r=!1,className:o="",autoCloseDuration:a=5e3})=>{const[i,l]=w.useState(!0),c=w.useRef(null);return w.useEffect(()=>{let u;return r&&(requestAnimationFrame(()=>{c.current&&(c.current.style.transition=`width ${a}ms linear`,c.current.style.width="0%")}),u=setTimeout(()=>{l(!1),t==null||t()},a)),()=>clearTimeout(u)},[r,a,t]),i?s.jsxs("div",{className:`relative border-t-4 p-4 flex items-start justify-between ${vi[n]} ${o}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[hi[n],s.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),s.jsx("button",{onClick:()=>{l(!1),t==null||t()},"aria-label":"Close alert",className:"ml-4 bg-color-transparent cursor-pointer hover:bg-color-white rounded-full p-1 transition-colors",children:s.jsx("svg",{className:`size-5 ${n==="dark"?"text-gray-700":""}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})})}),r&&s.jsx("div",{className:"absolute -top-1 left-0 h-1 w-full bg-color-transparent overflow-hidden",children:s.jsx("div",{ref:c,className:`${xi[n]} h-1`,style:{width:"100%"}})})]}):null},wi=({children:e,count:n,showDot:t=!1,max:r=99,color:o="red",position:a="top-right"})=>{const i=()=>{var u,d;if(t)return s.jsx("span",{className:`h-2 w-2 rounded-full ${(u=fe[o])==null?void 0:u.filled} block`});if(n===0||n===void 0)return null;const c=n>r?`${r}+`:n;return s.jsx("span",{className:`text-color-white text-xs px-[10px] py-1 rounded-full whitespace-nowrap ${(d=fe[o])==null?void 0:d.filled}`,children:c})},l=()=>{switch(a){case"top-left":return"top-0 left-0 -translate-x-1/2 -translate-y-1/2";case"bottom-right":return"bottom-0 right-0 translate-x-1/2 translate-y-1/2";case"bottom-left":return"bottom-0 left-0 -translate-x-1/2 translate-y-1/2";case"top-right":default:return"top-0 right-0 translate-x-1/2 -translate-y-1/2"}};return s.jsxs("div",{className:"relative inline-block",children:[e,s.jsx("span",{className:`absolute ${l()}`,children:i()})]})};/**
|
|
176
176
|
* react-router v7.7.1
|
|
177
177
|
*
|
|
178
178
|
* Copyright (c) Remix Software Inc.
|
|
@@ -181,17 +181,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
181
181
|
* LICENSE.md file in the root directory of this source tree.
|
|
182
182
|
*
|
|
183
183
|
* @license MIT
|
|
184
|
-
*/function ge(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function je(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Zt({pathname:e="/",search:n="",hash:t=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),t&&t!=="#"&&(e+=t.charAt(0)==="#"?t:"#"+t),e}function Kt(e){let n={};if(e){let t=e.indexOf("#");t>=0&&(n.hash=e.substring(t),e=e.substring(0,t));let r=e.indexOf("?");r>=0&&(n.search=e.substring(r),e=e.substring(0,r)),e&&(n.pathname=e)}return n}function kr(e,n,t="/"){return
|
|
184
|
+
*/function ge(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function je(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Zt({pathname:e="/",search:n="",hash:t=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),t&&t!=="#"&&(e+=t.charAt(0)==="#"?t:"#"+t),e}function Kt(e){let n={};if(e){let t=e.indexOf("#");t>=0&&(n.hash=e.substring(t),e=e.substring(0,t));let r=e.indexOf("?");r>=0&&(n.search=e.substring(r),e=e.substring(0,r)),e&&(n.pathname=e)}return n}function kr(e,n,t="/"){return yi(e,n,t,!1)}function yi(e,n,t,r){let o=typeof n=="string"?Kt(n):n,a=Pe(o.pathname||"/",t);if(a==null)return null;let i=$r(e);Ci(i);let l=null;for(let c=0;l==null&&c<i.length;++c){let u=Fi(a);l=Mi(i[c],u,r)}return l}function $r(e,n=[],t=[],r=""){let o=(a,i,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};c.relativePath.startsWith("/")&&(ge(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length));let u=ke([r,c.relativePath]),d=t.concat(c);a.children&&a.children.length>0&&(ge(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),$r(a.children,n,d,u)),!(a.path==null&&!a.index)&&n.push({path:u,score:_i(u,a.index),routesMeta:d})};return e.forEach((a,i)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))o(a,i);else for(let c of Rr(a.path))o(a,i,c)}),n}function Rr(e){let n=e.split("/");if(n.length===0)return[];let[t,...r]=n,o=t.endsWith("?"),a=t.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let i=Rr(r.join("/")),l=[];return l.push(...i.map(c=>c===""?a:[a,c].join("/"))),o&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Ci(e){e.sort((n,t)=>n.score!==t.score?t.score-n.score:Pi(n.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}var Si=/^:[\w-]+$/,ji=3,ki=2,$i=1,Ri=10,Ei=-2,Er=e=>e==="*";function _i(e,n){let t=e.split("/"),r=t.length;return t.some(Er)&&(r+=Ei),n&&(r+=ki),t.filter(o=>!Er(o)).reduce((o,a)=>o+(Si.test(a)?ji:a===""?$i:Ri),r)}function Pi(e,n){return e.length===n.length&&e.slice(0,-1).every((r,o)=>r===n[o])?e[e.length-1]-n[n.length-1]:0}function Mi(e,n,t=!1){let{routesMeta:r}=e,o={},a="/",i=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?n:n.slice(a.length)||"/",g=lt({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),p=c.route;if(!g&&u&&t&&!r[r.length-1].route.index&&(g=lt({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:ke([a,g.pathname]),pathnameBase:Ti(ke([a,g.pathnameBase])),route:p}),g.pathnameBase!=="/"&&(a=ke([a,g.pathnameBase]))}return i}function lt(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[t,r]=Li(e.path,e.caseSensitive,e.end),o=n.match(t);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,{paramName:d,isOptional:g},p)=>{if(d==="*"){let v=l[p]||"";i=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const f=l[p];return g&&!f?u[d]=void 0:u[d]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:i,pattern:e}}function Li(e,n=!1,t=!0){je(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),r]}function Fi(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return je(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Pe(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let t=n.endsWith("/")?n.length-1:n.length,r=e.charAt(t);return r&&r!=="/"?null:e.slice(t)||"/"}function Ai(e,n="/"){let{pathname:t,search:r="",hash:o=""}=typeof e=="string"?Kt(e):e;return{pathname:t?t.startsWith("/")?t:Ni(t,n):n,search:zi(r),hash:Oi(o)}}function Ni(e,n){let t=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?t.length>1&&t.pop():o!=="."&&t.push(o)}),t.length>1?t.join("/"):"/"}function Xt(e,n,t,r){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${t}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Di(e){return e.filter((n,t)=>t===0||n.route.path&&n.route.path.length>0)}function _r(e){let n=Di(e);return n.map((t,r)=>r===n.length-1?t.pathname:t.pathnameBase)}function Pr(e,n,t,r=!1){let o;typeof e=="string"?o=Kt(e):(o={...e},ge(!o.pathname||!o.pathname.includes("?"),Xt("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),Xt("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),Xt("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,l;if(i==null)l=t;else{let g=n.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),g-=1;o.pathname=p.join("/")}l=g>=0?n[g]:"/"}let c=Ai(o,l),u=i&&i!=="/"&&i.endsWith("/"),d=(a||i===".")&&t.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}var ke=e=>e.join("/").replace(/\/\/+/g,"/"),Ti=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),zi=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Oi=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ii(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var Mr=["POST","PUT","PATCH","DELETE"];new Set(Mr);var Vi=["GET",...Mr];new Set(Vi);var Ne=$.createContext(null);Ne.displayName="DataRouter";var st=$.createContext(null);st.displayName="DataRouterState",$.createContext(!1);var Lr=$.createContext({isTransitioning:!1});Lr.displayName="ViewTransition";var Hi=$.createContext(new Map);Hi.displayName="Fetchers";var Bi=$.createContext(null);Bi.displayName="Await";var $e=$.createContext(null);$e.displayName="Navigation";var Jt=$.createContext(null);Jt.displayName="Location";var Re=$.createContext({outlet:null,matches:[],isDataRoute:!1});Re.displayName="Route";var Qt=$.createContext(null);Qt.displayName="RouteError";function qi(e,{relative:n}={}){ge(ct(),"useHref() may be used only in the context of a <Router> component.");let{basename:t,navigator:r}=$.useContext($e),{hash:o,pathname:a,search:i}=Be(e,{relative:n}),l=a;return t!=="/"&&(l=a==="/"?t:ke([t,a])),r.createHref({pathname:l,search:i,hash:o})}function ct(){return $.useContext(Jt)!=null}function Fe(){return ge(ct(),"useLocation() may be used only in the context of a <Router> component."),$.useContext(Jt).location}var Fr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ar(e){$.useContext($e).static||$.useLayoutEffect(e)}function Gi(){let{isDataRoute:e}=$.useContext(Re);return e?ol():Wi()}function Wi(){ge(ct(),"useNavigate() may be used only in the context of a <Router> component.");let e=$.useContext(Ne),{basename:n,navigator:t}=$.useContext($e),{matches:r}=$.useContext(Re),{pathname:o}=Fe(),a=JSON.stringify(_r(r)),i=$.useRef(!1);return Ar(()=>{i.current=!0}),$.useCallback((c,u={})=>{if(je(i.current,Fr),!i.current)return;if(typeof c=="number"){t.go(c);return}let d=Pr(c,JSON.parse(a),o,u.relative==="path");e==null&&n!=="/"&&(d.pathname=d.pathname==="/"?n:ke([n,d.pathname])),(u.replace?t.replace:t.push)(d,u.state,u)},[n,t,a,o,e])}$.createContext(null);function Be(e,{relative:n}={}){let{matches:t}=$.useContext(Re),{pathname:r}=Fe(),o=JSON.stringify(_r(t));return $.useMemo(()=>Pr(e,JSON.parse(o),r,n==="path"),[e,o,r,n])}function Ui(e,n,t,r){ge(ct(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=$.useContext($e),{matches:a}=$.useContext(Re),i=a[a.length-1],l=i?i.params:{},c=i?i.pathname:"/",u=i?i.pathnameBase:"/",d=i&&i.route;{let x=d&&d.path||"";Dr(c,!d||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${x}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
185
185
|
|
|
186
|
-
Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let g=Fe(),p;p=g;let f=p.pathname||"/",v=f;if(u!=="/"){let x=u.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=kr(e,{pathname:v});return je(d||m!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),je(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Qi(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:ke([u,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:ke([u,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,t,r)}function Zi(){let e=ol(),n=Vi(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=$.createElement($.Fragment,null,$.createElement("p",null,"💿 Hey developer 👋"),$.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",$.createElement("code",{style:a},"ErrorBoundary")," or"," ",$.createElement("code",{style:a},"errorElement")," prop on your route.")),$.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},n),t?$.createElement("pre",{style:o},t):null,i)}var Ki=$.createElement(Zi,null),Xi=class extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?$.createElement(Re.Provider,{value:this.props.routeContext},$.createElement(Qt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Ji({routeContext:e,match:n,children:t}){let r=$.useContext(Ne);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(Re.Provider,{value:e},t)}function Qi(e,n=[],t=null,r=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(n.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let o=e,a=t==null?void 0:t.errors;if(a!=null){let c=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);ge(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,c+1))}let i=!1,l=-1;if(t)for(let c=0;c<o.length;c++){let u=o[c];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=c),u.route.id){let{loaderData:d,errors:g}=t,p=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!g||g[u.route.id]===void 0);if(u.route.lazy||p){i=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((c,u,d)=>{let g,p=!1,f=null,v=null;t&&(g=a&&u.route.id?a[u.route.id]:void 0,f=u.route.errorElement||Ki,i&&(l<0&&d===0?(Dr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,v=null):l===d&&(p=!0,v=u.route.hydrateFallbackElement||null)));let m=n.concat(o.slice(0,d+1)),b=()=>{let x;return g?x=f:p?x=v:u.route.Component?x=$.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=c,$.createElement(Ji,{match:u,routeContext:{outlet:c,matches:m,isDataRoute:t!=null},children:x})};return t&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?$.createElement(Xi,{location:t.location,revalidation:t.revalidation,component:f,error:g,children:b(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):b()},null)}function en(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function el(e){let n=$.useContext(Ne);return ge(n,en(e)),n}function tl(e){let n=$.useContext(st);return ge(n,en(e)),n}function nl(e){let n=$.useContext(Re);return ge(n,en(e)),n}function tn(e){let n=nl(e),t=n.matches[n.matches.length-1];return ge(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function rl(){return tn("useRouteId")}function ol(){var r;let e=$.useContext(Qt),n=tl("useRouteError"),t=tn("useRouteError");return e!==void 0?e:(r=n.errors)==null?void 0:r[t]}function al(){let{router:e}=el("useNavigate"),n=tn("useNavigate"),t=$.useRef(!1);return Ar(()=>{t.current=!0}),$.useCallback(async(o,a={})=>{je(t.current,Fr),t.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:n,...a}))},[e,n])}var Nr={};function Dr(e,n,t){!n&&!Nr[e]&&(Nr[e]=!0,je(!1,t))}$.memo(il);function il({routes:e,future:n,state:t}){return Yi(e,void 0,t,n)}var ut="get",dt="application/x-www-form-urlencoded";function pt(e){return e!=null&&typeof e.tagName=="string"}function ll(e){return pt(e)&&e.tagName.toLowerCase()==="button"}function sl(e){return pt(e)&&e.tagName.toLowerCase()==="form"}function cl(e){return pt(e)&&e.tagName.toLowerCase()==="input"}function ul(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dl(e,n){return e.button===0&&(!n||n==="_self")&&!ul(e)}var ft=null;function pl(){if(ft===null)try{new FormData(document.createElement("form"),0),ft=!1}catch{ft=!0}return ft}var fl=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nn(e){return e!=null&&!fl.has(e)?(je(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dt}"`),null):e}function ml(e,n){let t,r,o,a,i;if(sl(e)){let l=e.getAttribute("action");r=l?Pe(l,n):null,t=e.getAttribute("method")||ut,o=nn(e.getAttribute("enctype"))||dt,a=new FormData(e)}else if(ll(e)||cl(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?Pe(c,n):null,t=e.getAttribute("formmethod")||l.getAttribute("method")||ut,o=nn(e.getAttribute("formenctype"))||nn(l.getAttribute("enctype"))||dt,a=new FormData(l,e),!pl()){let{name:u,type:d,value:g}=e;if(d==="image"){let p=u?`${u}.`:"";a.append(`${p}x`,"0"),a.append(`${p}y`,"0")}else u&&a.append(u,g)}}else{if(pt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=ut,r=null,o=dt,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:r,method:t.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rn(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function gl(e,n,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${t}`:n&&Pe(r.pathname,n)==="/"?r.pathname=`${n.replace(/\/$/,"")}/_root.${t}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${t}`,r}async function vl(e,n){if(e.id in n)return n[e.id];try{let t=await import(e.module);return n[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function hl(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function xl(e,n,t){let r=await Promise.all(e.map(async o=>{let a=n.routes[o.route.id];if(a){let i=await vl(a,t);return i.links?i.links():[]}return[]}));return Cl(r.flat(1).filter(hl).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Tr(e,n,t,r,o,a){let i=(c,u)=>t[u]?c.route.id!==t[u].route.id:!0,l=(c,u)=>{var d;return t[u].pathname!==c.pathname||((d=t[u].route.path)==null?void 0:d.endsWith("*"))&&t[u].params["*"]!==c.params["*"]};return a==="assets"?n.filter((c,u)=>i(c,u)||l(c,u)):a==="data"?n.filter((c,u)=>{var g;let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(i(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=t[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function bl(e,n,{includeHydrateFallback:t}={}){return wl(e.map(r=>{let o=n.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),t&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function wl(e){return[...new Set(e)]}function yl(e){let n={},t=Object.keys(e).sort();for(let r of t)n[r]=e[r];return n}function Cl(e,n){let t=new Set;return new Set(n),e.reduce((r,o)=>{let a=JSON.stringify(yl(o));return t.has(a)||(t.add(a),r.push({key:a,link:o})),r},[])}function zr(){let e=$.useContext(Ne);return rn(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Sl(){let e=$.useContext(st);return rn(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var on=$.createContext(void 0);on.displayName="FrameworkContext";function Or(){let e=$.useContext(on);return rn(e,"You must render this element inside a <HydratedRouter> element"),e}function jl(e,n){let t=$.useContext(on),[r,o]=$.useState(!1),[a,i]=$.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:g}=n,p=$.useRef(null);$.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=x=>{x.forEach(R=>{i(R.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return p.current&&b.observe(p.current),()=>{b.disconnect()}}},[e]),$.useEffect(()=>{if(r){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[r]);let f=()=>{o(!0)},v=()=>{o(!1),i(!1)};return t?e!=="intent"?[a,p,{}]:[a,p,{onFocus:qe(l,f),onBlur:qe(c,v),onMouseEnter:qe(u,f),onMouseLeave:qe(d,v),onTouchStart:qe(g,f)}]:[!1,p,{}]}function qe(e,n){return t=>{e&&e(t),t.defaultPrevented||n(t)}}function kl({page:e,...n}){let{router:t}=zr(),r=$.useMemo(()=>kr(t.routes,e,t.basename),[t.routes,e,t.basename]);return r?$.createElement(Rl,{page:e,matches:r,...n}):null}function $l(e){let{manifest:n,routeModules:t}=Or(),[r,o]=$.useState([]);return $.useEffect(()=>{let a=!1;return xl(e,n,t).then(i=>{a||o(i)}),()=>{a=!0}},[e,n,t]),r}function Rl({page:e,matches:n,...t}){let r=Fe(),{manifest:o,routeModules:a}=Or(),{basename:i}=zr(),{loaderData:l,matches:c}=Sl(),u=$.useMemo(()=>Tr(e,n,c,o,r,"data"),[e,n,c,o,r]),d=$.useMemo(()=>Tr(e,n,c,o,r,"assets"),[e,n,c,o,r]),g=$.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,m=!1;if(n.forEach(x=>{var y;let R=o.routes[x.route.id];!R||!R.hasLoader||(!u.some(E=>E.route.id===x.route.id)&&x.route.id in l&&((y=a[x.route.id])!=null&&y.shouldRevalidate)||R.hasClientLoader?m=!0:v.add(x.route.id))}),v.size===0)return[];let b=gl(e,i,"data");return m&&v.size>0&&b.searchParams.set("_routes",n.filter(x=>v.has(x.route.id)).map(x=>x.route.id).join(",")),[b.pathname+b.search]},[i,l,r,o,u,n,e,a]),p=$.useMemo(()=>bl(d,o),[d,o]),f=$l(d);return $.createElement($.Fragment,null,g.map(v=>$.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...t})),p.map(v=>$.createElement("link",{key:v,rel:"modulepreload",href:v,...t})),f.map(({key:v,link:m})=>$.createElement("link",{key:v,...m})))}function El(...e){return n=>{e.forEach(t=>{typeof t=="function"?t(n):t!=null&&(t.current=n)})}}var Ir=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ir&&(window.__reactRouterVersion="7.7.1")}catch{}var Vr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=$.forwardRef(function({onClick:n,discover:t="render",prefetch:r="none",relative:o,reloadDocument:a,replace:i,state:l,target:c,to:u,preventScrollReset:d,viewTransition:g,...p},f){let{basename:v}=$.useContext($e),m=typeof u=="string"&&Vr.test(u),b,x=!1;if(typeof u=="string"&&m&&(b=u,Ir))try{let A=new URL(window.location.href),X=u.startsWith("//")?new URL(A.protocol+u):new URL(u),ae=Pe(X.pathname,v);X.origin===A.origin&&ae!=null?u=ae+X.search+X.hash:x=!0}catch{je(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=Gi(u,{relative:o}),[y,E,C]=jl(r,p),V=Ml(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:o,viewTransition:g});function T(A){n&&n(A),A.defaultPrevented||V(A)}let B=$.createElement("a",{...p,...C,href:b||R,onClick:x||a?n:T,ref:El(f,E),target:c,"data-discover":!m&&t==="render"?"true":void 0});return y&&!m?$.createElement($.Fragment,null,B,$.createElement(kl,{page:R})):B});an.displayName="Link";var Hr=$.forwardRef(function({"aria-current":n="page",caseSensitive:t=!1,className:r="",end:o=!1,style:a,to:i,viewTransition:l,children:c,...u},d){let g=Be(i,{relative:u.relative}),p=Fe(),f=$.useContext(st),{navigator:v,basename:m}=$.useContext($e),b=f!=null&&Dl(g)&&l===!0,x=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,R=p.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(R=R.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&m&&(y=Pe(y,m)||y);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=R===x||!o&&R.startsWith(x)&&R.charAt(E)==="/",V=y!=null&&(y===x||!o&&y.startsWith(x)&&y.charAt(x.length)==="/"),T={isActive:C,isPending:V,isTransitioning:b},B=C?n:void 0,A;typeof r=="function"?A=r(T):A=[r,C?"active":null,V?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let X=typeof a=="function"?a(T):a;return $.createElement(an,{...u,"aria-current":B,className:A,ref:d,style:X,to:i,viewTransition:l},typeof c=="function"?c(T):c)});Hr.displayName="NavLink";var _l=$.forwardRef(({discover:e="render",fetcherKey:n,navigate:t,reloadDocument:r,replace:o,state:a,method:i=ut,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:g,...p},f)=>{let v=Al(),m=Nl(l,{relative:u}),b=i.toLowerCase()==="get"?"get":"post",x=typeof l=="string"&&Vr.test(l),R=y=>{if(c&&c(y),y.defaultPrevented)return;y.preventDefault();let E=y.nativeEvent.submitter,C=(E==null?void 0:E.getAttribute("formmethod"))||i;v(E||y.currentTarget,{fetcherKey:n,method:C,navigate:t,replace:o,state:a,relative:u,preventScrollReset:d,viewTransition:g})};return $.createElement("form",{ref:f,method:b,action:m,onSubmit:r?c:R,...p,"data-discover":!x&&e==="render"?"true":void 0})});_l.displayName="Form";function Pl(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Br(e){let n=$.useContext(Ne);return ge(n,Pl(e)),n}function Ml(e,{target:n,replace:t,state:r,preventScrollReset:o,relative:a,viewTransition:i}={}){let l=Wi(),c=Fe(),u=Be(e,{relative:a});return $.useCallback(d=>{if(dl(d,n)){d.preventDefault();let g=t!==void 0?t:Zt(c)===Zt(u);l(e,{replace:g,state:r,preventScrollReset:o,relative:a,viewTransition:i})}},[c,l,u,t,r,n,e,o,a,i])}var Ll=0,Fl=()=>`__${String(++Ll)}__`;function Al(){let{router:e}=Br("useSubmit"),{basename:n}=$.useContext($e),t=rl();return $.useCallback(async(r,o={})=>{let{action:a,method:i,encType:l,formData:c,body:u}=ml(r,n);if(o.navigate===!1){let d=o.fetcherKey||Fl();await e.fetch(d,t,o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:t,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,n,t])}function Nl(e,{relative:n}={}){let{basename:t}=$.useContext($e),r=$.useContext(Re);ge(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Be(e||".",{relative:n})},i=Fe();if(e==null){a.search=i.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(d=>d==="")){l.delete("index"),c.filter(g=>g).forEach(g=>l.append("index",g));let d=l.toString();a.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:ke([t,a.pathname])),Zt(a)}function Dl(e,{relative:n}={}){let t=$.useContext(Lr);ge(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Br("useViewTransitionState"),o=Be(e,{relative:n});if(!t.isTransitioning)return!1;let a=Pe(t.currentLocation.pathname,r)||t.currentLocation.pathname,i=Pe(t.nextLocation.pathname,r)||t.nextLocation.pathname;return lt(o.pathname,i)!=null||lt(o.pathname,a)!=null}const Tl=({variant:e="fixed",activeTab:n,navItems:t,onTabChange:r,className:o="",activeClass:a="",buttonClass:i=""})=>{let l="flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4";return e==="fixed"?l+=" fixed bottom-0 left-0 right-0":e==="floating"?l+=" fixed bottom-4 left-4 right-4 rounded-full":e==="static"&&(l+=" static"),s.jsx("nav",{className:`${l} ${o}`,children:t.map(c=>{const u=c.label===n;return s.jsxs(an,{to:c.path,onClick:()=>r(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${i}`,children:[s.jsx("span",{className:`text-xl ${u?`text-color-blue-500 ${a}`:""}`,children:c.icon}),s.jsx("span",{className:`text-xs font-medium mt-1 ${u?`text-color-blue-500 ${a}`:""}`,children:c.label})]},c.label)})})},zl=({items:e,separator:n="/",className:t=""})=>s.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:s.jsx("ol",{className:"flex items-center space-x-1",children:e.map((r,o)=>s.jsxs("li",{className:"flex items-center",children:[r.href?s.jsx("a",{href:r.href,className:"text-color-gray-800 hover:underline font-medium",children:r.label}):s.jsx("span",{className:"text-color-gray-500 font-medium",children:r.label}),o<e.length-1&&s.jsx("span",{className:"mx-2 text-color-gray-400",children:n})]},o))})}),qr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ol=["Su","Mo","Tu","We","Th","Fr","Sa"],Il=({mode:e="single",type:n="inline",showTime:t=!1,onlyTime:r=!1,className:o,onChange:a,placeholder:i="Select date",icon:l=s.jsx("svg",{className:"text-color-gray-500 size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M7 3V1H9V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V9H20V5H17V7H15V5H9V7H7V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7ZM17 12C14.7909 12 13 13.7909 13 16C13 18.2091 14.7909 20 17 20C19.2091 20 21 18.2091 21 16C21 13.7909 19.2091 12 17 12ZM11 16C11 12.6863 13.6863 10 17 10C20.3137 10 23 12.6863 23 16C23 19.3137 20.3137 22 17 22C13.6863 22 11 19.3137 11 16ZM16 13V16.4142L18.2929 18.7071L19.7071 17.2929L18 15.5858V13H16Z"})}),disableBefore:c,disableAfter:u,selectedDate:d})=>{const[g,p]=w.useState(!1),[f,v]=w.useState(null),[m,b]=w.useState(new Date),[x,R]=w.useState(d?new Date(d):null),[y,E]=w.useState(null),[C,V]=w.useState(null),[T,B]=w.useState(null),[A,X]=w.useState({hour:12,minute:0,ampm:"AM"}),ae=w.useRef(null),[se,ee]=w.useState(d?new Date(d):null),[q,K]=w.useState(null),[O,ne]=w.useState(null);w.useEffect(()=>{R(d?new Date(d):null),ee(d?new Date(d):null)},[d]);const ue=j=>{j.stopPropagation(),v(j.currentTarget),p(!0)},J=()=>{p(!1)},h=j=>!!(c&&j.getTime()<c||u&&j.getTime()>u),S=j=>{n==="inline"&&ae.current&&!ae.current.contains(j.target)&&(e==="single"?x||R(null):e==="range"&&(!y||!C)&&(E(null),V(null)),p(!1))};w.useEffect(()=>(g?document.addEventListener("mousedown",S):document.removeEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}),[g]);const F=j=>{!j||h(j)||(e==="single"?R(j):e==="range"&&(!y||y&&C?(E(j),V(null)):j>=y?V(j):E(j)))},L=j=>{if(!j||h(j)){B(null);return}e==="range"&&y&&!C&&B(j)},D=()=>{B(null)},H=()=>{if(p(!1),e==="single"){const j=r?new Date:x,k=j?new Date(j.getFullYear(),j.getMonth(),j.getDate(),A.ampm==="PM"&&A.hour!==12?A.hour+12:A.ampm==="AM"&&A.hour===12?0:A.hour,A.minute):null;ee(k),a==null||a(k?k.getTime():null)}else e==="range"&&(K(y),ne(C),a==null||a({startDate:y?y.getTime():null,endDate:C?C.getTime():null}))},z=()=>{const j=new Date(m.getFullYear(),m.getMonth(),1),k=new Date(m.getFullYear(),m.getMonth()+1,0),_=[],Q=j.getDay();for(let te=0;te<Q;te++)_.push(null);for(let te=1;te<=k.getDate();te++)_.push(new Date(m.getFullYear(),m.getMonth(),te));return _},P=j=>{if(!j)return!1;if(e==="single")return(x==null?void 0:x.toDateString())===j.toDateString();if(e==="range"){if(y&&!C&&T){const k=y<T?y:T,_=y<T?T:y;return j>=k&&j<=_}return y&&C&&j>=y&&j<=C}return!1},M=(j,k)=>{if(!j)return e==="range"?k==="end"?"End Date":"Start Date":r?`${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`:i;if(r)return`${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`;const _=j.getDate().toString().padStart(2,"0"),Q=qr[j.getMonth()],te=j.getFullYear(),ce=t?` ${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`:"";return`${_} ${Q} ${te}${ce}`},G=s.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[s.jsx("select",{value:A.hour,onChange:j=>X({...A,hour:parseInt(j.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(j,k)=>k+1).map(j=>s.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),s.jsx("select",{value:A.minute,onChange:j=>X({...A,minute:parseInt(j.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(j,k)=>k).map(j=>s.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),s.jsxs("select",{value:A.ampm,onChange:j=>X({...A,ampm:j.target.value}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[s.jsx("option",{value:"AM",children:"AM"}),s.jsx("option",{value:"PM",children:"PM"})]})]}),W=s.jsxs("div",{ref:ae,className:`${n==="dialog"?"relative w-full":"absolute z-50 mt-2 w-72 rounded-lg border border-color-gray-200 bg-color-white shadow-xl p-4"}`,style:n==="dialog"?void 0:{position:"absolute",left:f==null?void 0:f.getBoundingClientRect().left,top:f?f.getBoundingClientRect().bottom+window.scrollY:0},children:[!r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(we,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()-1,1)),icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("select",{className:"text-sm outline-none",value:m.getMonth(),onChange:j=>b(new Date(m.getFullYear(),parseInt(j.target.value),1)),children:qr.map((j,k)=>s.jsx("option",{value:k,children:j},j))}),s.jsx("select",{className:"text-sm outline-none",value:m.getFullYear(),onChange:j=>b(new Date(parseInt(j.target.value),m.getMonth(),1)),children:Array.from({length:150},(j,k)=>new Date().getFullYear()-100+k).map(j=>s.jsx("option",{value:j,children:j},j))})]}),s.jsx(we,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()+1,1)),icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})})})]}),s.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[Ol.map(j=>s.jsx("div",{className:"font-semibold",children:j},j)),z().map((j,k)=>s.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
|
|
186
|
+
Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let g=Fe(),p;p=g;let f=p.pathname||"/",v=f;if(u!=="/"){let x=u.replace(/^\//,"").split("/");v="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=kr(e,{pathname:v});return je(d||m!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),je(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Ji(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:ke([u,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:ke([u,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,t,r)}function Yi(){let e=rl(),n=Ii(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),t=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=$.createElement($.Fragment,null,$.createElement("p",null,"💿 Hey developer 👋"),$.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",$.createElement("code",{style:a},"ErrorBoundary")," or"," ",$.createElement("code",{style:a},"errorElement")," prop on your route.")),$.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},n),t?$.createElement("pre",{style:o},t):null,i)}var Zi=$.createElement(Yi,null),Ki=class extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?$.createElement(Re.Provider,{value:this.props.routeContext},$.createElement(Qt.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Xi({routeContext:e,match:n,children:t}){let r=$.useContext(Ne);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),$.createElement(Re.Provider,{value:e},t)}function Ji(e,n=[],t=null,r=null){if(e==null){if(!t)return null;if(t.errors)e=t.matches;else if(n.length===0&&!t.initialized&&t.matches.length>0)e=t.matches;else return null}let o=e,a=t==null?void 0:t.errors;if(a!=null){let c=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);ge(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,c+1))}let i=!1,l=-1;if(t)for(let c=0;c<o.length;c++){let u=o[c];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=c),u.route.id){let{loaderData:d,errors:g}=t,p=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!g||g[u.route.id]===void 0);if(u.route.lazy||p){i=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((c,u,d)=>{let g,p=!1,f=null,v=null;t&&(g=a&&u.route.id?a[u.route.id]:void 0,f=u.route.errorElement||Zi,i&&(l<0&&d===0?(Dr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),p=!0,v=null):l===d&&(p=!0,v=u.route.hydrateFallbackElement||null)));let m=n.concat(o.slice(0,d+1)),b=()=>{let x;return g?x=f:p?x=v:u.route.Component?x=$.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=c,$.createElement(Xi,{match:u,routeContext:{outlet:c,matches:m,isDataRoute:t!=null},children:x})};return t&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?$.createElement(Ki,{location:t.location,revalidation:t.revalidation,component:f,error:g,children:b(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):b()},null)}function en(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qi(e){let n=$.useContext(Ne);return ge(n,en(e)),n}function el(e){let n=$.useContext(st);return ge(n,en(e)),n}function tl(e){let n=$.useContext(Re);return ge(n,en(e)),n}function tn(e){let n=tl(e),t=n.matches[n.matches.length-1];return ge(t.route.id,`${e} can only be used on routes that contain a unique "id"`),t.route.id}function nl(){return tn("useRouteId")}function rl(){var r;let e=$.useContext(Qt),n=el("useRouteError"),t=tn("useRouteError");return e!==void 0?e:(r=n.errors)==null?void 0:r[t]}function ol(){let{router:e}=Qi("useNavigate"),n=tn("useNavigate"),t=$.useRef(!1);return Ar(()=>{t.current=!0}),$.useCallback(async(o,a={})=>{je(t.current,Fr),t.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:n,...a}))},[e,n])}var Nr={};function Dr(e,n,t){!n&&!Nr[e]&&(Nr[e]=!0,je(!1,t))}$.memo(al);function al({routes:e,future:n,state:t}){return Ui(e,void 0,t,n)}var ut="get",dt="application/x-www-form-urlencoded";function pt(e){return e!=null&&typeof e.tagName=="string"}function il(e){return pt(e)&&e.tagName.toLowerCase()==="button"}function ll(e){return pt(e)&&e.tagName.toLowerCase()==="form"}function sl(e){return pt(e)&&e.tagName.toLowerCase()==="input"}function cl(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ul(e,n){return e.button===0&&(!n||n==="_self")&&!cl(e)}var ft=null;function dl(){if(ft===null)try{new FormData(document.createElement("form"),0),ft=!1}catch{ft=!0}return ft}var pl=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nn(e){return e!=null&&!pl.has(e)?(je(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${dt}"`),null):e}function fl(e,n){let t,r,o,a,i;if(ll(e)){let l=e.getAttribute("action");r=l?Pe(l,n):null,t=e.getAttribute("method")||ut,o=nn(e.getAttribute("enctype"))||dt,a=new FormData(e)}else if(il(e)||sl(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?Pe(c,n):null,t=e.getAttribute("formmethod")||l.getAttribute("method")||ut,o=nn(e.getAttribute("formenctype"))||nn(l.getAttribute("enctype"))||dt,a=new FormData(l,e),!dl()){let{name:u,type:d,value:g}=e;if(d==="image"){let p=u?`${u}.`:"";a.append(`${p}x`,"0"),a.append(`${p}y`,"0")}else u&&a.append(u,g)}}else{if(pt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');t=ut,r=null,o=dt,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:r,method:t.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rn(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function ml(e,n,t){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${t}`:n&&Pe(r.pathname,n)==="/"?r.pathname=`${n.replace(/\/$/,"")}/_root.${t}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${t}`,r}async function gl(e,n){if(e.id in n)return n[e.id];try{let t=await import(e.module);return n[e.id]=t,t}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vl(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function hl(e,n,t){let r=await Promise.all(e.map(async o=>{let a=n.routes[o.route.id];if(a){let i=await gl(a,t);return i.links?i.links():[]}return[]}));return yl(r.flat(1).filter(vl).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Tr(e,n,t,r,o,a){let i=(c,u)=>t[u]?c.route.id!==t[u].route.id:!0,l=(c,u)=>{var d;return t[u].pathname!==c.pathname||((d=t[u].route.path)==null?void 0:d.endsWith("*"))&&t[u].params["*"]!==c.params["*"]};return a==="assets"?n.filter((c,u)=>i(c,u)||l(c,u)):a==="data"?n.filter((c,u)=>{var g;let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(i(c,u)||l(c,u))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=t[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function xl(e,n,{includeHydrateFallback:t}={}){return bl(e.map(r=>{let o=n.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),t&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function bl(e){return[...new Set(e)]}function wl(e){let n={},t=Object.keys(e).sort();for(let r of t)n[r]=e[r];return n}function yl(e,n){let t=new Set;return new Set(n),e.reduce((r,o)=>{let a=JSON.stringify(wl(o));return t.has(a)||(t.add(a),r.push({key:a,link:o})),r},[])}function zr(){let e=$.useContext(Ne);return rn(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Cl(){let e=$.useContext(st);return rn(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var on=$.createContext(void 0);on.displayName="FrameworkContext";function Or(){let e=$.useContext(on);return rn(e,"You must render this element inside a <HydratedRouter> element"),e}function Sl(e,n){let t=$.useContext(on),[r,o]=$.useState(!1),[a,i]=$.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:g}=n,p=$.useRef(null);$.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=x=>{x.forEach(R=>{i(R.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return p.current&&b.observe(p.current),()=>{b.disconnect()}}},[e]),$.useEffect(()=>{if(r){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[r]);let f=()=>{o(!0)},v=()=>{o(!1),i(!1)};return t?e!=="intent"?[a,p,{}]:[a,p,{onFocus:qe(l,f),onBlur:qe(c,v),onMouseEnter:qe(u,f),onMouseLeave:qe(d,v),onTouchStart:qe(g,f)}]:[!1,p,{}]}function qe(e,n){return t=>{e&&e(t),t.defaultPrevented||n(t)}}function jl({page:e,...n}){let{router:t}=zr(),r=$.useMemo(()=>kr(t.routes,e,t.basename),[t.routes,e,t.basename]);return r?$.createElement($l,{page:e,matches:r,...n}):null}function kl(e){let{manifest:n,routeModules:t}=Or(),[r,o]=$.useState([]);return $.useEffect(()=>{let a=!1;return hl(e,n,t).then(i=>{a||o(i)}),()=>{a=!0}},[e,n,t]),r}function $l({page:e,matches:n,...t}){let r=Fe(),{manifest:o,routeModules:a}=Or(),{basename:i}=zr(),{loaderData:l,matches:c}=Cl(),u=$.useMemo(()=>Tr(e,n,c,o,r,"data"),[e,n,c,o,r]),d=$.useMemo(()=>Tr(e,n,c,o,r,"assets"),[e,n,c,o,r]),g=$.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,m=!1;if(n.forEach(x=>{var y;let R=o.routes[x.route.id];!R||!R.hasLoader||(!u.some(E=>E.route.id===x.route.id)&&x.route.id in l&&((y=a[x.route.id])!=null&&y.shouldRevalidate)||R.hasClientLoader?m=!0:v.add(x.route.id))}),v.size===0)return[];let b=ml(e,i,"data");return m&&v.size>0&&b.searchParams.set("_routes",n.filter(x=>v.has(x.route.id)).map(x=>x.route.id).join(",")),[b.pathname+b.search]},[i,l,r,o,u,n,e,a]),p=$.useMemo(()=>xl(d,o),[d,o]),f=kl(d);return $.createElement($.Fragment,null,g.map(v=>$.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...t})),p.map(v=>$.createElement("link",{key:v,rel:"modulepreload",href:v,...t})),f.map(({key:v,link:m})=>$.createElement("link",{key:v,...m})))}function Rl(...e){return n=>{e.forEach(t=>{typeof t=="function"?t(n):t!=null&&(t.current=n)})}}var Ir=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ir&&(window.__reactRouterVersion="7.7.1")}catch{}var Vr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=$.forwardRef(function({onClick:n,discover:t="render",prefetch:r="none",relative:o,reloadDocument:a,replace:i,state:l,target:c,to:u,preventScrollReset:d,viewTransition:g,...p},f){let{basename:v}=$.useContext($e),m=typeof u=="string"&&Vr.test(u),b,x=!1;if(typeof u=="string"&&m&&(b=u,Ir))try{let A=new URL(window.location.href),X=u.startsWith("//")?new URL(A.protocol+u):new URL(u),ae=Pe(X.pathname,v);X.origin===A.origin&&ae!=null?u=ae+X.search+X.hash:x=!0}catch{je(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=qi(u,{relative:o}),[y,E,C]=Sl(r,p),V=Pl(u,{replace:i,state:l,target:c,preventScrollReset:d,relative:o,viewTransition:g});function T(A){n&&n(A),A.defaultPrevented||V(A)}let B=$.createElement("a",{...p,...C,href:b||R,onClick:x||a?n:T,ref:Rl(f,E),target:c,"data-discover":!m&&t==="render"?"true":void 0});return y&&!m?$.createElement($.Fragment,null,B,$.createElement(jl,{page:R})):B});an.displayName="Link";var Hr=$.forwardRef(function({"aria-current":n="page",caseSensitive:t=!1,className:r="",end:o=!1,style:a,to:i,viewTransition:l,children:c,...u},d){let g=Be(i,{relative:u.relative}),p=Fe(),f=$.useContext(st),{navigator:v,basename:m}=$.useContext($e),b=f!=null&&Nl(g)&&l===!0,x=v.encodeLocation?v.encodeLocation(g).pathname:g.pathname,R=p.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(R=R.toLowerCase(),y=y?y.toLowerCase():null,x=x.toLowerCase()),y&&m&&(y=Pe(y,m)||y);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=R===x||!o&&R.startsWith(x)&&R.charAt(E)==="/",V=y!=null&&(y===x||!o&&y.startsWith(x)&&y.charAt(x.length)==="/"),T={isActive:C,isPending:V,isTransitioning:b},B=C?n:void 0,A;typeof r=="function"?A=r(T):A=[r,C?"active":null,V?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let X=typeof a=="function"?a(T):a;return $.createElement(an,{...u,"aria-current":B,className:A,ref:d,style:X,to:i,viewTransition:l},typeof c=="function"?c(T):c)});Hr.displayName="NavLink";var El=$.forwardRef(({discover:e="render",fetcherKey:n,navigate:t,reloadDocument:r,replace:o,state:a,method:i=ut,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:g,...p},f)=>{let v=Fl(),m=Al(l,{relative:u}),b=i.toLowerCase()==="get"?"get":"post",x=typeof l=="string"&&Vr.test(l),R=y=>{if(c&&c(y),y.defaultPrevented)return;y.preventDefault();let E=y.nativeEvent.submitter,C=(E==null?void 0:E.getAttribute("formmethod"))||i;v(E||y.currentTarget,{fetcherKey:n,method:C,navigate:t,replace:o,state:a,relative:u,preventScrollReset:d,viewTransition:g})};return $.createElement("form",{ref:f,method:b,action:m,onSubmit:r?c:R,...p,"data-discover":!x&&e==="render"?"true":void 0})});El.displayName="Form";function _l(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Br(e){let n=$.useContext(Ne);return ge(n,_l(e)),n}function Pl(e,{target:n,replace:t,state:r,preventScrollReset:o,relative:a,viewTransition:i}={}){let l=Gi(),c=Fe(),u=Be(e,{relative:a});return $.useCallback(d=>{if(ul(d,n)){d.preventDefault();let g=t!==void 0?t:Zt(c)===Zt(u);l(e,{replace:g,state:r,preventScrollReset:o,relative:a,viewTransition:i})}},[c,l,u,t,r,n,e,o,a,i])}var Ml=0,Ll=()=>`__${String(++Ml)}__`;function Fl(){let{router:e}=Br("useSubmit"),{basename:n}=$.useContext($e),t=nl();return $.useCallback(async(r,o={})=>{let{action:a,method:i,encType:l,formData:c,body:u}=fl(r,n);if(o.navigate===!1){let d=o.fetcherKey||Ll();await e.fetch(d,t,o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||l,flushSync:o.flushSync})}else await e.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:t,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,n,t])}function Al(e,{relative:n}={}){let{basename:t}=$.useContext($e),r=$.useContext(Re);ge(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...Be(e||".",{relative:n})},i=Fe();if(e==null){a.search=i.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(d=>d==="")){l.delete("index"),c.filter(g=>g).forEach(g=>l.append("index",g));let d=l.toString();a.search=d?`?${d}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),t!=="/"&&(a.pathname=a.pathname==="/"?t:ke([t,a.pathname])),Zt(a)}function Nl(e,{relative:n}={}){let t=$.useContext(Lr);ge(t!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Br("useViewTransitionState"),o=Be(e,{relative:n});if(!t.isTransitioning)return!1;let a=Pe(t.currentLocation.pathname,r)||t.currentLocation.pathname,i=Pe(t.nextLocation.pathname,r)||t.nextLocation.pathname;return lt(o.pathname,i)!=null||lt(o.pathname,a)!=null}const Dl=({variant:e="fixed",activeTab:n,navItems:t,onTabChange:r,className:o="",activeClass:a="",buttonClass:i=""})=>{let l="flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4";return e==="fixed"?l+=" fixed bottom-0 left-0 right-0":e==="floating"?l+=" fixed bottom-4 left-4 right-4 rounded-full":e==="static"&&(l+=" static"),s.jsx("nav",{className:`${l} ${o}`,children:t.map(c=>{const u=c.label===n;return s.jsxs(an,{to:c.path,onClick:()=>r(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${i}`,children:[s.jsx("span",{className:`text-xl ${u?`text-color-blue-500 ${a}`:""}`,children:c.icon}),s.jsx("span",{className:`text-xs font-medium mt-1 ${u?`text-color-blue-500 ${a}`:""}`,children:c.label})]},c.label)})})},Tl=({items:e,separator:n="/",className:t=""})=>s.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:s.jsx("ol",{className:"flex items-center space-x-1",children:e.map((r,o)=>s.jsxs("li",{className:"flex items-center",children:[r.href?s.jsx("a",{href:r.href,className:"text-color-gray-800 hover:underline font-medium",children:r.label}):s.jsx("span",{className:"text-color-gray-500 font-medium",children:r.label}),o<e.length-1&&s.jsx("span",{className:"mx-2 text-color-gray-400",children:n})]},o))})}),qr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],zl=["Su","Mo","Tu","We","Th","Fr","Sa"],Ol=({mode:e="single",type:n="inline",showTime:t=!1,onlyTime:r=!1,className:o,onChange:a,placeholder:i="Select date",icon:l=s.jsx("svg",{className:"text-color-gray-500 size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M7 3V1H9V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V9H20V5H17V7H15V5H9V7H7V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7ZM17 12C14.7909 12 13 13.7909 13 16C13 18.2091 14.7909 20 17 20C19.2091 20 21 18.2091 21 16C21 13.7909 19.2091 12 17 12ZM11 16C11 12.6863 13.6863 10 17 10C20.3137 10 23 12.6863 23 16C23 19.3137 20.3137 22 17 22C13.6863 22 11 19.3137 11 16ZM16 13V16.4142L18.2929 18.7071L19.7071 17.2929L18 15.5858V13H16Z"})}),disableBefore:c,disableAfter:u,selectedDate:d})=>{const[g,p]=w.useState(!1),[f,v]=w.useState(null),[m,b]=w.useState(new Date),[x,R]=w.useState(d?new Date(d):null),[y,E]=w.useState(null),[C,V]=w.useState(null),[T,B]=w.useState(null),[A,X]=w.useState({hour:12,minute:0,ampm:"AM"}),ae=w.useRef(null),[se,ee]=w.useState(d?new Date(d):null),[q,K]=w.useState(null),[O,ne]=w.useState(null);w.useEffect(()=>{R(d?new Date(d):null),ee(d?new Date(d):null)},[d]);const ue=j=>{j.stopPropagation(),v(j.currentTarget),p(!0)},J=()=>{p(!1)},h=j=>!!(c&&j.getTime()<c||u&&j.getTime()>u),S=j=>{n==="inline"&&ae.current&&!ae.current.contains(j.target)&&(e==="single"?x||R(null):e==="range"&&(!y||!C)&&(E(null),V(null)),p(!1))};w.useEffect(()=>(g?document.addEventListener("mousedown",S):document.removeEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}),[g]);const F=j=>{!j||h(j)||(e==="single"?R(j):e==="range"&&(!y||y&&C?(E(j),V(null)):j>=y?V(j):E(j)))},L=j=>{if(!j||h(j)){B(null);return}e==="range"&&y&&!C&&B(j)},D=()=>{B(null)},H=()=>{if(p(!1),e==="single"){const j=r?new Date:x,k=j?new Date(j.getFullYear(),j.getMonth(),j.getDate(),A.ampm==="PM"&&A.hour!==12?A.hour+12:A.ampm==="AM"&&A.hour===12?0:A.hour,A.minute):null;ee(k),a==null||a(k?k.getTime():null)}else e==="range"&&(K(y),ne(C),a==null||a({startDate:y?y.getTime():null,endDate:C?C.getTime():null}))},z=()=>{const j=new Date(m.getFullYear(),m.getMonth(),1),k=new Date(m.getFullYear(),m.getMonth()+1,0),_=[],Q=j.getDay();for(let te=0;te<Q;te++)_.push(null);for(let te=1;te<=k.getDate();te++)_.push(new Date(m.getFullYear(),m.getMonth(),te));return _},P=j=>{if(!j)return!1;if(e==="single")return(x==null?void 0:x.toDateString())===j.toDateString();if(e==="range"){if(y&&!C&&T){const k=y<T?y:T,_=y<T?T:y;return j>=k&&j<=_}return y&&C&&j>=y&&j<=C}return!1},M=(j,k)=>{if(!j)return e==="range"?k==="end"?"End Date":"Start Date":r?`${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`:i;if(r)return`${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`;const _=j.getDate().toString().padStart(2,"0"),Q=qr[j.getMonth()],te=j.getFullYear(),ce=t?` ${String(A.hour).padStart(2,"0")}:${String(A.minute).padStart(2,"0")} ${A.ampm}`:"";return`${_} ${Q} ${te}${ce}`},G=s.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[s.jsx("select",{value:A.hour,onChange:j=>X({...A,hour:parseInt(j.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0",children:Array.from({length:12},(j,k)=>k+1).map(j=>s.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),s.jsx("select",{value:A.minute,onChange:j=>X({...A,minute:parseInt(j.target.value)}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:Array.from({length:60},(j,k)=>k).map(j=>s.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),s.jsxs("select",{value:A.ampm,onChange:j=>X({...A,ampm:j.target.value}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[s.jsx("option",{value:"AM",children:"AM"}),s.jsx("option",{value:"PM",children:"PM"})]})]}),W=s.jsxs("div",{ref:ae,className:`${n==="dialog"?"relative w-full":"absolute z-50 mt-2 w-72 rounded-lg border border-color-gray-200 bg-color-white shadow-xl p-4"}`,style:n==="dialog"?void 0:{position:"absolute",left:f==null?void 0:f.getBoundingClientRect().left,top:f?f.getBoundingClientRect().bottom+window.scrollY:0},children:[!r&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx(we,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()-1,1)),icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("select",{className:"text-sm outline-none",value:m.getMonth(),onChange:j=>b(new Date(m.getFullYear(),parseInt(j.target.value),1)),children:qr.map((j,k)=>s.jsx("option",{value:k,children:j},j))}),s.jsx("select",{className:"text-sm outline-none",value:m.getFullYear(),onChange:j=>b(new Date(parseInt(j.target.value),m.getMonth(),1)),children:Array.from({length:150},(j,k)=>new Date().getFullYear()-100+k).map(j=>s.jsx("option",{value:j,children:j},j))})]}),s.jsx(we,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()+1,1)),icon:s.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})})})]}),s.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[zl.map(j=>s.jsx("div",{className:"font-semibold",children:j},j)),z().map((j,k)=>s.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
|
|
187
187
|
${j?"hover:bg-color-blue-100 cursor-pointer":""}
|
|
188
188
|
${j&&P(j)?"bg-color-blue-500 hover:bg-color-blue-500 text-color-white":""}
|
|
189
|
-
${j&&h(j)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>j&&F(j),onMouseEnter:()=>j&&L(j),onMouseLeave:D,children:j?j.getDate():""},k))]})]}),(t||r)&&G,s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsx(Ye,{fullWidth:!0,onClick:H,disabled:e==="range"&&!C&&!r,className:`${e==="range"&&!C&&!r?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return s.jsxs("div",{className:"relative",children:[s.jsxs(Ye,{onClick:ue,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${o||""}`,children:[e==="single"?se?M(se):i:y||q||O?s.jsxs(s.Fragment,{children:[M(y||q,"start")," -"," ",M(C||O,"end")]}):i,l]}),n==="inline"?s.jsx(s.Fragment,{children:g&&Te.createPortal(W,document.body)}):s.jsx(Sr,{open:g,title:r?"Select Time":i,onClose:J,children:s.jsx("div",{className:"w-72",children:W})})]})},
|
|
189
|
+
${j&&h(j)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>j&&F(j),onMouseEnter:()=>j&&L(j),onMouseLeave:D,children:j?j.getDate():""},k))]})]}),(t||r)&&G,s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsx(Ye,{fullWidth:!0,onClick:H,disabled:e==="range"&&!C&&!r,className:`${e==="range"&&!C&&!r?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return s.jsxs("div",{className:"relative",children:[s.jsxs(Ye,{onClick:ue,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${o||""}`,children:[e==="single"?se?M(se):i:y||q||O?s.jsxs(s.Fragment,{children:[M(y||q,"start")," -"," ",M(C||O,"end")]}):i,l]}),n==="inline"?s.jsx(s.Fragment,{children:g&&Te.createPortal(W,document.body)}):s.jsx(Sr,{open:g,title:r?"Select Time":i,onClose:J,children:s.jsx("div",{className:"w-72",children:W})})]})},Il=({tabs:e,activeKey:n,onChange:t,className:r="",tabsClass:o="",tabItemClass:a="",tabContentClass:i="",variant:l="horizontal"})=>{const c=e.find(d=>d.key===n),u=l==="vertical";return s.jsxs("div",{className:`w-full flex ${u?"flex-row":"flex-col"} ${r}`,children:[s.jsx("div",{className:`${u?"flex flex-col min-w-[160px] border-r border-color-gray-200":"flex space-x-6 border-b border-color-gray-200"} ${o}`,children:e.map(d=>{const g=n===d.key;return s.jsxs("button",{onClick:()=>t(d.key),className:`relative flex ${u?"flex-row items-center px-4 py-3":"flex-col items-center py-4"}
|
|
190
190
|
text-sm font-medium transition-color duration-200 bg-color-transparent
|
|
191
191
|
${g?"text-color-blue-500":"text-color-gray-600 hover:text-color-blue-500 cursor-pointer"}
|
|
192
|
-
${a}`,children:[s.jsxs("div",{className:`flex items-center ${u?"space-x-3":"space-x-2"}`,children:[d.icon&&s.jsx("span",{children:d.icon}),s.jsx("span",{children:d.label})]}),g&&(u?s.jsx("div",{className:"absolute right-0 top-3 bottom-3 w-1 bg-color-blue-500 rounded-full"}):s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-color-blue-500 rounded-full"}))]},d.key)})}),s.jsx("div",{className:`mt-4 ${u?"ml-6 mt-0":""} ${i}`,children:c==null?void 0:c.content})]})},
|
|
193
|
-
md:p-2 not-last:pb-4 w-full h-full ${t.className}`,children:[s.jsx("div",{className:`p-2 ${t.accentColor} ${t.accentBackground} flex-shrink-0 flex items-center justify-center p-4 text-md rounded-lg`,children:t.icon}),s.jsxs("div",{className:"flex flex-col justify-center gap-1 w-full ",children:[s.jsx("div",{className:"text-sm",children:t.name}),s.jsx("div",{className:`text-xl ${t.accentColor} font-semibold`,children:t.value})]})]},r))})});function
|
|
192
|
+
${a}`,children:[s.jsxs("div",{className:`flex items-center ${u?"space-x-3":"space-x-2"}`,children:[d.icon&&s.jsx("span",{children:d.icon}),s.jsx("span",{children:d.label})]}),g&&(u?s.jsx("div",{className:"absolute right-0 top-3 bottom-3 w-1 bg-color-blue-500 rounded-full"}):s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-color-blue-500 rounded-full"}))]},d.key)})}),s.jsx("div",{className:`mt-4 ${u?"ml-6 mt-0":""} ${i}`,children:c==null?void 0:c.content})]})},Vl=({stats:e=[],className:n=""})=>s.jsx(Cr,{className:`w-full ${n}`,children:s.jsx("div",{className:"grid grid-columns-1 sm:grid-columns-1 md:grid-columns-2 lg:grid-columns-4 gap-4 justify-items-center",children:e.map((t,r)=>s.jsxs("div",{className:`flex items-center justify-center gap-4 lg:not-last:border-r md:not-last:border-r md:nth-2:border-r-0 md:not-last:border-b-0 not-last:border-b border-color-gray-200
|
|
193
|
+
md:p-2 not-last:pb-4 w-full h-full ${t.className}`,children:[s.jsx("div",{className:`p-2 ${t.accentColor} ${t.accentBackground} flex-shrink-0 flex items-center justify-center p-4 text-md rounded-lg`,children:t.icon}),s.jsxs("div",{className:"flex flex-col justify-center gap-1 w-full ",children:[s.jsx("div",{className:"text-sm",children:t.name}),s.jsx("div",{className:`text-xl ${t.accentColor} font-semibold`,children:t.value})]})]},r))})});function Hl({items:e=[],logoJSX:n,position:t,defaultActive:r,open:o=!0,onClose:a,onItemSelect:i}){const[l,c]=w.useState(r),u=d=>{c(d),d.onClick&&d.onClick(),i&&i(d)};return s.jsx(s.Fragment,{children:s.jsx(jr,{open:o,onClose:a,anchor:t,showCloseIcon:!1,children:s.jsxs("div",{className:"",children:[n&&s.jsx("div",{className:"pb-6",children:n}),s.jsx("nav",{className:"space-y-2 text-sm font-medium text-color-gray-700",children:e.map(d=>d.href?s.jsxs(Hr,{to:d.href,className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
|
|
194
194
|
${d.label===(l==null?void 0:l.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600"}
|
|
195
195
|
`,onClick:()=>u(d),children:[s.jsx("span",{className:"text-lg",children:d.icon}),s.jsx("span",{children:d.label})]},d.label):s.jsxs("button",{onClick:()=>u(d),className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
|
|
196
196
|
${d.label===(l==null?void 0:l.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600 bg-color-transparent"}
|
|
197
|
-
`,children:[s.jsx("span",{className:"text-lg",children:d.icon}),s.jsx("span",{children:d.label})]}))})]})})})}I.Accordion=
|
|
197
|
+
`,children:[s.jsx("span",{className:"text-lg",children:d.icon}),s.jsx("span",{children:d.label})]}))})]})})})}I.Accordion=gi,I.ActionMenu=fi,I.Alert=bi,I.Avatar=Ft,I.Badge=wi,I.BottomNavigation=Dl,I.Breadcrumbs=Tl,I.Button=Ye,I.COLOR_MAP=fe,I.Card=Cr,I.CardWrapper=Xr,I.Carousel=ni,I.Checkbox=Jr,I.DashboardStatBoxes=Vl,I.DatePicker=Ol,I.Dialog=Sr,I.Divider=li,I.Drawer=jr,I.Dropdown=Qr,I.DropzoneUploader=oa,I.EmptyState=ri,I.IconButton=we,I.List=Ua,I.ListItem=Ya,I.Menu=Qn,I.OtpInput=er,I.Pagination=gr,I.PasswordInput=tr,I.Pill=da,I.ProfileImageShowcase=pa,I.Progress=ei,I.RANGE_COLOR_MAP=Ue,I.RadioGroup=si,I.Rating=ti,I.Select=ci,I.Sidebar=Hl,I.Skeleton=Za,I.Slider=Ja,I.Snackbar=Qa,I.Stepper=fa,I.Table=Wa,I.Tabs=Il,I.TextArea=Ka,I.TextInput=Lt,I.ToggleButton=ii,I.ToggleSwitch=oi,I.Tooltip=ui,I.Typography=mr,I.extendColorMap=Zr,I.extendRangeColorMap=Kr,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
|