@unizap/uniui 1.0.34 → 1.0.36

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.
@@ -80,7 +80,7 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var k=j(_,G,A,O,N+"."+G,
80
80
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ao(e){if(Array.isArray(e))return st(e)}function cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function un(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?cn(Object(t),!0).forEach(function(o){pn(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function pn(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Pe(e,n){return zo(e)||Do(e,n)||dn(e,n)||No()}function No(){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 dn(e,n){if(e){if(typeof e=="string")return st(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 st(e,n)}}function st(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function Do(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],r=!0,i=!1,l,s;try{for(t=t.call(e);!(r=(l=t.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&t.return!=null&&t.return()}finally{if(i)throw s}}return o}}function zo(e){if(Array.isArray(e))return e}var To=typeof lt=="function"?lt:lt.default,Oo="file-invalid-type",Io="file-too-large",Vo="file-too-small",Ho="too-many-files",Bo=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=n.split(","),o=t.length>1?"one of ".concat(t.join(", ")):t[0];return{code:Oo,message:"File type must be ".concat(o)}},fn=function(n){return{code:Io,message:"File is larger than ".concat(n," ").concat(n===1?"byte":"bytes")}},gn=function(n){return{code:Vo,message:"File is smaller than ".concat(n," ").concat(n===1?"byte":"bytes")}},qo={code:Ho,message:"Too many files"};function mn(e,n){var t=e.type==="application/x-moz-file"||To(e,n);return[t,t?null:Bo(n)]}function xn(e,n,t){if(ke(e.size))if(ke(n)&&ke(t)){if(e.size>t)return[!1,fn(t)];if(e.size<n)return[!1,gn(n)]}else{if(ke(n)&&e.size<n)return[!1,gn(n)];if(ke(t)&&e.size>t)return[!1,fn(t)]}return[!0,null]}function ke(e){return e!=null}function Go(e){var n=e.files,t=e.accept,o=e.minSize,r=e.maxSize,i=e.multiple,l=e.maxFiles,s=e.validator;return!i&&n.length>1||i&&l>=1&&n.length>l?!1:n.every(function(c){var p=mn(c,t),u=Pe(p,1),v=u[0],f=xn(c,o,r),d=Pe(f,1),x=d[0],m=s?s(c):null;return v&&x&&!m})}function He(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Be(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 vn(e){e.preventDefault()}function Zo(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Yo(e){return e.indexOf("Edge/")!==-1}function Wo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Zo(e)||Yo(e)}function we(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];return n.some(function(s){return!He(o)&&s&&s.apply(void 0,[o].concat(i)),He(o)})}}function Uo(){return"showOpenFilePicker"in window}function Ko(e){if(ke(e)){var n=Object.entries(e).filter(function(t){var o=Pe(t,2),r=o[0],i=o[1],l=!0;return hn(r)||(console.warn('Skipped "'.concat(r,'" 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.')),l=!1),(!Array.isArray(i)||!i.every(bn))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),l=!1),l}).reduce(function(t,o){var r=Pe(o,2),i=r[0],l=r[1];return un(un({},t),{},pn({},i,l))},{});return[{description:"Files",accept:n}]}return e}function Xo(e){if(ke(e))return Object.entries(e).reduce(function(n,t){var o=Pe(t,2),r=o[0],i=o[1];return[].concat(sn(n),[r],sn(i))},[]).filter(function(n){return hn(n)||bn(n)}).join(",")}function Jo(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 hn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function bn(e){return/^.*\.[\w]+$/.test(e)}var er=["children"],tr=["open"],nr=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],or=["refKey","onChange","onClick"];function rr(e){return lr(e)||ar(e)||wn(e)||ir()}function ir(){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 ar(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lr(e){if(Array.isArray(e))return ut(e)}function ct(e,n){return ur(e)||cr(e,n)||wn(e,n)||sr()}function sr(){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 wn(e,n){if(e){if(typeof e=="string")return ut(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 ut(e,n)}}function ut(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function cr(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],r=!0,i=!1,l,s;try{for(t=t.call(e);!(r=(l=t.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&t.return!=null&&t.return()}finally{if(i)throw s}}return o}}function ur(e){if(Array.isArray(e))return e}function yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function ae(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?yn(Object(t),!0).forEach(function(o){pt(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function pt(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function qe(e,n){if(e==null)return{};var t=pr(e,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function pr(e,n){if(e==null)return{};var t={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(t[r]=e[r]);return t}var dt=h.forwardRef(function(e,n){var t=e.children,o=qe(e,er),r=Sn(o),i=r.open,l=qe(r,tr);return h.useImperativeHandle(n,function(){return{open:i}},[i]),h.createElement(h.Fragment,null,t(ae(ae({},l),{},{open:i})))});dt.displayName="Dropzone";var Cn={disabled:!1,getFilesFromEvent:yo,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};dt.defaultProps=Cn,dt.propTypes={children:re.func,accept:re.objectOf(re.arrayOf(re.string)),multiple:re.bool,preventDropOnDocument:re.bool,noClick:re.bool,noKeyboard:re.bool,noDrag:re.bool,noDragEventsBubbling:re.bool,minSize:re.number,maxSize:re.number,maxFiles:re.number,disabled:re.bool,getFilesFromEvent:re.func,onFileDialogCancel:re.func,onFileDialogOpen:re.func,useFsAccessApi:re.bool,autoFocus:re.bool,onDragEnter:re.func,onDragLeave:re.func,onDragOver:re.func,onDrop:re.func,onDropAccepted:re.func,onDropRejected:re.func,onError:re.func,validator:re.func};var ft={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Sn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=ae(ae({},Cn),e),t=n.accept,o=n.disabled,r=n.getFilesFromEvent,i=n.maxSize,l=n.minSize,s=n.multiple,c=n.maxFiles,p=n.onDragEnter,u=n.onDragLeave,v=n.onDragOver,f=n.onDrop,d=n.onDropAccepted,x=n.onDropRejected,m=n.onFileDialogCancel,b=n.onFileDialogOpen,S=n.useFsAccessApi,M=n.autoFocus,y=n.preventDropOnDocument,L=n.noClick,w=n.noKeyboard,H=n.noDrag,I=n.noDragEventsBubbling,q=n.onError,z=n.validator,te=h.useMemo(function(){return Xo(t)},[t]),ie=h.useMemo(function(){return Ko(t)},[t]),le=h.useMemo(function(){return typeof b=="function"?b:jn},[b]),K=h.useMemo(function(){return typeof m=="function"?m:jn},[m]),V=h.useRef(null),U=h.useRef(null),T=h.useReducer(dr,ft),ee=ct(T,2),ce=ee[0],X=ee[1],g=ce.isFocused,C=ce.isFileDialogActive,P=h.useRef(typeof window<"u"&&window.isSecureContext&&S&&Uo()),E=function(){!P.current&&C&&setTimeout(function(){if(U.current){var Z=U.current.files;Z.length||(X({type:"closeDialog"}),K())}},300)};h.useEffect(function(){return window.addEventListener("focus",E,!1),function(){window.removeEventListener("focus",E,!1)}},[U,C,K,P]);var A=h.useRef([]),O=function(Z){V.current&&V.current.contains(Z.target)||(Z.preventDefault(),A.current=[])};h.useEffect(function(){return y&&(document.addEventListener("dragover",vn,!1),document.addEventListener("drop",O,!1)),function(){y&&(document.removeEventListener("dragover",vn),document.removeEventListener("drop",O))}},[V,y]),h.useEffect(function(){return!o&&M&&V.current&&V.current.focus(),function(){}},[V,M,o]);var N=h.useCallback(function(F){q?q(F):console.error(F)},[q]),_=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F),A.current=[].concat(rr(A.current),[F.target]),Be(F)&&Promise.resolve(r(F)).then(function(Z){if(!(He(F)&&!I)){var pe=Z.length,fe=pe>0&&Go({files:Z,accept:te,minSize:l,maxSize:i,multiple:s,maxFiles:c,validator:z}),ve=pe>0&&!fe;X({isDragAccept:fe,isDragReject:ve,isDragActive:!0,type:"setDraggedFiles"}),p&&p(F)}}).catch(function(Z){return N(Z)})},[r,p,N,I,te,l,i,s,c,z]),R=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F);var Z=Be(F);if(Z&&F.dataTransfer)try{F.dataTransfer.dropEffect="copy"}catch{}return Z&&v&&v(F),!1},[v,I]),B=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F);var Z=A.current.filter(function(fe){return V.current&&V.current.contains(fe)}),pe=Z.indexOf(F.target);pe!==-1&&Z.splice(pe,1),A.current=Z,!(Z.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Be(F)&&u&&u(F))},[V,u,I]),G=h.useCallback(function(F,Z){var pe=[],fe=[];F.forEach(function(ve){var Ae=mn(ve,te),_e=ct(Ae,2),Pt=_e[0],Lt=_e[1],Ft=xn(ve,l,i),Je=ct(Ft,2),At=Je[0],Nt=Je[1],Dt=z?z(ve):null;if(Pt&&At&&!Dt)pe.push(ve);else{var zt=[Lt,Nt];Dt&&(zt=zt.concat(Dt)),fe.push({file:ve,errors:zt.filter(function(Oi){return Oi})})}}),(!s&&pe.length>1||s&&c>=1&&pe.length>c)&&(pe.forEach(function(ve){fe.push({file:ve,errors:[qo]})}),pe.splice(0)),X({acceptedFiles:pe,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),f&&f(pe,fe,Z),fe.length>0&&x&&x(fe,Z),pe.length>0&&d&&d(pe,Z)},[X,s,te,l,i,c,f,d,x,z]),j=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F),A.current=[],Be(F)&&Promise.resolve(r(F)).then(function(Z){He(F)&&!I||G(Z,F)}).catch(function(Z){return N(Z)}),X({type:"reset"})},[r,G,N,I]),k=h.useCallback(function(){if(P.current){X({type:"openDialog"}),le();var F={multiple:s,types:ie};window.showOpenFilePicker(F).then(function(Z){return r(Z)}).then(function(Z){G(Z,null),X({type:"closeDialog"})}).catch(function(Z){Jo(Z)?(K(Z),X({type:"closeDialog"})):Qo(Z)?(P.current=!1,U.current?(U.current.value=null,U.current.click()):N(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."))):N(Z)});return}U.current&&(X({type:"openDialog"}),le(),U.current.value=null,U.current.click())},[X,le,K,S,G,N,ie,s]),$=h.useCallback(function(F){!V.current||!V.current.isEqualNode(F.target)||(F.key===" "||F.key==="Enter"||F.keyCode===32||F.keyCode===13)&&(F.preventDefault(),k())},[V,k]),J=h.useCallback(function(){X({type:"focus"})},[]),Q=h.useCallback(function(){X({type:"blur"})},[]),se=h.useCallback(function(){L||(Wo()?setTimeout(k,0):k())},[L,k]),ue=function(Z){return o?null:Z},me=function(Z){return w?null:ue(Z)},Ke=function(Z){return H?null:ue(Z)},Xe=function(Z){I&&Z.stopPropagation()},Di=h.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Z=F.refKey,pe=Z===void 0?"ref":Z,fe=F.role,ve=F.onKeyDown,Ae=F.onFocus,_e=F.onBlur,Pt=F.onClick,Lt=F.onDragEnter,Ft=F.onDragOver,Je=F.onDragLeave,At=F.onDrop,Nt=qe(F,nr);return ae(ae(pt({onKeyDown:me(we(ve,$)),onFocus:me(we(Ae,J)),onBlur:me(we(_e,Q)),onClick:ue(we(Pt,se)),onDragEnter:Ke(we(Lt,_)),onDragOver:Ke(we(Ft,R)),onDragLeave:Ke(we(Je,B)),onDrop:Ke(we(At,j)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},pe,V),!o&&!w?{tabIndex:0}:{}),Nt)}},[V,$,J,Q,se,_,R,B,j,w,H,o]),zi=h.useCallback(function(F){F.stopPropagation()},[]),Ti=h.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Z=F.refKey,pe=Z===void 0?"ref":Z,fe=F.onChange,ve=F.onClick,Ae=qe(F,or),_e=pt({accept:te,multiple:s,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:ue(we(fe,j)),onClick:ue(we(ve,zi)),tabIndex:-1},pe,U);return ae(ae({},_e),Ae)}},[U,t,s,j,o]);return ae(ae({},ce),{},{isFocused:g&&!o,getRootProps:Di,getInputProps:Ti,rootRef:V,inputRef:U,open:ue(k)})}function dr(e,n){switch(n.type){case"focus":return ae(ae({},e),{},{isFocused:!0});case"blur":return ae(ae({},e),{},{isFocused:!1});case"openDialog":return ae(ae({},ft),{},{isFileDialogActive:!0});case"closeDialog":return ae(ae({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ae(ae({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return ae(ae({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return ae({},ft);default:return e}}function jn(){}const fr=({onFilesAccepted:e,onError:n,accept:t={"image/*":[],"application/pdf":[],"application/msword":[],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[]},multiple:o=!1,maxSizeInBytes:r=1*1024*1024,maxFiles:i=void 0,disabled:l=!1,label:s="Upload PDF",subLabel:c="Maximum size: 2 MB",icon:p=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"})}),wrapperClass:u="",iconClass:v="",labelClass:f="",subLabelClass:d="",showList:x=!0,listView:m=!0,showListImage:b=!1,uploadedFiles:S=[],onDeleteCallback:M=()=>{}})=>{const[y,L]=h.useState(S),[w,H]=h.useState([]);h.useEffect(()=>{(S.length!==y.length||S.some((K,V)=>K!==y[V]))&&L(S)},[S]);const I=h.useCallback((K,V)=>{const U=[];if(V.length>0&&V.forEach(T=>{T.errors.forEach(ee=>{ee.code==="file-too-large"&&U.push(`${T.file.name} is too large (max ${(r/1024/1024).toFixed(2)}MB)`),ee.code==="file-invalid-type"&&U.push(`${T.file.name} has an invalid file type`)})}),i!==void 0&&(o?y.length:0)+K.length>i&&U.push(`You can only upload up to ${i} file${i>1?"s":""}.`),U.length>0){H(U),n==null||n(U);return}else H([]);K.length>0&&(L(T=>o?[...T,...K]:K),e(K))},[e,n,r,i,y,o]),q=K=>{L(V=>V.filter((U,T)=>T!==K)),M(y)},{getRootProps:z,getInputProps:te,isDragActive:ie,isDragReject:le}=Sn({onDrop:I,accept:t,multiple:o,maxSize:r,disabled:l});return a.jsxs("div",{className:`
83
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wn(e,n){if(e){if(typeof e=="string")return ut(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 ut(e,n)}}function ut(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,o=new Array(n);t<n;t++)o[t]=e[t];return o}function cr(e,n){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var o=[],r=!0,i=!1,l,s;try{for(t=t.call(e);!(r=(l=t.next()).done)&&(o.push(l.value),!(n&&o.length===n));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&t.return!=null&&t.return()}finally{if(i)throw s}}return o}}function ur(e){if(Array.isArray(e))return e}function yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function ae(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?yn(Object(t),!0).forEach(function(o){pt(e,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yn(Object(t)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))})}return e}function pt(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function qe(e,n){if(e==null)return{};var t=pr(e,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(t[o]=e[o])}return t}function pr(e,n){if(e==null)return{};var t={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(t[r]=e[r]);return t}var dt=h.forwardRef(function(e,n){var t=e.children,o=qe(e,er),r=Sn(o),i=r.open,l=qe(r,tr);return h.useImperativeHandle(n,function(){return{open:i}},[i]),h.createElement(h.Fragment,null,t(ae(ae({},l),{},{open:i})))});dt.displayName="Dropzone";var Cn={disabled:!1,getFilesFromEvent:yo,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};dt.defaultProps=Cn,dt.propTypes={children:re.func,accept:re.objectOf(re.arrayOf(re.string)),multiple:re.bool,preventDropOnDocument:re.bool,noClick:re.bool,noKeyboard:re.bool,noDrag:re.bool,noDragEventsBubbling:re.bool,minSize:re.number,maxSize:re.number,maxFiles:re.number,disabled:re.bool,getFilesFromEvent:re.func,onFileDialogCancel:re.func,onFileDialogOpen:re.func,useFsAccessApi:re.bool,autoFocus:re.bool,onDragEnter:re.func,onDragLeave:re.func,onDragOver:re.func,onDrop:re.func,onDropAccepted:re.func,onDropRejected:re.func,onError:re.func,validator:re.func};var ft={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Sn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=ae(ae({},Cn),e),t=n.accept,o=n.disabled,r=n.getFilesFromEvent,i=n.maxSize,l=n.minSize,s=n.multiple,c=n.maxFiles,p=n.onDragEnter,u=n.onDragLeave,v=n.onDragOver,f=n.onDrop,d=n.onDropAccepted,x=n.onDropRejected,m=n.onFileDialogCancel,b=n.onFileDialogOpen,S=n.useFsAccessApi,M=n.autoFocus,y=n.preventDropOnDocument,L=n.noClick,w=n.noKeyboard,H=n.noDrag,I=n.noDragEventsBubbling,q=n.onError,z=n.validator,te=h.useMemo(function(){return Xo(t)},[t]),ie=h.useMemo(function(){return Ko(t)},[t]),le=h.useMemo(function(){return typeof b=="function"?b:jn},[b]),K=h.useMemo(function(){return typeof m=="function"?m:jn},[m]),V=h.useRef(null),U=h.useRef(null),T=h.useReducer(dr,ft),ee=ct(T,2),ce=ee[0],X=ee[1],g=ce.isFocused,C=ce.isFileDialogActive,P=h.useRef(typeof window<"u"&&window.isSecureContext&&S&&Uo()),E=function(){!P.current&&C&&setTimeout(function(){if(U.current){var Z=U.current.files;Z.length||(X({type:"closeDialog"}),K())}},300)};h.useEffect(function(){return window.addEventListener("focus",E,!1),function(){window.removeEventListener("focus",E,!1)}},[U,C,K,P]);var A=h.useRef([]),O=function(Z){V.current&&V.current.contains(Z.target)||(Z.preventDefault(),A.current=[])};h.useEffect(function(){return y&&(document.addEventListener("dragover",vn,!1),document.addEventListener("drop",O,!1)),function(){y&&(document.removeEventListener("dragover",vn),document.removeEventListener("drop",O))}},[V,y]),h.useEffect(function(){return!o&&M&&V.current&&V.current.focus(),function(){}},[V,M,o]);var N=h.useCallback(function(F){q?q(F):console.error(F)},[q]),_=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F),A.current=[].concat(rr(A.current),[F.target]),Be(F)&&Promise.resolve(r(F)).then(function(Z){if(!(He(F)&&!I)){var pe=Z.length,fe=pe>0&&Go({files:Z,accept:te,minSize:l,maxSize:i,multiple:s,maxFiles:c,validator:z}),ve=pe>0&&!fe;X({isDragAccept:fe,isDragReject:ve,isDragActive:!0,type:"setDraggedFiles"}),p&&p(F)}}).catch(function(Z){return N(Z)})},[r,p,N,I,te,l,i,s,c,z]),R=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F);var Z=Be(F);if(Z&&F.dataTransfer)try{F.dataTransfer.dropEffect="copy"}catch{}return Z&&v&&v(F),!1},[v,I]),B=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F);var Z=A.current.filter(function(fe){return V.current&&V.current.contains(fe)}),pe=Z.indexOf(F.target);pe!==-1&&Z.splice(pe,1),A.current=Z,!(Z.length>0)&&(X({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Be(F)&&u&&u(F))},[V,u,I]),G=h.useCallback(function(F,Z){var pe=[],fe=[];F.forEach(function(ve){var Ae=mn(ve,te),_e=ct(Ae,2),Pt=_e[0],Lt=_e[1],Ft=xn(ve,l,i),Je=ct(Ft,2),At=Je[0],Nt=Je[1],Dt=z?z(ve):null;if(Pt&&At&&!Dt)pe.push(ve);else{var zt=[Lt,Nt];Dt&&(zt=zt.concat(Dt)),fe.push({file:ve,errors:zt.filter(function(Vi){return Vi})})}}),(!s&&pe.length>1||s&&c>=1&&pe.length>c)&&(pe.forEach(function(ve){fe.push({file:ve,errors:[qo]})}),pe.splice(0)),X({acceptedFiles:pe,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),f&&f(pe,fe,Z),fe.length>0&&x&&x(fe,Z),pe.length>0&&d&&d(pe,Z)},[X,s,te,l,i,c,f,d,x,z]),j=h.useCallback(function(F){F.preventDefault(),F.persist(),Xe(F),A.current=[],Be(F)&&Promise.resolve(r(F)).then(function(Z){He(F)&&!I||G(Z,F)}).catch(function(Z){return N(Z)}),X({type:"reset"})},[r,G,N,I]),k=h.useCallback(function(){if(P.current){X({type:"openDialog"}),le();var F={multiple:s,types:ie};window.showOpenFilePicker(F).then(function(Z){return r(Z)}).then(function(Z){G(Z,null),X({type:"closeDialog"})}).catch(function(Z){Jo(Z)?(K(Z),X({type:"closeDialog"})):Qo(Z)?(P.current=!1,U.current?(U.current.value=null,U.current.click()):N(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."))):N(Z)});return}U.current&&(X({type:"openDialog"}),le(),U.current.value=null,U.current.click())},[X,le,K,S,G,N,ie,s]),$=h.useCallback(function(F){!V.current||!V.current.isEqualNode(F.target)||(F.key===" "||F.key==="Enter"||F.keyCode===32||F.keyCode===13)&&(F.preventDefault(),k())},[V,k]),J=h.useCallback(function(){X({type:"focus"})},[]),Q=h.useCallback(function(){X({type:"blur"})},[]),se=h.useCallback(function(){L||(Wo()?setTimeout(k,0):k())},[L,k]),ue=function(Z){return o?null:Z},me=function(Z){return w?null:ue(Z)},Ke=function(Z){return H?null:ue(Z)},Xe=function(Z){I&&Z.stopPropagation()},Ti=h.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Z=F.refKey,pe=Z===void 0?"ref":Z,fe=F.role,ve=F.onKeyDown,Ae=F.onFocus,_e=F.onBlur,Pt=F.onClick,Lt=F.onDragEnter,Ft=F.onDragOver,Je=F.onDragLeave,At=F.onDrop,Nt=qe(F,nr);return ae(ae(pt({onKeyDown:me(we(ve,$)),onFocus:me(we(Ae,J)),onBlur:me(we(_e,Q)),onClick:ue(we(Pt,se)),onDragEnter:Ke(we(Lt,_)),onDragOver:Ke(we(Ft,R)),onDragLeave:Ke(we(Je,B)),onDrop:Ke(we(At,j)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},pe,V),!o&&!w?{tabIndex:0}:{}),Nt)}},[V,$,J,Q,se,_,R,B,j,w,H,o]),Oi=h.useCallback(function(F){F.stopPropagation()},[]),Ii=h.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Z=F.refKey,pe=Z===void 0?"ref":Z,fe=F.onChange,ve=F.onClick,Ae=qe(F,or),_e=pt({accept:te,multiple:s,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:ue(we(fe,j)),onClick:ue(we(ve,Oi)),tabIndex:-1},pe,U);return ae(ae({},_e),Ae)}},[U,t,s,j,o]);return ae(ae({},ce),{},{isFocused:g&&!o,getRootProps:Ti,getInputProps:Ii,rootRef:V,inputRef:U,open:ue(k)})}function dr(e,n){switch(n.type){case"focus":return ae(ae({},e),{},{isFocused:!0});case"blur":return ae(ae({},e),{},{isFocused:!1});case"openDialog":return ae(ae({},ft),{},{isFileDialogActive:!0});case"closeDialog":return ae(ae({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ae(ae({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return ae(ae({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:n.isDragReject});case"reset":return ae({},ft);default:return e}}function jn(){}const fr=({onFilesAccepted:e,onError:n,accept:t={"image/*":[],"application/pdf":[],"application/msword":[],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[]},multiple:o=!1,maxSizeInBytes:r=1*1024*1024,maxFiles:i=void 0,disabled:l=!1,label:s="Upload PDF",subLabel:c="Maximum size: 2 MB",icon:p=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M3 19H21V21H3V19ZM13 5.82843V17H11V5.82843L4.92893 11.8995L3.51472 10.4853L12 2L20.4853 10.4853L19.0711 11.8995L13 5.82843Z"})}),wrapperClass:u="",iconClass:v="",labelClass:f="",subLabelClass:d="",showList:x=!0,listView:m=!0,showListImage:b=!1,uploadedFiles:S=[],onDeleteCallback:M=()=>{}})=>{const[y,L]=h.useState(S),[w,H]=h.useState([]);h.useEffect(()=>{(S.length!==y.length||S.some((K,V)=>K!==y[V]))&&L(S)},[S]);const I=h.useCallback((K,V)=>{const U=[];if(V.length>0&&V.forEach(T=>{T.errors.forEach(ee=>{ee.code==="file-too-large"&&U.push(`${T.file.name} is too large (max ${(r/1024/1024).toFixed(2)}MB)`),ee.code==="file-invalid-type"&&U.push(`${T.file.name} has an invalid file type`)})}),i!==void 0&&(o?y.length:0)+K.length>i&&U.push(`You can only upload up to ${i} file${i>1?"s":""}.`),U.length>0){H(U),n==null||n(U);return}else H([]);K.length>0&&(L(T=>o?[...T,...K]:K),e(K))},[e,n,r,i,y,o]),q=K=>{L(V=>V.filter((U,T)=>T!==K)),M(y)},{getRootProps:z,getInputProps:te,isDragActive:ie,isDragReject:le}=Sn({onDrop:I,accept:t,multiple:o,maxSize:r,disabled:l});return a.jsxs("div",{className:`
84
84
  border border-style-dashed rounded-lg p-0 overflow-hidden transition
85
85
  ${ie?"border-color-blue-500 bg-color-blue-50":"border-color-gray-200 bg-color-gray-50"}
86
86
  ${le?"border-color-red-500 bg-color-red-50":""}
@@ -94,7 +94,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
94
94
  ${xr[c]}
95
95
  ${mr[p]}
96
96
  ${n}
97
- `,value:t[b]||"",onChange:S=>d(S,b),onKeyDown:S=>x(S,b),...u},b))})});$n.displayName="OtpInput";const vr={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},hr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},gt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",className:r="",inputClass:i="",iconStyle:l="",startIcon:s,endIcon:c,error:p,maxLength:u,label:v,labelClassName:f="",variant:d="outlined",size:x="medium",...m},b)=>{const S=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",M=p?"text-color-red-500":l;return a.jsxs("div",{className:"w-full",children:[v&&a.jsx("label",{className:`text-sm text-color-gray-500 mb-2 block ${f}`,children:v}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${S} ${hr[d]} ${r}`,children:[s&&a.jsx("span",{className:`pl-3 ${M}`,children:s}),a.jsx("input",{...m,ref:b,type:o,placeholder:e,defaultValue:n,maxLength:u,onChange:t,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${vr[x]} ${i}`}),c&&a.jsx("span",{className:`pr-3 ${M}`,children:c})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});gt.displayName="TextInput";const _n=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(gt,{...e,ref:n,type:t?"text":"password",inputClass:e.inputClass,startIcon:e.startIcon??a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9V10ZM5 12V20H19V12H5ZM11 14H13V18H11V14ZM17 10V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V10H17Z"})}),endIcon:a.jsx("span",{onClick:()=>o(!t),className:"cursor-pointer",children:t?a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"})}):a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968ZM5.9356 7.3497C4.60673 8.56015 3.6378 10.1672 3.22278 12.0002C4.14022 16.0521 7.7646 19.0002 12.0003 19.0002C13.5997 19.0002 15.112 18.5798 16.4243 17.8384L14.396 15.8101C13.7023 16.2472 12.8808 16.5002 12.0003 16.5002C9.51498 16.5002 7.50026 14.4854 7.50026 12.0002C7.50026 11.1196 7.75317 10.2981 8.19031 9.60442L5.9356 7.3497ZM12.9139 14.328L9.67246 11.0866C9.5613 11.3696 9.50026 11.6777 9.50026 12.0002C9.50026 13.3809 10.6196 14.5002 12.0003 14.5002C12.3227 14.5002 12.6309 14.4391 12.9139 14.328ZM20.8068 16.5925L19.376 15.1617C20.0319 14.2268 20.5154 13.1586 20.7777 12.0002C19.8603 7.94818 16.2359 5.00016 12.0003 5.00016C11.1544 5.00016 10.3329 5.11773 9.55249 5.33818L7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925ZM11.7229 7.50857C11.8146 7.50299 11.9071 7.50016 12.0003 7.50016C14.4855 7.50016 16.5003 9.51488 16.5003 12.0002C16.5003 12.0933 16.4974 12.1858 16.4919 12.2775L11.7229 7.50857Z"})})})})});_n.displayName="PasswordInput";const mt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var p;const s={small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-base",large:"w-14 h-14 text-lg","extra-large":"w-20 h-20 text-xl"},c={circle:"rounded-full",rounded:"rounded-md",square:"rounded-none"};return a.jsx("div",{className:`inline-flex items-center justify-center font-medium overflow-hidden ${s[t]} ${c[l]} ${de[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((p=n==null?void 0:n[0])==null?void 0:p.toUpperCase())||"?"})},he=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...p})=>{var d;const u=h.useRef(null),v=x=>{const m=u.current;if(!m)return;const b=document.createElement("span"),S=m.getBoundingClientRect(),M=Math.max(S.width,S.height);b.style.width=b.style.height=`${M}px`,b.style.left=`${x.clientX-S.left-M/2}px`,b.style.top=`${x.clientY-S.top-M/2}px`,b.className="ripple_small",m.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},f=((d=de[n])==null?void 0:d[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:v,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
97
+ `,value:t[b]||"",onChange:S=>d(S,b),onKeyDown:S=>x(S,b),...u},b))})});$n.displayName="OtpInput";const vr={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},hr={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-200 bg-color-transparent"},gt=h.forwardRef(({placeholder:e,value:n,onChange:t,type:o="text",className:r="",inputClass:i="",iconStyle:l="",startIcon:s,endIcon:c,error:p,maxLength:u,label:v,labelClassName:f="",variant:d="outlined",size:x="medium",...m},b)=>{const S=p?"border-color-red-500 focus-within:ring-color-red-500":"border-color-gray-200",M=p?"text-color-red-500":l;return a.jsxs("div",{className:"w-full",children:[v&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${f}`,children:v}),a.jsxs("div",{className:`flex items-center w-full rounded-md border focus-within:ring-1 ${S} ${hr[d]} ${r}`,children:[s&&a.jsx("span",{className:`pl-3 ${M}`,children:s}),a.jsx("input",{...m,ref:b,type:o,placeholder:e,defaultValue:n,maxLength:u,onChange:t,className:`grow outline-0 w-full font-medium placeholder:font-normal bg-color-transparent ${vr[x]} ${i}`}),c&&a.jsx("span",{className:`pr-3 ${M}`,children:c})]}),p&&a.jsx("p",{className:"text-color-red-500 text-xs mt-1",children:p})]})});gt.displayName="TextInput";const _n=h.forwardRef((e,n)=>{const[t,o]=h.useState(!1);return a.jsx(gt,{...e,ref:n,label:e.label,type:t?"text":"password",inputClass:e.inputClass,startIcon:e.startIcon??a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9V10ZM5 12V20H19V12H5ZM11 14H13V18H11V14ZM17 10V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V10H17Z"})}),endIcon:a.jsx("span",{onClick:()=>o(!t),className:"cursor-pointer",children:t?a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z"})}):a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968ZM5.9356 7.3497C4.60673 8.56015 3.6378 10.1672 3.22278 12.0002C4.14022 16.0521 7.7646 19.0002 12.0003 19.0002C13.5997 19.0002 15.112 18.5798 16.4243 17.8384L14.396 15.8101C13.7023 16.2472 12.8808 16.5002 12.0003 16.5002C9.51498 16.5002 7.50026 14.4854 7.50026 12.0002C7.50026 11.1196 7.75317 10.2981 8.19031 9.60442L5.9356 7.3497ZM12.9139 14.328L9.67246 11.0866C9.5613 11.3696 9.50026 11.6777 9.50026 12.0002C9.50026 13.3809 10.6196 14.5002 12.0003 14.5002C12.3227 14.5002 12.6309 14.4391 12.9139 14.328ZM20.8068 16.5925L19.376 15.1617C20.0319 14.2268 20.5154 13.1586 20.7777 12.0002C19.8603 7.94818 16.2359 5.00016 12.0003 5.00016C11.1544 5.00016 10.3329 5.11773 9.55249 5.33818L7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925ZM11.7229 7.50857C11.8146 7.50299 11.9071 7.50016 12.0003 7.50016C14.4855 7.50016 16.5003 9.51488 16.5003 12.0002C16.5003 12.0933 16.4974 12.1858 16.4919 12.2775L11.7229 7.50857Z"})})})})});_n.displayName="PasswordInput";const mt=({src:e,alt:n,size:t="medium",fallback:o,className:r="",color:i="pearl",shape:l="circle"})=>{var p;const s={small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-base",large:"w-14 h-14 text-lg","extra-large":"w-20 h-20 text-xl"},c={circle:"rounded-full",rounded:"rounded-md",square:"rounded-none"};return a.jsx("div",{className:`inline-flex items-center justify-center font-medium overflow-hidden ${s[t]} ${c[l]} ${de[i].filled} ${r}`,children:e?a.jsx("img",{src:e,alt:n,className:`object-cover w-full h-full ${c[l]}`}):o||((p=n==null?void 0:n[0])==null?void 0:p.toUpperCase())||"?"})},he=({variant:e="filled",color:n="blue",icon:t,onClick:o,className:r="",disabled:i=!1,roundedFull:l=!1,size:s="medium",autoFocus:c=!1,...p})=>{var d;const u=h.useRef(null),v=x=>{const m=u.current;if(!m)return;const b=document.createElement("span"),S=m.getBoundingClientRect(),M=Math.max(S.width,S.height);b.style.width=b.style.height=`${M}px`,b.style.left=`${x.clientX-S.left-M/2}px`,b.style.top=`${x.clientY-S.top-M/2}px`,b.className="ripple_small",m.appendChild(b),setTimeout(()=>b.remove(),600),o==null||o(x)},f=((d=de[n])==null?void 0:d[e==="filled"?"filled":e==="outlined"?"outline":"transparent"])||"";return a.jsx("button",{ref:u,type:"button",disabled:i,onClick:v,className:`relative overflow-hidden flex items-center justify-center gap-1 transition-all focus:outline-0
98
98
  ${f}
99
99
  ${e==="outlined"&&"border"}
100
100
  ${r}
@@ -129,7 +129,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
129
129
  50% { transform: translateX(100%); }
130
130
  100% { transform: translateX(100%); }
131
131
  }
132
- `})]})})},ri=({label:e,error:n,className:t="",inputClass:o="",labelClass:r="",...i})=>a.jsxs("div",{className:`flex flex-col gap-1 ${t}`,children:[e&&a.jsx("label",{className:`text-sm font-medium ${r}`,children:e}),a.jsx("textarea",{className:`border border-color-gray-300 rounded-md px-3 py-2 resize-none focus:ring-1 focus:outline-none ${o}`,...i}),n&&a.jsx("span",{className:"text-xs text-color-red-500",children:n})]}),qn={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 ii(e){const n=h.useRef(null),t=h.useRef(null),o=h.useRef(null),r=(c,p)=>{if(c===p)return!0;if(Array.isArray(c)&&Array.isArray(p)){if(c.length!==p.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==p[u])return!1;return!0}return!1},i=h.useCallback(c=>{e&&(r(c,o.current)||(o.current=c,e(c)))},[e]),l=h.useCallback(c=>{t.current=c,n.current==null&&(n.current=requestAnimationFrame(()=>{n.current=null,t.current!=null&&i(t.current)}))},[i]),s=h.useCallback(()=>{n.current!=null&&cancelAnimationFrame(n.current),n.current=null},[]);return{schedule:l,flush:i,cancel:s,last:t}}const ai=h.memo(function({value:n,defaultValue:t,onChange:o,onChangeEnd:r,min:i=0,max:l=100,step:s=1,color:c="blue",size:p="medium",disabled:u=!1,className:v="",showValue:f=!0,showMarks:d=!1,marks:x=[],range:m=!1,minDistance:b=0}){const S=n!==void 0,[M,y]=h.useState(()=>t!==void 0?t:m?[i,l]:i),L=S?n:M,w=Array.isArray(L)?L[0]:L,[H,I]=Array.isArray(L)?L:[L,L],q=De[c]||De.blue,z=qn[p]??qn.medium,te=h.useCallback($=>($-i)/(l-i)*100,[i,l]),ie=te(w),le=te(H),K=te(I),V=h.useCallback($=>Math.max(i,Math.min(l,$)),[i,l]),U=h.useCallback($=>Math.round($/s)*s,[s]),T=ii(o),ee=h.useCallback(($,J=!0)=>{S||y($),J?T.schedule($):T.flush($)},[S,T]),ce=h.useCallback(()=>{const $=T.last.current;$!=null&&(T.flush($),r==null||r($))},[T,r]),X=h.useCallback(($,J)=>{if(m&&Array.isArray($)){let[Q,se]=$,ue=U(V(Q)),me=U(V(se));return me-ue<b&&(J==="min"?me=V(ue+b):J==="max"&&(ue=V(me-b))),ue>me&&(J==="min"?ue=me:me=ue),[ue,me]}else if(!m&&typeof $=="number")return U(V($));return $},[m,V,U,b]),g=h.useRef(null),C=h.useCallback($=>{var se;const J=(se=g.current)==null?void 0:se.getBoundingClientRect();if(!J)return m?i:w;const Q=Math.max(0,Math.min(1,($-J.left)/J.width));return i+Q*(l-i)},[i,l,m,w]),P=h.useCallback($=>{const J=Math.abs($-H),Q=Math.abs($-I);return J<=Q?"min":"max"},[H,I]),[E,A]=h.useState(null),[O,N]=h.useState(null),[_,R]=h.useState(null),B=h.useCallback(($,J)=>{var se,ue;if(u)return;$.preventDefault(),(ue=(se=$.currentTarget).setPointerCapture)==null||ue.call(se,$.pointerId),R($.pointerId);const Q=C($.clientX);if(m){const me=J||P(Q);A(me),ee(me==="min"?X([Q,I],"min"):X([H,Q],"max"))}else A("single"),ee(X(Q,"single"))},[u,m,C,P,X,H,I,ee]),G=h.useCallback($=>{if(u||_==null||E==null)return;const J=C($.clientX);m?E==="min"?ee(X([J,I],"min")):E==="max"&&ee(X([H,J],"max")):ee(X(J,"single"))},[u,_,E,m,C,X,H,I,ee]),j=h.useCallback(()=>{E!=null&&(A(null),R(null),ce())},[E,ce]),k=h.useCallback(($,J)=>{if(u)return;const Q=m?J==="min"?H:I:w;let se=Q;const ue=(l-i)/10;switch($.key){case"ArrowLeft":case"ArrowDown":se=Q-s;break;case"ArrowRight":case"ArrowUp":se=Q+s;break;case"PageDown":se=Q-ue;break;case"PageUp":se=Q+ue;break;case"Home":se=i;break;case"End":se=l;break;default:return}$.preventDefault(),ee(m?J==="min"?X([se,I],"min"):X([H,se],"max"):X(se,"single"),!1),r==null||r(S?n:L)},[u,m,w,H,I,s,i,l,X,ee,r,S,n,L]);return h.useEffect(()=>{if(!E)return;const $=document.body.style.userSelect;return document.body.style.userSelect="none",()=>{document.body.style.userSelect=$}},[E]),a.jsx("div",{className:`w-full ${v}`,children:a.jsxs("div",{className:"relative flex items-center",children:[m&&a.jsx("div",{className:"mr-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem]",children:a.jsx("div",{className:"range-min",children:a.jsx("div",{children:H})})}),a.jsxs("div",{className:"w-full",children:[a.jsxs("div",{ref:g,className:`
132
+ `})]})})},ri={small:"p-2 text-sm",medium:"p-3 text-base",large:"p-4 text-lg"},ii={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border border-color-gray-200 bg-color-transparent"},ai=({label:e,error:n,className:t="",inputClass:o="",labelClass:r="",variant:i="outlined",size:l="medium",...s})=>a.jsxs("div",{className:`flex flex-col gap-1 ${t}`,children:[e&&a.jsx("label",{className:`text-sm font-medium text-color-gray-700 mb-1 block ${r}`,children:e}),a.jsx("textarea",{className:`
133
+ rounded-md resize-none focus:ring-1 focus:outline-none
134
+ ${ri[l]}
135
+ ${ii[i]}
136
+ ${n?"border-color-red-500":""}
137
+ ${o}
138
+ `,...s}),n&&a.jsx("span",{className:"text-xs text-color-red-500",children:n})]}),qn={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 li(e){const n=h.useRef(null),t=h.useRef(null),o=h.useRef(null),r=(c,p)=>{if(c===p)return!0;if(Array.isArray(c)&&Array.isArray(p)){if(c.length!==p.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==p[u])return!1;return!0}return!1},i=h.useCallback(c=>{e&&(r(c,o.current)||(o.current=c,e(c)))},[e]),l=h.useCallback(c=>{t.current=c,n.current==null&&(n.current=requestAnimationFrame(()=>{n.current=null,t.current!=null&&i(t.current)}))},[i]),s=h.useCallback(()=>{n.current!=null&&cancelAnimationFrame(n.current),n.current=null},[]);return{schedule:l,flush:i,cancel:s,last:t}}const si=h.memo(function({value:n,defaultValue:t,onChange:o,onChangeEnd:r,min:i=0,max:l=100,step:s=1,color:c="blue",size:p="medium",disabled:u=!1,className:v="",showValue:f=!0,showMarks:d=!1,marks:x=[],range:m=!1,minDistance:b=0}){const S=n!==void 0,[M,y]=h.useState(()=>t!==void 0?t:m?[i,l]:i),L=S?n:M,w=Array.isArray(L)?L[0]:L,[H,I]=Array.isArray(L)?L:[L,L],q=De[c]||De.blue,z=qn[p]??qn.medium,te=h.useCallback($=>($-i)/(l-i)*100,[i,l]),ie=te(w),le=te(H),K=te(I),V=h.useCallback($=>Math.max(i,Math.min(l,$)),[i,l]),U=h.useCallback($=>Math.round($/s)*s,[s]),T=li(o),ee=h.useCallback(($,J=!0)=>{S||y($),J?T.schedule($):T.flush($)},[S,T]),ce=h.useCallback(()=>{const $=T.last.current;$!=null&&(T.flush($),r==null||r($))},[T,r]),X=h.useCallback(($,J)=>{if(m&&Array.isArray($)){let[Q,se]=$,ue=U(V(Q)),me=U(V(se));return me-ue<b&&(J==="min"?me=V(ue+b):J==="max"&&(ue=V(me-b))),ue>me&&(J==="min"?ue=me:me=ue),[ue,me]}else if(!m&&typeof $=="number")return U(V($));return $},[m,V,U,b]),g=h.useRef(null),C=h.useCallback($=>{var se;const J=(se=g.current)==null?void 0:se.getBoundingClientRect();if(!J)return m?i:w;const Q=Math.max(0,Math.min(1,($-J.left)/J.width));return i+Q*(l-i)},[i,l,m,w]),P=h.useCallback($=>{const J=Math.abs($-H),Q=Math.abs($-I);return J<=Q?"min":"max"},[H,I]),[E,A]=h.useState(null),[O,N]=h.useState(null),[_,R]=h.useState(null),B=h.useCallback(($,J)=>{var se,ue;if(u)return;$.preventDefault(),(ue=(se=$.currentTarget).setPointerCapture)==null||ue.call(se,$.pointerId),R($.pointerId);const Q=C($.clientX);if(m){const me=J||P(Q);A(me),ee(me==="min"?X([Q,I],"min"):X([H,Q],"max"))}else A("single"),ee(X(Q,"single"))},[u,m,C,P,X,H,I,ee]),G=h.useCallback($=>{if(u||_==null||E==null)return;const J=C($.clientX);m?E==="min"?ee(X([J,I],"min")):E==="max"&&ee(X([H,J],"max")):ee(X(J,"single"))},[u,_,E,m,C,X,H,I,ee]),j=h.useCallback(()=>{E!=null&&(A(null),R(null),ce())},[E,ce]),k=h.useCallback(($,J)=>{if(u)return;const Q=m?J==="min"?H:I:w;let se=Q;const ue=(l-i)/10;switch($.key){case"ArrowLeft":case"ArrowDown":se=Q-s;break;case"ArrowRight":case"ArrowUp":se=Q+s;break;case"PageDown":se=Q-ue;break;case"PageUp":se=Q+ue;break;case"Home":se=i;break;case"End":se=l;break;default:return}$.preventDefault(),ee(m?J==="min"?X([se,I],"min"):X([H,se],"max"):X(se,"single"),!1),r==null||r(S?n:L)},[u,m,w,H,I,s,i,l,X,ee,r,S,n,L]);return h.useEffect(()=>{if(!E)return;const $=document.body.style.userSelect;return document.body.style.userSelect="none",()=>{document.body.style.userSelect=$}},[E]),a.jsx("div",{className:`w-full ${v}`,children:a.jsxs("div",{className:"relative flex items-center",children:[m&&a.jsx("div",{className:"mr-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem]",children:a.jsx("div",{className:"range-min",children:a.jsx("div",{children:H})})}),a.jsxs("div",{className:"w-full",children:[a.jsxs("div",{ref:g,className:`
133
139
  relative w-full ${z.track} ${q.track} rounded-full
134
140
  ${u?"opacity-60 cursor-not-allowed":"cursor-pointer"}
135
141
  `,onPointerDown:$=>B($),onPointerMove:G,onPointerUp:j,onPointerCancel:j,children:[m?a.jsx("div",{className:`absolute top-0 ${z.track} ${q.progress} rounded-full ${E?"":"transition-all duration-150"}`,style:{left:`${le}%`,width:`${K-le}%`}}):a.jsx("div",{className:`absolute top-0 left-0 ${z.track} ${q.progress} rounded-full ${E?"":"transition-all duration-150"}`,style:{width:`${ie}%`}}),d&&x.map(($,J)=>{const Q=te($.value);return a.jsx("div",{className:"absolute top-1/2 transform -translate-y-1/2 w-1 h-1 bg-gray-400 rounded-full",style:{left:`${Q}%`}},J)}),!m&&a.jsx("div",{className:`
@@ -153,34 +159,34 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
153
159
  ${E==="max"?"cursor-grabbing scale-110 z-20":E?"":"transition-all duration-150"}
154
160
  ${O==="max"?"ring-2 ring-offset-1 ring-blue-300":""}
155
161
  shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
156
- `,style:{left:`${K}%`},tabIndex:u?-1:0,role:"slider","aria-orientation":"horizontal","aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-disabled":u,"aria-label":"Maximum value",onKeyDown:$=>k($,"max"),onFocus:()=>N("max"),onBlur:()=>N(null),onPointerDown:$=>B($,"max")})]})]}),d&&x.length>0&&a.jsx("div",{className:"relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",children:x.map(($,J)=>{const Q=te($.value);return a.jsx("div",{className:"absolute transform -translate-x-1/2 text-xs",style:{left:`${Q}%`},children:$.label||$.value},J)})})]}),f&&a.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?a.jsx("div",{className:"range-max",children:a.jsx("div",{children:I})}):a.jsx("span",{children:w})})]})})}),li=({open:e=!1,message:n,autoHideDuration:t=4e3,position:o="bottom-center",color:r="dark",onClose:i,action:l,className:s=""})=>{var v;h.useEffect(()=>{if(e&&t>0&&i){const f=setTimeout(()=>{i()},t);return()=>clearTimeout(f)}},[e,t,i]),h.useEffect(()=>{const f=d=>{d.key==="Escape"&&e&&i&&i()};if(e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,i]);const c=h.useCallback(()=>{i&&i()},[i]),p=f=>{const d="fixed z-50 transform transition-all duration-300 ease-in-out";switch(f){case"top-center":return`${d} top-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-left":return`${d} top-4 left-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-right":return`${d} top-4 right-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"bottom-left":return`${d} bottom-4 left-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-right":return`${d} bottom-4 right-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-center":default:return`${d} bottom-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`}},u=(v=de[r])==null?void 0:v.filled;return e?a.jsxs(a.Fragment,{children:[e&&a.jsx("div",{className:"fixed inset-0 z-40 bg-color-black/10 backdrop-blur-[1px] md:hidden",onClick:c}),a.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
- ${p(o)} ${u} ${s}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[a.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:n}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l&&a.jsx("div",{className:"flex items-center",children:l}),i&&a.jsx(he,{color:"light",size:"small",icon:a.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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},si=({variant:e="linear",value:n=0,color:t="blue",determinate:o=!0,className:r="",...i})=>{var v,f;const l="inline-block",s=(v=de[t])==null?void 0:v.transparent,c=(f=de[t])==null?void 0:f.filled,p=Math.min(Math.max(n,0),100);if(e==="circular"){const{size:d=40,thickness:x=3.6}=i,m=(d-x)/2,b=2*Math.PI*m,S=`${b} ${b}`,M=b-p/100*b;return a.jsx("div",{className:`${l} ${r}`,style:{width:d,height:d},role:"progressbar","aria-valuenow":o?p:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsxs("svg",{className:"transform -rotate-90",width:d,height:d,viewBox:`0 0 ${d} ${d}`,children:[a.jsx("circle",{cx:d/2,cy:d/2,r:m,stroke:"currentColor",strokeWidth:x,fill:"none",className:"text-color-gray-200 dark:text-color-gray-700"}),a.jsx("circle",{cx:d/2,cy:d/2,r:m,stroke:"currentColor",strokeWidth:x,fill:"none",strokeLinecap:"round",className:`${s} ${o?"":"animate-circular"}`,style:{strokeDasharray:S,strokeDashoffset:o?M:b*.75,transformOrigin:"center"}})]})})}const{thickness:u=4}=i;return a.jsx("div",{className:`${l} w-full ${r}`,role:"progressbar","aria-valuenow":o?p:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"w-full bg-color-gray-200 dark:bg-color-gray-700 rounded-full overflow-hidden relative",style:{height:`${u}px`},children:o?a.jsx("div",{className:`h-full ${c} transition-all duration-300 ease-out`,style:{width:`${p}%`}}):a.jsx("div",{className:`absolute left-0 top-0 h-full ${c} animate-progress-indeterminate-gpu`,style:{width:"40%"}})})})},Gn=a.jsx("svg",{className:"w-5 h-5 fill-color-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:a.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"})}),Zn=a.jsx("svg",{className:"w-5 h-5 fill-color-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 20 20",children:a.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"})}),Ue={small:"w-4 h-4",medium:"w-6 h-6",large:"w-8 h-8"},ci=({value:e,onChange:n,readOnly:t=!1,disabled:o=!1,precision:r=1,max:i=5,size:l="medium",icon:s,emptyIcon:c,className:p="",showHoverValue:u=!1,showValue:v=!1,labels:f={}})=>{const[d,x]=h.useState(null),m=(y,L)=>{if(t||o||!n)return;const{left:w,width:H}=y.target.getBoundingClientRect(),I=(y.clientX-w)/H;let q=L-1+Math.ceil(I/r)*r;q=Math.min(i,Math.max(r,Math.round(q/r)*r)),n(q)},b=(y,L)=>{if(t||o)return;const{left:w,width:H}=y.target.getBoundingClientRect(),I=(y.clientX-w)/H;let q=L-1+Math.ceil(I/r)*r;q=Math.min(i,Math.max(r,Math.round(q/r)*r)),x(q)},S=()=>x(null),M=[];for(let y=1;y<=i;y++){let L=(d!==null?d:e)>=y,w=!L&&(d!==null?d:e)>y-1,H=L?s||h.cloneElement(Gn,{className:`fill-color-yellow-500 ${Ue[l]}`}):c||h.cloneElement(Zn,{className:`stroke-color-gray-300 ${Ue[l]}`});if(w){const I=((d!==null?d:e)-(y-1))*100;H=a.jsxs("span",{className:"relative block",children:[a.jsx("span",{className:"absolute top-0 left-0 overflow-hidden",style:{width:`${I}%`},children:s||h.cloneElement(Gn,{className:`fill-color-yellow-500 ${Ue[l]}`})}),c||h.cloneElement(Zn,{className:`stroke-color-gray-300 ${Ue[l]}`})]})}M.push(a.jsx("span",{className:`inline-block ${o?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:I=>m(I,y),onMouseMove:I=>b(I,y),onMouseLeave:S,tabIndex:t||o?-1:0,"aria-label":`Rate ${y}`,role:"radio","aria-checked":e===y,children:H},y))}return a.jsxs("div",{className:`flex items-center gap-1 ${p}`,role:"radiogroup","aria-disabled":o,children:[M,u&&d!==null?a.jsx("span",{className:"ml-2 text-xs text-gray-500",children:f[d]||d}):v?a.jsx("span",{className:"ml-2 text-xs text-gray-500",children:f[e]||e}):null]})},ui=({children:e,width:n="100%",height:t="auto",showIndicators:o=!0,showArrows:r=!0,autoplay:i=!1,interval:l=3e3,infiniteLoop:s=!1,perview:c=1,gap:p=0,onClickItem:u,showThumbs:v=!1,pauseOnHover:f=!1,swipeable:d=!0,thumbWidth:x=60,orientation:m="horizontal",nextIcon:b,prevIcon:S,className:M})=>{const y=e.length,L=Math.min(Math.max(c,.1),y),[w,H]=h.useState(0),[I,q]=h.useState(!1),[z,te]=h.useState(!1),[ie,le]=h.useState(0),K=h.useRef(null),V=h.useRef(0),U=h.useRef(0),T=L>=y?0:Math.max(0,y-L),ee=_=>Math.max(0,Math.min(_,T)),ce=_=>H(s&&T>0?(_%(T+1)+(T+1))%(T+1):ee(_)),X=()=>{s&&T>0?H(w===0?T:w-1):ce(w-1)},g=()=>{s&&T>0?H(w>=T?0:w+1):ce(w+1)};h.useEffect(()=>{if(!i||f&&I||z||T===0)return;const _=setInterval(()=>{H(R=>{const B=R+1;return B>T?s?0:R:B})},l);return()=>clearInterval(_)},[i,l,I,f,z,T,s]);const C=(_,R)=>{!d||T===0||(te(!0),V.current=m==="horizontal"?_:R,U.current=V.current)},P=(_,R)=>{z&&(U.current=m==="horizontal"?_:R,le(U.current-V.current))},E=()=>{if(!z)return;Math.abs(U.current-V.current)>50&&(U.current<V.current?g():X()),te(!1),le(0)},A=()=>{const _=m==="horizontal"?"X":"Y";let R=0;if(z&&K.current&&T>0){const J=m==="horizontal"?K.current.offsetWidth:K.current.offsetHeight;R=ie/J*100*(L/y)}const G=Math.min(w,T)*(100/y)-R,j=w>=T,$=w<=0?0:j?p/(c/2):p/c;return`translate${_}(calc(-${G}% - ${$}px))`},O=()=>L>=y?1:Math.floor(T)+1,N=()=>T===0?0:Math.round(w/T*(O()-1));return a.jsxs("div",{className:`relative flex flex-col items-center select-none ${M}`,style:{width:n,height:t},onMouseEnter:()=>f&&q(!0),onMouseLeave:()=>f&&q(!1),children:[a.jsxs("div",{ref:K,className:`w-full overflow-hidden relative ${d&&T>0?z?"cursor-grabbing":"cursor-grab":"cursor-default"}`,style:{height:v?`calc(${t} - ${x+20}px)`:t},onMouseDown:_=>{_.preventDefault(),C(_.clientX,_.clientY)},onMouseMove:_=>P(_.clientX,_.clientY),onMouseUp:E,onMouseLeave:E,onTouchStart:_=>C(_.touches[0].clientX,_.touches[0].clientY),onTouchMove:_=>P(_.touches[0].clientX,_.touches[0].clientY),onTouchEnd:E,children:[a.jsx("div",{className:`flex ${m==="horizontal"?"flex-row":"flex-col"} transition-transform duration-300 ease-in-out`,style:{width:m==="horizontal"?`${y*100/L}%`:"100%",height:m==="vertical"?`${y*100/L}%`:"100%",transform:A(),gap:`${p}px`,transitionProperty:z?"none":"transform"},children:e.map((_,R)=>a.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:m==="horizontal"?`calc(${100/y}% - ${p/c}px)`:"100%",height:m==="vertical"?`calc(${100/y}% - ${p*(y-1)/y}px)`:"100%"},onClick:()=>!z&&(u==null?void 0:u(R)),children:_},R))}),r&&T>0&&a.jsxs(a.Fragment,{children:[a.jsx("button",{"aria-label":"prev",onClick:X,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
162
+ `,style:{left:`${K}%`},tabIndex:u?-1:0,role:"slider","aria-orientation":"horizontal","aria-valuemin":i,"aria-valuemax":l,"aria-valuenow":I,"aria-disabled":u,"aria-label":"Maximum value",onKeyDown:$=>k($,"max"),onFocus:()=>N("max"),onBlur:()=>N(null),onPointerDown:$=>B($,"max")})]})]}),d&&x.length>0&&a.jsx("div",{className:"relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",children:x.map(($,J)=>{const Q=te($.value);return a.jsx("div",{className:"absolute transform -translate-x-1/2 text-xs",style:{left:`${Q}%`},children:$.label||$.value},J)})})]}),f&&a.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?a.jsx("div",{className:"range-max",children:a.jsx("div",{children:I})}):a.jsx("span",{children:w})})]})})}),ci=({open:e=!1,message:n,autoHideDuration:t=4e3,position:o="bottom-center",color:r="dark",onClose:i,action:l,className:s=""})=>{var v;h.useEffect(()=>{if(e&&t>0&&i){const f=setTimeout(()=>{i()},t);return()=>clearTimeout(f)}},[e,t,i]),h.useEffect(()=>{const f=d=>{d.key==="Escape"&&e&&i&&i()};if(e)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,i]);const c=h.useCallback(()=>{i&&i()},[i]),p=f=>{const d="fixed z-50 transform transition-all duration-300 ease-in-out";switch(f){case"top-center":return`${d} top-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-left":return`${d} top-4 left-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"top-right":return`${d} top-4 right-4 ${e?"translate-y-0 opacity-100":"-translate-y-full opacity-0"}`;case"bottom-left":return`${d} bottom-4 left-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-right":return`${d} bottom-4 right-4 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`;case"bottom-center":default:return`${d} bottom-4 left-1/2 -translate-x-1/2 ${e?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`}},u=(v=de[r])==null?void 0:v.filled;return e?a.jsxs(a.Fragment,{children:[e&&a.jsx("div",{className:"fixed inset-0 z-40 bg-color-black/10 backdrop-blur-[1px] md:hidden",onClick:c}),a.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
163
+ ${p(o)} ${u} ${s}`,role:"alert","aria-live":"assertive","aria-atomic":"true",children:[a.jsx("span",{className:"flex-1 text-sm font-medium leading-relaxed",children:n}),a.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l&&a.jsx("div",{className:"flex items-center",children:l}),i&&a.jsx(he,{color:"light",size:"small",icon:a.jsx("svg",{className:"size-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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},ui=({variant:e="linear",value:n=0,color:t="blue",determinate:o=!0,className:r="",...i})=>{var v,f;const l="inline-block",s=(v=de[t])==null?void 0:v.transparent,c=(f=de[t])==null?void 0:f.filled,p=Math.min(Math.max(n,0),100);if(e==="circular"){const{size:d=40,thickness:x=3.6}=i,m=(d-x)/2,b=2*Math.PI*m,S=`${b} ${b}`,M=b-p/100*b;return a.jsx("div",{className:`${l} ${r}`,style:{width:d,height:d},role:"progressbar","aria-valuenow":o?p:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsxs("svg",{className:"transform -rotate-90",width:d,height:d,viewBox:`0 0 ${d} ${d}`,children:[a.jsx("circle",{cx:d/2,cy:d/2,r:m,stroke:"currentColor",strokeWidth:x,fill:"none",className:"text-color-gray-200 dark:text-color-gray-700"}),a.jsx("circle",{cx:d/2,cy:d/2,r:m,stroke:"currentColor",strokeWidth:x,fill:"none",strokeLinecap:"round",className:`${s} ${o?"":"animate-circular"}`,style:{strokeDasharray:S,strokeDashoffset:o?M:b*.75,transformOrigin:"center"}})]})})}const{thickness:u=4}=i;return a.jsx("div",{className:`${l} w-full ${r}`,role:"progressbar","aria-valuenow":o?p:void 0,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"w-full bg-color-gray-200 dark:bg-color-gray-700 rounded-full overflow-hidden relative",style:{height:`${u}px`},children:o?a.jsx("div",{className:`h-full ${c} transition-all duration-300 ease-out`,style:{width:`${p}%`}}):a.jsx("div",{className:`absolute left-0 top-0 h-full ${c} animate-progress-indeterminate-gpu`,style:{width:"40%"}})})})},Gn=a.jsx("svg",{className:"w-5 h-5 fill-color-yellow-500",fill:"currentColor",viewBox:"0 0 20 20",children:a.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"})}),Zn=a.jsx("svg",{className:"w-5 h-5 fill-color-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 20 20",children:a.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"})}),Ue={small:"w-4 h-4",medium:"w-6 h-6",large:"w-8 h-8"},pi=({value:e,onChange:n,readOnly:t=!1,disabled:o=!1,precision:r=1,max:i=5,size:l="medium",icon:s,emptyIcon:c,className:p="",showHoverValue:u=!1,showValue:v=!1,labels:f={}})=>{const[d,x]=h.useState(null),m=(y,L)=>{if(t||o||!n)return;const{left:w,width:H}=y.target.getBoundingClientRect(),I=(y.clientX-w)/H;let q=L-1+Math.ceil(I/r)*r;q=Math.min(i,Math.max(r,Math.round(q/r)*r)),n(q)},b=(y,L)=>{if(t||o)return;const{left:w,width:H}=y.target.getBoundingClientRect(),I=(y.clientX-w)/H;let q=L-1+Math.ceil(I/r)*r;q=Math.min(i,Math.max(r,Math.round(q/r)*r)),x(q)},S=()=>x(null),M=[];for(let y=1;y<=i;y++){let L=(d!==null?d:e)>=y,w=!L&&(d!==null?d:e)>y-1,H=L?s||h.cloneElement(Gn,{className:`fill-color-yellow-500 ${Ue[l]}`}):c||h.cloneElement(Zn,{className:`stroke-color-gray-300 ${Ue[l]}`});if(w){const I=((d!==null?d:e)-(y-1))*100;H=a.jsxs("span",{className:"relative block",children:[a.jsx("span",{className:"absolute top-0 left-0 overflow-hidden",style:{width:`${I}%`},children:s||h.cloneElement(Gn,{className:`fill-color-yellow-500 ${Ue[l]}`})}),c||h.cloneElement(Zn,{className:`stroke-color-gray-300 ${Ue[l]}`})]})}M.push(a.jsx("span",{className:`inline-block ${o?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:I=>m(I,y),onMouseMove:I=>b(I,y),onMouseLeave:S,tabIndex:t||o?-1:0,"aria-label":`Rate ${y}`,role:"radio","aria-checked":e===y,children:H},y))}return a.jsxs("div",{className:`flex items-center gap-1 ${p}`,role:"radiogroup","aria-disabled":o,children:[M,u&&d!==null?a.jsx("span",{className:"ml-2 text-xs text-gray-500",children:f[d]||d}):v?a.jsx("span",{className:"ml-2 text-xs text-gray-500",children:f[e]||e}):null]})},di=({children:e,width:n="100%",height:t="auto",showIndicators:o=!0,showArrows:r=!0,autoplay:i=!1,interval:l=3e3,infiniteLoop:s=!1,perview:c=1,gap:p=0,onClickItem:u,showThumbs:v=!1,pauseOnHover:f=!1,swipeable:d=!0,thumbWidth:x=60,orientation:m="horizontal",nextIcon:b,prevIcon:S,className:M})=>{const y=e.length,L=Math.min(Math.max(c,.1),y),[w,H]=h.useState(0),[I,q]=h.useState(!1),[z,te]=h.useState(!1),[ie,le]=h.useState(0),K=h.useRef(null),V=h.useRef(0),U=h.useRef(0),T=L>=y?0:Math.max(0,y-L),ee=_=>Math.max(0,Math.min(_,T)),ce=_=>H(s&&T>0?(_%(T+1)+(T+1))%(T+1):ee(_)),X=()=>{s&&T>0?H(w===0?T:w-1):ce(w-1)},g=()=>{s&&T>0?H(w>=T?0:w+1):ce(w+1)};h.useEffect(()=>{if(!i||f&&I||z||T===0)return;const _=setInterval(()=>{H(R=>{const B=R+1;return B>T?s?0:R:B})},l);return()=>clearInterval(_)},[i,l,I,f,z,T,s]);const C=(_,R)=>{!d||T===0||(te(!0),V.current=m==="horizontal"?_:R,U.current=V.current)},P=(_,R)=>{z&&(U.current=m==="horizontal"?_:R,le(U.current-V.current))},E=()=>{if(!z)return;Math.abs(U.current-V.current)>50&&(U.current<V.current?g():X()),te(!1),le(0)},A=()=>{const _=m==="horizontal"?"X":"Y";let R=0;if(z&&K.current&&T>0){const J=m==="horizontal"?K.current.offsetWidth:K.current.offsetHeight;R=ie/J*100*(L/y)}const G=Math.min(w,T)*(100/y)-R,j=w>=T,$=w<=0?0:j?p/(c/2):p/c;return`translate${_}(calc(-${G}% - ${$}px))`},O=()=>L>=y?1:Math.floor(T)+1,N=()=>T===0?0:Math.round(w/T*(O()-1));return a.jsxs("div",{className:`relative flex flex-col items-center select-none ${M}`,style:{width:n,height:t},onMouseEnter:()=>f&&q(!0),onMouseLeave:()=>f&&q(!1),children:[a.jsxs("div",{ref:K,className:`w-full overflow-hidden relative ${d&&T>0?z?"cursor-grabbing":"cursor-grab":"cursor-default"}`,style:{height:v?`calc(${t} - ${x+20}px)`:t},onMouseDown:_=>{_.preventDefault(),C(_.clientX,_.clientY)},onMouseMove:_=>P(_.clientX,_.clientY),onMouseUp:E,onMouseLeave:E,onTouchStart:_=>C(_.touches[0].clientX,_.touches[0].clientY),onTouchMove:_=>P(_.touches[0].clientX,_.touches[0].clientY),onTouchEnd:E,children:[a.jsx("div",{className:`flex ${m==="horizontal"?"flex-row":"flex-col"} transition-transform duration-300 ease-in-out`,style:{width:m==="horizontal"?`${y*100/L}%`:"100%",height:m==="vertical"?`${y*100/L}%`:"100%",transform:A(),gap:`${p}px`,transitionProperty:z?"none":"transform"},children:e.map((_,R)=>a.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:m==="horizontal"?`calc(${100/y}% - ${p/c}px)`:"100%",height:m==="vertical"?`calc(${100/y}% - ${p*(y-1)/y}px)`:"100%"},onClick:()=>!z&&(u==null?void 0:u(R)),children:_},R))}),r&&T>0&&a.jsxs(a.Fragment,{children:[a.jsx("button",{"aria-label":"prev",onClick:X,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
164
  ${m==="horizontal"?"left-2 top-1/2 -translate-y-1/2":"left-1/2 top-2 -translate-x-1/2"}`,children:S||(m==="horizontal"?"‹":"↑")}),a.jsx("button",{"aria-label":"next",onClick:g,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"?"›":"↓")})]}),o&&O()>1&&a.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:O()}).map((_,R)=>a.jsx("button",{onClick:()=>ce(Math.round(R/(O()-1)*T)),className:`size-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${R===N()?"bg-color-gray-800":"bg-color-gray-400"}`},R))})]}),v&&a.jsx("div",{className:"flex gap-2 mt-3 justify-center flex-wrap",children:e.map((_,R)=>{const B=R===Math.round(w);return a.jsx("div",{onClick:()=>{const G=Math.max(0,Math.min(T,R-Math.floor(L/2)));ce(G)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${B?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:x,height:x},children:_},R)})})]})},pi=({title:e,description:n,actionLabel:t,onAction:o,illustration:r,illustrationWidth:i=120,children:l,color:s="gray"})=>a.jsxs("section",{className:"flex flex-col items-center justify-center text-center p-6 max-w-md",role:"status","aria-live":"polite",children:[r&&a.jsx("div",{className:"flex items-center justify-center",style:{width:i},children:typeof r=="string"?a.jsx("img",{src:r,alt:"",className:"object-contain"}):r}),a.jsx("h2",{className:"text-lg mt-4 font-semibold text-color-gray-800",children:e}),n&&a.jsx("p",{className:"text-sm mt-2 text-color-gray-600",children:n}),t&&o&&a.jsx(ze,{onClick:o,color:s,className:"mt-4",children:t}),l]}),di=({initialState:e=!1,onToggle:n,disabled:t=!1,type:o="button",color:r="green",variant:i="ios"})=>{var v,f,d;const[l,s]=h.useState(e),[c,p]=h.useState(!1),u=async()=>{if(!(t||c))if(n){p(!0);try{await n(!l),s(!l)}catch(x){console.error("Toggle failed",x)}finally{p(!1)}}else s(!l)};return i==="android"?a.jsxs("button",{onClick:u,type:o,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:[a.jsx("span",{className:`absolute rounded-full inset-0 opacity-50 ${l?`${(v=de[r])==null?void 0:v.filled}`:"bg-color-gray-400"}`}),a.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 ${l?`translate-x-5 ${(f=de[r])==null?void 0:f.filled}`:"translate-x-0 bg-color-white"}`,children:c?a.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:a.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})]}):a.jsx("button",{onClick:u,type:o,disabled:t,className:`relative w-11 h-6 flex items-center rounded-full transition-color duration-300 ${l?(d=de[r])==null?void 0:d.filled:"bg-color-gray-300"} ${t?"bg-color-gray-300 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:a.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 ${l?"translate-x-[19px]":"-translate-x-0"}`,children:c?a.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:a.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})})},fi={small:"px-2 py-1 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"},gi=({value:e,onChange:n,options:t,multiple:o=!1,size:r="medium",color:i="blue",orientation:l="horizontal",className:s="",buttonClass:c="",disabled:p=!1})=>{const u=f=>Array.isArray(e)?e.includes(f):e===f,v=f=>{if(!p)if(o){if(!Array.isArray(e))return;e.includes(f)?n(e.filter(d=>d!==f)):n([...e,f])}else n(f)};return a.jsx("div",{className:`inline-flex ${l==="vertical"?"flex-col":"flex-row"} rounded-md overflow-hidden border border-color-gray-200 bg-color-white ${s}`,role:"group","aria-disabled":p,children:t.map((f,d)=>{var x;return a.jsxs("button",{type:"button",disabled:p||f.disabled,className:`
165
+ ${m==="horizontal"?"right-2 top-1/2 -translate-y-1/2":"left-1/2 bottom-2 -translate-x-1/2"}`,children:b||(m==="horizontal"?"›":"↓")})]}),o&&O()>1&&a.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:O()}).map((_,R)=>a.jsx("button",{onClick:()=>ce(Math.round(R/(O()-1)*T)),className:`size-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${R===N()?"bg-color-gray-800":"bg-color-gray-400"}`},R))})]}),v&&a.jsx("div",{className:"flex gap-2 mt-3 justify-center flex-wrap",children:e.map((_,R)=>{const B=R===Math.round(w);return a.jsx("div",{onClick:()=>{const G=Math.max(0,Math.min(T,R-Math.floor(L/2)));ce(G)},className:`overflow-hidden rounded-md cursor-pointer transition-all hover:opacity-100 ${B?"border-2 border-color-gray-800 opacity-100 scale-105":"border-2 border-color-gray-300 opacity-70"}`,style:{width:x,height:x},children:_},R)})})]})},fi=({title:e,description:n,actionLabel:t,onAction:o,illustration:r,illustrationWidth:i=120,children:l,color:s="gray"})=>a.jsxs("section",{className:"flex flex-col items-center justify-center text-center p-6 max-w-md",role:"status","aria-live":"polite",children:[r&&a.jsx("div",{className:"flex items-center justify-center",style:{width:i},children:typeof r=="string"?a.jsx("img",{src:r,alt:"",className:"object-contain"}):r}),a.jsx("h2",{className:"text-lg mt-4 font-semibold text-color-gray-800",children:e}),n&&a.jsx("p",{className:"text-sm mt-2 text-color-gray-600",children:n}),t&&o&&a.jsx(ze,{onClick:o,color:s,className:"mt-4",children:t}),l]}),gi=({initialState:e=!1,onToggle:n,disabled:t=!1,type:o="button",color:r="green",variant:i="ios"})=>{var v,f,d;const[l,s]=h.useState(e),[c,p]=h.useState(!1),u=async()=>{if(!(t||c))if(n){p(!0);try{await n(!l),s(!l)}catch(x){console.error("Toggle failed",x)}finally{p(!1)}}else s(!l)};return i==="android"?a.jsxs("button",{onClick:u,type:o,disabled:t,className:`relative w-10 h-3 flex items-center transition-color duration-300
166
+ } ${t?"bg-color-gray-200 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[a.jsx("span",{className:`absolute rounded-full inset-0 opacity-50 ${l?`${(v=de[r])==null?void 0:v.filled}`:"bg-color-gray-400"}`}),a.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 ${l?`translate-x-5 ${(f=de[r])==null?void 0:f.filled}`:"translate-x-0 bg-color-white"}`,children:c?a.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:a.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})]}):a.jsx("button",{onClick:u,type:o,disabled:t,className:`relative w-11 h-6 flex items-center rounded-full transition-color duration-300 ${l?(d=de[r])==null?void 0:d.filled:"bg-color-gray-300"} ${t?"bg-color-gray-300 opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:a.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 ${l?"translate-x-[19px]":"-translate-x-0"}`,children:c?a.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:a.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})})},mi={small:"px-2 py-1 text-sm",medium:"px-4 py-2 text-base",large:"px-6 py-3 text-lg"},xi=({value:e,onChange:n,options:t,multiple:o=!1,size:r="medium",color:i="blue",orientation:l="horizontal",className:s="",buttonClass:c="",disabled:p=!1})=>{const u=f=>Array.isArray(e)?e.includes(f):e===f,v=f=>{if(!p)if(o){if(!Array.isArray(e))return;e.includes(f)?n(e.filter(d=>d!==f)):n([...e,f])}else n(f)};return a.jsx("div",{className:`inline-flex ${l==="vertical"?"flex-col":"flex-row"} rounded-md overflow-hidden border border-color-gray-200 bg-color-white ${s}`,role:"group","aria-disabled":p,children:t.map((f,d)=>{var x;return a.jsxs("button",{type:"button",disabled:p||f.disabled,className:`
161
167
  flex items-center justify-center gap-2 border-0 ${l==="vertical"?"not-last:border-b-1":"not-last:border-r-1"} border-color-gray-200
162
- ${fi[r]}
168
+ ${mi[r]}
163
169
  ${u(f.value)?((x=de[i])==null?void 0:x.filled)||i:"bg-color-transparent text-color-gray-700"}
164
170
  ${p||f.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
165
171
  ${c}
166
- `,"aria-pressed":u(f.value),onClick:()=>!(p||f.disabled)&&v(f.value),children:[f.icon,f.label]},f.value)})})},Yn={small:"p-2",medium:"p-4",large:"p-6",none:"p-0"},Wn={default:"shadow-xs",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"},Un={small:"rounded-md",medium:"rounded-xl",large:"rounded-2xl"},Kn=({title:e,subtitle:n,space:t="medium",shadow:o="small",roundness:r="medium",image:i,actionMenu:l,divider:s=!0,children:c,className:p="",hoverable:u=!1,bordered:v=!1,onClick:f,loaderJsx:d=!1})=>{const x=["relative","bg-white","overflow-hidden","w-full",Yn[t]||Yn.medium,Wn[o]||Wn.small,Un[r]||Un.medium,u?"hover:shadow-xl transition-shadow duration-300 cursor-pointer":"",v?"border border-color-gray-200":"",p].join(" ").trim();return a.jsxs("div",{className:x,onClick:f,children:[i&&a.jsx("img",{src:i,alt:"Card",className:"w-full h-auto mb-4 rounded"}),(e||n)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsxs("div",{children:[e&&a.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&a.jsx("p",{className:"text-color-gray-500 text-sm",children:n})]}),l&&a.jsx("div",{className:"ml-2",children:l})]}),s&&a.jsx("hr",{className:"h-px my-5 bg-color-gray-200 border-0"})]}),a.jsx("div",{children:c}),d&&a.jsx("div",{className:"absolute w-full h-full top-0 left-0 flex items-center justify-center bg-color-white bg-opacity-50",children:a.jsx(Bn,{animation:"wave",className:"!w-full !h-full"})})]})},mi=({orientation:e="horizontal",variant:n="fullWidth",children:t,className:o=""})=>{const r=e==="horizontal";if(t){const l=["flex items-center gap-2 text-sm text-color-gray-500 w-full",r?"flex-row":"flex-col"].filter(Boolean).join(" "),s=r?"flex-1 border-t border-color-gray-300":"h-4 border-l border-color-gray-300";return a.jsx("div",{role:"separator",className:`flex ${r?"w-full items-center":"h-full flex-col justify-center"}
172
+ `,"aria-pressed":u(f.value),onClick:()=>!(p||f.disabled)&&v(f.value),children:[f.icon,f.label]},f.value)})})},Yn={small:"p-2",medium:"p-4",large:"p-6",none:"p-0"},Wn={default:"shadow-xs",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"},Un={small:"rounded-md",medium:"rounded-xl",large:"rounded-2xl"},Kn=({title:e,subtitle:n,space:t="medium",shadow:o="small",roundness:r="medium",image:i,actionMenu:l,divider:s=!0,children:c,className:p="",hoverable:u=!1,bordered:v=!1,onClick:f,loaderJsx:d=!1})=>{const x=["relative","bg-white","overflow-hidden","w-full",Yn[t]||Yn.medium,Wn[o]||Wn.small,Un[r]||Un.medium,u?"hover:shadow-xl transition-shadow duration-300 cursor-pointer":"",v?"border border-color-gray-200":"",p].join(" ").trim();return a.jsxs("div",{className:x,onClick:f,children:[i&&a.jsx("img",{src:i,alt:"Card",className:"w-full h-auto mb-4 rounded"}),(e||n)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsxs("div",{children:[e&&a.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&a.jsx("p",{className:"text-color-gray-500 text-sm",children:n})]}),l&&a.jsx("div",{className:"ml-2",children:l})]}),s&&a.jsx("hr",{className:"h-px my-5 bg-color-gray-200 border-0"})]}),a.jsx("div",{children:c}),d&&a.jsx("div",{className:"absolute w-full h-full top-0 left-0 flex items-center justify-center bg-color-white bg-opacity-50",children:a.jsx(Bn,{animation:"wave",className:"!w-full !h-full"})})]})},vi=({orientation:e="horizontal",variant:n="fullWidth",children:t,className:o=""})=>{const r=e==="horizontal";if(t){const l=["flex items-center gap-2 text-sm text-color-gray-500 w-full",r?"flex-row":"flex-col"].filter(Boolean).join(" "),s=r?"flex-1 border-t border-color-gray-300":"h-4 border-l border-color-gray-300";return a.jsx("div",{role:"separator",className:`flex ${r?"w-full items-center":"h-full flex-col justify-center"}
167
173
  ${o}
168
174
  ${n==="inset"?r?"pl-4":"pt-4":""}`,children:a.jsxs("div",{className:l,children:[a.jsx("div",{className:s}),a.jsx("span",{children:t}),a.jsx("div",{className:s})]})})}const i=r?"h-px w-full bg-color-gray-300":"w-px h-full bg-color-gray-300";return a.jsx("div",{role:"separator",className:`flex ${r?"w-full items-center":"h-full flex-col justify-center"}
169
175
  ${o}
170
- ${n==="inset"?r?"pl-4":"pt-4":""} ${i}`})},xi=({name:e,options:n,selectedValue:t,onChange:o,direction:r="column",disabled:i=!1,color:l="blue",className:s="",radioClass:c})=>a.jsx("div",{className:`flex ${r==="row"?"flex-row gap-6":"flex-col gap-3"} ${s}`,children:n.map(({label:p,value:u,disabled:v})=>{var d,x;const f=i||v;return a.jsxs("label",{className:`relative flex items-center cursor-pointer select-none transition ${f?"opacity-50 cursor-not-allowed":"hover:opacity-90"}`,children:[a.jsx("input",{type:"radio",name:e,value:u,disabled:f,checked:t===u,onChange:()=>!f&&(o==null?void 0:o(u)),className:"sr-only peer"}),a.jsx("div",{className:`w-5 h-5 rounded-full border-2 border-color-gray-400 peer-checked:border-[7px] transition-all duration-150 ${(d=de[l])==null?void 0:d.peer} ${c}`}),a.jsx("span",{className:`ml-2 text-sm text-color-gray-800 ${(x=de[l])==null?void 0:x.peer}`,children:p})]},u)})}),vi=({label:e,value:n,onChange:t,options:o,className:r="",labelClass:i="",disabled:l=!1,size:s="medium",variant:c="outlined",rounded:p="medium",shadow:u=!1})=>{const v={small:"p-2",medium:"p-3",large:"p-4"},f={small:"rounded-md",medium:"rounded-lg",full:"rounded-full"},d={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-300 bg-color-transparent"};return a.jsxs("div",{className:`relative w-full ${r}`,children:[e&&a.jsx("label",{className:`text-sm text-color-gray-500 pointer-events-none block mb-1 ${i}`,children:e}),a.jsxs("div",{className:"relative",children:[a.jsx("select",{disabled:l,value:n,onChange:x=>t(x.target.value),className:`appearance-none focus:ring-1 text-color-gray-800 w-full border outline-none transition-all ${f[p]} ${v[s]} ${d[c]} ${l?"!bg-color-gray-50 opacity-60 cursor-not-allowed":""} ${u?"shadow-md shadow-color-zinc-100":""}`,children:o.map(x=>a.jsx("option",{value:x.value,className:"text-color-gray-900",children:x.label},x.value))}),a.jsx("span",{className:`absolute right-3 text-sm top-1/2 -translate-y-1/2 ${l?"opacity-60":""}`,children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})})})]})]})},hi=({content:e,children:n,position:t="top"})=>{const[o,r]=h.useState(!1),[i,l]=h.useState({top:0,left:0}),s=h.useRef(null),c=h.useRef(null);return h.useEffect(()=>{if(o&&s.current&&c.current){const p=s.current.getBoundingClientRect(),u=c.current.getBoundingClientRect();let v=0,f=0;switch(t){case"top":v=p.top-u.height-8,f=p.left+p.width/2-u.width/2;break;case"bottom":v=p.bottom+8,f=p.left+p.width/2-u.width/2;break;case"left":v=p.top+p.height/2-u.height/2,f=p.left-u.width-8;break;case"right":v=p.top+p.height/2-u.height/2,f=p.right+8;break}l({top:v,left:f})}},[o,t]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:s,className:"inline-block",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:n}),o&&Re.createPortal(a.jsx("div",{ref:c,style:{top:i.top,left:i.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 bi(...e){return e.filter(Boolean).join(" ")}const wi={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"},Xn=h.forwardRef(({open:e,onClose:n,className:t,title:o,children:r,actions:i,showCloseIcon:l=!0,fullscreen:s=!1,fullWidth:c=!1,maxWidth:p},u)=>{const[v,f]=h.useState(e||!1),[d,x]=h.useState(!1),[m,b]=h.useState(!1);h.useEffect(()=>{e!==void 0&&f(e)},[e]),h.useImperativeHandle(u,()=>({open:()=>f(!0),close:()=>{b(!1),setTimeout(()=>f(!1),300)}})),h.useEffect(()=>{let M;return v?(x(!0),M=setTimeout(()=>b(!0),10)):b(!1),()=>clearTimeout(M)},[v]);const S=()=>{v||x(!1)};return h.useEffect(()=>{const M=y=>{y.key==="Escape"&&(n==null||n())};return v&&document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[v,n]),h.useEffect(()=>(v?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[v]),d?Re.createPortal(a.jsxs("div",{className:bi("fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300",m?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:()=>{n==null||n(),f(!1)}}),a.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"} ${s?"w-full h-[calc(100%_-_40px)] m-5":`${c?"w-full":"w-auto"} ${p?wi[p]:""} mx-5`} ${t}`,onTransitionEnd:S,children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o&&a.jsx("h2",{className:"text-xl font-semibold",children:o}),l&&a.jsx(he,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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(),f(!1)},variant:"transparent"})]}),a.jsx("div",{className:"grow lg:max-h-[calc(100vh_-_200px)] max-h-[calc(100vh_-_130px)] overflow-y-auto",children:r}),i&&a.jsx("div",{className:"mt-8",children:i})]})]}),document.body):null});function yi({items:e,trigger:n,className:t,dropdownItemClass:o}){const[r,i]=h.useState(!1),[l,s]=h.useState({top:0,left:0}),[c,p]=h.useState(!1),u=h.useRef(null),v=h.useRef(null),f=x=>{x.stopPropagation(),i(m=>!m),p(!1)};h.useLayoutEffect(()=>{if(r&&u.current&&v.current){const x=u.current.getBoundingClientRect(),m=v.current.getBoundingClientRect(),b=window.innerWidth,S=window.innerHeight;let M=x.left+window.scrollX,y=x.bottom+window.scrollY;x.right+m.width>b&&(M=x.right+window.scrollX-m.width),M+m.width>b&&(M=b-m.width-12),y+m.height>S&&(y=x.top+window.scrollY-m.height),s({top:y,left:M}),setTimeout(()=>{p(!0)},150)}},[r]),h.useEffect(()=>{const x=m=>{var b;v.current&&!v.current.contains(m.target)&&!((b=u.current)!=null&&b.contains(m.target))&&i(!1)};return r&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[r]);const d=a.jsx("div",{ref:v,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:l.top,left:l.left},children:e.map((x,m)=>a.jsxs("button",{disabled:x.disabled,onClick:()=>{var b;(b=x.onClick)==null||b.call(x),i(!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 ${x.disabled?"opacity-50 hover:bg-color-transparent !cursor-not-allowed":""} ${o} ${x.itemClass}`,children:[x.icon&&a.jsx("span",{children:x.icon}),a.jsx("span",{children:x.label})]},m))});return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:u,onClick:f,className:"cursor-pointer",children:n}),r&&Re.createPortal(d,document.body)]})}function Ci(...e){return e.filter(Boolean).join(" ")}const Jn=({open:e,onClose:n,className:t,title:o,children:r,childrenClass:i,actions:l,showCloseIcon:s=!0,anchor:c="left"})=>{const[p,u]=h.useState(!1),[v,f]=h.useState(!1);h.useEffect(()=>{let b;return e?(u(!0),b=setTimeout(()=>{f(!0)},10)):f(!1),()=>clearTimeout(b)},[e]);const d=()=>{e||u(!1)};if(h.useEffect(()=>{const b=S=>{S.key==="Escape"&&(n==null||n())};return e&&document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,n]),h.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!p)return null;const x={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:v?"translate-x-0":"-translate-x-full",right:v?"translate-x-0":"translate-x-full",top:v?"translate-y-0":"-translate-y-full",bottom:v?"translate-y-0":"translate-y-full"};return Re.createPortal(a.jsxs("div",{className:Ci("fixed inset-0 z-50 transition-opacity duration-300",v?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:n}),a.jsxs("div",{className:`
176
+ ${n==="inset"?r?"pl-4":"pt-4":""} ${i}`})},hi=({name:e,options:n,selectedValue:t,onChange:o,direction:r="column",disabled:i=!1,color:l="blue",className:s="",radioClass:c})=>a.jsx("div",{className:`flex ${r==="row"?"flex-row gap-6":"flex-col gap-3"} ${s}`,children:n.map(({label:p,value:u,disabled:v})=>{var d,x;const f=i||v;return a.jsxs("label",{className:`relative flex items-center cursor-pointer select-none transition ${f?"opacity-50 cursor-not-allowed":"hover:opacity-90"}`,children:[a.jsx("input",{type:"radio",name:e,value:u,disabled:f,checked:t===u,onChange:()=>!f&&(o==null?void 0:o(u)),className:"sr-only peer"}),a.jsx("div",{className:`w-5 h-5 rounded-full border-2 border-color-gray-400 peer-checked:border-[7px] transition-all duration-150 ${(d=de[l])==null?void 0:d.peer} ${c}`}),a.jsx("span",{className:`ml-2 text-sm text-color-gray-800 ${(x=de[l])==null?void 0:x.peer}`,children:p})]},u)})}),bi=({label:e,value:n,onChange:t,options:o,className:r="",labelClass:i="",disabled:l=!1,size:s="medium",variant:c="outlined",rounded:p="medium",shadow:u=!1})=>{const v={small:"p-2",medium:"p-3",large:"p-4"},f={small:"rounded-md",medium:"rounded-lg",full:"rounded-full"},d={filled:"bg-color-gray-100 border-color-gray-200",outlined:"border-color-gray-300 bg-color-transparent"};return a.jsxs("div",{className:`relative w-full ${r}`,children:[e&&a.jsx("label",{className:`text-sm text-color-gray-500 pointer-events-none block mb-1 ${i}`,children:e}),a.jsxs("div",{className:"relative",children:[a.jsx("select",{disabled:l,value:n,onChange:x=>t(x.target.value),className:`appearance-none focus:ring-1 text-color-gray-800 w-full border outline-none transition-all ${f[p]} ${v[s]} ${d[c]} ${l?"!bg-color-gray-50 opacity-60 cursor-not-allowed":""} ${u?"shadow-md shadow-color-zinc-100":""}`,children:o.map(x=>a.jsx("option",{value:x.value,className:"text-color-gray-900",children:x.label},x.value))}),a.jsx("span",{className:`absolute right-3 text-sm top-1/2 -translate-y-1/2 ${l?"opacity-60":""}`,children:a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})})})]})]})},wi=({content:e,children:n,position:t="top"})=>{const[o,r]=h.useState(!1),[i,l]=h.useState({top:0,left:0}),s=h.useRef(null),c=h.useRef(null);return h.useEffect(()=>{if(o&&s.current&&c.current){const p=s.current.getBoundingClientRect(),u=c.current.getBoundingClientRect();let v=0,f=0;switch(t){case"top":v=p.top-u.height-8,f=p.left+p.width/2-u.width/2;break;case"bottom":v=p.bottom+8,f=p.left+p.width/2-u.width/2;break;case"left":v=p.top+p.height/2-u.height/2,f=p.left-u.width-8;break;case"right":v=p.top+p.height/2-u.height/2,f=p.right+8;break}l({top:v,left:f})}},[o,t]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:s,className:"inline-block",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:n}),o&&Re.createPortal(a.jsx("div",{ref:c,style:{top:i.top,left:i.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 yi(...e){return e.filter(Boolean).join(" ")}const Ci={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"},Xn=h.forwardRef(({open:e,onClose:n,className:t,title:o,children:r,actions:i,showCloseIcon:l=!0,fullscreen:s=!1,fullWidth:c=!1,maxWidth:p},u)=>{const[v,f]=h.useState(e||!1),[d,x]=h.useState(!1),[m,b]=h.useState(!1);h.useEffect(()=>{e!==void 0&&f(e)},[e]),h.useImperativeHandle(u,()=>({open:()=>f(!0),close:()=>{b(!1),setTimeout(()=>f(!1),300)}})),h.useEffect(()=>{let M;return v?(x(!0),M=setTimeout(()=>b(!0),10)):b(!1),()=>clearTimeout(M)},[v]);const S=()=>{v||x(!1)};return h.useEffect(()=>{const M=y=>{y.key==="Escape"&&(n==null||n())};return v&&document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[v,n]),h.useEffect(()=>(v?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[v]),d?Re.createPortal(a.jsxs("div",{className:yi("fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300",m?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:()=>{n==null||n(),f(!1)}}),a.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"} ${s?"w-full h-[calc(100%_-_40px)] m-5":`${c?"w-full":"w-auto"} ${p?Ci[p]:""} mx-5`} ${t}`,onTransitionEnd:S,children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o&&a.jsx("h2",{className:"text-xl font-semibold",children:o}),l&&a.jsx(he,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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(),f(!1)},variant:"transparent"})]}),a.jsx("div",{className:"grow lg:max-h-[calc(100vh_-_200px)] max-h-[calc(100vh_-_130px)] overflow-y-auto",children:r}),i&&a.jsx("div",{className:"mt-8",children:i})]})]}),document.body):null});function Si({items:e,trigger:n,className:t,dropdownItemClass:o}){const[r,i]=h.useState(!1),[l,s]=h.useState({top:0,left:0}),[c,p]=h.useState(!1),u=h.useRef(null),v=h.useRef(null),f=x=>{x.stopPropagation(),i(m=>!m),p(!1)};h.useLayoutEffect(()=>{if(r&&u.current&&v.current){const x=u.current.getBoundingClientRect(),m=v.current.getBoundingClientRect(),b=window.innerWidth,S=window.innerHeight;let M=x.left+window.scrollX,y=x.bottom+window.scrollY;x.right+m.width>b&&(M=x.right+window.scrollX-m.width),M+m.width>b&&(M=b-m.width-12),y+m.height>S&&(y=x.top+window.scrollY-m.height),s({top:y,left:M}),setTimeout(()=>{p(!0)},150)}},[r]),h.useEffect(()=>{const x=m=>{var b;v.current&&!v.current.contains(m.target)&&!((b=u.current)!=null&&b.contains(m.target))&&i(!1)};return r&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[r]);const d=a.jsx("div",{ref:v,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:l.top,left:l.left},children:e.map((x,m)=>a.jsxs("button",{disabled:x.disabled,onClick:()=>{var b;(b=x.onClick)==null||b.call(x),i(!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 ${x.disabled?"opacity-50 hover:bg-color-transparent !cursor-not-allowed":""} ${o} ${x.itemClass}`,children:[x.icon&&a.jsx("span",{children:x.icon}),a.jsx("span",{children:x.label})]},m))});return a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:u,onClick:f,className:"cursor-pointer",children:n}),r&&Re.createPortal(d,document.body)]})}function ji(...e){return e.filter(Boolean).join(" ")}const Jn=({open:e,onClose:n,className:t,title:o,children:r,childrenClass:i,actions:l,showCloseIcon:s=!0,anchor:c="left"})=>{const[p,u]=h.useState(!1),[v,f]=h.useState(!1);h.useEffect(()=>{let b;return e?(u(!0),b=setTimeout(()=>{f(!0)},10)):f(!1),()=>clearTimeout(b)},[e]);const d=()=>{e||u(!1)};if(h.useEffect(()=>{const b=S=>{S.key==="Escape"&&(n==null||n())};return e&&document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,n]),h.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!p)return null;const x={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:v?"translate-x-0":"-translate-x-full",right:v?"translate-x-0":"translate-x-full",top:v?"translate-y-0":"-translate-y-full",bottom:v?"translate-y-0":"translate-y-full"};return Re.createPortal(a.jsxs("div",{className:ji("fixed inset-0 z-50 transition-opacity duration-300",v?"opacity-100":"opacity-0 pointer-events-none"),children:[a.jsx("div",{className:"fixed inset-0 bg-color-black/50",onClick:n}),a.jsxs("div",{className:`
171
177
  fixed bg-color-white shadow-lg z-50 p-6 flex flex-col
172
178
  ${x[c]}
173
179
  ${m[c]}
174
180
  ${t}
175
- `,onTransitionEnd:d,children:[s&&a.jsx(he,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"}),o&&a.jsx("h2",{className:"text-xl font-semibold mb-4",children:o}),a.jsx("div",{className:`grow overflow-y-auto ${i}`,children:r}),l&&a.jsx("div",{className:"mt-4",children:l})]})]}),document.body)},Si=({title:e,content:n,expandIcon:t=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})}),collapseIcon:o=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})}),isOpen:r,defaultExpanded:i=!1,onToggle:l,className:s="",titleClass:c="",contentClass:p=""})=>{const[u,v]=h.useState(i),f=r!==void 0,d=f?r:u,x=()=>{const m=!d;f||v(m),l==null||l(m)};return h.useEffect(()=>{f&&v(r)},[r]),a.jsxs("div",{className:`overflow-hidden w-full border border-color-gray-100 ${s}`,children:[a.jsxs("button",{onClick:x,className:`flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,children:[a.jsx("div",{className:"text-left text-sm font-medium",children:e}),a.jsx("div",{className:"transition-transform duration-300",children:d?t:o})]}),a.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-in-out grid-rows-[0fr] ${d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:a.jsx("div",{className:"overflow-hidden",children:a.jsx("div",{className:`p-4 text-sm text-color-gray-700 ${p}`,children:n})})})]})},ji={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"},ki={info:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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"})})},$i={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"},_i=({message:e,variant:n="info",onClose:t,autoClose:o=!1,className:r="",autoCloseDuration:i=5e3})=>{const[l,s]=h.useState(!0),c=h.useRef(null);return h.useEffect(()=>{let p;return o&&(requestAnimationFrame(()=>{c.current&&(c.current.style.transition=`width ${i}ms linear`,c.current.style.width="0%")}),p=setTimeout(()=>{s(!1),t==null||t()},i)),()=>clearTimeout(p)},[o,i,t]),l?a.jsxs("div",{className:`relative border-t-4 p-4 flex items-start justify-between ${ji[n]} ${r}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[ki[n],a.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),a.jsx("button",{onClick:()=>{s(!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:a.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:a.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"})})}),o&&a.jsx("div",{className:"absolute -top-1 left-0 h-1 w-full bg-color-transparent overflow-hidden",children:a.jsx("div",{ref:c,className:`${$i[n]} h-1`,style:{width:"100%"}})})]}):null},Ri=({children:e,count:n,showDot:t=!1,max:o=99,color:r="red",position:i="top-right"})=>{const l=()=>{var p,u;if(t)return a.jsx("span",{className:`h-2 w-2 rounded-full ${(p=de[r])==null?void 0:p.filled} block`});if(n===0||n===void 0)return null;const c=n>o?`${o}+`:n;return a.jsx("span",{className:`text-color-white text-xs px-[10px] py-1 rounded-full whitespace-nowrap ${(u=de[r])==null?void 0:u.filled}`,children:c})},s=()=>{switch(i){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 a.jsxs("div",{className:"relative inline-block",children:[e,a.jsx("span",{className:`absolute ${s()}`,children:l()})]})},Ei=({variant:e="fixed",activeTab:n,navItems:t,onTabChange:o,className:r="",activeClass:i="",buttonClass:l=""})=>{let s="flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4";return e==="fixed"?s+=" fixed bottom-0 left-0 right-0":e==="floating"?s+=" fixed bottom-4 left-4 right-4 rounded-full":e==="static"&&(s+=" static w-full"),a.jsx("nav",{className:`${s} ${r}`,children:t.map(c=>{const p=c.label===n;return a.jsxs("a",{href:c.path,onClick:()=>o(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${l}`,children:[a.jsx("span",{className:`text-xl ${p?`text-color-blue-500 ${i}`:""}`,children:c.icon}),a.jsx("span",{className:`text-xs font-medium mt-1 ${p?`text-color-blue-500 ${i}`:""}`,children:c.label})]},c.label)})})},Mi=({items:e,separator:n="/",className:t=""})=>a.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:a.jsx("ol",{className:"flex items-center space-x-1",children:e.map((o,r)=>a.jsxs("li",{className:"flex items-center",children:[o.href?a.jsx("a",{href:o.href,className:"text-color-gray-800 hover:underline font-medium",children:o.label}):a.jsx("span",{className:"text-color-gray-500 font-medium",children:o.label}),r<e.length-1&&a.jsx("span",{className:"mx-2 text-color-gray-400",children:n})]},r))})}),Qn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Pi=["Su","Mo","Tu","We","Th","Fr","Sa"],Li=({mode:e="single",type:n="inline",showTime:t=!1,onlyTime:o=!1,className:r,onChange:i,placeholder:l="Select date",icon:s=a.jsx("svg",{className:"text-color-gray-500 size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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:p,selectedDate:u})=>{const[v,f]=h.useState(!1),[d,x]=h.useState(null),[m,b]=h.useState(new Date),[S,M]=h.useState(u?new Date(u):null),[y,L]=h.useState(null),[w,H]=h.useState(null),[I,q]=h.useState(null),[z,te]=h.useState({hour:12,minute:0,ampm:"AM"}),ie=h.useRef(null),[le,K]=h.useState(u?new Date(u):null),[V,U]=h.useState(null),[T,ee]=h.useState(null);h.useEffect(()=>{M(u?new Date(u):null),K(u?new Date(u):null)},[u]);const ce=j=>{j.stopPropagation(),x(j.currentTarget),f(!0)},X=()=>{f(!1)},g=j=>!!(c&&j.getTime()<c||p&&j.getTime()>p),C=j=>{n==="inline"&&ie.current&&!ie.current.contains(j.target)&&(e==="single"?S||M(null):e==="range"&&(!y||!w)&&(L(null),H(null)),f(!1))};h.useEffect(()=>(v?document.addEventListener("mousedown",C):document.removeEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}),[v]);const P=j=>{!j||g(j)||(e==="single"?M(j):e==="range"&&(!y||y&&w?(L(j),H(null)):j>=y?H(j):L(j)))},E=j=>{if(!j||g(j)){q(null);return}e==="range"&&y&&!w&&q(j)},A=()=>{q(null)},O=()=>{if(f(!1),e==="single"){const j=o?new Date:S,k=j?new Date(j.getFullYear(),j.getMonth(),j.getDate(),z.ampm==="PM"&&z.hour!==12?z.hour+12:z.ampm==="AM"&&z.hour===12?0:z.hour,z.minute):null;K(k),i==null||i(k?k.getTime():null)}else e==="range"&&(U(y),ee(w),i==null||i({startDate:y?y.getTime():null,endDate:w?w.getTime():null}))},N=()=>{const j=new Date(m.getFullYear(),m.getMonth(),1),k=new Date(m.getFullYear(),m.getMonth()+1,0),$=[],J=j.getDay();for(let Q=0;Q<J;Q++)$.push(null);for(let Q=1;Q<=k.getDate();Q++)$.push(new Date(m.getFullYear(),m.getMonth(),Q));return $},_=j=>{if(!j)return!1;if(e==="single")return(S==null?void 0:S.toDateString())===j.toDateString();if(e==="range"){if(y&&!w&&I){const k=y<I?y:I,$=y<I?I:y;return j>=k&&j<=$}return y&&w&&j>=y&&j<=w}return!1},R=(j,k)=>{if(!j)return e==="range"?k==="end"?"End Date":"Start Date":o?`${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`:l;if(o)return`${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`;const $=j.getDate().toString().padStart(2,"0"),J=Qn[j.getMonth()],Q=j.getFullYear(),se=t?` ${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`:"";return`${$} ${J} ${Q}${se}`},B=a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:z.hour,onChange:j=>te({...z,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=>a.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),a.jsx("select",{value:z.minute,onChange:j=>te({...z,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=>a.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),a.jsxs("select",{value:z.ampm,onChange:j=>te({...z,ampm:j.target.value}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),G=a.jsxs("div",{ref:ie,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:d==null?void 0:d.getBoundingClientRect().left,top:d?d.getBoundingClientRect().bottom+window.scrollY:0},children:[!o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(he,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()-1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("select",{className:"text-sm outline-none",value:m.getMonth(),onChange:j=>b(new Date(m.getFullYear(),parseInt(j.target.value),1)),children:Qn.map((j,k)=>a.jsx("option",{value:k,children:j},j))}),a.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=>a.jsx("option",{value:j,children:j},j))})]}),a.jsx(he,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()+1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})})})]}),a.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[Pi.map(j=>a.jsx("div",{className:"font-semibold",children:j},j)),N().map((j,k)=>a.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
181
+ `,onTransitionEnd:d,children:[s&&a.jsx(he,{color:"gray",icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"}),o&&a.jsx("h2",{className:"text-xl font-semibold mb-4",children:o}),a.jsx("div",{className:`grow overflow-y-auto ${i}`,children:r}),l&&a.jsx("div",{className:"mt-4",children:l})]})]}),document.body)},ki=({title:e,content:n,expandIcon:t=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})}),collapseIcon:o=a.jsx("svg",{className:"size-4",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})}),isOpen:r,defaultExpanded:i=!1,onToggle:l,className:s="",titleClass:c="",contentClass:p=""})=>{const[u,v]=h.useState(i),f=r!==void 0,d=f?r:u,x=()=>{const m=!d;f||v(m),l==null||l(m)};return h.useEffect(()=>{f&&v(r)},[r]),a.jsxs("div",{className:`overflow-hidden w-full border border-color-gray-100 ${s}`,children:[a.jsxs("button",{onClick:x,className:`flex justify-between items-center w-full p-4 bg-color-gray-50 hover:bg-color-gray-200 transition ${c}`,children:[a.jsx("div",{className:"text-left text-sm font-medium",children:e}),a.jsx("div",{className:"transition-transform duration-300",children:d?t:o})]}),a.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-in-out grid-rows-[0fr] ${d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:a.jsx("div",{className:"overflow-hidden",children:a.jsx("div",{className:`p-4 text-sm text-color-gray-700 ${p}`,children:n})})})]})},$i={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"},_i={info:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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:a.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"})})},Ri={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"},Ei=({message:e,variant:n="info",onClose:t,autoClose:o=!1,className:r="",autoCloseDuration:i=5e3})=>{const[l,s]=h.useState(!0),c=h.useRef(null);return h.useEffect(()=>{let p;return o&&(requestAnimationFrame(()=>{c.current&&(c.current.style.transition=`width ${i}ms linear`,c.current.style.width="0%")}),p=setTimeout(()=>{s(!1),t==null||t()},i)),()=>clearTimeout(p)},[o,i,t]),l?a.jsxs("div",{className:`relative border-t-4 p-4 flex items-start justify-between ${$i[n]} ${r}`,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[_i[n],a.jsx("span",{dangerouslySetInnerHTML:{__html:e}})]}),a.jsx("button",{onClick:()=>{s(!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:a.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:a.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"})})}),o&&a.jsx("div",{className:"absolute -top-1 left-0 h-1 w-full bg-color-transparent overflow-hidden",children:a.jsx("div",{ref:c,className:`${Ri[n]} h-1`,style:{width:"100%"}})})]}):null},Mi=({children:e,count:n,showDot:t=!1,max:o=99,color:r="red",position:i="top-right"})=>{const l=()=>{var p,u;if(t)return a.jsx("span",{className:`h-2 w-2 rounded-full ${(p=de[r])==null?void 0:p.filled} block`});if(n===0||n===void 0)return null;const c=n>o?`${o}+`:n;return a.jsx("span",{className:`text-color-white text-xs px-[10px] py-1 rounded-full whitespace-nowrap ${(u=de[r])==null?void 0:u.filled}`,children:c})},s=()=>{switch(i){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 a.jsxs("div",{className:"relative inline-block",children:[e,a.jsx("span",{className:`absolute ${s()}`,children:l()})]})},Pi=({variant:e="fixed",activeTab:n,navItems:t,onTabChange:o,className:r="",activeClass:i="",buttonClass:l=""})=>{let s="flex justify-around items-center bg-color-white shadow-sm text-color-gray-600 py-2 px-4";return e==="fixed"?s+=" fixed bottom-0 left-0 right-0":e==="floating"?s+=" fixed bottom-4 left-4 right-4 rounded-full":e==="static"&&(s+=" static w-full"),a.jsx("nav",{className:`${s} ${r}`,children:t.map(c=>{const p=c.label===n;return a.jsxs("a",{href:c.path,onClick:()=>o(c.label),className:`flex flex-col items-center text-sm cursor-pointer text-color-gray-500 no-underline ${l}`,children:[a.jsx("span",{className:`text-xl ${p?`text-color-blue-500 ${i}`:""}`,children:c.icon}),a.jsx("span",{className:`text-xs font-medium mt-1 ${p?`text-color-blue-500 ${i}`:""}`,children:c.label})]},c.label)})})},Li=({items:e,separator:n="/",className:t=""})=>a.jsx("nav",{className:`text-sm text-color-gray-600 ${t}`,"aria-label":"Breadcrumb",children:a.jsx("ol",{className:"flex items-center space-x-1",children:e.map((o,r)=>a.jsxs("li",{className:"flex items-center",children:[o.href?a.jsx("a",{href:o.href,className:"text-color-gray-800 hover:underline font-medium",children:o.label}):a.jsx("span",{className:"text-color-gray-500 font-medium",children:o.label}),r<e.length-1&&a.jsx("span",{className:"mx-2 text-color-gray-400",children:n})]},r))})}),Qn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fi=["Su","Mo","Tu","We","Th","Fr","Sa"],Ai=({mode:e="single",type:n="inline",showTime:t=!1,onlyTime:o=!1,className:r,onChange:i,placeholder:l="Select date",icon:s=a.jsx("svg",{className:"text-color-gray-500 size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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:p,selectedDate:u})=>{const[v,f]=h.useState(!1),[d,x]=h.useState(null),[m,b]=h.useState(new Date),[S,M]=h.useState(u?new Date(u):null),[y,L]=h.useState(null),[w,H]=h.useState(null),[I,q]=h.useState(null),[z,te]=h.useState({hour:12,minute:0,ampm:"AM"}),ie=h.useRef(null),[le,K]=h.useState(u?new Date(u):null),[V,U]=h.useState(null),[T,ee]=h.useState(null);h.useEffect(()=>{M(u?new Date(u):null),K(u?new Date(u):null)},[u]);const ce=j=>{j.stopPropagation(),x(j.currentTarget),f(!0)},X=()=>{f(!1)},g=j=>!!(c&&j.getTime()<c||p&&j.getTime()>p),C=j=>{n==="inline"&&ie.current&&!ie.current.contains(j.target)&&(e==="single"?S||M(null):e==="range"&&(!y||!w)&&(L(null),H(null)),f(!1))};h.useEffect(()=>(v?document.addEventListener("mousedown",C):document.removeEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}),[v]);const P=j=>{!j||g(j)||(e==="single"?M(j):e==="range"&&(!y||y&&w?(L(j),H(null)):j>=y?H(j):L(j)))},E=j=>{if(!j||g(j)){q(null);return}e==="range"&&y&&!w&&q(j)},A=()=>{q(null)},O=()=>{if(f(!1),e==="single"){const j=o?new Date:S,k=j?new Date(j.getFullYear(),j.getMonth(),j.getDate(),z.ampm==="PM"&&z.hour!==12?z.hour+12:z.ampm==="AM"&&z.hour===12?0:z.hour,z.minute):null;K(k),i==null||i(k?k.getTime():null)}else e==="range"&&(U(y),ee(w),i==null||i({startDate:y?y.getTime():null,endDate:w?w.getTime():null}))},N=()=>{const j=new Date(m.getFullYear(),m.getMonth(),1),k=new Date(m.getFullYear(),m.getMonth()+1,0),$=[],J=j.getDay();for(let Q=0;Q<J;Q++)$.push(null);for(let Q=1;Q<=k.getDate();Q++)$.push(new Date(m.getFullYear(),m.getMonth(),Q));return $},_=j=>{if(!j)return!1;if(e==="single")return(S==null?void 0:S.toDateString())===j.toDateString();if(e==="range"){if(y&&!w&&I){const k=y<I?y:I,$=y<I?I:y;return j>=k&&j<=$}return y&&w&&j>=y&&j<=w}return!1},R=(j,k)=>{if(!j)return e==="range"?k==="end"?"End Date":"Start Date":o?`${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`:l;if(o)return`${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`;const $=j.getDate().toString().padStart(2,"0"),J=Qn[j.getMonth()],Q=j.getFullYear(),se=t?` ${String(z.hour).padStart(2,"0")}:${String(z.minute).padStart(2,"0")} ${z.ampm}`:"";return`${$} ${J} ${Q}${se}`},B=a.jsxs("div",{className:"flex items-center justify-between w-full border border-color-gray-300 rounded-md p-2",children:[a.jsx("select",{value:z.hour,onChange:j=>te({...z,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=>a.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),a.jsx("select",{value:z.minute,onChange:j=>te({...z,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=>a.jsx("option",{value:j,children:j.toString().padStart(2,"0")},j))}),a.jsxs("select",{value:z.ampm,onChange:j=>te({...z,ampm:j.target.value}),className:"w-16 border-0 text-center bg-color-transparent outline-0 border-l border-color-gray-300",children:[a.jsx("option",{value:"AM",children:"AM"}),a.jsx("option",{value:"PM",children:"PM"})]})]}),G=a.jsxs("div",{ref:ie,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:d==null?void 0:d.getBoundingClientRect().left,top:d?d.getBoundingClientRect().bottom+window.scrollY:0},children:[!o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx(he,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()-1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"})})}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("select",{className:"text-sm outline-none",value:m.getMonth(),onChange:j=>b(new Date(m.getFullYear(),parseInt(j.target.value),1)),children:Qn.map((j,k)=>a.jsx("option",{value:k,children:j},j))}),a.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=>a.jsx("option",{value:j,children:j},j))})]}),a.jsx(he,{variant:"transparent",size:"small",color:"gray",roundedFull:!0,onClick:()=>b(new Date(m.getFullYear(),m.getMonth()+1,1)),icon:a.jsx("svg",{className:"size-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:a.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"})})})]}),a.jsxs("div",{className:"grid grid-columns-7 gap-1 text-center text-sm mb-2",children:[Fi.map(j=>a.jsx("div",{className:"font-semibold",children:j},j)),N().map((j,k)=>a.jsx("div",{className:`size-8 flex justify-center items-center text-sm rounded-full transition-all
176
182
  ${j?"hover:bg-color-blue-100 cursor-pointer":""}
177
183
  ${j&&_(j)?"bg-color-blue-500 hover:bg-color-blue-500 text-color-white":""}
178
- ${j&&g(j)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>j&&P(j),onMouseEnter:()=>j&&E(j),onMouseLeave:A,children:j?j.getDate():""},k))]})]}),(t||o)&&B,a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:O,disabled:e==="range"&&!w&&!o,className:`${e==="range"&&!w&&!o?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return a.jsxs("div",{className:"relative",children:[a.jsxs(ze,{onClick:ce,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${r||""}`,children:[e==="single"?le?R(le):l:y||V||T?a.jsxs(a.Fragment,{children:[R(y||V,"start")," -"," ",R(w||T,"end")]}):l,s]}),n==="inline"?a.jsx(a.Fragment,{children:v&&Re.createPortal(G,document.body)}):a.jsx(Xn,{open:v,title:o?"Select Time":l,onClose:X,children:a.jsx("div",{className:"w-72",children:G})})]})},Fi=({tabs:e,activeKey:n,onChange:t,className:o="",tabsClass:r="",tabItemClass:i="",tabContentClass:l="",variant:s="horizontal"})=>{const c=e.find(u=>u.key===n),p=s==="vertical";return a.jsxs("div",{className:`w-full flex ${p?"flex-row":"flex-col"} ${o}`,children:[a.jsx("div",{className:`${p?"flex flex-col min-w-[160px] border-r border-color-gray-200":"flex space-x-6 border-b border-color-gray-200"} ${r}`,children:e.map(u=>{const v=n===u.key;return a.jsxs("button",{onClick:()=>t(u.key),className:`relative flex ${p?"flex-row items-center px-4 py-3":"flex-col items-center py-4"}
184
+ ${j&&g(j)?"bg-color-gray-100 text-color-gray-400 !cursor-not-allowed hover:bg-color-gray-100":""}`,onClick:()=>j&&P(j),onMouseEnter:()=>j&&E(j),onMouseLeave:A,children:j?j.getDate():""},k))]})]}),(t||o)&&B,a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsx(ze,{fullWidth:!0,onClick:O,disabled:e==="range"&&!w&&!o,className:`${e==="range"&&!w&&!o?"bg-color-gray-400 cursor-not-allowed":""}`,children:"Confirm"})})]});return a.jsxs("div",{className:"relative",children:[a.jsxs(ze,{onClick:ce,fullWidth:!0,color:"gray",variant:"outlined",className:`!justify-between gap-2 ${r||""}`,children:[e==="single"?le?R(le):l:y||V||T?a.jsxs(a.Fragment,{children:[R(y||V,"start")," -"," ",R(w||T,"end")]}):l,s]}),n==="inline"?a.jsx(a.Fragment,{children:v&&Re.createPortal(G,document.body)}):a.jsx(Xn,{open:v,title:o?"Select Time":l,onClose:X,children:a.jsx("div",{className:"w-72",children:G})})]})},Ni=({tabs:e,activeKey:n,onChange:t,className:o="",tabsClass:r="",tabItemClass:i="",tabContentClass:l="",variant:s="horizontal"})=>{const c=e.find(u=>u.key===n),p=s==="vertical";return a.jsxs("div",{className:`w-full flex ${p?"flex-row":"flex-col"} ${o}`,children:[a.jsx("div",{className:`${p?"flex flex-col min-w-[160px] border-r border-color-gray-200":"flex space-x-6 border-b border-color-gray-200"} ${r}`,children:e.map(u=>{const v=n===u.key;return a.jsxs("button",{onClick:()=>t(u.key),className:`relative flex ${p?"flex-row items-center px-4 py-3":"flex-col items-center py-4"}
179
185
  text-sm font-medium transition-color duration-200 bg-color-transparent
180
186
  ${v?"text-color-blue-500":"text-color-gray-600 hover:text-color-blue-500 cursor-pointer"}
181
- ${i}`,children:[a.jsxs("div",{className:`flex items-center ${p?"space-x-3":"space-x-2"}`,children:[u.icon&&a.jsx("span",{children:u.icon}),a.jsx("span",{children:u.label})]}),v&&(p?a.jsx("div",{className:"absolute right-0 top-3 bottom-3 w-1 bg-color-blue-500 rounded-full"}):a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-color-blue-500 rounded-full"}))]},u.key)})}),a.jsx("div",{className:`mt-4 ${p?"ml-6 mt-0":""} ${l}`,children:c==null?void 0:c.content})]})},Ai=({stats:e=[],className:n=""})=>a.jsx(Kn,{className:`w-full ${n}`,children:a.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,o)=>a.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
182
- md:p-2 not-last:pb-4 w-full h-full ${t.className}`,children:[a.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}),a.jsxs("div",{className:"flex flex-col justify-center gap-1 w-full ",children:[a.jsx("div",{className:"text-sm",children:t.name}),a.jsx("div",{className:`text-xl ${t.accentColor} font-semibold`,children:t.value})]})]},o))})});function Ni({items:e=[],logoJSX:n,position:t,defaultActive:o,open:r=!0,onClose:i,onItemSelect:l}){const[s,c]=h.useState(o),p=u=>{c(u),u.onClick&&u.onClick(),l&&l(u)};return a.jsx(a.Fragment,{children:a.jsx(Jn,{open:r,onClose:i,anchor:t,showCloseIcon:!1,children:a.jsxs("div",{className:"",children:[n&&a.jsx("div",{className:"pb-6",children:n}),a.jsx("nav",{className:"space-y-2 text-sm font-medium text-color-gray-700",children:e.map(u=>u.href?a.jsxs("a",{href:u.href,className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
187
+ ${i}`,children:[a.jsxs("div",{className:`flex items-center ${p?"space-x-3":"space-x-2"}`,children:[u.icon&&a.jsx("span",{children:u.icon}),a.jsx("span",{children:u.label})]}),v&&(p?a.jsx("div",{className:"absolute right-0 top-3 bottom-3 w-1 bg-color-blue-500 rounded-full"}):a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-color-blue-500 rounded-full"}))]},u.key)})}),a.jsx("div",{className:`mt-4 ${p?"ml-6 mt-0":""} ${l}`,children:c==null?void 0:c.content})]})},Di=({stats:e=[],className:n=""})=>a.jsx(Kn,{className:`w-full ${n}`,children:a.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,o)=>a.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
188
+ md:p-2 not-last:pb-4 w-full h-full ${t.className}`,children:[a.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}),a.jsxs("div",{className:"flex flex-col justify-center gap-1 w-full ",children:[a.jsx("div",{className:"text-sm",children:t.name}),a.jsx("div",{className:`text-xl ${t.accentColor} font-semibold`,children:t.value})]})]},o))})});function zi({items:e=[],logoJSX:n,position:t,defaultActive:o,open:r=!0,onClose:i,onItemSelect:l}){const[s,c]=h.useState(o),p=u=>{c(u),u.onClick&&u.onClick(),l&&l(u)};return a.jsx(a.Fragment,{children:a.jsx(Jn,{open:r,onClose:i,anchor:t,showCloseIcon:!1,children:a.jsxs("div",{className:"",children:[n&&a.jsx("div",{className:"pb-6",children:n}),a.jsx("nav",{className:"space-y-2 text-sm font-medium text-color-gray-700",children:e.map(u=>u.href?a.jsxs("a",{href:u.href,className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
183
189
  ${u.label===(s==null?void 0:s.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600"}
184
190
  `,onClick:()=>p(u),children:[a.jsx("span",{className:"text-lg",children:u.icon}),a.jsx("span",{children:u.label})]},u.label):a.jsxs("button",{onClick:()=>p(u),className:`flex items-center gap-3 py-3 px-4 cursor-pointer rounded-full w-full no-underline
185
191
  ${u.label===(s==null?void 0:s.label)?"bg-color-blue-500 text-color-white font-medium ":"hover:bg-color-gray-50 text-color-gray-600 bg-color-transparent"}
186
- `,children:[a.jsx("span",{className:"text-lg",children:u.icon}),a.jsx("span",{children:u.label})]},u.label))})]})})})}D.Accordion=Si,D.ActionMenu=yi,D.Alert=_i,D.Avatar=mt,D.Backdrop=oi,D.Badge=Ri,D.BottomNavigation=Ei,D.Breadcrumbs=Mi,D.Button=ze,D.COLOR_MAP=de,D.Card=Kn,D.CardWrapper=ao,D.Carousel=ui,D.Checkbox=lo,D.DashboardStatBoxes=Ai,D.DatePicker=Li,D.Dialog=Xn,D.Divider=mi,D.Drawer=Jn,D.Dropdown=so,D.DropzoneUploader=fr,D.EmptyState=pi,D.IconButton=he,D.List=ti,D.ListItem=ni,D.Menu=kn,D.OtpInput=$n,D.Pagination=Hn,D.PasswordInput=_n,D.Pill=wr,D.ProfileImageShowcase=En,D.ProfileShowcase=En,D.Progress=si,D.RANGE_COLOR_MAP=De,D.RadioGroup=xi,D.Rating=ci,D.Select=vi,D.Sidebar=Ni,D.Skeleton=Bn,D.Slider=ai,D.Snackbar=li,D.Stepper=yr,D.Table=ei,D.Tabs=Fi,D.TextArea=ri,D.TextInput=gt,D.ToggleButton=gi,D.ToggleSwitch=di,D.Tooltip=hi,D.Typography=Vn,D.extendColorMap=ro,D.extendRangeColorMap=io,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
192
+ `,children:[a.jsx("span",{className:"text-lg",children:u.icon}),a.jsx("span",{children:u.label})]},u.label))})]})})})}D.Accordion=ki,D.ActionMenu=Si,D.Alert=Ei,D.Avatar=mt,D.Backdrop=oi,D.Badge=Mi,D.BottomNavigation=Pi,D.Breadcrumbs=Li,D.Button=ze,D.COLOR_MAP=de,D.Card=Kn,D.CardWrapper=ao,D.Carousel=di,D.Checkbox=lo,D.DashboardStatBoxes=Di,D.DatePicker=Ai,D.Dialog=Xn,D.Divider=vi,D.Drawer=Jn,D.Dropdown=so,D.DropzoneUploader=fr,D.EmptyState=fi,D.IconButton=he,D.List=ti,D.ListItem=ni,D.Menu=kn,D.OtpInput=$n,D.Pagination=Hn,D.PasswordInput=_n,D.Pill=wr,D.ProfileImageShowcase=En,D.ProfileShowcase=En,D.Progress=ui,D.RANGE_COLOR_MAP=De,D.RadioGroup=hi,D.Rating=pi,D.Select=bi,D.Sidebar=zi,D.Skeleton=Bn,D.Slider=si,D.Snackbar=ci,D.Stepper=yr,D.Table=ei,D.Tabs=Ni,D.TextArea=ai,D.TextInput=gt,D.ToggleButton=xi,D.ToggleSwitch=gi,D.Tooltip=wi,D.Typography=Vn,D.extendColorMap=ro,D.extendRangeColorMap=io,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
@@ -10,9 +10,10 @@ export declare const COLOR_MAP: Record<CompColor, {
10
10
  export declare const extendColorMap: (newColors: Record<string, {
11
11
  filled: string;
12
12
  outline: string;
13
- text: string;
13
+ transparent: string;
14
14
  accent: string;
15
15
  peer: string;
16
+ text: string;
16
17
  }>) => void;
17
18
  export declare const RANGE_COLOR_MAP: Record<CompColor, {
18
19
  track: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unizap/uniui",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "A UI component library for React",
5
5
  "type": "module",
6
6
  "files": [