@openway/ui 1.0.0 → 1.0.2

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.
Files changed (58) hide show
  1. package/README.md +203 -181
  2. package/dist/chunk-X4LIYOS5.js +3 -0
  3. package/dist/chunk-X4LIYOS5.js.map +1 -0
  4. package/dist/index.cjs +5 -1
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +2740 -1473
  7. package/dist/index.d.ts +2740 -1473
  8. package/dist/index.js +5 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/query.cjs +3 -0
  11. package/dist/query.cjs.map +1 -0
  12. package/dist/query.d.cts +431 -0
  13. package/dist/query.d.ts +431 -0
  14. package/dist/query.js +3 -0
  15. package/dist/query.js.map +1 -0
  16. package/dist/useInfiniteScroll-D9AW6cQV.d.cts +598 -0
  17. package/dist/useInfiniteScroll-D9AW6cQV.d.ts +598 -0
  18. package/docs/AGENTS.md +144 -0
  19. package/docs/README.md +150 -0
  20. package/docs/SKILL.md +54 -0
  21. package/docs/components/alert.md +246 -0
  22. package/docs/components/badge.md +238 -0
  23. package/docs/components/button.md +262 -0
  24. package/docs/components/carousel.md +354 -0
  25. package/docs/components/checkbox.md +252 -0
  26. package/docs/components/collapse.md +318 -0
  27. package/docs/components/confirm.md +322 -0
  28. package/docs/components/datepicker.md +259 -0
  29. package/docs/components/daterangepicker.md +260 -0
  30. package/docs/components/datetimepicker.md +226 -0
  31. package/docs/components/datetimerangepicker.md +222 -0
  32. package/docs/components/dropdown.md +275 -0
  33. package/docs/components/empty.md +200 -0
  34. package/docs/components/file-preview.md +180 -0
  35. package/docs/components/input.md +559 -0
  36. package/docs/components/modal.md +293 -0
  37. package/docs/components/popover.md +255 -0
  38. package/docs/components/radio.md +245 -0
  39. package/docs/components/select.md +254 -0
  40. package/docs/components/skeleton.md +150 -0
  41. package/docs/components/slider.md +346 -0
  42. package/docs/components/table.md +316 -0
  43. package/docs/components/tabs.md +432 -0
  44. package/docs/components/textarea.md +193 -0
  45. package/docs/components/timepicker.md +242 -0
  46. package/docs/components/timerangepicker.md +210 -0
  47. package/docs/components/toast.md +282 -0
  48. package/docs/components/toggle.md +211 -0
  49. package/docs/components/tooltip.md +213 -0
  50. package/docs/components/upload-avatar.md +318 -0
  51. package/docs/components/upload-file.md +245 -0
  52. package/docs/components/upload-image.md +126 -0
  53. package/docs/hooks/useDebounce.md +92 -0
  54. package/docs/hooks/useInfiniteScroll.md +95 -0
  55. package/docs/hooks/useMutationApp.md +242 -0
  56. package/docs/hooks/useSelectInfiniteQuery.md +123 -0
  57. package/docs/hooks/useTableQuery.md +124 -0
  58. package/package.json +31 -12
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
1
  "use client";
2
- var ni={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},ii={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ai={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};function w(e,r,t){return e!=null&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:r[t]}import{jsx as ec,jsxs as Zd}from"react/jsx-runtime";function ke({width:e=16,height:r=16,className:t="",...o}){return Zd("svg",{width:e,height:r,className:`animate-[spin_1s_steps(8)_infinite] ${t}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[ec("path",{d:"M0 0h25v24H0z",fill:"none"}),ec("path",{fill:"currentColor",d:"M4.818 6.664h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541h-.029zm-2.97 7.182h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.278.541h-.031h.002zM12 3.692a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zM4.818 21.029h-.001a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.276.541h-.031zM19.182 7.125a2.308 2.308 0 1 1 0-4.615a2.308 2.308 0 0 1 0 4.615M12 24a1.847 1.847 0 1 1 1.306-.541a1.77 1.77 0 0 1-1.277.541zm10.154-9.231h-.048c-.75 0-1.428-.309-1.913-.807l-.001-.001c-.499-.503-.808-1.196-.808-1.961s.308-1.458.808-1.962a2.66 2.66 0 0 1 1.914-.808h.05h-.003h.048c.75 0 1.427.309 1.913.807l.001.001c.499.503.808 1.196.808 1.961s-.308 1.458-.808 1.962a2.66 2.66 0 0 1-1.915.809h-.049zm-2.971 7.643h-.05a3.1 3.1 0 0 1-2.236-.951l-.001-.001c-.584-.584-.945-1.391-.945-2.283s.361-1.698.945-2.283a3.1 3.1 0 0 1 2.234-.945h.054h-.003h.042c.877 0 1.67.362 2.237.944l.001.001c.588.582.952 1.39.952 2.283s-.364 1.7-.952 2.282a3.1 3.1 0 0 1-2.24.953h-.04z"})]})}import{jsx as Ra,jsxs as qd}from"react/jsx-runtime";function Kr({size:e,variant:r,color:t,radius:o,leftIcon:n,rightIcon:a,isLoading:s=!1,showSpinner:i=!1,loadingText:l,isFullWidth:b=!1,disabled:m=!1,type:x="button",className:c="",children:f,ref:h,...p}){let y=w(e,ni,"md"),S=r==="other"?"":w(t,w(r,ai,"filled"),"primary"),T=w(o,ii,"lg"),k=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",y.button,T,S,b?"w-full":"",m?"opacity-50":"",c].filter(Boolean).join(" "),g=u=>Ra("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon}`,"aria-hidden":"true",children:u}),d=s&&l?l:f;return qd("button",{ref:h,type:x,disabled:m||s,"aria-busy":s,"aria-disabled":m||s,className:k,...p,children:[s&&i&&g(Ra(ke,{})),(!s||!i)&&n&&g(n),d&&Ra("span",{className:"leading-none",children:d}),!s&&a&&g(a)]})}import{jsx as Na}from"react/jsx-runtime";function Da({icon:e,size:r,variant:t,color:o,radius:n,isLoading:a=!1,showSpinner:s=!1,disabled:i=!1,type:l="button",className:b="",ref:m,...x}){let c=w(r,ni,"md"),f=t==="other"?"":w(o,w(t,ai,"filled"),"primary"),h=w(n,ii,"full"),p=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",c.iconOnly,h,f,i?"opacity-50":"",b].filter(Boolean).join(" "),y=S=>Na("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${c.icon}`,"aria-hidden":"true",children:S});return Na("button",{ref:m,type:l,disabled:i||a,"aria-busy":a,"aria-disabled":i||a,className:p,...x,children:y(a&&s?Na(ke,{}):e)})}var rc={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},tc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},oc={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},nc={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};import{jsx as ic}from"react/jsx-runtime";function Le({width:e=14,height:r=14,className:t="",...o}){return ic("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:ic("path",{d:"M18 6 6 18M6 6l12 12"})})}import{jsx as on,jsxs as Jd}from"react/jsx-runtime";function tt({size:e="md",variant:r="soft",color:t="primary",radius:o="full",dot:n=!1,dotPing:a=!1,leftIcon:s,rightIcon:i,onDelete:l,deleteAriaLabel:b="Remove",className:m="",children:x,onClick:c,ref:f,...h}){let p=w(e,rc,"md"),y=r==="other"?"":w(t,w(r,nc,"soft"),"primary"),S=w(t,oc,"primary"),T=w(o,tc,"full"),k=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",p.badge,T,y,c?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",m].filter(Boolean).join(" "),g=d=>on("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:d});return Jd("span",{ref:f,role:c?"button":void 0,tabIndex:c?0:void 0,className:k,onClick:c,...h,children:[n&&on("span",{className:`relative inline-block shrink-0 rounded-full ${a?"animate-pulse":""} ${p.dot} ${S}`,"aria-hidden":"true"}),s&&g(s),x&&on("span",{className:"leading-none",children:x}),i&&!l&&g(i),l&&on("button",{type:"button",onClick:d=>{d.stopPropagation(),l()},"aria-label":b,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${p.deleteIcon}`,children:on(Le,{className:"size-full"})})]})}import{useId as e0,useState as r0,useRef as t0}from"react";import{useMergeRefs as o0}from"@floating-ui/react";var si={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},fo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ac={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},sc={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},po={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},li={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},lc={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};import{useEffect as Qd,useState as Pa}from"react";function cc(e,r={}){let{exitDuration:t=250}=r,[o,n]=Pa(e),[a,s]=Pa(!1),[i,l]=Pa(e);return e!==i&&(l(e),e?(n(e),s(!1)):s(!0)),Qd(()=>{if(!a)return;let b=setTimeout(()=>{n(void 0),s(!1)},t);return()=>clearTimeout(b)},[t,a]),{displayedError:o,isExiting:a}}import{jsx as za}from"react/jsx-runtime";function Ee({id:e,helperText:r,errorMessage:t,sizeClassName:o="text-xs",className:n=""}){let{displayedError:a,isExiting:s}=cc(t),i=a||r,l=!!(a||r),b=!!a;return za("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:za("div",{className:"overflow-hidden",children:za("div",{id:e,role:b?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${o} ${b?s?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${n}`,children:i||"\xA0"})})})}import{jsx as Cr,jsxs as go}from"react/jsx-runtime";function Xr({size:e,variant:r,color:t,radius:o,label:n,labelPlacement:a="floating",config:s,helperText:i,errorMessage:l,leftIcon:b,leftAddon:m,rightIcon:x,rightAddon:c,onClear:f,wrapperClassName:h="",inputWrapperClassName:p="",labelClassName:y="",helperClassName:S="",id:T,value:k,defaultValue:g,onChange:d,disabled:u=!1,readOnly:v=!1,className:C="",type:R="text",placeholder:N,ref:D,...V}){let{isRequired:Y=!1,isInvalid:L=!1,isLoading:z=!1,showSpinner:A=!1,isClearable:O=!1,isFullWidth:G=!1}=s??{},U=e0(),M=T||U,P=`${M}-error-helper`,$=t0(null),K=o0([$,D]),X=k!==void 0,[B,oe]=r0(g),q=X?k:B,ee=ye=>{X||oe(ye.target.value),d?.(ye)},ne=()=>{X||oe(""),f?.()},le=q!=null?String(q).length>0:!1,_=!!(L||l),W=_?"error":t,se=w(e,si,"md"),Z=w(o,fo,"md"),F=r==="other"?"":w(W,w(r,po,"outline"),"primary"),j=ye=>Cr("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${se.icon}`,"aria-hidden":"true",children:ye}),re=a==="floating",Se=()=>{if(!n)return null;let ye=_?"text-error-600 font-bold":w(W,li,"primary");return re?go("label",{htmlFor:M,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-text font-bold bg-neutral-white transition-colors duration-150 ${se.floatingLabel} ${ye} ${y}`,children:[n,Y&&Cr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):go("label",{htmlFor:M,className:`inline-flex items-center font-bold transition-colors duration-150 ${se.label} ${ye} ${y}`,children:[n,Y&&Cr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},ie=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",se.wrapper,Z,F,u?"opacity-50":"",G?"w-full":"w-auto",p].filter(Boolean).join(" "),de=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",se.input,b?"pl-1.5":"",x||O||z?"pr-1.5":"",C].filter(Boolean).join(" ");return go("div",{className:`group/field flex ${a==="left"?"flex-row items-center gap-3":"flex-col"} ${G?"w-full":"inline-flex"} ${h}`,children:[!re&&Se(),go("div",{className:`flex flex-col ${G?"w-full":""}`,children:[go("div",{className:"flex items-stretch",children:[m&&Cr("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${Z?`${Z} rounded-r-none`:""}`,children:m}),go("div",{className:`${ie} ${m?"rounded-l-none!":""} ${c?"rounded-r-none!":""}`,children:[re&&Se(),b&&Cr("div",{className:"flex items-center justify-center pl-3 shrink-0",children:j(b)}),Cr("input",{ref:K,id:M,type:R,value:q,onChange:ee,disabled:u||z,readOnly:v,"aria-invalid":_,"aria-required":Y,"aria-describedby":l||i?P:void 0,"aria-errormessage":l?P:void 0,"aria-busy":z,"aria-disabled":u||z,placeholder:N,className:de,...V}),z&&A&&Cr("div",{className:"flex items-center justify-center pr-3 shrink-0",children:j(Cr(ke,{}))}),!z&&O&&!u&&!v&&Cr("button",{type:"button",onClick:ne,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:le?0:-1,"aria-hidden":!le,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${se.icon} ${le?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Cr(Le,{className:"size-full"})}),!z&&x&&Cr("div",{className:"flex items-center justify-center pr-3 shrink-0",children:j(x)})]}),c&&Cr("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${Z?`${Z} rounded-l-none`:""}`,children:c})]}),Cr(Ee,{id:P,helperText:i,errorMessage:l,sizeClassName:se.helper,className:S})]})]})}import{useState as n0}from"react";import{jsx as mo,jsxs as dc}from"react/jsx-runtime";function Ia({width:e=16,height:r=16,className:t="",...o}){return dc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[mo("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),mo("circle",{cx:"12",cy:"12",r:"3"})]})}function uc({width:e=16,height:r=16,className:t="",...o}){return dc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[mo("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),mo("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),mo("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),mo("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var nn=Ia;import{jsx as ci}from"react/jsx-runtime";function Ma({defaultVisible:e=!1,toggleAriaLabel:r="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:t,rightIcon:o,disabled:n,readOnly:a,...s}){let[i,l]=n0(e);return ci(Xr,{type:i?"text":"password",disabled:n,readOnly:a,rightIcon:o||ci("button",{type:"button",onClick:()=>{if(n||a)return;let x=!i;l(x),t?.(x)},disabled:n||a,"aria-label":r,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:i?ci(uc,{className:"size-full"}):ci(Ia,{className:"size-full"})}),...s})}import{useState as i0}from"react";function gt(e,r){if(e==null||e==="")return"";let t=r?.thousandSeparator??".",o=r?.decimalSeparator??",",n=r?.maxDecimalDigits??0,a=r?.min,s=r?.max,i=r?.clampMin??!1,l=r?.allowNegative??(a===void 0||a<0),b=String(e).trim();if(!b)return"";let m=l&&b.startsWith("-");if(m&&b==="-")return"-";if(n>0&&b.includes(o)){let y=b.split(o),S=y[0]?.replace(/\D/g,"")??"",T=y.slice(1).join("").replace(/\D/g,"").slice(0,n);if(S||T){let d=parseFloat(`${S||"0"}.${T||"0"}`);if(m&&(d=-d),s!==void 0&&!isNaN(d)&&d>s)return gt(s,{...r,max:void 0,min:void 0});if(a!==void 0&&!isNaN(d)&&d<a&&(i||m&&a<0))return gt(a,{...r,max:void 0,min:void 0})}let k=S?parseInt(S,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,t):"",g=m?"-":"";return y.length>1&&y[1]===""&&T===""?`${g}${k||"0"}${o}`:T.length>0?`${g}${k||"0"}${o}${T}`:`${g}${k}`}let x=b.replace(/\D/g,"");if(!x)return m?"-":"";let c=parseInt(x,10);if(isNaN(c))return"";m&&(c=-c),s!==void 0&&c>s&&(c=s),a!==void 0&&c<a&&(i||m&&a<0)&&(c=a);let f=c<0?"-":"",h=Math.abs(c).toString().replace(/\B(?=(\d{3})+(?!\d))/g,t);return`${f}${h}`}function fc(e,r){let t=r?.thousandSeparator??".";return e.split(t).join("")}function ui(e,r){if(!e)return;let t=r?.thousandSeparator??".",o=r?.decimalSeparator??",",n=e.split(t).join("");if(o!=="."&&(n=n.split(o).join(".")),n=n.replace(/[^\d.-]/g,""),!n||n==="."||n==="-")return;let a=parseFloat(n);return isNaN(a)?void 0:a}function Ea(e,r,t,o){let n=o?.decimalSeparator??",",a=0;for(let l=0;l<t&&l<e.length;l++){let b=e.charAt(l);(/\d/.test(b)||b===n||b==="-")&&a++}if(a===0)return 0;let s=r.length,i=0;for(let l=0;l<r.length;l++){let b=r.charAt(l);if((/\d/.test(b)||b===n||b==="-")&&i++,i===a){s=l+1;break}}return Math.min(s,r.length)}function di(e,r="numeric"){return r==="numeric"?/^\d$/.test(e):r==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function fi(e,r="numeric"){return r==="numeric"?e.replace(/\D/g,""):r==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function pi(e,r=/[\r\n,;\t]+/,t=!0){return e?e.split(r).map(o=>t?o.trim():o).filter(Boolean):[]}import{jsx as a0}from"react/jsx-runtime";function $a({value:e,defaultValue:r,min:t,max:o,thousandSeparator:n=".",decimalSeparator:a=",",maxDecimalDigits:s=0,allowNegative:i,onChange:l,onClear:b,onBlur:m,ref:x,...c}){let f={max:o,min:t,thousandSeparator:n,decimalSeparator:a,maxDecimalDigits:s,allowNegative:i},h=e!==void 0,[p,y]=i0(r),S=h?e:p,T=gt(S,f),k=()=>{h||y(""),b?.()},g=u=>{let v=u.target,C=v.value,R=v.selectionStart||0,N=gt(C,f),D=Ea(C,N,R,{decimalSeparator:a});if(h||y(N),v.value=N,l){let V={...u,target:v,currentTarget:v};l(V)}requestAnimationFrame(()=>{v&&v.setSelectionRange&&v.setSelectionRange(D,D)})},d=u=>{if(t!==void 0&&S!==void 0&&S!==null&&S!==""){let v=ui(String(S),{thousandSeparator:n,decimalSeparator:a});if(v!==void 0&&v<t){let C=gt(t,{...f,clampMin:!0});if(h||y(C),l){u.target.value=C;let R={...u,target:u.target,currentTarget:u.target};l(R)}}}m?.(u)};return a0(Xr,{ref:x,type:"text",inputMode:s>0?"decimal":"numeric",value:T,onChange:g,onBlur:d,onClear:k,...c})}import{useId as s0,useState as l0,useEffect as c0,useRef as u0,useImperativeHandle as d0}from"react";import{jsx as Vt,jsxs as an}from"react/jsx-runtime";function La({ref:e,config:r,id:t,name:o,length:n=6,value:a,defaultValue:s="",onChange:i,onComplete:l,type:b="numeric",mask:m=!1,size:x="md",variant:c="outline",color:f="primary",radius:h,autoFocus:p=!1,disabled:y=!1,readOnly:S=!1,groupSize:T,separator:k="-",ariaLabel:g="One-time password",getSlotAriaLabel:d,allowOneTimeCode:u=!0,label:v,labelPlacement:C="top",helperText:R,errorMessage:N,className:D="",slotClassName:V="",wrapperClassName:Y="",labelClassName:L="",helperClassName:z=""}){let{isRequired:A=!1,isInvalid:O=!1,isLoading:G=!1,showSpinner:U=!1}=r??{},M=s0(),P=t||M,$=`${P}-slot-0`,K=`${P}-error-helper`,[X,B]=l0(()=>{let J=(a!==void 0?a:s).split("");return Array.from({length:n},(E,I)=>J[I]||"")}),oe=u0([]),q=a!==void 0,ee=q?Array.from({length:n},(J,E)=>a&&a[E]!==void 0?a[E]:""):X,ne=!!(O||N),le=ne?"error":f;c0(()=>{if(p&&!y&&!S){let J=ee.findIndex(I=>!I),E=J!==-1?J:0;oe.current[E]?.focus()}},[p,ee,y,S]),d0(e,()=>({getValue:()=>ee.join(""),clear:()=>{let J=Array(n).fill("");q||B(J),i?.(""),!y&&!S&&oe.current[0]?.focus()},focus:(J=0)=>{let E=Math.max(0,Math.min(J,n-1));oe.current[E]?.focus()}}),[ee,n,q,i,y,S]);let _=J=>{q||B(J);let E=J.join("");i?.(E),J.every(I=>I.length>0)&&J.length===n&&l?.(E)},W=(J,E)=>{let I=fi(J,b);if(!I)return;let fe=[...ee],Q=I.length>=n?0:E,xe=I.slice(0,n-Q).split("");xe.forEach((be,ce)=>{Q+ce<n&&(fe[Q+ce]=be)}),_(fe);let ge=Math.min(Q+xe.length,n-1);oe.current[ge]?.focus()},se=(J,E)=>{if(y||S||G)return;let I=J.target.value;if(!I){let Q=[...ee];Q[E]="",_(Q);return}if(I.length>1){W(I,E);return}let fe=I.slice(-1);if(di(fe,b)){let Q=[...ee];Q[E]=fe,_(Q),E<n-1&&oe.current[E+1]?.focus()}},Z=(J,E)=>{if(!(y||S||G)){if(J.key==="Backspace"){J.preventDefault();let I=[...ee];ee[E]?(I[E]="",_(I)):E>0&&(I[E-1]="",_(I),oe.current[E-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let I=[...ee];I[E]="",_(I)}else if(J.key==="ArrowLeft")J.preventDefault(),E>0&&oe.current[E-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),E<n-1&&oe.current[E+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let I=ee.join("");I&&navigator.clipboard?.writeText(I)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let I=ee.join("");I&&navigator.clipboard?.writeText(I);let fe=Array(n).fill("");_(fe),oe.current[0]?.focus()}}},F=(J,E)=>{if(y||S||G)return;J.preventDefault();let I=J.clipboardData.getData("text/plain");W(I,E)},j=w(x,lc,"md"),re=w(x,si,"md"),Se=w(h,fo,"md"),ie=c==="other"?"":w(le,w(c,po,"outline"),"primary"),de=y?"opacity-50":"",Te=()=>v?an("label",{htmlFor:$,className:`block font-medium text-neutral-700 select-none ${j.label} ${L}`,children:[v,A&&Vt("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return an("div",{className:`group/otp flex ${C==="left"?"flex-row items-start gap-3":"flex-col"} ${Y}`,children:[Te(),an("div",{className:"flex flex-col",children:[an("div",{role:"group","aria-label":g,"aria-describedby":N||R?K:void 0,"aria-errormessage":N?K:void 0,className:`inline-flex items-center ${j.gap} ${D}`,children:[Array.from({length:n}).map((J,E)=>{let I=!!(m||b==="password"),fe=d?d(E,n):`K\xFD t\u1EF1 ${E+1} tr\xEAn ${n}`,Q=!!(T&&T>0)&&(E+1)%(T||1)===0&&E<n-1;return an("div",{className:"inline-flex items-center gap-1.5",children:[Vt("input",{id:`${P}-slot-${E}`,ref:xe=>{oe.current[E]=xe},type:I?"password":"text",inputMode:b==="numeric"?"numeric":"text",pattern:b==="numeric"?"[0-9]*":void 0,maxLength:1,value:ee[E]||"",onFocus:xe=>xe.target.select(),onChange:xe=>se(xe,E),onKeyDown:xe=>Z(xe,E),onPaste:xe=>F(xe,E),disabled:y||G,readOnly:S,"aria-label":fe,"aria-invalid":ne,"aria-required":A,"aria-busy":G,"aria-disabled":y||G,autoComplete:u?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${j.slot} ${j.text} ${Se} ${ie} ${de} ${V}`}),Q&&Vt("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:k})]},`${P}-slot-${E}`)}),G&&U&&Vt("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:Vt(ke,{className:`animate-spin ${re.icon}`})})]}),Vt(Ee,{id:K,helperText:R,errorMessage:N,sizeClassName:j.helper,className:z}),o&&Vt("input",{type:"hidden",name:o,value:ee.join(""),disabled:y||G})]})]})}import{useId as p0,useState as Fa,useRef as g0}from"react";import{useMergeRefs as m0}from"@floating-ui/react";import{jsx as pc,jsxs as f0}from"react/jsx-runtime";function bo({width:e=14,height:r=14,className:t="",...o}){return f0("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[pc("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),pc("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{Fragment as b0,jsx as Ke,jsxs as ot}from"react/jsx-runtime";function Ba({size:e,variant:r,color:t,radius:o,label:n,labelPlacement:a="floating",config:s,helperText:i,errorMessage:l,leftIcon:b,leftAddon:m,rightIcon:x,rightAddon:c,onClear:f,wrapperClassName:h="",inputWrapperClassName:p="",labelClassName:y="",helperClassName:S="",id:T,name:k,value:g,defaultValue:d=[],onChange:u,inputValue:v,onInputValueChange:C,delimiters:R=["Enter"],showAddButton:N=!1,renderAddButton:D,addOnBlur:V=!1,addOnPaste:Y=!0,pasteSplitRegex:L=/[\r\n,;\t]+/,trimValues:z=!0,allowDuplicates:A=!1,onDuplicate:O,maxTags:G,onMaxTagsReached:U,maxTagLength:M,validateTag:P,onValidateError:$,maxTagCount:K,renderTag:X,tagVariant:B,tagColor:oe,tagRadius:q,tagSize:ee,tagClassName:ne="",addButtonClassName:le="",disabled:_=!1,readOnly:W=!1,className:se="",placeholder:Z="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:F=!1,ref:j}){let{isRequired:re=!1,isInvalid:Se=!1,isLoading:ie=!1,showSpinner:de=!1,isClearable:Te=!1,isFullWidth:ye=!1}=s??{},J=p0(),E=T||J,I=`${E}-error-helper`,fe=n?`${E}-label`:void 0,Q=g0(null),xe=m0([Q,j]),ge=g!==void 0,[be,ce]=Fa(d),pe=ge?g||[]:be,De=v!==void 0,[ue,Pe]=Fa(""),he=De?v||"":ue,[Be,Me]=Fa(""),ze=H=>{De||Pe(H),C?.(H)},Ie=H=>{ge||ce(H),u?.(H)},Fe=H=>{if(_||W||ie)return!1;let ae=z?H.trim():H;if(!ae)return!1;if(M&&M>0&&ae.length>M&&(ae=ae.slice(0,M)),G!==void 0&&pe.length>=G)return U?.(ae),Me(`Maximum limit of ${G} tags reached`),!1;if(!A&&pe.includes(ae))return O?.(ae),Me(`Tag "${ae}" already exists`),!1;if(P){let Ve=P(ae);if(Ve===!1||typeof Ve=="string")return $?.(ae,typeof Ve=="string"?Ve:void 0),Me(`Tag "${ae}" is invalid`),!1}let Ne=[...pe,ae];return Ie(Ne),ze(""),Me(`Added tag "${ae}"`),!0},Ge=H=>{if(_||W||ie)return;let ae=[...pe],Ne=new Set(pe),Ve=0;for(let Ye of H){let Oe=z?Ye.trim():Ye;if(Oe){if(M&&M>0&&Oe.length>M&&(Oe=Oe.slice(0,M)),G!==void 0&&ae.length>=G){U?.(Oe);break}if(!A&&Ne.has(Oe)){O?.(Oe);continue}if(P){let pt=P(Oe);if(pt===!1||typeof pt=="string"){$?.(Oe,typeof pt=="string"?pt:void 0);continue}}ae.push(Oe),Ne.add(Oe),Ve++}}Ie(ae),ze(""),Ve>0&&Me(`Added ${Ve} tags`)},Xe=H=>{if(_||W||ie)return;let ae=pe[H],Ne=pe.filter((Ve,Ye)=>Ye!==H);Ie(Ne),ae&&Me(`Removed tag "${ae}"`)},je=H=>{H?.stopPropagation(),!(_||W||ie)&&(Ie([]),ze(""),Me("Removed all tags"),f?.(),Q.current?.focus())},Je=H=>{if(_||W||ie)return;R.includes(H.key)||R.includes("Enter")&&H.key==="Enter"||R.includes("Comma")&&(H.key===","||H.key==="Comma")||R.includes("Tab")&&H.key==="Tab"||R.includes("Space")&&(H.key===" "||H.key==="Space")?he&&(H.preventDefault(),Fe(he)):H.key==="Backspace"&&he===""&&pe.length>0&&(H.preventDefault(),Xe(pe.length-1))},Ze=H=>{if(!(_||W||ie)&&Y){let ae=H.clipboardData.getData("text");if(ae){let Ne=pi(ae,L,z);(Ne.length>1||L.test(ae))&&(H.preventDefault(),Ge(Ne))}}},_e=()=>{V&&he.trim()&&Fe(he)},te=pe.length>0||he.length>0,Ae=!!(Se||l),We=Ae?"error":t,me=w(e,sc,"md"),Ue=w(o,fo,"md"),er=q||w(o,ac,"md"),rr=ee||me.badgeSize||"sm",cr=oe||t,ve=B||r,wr=r==="other"?"":w(We,w(r,po,"outline"),"primary"),Ce=a==="floating",we=H=>Ke("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${me.icon}`,"aria-hidden":"true",children:H}),nr=()=>{if(!n)return null;let H=Ae?"text-error-600 font-bold":w(We,li,"primary");return Ce?ot("label",{id:fe,htmlFor:E,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-text font-bold bg-neutral-white transition-colors duration-150 ${me.floatingLabel} ${H} ${y}`,children:[n,re&&Ke("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):ot("label",{id:fe,htmlFor:E,className:`inline-flex items-center font-bold transition-colors duration-150 ${me.label} ${H} ${y}`,children:[n,re&&Ke("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},ir=K&&K>0?pe.slice(0,K):pe,fr=K&&K>0?Math.max(0,pe.length-K):0,Bt=_?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",ft=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",me.wrapper,Ue,wr,Bt,ye?"w-full":"w-auto min-w-[200px]",p].filter(Boolean).join(" "),$e=a==="left",pr=G===void 0||pe.length<G,Wr=N&&!_&&!W;return ot("div",{role:"group","aria-labelledby":fe,className:`group/field flex ${$e?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${h}`,children:[Ke("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Be}),!Ce&&nr(),ot("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[ot("div",{className:"flex items-stretch",children:[m&&Ke("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${Ue?`${Ue} rounded-r-none`:""}`,children:m}),ot("div",{className:`${ft} ${m?"rounded-l-none!":""} ${c?"rounded-r-none!":""}`,children:[Ce&&nr(),b&&Ke("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:we(b)}),ot("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${me.gap}`,children:[(()=>{let H=new Map;return ir.map((ae,Ne)=>{let Ve=(H.get(ae)??0)+1;H.set(ae,Ve);let Ye=`${ae}_${Ve}`;return X?Ke("span",{className:"inline-flex shrink-0",children:X({value:ae,index:Ne,onRemove:()=>Xe(Ne),disabled:_,readOnly:W})},Ye):Ke("span",{className:"inline-flex shrink-0",children:Ke(tt,{size:rr,variant:ve,color:cr,radius:er,deleteAriaLabel:`Remove tag ${ae}`,onDelete:!_&&!W?()=>Xe(Ne):void 0,className:`shrink-0 max-w-full truncate select-none ${ne}`,children:ae})},Ye)})})(),fr>0&&Ke("span",{className:"inline-flex shrink-0",children:ot(tt,{size:rr,variant:"filled",color:"neutral",radius:er,className:"shrink-0 font-medium select-none",children:["+",fr]})}),pr?Ke("input",{ref:xe,id:E,type:"text",value:he,onChange:H=>ze(H.target.value),onKeyDown:Je,onPaste:Ze,onBlur:_e,disabled:_||ie,readOnly:W,autoFocus:F,"aria-invalid":Ae,"aria-required":re,"aria-describedby":l||i?I:void 0,"aria-errormessage":l?I:void 0,"aria-busy":ie,"aria-disabled":_||ie,"aria-autocomplete":"none",placeholder:pe.length===0?Z:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${me.input} ${se}`}):null]}),Wr&&Ke("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:D?D({onAdd:()=>Fe(he),disabled:!he.trim()||!pr}):Ke("button",{type:"button",onClick:H=>{H.stopPropagation(),he.trim()&&pr?Fe(he):Q.current?.focus()},disabled:!he.trim()||!pr,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${le}`,children:Ke(bo,{className:me.icon})})}),ie&&de&&Ke("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:we(Ke(ke,{}))}),!ie&&Te&&!_&&!W&&Ke("button",{type:"button",onClick:je,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:te?0:-1,"aria-hidden":!te,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${me.icon} ${te?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Ke(Le,{className:"size-full"})}),!ie&&x&&Ke("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:we(x)})]}),c&&Ke("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${Ue?`${Ue} rounded-l-none`:""}`,children:c})]}),Ke(Ee,{id:I,helperText:i,errorMessage:l,sizeClassName:me.helper,className:S}),k&&(()=>{let H=new Map;return ot(b0,{children:[pe.map(ae=>{let Ne=(H.get(ae)??0)+1;H.set(ae,Ne);let Ve=`${ae}_${Ne}`;return Ke("input",{type:"hidden",name:`${k}[]`,value:ae,disabled:_||ie},`hidden_${Ve}`)}),pe.length===0&&Ke("input",{type:"hidden",name:k,value:"",disabled:_||ie})]})})()]})]})}import{useId as h0,useState as x0,useRef as v0}from"react";import y0 from"react-textarea-autosize";import{useMergeRefs as w0}from"@floating-ui/react";var gc={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},mc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},bc={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},hc={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}},xc={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"};import{jsx as nt,jsxs as ho}from"react/jsx-runtime";function Va({size:e,variant:r,color:t,radius:o,label:n,labelPlacement:a="floating",config:s,helperText:i,errorMessage:l,onClear:b,minRows:m=3,maxRows:x,onHeightChange:c,cacheMeasurements:f,resize:h="none",wrapperClassName:p="",textareaWrapperClassName:y="",labelClassName:S="",helperClassName:T="",countClassName:k="",id:g,value:d,defaultValue:u,onChange:v,disabled:C=!1,readOnly:R=!1,className:N="",placeholder:D,maxLength:V,ref:Y,style:L,...z}){let{isRequired:A=!1,isInvalid:O=!1,isLoading:G=!1,showSpinner:U=!1,isClearable:M=!1,showCount:P=!1,isFullWidth:$=!1,autoResize:K=!0}=s??{},X=h0(),B=g||X,oe=`${B}-error-helper`,q=v0(null),[ee,ne]=x0(u),le=w0([q,Y]),_=d!==void 0,W=_?d:ee,se=!!(O||l),Z=se?"error":t,F=w(e,gc,"md"),j=w(o,mc,"md"),re=K?"resize-none":w(h,bc,"none"),Se=r==="other"?"":w(Z,w(r,hc,"outline"),"primary"),ie=W!=null?String(W).length:0,de=ie>0,Te=be=>{let ce=be.target.value;V!==void 0&&ce.length>V&&(ce=ce.slice(0,V),be.target.value=ce),_||ne(ce),v?.(be)},ye=()=>{_||ne(""),b?.()},J=a==="floating",E=()=>{if(!n)return null;let be=se?"text-error-600 font-bold":w(Z,xc,"primary");return J?ho("label",{htmlFor:B,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-text font-bold bg-neutral-white transition-colors duration-150 ${F.floatingLabel} ${be} ${S}`,children:[n,A&&nt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):ho("label",{htmlFor:B,className:`inline-flex items-center font-bold transition-colors duration-150 ${F.label} ${be} ${S}`,children:[n,A&&nt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},I=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",j,Se,C?"opacity-50":"",$?"w-full":"w-auto",y].filter(Boolean).join(" "),fe=M||G&&U,Q=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",F.textarea,fe?"pr-8":"",P?"pb-6":"",re,N].filter(Boolean).join(" "),xe=a==="left",ge={id:B,value:W,onChange:Te,disabled:C||G,readOnly:R,maxLength:V,"aria-invalid":se,"aria-required":A,"aria-describedby":l||i?oe:void 0,"aria-errormessage":l?oe:void 0,"aria-busy":G,"aria-disabled":C||G,placeholder:D,className:Q,style:L,...z};return ho("div",{className:`group/field flex ${xe?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${$?"w-full":"inline-flex"} ${p}`,children:[!J&&E(),ho("div",{className:`flex flex-col ${$?"w-full":""}`,children:[ho("div",{className:I,children:[J&&E(),K?nt(y0,{ref:le,minRows:m,maxRows:x,onHeightChange:c,cacheMeasurements:f,...ge}):nt("textarea",{ref:le,rows:m,...ge}),G&&U&&nt("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:nt(ke,{className:"size-full animate-spin"})}),!G&&M&&!C&&!R&&nt("button",{type:"button",onClick:ye,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:de?0:-1,"aria-hidden":!de,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${de?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:nt(Le,{className:"size-full"})}),P&&ho("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${k}`,children:[ie,V!==void 0&&`/${V}`]})]}),nt(Ee,{id:oe,helperText:i,errorMessage:l,sizeClassName:F.helper,className:T})]})]})}import{useId as S0,useState as T0,useEffect as R0,useRef as N0,useImperativeHandle as D0}from"react";var Ht={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",rounded:"rounded-[3px]",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",rounded:"rounded-sm",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",rounded:"rounded-md",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",rounded:"rounded-md",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",rounded:"rounded-lg",helper:"text-sm"}},Ha={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},xo={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}};import{createContext as C0,useContext as k0}from"react";var sn=C0(void 0),gi=()=>k0(sn);import{jsx as vc}from"react/jsx-runtime";function mt({width:e=14,height:r=14,className:t="",...o}){return vc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:vc("polyline",{points:"20 6 9 17 4 12"})})}import{jsx as yc}from"react/jsx-runtime";function mi({width:e=14,height:r=14,className:t="",...o}){return yc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:yc("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}import{jsx as _r,jsxs as Aa}from"react/jsx-runtime";function ln({size:e,variant:r,color:t,radius:o,indeterminate:n=!1,isLoading:a,isInvalid:s,isRequired:i,label:l,children:b,helperText:m,errorMessage:x,labelPlacement:c,icon:f,indeterminateIcon:h,wrapperClassName:p="",boxClassName:y="",labelClassName:S="",helperClassName:T="",className:k="",checked:g,defaultChecked:d,disabled:u,readOnly:v,onChange:C,value:R,id:N,name:D,ref:V,...Y}){let L=l||b,z=gi(),A=S0(),O=N||A,G=`${O}-helper`,U=e??z?.size??"md",M=r??z?.variant??"filled",P=t??z?.color??"primary",$=o??z?.radius,K=u??z?.disabled??!1,X=v??z?.isReadOnly??!1,B=a??z?.isLoading??!1,oe=i??z?.isRequired??!1,q=!!(s??z?.isInvalid??!!x),ee=c??z?.labelPlacement??"right",ne=z?.value!==void 0&&R!==null&&R!==void 0,le=g!==void 0,[_,W]=T0(d??!1),se=ne?z.value.includes(String(R)):le?g:_,Z=N0(null);D0(V,()=>Z.current),R0(()=>{Z.current&&(Z.current.indeterminate=!!n)},[n]);let F=fe=>{K||X||B||(z?.onChange&&R!==void 0&&z.onChange(String(R),fe.target.checked),!le&&!ne&&W(fe.target.checked),C?.(fe))},j=Ht[U]||Ht.md,re=$?Ha[$]:j.rounded,Se=se||n,ie;M==="other"?ie="":Se?ie=xo[M]?.[P]||xo.filled.primary:ie="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",q&&(ie=Se?xo[M==="other"?"filled":M]?.error||xo.filled.error:"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let de=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",j.box,re,ie,!K&&!X&&!B?"active:scale-95":"",y].filter(Boolean).join(" "),Te=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",j.label,K?"opacity-60":"",S].filter(Boolean).join(" "),ye=["group inline-flex relative",ee==="left"?"flex-row-reverse justify-between":"flex-row",j.gap,K?"cursor-not-allowed opacity-60":"cursor-pointer",p,k].filter(Boolean).join(" "),J=()=>B?_r("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:_r(ke,{className:"size-full animate-spin"})}):n?_r("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:h||_r(mi,{className:"size-full"})}):se?_r("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:f||_r(mt,{className:"size-full"})}):null,E=!!L;return Aa("div",{className:"inline-flex flex-col",children:[Aa("label",{className:ye,onClick:fe=>{(K||X||B)&&fe.preventDefault()},children:[_r("input",{ref:Z,type:"checkbox",id:O,name:D??z?.name,value:R,checked:se,disabled:K||B,readOnly:X,required:oe,"aria-checked":n?"mixed":se,"aria-invalid":q,"aria-required":oe,"aria-busy":B,"aria-disabled":K||B,"aria-describedby":x||m?G:void 0,onChange:F,className:"sr-only peer",...Y}),_r("span",{className:de,"aria-hidden":"true",children:J()}),E&&Aa("span",{className:Te,children:[L,oe&&_r("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),_r(Ee,{id:G,helperText:m,errorMessage:x,sizeClassName:j.helper,className:T})]})}import{useState as P0,useId as z0,useMemo as I0,useCallback as M0}from"react";import{jsx as bi,jsxs as wc}from"react/jsx-runtime";function cn({value:e,defaultValue:r=[],onChange:t,size:o="md",color:n="primary",variant:a="filled",radius:s,disabled:i=!1,isReadOnly:l=!1,isLoading:b=!1,isInvalid:m,isRequired:x=!1,label:c,helperText:f,errorMessage:h,orientation:p="vertical",labelPlacement:y="right",className:S="",wrapperClassName:T="",labelClassName:k="",helperClassName:g="",children:d,ref:u,...v}){let C=z0(),R=`${C}-label`,N=`${C}-helper`,D=e!==void 0,[V,Y]=P0(r),L=D?e:V,z=!!(m??!!h),A=M0((P,$)=>{if(i||l||b)return;let K;$?K=[...L,P]:K=L.filter(X=>X!==P),D||Y(K),t?.(K)},[i,l,b,L,D,t]),O=I0(()=>({value:L,onChange:A,size:o,color:n,variant:a,radius:s,disabled:i,isReadOnly:l,isLoading:b,isInvalid:z,isRequired:x,labelPlacement:y}),[L,A,o,n,a,s,i,l,b,z,x,y]),G=p==="horizontal"?"flex flex-row flex-wrap gap-4 items-center":"flex flex-col gap-2.5",U=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",i?"opacity-60":"",k].filter(Boolean).join(" "),M=Ht[o]||Ht.md;return wc("div",{ref:u,role:"group","aria-labelledby":c?R:void 0,"aria-describedby":h||f?N:void 0,"aria-errormessage":h?N:void 0,"aria-invalid":z?"true":void 0,"aria-disabled":i?"true":void 0,"aria-busy":b?"true":void 0,className:`inline-flex flex-col ${T}`,...v,children:[c&&wc("span",{id:R,className:U,children:[c,x&&bi("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),bi("div",{className:`${G} ${S}`,children:bi(sn.Provider,{value:O,children:d})}),bi(Ee,{id:N,helperText:f,errorMessage:h,sizeClassName:M.helper,className:g})]})}import{useId as L0,useState as F0,useRef as B0,useImperativeHandle as V0}from"react";var At={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},vo={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}};import{createContext as E0,useContext as $0}from"react";var un=E0(void 0),hi=()=>$0(un);import{jsx as Cc}from"react/jsx-runtime";function xi({className:e}){return Cc("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:Cc("circle",{cx:"5",cy:"5",r:"5"})})}import{jsx as bt,jsxs as Ga}from"react/jsx-runtime";function Ya({size:e,variant:r,color:t,isLoading:o,isInvalid:n,isRequired:a,label:s,helperText:i,errorMessage:l,labelPlacement:b,dotIcon:m,wrapperClassName:x="",boxClassName:c="",labelClassName:f="",helperClassName:h="",className:p="",checked:y,defaultChecked:S,disabled:T,readOnly:k,onChange:g,value:d,id:u,name:v,ref:C,...R}){let N=hi(),D=L0(),V=u||D,Y=`${V}-helper`,L=e??N?.size??"md",z=r??N?.variant??"filled",A=t??N?.color??"primary",O=T??N?.disabled??!1,G=k??N?.isReadOnly??!1,U=o??N?.isLoading??!1,M=a??N?.isRequired??!1,P=!!(n??N?.isInvalid??!!l),$=b??N?.labelPlacement??"right",K=v??N?.name,X=N!==void 0&&N.value!==null&&N.value!==void 0&&d!==null&&d!==void 0,B=y!==void 0,[oe,q]=F0(S??!1),ee=X?N.value===String(d):B?y:oe,ne=B0(null);V0(C,()=>ne.current);let le=de=>{O||G||U||(N?.onChange&&d!==void 0&&N.onChange(String(d)),!B&&!X&&q(de.target.checked),g?.(de))},_=At[L]||At.md,W="";z==="other"?W="":ee?W=vo[z]?.[A]||vo.filled.primary:W="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",P&&(W=ee?vo[z==="other"?"filled":z]?.error||vo.filled.error:"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let se=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",_.box,W,!O&&!G&&!U?"active:scale-95":"",c].filter(Boolean).join(" "),Z=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",_.label,O?"opacity-60":"",f].filter(Boolean).join(" "),F=["group inline-flex relative",$==="left"?"flex-row-reverse justify-between":"flex-row",_.gap,O?"cursor-not-allowed opacity-60":"cursor-pointer",x,p].filter(Boolean).join(" "),j=()=>U?bt("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${_.dot}`,"aria-hidden":"true",children:bt(ke,{className:"size-full animate-spin"})}):ee?bt("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${_.dot}`,"aria-hidden":"true",children:m||bt(xi,{className:"size-full"})}):null,re=!!s;return Ga("div",{className:"inline-flex flex-col",children:[Ga("label",{className:F,onClick:de=>{(O||G||U)&&de.preventDefault()},children:[bt("input",{ref:ne,type:"radio",id:V,name:K,value:d,checked:ee,disabled:O||U,readOnly:G,required:M,"aria-invalid":P,"aria-busy":U,"aria-disabled":O||U,"aria-describedby":l||i?Y:void 0,onChange:le,onClick:de=>{if(O||G||U){de.preventDefault();return}R.onClick?.(de)},className:"sr-only peer",...R}),bt("span",{className:se,"aria-hidden":"true",children:j()}),re&&Ga("span",{className:Z,children:[s,M&&bt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),bt(Ee,{id:Y,helperText:i,errorMessage:l,sizeClassName:_.helper,className:h})]})}import{useState as H0,useId as kc,useMemo as A0,useCallback as G0}from"react";import{jsx as vi,jsxs as Sc}from"react/jsx-runtime";function Oa({value:e,defaultValue:r,onChange:t,size:o="md",color:n="primary",variant:a="filled",disabled:s=!1,isReadOnly:i=!1,isLoading:l=!1,isInvalid:b,isRequired:m=!1,label:x,helperText:c,errorMessage:f,orientation:h="vertical",labelPlacement:p="right",className:y="",wrapperClassName:S="",labelClassName:T="",helperClassName:k="",children:g,ref:d,...u}){let v=kc(),C=`${v}-label`,R=`${v}-helper`,N=kc(),D=e!==void 0,[V,Y]=H0(r??null),L=D?e:V,z=!!(b??!!f),A=G0(P=>{s||i||l||(D||Y(P),t?.(P))},[s,i,l,D,t]),O=A0(()=>({name:N,value:L,onChange:A,size:o,color:n,variant:a,disabled:s,isReadOnly:i,isLoading:l,isInvalid:z,isRequired:m,labelPlacement:p}),[N,L,A,o,n,a,s,i,l,z,m,p]),G=h==="horizontal"?"flex flex-row flex-wrap gap-4 items-center":"flex flex-col gap-2.5",U=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",T].filter(Boolean).join(" "),M=At[o]||At.md;return Sc("div",{ref:d,role:"radiogroup","aria-labelledby":x?C:void 0,"aria-describedby":f||c?R:void 0,"aria-errormessage":f?R:void 0,"aria-orientation":h,"aria-required":m?"true":void 0,"aria-invalid":z?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":i?"true":void 0,"aria-busy":l?"true":void 0,className:`inline-flex flex-col ${S}`,...u,children:[x&&Sc("span",{id:C,className:U,children:[x,m&&vi("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),vi("div",{className:`${G} ${y}`,children:vi(un.Provider,{value:O,children:g})}),vi(Ee,{id:R,helperText:c,errorMessage:f,sizeClassName:M.helper,className:k})]})}import{useId as Y0,useState as O0,useRef as U0}from"react";import{useMergeRefs as j0}from"@floating-ui/react";var Ua={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},yi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ja={filled:{primary:{checked:{track:"bg-primary-600 dark:bg-primary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 dark:text-primary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 dark:bg-secondary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 dark:text-secondary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-600 dark:bg-error-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 dark:text-error-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-600 dark:bg-success-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 dark:text-success-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-500 dark:bg-warning-400 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 dark:bg-neutral-900 dark:text-warning-400 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-600 dark:bg-info-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 dark:text-info-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 dark:bg-neutral-200 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 dark:bg-primary-950/40 border-2 border-primary-600 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 dark:bg-secondary-950/40 border-2 border-secondary-600 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 dark:bg-error-950/40 border-2 border-error-600 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 dark:bg-success-950/40 border-2 border-success-600 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 dark:bg-warning-950/40 border-2 border-warning-500 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 dark:bg-info-950/40 border-2 border-info-600 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 dark:bg-neutral-800 border-2 border-neutral-800 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 dark:bg-primary-900/50 border border-primary-200 dark:border-primary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 dark:bg-secondary-900/50 border border-secondary-200 dark:border-secondary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-100 dark:bg-error-900/50 border border-error-200 dark:border-error-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-100 dark:bg-success-900/50 border border-success-200 dark:border-success-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-100 dark:bg-warning-900/50 border border-warning-200 dark:border-warning-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-100 dark:bg-info-900/50 border border-info-200 dark:border-info-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 dark:bg-neutral-700 border border-neutral-300 dark:border-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}}}};import{jsx as it,jsxs as wi}from"react/jsx-runtime";function Wa({size:e,variant:r,color:t,radius:o,thumbRadius:n,config:a,label:s,helperText:i,errorMessage:l,labelPlacement:b="right",thumbIcon:m,startContent:x,endContent:c,wrapperClassName:f="",trackClassName:h="",thumbClassName:p="",labelClassName:y="",helperClassName:S="",className:T="",checked:k,defaultChecked:g,disabled:d=!1,readOnly:u=!1,onChange:v,onClick:C,value:R,id:N,name:D,ref:V,...Y}){let{isRequired:L=!1,isInvalid:z=!1,isLoading:A=!1,showSpinner:O=!1}=a??{},G=Y0(),U=N||G,M=`${U}-error-helper`,P=U0(null),$=j0([P,V]),K=k!==void 0,[X,B]=O0(g??!1),oe=K?!!k:X,q=I=>{d||u||A||(K||B(I.target.checked),v?.(I))},ee=I=>{if(d||u||A){I.preventDefault();return}C?.(I)},ne=I=>{(d||u||A)&&I.preventDefault()},le=!!(z||l),_=le?"error":t,W=w(e,Ua,"md"),se=w(o,yi,"full"),Z=w(n,yi,"full"),F=r==="other"?void 0:w(_,w(r,ja,"filled"),"primary"),j=F?oe?F.checked.track:F.unchecked.track:"",re=F?oe?F.checked.thumb:F.unchecked.thumb:"",Se=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",W.track,se,j,d?"opacity-50":"",h].filter(Boolean).join(" "),ie=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",W.thumb,Z,re,oe?W.translate:"translate-x-0",p].filter(Boolean).join(" "),de=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",W.label,d?"opacity-50":"",y].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",b==="left"?"flex-row-reverse justify-between":"flex-row",W.gap,d?"cursor-not-allowed opacity-60":"cursor-pointer",f,T].filter(Boolean).join(" "),J=()=>A&&O?it("span",{className:`inline-flex items-center justify-center ${W.icon}`,"aria-hidden":"true",children:it(ke,{className:"size-full animate-spin"})}):typeof m=="function"?m({isChecked:oe,className:W.icon}):m?it("span",{className:`inline-flex items-center justify-center ${W.icon}`,"aria-hidden":"true",children:m}):null,E=()=>s?wi("span",{className:de,children:[s,L&&it("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return wi("div",{className:"inline-flex flex-col",children:[wi("label",{className:ye,onClick:ne,children:[it("input",{ref:$,type:"checkbox",role:"switch",id:U,name:D,value:R,checked:oe,onChange:q,onClick:ee,disabled:d||A,readOnly:u,required:L,"aria-checked":oe,"aria-invalid":le,"aria-required":L,"aria-describedby":l||i?M:void 0,"aria-errormessage":l?M:void 0,"aria-busy":A,"aria-disabled":d||A,className:"sr-only peer",...Y}),wi("span",{className:Se,"aria-hidden":"true",children:[x&&it("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${W.content} ${oe?"opacity-100":"opacity-0"}`,children:x}),it("span",{className:ie,children:J()}),c&&it("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${W.content} ${oe?"opacity-0":"opacity-100"}`,children:c})]}),E()]}),it(Ee,{id:M,helperText:i,errorMessage:l,sizeClassName:W.helper,className:S})]})}import{jsx as Tc}from"react/jsx-runtime";function tr({width:e=16,height:r=16,className:t="",...o}){return Tc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:Tc("path",{d:"m6 9 6 6 6-6"})})}import{jsx as Rc}from"react/jsx-runtime";function Zr({width:e=16,height:r=16,className:t="",...o}){return Rc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:Rc("path",{d:"m15 18-6-6 6-6"})})}import{jsx as Nc}from"react/jsx-runtime";function qr({width:e=16,height:r=16,className:t="",...o}){return Nc("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:Nc("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Ci,jsxs as W0}from"react/jsx-runtime";function Dc({width:e=16,height:r=16,className:t="",...o}){return W0("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Ci("path",{d:"M8 2v4"}),Ci("path",{d:"M16 2v4"}),Ci("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),Ci("path",{d:"M3 10h18"})]})}import{jsx as Pc,jsxs as K0}from"react/jsx-runtime";function zc({width:e=16,height:r=16,className:t="",...o}){return K0("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Pc("circle",{cx:"12",cy:"12",r:"10"}),Pc("polyline",{points:"12 6 12 12 16 14"})]})}import{jsx as Ic,jsxs as X0}from"react/jsx-runtime";function yo({width:e=16,height:r=16,className:t="",...o}){return X0("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Ic("path",{d:"m11 17-5-5 5-5"}),Ic("path",{d:"m18 17-5-5 5-5"})]})}import{jsx as Mc,jsxs as _0}from"react/jsx-runtime";function wo({width:e=16,height:r=16,className:t="",...o}){return _0("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Mc("path",{d:"m6 17 5-5-5-5"}),Mc("path",{d:"m13 17 5-5-5-5"})]})}import{jsx as Gr,jsxs as q0}from"react/jsx-runtime";function Z0(e){return q0("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Gr("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),Gr("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),Gr("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),Gr("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),Gr("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 dark:fill-primary-900/80 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),Gr("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 dark:fill-primary-900/60 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),Gr("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 dark:fill-primary-950/90 stroke-primary-400/30 dark:stroke-primary-700/30",strokeWidth:"1",strokeLinejoin:"round"}),Gr("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 dark:fill-primary-900/50 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),Gr("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 dark:fill-primary-800/60 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),Gr("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 dark:fill-primary-950/90 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),Gr("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 dark:fill-primary-900/80 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var Ka=Z0;import{jsx as at,jsxs as Ec}from"react/jsx-runtime";function J0(e){return Ec("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[at("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),at("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white dark:fill-neutral-900 stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2"}),at("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),at("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),at("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Ec("g",{transform:"translate(48, 38)",children:[at("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),at("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),at("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),at("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var Xa=J0;import{jsx as Gt,jsxs as ef}from"react/jsx-runtime";function Q0(e){return ef("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Gt("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Gt("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 dark:fill-error-950/40 stroke-error-200 dark:stroke-error-800",strokeWidth:"2"}),Gt("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),Gt("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),Gt("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),Gt("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),Gt("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var _a=Q0;import{jsx as Co,jsxs as tf}from"react/jsx-runtime";function rf(e){return tf("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Co("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Co("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 dark:fill-primary-900/60 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"2"}),Co("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white dark:fill-neutral-900 stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"1.5"}),Co("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),Co("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),Co("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 dark:fill-primary-800/70 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"2"})]})}var Za=rf;import{jsx as ki,jsxs as nf}from"react/jsx-runtime";function of(e){return nf("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[ki("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),ki("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 dark:fill-neutral-800 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ki("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 dark:fill-neutral-700 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ki("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 dark:fill-neutral-600 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"})]})}var qa=of;import{jsx as Ja,jsxs as af}from"react/jsx-runtime";function zr({width:e=20,height:r=20,className:t="",...o}){return af("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Ja("circle",{cx:"12",cy:"12",r:"10"}),Ja("path",{d:"M12 16v-4"}),Ja("path",{d:"M12 8h.01"})]})}import{jsx as $c,jsxs as sf}from"react/jsx-runtime";function ko({width:e=20,height:r=20,className:t="",...o}){return sf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[$c("circle",{cx:"12",cy:"12",r:"10"}),$c("path",{d:"m9 12 2 2 4-4"})]})}import{jsx as Qa,jsxs as lf}from"react/jsx-runtime";function So({width:e=20,height:r=20,className:t="",...o}){return lf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Qa("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),Qa("path",{d:"M12 9v4"}),Qa("path",{d:"M12 17h.01"})]})}import{jsx as es,jsxs as cf}from"react/jsx-runtime";function To({width:e=20,height:r=20,className:t="",...o}){return cf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[es("circle",{cx:"12",cy:"12",r:"10"}),es("path",{d:"M12 8v4"}),es("path",{d:"M12 16h.01"})]})}import{jsx as Si,jsxs as uf}from"react/jsx-runtime";function Ro({width:e=20,height:r=20,className:t="",...o}){return uf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Si("circle",{cx:"11",cy:"11",r:"8"}),Si("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Si("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),Si("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as rs,jsxs as df}from"react/jsx-runtime";function No({width:e=20,height:r=20,className:t="",...o}){return df("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[rs("circle",{cx:"11",cy:"11",r:"8"}),rs("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),rs("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Lc,jsxs as ff}from"react/jsx-runtime";function Do({width:e=20,height:r=20,className:t="",...o}){return ff("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Lc("path",{d:"M21 2v6h-6"}),Lc("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}import{jsx as Fc,jsxs as pf}from"react/jsx-runtime";function Po({width:e=20,height:r=20,className:t="",...o}){return pf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Fc("path",{d:"M3 2v6h6"}),Fc("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}import{jsx as zo,jsxs as gf}from"react/jsx-runtime";function Io({width:e=20,height:r=20,className:t="",...o}){return gf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[zo("path",{d:"m3 7 5 5-5 5V7z"}),zo("path",{d:"m21 7-5 5 5 5V7z"}),zo("path",{d:"M12 20v2"}),zo("path",{d:"M12 14v2"}),zo("path",{d:"M12 8v2"}),zo("path",{d:"M12 2v2"})]})}import{jsx as ts,jsxs as mf}from"react/jsx-runtime";function Yt({width:e=20,height:r=20,className:t="",...o}){return mf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[ts("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),ts("polyline",{points:"7 10 12 15 17 10"}),ts("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}import{jsx as Bc,jsxs as bf}from"react/jsx-runtime";function Ti({width:e=20,height:r=20,className:t="",...o}){return bf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Bc("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),Bc("path",{d:"M3 3v5h5"})]})}import{jsx as os,jsxs as hf}from"react/jsx-runtime";function Ri({width:e=20,height:r=20,className:t="",...o}){return hf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[os("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),os("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),os("polyline",{points:"21 15 16 10 5 21"})]})}import{jsx as Vc,jsxs as xf}from"react/jsx-runtime";function Ni({width:e=16,height:r=16,className:t="",...o}){return xf("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Vc("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),Vc("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}import{jsx as Hc,jsxs as wf}from"react/jsx-runtime";function vf({width:e=16,height:r=16,className:t="",...o}){return wf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Hc("circle",{cx:"11",cy:"11",r:"8"}),Hc("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var yf=vf;import{jsx as Di,jsxs as Cf}from"react/jsx-runtime";function Mo({width:e=16,height:r=16,className:t="",...o}){return Cf("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[Di("polyline",{points:"3 6 5 6 21 6"}),Di("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),Di("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),Di("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}import{jsx as Ac}from"react/jsx-runtime";function Jr({width:e=24,height:r=24,className:t="",...o}){return Ac("svg",{width:e,height:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:t,...o,children:Ac("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}var Gc={xs:{container:"p-2 gap-2 text-xs",title:"text-xs font-semibold leading-tight",description:"text-[11px] leading-tight",icon:"size-3.5 mt-0.5",closeButton:"size-4 p-0.5 -mr-0.5",closeIcon:"size-3",action:"gap-1.5 text-xs"},sm:{container:"p-2.5 gap-2.5 text-xs",title:"text-sm font-semibold leading-tight",description:"text-xs leading-normal",icon:"size-4 mt-0.5",closeButton:"size-5 p-0.5 -mr-0.5",closeIcon:"size-3.5",action:"gap-1.5 text-xs"},md:{container:"p-3.5 gap-3 text-sm",title:"text-sm font-semibold leading-tight",description:"text-sm leading-normal",icon:"size-5 mt-0.5",closeButton:"size-6 p-1 -mr-1",closeIcon:"size-4",action:"gap-2 text-sm"},lg:{container:"p-4 gap-3.5 text-base",title:"text-base font-semibold leading-snug",description:"text-sm leading-normal",icon:"size-6 mt-0.5",closeButton:"size-7 p-1.5 -mr-1.5",closeIcon:"size-4.5",action:"gap-2.5 text-sm"},xl:{container:"p-5 gap-4 text-lg",title:"text-lg font-semibold leading-snug",description:"text-base leading-normal",icon:"size-7 mt-0.5",closeButton:"size-8 p-1.5 -mr-1.5",closeIcon:"size-5",action:"gap-3 text-base"}},Yc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Oc={soft:{primary:"bg-primary-50 text-primary-900 border-2 border-primary-200",secondary:"bg-secondary-50 text-secondary-900 border-2 border-secondary-200",neutral:"bg-neutral-100 text-neutral-900 border-2 border-neutral-200",error:"bg-error-50 text-error-900 border-2 border-error-200",success:"bg-success-50 text-success-900 border-2 border-success-200",warning:"bg-warning-50 text-warning-900 border-2 border-warning-200",info:"bg-info-50 text-info-900 border-2 border-info-200"},filled:{primary:"bg-primary-600 text-white border-2 border-primary-600",secondary:"bg-secondary-600 text-white border-2 border-secondary-600",neutral:"bg-neutral-700 text-white border-2 border-neutral-700",error:"bg-error-600 text-white border-2 border-error-600",success:"bg-success-600 text-white border-2 border-success-600",warning:"bg-warning-500 text-neutral-950 border-2 border-warning-500",info:"bg-info-600 text-white border-2 border-info-600"},outline:{primary:"bg-neutral-white text-primary-700 border-2 border-primary-400",secondary:"bg-neutral-white text-secondary-700 border-2 border-secondary-400",neutral:"bg-neutral-white text-neutral-700 border-2 border-neutral-300",error:"bg-neutral-white text-error-700 border-2 border-error-500",success:"bg-neutral-white text-success-700 border-2 border-success-400",warning:"bg-neutral-white text-warning-800 border-2 border-warning-400",info:"bg-neutral-white text-info-700 border-2 border-info-400"},"accent-left":{primary:"bg-primary-50/70 text-primary-900 border-2 border-primary-200 border-l-4 border-l-primary-500",secondary:"bg-secondary-50/70 text-secondary-900 border-2 border-secondary-200 border-l-4 border-l-secondary-500",neutral:"bg-neutral-50/70 text-neutral-900 border-2 border-neutral-200 border-l-4 border-l-neutral-500",error:"bg-error-50/70 text-error-900 border-2 border-error-200 border-l-4 border-l-error-500",success:"bg-success-50/70 text-success-900 border-2 border-success-200 border-l-4 border-l-success-500",warning:"bg-warning-50/70 text-warning-900 border-2 border-warning-200 border-l-4 border-l-warning-500",info:"bg-info-50/70 text-info-900 border-2 border-info-200 border-l-4 border-l-info-500"},ghost:{primary:"bg-transparent text-primary-800 border-2 border-transparent",secondary:"bg-transparent text-secondary-800 border-2 border-transparent",neutral:"bg-transparent text-neutral-800 border-2 border-transparent",error:"bg-transparent text-error-700 border-2 border-transparent",success:"bg-transparent text-success-700 border-2 border-transparent",warning:"bg-transparent text-warning-800 border-2 border-transparent",info:"bg-transparent text-info-800 border-2 border-transparent"}},Uc={soft:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},filled:{primary:"text-white",secondary:"text-white",neutral:"text-white",error:"text-white",success:"text-white",warning:"text-neutral-950",info:"text-white"},outline:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},"accent-left":{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"},ghost:{primary:"text-primary-600",secondary:"text-secondary-600",neutral:"text-neutral-600",error:"text-error-600",success:"text-success-600",warning:"text-warning-600",info:"text-info-600"}},jc={primary:zr,secondary:zr,neutral:zr,info:zr,success:ko,warning:So,error:To};import{jsx as ht,jsxs as Wc}from"react/jsx-runtime";function Eo({size:e,variant:r,color:t,radius:o,title:n,description:a,icon:s=!0,action:i,closable:l=!0,onClose:b,closeAriaLabel:m="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:x=!1,titleClassName:c="",descriptionClassName:f="",actionClassName:h="",iconClassName:p="",closeButtonClassName:y="",className:S="",children:T,role:k,ref:g,...d}){let u=w(e,Gc,"md"),v=x?"rounded-none border-x-0 w-full":w(o,Yc,"lg"),C=r==="other"?"":w(t,w(r,Oc,"soft"),"info"),R=r==="other"?"":w(t,w(r,Uc,"soft"),"info"),N=l||!!b,D=U=>{U.stopPropagation(),b?.()},Y=k||(t==="error"||t==="warning"?"alert":"status"),L=t==="error"||t==="warning"?"assertive":"polite",z=a??T,A=!!z,O=()=>{if(s===!1)return null;if(s!==!0&&s!==void 0)return ht("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${u.icon} ${p}`,"aria-hidden":"true",children:s});let U=w(t,jc,"info");return ht("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${u.icon} ${R} ${p}`,"aria-hidden":"true",children:ht(U,{className:"size-full"})})},G=["relative flex w-full",u.container,v,C,S].filter(Boolean).join(" ");return Wc("div",{ref:g,role:Y,"aria-live":L,className:G,...d,children:[O(),Wc("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[n&&ht("div",{className:`${u.title} ${c}`,children:n}),A&&ht("div",{className:`${u.description} ${n?"mt-0.5":""} ${f}`,children:z})]}),i&&ht("div",{className:`inline-flex items-center shrink-0 ${u.action} ${h}`,children:i}),N&&ht("button",{type:"button",onClick:D,"aria-label":m,className:`inline-flex items-center justify-center shrink-0 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-current opacity-70 hover:opacity-100 ${r==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${u.closeButton} ${y}`,children:ht(Le,{className:u.closeIcon})})]})}import{Toaster as kf}from"sonner";var Qr=4e3;import{jsx as Sf}from"react/jsx-runtime";function ns({position:e="top-right",visibleToasts:r=3,expand:t=!1,duration:o=4e3,closeButton:n=!1,className:a="",toastOptions:s,...i}){return Sf(kf,{position:e,visibleToasts:r,expand:t,duration:o,closeButton:n,className:`toaster group ${a}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...s},...i})}import{isValidElement as Tf}from"react";import{toast as $o}from"sonner";import{jsx as as}from"react/jsx-runtime";function xt(e,r="info",t="soft",o,n={},a){let{duration:s,position:i,onDismiss:l,onAutoClose:b,...m}=n;return $o.custom(x=>as(Eo,{color:r,variant:t,title:e,description:o,closable:m.closable??!0,onClose:()=>{m.onClose?.(),$o.dismiss(x)},...m}),{id:a,duration:s??4e3,position:i,onDismiss:l,onAutoClose:b})}function Rf(e){return typeof e=="object"&&e!==null&&!Tf(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function is(e,r,t){return Rf(e)?{title:e.title??"",description:e.description,color:e.color??r,variant:e.variant??t}:{title:e,description:void 0,color:r,variant:t}}var et=((e,r,t)=>{let o=t||{};return xt(e,o.color||"info",o.variant||"soft",r,o)});et.custom=(e,r={})=>{if(typeof e=="function")return $o.custom(i=>e(i),{duration:r.duration??4e3,position:r.position,onDismiss:r.onDismiss,onAutoClose:r.onAutoClose});let{duration:t,position:o,onDismiss:n,onAutoClose:a,...s}=e;return $o.custom(i=>as(Eo,{closable:s.closable??!0,onClose:()=>{s.onClose?.(),$o.dismiss(i)},...s}),{duration:t??4e3,position:o,onDismiss:n,onAutoClose:a})};et.success=(e,r,t)=>{let o=t||{};return xt(e,o.color||"success",o.variant||"soft",r,o)};et.error=(e,r,t)=>{let o=t||{};return xt(e,o.color||"error",o.variant||"soft",r,o)};et.warning=(e,r,t)=>{let o=t||{};return xt(e,o.color||"warning",o.variant||"soft",r,o)};et.info=(e,r,t)=>{let o=t||{};return xt(e,o.color||"info",o.variant||"soft",r,o)};et.loading=(e,r,t)=>{let o=t||{};return xt(e,o.color||"info",o.variant||"soft",r,{...o,icon:o.icon??as(ke,{className:"size-full animate-spin"}),duration:o.duration??1/0,closable:o.closable??!1})};et.promise=async(e,r)=>{let t=typeof e=="function"?e():e,{title:o,description:n}=is(r.loading,"info",r.variant||"soft"),a=et.loading(o,n,{size:r.size,variant:r.variant,radius:r.radius});try{let s=await t,i=typeof r.success=="function"?r.success(s):r.success,{title:l,description:b,color:m,variant:x}=is(i,"success",r.variant||"soft");return xt(l,m,x,b,{duration:r.duration??4e3,size:r.size,radius:r.radius},a),s}catch(s){let i=typeof r.error=="function"?r.error(s):r.error,{title:l,description:b,color:m,variant:x}=is(i,"error",r.variant||"soft");throw xt(l,m,x,b,{duration:r.duration??4e3,size:r.size,radius:r.radius},a),s}finally{r.finally&&await r.finally()}};et.dismiss=e=>$o.dismiss(e);var Kc=et;import{cloneElement as Nf,isValidElement as ss,useState as Jc}from"react";import{useFloating as Df,autoUpdate as Pf,offset as zf,flip as If,shift as Mf,arrow as Ef,useHover as $f,useFocus as Lf,useDismiss as Ff,useRole as Bf,useInteractions as Vf,useTransitionStyles as Hf,useMergeRefs as Af,FloatingPortal as Gf,FloatingArrow as Yf}from"@floating-ui/react";var Xc={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},_c={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Zc={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},qc={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};var qe={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60};import{Fragment as Uf,jsx as zi,jsxs as Qc}from"react/jsx-runtime";function Of({children:e,ref:r,disabled:t,className:o="",...n}){let a=ss(e)?e.props?.ref:void 0,s=Af([r,a]);if(!ss(e))return null;let i=e.props||{};return Nf(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function dn({content:e,children:r,placement:t="top",variant:o,color:n,size:a,radius:s,hasArrow:i=!0,offset:l=8,flip:b=!0,shift:m=!0,delay:x={open:200,close:150},disabled:c=!1,animated:f=!0,animationDuration:h=150,open:p,defaultOpen:y=!1,onOpenChange:S,className:T="",arrowClassName:k="",zIndex:g=qe.TOOLTIP}){let[d,u]=Jc(y),[v,C]=Jc(null),R=p!==void 0,N=R?p:d,D=W=>{R||u(W),S?.(W)},V=[zf(l),b?If():void 0,m?Mf({padding:8}):void 0,i?Ef({element:v}):void 0].filter(Boolean),{refs:{setReference:Y,setFloating:L},floatingStyles:z,context:A,placement:O}=Df({placement:t,open:N&&!c,onOpenChange:D,whileElementsMounted:Pf,transform:!1,middleware:V}),G=$f(A,{move:!1,delay:x,enabled:!c}),U=Lf(A,{enabled:!c}),M=Ff(A),P=Bf(A,{role:"tooltip"}),{getReferenceProps:$,getFloatingProps:K}=Vf([G,U,M,P]),{isMounted:X,styles:B}=Hf(A,{duration:f?h:0,initial:({side:W})=>({opacity:0,transform:W==="top"?"translateY(4px) scale(0.95)":W==="bottom"?"translateY(-4px) scale(0.95)":W==="left"?"translateX(4px) scale(0.95)":"translateX(-4px) scale(0.95)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:W})=>({opacity:0,transform:W==="top"?"translateY(4px) scale(0.95)":W==="bottom"?"translateY(-4px) scale(0.95)":W==="left"?"translateX(4px) scale(0.95)":"translateX(-4px) scale(0.95)"})}),oe=w(a,Xc,"md"),q=w(s,_c,"md"),ee=o==="other"?"":w(n,w(o,Zc,"filled"),"neutral"),ne=o==="other"?"":w(n,w(o,qc,"filled"),"neutral"),le=["select-none pointer-events-none max-w-xs break-words",oe.box,q,ee,T].filter(Boolean).join(" "),_=$();return Qc(Uf,{children:[ss(r)?zi(Of,{ref:Y,disabled:c,..._,children:r}):zi("span",{ref:Y,..._,children:r}),zi(Gf,{children:X&&!c&&e&&Qc("div",{ref:L,style:{...z,...f?B:{},zIndex:g},className:le,"data-state":N?"open":"closed","data-placement":O,...K(),children:[e,i&&zi(Yf,{ref:C,context:A,width:oe.arrowWidth,height:oe.arrowHeight,strokeWidth:o==="outline"||o==="soft"?1:0,className:[ne,k].filter(Boolean).join(" ")})]})})]})}import{useId as Wf,useState as Kf}from"react";import*as Lo from"@radix-ui/react-slider";var Ot={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},ls={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},eu={filled:{primary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100 dark:bg-primary-950/40",filler:"bg-primary-400 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100 dark:bg-secondary-950/40",filler:"bg-secondary-400 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100 dark:bg-error-950/40",filler:"bg-error-400 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100 dark:bg-success-950/40",filler:"bg-success-400 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100 dark:bg-warning-950/40",filler:"bg-warning-400 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100 dark:bg-info-950/40",filler:"bg-info-400 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-800",filler:"bg-neutral-600 dark:bg-neutral-400",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-600 dark:border-neutral-400 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};import{useState as cs}from"react";import*as ru from"@radix-ui/react-slider";import{jsx as Ii}from"react/jsx-runtime";function fn({id:e,thumbIdx:r,value:t,orientation:o,size:n,thumbRadiusClass:a,thumbThemeStyles:s,thumbClassName:i="",tooltipClassName:l="",state:b,label:m,helperId:x,tooltipMode:c="none",tooltipPlacement:f,formatTooltip:h}){let{isLoading:p=!1,showSpinner:y=!1,disabled:S=!1,readOnly:T=!1,isRequired:k=!1,isInvalid:g=!1,isRange:d=!1,hasDescription:u=!1}=b??{},v=w(n,Ot,"md"),[C,R]=cs(!1),[N,D]=cs(!1),[V,Y]=cs(!1),L;c==="always"?L=!0:c==="active"?L=V||N:c==="hover"?L=C||V||N:c==="none"&&(L=!1);let z=f||(o==="vertical"?"right":"top"),A=h?h(t):t.toString(),O=typeof A=="string"||typeof A=="number"?String(A):void 0,G=Ii(ru.Thumb,{id:`${e}-thumb-${r}`,tabIndex:S||p?-1:0,"aria-busy":p,"aria-disabled":S||p,"aria-readonly":T,"aria-required":k,"aria-invalid":g,"aria-errormessage":g?x:void 0,"aria-describedby":u?x:void 0,"aria-valuetext":O,"aria-orientation":o,"aria-label":typeof m=="string"?`${m} ${d?r===0?"minimum":"maximum":""}`:`Slider ${d?r===0?"min":"max":""}`,onFocus:()=>D(!0),onBlur:()=>D(!1),onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),onPointerDown:()=>Y(!0),onPointerUp:()=>Y(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${S||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${v.thumb} ${a} ${s} ${V&&!S&&!p?"scale-110 ring-4 ring-primary-500/20":""} ${i}`,children:p&&y&&Ii("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:Ii(ke,{className:"size-full animate-spin text-current"})})});return c!=="none"?Ii(dn,{content:A,placement:z,open:L,size:v.tooltipSize,className:l,disabled:S||p,children:G}):G}function us(e,r,t){return Math.min(Math.max(e,r),t)}function pn(e,r,t){return t<=r?0:us((e-r)/(t-r)*100,0,100)}import{Fragment as jf,jsx as Mi}from"react/jsx-runtime";function Ei({marks:e,min:r,max:t,step:o,orientation:n,size:a,markClassName:s=""}){if(!e)return null;let i=[];if(Array.isArray(e))i=e;else if(e===!0&&o>0){let b=Math.floor((t-r)/o);if(b<=20)for(let m=0;m<=b;m++){let x=r+m*o;i.push({value:x,label:x.toString()})}}if(!i.length)return null;let l=w(a,Ot,"md");return Mi("div",{className:`relative w-full ${n==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:i.map(b=>{let m=pn(b.value,r,t);return Mi("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${s}`,style:n==="vertical"?{bottom:`${m}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${m}%`,transform:"translateX(-50%)"},children:b.label??b.value},b.value)})})}function $i({showSteps:e,min:r,max:t,step:o,orientation:n,size:a,isRange:s,currentValues:i}){if(!e||o<=0)return null;let l=Math.floor((t-r)/o);if(l>100)return null;let b=w(a,Ot,"md"),m=[];for(let x=0;x<=l;x++){let c=r+x*o,f=pn(c,r,t),h=s?c>=(i[0]??r)&&c<=(i[1]??t):c<=(i[0]??r);m.push(Mi("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${b.stepDot} ${h?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:n==="vertical"?{bottom:`${f}%`,left:"50%"}:{left:`${f}%`,top:"50%"}},`step-dot-${c}`))}return Mi(jf,{children:m})}import{Fragment as tu,jsx as kr,jsxs as Ut}from"react/jsx-runtime";function ds({config:e,value:r,defaultValue:t,min:o=0,max:n=100,step:a=1,minStepsBetweenThumbs:s=0,inverted:i=!1,size:l,variant:b,color:m,radius:x,thumbRadius:c,orientation:f="horizontal",label:h,labelPlacement:p="top",formatValue:y,showTooltip:S="none",tooltipPlacement:T,formatTooltip:k,marks:g=!1,startContent:d,endContent:u,disabled:v=!1,readOnly:C=!1,helperText:R,errorMessage:N,name:D,id:V,onChange:Y,onChangeEnd:L,className:z="",wrapperClassName:A="",trackWrapperClassName:O="",trackClassName:G="",fillerClassName:U="",thumbClassName:M="",labelClassName:P="",valueClassName:$="",helperClassName:K="",tooltipClassName:X="",markClassName:B="",ref:oe}){let{isRequired:q=!1,isInvalid:ee=!1,isLoading:ne=!1,showSpinner:le=!1,showSteps:_=!1,showValue:W=!1,isFullWidth:se=!0}=e??{},Z=Wf(),F=V||Z,j=`${F}-helper`,re=!!(ee||N),Se=re?"error":m,ie=Array.isArray(r??t),de=r!==void 0,[Te,ye]=Kf(()=>t!==void 0?Array.isArray(t)?t:[t]:ie?[o,n]:[o]),J=de?Array.isArray(r)?r:r!==void 0?[r]:void 0:void 0,E=de?Array.isArray(r)?[r[0]??o,r[1]??n]:[r??o,0]:ie?[Te[0]??o,Te[1]??n]:[Te[0]??o,0],I=he=>{if(v||C||ne)return;de||ye(he);let Be=ie?[he[0]??o,he[1]??n]:he[0]??o;Y?.(Be)},fe=he=>{if(v||C||ne)return;let Be=ie?[he[0]??o,he[1]??n]:he[0]??o;L?.(Be)},Q=w(l,Ot,"md"),xe=w(x,ls,"full"),ge=w(c,ls,"full"),be=b==="other"?{track:"",filler:"",thumb:""}:w(Se,w(b,eu,"filled"),"primary"),ce=be.track,pe=be.filler,De=be.thumb,ue=()=>{if(!h&&!W)return null;let he="";y?he=y(ie?E:E[0]):ie?he=`${E[0]} - ${E[1]}`:he=`${E[0]}`;let Be=re?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return Ut("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[h&&Ut("label",{htmlFor:`${F}-thumb-0`,className:`font-medium ${Be} ${Q.label} ${v?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${P}`,children:[h,q&&kr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),W&&kr("span",{className:`select-none text-neutral-700 dark:text-neutral-300 ${Q.value} ${$}`,"aria-hidden":"true",children:he})]})},Pe=ie?[E[0],E[1]]:[E[0]];return Ut("div",{ref:oe,className:`group/field flex flex-col ${se?"w-full":"inline-flex"} ${v?"opacity-60 cursor-not-allowed":""} ${A||z}`,children:[p==="top"&&ue(),Ut("div",{className:`flex items-center ${Q.gap} ${f==="vertical"?"flex-col h-48":"flex-row w-full"} ${O}`,children:[p==="left"&&ue(),d&&kr("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:d}),Ut(Lo.Root,{min:o,max:n,step:a,minStepsBetweenThumbs:s,inverted:i,orientation:f,disabled:v||ne||C,value:J,defaultValue:t!==void 0?Array.isArray(t)?t:[t]:void 0,onValueChange:I,onValueCommit:fe,className:`relative flex items-center select-none touch-none ${f==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${v||C?"cursor-not-allowed":"cursor-pointer"}`,children:[Ut(Lo.Track,{className:`relative overflow-hidden ${f==="vertical"?`${Q.trackVertical} h-full`:`${Q.trackHorizontal} w-full`} ${xe} ${ce} ${G}`,children:[kr($i,{showSteps:_,min:o,max:n,step:a,orientation:f,size:l||"md",isRange:ie,currentValues:E}),kr(Lo.Range,{className:`absolute ${pe} ${xe} ${U}`})]}),Pe.map((he,Be)=>{let Me=ie?Be===0?`${F}-thumb-min`:`${F}-thumb-max`:`${F}-thumb-single`;return kr(fn,{id:F,thumbIdx:Be,value:he,orientation:f,size:l||"md",thumbRadiusClass:ge,thumbThemeStyles:De,thumbClassName:M,tooltipClassName:X,state:{isLoading:ne,showSpinner:le,disabled:v,readOnly:C,isRequired:q,isInvalid:re,isRange:ie,hasDescription:!!(re||R)},label:h,helperId:j,tooltipMode:S,tooltipPlacement:T,formatTooltip:k},Me)})]}),u&&kr("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:u}),p==="right"&&ue()]}),kr(Ei,{marks:g,min:o,max:n,step:a,orientation:f,size:l||"md",markClassName:B}),kr(Ee,{id:j,helperText:R,errorMessage:N,sizeClassName:Q.helper,className:K}),D&&kr(tu,{children:ie?Ut(tu,{children:[kr("input",{type:"hidden",name:`${D}[0]`,value:E[0],disabled:v}),kr("input",{type:"hidden",name:`${D}[1]`,value:E[1],disabled:v})]}):kr("input",{type:"hidden",name:D,value:E[0],disabled:v})})]})}import{useState as Xf,useMemo as cu,useCallback as _f}from"react";var Li={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},Fi={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},ou={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},nu={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},iu={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},au={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};import{createContext as su,useContext as lu}from"react";var fs=su(null),ps=su(null);function vt(){let e=lu(fs);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function Fo(){let e=lu(ps);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}import{jsx as du}from"react/jsx-runtime";function uu(e){return e==null?[]:Array.isArray(e)?e:[e]}function gs({activeKey:e,defaultActiveKey:r,onChange:t,accordion:o=!1,size:n="md",variant:a="outlined",color:s="primary",radius:i="md",expandIconPosition:l="right",expandIcon:b,destroyInactivePanel:m=!1,className:x="",style:c,children:f,ref:h,...p}){let y=e!==void 0,[S,T]=Xf(()=>uu(r)),k=cu(()=>new Set(y?uu(e):S),[y,e,S]),g=_f(R=>{let N,D=k.has(R);if(o)N=D?[]:[R];else{let V=Array.from(k);D?N=V.filter(Y=>Y!==R):N=[...V,R]}y||T(N),t?.(o?N[0]??"":N)},[o,k,y,t]),d=a==="other"?"":w(s,w(a,ou,"outlined"),"primary"),u=a!=="separated"&&a!=="ghost"?w(i,Fi,"md"):"",v=["w-full transition-colors",d,u,x].filter(Boolean).join(" "),C=cu(()=>({activeKeys:k,handleToggle:g,accordion:o,size:n,variant:a,color:s,radius:i,expandIconPosition:l,expandIcon:b,destroyInactivePanel:m}),[k,g,o,n,a,s,i,l,b,m]);return du(fs.Provider,{value:C,children:du("div",{ref:h,className:v,style:c,...p,children:f})})}import{useId as Zf,useMemo as qf}from"react";import{jsx as jt,jsxs as gn}from"react/jsx-runtime";function mn({startIcon:e,description:r,extra:t,showArrow:o=!0,children:n,className:a="",ref:s,onClick:i,onKeyDown:l,...b}){let{size:m,variant:x,color:c,expandIconPosition:f,expandIcon:h}=vt(),{isActive:p,disabled:y,headerId:S,panelId:T,onToggle:k}=Fo(),g=w(m,Li,"md"),d=w(c,au,"primary"),u=x==="other"?"":w(c,w(x,iu,"outlined"),"primary"),v=o&&f!=="none",C=()=>v?typeof h=="function"?jt("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${p?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:h({isActive:p,disabled:y})}):h?jt("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${p?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:h}):jt("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${p?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:jt(tr,{className:g.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",g.header,g.gap,y?"cursor-not-allowed opacity-60":u,a].filter(Boolean).join(" "),N=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",g.gap,y?"cursor-not-allowed pointer-events-none":`${d.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return gn("div",{className:R,children:[gn("button",{ref:s,id:S,type:"button","aria-expanded":p,"aria-controls":T,"aria-disabled":y?!0:void 0,disabled:y,onClick:D=>{k(),i?.(D)},onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),k()),l?.(D)},className:N,...b,children:[f==="left"&&C(),gn("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&jt("span",{className:`inline-flex items-center justify-center shrink-0 ${d.activeIndicator} ${g.startIcon}`,"aria-hidden":"true",children:e}),gn("div",{className:"flex flex-col min-w-0 flex-1",children:[jt("span",{className:`truncate ${g.title} ${d.title}`,children:n}),r&&jt("span",{className:`line-clamp-2 ${g.description}`,children:r})]})]}),f==="right"&&!t&&C()]}),t&&gn("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[t,f==="right"&&C()]})]})}import{jsx as ms}from"react/jsx-runtime";function bn({destroyInactivePanel:e,children:r,className:t="",style:o,ref:n,...a}){let{size:s,destroyInactivePanel:i}=vt(),{isActive:l,headerId:b,panelId:m}=Fo(),x=w(s,Li,"md");return ms("div",{ref:n,id:m,role:"region","aria-labelledby":b,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:o,...a,children:ms("div",{className:"overflow-hidden",children:(!(e??i)||l)&&ms("div",{className:`${x.content} ${t}`,children:r})})})}import{Fragment as Jf,jsx as Bi,jsxs as Qf}from"react/jsx-runtime";function bs({value:e,label:r,description:t,startIcon:o,extra:n,disabled:a=!1,showArrow:s=!0,headerClassName:i="",contentClassName:l="",destroyInactivePanel:b,className:m="",children:x,ref:c,...f}){let h=Zf(),{activeKeys:p,handleToggle:y,variant:S,color:T,radius:k}=vt(),g=p.has(e),d=`collapse-header-${e??h}`,u=`collapse-panel-${e??h}`,v=qf(()=>({value:e,isActive:g,disabled:a,headerId:d,panelId:u,onToggle:()=>!a&&y(e)}),[e,g,a,d,u,y]),C=S==="separated"?w(k,Fi,"md"):"",N=["group",S==="other"?"":w(T,w(S,nu,"outlined"),"primary"),C,a?"opacity-50 cursor-not-allowed":"",m].filter(Boolean).join(" ");return Bi(ps.Provider,{value:v,children:Bi("div",{ref:c,className:N,"data-state":g?"open":"closed",...f,children:r!==void 0?Qf(Jf,{children:[Bi(mn,{startIcon:o,description:t,extra:n,showArrow:s,className:i,children:r}),Bi(bn,{destroyInactivePanel:b,className:l,children:x})]}):x})})}import{useId as ep,useState as rp}from"react";import{jsx as fu}from"react/jsx-runtime";function hs({open:e,defaultOpen:r=!1,destroyInactivePanel:t=!1,className:o="",children:n,ref:a,...s}){let i=ep(),l=e!==void 0,[b]=rp(r),m=l?e:b;return fu("div",{ref:a,id:i,role:"region","aria-hidden":!m,"data-state":m?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${m?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${o}`,...s,children:fu("div",{className:"overflow-hidden",children:(!t||m)&&n})})}import{useState as np,useMemo as ip,useCallback as pu}from"react";import{createContext as tp,useContext as op}from"react";var hn=tp(null);function yt(){let e=op(hn);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}import{jsx as gu}from"react/jsx-runtime";function Wt({activeKey:e,defaultActiveKey:r,onChange:t,onClose:o,size:n="md",variant:a="line",color:s="primary",radius:i="md",orientation:l="horizontal",placement:b="top",fullWidth:m=!1,disabled:x=!1,destroyInactiveTabPane:c=!1,className:f="",children:h,ref:p,...y}){let S=e!==void 0,[T,k]=np(r),g=S?e:T,d=pu(D=>{S||k(D),t?.(D)},[S,t]),u=pu(D=>{o?.(D)},[o]),v=ip(()=>({activeKey:g,setActiveKey:d,size:n,variant:a,color:s,radius:i,orientation:l,placement:b,fullWidth:m,disabled:x,destroyInactiveTabPane:c,onCloseTab:u}),[g,d,n,a,s,i,l,b,m,x,c,u]),C=l==="vertical",R;C?R=b==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=b==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let N=["w-full",R,f].filter(Boolean).join(" ");return gu("div",{ref:p,className:N,...y,children:gu(hn.Provider,{value:v,children:h})})}import{useMergeRefs as cp}from"@floating-ui/react";var xs={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},xn={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},vs={line:(e,r)=>e==="vertical"?r==="right"?"border-l border-neutral-200 dark:border-neutral-800 gap-1":"border-r border-neutral-200 dark:border-neutral-800 gap-1":r==="bottom"?"border-t border-neutral-200 dark:border-neutral-800 gap-2":"border-b border-neutral-200 dark:border-neutral-800 gap-2",solid:()=>"bg-neutral-100 dark:bg-neutral-800/80 p-1 gap-1",bordered:()=>"border border-neutral-200 dark:border-neutral-700/80 p-1 gap-1 bg-neutral-50/50 dark:bg-neutral-900/50",flat:()=>"bg-neutral-100/60 dark:bg-neutral-800/40 p-1 gap-1"},ys={primary:{line:{active:"text-primary-700 dark:text-primary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-600 dark:hover:text-primary-300"},solid:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-700 dark:hover:text-primary-300"}},secondary:{line:{active:"text-secondary-700 dark:text-secondary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-600 dark:hover:text-secondary-300"},solid:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-700 dark:hover:text-secondary-300"}},neutral:{line:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-950 dark:hover:text-neutral-100"},solid:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100"}},error:{line:{active:"text-error-700 dark:text-error-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-600 dark:hover:text-error-300"},solid:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-700 dark:hover:text-error-300"}},success:{line:{active:"text-success-700 dark:text-success-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-600 dark:hover:text-success-300"},solid:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-700 dark:hover:text-success-300"}},warning:{line:{active:"text-warning-700 dark:text-warning-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-600 dark:hover:text-warning-300"},solid:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-700 dark:hover:text-warning-300"}},info:{line:{active:"text-info-700 dark:text-info-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-600 dark:hover:text-info-300"},solid:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-700 dark:hover:text-info-300"}}},ws={line:{primary:"bg-primary-600 dark:bg-primary-400",secondary:"bg-secondary-600 dark:bg-secondary-400",neutral:"bg-neutral-900 dark:bg-neutral-100",error:"bg-error-600 dark:bg-error-400",success:"bg-success-600 dark:bg-success-400",warning:"bg-warning-600 dark:bg-warning-400",info:"bg-info-600 dark:bg-info-400"},solid:{primary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",secondary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",neutral:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",error:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",success:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",warning:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",info:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70"},bordered:{primary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",secondary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",neutral:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",error:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",success:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",warning:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",info:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs"},flat:{primary:"bg-primary-100/90 dark:bg-primary-950/80",secondary:"bg-secondary-100/90 dark:bg-secondary-950/80",neutral:"bg-neutral-200/90 dark:bg-neutral-800",error:"bg-error-100/90 dark:bg-error-950/80",success:"bg-success-100/90 dark:bg-success-950/80",warning:"bg-warning-100/90 dark:bg-warning-950/80",info:"bg-info-100/90 dark:bg-info-950/80"}};import{useCallback as mu,useEffect as ap,useLayoutEffect as sp,useRef as lp,useState as Cs}from"react";var bu=typeof window<"u"?sp:ap;function hu({activeKey:e,orientation:r="horizontal",placement:t="top",variant:o="line",color:n="primary",radius:a="md"}={}){let s=lp(null),[i,l]=Cs({opacity:0}),[b,m]=Cs(!1),[x,c]=Cs(!1),f=mu(()=>{if(!s.current||r==="vertical"){m(!1),c(!1);return}let{scrollLeft:T,scrollWidth:k,clientWidth:g}=s.current,d=k-g;m(T>1),c(T<d-1)},[r]),h=mu(()=>{if(!s.current)return;f();let T=s.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(C=>({...C,opacity:0}));return}let k=T.closest("[data-tab-wrapper]")||T;k.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:g,offsetTop:d,offsetWidth:u,offsetHeight:v}=k;l(o==="line"?r==="vertical"?{transform:`translate3d(0, ${d}px, 0)`,height:`${v}px`,width:"2px",top:0,left:t==="right"?0:void 0,right:t!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${g}px, 0, 0)`,width:`${u}px`,height:"2px",left:0,top:t==="bottom"?0:void 0,bottom:t!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${g}px, ${d}px, 0)`,width:`${u}px`,height:`${v}px`,top:0,left:0,opacity:1})},[f,r,t,o]);return bu(()=>{h()},[h,e,o,r,t,n,a]),bu(()=>{h();let T=requestAnimationFrame(h),k=new ResizeObserver(h);if(s.current){k.observe(s.current);let d=s.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let u of d)k.observe(u)}let g=()=>h();return window.addEventListener("resize",g),()=>{cancelAnimationFrame(T),k.disconnect(),window.removeEventListener("resize",g)}},[h]),{listRef:s,indicatorStyle:i,canScrollLeft:b,canScrollRight:x,checkScroll:f,handleScrollLeft:()=>{s.current&&s.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{s.current&&s.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:T=>{if(!s.current)return;let k=Array.from(s.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!k.length)return;let g=k.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),d=-1,u=r==="horizontal",v=u?"ArrowRight":"ArrowDown",C=u?"ArrowLeft":"ArrowUp";T.key===v?(T.preventDefault(),d=(g+1)%k.length):T.key===C?(T.preventDefault(),d=(g-1+k.length)%k.length):T.key==="Home"?(T.preventDefault(),d=0):T.key==="End"&&(T.preventDefault(),d=k.length-1),d>=0&&k[d]&&(k[d]?.focus(),k[d]?.click())}}}import{jsx as Bo,jsxs as xu}from"react/jsx-runtime";function Kt({children:e,className:r="",extra:t,centered:o=!1,ref:n,...a}){let{activeKey:s,orientation:i="horizontal",placement:l="top",variant:b="line",color:m="primary",radius:x="md",fullWidth:c=!1}=yt(),{listRef:f,indicatorStyle:h,canScrollLeft:p,canScrollRight:y,checkScroll:S,handleScrollLeft:T,handleScrollRight:k,handleKeyDown:g}=hu({activeKey:s,orientation:i,placement:l,variant:b,color:m,radius:x}),d=cp([f,n]),u=w(x,xn,"md"),v=b==="other"?"":w(b,vs,"line"),C=typeof v=="function"?v(i,l):"",R=b==="other"?"":w(m,w(b,ws,"line"),"primary"),N=i==="vertical",D=p||y,Y=["relative flex-1 min-w-0",N?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${c?"w-full":""}`,o&&!N?"justify-center":"",b!=="line"?u:"",C,r].filter(Boolean).join(" "),L=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",b!=="line"?u:"",R].filter(Boolean).join(" ");return xu("div",{className:N?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!N&&D&&Bo("button",{type:"button","aria-label":"Scroll tabs left",disabled:!p,onClick:T,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:Bo(Zr,{className:"size-4"})}),xu("div",{ref:d,role:"tablist","aria-orientation":i,onKeyDown:g,onScroll:S,className:Y,...a,children:[Bo("div",{"aria-hidden":"true",className:L,style:h}),e]}),!N&&D&&Bo("button",{type:"button","aria-label":"Scroll tabs right",disabled:!y,onClick:k,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:Bo(qr,{className:"size-4"})}),t&&Bo("div",{className:N?"w-full mt-1":"shrink-0 ml-auto pl-1",children:t})]})}import{useRef as up}from"react";import{useMergeRefs as dp}from"@floating-ui/react";import{jsx as Vo,jsxs as vu}from"react/jsx-runtime";function Xt({value:e,label:r,startIcon:t,endIcon:o,badge:n,disabled:a=!1,closable:s=!1,onClose:i,className:l="",children:b,onClick:m,onKeyDown:x,ref:c,...f}){let{activeKey:h,setActiveKey:p,size:y,variant:S,color:T,radius:k,orientation:g,fullWidth:d,disabled:u,onCloseTab:v}=yt(),C=up(null),R=dp([C,c]),N=u||a,D=h===e,V=B=>{N||(p(e),m?.(B))},Y=B=>{B.stopPropagation(),!N&&(i?.(B),v?.(e))},L=w(y,xs,"md"),z=w(k,xn,"md"),A=w(T,ys,"primary"),O=S==="other"?{active:"",inactive:""}:w(S,A,"line"),G=`tab-${e}`,U=`tabpanel-${e}`,M=D?O.active:O.inactive,P=g==="vertical",$=["group relative z-10 inline-flex items-center select-none",P?"justify-start text-left w-full":"justify-center text-center",S!=="line"?z:"",d&&!P?"flex-1 text-center":"",N?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),K=["inline-flex items-center cursor-pointer select-none bg-transparent",P?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",S!=="line"?z:"",L.tab,L.gap,s?"pr-1.5":"",d&&!P?"flex-1 text-center":"",M,N?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return vu("div",{"data-tab-wrapper":!0,className:$,children:[vu("button",{ref:R,id:G,type:"button",role:"tab","aria-selected":D,"aria-controls":U,"aria-disabled":N?"true":void 0,tabIndex:D?0:-1,disabled:N,onClick:V,onKeyDown:B=>{if(s&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),N)return;i?.(B),v?.(e)}x?.(B)},className:K,...f,children:[t&&Vo("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${L.icon}`,"aria-hidden":"true",children:t}),Vo("span",{className:`truncate ${P?"flex-1 text-left":""}`,children:r||b}),n!=null&&Vo("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 transition-colors duration-200 ${L.badge}`,children:n}),o&&Vo("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${L.icon}`,"aria-hidden":"true",children:o})]}),s&&Vo("button",{type:"button","aria-label":"Close tab",disabled:N,tabIndex:D?0:-1,onClick:Y,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 dark:hover:bg-neutral-700 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${L.closeBtn}`,children:Vo(Le,{className:"size-full pointer-events-none"})})]})}import{jsx as fp}from"react/jsx-runtime";function ks({children:e,className:r="",ref:t,...o}){return fp("div",{ref:t,className:`w-full ${r}`,...o,children:e})}import{jsx as pp}from"react/jsx-runtime";function Ss({value:e,children:r,className:t="",destroyInactiveTabPane:o,ref:n,...a}){let{activeKey:s,destroyInactiveTabPane:i}=yt(),l=s===e;if((o??i)&&!l)return null;let m=`tab-${e}`,x=`tabpanel-${e}`,c=["focus-visible:outline-hidden",l?"":"hidden",t].filter(Boolean).join(" ");return pp("div",{ref:n,id:x,role:"tabpanel",tabIndex:0,"aria-labelledby":m,hidden:!l,className:c,...a,children:r})}import{createContext as gp,useContext as mp}from"react";var Ts=gp(null);function Yr(){let e=mp(Ts);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}import{useCallback as xr,useEffect as bp,useRef as vn,useState as Ho}from"react";function Vi({currentIndex:e,defaultIndex:r=0,onIndexChange:t,loop:o=!1,slidesToShow:n=1,slidesToScroll:a=1,spacing:s=0,autoPlay:i=!0,interval:l=3e3,transitionDuration:b=650,pauseOnHover:m=!0,pauseOnFocus:x=!0,draggable:c=!0,size:f="md",radius:h="md"}={}){let[p,y]=Ho(r),[S,T]=Ho(0),[k,g]=Ho(!1),[d,u]=Ho(0),[v,C]=Ho(!1),[R,N]=Ho(!1),D=vn(new Set),V=vn(null),Y=vn(null),L=vn(0),z=vn(0),A=e!==void 0,O=A?e:p,G=Math.max(0,o?S-1:S-n),U=xr(F=>{let j=F;o?S>0?j=(j+S)%S:j=0:j=Math.max(0,Math.min(j,G)),A||y(j),t?.(j)},[A,o,G,t,S]),M=o?S>1:O>0,P=o?S>1:O<S-n,$=xr(()=>{M&&U(O-a)},[O,M,U,a]),K=xr(()=>{P&&U(O+a)},[O,P,U,a]),X=xr(F=>{U(F)},[U]),B=xr(F=>{D.current.add(F),T(D.current.size)},[]),oe=xr(F=>{D.current.delete(F),T(D.current.size)},[]);bp(()=>{if(!i||S<=n||m&&v||x&&R||k)return;let F=setInterval(()=>{o||O<S-n?K():X(0)},l);return()=>clearInterval(F)},[O,i,l,k,R,v,o,x,m,K,X,n,S]);let q=xr(F=>{if(!c||S<=n||F.button!==0)return;let j=F.clientX;L.current=j,z.current=j,g(!0),u(0);let re=F.currentTarget;try{re.setPointerCapture(F.pointerId)}catch{}},[c,n,S]),ee=xr(F=>{if(!k)return;let j=F.clientX;z.current=j;let re=j-L.current;if(!o){if(O===0&&re>0){u(re*.3);return}if(O>=S-n&&re<0){u(re*.3);return}}u(re)},[O,k,o,n,S]),ne=xr(F=>{if(!k)return;g(!1);let j=z.current-L.current;Math.abs(j)>40&&(j>0?$():K()),u(0);try{F.currentTarget.releasePointerCapture(F.pointerId)}catch{}},[k,K,$]),le=xr(F=>{F.key==="ArrowLeft"?(F.preventDefault(),$()):F.key==="ArrowRight"?(F.preventDefault(),K()):F.key==="Home"?(F.preventDefault(),X(0)):F.key==="End"&&(F.preventDefault(),X(G))},[G,K,$,X]),_=xr(()=>C(!0),[]),W=xr(()=>C(!1),[]),se=xr(()=>N(!0),[]),Z=xr(()=>N(!1),[]);return{currentIndex:O,totalSlides:S,slidesToShow:n,slidesToScroll:a,spacing:s,loop:o,canScrollPrev:M,canScrollNext:P,size:f,radius:h,transitionDuration:b,isDragging:k,dragOffset:d,scrollPrev:$,scrollNext:K,scrollTo:X,registerSlide:B,unregisterSlide:oe,setTotalSlides:T,viewportRef:V,containerRef:Y,handlePointerDown:q,handlePointerMove:ee,handlePointerUp:ne,handlePointerCancel:ne,handleKeyDown:le,handleMouseEnter:_,handleMouseLeave:W,handleFocus:se,handleBlur:Z}}var yn={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},yu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Rs={glass:"bg-white/40 dark:bg-black/35 backdrop-blur-md border border-white/40 dark:border-white/15 text-primary-950 dark:text-white shadow-md hover:bg-white/70 dark:hover:bg-black/60 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 dark:disabled:bg-neutral-800 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-sm hover:bg-primary-50 dark:hover:bg-primary-950 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 dark:hover:bg-primary-950/60 active:bg-primary-200/60 disabled:text-neutral-400"},Ns="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",wn={active:"bg-primary-600 dark:bg-primary-400 shadow-sm",inactive:"bg-white/60 dark:bg-white/40 hover:bg-white/90 dark:hover:bg-white/70 transition-colors"};import{jsx as wu}from"react/jsx-runtime";function Cu({currentIndex:e,defaultIndex:r=0,onIndexChange:t,loop:o=!1,slidesToShow:n=1,slidesToScroll:a=1,spacing:s=0,autoPlay:i=!0,interval:l=3e3,transitionDuration:b=650,pauseOnHover:m=!0,pauseOnFocus:x=!0,draggable:c=!0,size:f="md",radius:h="md",children:p,className:y="",style:S,ref:T,...k}){let g=Vi({currentIndex:e,defaultIndex:r,onIndexChange:t,loop:o,slidesToShow:n,slidesToScroll:a,spacing:s,autoPlay:i,interval:l,transitionDuration:b,pauseOnHover:m,pauseOnFocus:x,draggable:c,size:f,radius:h}),d=w(h,yu,"md");return wu(Ts.Provider,{value:g,children:wu("div",{ref:T,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:g.handleKeyDown,onMouseEnter:g.handleMouseEnter,onMouseLeave:g.handleMouseLeave,onFocus:g.handleFocus,onBlur:g.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${d} ${y}`,style:S,...k,children:p})})}import{jsx as ku}from"react/jsx-runtime";function Su({children:e,className:r="",style:t,ref:o,...n}){let{currentIndex:a,slidesToShow:s,spacing:i,transitionDuration:l,isDragging:b,dragOffset:m,viewportRef:x,handlePointerDown:c,handlePointerMove:f,handlePointerUp:h,handlePointerCancel:p}=Yr(),y=typeof i=="number"?`${i}px`:i||"0px",S=`translateX(calc(-${a} * ((100% + ${y}) / ${s}) + ${m}px))`,T={display:"flex",flexDirection:"row",gap:y,transform:S,transition:b?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return ku("div",{ref:x,className:`overflow-hidden relative w-full h-full cursor-grab ${b?"cursor-grabbing select-none":""}`,onPointerDown:c,onPointerMove:f,onPointerUp:h,onPointerCancel:p,children:ku("div",{ref:o,role:"presentation",className:`flex ${r}`,style:{...T,...t},...n,children:e})})}import{useId as hp,useEffect as xp}from"react";import{jsx as vp}from"react/jsx-runtime";function Tu({children:e,className:r="",style:t,ref:o,...n}){let a=hp(),{slidesToShow:s,spacing:i,registerSlide:l,unregisterSlide:b}=Yr();xp(()=>(l(a),()=>{b(a)}),[a,l,b]);let m=typeof i=="number"?`${i}px`:i||"0px",x={...t};return s>1||m!=="0px"?x.flex=`0 0 calc((100% - ${s-1} * ${m}) / ${s})`:x.flex="0 0 100%",vp("div",{ref:o,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${r}`,style:x,...n,children:e})}import{jsx as Hi}from"react/jsx-runtime";function Ru({variant:e="glass",icon:r,className:t="",disabled:o,onClick:n,ref:a,...s}){let{scrollPrev:i,canScrollPrev:l,size:b}=Yr(),m=o!==void 0?o:!l,x=w(b,yn,"md"),c=w(e,Rs,"glass"),f=Hi(Zr,{className:x.arrowIcon}),h=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",c,x.arrowBtn,t].filter(Boolean).join(" ");return Hi("button",{ref:a,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:m,onClick:p=>{i(),n?.(p)},className:h,...s,children:r||f})}function Nu({variant:e="glass",icon:r,className:t="",disabled:o,onClick:n,ref:a,...s}){let{scrollNext:i,canScrollNext:l,size:b}=Yr(),m=o!==void 0?o:!l,x=w(b,yn,"md"),c=w(e,Rs,"glass"),f=Hi(qr,{className:x.arrowIcon}),h=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",c,x.arrowBtn,t].filter(Boolean).join(" ");return Hi("button",{ref:a,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:m,onClick:p=>{i(),n?.(p)},className:h,...s,children:r||f})}import{jsx as Ai,jsxs as yp}from"react/jsx-runtime";function Du({type:e="dots",clickable:r=!0,className:t="",ref:o,...n}){let{currentIndex:a,totalSlides:s,slidesToShow:i,loop:l,scrollTo:b,size:m}=Yr();if(e==="none"||s<=1)return null;let x=w(m,yn,"md"),c=l?s:Math.max(1,s-i+1);return e==="fraction"?Ai("div",{ref:o,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${Ns} text-white ${x.fraction} ${t}`,...n,children:yp("span",{children:[Math.min(a+1,c)," / ",c]})}):Ai("div",{ref:o,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${Ns} ${x.paginationWrapper} ${t}`,...n,children:Array.from({length:c}).map((f,h)=>{let p=h===a;return e==="line"?Ai("button",{type:"button",role:"tab","aria-selected":p,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${h+1}`,disabled:!r,onClick:()=>r&&b(h),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${p?`${x.activeLine} ${wn.active}`:`${x.line} ${wn.inactive}`} ${r?"cursor-pointer":"cursor-default"}`},h):Ai("button",{type:"button",role:"tab","aria-selected":p,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${h+1}`,disabled:!r,onClick:()=>r&&b(h),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${x.dot} ${p?wn.active:wn.inactive} ${r?"cursor-pointer":"cursor-default"}`},h)})})}import{useState as Pu,useRef as zu,useMemo as Iu,useCallback as kp}from"react";import{useFloating as Sp,autoUpdate as Tp,offset as Rp,flip as Np,shift as Dp,useClick as Pp,useHover as zp,useDismiss as Ip,useRole as Mp,useListNavigation as Ep,useTypeahead as $p,useInteractions as Lp,safePolygon as Fp}from"@floating-ui/react";import{createContext as wp,useContext as Cp}from"react";var Ds=wp(null),rt=()=>{let e=Cp(Ds);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};import{jsx as Bp}from"react/jsx-runtime";function Ps({children:e,open:r,defaultOpen:t=!1,onOpenChange:o,trigger:n="click",placement:a="bottom-start",offset:s=4,flip:i=!0,shift:l=!0,size:b="md",radius:m="md",color:x="primary",disabled:c=!1,animated:f=!0,animationDuration:h=150,closeOnSelect:p=!0}){let[y,S]=Pu(t),[T,k]=Pu(null),g=zu([]),d=zu([]),u=r!==void 0,v=u?r:y,C=kp(X=>{u||S(X),X||k(null),o?.(X)},[u,o]),R=Iu(()=>[Rp(s),i?Np():void 0,l?Dp({padding:8}):void 0].filter(Boolean),[s,i,l]),{refs:N,floatingStyles:D,context:V,placement:Y}=Sp({placement:a,open:v&&!c,onOpenChange:C,whileElementsMounted:Tp,transform:!1,middleware:R}),L=Pp(V,{enabled:!c&&n==="click"}),z=zp(V,{enabled:!c&&n==="hover",delay:{open:100,close:150},handleClose:Fp()}),A=Ip(V),O=Mp(V,{role:"menu"}),G=Ep(V,{listRef:g,activeIndex:T,onNavigate:k,loop:!0}),U=$p(V,{listRef:d,activeIndex:T,onMatch:v?k:void 0}),{getReferenceProps:M,getFloatingProps:P,getItemProps:$}=Lp([L,z,A,O,G,U]),K=Iu(()=>({isOpen:v,setIsOpen:C,refs:N,floatingStyles:D,context:V,getReferenceProps:M,getFloatingProps:P,getItemProps:$,elementsRef:g,labelsRef:d,activeIndex:T,setActiveIndex:k,size:b,radius:m,color:x,disabled:c,animated:f,animationDuration:h,closeOnSelect:p,computedPlacement:Y}),[v,C,N,D,V,M,P,$,g,d,T,k,b,m,x,c,f,h,p,Y]);return Bp(Ds.Provider,{value:K,children:e})}import{cloneElement as Vp,isValidElement as zs}from"react";import{useMergeRefs as Eu}from"@floating-ui/react";import{jsx as Mu}from"react/jsx-runtime";function Hp({children:e,ref:r,disabled:t,className:o="",...n}){let a=zs(e)?e.props?.ref:void 0,s=Eu([r,a]);if(!zs(e))return null;let i=e.props||{};return Vp(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function Ap({ref:e,children:r,className:t="",asChild:o=!1,...n}){let{refs:a,getReferenceProps:s,isOpen:i,disabled:l}=rt(),b=Eu([a.setReference,e]),m=s({...n,"aria-expanded":i,"aria-haspopup":"menu",className:t});return zs(r)&&(o||!0)?Mu(Hp,{ref:b,disabled:l,...m,children:r}):Mu("button",{ref:b,type:"button",disabled:l,"aria-expanded":i,"aria-haspopup":"menu",className:t,...m,children:r})}var $u=Ap;import{FloatingPortal as Gp,FloatingList as Yp,useTransitionStyles as Op,useMergeRefs as Up}from"@floating-ui/react";var Ao={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},Lu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Fu={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},Is={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};import{jsx as Ms}from"react/jsx-runtime";function Es({ref:e,children:r,className:t="",style:o,minWidth:n,zIndex:a=qe.DROPDOWN,...s}){let{isOpen:i,refs:l,floatingStyles:b,context:m,getFloatingProps:x,elementsRef:c,labelsRef:f,size:h,radius:p,animated:y,animationDuration:S,computedPlacement:T}=rt(),k=Up([l.setFloating,e]),{isMounted:g,styles:d}=Op(m,{duration:y?S:0,initial:({side:R})=>({opacity:0,transform:R==="top"?"translateY(4px) scale(0.96)":R==="bottom"?"translateY(-4px) scale(0.96)":R==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:R})=>({opacity:0,transform:R==="top"?"translateY(4px) scale(0.96)":R==="bottom"?"translateY(-4px) scale(0.96)":R==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})});if(!g)return null;let u=w(h,Ao,"md"),v=w(p,Lu,"md"),C=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",u.menu,v,t].filter(Boolean).join(" ");return Ms(Gp,{children:Ms("div",{ref:k,style:{...b,...y?d:{},minWidth:n,zIndex:a,...o},className:C,"data-state":i?"open":"closed","data-placement":T,...x(s),children:Ms(Yp,{elementsRef:c,labelsRef:f,children:r})})})}import{useListItem as jp,useMergeRefs as Wp}from"@floating-ui/react";import{jsx as Cn,jsxs as Bu}from"react/jsx-runtime";function Kp({ref:e,children:r,onClick:t,disabled:o=!1,danger:n=!1,selected:a=!1,startIcon:s,endIcon:i,shortcut:l,description:b,className:m="",closeOnSelect:x,...c}){let{getItemProps:f,activeIndex:h,setIsOpen:p,color:y,size:S,closeOnSelect:T}=rt(),k=typeof r=="string"?r:void 0,{ref:g,index:d}=jp({label:k}),u=Wp([g,e]),v=h===d,C=w(S,Ao,"md"),R=w(y,Fu,"primary"),N=Y=>{if(o){Y.preventDefault();return}t?.(Y),(x??T)&&p(!1)},D=o?"opacity-50 cursor-not-allowed text-neutral-400 select-none":n?`${Is.default} ${v?Is.active:""} cursor-pointer`:a?`${R.selected} cursor-pointer`:`${v?R.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,V=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",C.item,C.itemGap,D,m].filter(Boolean).join(" ");return Bu("button",{ref:u,type:"button",role:"menuitem",disabled:o,"aria-disabled":o,tabIndex:v?0:-1,...f({...c,onClick:N,className:V}),children:[s&&Cn("span",{className:`flex items-center justify-center shrink-0 ${C.icon}`,children:s}),Bu("div",{className:"flex-1 flex flex-col min-w-0",children:[Cn("span",{className:"truncate",children:r}),b&&Cn("span",{className:`text-neutral-500 truncate ${C.description}`,children:b})]}),l&&Cn("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${C.shortcut}`,children:l}),i&&Cn("span",{className:`flex items-center justify-center shrink-0 ${C.icon}`,children:i})]})}var Vu=Kp;import{jsx as Xp}from"react/jsx-runtime";function $s({children:e,className:r="",...t}){let{size:o}=rt(),n=w(o,Ao,"md");return Xp("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",n.header,r].filter(Boolean).join(" "),...t,children:e})}var Hu=$s;import{jsx as Zp}from"react/jsx-runtime";function _p({className:e="",...r}){return Zp("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...r})}var Au=_p;import{jsx as Jp,jsxs as Qp}from"react/jsx-runtime";function qp({children:e,label:r,className:t="",...o}){return Qp("div",{role:"group",className:["flex flex-col",t].filter(Boolean).join(" "),...o,children:[r&&Jp($s,{children:r}),e]})}var Gu=qp;import{useState as tg,useMemo as Yu,useCallback as og}from"react";import{useFloating as ng,autoUpdate as ig,offset as ag,flip as sg,shift as lg,useClick as cg,useHover as ug,useDismiss as dg,useRole as fg,useInteractions as pg,safePolygon as gg}from"@floating-ui/react";import{createContext as eg,useContext as rg}from"react";var Ls=eg(null),vr=()=>{let e=rg(Ls);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};import{jsx as mg}from"react/jsx-runtime";function Fs({children:e,open:r,defaultOpen:t=!1,onOpenChange:o,trigger:n="click",placement:a="bottom",offset:s=8,flip:i=!0,shift:l=!0,size:b="md",radius:m="md",color:x="neutral",disabled:c=!1,animated:f=!0,animationDuration:h=150,modal:p=!1,closeOnEsc:y=!0,closeOnClickOutside:S=!0}){let[T,k]=tg(t),g=r!==void 0,d=g?r:T,u=og(U=>{g||k(U),o?.(U)},[g,o]),v=Yu(()=>[ag(s),i?sg():void 0,l?lg({padding:8}):void 0].filter(Boolean),[s,i,l]),{refs:C,floatingStyles:R,context:N,placement:D}=ng({placement:a,open:d&&!c,onOpenChange:u,whileElementsMounted:ig,transform:!1,middleware:v}),V=cg(N,{enabled:!c&&n==="click"}),Y=ug(N,{enabled:!c&&n==="hover",delay:{open:100,close:150},handleClose:gg()}),L=dg(N,{escapeKey:y,outsidePress:S}),z=fg(N,{role:"dialog"}),{getReferenceProps:A,getFloatingProps:O}=pg([V,Y,L,z]),G=Yu(()=>({isOpen:d,setIsOpen:u,refs:C,floatingStyles:R,context:N,getReferenceProps:A,getFloatingProps:O,size:b,radius:m,color:x,disabled:c,animated:f,animationDuration:h,modal:p,computedPlacement:D}),[d,u,C,R,N,A,O,b,m,x,c,f,h,p,D]);return mg(Ls.Provider,{value:G,children:e})}import{cloneElement as bg,isValidElement as Bs}from"react";import{useMergeRefs as Uu}from"@floating-ui/react";import{jsx as Ou}from"react/jsx-runtime";function hg({children:e,ref:r,disabled:t,className:o="",...n}){let a=Bs(e)?e.props?.ref:void 0,s=Uu([r,a]);if(!Bs(e))return null;let i=e.props||{};return bg(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function xg({ref:e,children:r,className:t="",asChild:o=!1,...n}){let{refs:a,getReferenceProps:s,isOpen:i,disabled:l}=vr(),b=Uu([a.setReference,e]),m=s({...n,"aria-expanded":i,"aria-haspopup":"dialog",className:t});return Bs(r)&&(o||!0)?Ou(hg,{ref:b,disabled:l,...m,children:r}):Ou("button",{ref:b,type:"button",disabled:l,"aria-expanded":i,"aria-haspopup":"dialog",className:t,...m,children:r})}var ju=xg;import{FloatingPortal as vg,FloatingFocusManager as yg,useTransitionStyles as wg,useMergeRefs as Cg}from"@floating-ui/react";var wt={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},Wu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};import{jsx as Vs}from"react/jsx-runtime";function kg({ref:e,children:r,className:t="",style:o,minWidth:n,maxWidth:a,zIndex:s=qe.POPOVER,...i}){let{isOpen:l,refs:b,floatingStyles:m,context:x,getFloatingProps:c,size:f,radius:h,animated:p,animationDuration:y,modal:S,computedPlacement:T}=vr(),k=Cg([b.setFloating,e]),{isMounted:g,styles:d}=wg(x,{duration:p?y:0,initial:({side:D})=>({opacity:0,transform:D==="top"?"translateY(4px) scale(0.96)":D==="bottom"?"translateY(-4px) scale(0.96)":D==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:D})=>({opacity:0,transform:D==="top"?"translateY(4px) scale(0.96)":D==="bottom"?"translateY(-4px) scale(0.96)":D==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})});if(!g)return null;let u=w(f,wt,"md"),v=w(h,Wu,"md"),R=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",u.container,v,t].filter(Boolean).join(" "),N=Vs(yg,{context:x,modal:S,children:Vs("div",{ref:k,style:{...m,...p?d:{},minWidth:n,maxWidth:a,zIndex:s,...o},className:R,"data-state":l?"open":"closed","data-placement":T,...c(i),children:r})});return Vs(vg,{children:N})}var Ku=kg;import{jsx as Tg}from"react/jsx-runtime";function Sg({children:e,className:r="",...t}){let{size:o}=vr(),n=w(o,wt,"md");return Tg("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",n.header,r].filter(Boolean).join(" "),...t,children:e})}var Xu=Sg;import{jsx as Ng}from"react/jsx-runtime";function Rg({children:e,className:r="",...t}){let{size:o}=vr(),n=w(o,wt,"md");return Ng("div",{className:["text-neutral-700",n.body,r].filter(Boolean).join(" "),...t,children:e})}var _u=Rg;import{jsx as Pg}from"react/jsx-runtime";function Dg({children:e,className:r="",...t}){let{size:o}=vr(),n=w(o,wt,"md");return Pg("div",{className:["border-t border-neutral-100 bg-neutral-50/50",n.footer,r].filter(Boolean).join(" "),...t,children:e})}var Zu=Dg;import{cloneElement as zg,isValidElement as Hs}from"react";import{useMergeRefs as Ig}from"@floating-ui/react";import{jsx as qu}from"react/jsx-runtime";function Mg({children:e,ref:r,className:t="",onClick:o,...n}){let a=Hs(e)?e.props?.ref:void 0,s=Ig([r,a]);if(!Hs(e))return null;let i=e.props||{};return zg(e,{...n,...i,ref:s,className:[i.className,t].filter(Boolean).join(" "),onClick:l=>{i.onClick?.(l),o?.(l)}})}function Eg({ref:e,children:r,className:t="",asChild:o=!1,onClick:n,...a}){let{setIsOpen:s}=vr(),i=l=>{n?.(l),l.defaultPrevented||s(!1)};return Hs(r)&&o?qu(Mg,{ref:e,className:t,onClick:i,...a,children:r}):qu("button",{ref:e,type:"button",className:t,onClick:i,...a,children:r})}var Ju=Eg;import{useState as Ws,useId as Vg,useMemo as Hg}from"react";import{useFloating as Ag,autoUpdate as Gg,offset as Yg,flip as Og,shift as Ug,useDismiss as jg,useRole as Wg,useInteractions as Kg,useTransitionStyles as Xg,FloatingPortal as _g,FloatingFocusManager as Zg}from"@floating-ui/react";import{useState as js,useMemo as id}from"react";var Qu={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},ed={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},Ir={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},rd={primary:"text-primary-500 group-focus-within/datepicker:text-primary-600",secondary:"text-secondary-500 group-focus-within/datepicker:text-secondary-600",error:"text-error-500 group-focus-within/datepicker:text-error-600",success:"text-success-500 group-focus-within/datepicker:text-success-600",warning:"text-warning-500 group-focus-within/datepicker:text-warning-600",info:"text-info-500 group-focus-within/datepicker:text-info-600",neutral:"text-neutral-500 group-focus-within/datepicker:text-neutral-600"},Ct={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},td={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},kt={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},od={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Qe(e){return!e||e==="vi"?Qu:e==="en"?ed:e}function ur(e,r){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let t=e.trim();if(!t)return null;if(r){let n=Gs(t,r);if(n)return n}let o=new Date(t);return isNaN(o.getTime())?null:o}if(typeof e=="number"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null}function St(e,r){return!e||!r?!1:e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Gi(e,r){return!e||!r?!1:e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()}function kn(e,r){let t=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime();return t<o}function Sn(e,r){let t=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime();return t>o}function Tn(e){let r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),t=r.getUTCDay()||7;r.setUTCDate(r.getUTCDate()+4-t);let o=new Date(Date.UTC(r.getUTCFullYear(),0,1));return Math.ceil(((r.getTime()-o.getTime())/864e5+1)/7)}function nd(e,r){return new Date(e,r+1,0).getDate()}function Yi(e,r,t=1,o,n,a,s){let i=[],l=new Date,b=new Date(e,r,1).getDay(),m=nd(e,r-1),x=nd(e,r),c=t===1?b===0?6:b-1:b;for(let h=c-1;h>=0;h--){let p=m-h,y=new Date(e,r-1,p);i.push(As(y,!1,l,o,n,a,s))}for(let h=1;h<=x;h++){let p=new Date(e,r,h);i.push(As(p,!0,l,o,n,a,s))}let f=42-i.length;for(let h=1;h<=f;h++){let p=new Date(e,r+1,h);i.push(As(p,!1,l,o,n,a,s))}return i}function As(e,r,t,o,n,a,s){let i=o?St(e,o):!1,l=!1;return n&&kn(e,n)&&(l=!0),a&&Sn(e,a)&&(l=!0),s&&s(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:r,isToday:St(e,t),isSelected:i,isDisabled:l,weekNumber:Tn(e)}}function Sr(e,r="DD/MM/YYYY",t){if(!e||isNaN(e.getTime()))return"";let o=Qe(t),n=e.getFullYear(),a=e.getMonth(),s=e.getDate(),i=e.getHours(),l=e.getMinutes(),b=e.getSeconds(),m=e.getDay(),x=p=>String(p).padStart(2,"0"),c=i%12||12,f=i>=12?"PM":"AM",h={YYYY:String(n),YY:String(n).slice(-2),MMMM:o.months[a]??"",MMM:o.monthsShort[a]??"",MM:x(a+1),M:String(a+1),DD:x(s),D:String(s),dddd:o.weekdays[m]??"",ddd:o.weekdaysShort[m]??"",dd:o.weekdaysMin[m]??"",HH:x(i),H:String(i),hh:x(c),h:String(c),mm:x(l),m:String(l),ss:x(b),s:String(b),A:f,a:f.toLowerCase()};return r.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,p=>h[p]??p)}function Gs(e,r="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let t=e.trim();if(!t)return null;let o=new Date().getFullYear(),n=1,a=1,s=0,i=0,l=0,b=r.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!b){let f=new Date(t);return isNaN(f.getTime())?null:f}let m="^"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let f of b)f==="YYYY"?m=m.replace("YYYY","(\\d{4})"):f==="YY"?m=m.replace("YY","(\\d{2})"):(f==="MM"||f==="M"||f==="DD"||f==="D"||f==="HH"||f==="H"||f==="hh"||f==="h"||f==="mm"||f==="m"||f==="ss"||f==="s")&&(m=m.replace(f,"(\\d{1,2})"));m+="$";let x=new RegExp(m).exec(t);if(!x){let f=new Date(t);return isNaN(f.getTime())?null:f}b.forEach((f,h)=>{let p=x[h+1];if(!p)return;let y=parseInt(p,10);isNaN(y)||(f==="YYYY"?o=y:f==="YY"?o=2e3+y:f==="MM"||f==="M"?n=y:f==="DD"||f==="D"?a=y:f==="HH"||f==="H"||f==="hh"||f==="h"?s=y:f==="mm"||f==="m"?i=y:(f==="ss"||f==="s")&&(l=y))});let c=new Date(o,n-1,a,s,i,l);return isNaN(c.getTime())?null:c}function Oi(e,r="days"){if(r==="days")return e;if(r==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(r==="months"){let t=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return t=t.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),t=t.replace(/[-/.,\s]{2,}/g,o=>o.charAt(0)).trim(),!t||!t.includes("M")&&!t.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":t}return e}import{jsx as st,jsxs as Ys}from"react/jsx-runtime";function Rn({currentMonth:e,view:r,onViewChange:t,onPrevMonth:o,onNextMonth:n,onPrevYear:a,onNextYear:s,onPrevDecade:i,onNextDecade:l,size:b="md",color:m="primary",locale:x,showMonthButtons:c=!0}){let f=Qe(x),h=w(b,Ir,"md"),p=w(m,kt,"primary"),y=e.getFullYear(),S=e.getMonth(),T=Math.floor(y/10)*10,k=T+9,g=()=>{r==="days"?t("months"):r==="months"?t("years"):r==="years"&&t("days")},d=()=>{r==="years"?i?i():a():r==="months"?a():o()},u=()=>{r==="years"?l?l():s():r==="months"?s():n()},v=()=>r==="years"?`${T} - ${k}`:r==="months"?`${y}`:`${f.months[S]} ${y}`;return Ys("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[Ys("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&st("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:st(yo,{width:14,height:14})}),c&&st("button",{type:"button",onClick:d,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:st(Zr,{width:14,height:14})})]}),st("button",{type:"button",onClick:g,className:`${h.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${p.activeText} transition-colors cursor-pointer`,children:v()}),Ys("div",{className:"flex items-center space-x-0.5",children:[c&&st("button",{type:"button",onClick:u,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:st(qr,{width:14,height:14})}),r==="days"&&st("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:st(wo,{width:14,height:14})})]})]})}import $g,{useRef as Lg}from"react";import{jsx as Nn,jsxs as Ui}from"react/jsx-runtime";function Dn({days:e,onSelectDate:r,size:t="md",color:o="primary",radius:n,locale:a,firstDayOfWeek:s=1,showWeekNumbers:i=!1}){let l=Qe(a),b=w(t,Ir,"md"),m=w(o,kt,"primary"),x=w(n,Ct,"lg"),c=Lg(null),f=[...l.weekdaysShort];if(s===1){let g=f.shift();f.push(g)}let h=e.some(g=>g.isSelected&&!g.isDisabled),p=e.findIndex(g=>g.isToday&&!g.isDisabled),y=e.findIndex(g=>g.isCurrentMonth&&!g.isDisabled),S=y!==-1?y:e.findIndex(g=>!g.isDisabled),T=g=>{let u=c.current?.querySelectorAll("button")?.[g];u&&!u.disabled&&u.focus()},k=(g,d)=>{let u=null;if(g.key==="ArrowRight"){g.preventDefault();for(let v=d+1;v<e.length;v++)if(!e[v].isDisabled){u=v;break}}else if(g.key==="ArrowLeft"){g.preventDefault();for(let v=d-1;v>=0;v--)if(!e[v].isDisabled){u=v;break}}else if(g.key==="ArrowDown")g.preventDefault(),d+7<e.length&&!e[d+7].isDisabled&&(u=d+7);else if(g.key==="ArrowUp")g.preventDefault(),d-7>=0&&!e[d-7].isDisabled&&(u=d-7);else if(g.key==="Home"){g.preventDefault();let v=d-d%7;for(let C=v;C<v+7&&C<e.length;C++)if(!e[C].isDisabled){u=C;break}}else if(g.key==="End"){g.preventDefault();let v=Math.min(e.length-1,d-d%7+6);for(let C=v;C>=d-d%7;C--)if(!e[C].isDisabled){u=C;break}}else if(g.key==="Enter"||g.key===" "){g.preventDefault();let v=e[d];v&&!v.isDisabled&&r(v.date);return}u!==null&&T(u)};return Ui("div",{ref:c,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[Ui("div",{role:"row",className:`grid ${i?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[i&&Nn("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${b.cellSize} text-neutral-400 ${b.cellText} font-medium`,children:"#"}),f.map(g=>Nn("div",{role:"columnheader","aria-label":g,className:`flex items-center justify-center ${b.cellSize} text-neutral-500 ${b.cellText} font-medium`,children:g},g))]}),Nn("div",{role:"rowgroup",className:`grid ${i?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((g,d)=>{let u=d%7===0,v="text-neutral-800 hover:bg-neutral-100";g.isDisabled?v="text-neutral-300 cursor-not-allowed line-through":g.isSelected?v=`${m.selected} font-semibold shadow-xs`:g.isCurrentMonth||(v="text-neutral-400 hover:bg-neutral-100");let C=g.isToday&&!g.isSelected?`ring-1 ${m.todayRing} font-bold`:"",R=`${g.day} ${l.months[g.month]} ${g.year}`,N=!g.isDisabled&&(g.isSelected||!h&&g.isToday&&d===p||!h&&p===-1&&d===S);return Ui($g.Fragment,{children:[i&&u&&Ui("div",{className:`flex items-center justify-center ${b.cellSize} text-neutral-400 ${b.cellText} text-[10px] font-mono`,children:["W",g.weekNumber]}),Nn("div",{role:"gridcell","aria-selected":g.isSelected,className:"flex items-center justify-center",children:Nn("button",{type:"button",disabled:g.isDisabled,tabIndex:N?0:-1,onKeyDown:D=>k(D,d),onClick:()=>!g.isDisabled&&r(g.date),"aria-label":R,"aria-current":g.isToday?"date":void 0,"aria-disabled":g.isDisabled,className:`flex items-center justify-center ${b.cellSize} ${b.cellText} ${x} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${v} ${C}`,children:g.day})})]},g.date.toISOString())})})]})}import{useRef as Fg}from"react";import{jsx as Os}from"react/jsx-runtime";function Pn({currentMonth:e,selectedDate:r,onSelectMonth:t,size:o="md",color:n="primary",radius:a,locale:s}){let i=Qe(s),l=w(o,Ir,"md"),b=w(n,kt,"primary"),m=w(a,Ct,"lg"),x=Fg(null),c=e.getFullYear(),f=new Date,h=f.getMonth(),p=f.getFullYear(),y=r&&r.getFullYear()===c?r.getMonth():-1,S=y!==-1?y:p===c?h:0,T=g=>{let u=x.current?.querySelectorAll("button")?.[g];u&&u.focus()},k=(g,d)=>{let u=null;if(g.key==="ArrowRight")g.preventDefault(),d+1<i.monthsShort.length&&(u=d+1);else if(g.key==="ArrowLeft")g.preventDefault(),d-1>=0&&(u=d-1);else if(g.key==="ArrowDown")g.preventDefault(),d+3<i.monthsShort.length&&(u=d+3);else if(g.key==="ArrowUp")g.preventDefault(),d-3>=0&&(u=d-3);else if(g.key==="Home")g.preventDefault(),u=0;else if(g.key==="End")g.preventDefault(),u=i.monthsShort.length-1;else if(g.key==="Enter"||g.key===" "){g.preventDefault(),t(d);return}u!==null&&T(u)};return Os("div",{ref:x,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:i.monthsShort.map((g,d)=>{let u=new Date(c,d,1),v=r?Gi(u,r):!1,C=p===c&&h===d,R=d===S,N="text-neutral-800 hover:bg-neutral-100";return v?N=`${b.selected} font-semibold shadow-xs`:C&&(N=`ring-1 ${b.todayRing} font-semibold`),Os("div",{role:"gridcell","aria-selected":v,className:"flex items-center justify-center",children:Os("button",{type:"button",tabIndex:R?0:-1,onKeyDown:D=>k(D,d),onClick:()=>t(d),"aria-label":`${g} ${c}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${N}`,children:g})},g)})})}import{useRef as Bg}from"react";import{jsx as Us}from"react/jsx-runtime";function zn({currentMonth:e,selectedDate:r,onSelectYear:t,size:o="md",color:n="primary",radius:a}){let s=w(o,Ir,"md"),i=w(n,kt,"primary"),l=w(a,Ct,"lg"),b=Bg(null),m=e.getFullYear(),x=r?r.getFullYear():m,c=Math.floor(m/10)*10,f=new Date().getFullYear(),h=[];for(let g=0;g<12;g++)h.push(c+g);let p=h.indexOf(x),y=h.indexOf(f),S=p!==-1?p:y!==-1?y:0,T=g=>{let u=b.current?.querySelectorAll("button")?.[g];u&&u.focus()},k=(g,d)=>{let u=null;if(g.key==="ArrowRight")g.preventDefault(),d+1<h.length&&(u=d+1);else if(g.key==="ArrowLeft")g.preventDefault(),d-1>=0&&(u=d-1);else if(g.key==="ArrowDown")g.preventDefault(),d+3<h.length&&(u=d+3);else if(g.key==="ArrowUp")g.preventDefault(),d-3>=0&&(u=d-3);else if(g.key==="Home")g.preventDefault(),u=0;else if(g.key==="End")g.preventDefault(),u=h.length-1;else if(g.key==="Enter"||g.key===" "){g.preventDefault();let v=h[d];v!==void 0&&t(v);return}u!==null&&T(u)};return Us("div",{ref:b,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:h.map((g,d)=>{let u=g===x,v=g===f,C=d===S,R="text-neutral-800 hover:bg-neutral-100";return u?R=`${i.selected} font-semibold shadow-xs`:v&&(R=`ring-1 ${i.todayRing} font-semibold`),Us("div",{role:"gridcell","aria-selected":u,className:"flex items-center justify-center",children:Us("button",{type:"button",tabIndex:C?0:-1,onKeyDown:N=>k(N,d),onClick:()=>t(g),"aria-label":`${g}`,className:`w-full flex items-center justify-center h-10 ${s.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:g})},g)})})}import{jsx as Tt,jsxs as ad}from"react/jsx-runtime";function lt({value:e,onChange:r,view:t="days",onViewChange:o,minDate:n,maxDate:a,isDateDisabled:s,locale:i="vi",firstDayOfWeek:l=1,showWeekNumbers:b=!1,showViewTabs:m=!1,viewTabs:x=["days","months","years"],size:c="md",color:f="primary",radius:h,className:p=""}){let y=w(c,Ir,"md"),S=w(h,td,"lg"),[T,k]=js(t),[g,d]=js(t);t!==g&&(d(t),k(t));let[u,v]=js(()=>{let $=e||new Date;return new Date($.getFullYear(),$.getMonth(),1)}),C=Qe(i),R=id(()=>{let $=C.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(x||["days","months","years"]).map(K=>({key:K,label:$[K]||K}))},[x,C.viewTabs]),N=$=>{let K=$;k(K),o?.(K)},D=()=>{let $=new Date(u.getFullYear(),u.getMonth()-1,1);v($)},V=()=>{let $=new Date(u.getFullYear(),u.getMonth()+1,1);v($)},Y=()=>{let $=new Date(u.getFullYear()-1,u.getMonth(),1);v($)},L=()=>{let $=new Date(u.getFullYear()+1,u.getMonth(),1);v($)},z=()=>{let $=new Date(u.getFullYear()-10,u.getMonth(),1);v($)},A=()=>{let $=new Date(u.getFullYear()+10,u.getMonth(),1);v($)},O=$=>{let K=new Date(u.getFullYear(),$,1);v(K),t==="months"?r?.(K):k("days")},G=$=>{let K=new Date($,u.getMonth(),1);v(K),t==="years"?r?.(K):k("months")},U=ur(n),M=ur(a),P=id(()=>Yi(u.getFullYear(),u.getMonth(),l,e,U,M,s),[u,l,e,U,M,s]);return ad("div",{className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl ${S} overflow-hidden select-none ${p}`,children:[m&&R.length>0&&Tt("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:Tt(Wt,{activeKey:t,onChange:N,size:"sm",variant:"solid",color:f,fullWidth:!0,className:"gap-0!",children:Tt(Kt,{className:"p-0.5",children:R.map($=>Tt(Xt,{value:$.key,className:"py-1 px-2 text-xs",children:$.label},$.key))})})}),ad("div",{className:`${y.calendarPadding} min-w-70`,children:[Tt(Rn,{currentMonth:u,view:T,onViewChange:k,onPrevMonth:D,onNextMonth:V,onPrevYear:Y,onNextYear:L,onPrevDecade:z,onNextDecade:A,size:c,color:f,locale:i,showMonthButtons:!0}),T==="days"&&Tt(Dn,{days:P,onSelectDate:$=>r?.($),size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&Tt(Pn,{currentMonth:u,selectedDate:e,onSelectMonth:O,size:c,color:f,radius:h,locale:i}),T==="years"&&Tt(zn,{currentMonth:u,selectedDate:e,onSelectYear:G,size:c,color:f,radius:h})]})]})}import{jsx as gr,jsxs as Go}from"react/jsx-runtime";function In({ref:e,value:r,defaultValue:t,onChange:o,format:n="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:i="vi",firstDayOfWeek:l=1,minDate:b,maxDate:m,isDateDisabled:x,size:c="md",variant:f="outline",color:h="primary",radius:p,label:y,labelPlacement:S="top",placeholder:T,helperText:k,errorMessage:g,name:d,id:u,autoComplete:v,viewTabs:C=["days","months","years"],view:R,onViewChange:N,onClear:D,placement:V="bottom-start",disabled:Y=!1,readOnly:L=!1,config:z,className:A="",wrapperClassName:O="",inputWrapperClassName:G="",labelClassName:U="",helperClassName:M="",popoverClassName:P=""}){let{isRequired:$=!1,isInvalid:K=!1,isLoading:X=!1,showSpinner:B=!1,isClearable:oe=!0,isFullWidth:q=!1,showWeekNumbers:ee=!1,showViewTabs:ne=!1,closeOnSelect:le=!0}=z??{},_=Vg(),W=u||_,se=`${W}-error-helper`,Z=`${W}-popover`,F=R!==void 0,[j,re]=Ws(s),Se=F?R:j,ie=a||n,de=Hg(()=>Oi(ie,Se),[ie,Se]),Te=r!==void 0,[ye,J]=Ws(()=>ur(t,n)),E=Te?ur(r,n):ye,I=E?Sr(E,de,i):"",[fe,Q]=Ws(!1),{refs:{setReference:xe,setFloating:ge},floatingStyles:be,context:ce}=Ag({placement:V,open:fe&&!Y&&!L&&!X,onOpenChange:Q,whileElementsMounted:Gg,transform:!1,middleware:[Yg(6),Og(),Ug({padding:8})]}),pe=jg(ce,{escapeKey:!0,outsidePress:!0}),De=Wg(ce,{role:"dialog"}),{getReferenceProps:ue,getFloatingProps:Pe}=Kg([pe,De]),{isMounted:he,styles:Be}=Xg(ce,{duration:150,initial:({side:ve})=>({opacity:0,transform:ve==="top"?"translateY(4px) scale(0.96)":ve==="bottom"?"translateY(-4px) scale(0.96)":ve==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:ve})=>({opacity:0,transform:ve==="top"?"translateY(4px) scale(0.96)":ve==="bottom"?"translateY(-4px) scale(0.96)":ve==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),Me=!!(K||g),ze=Me?"error":h,Ie=w(c,Ir,"md"),Fe=w(p,Ct,"lg"),Ge=f==="other"?"":w(ze,w(f,od,"outline"),"primary"),Xe=!!E,je=ve=>{F||re(ve),N?.(ve)},Je=ve=>{Te||J(ve);let wr=ve?Sr(ve,n,i):"";o?.(wr),le&&Q(!1)},Ze=ve=>{Y||L||X||(ve.key==="ArrowDown"||ve.key==="Enter"||ve.key===" "?(ve.preventDefault(),fe||Q(!0)):ve.key==="Escape"&&fe&&(ve.preventDefault(),Q(!1)))},_e=ve=>{ve.stopPropagation(),Te||J(null),o?.(null),D?.()},te=T||de,Ae=S==="floating",We=S==="left",me=()=>{if(!y)return null;let ve=Me?"text-error-600 font-bold":w(ze,rd,"primary");return Ae?Go("label",{htmlFor:W,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${Ie.floatingLabel} ${ve} ${U}`,children:[y,$&&gr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):Go("label",{htmlFor:W,className:`inline-flex items-center font-bold transition-colors duration-150 ${Ie.label} ${ve} ${U}`,children:[y,$&&gr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Ue=ve=>gr("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ie.icon}`,"aria-hidden":"true",children:ve}),er=["group/field relative flex",We?"flex-row items-center gap-3":"flex-col",q?"w-full":"inline-flex",O].filter(Boolean).join(" "),rr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ie.inputHeight,Fe,Ge,Y?"opacity-50":"",q?"w-full":"w-auto",G].filter(Boolean).join(" "),cr=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ie.inputText,Ie.inputPadding,A].filter(Boolean).join(" ");return Go("div",{className:er,children:[!Ae&&me(),Go("div",{className:`flex flex-col ${q?"w-full":""}`,children:[Go("div",{ref:xe,...ue(),className:rr,children:[Ae&&me(),gr("input",{ref:e,id:W,name:d,type:"text",value:I,onClick:()=>!Y&&!L&&!X&&Q(ve=>!ve),onKeyDown:Ze,readOnly:!0,autoComplete:v,placeholder:te,disabled:Y||X,role:"combobox","aria-expanded":fe&&!X,"aria-haspopup":"dialog","aria-controls":Z,"aria-required":$,"aria-invalid":Me,"aria-busy":X,"aria-disabled":Y||X,"aria-describedby":k||g?se:void 0,"aria-errormessage":g?se:void 0,className:cr}),Go("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&B&&gr("div",{className:"flex items-center justify-center shrink-0",children:Ue(gr(ke,{}))}),!X&&oe&&!Y&&!L&&gr("button",{type:"button",onClick:_e,"aria-label":"X\xF3a ng\xE0y",tabIndex:Xe?0:-1,"aria-hidden":!Xe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ie.icon} ${Xe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:gr(Le,{className:"size-full"})}),gr("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${fe?"rotate-180":"rotate-0"}`,children:Ue(gr(tr,{className:"size-full"}))})]})]}),he&&gr(_g,{children:gr(Zg,{context:ce,modal:!1,returnFocus:!0,children:gr("div",{ref:ge,id:Z,style:{...be,...Be,zIndex:qe.PICKER},...Pe(),className:P,children:gr(lt,{value:E,onChange:Je,view:Se,onViewChange:je,minDate:b,maxDate:m,isDateDisabled:x,locale:i,firstDayOfWeek:l,showWeekNumbers:ee,size:c,color:h,radius:p,showViewTabs:ne,viewTabs:C})})})}),gr(Ee,{id:se,helperText:k,errorMessage:g,sizeClassName:Ie.helper,className:M})]})]})}import{useState as qs,useId as rm,useMemo as tm}from"react";import{useFloating as om,autoUpdate as nm,offset as im,flip as am,shift as sm,useDismiss as lm,useRole as cm,useInteractions as um,useTransitionStyles as dm,FloatingPortal as fm,FloatingFocusManager as pm}from"@floating-ui/react";import{useState as Ln,useMemo as Ki}from"react";var Mr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Rt={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},sd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Nt={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},ld={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}},cd={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"};import{jsx as Er,jsxs as ji}from"react/jsx-runtime";function Mn({month1:e,month2:r,view:t,onViewChange:o,onPrevMonth:n,onNextMonth:a,onPrevYear:s,onNextYear:i,onPrevDecade:l,onNextDecade:b,size:m="md",color:x="primary",locale:c}){let f=Qe(c),h=w(m,Mr,"md"),p=w(x,Nt,"primary"),y=f.months[e.getMonth()],S=e.getFullYear(),T=Math.floor(S/10)*10,k=T+9,g=`${y} ${S}`;t==="months"&&(g=`${S}`),t==="years"&&(g=`${T} - ${k}`);let d=f.months[r.getMonth()],u=r.getFullYear(),v=Math.floor(u/10)*10,C=v+9,R=`${d} ${u}`;t==="months"&&(R=`${u}`),t==="years"&&(R=`${v} - ${C}`);let N=()=>{t==="days"?o("months"):t==="months"?o("years"):t==="years"&&o("days")},D=()=>{t==="days"?n():t==="months"?s():t==="years"&&(l?l():s())},V=()=>{t==="days"?a():t==="months"?i():t==="years"&&(b?b():i())};return ji("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[ji("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&Er("button",{type:"button",onClick:s,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Er(yo,{width:14,height:14})}),Er("button",{type:"button",onClick:D,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Er(Zr,{width:h.iconSize,height:h.iconSize})})]}),ji("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[Er("div",{className:"flex items-center justify-center",children:Er("button",{type:"button",onClick:N,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${p.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${h.headerText}`,children:g})}),Er("div",{className:"flex items-center justify-center",children:Er("button",{type:"button",onClick:N,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${p.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${h.headerText}`,children:R})})]}),ji("div",{className:"flex items-center space-x-0.5",children:[Er("button",{type:"button",onClick:V,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Er(qr,{width:h.iconSize,height:h.iconSize})}),t==="days"&&Er("button",{type:"button",onClick:i,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${h.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Er(wo,{width:14,height:14})})]})]})}import qg,{useRef as Jg}from"react";import{jsx as En,jsxs as Wi}from"react/jsx-runtime";function Yo({days:e,onSelectDate:r,onHoverDate:t,size:o="md",color:n="primary",radius:a,locale:s,firstDayOfWeek:i=1,showWeekNumbers:l=!1}){let b=Qe(s),m=w(o,Mr,"md"),x=w(n,Nt,"primary"),c=w(a,Rt,"lg"),f=Jg(null),h=[...b.weekdaysShort];if(i===1){let d=h.shift();h.push(d)}let p=e.some(d=>(d.isSelected||d.isRangeStart)&&!d.isDisabled),y=e.findIndex(d=>d.isToday&&!d.isDisabled),S=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),T=S!==-1?S:e.findIndex(d=>!d.isDisabled),k=d=>{let v=f.current?.querySelectorAll("button")?.[d];v&&!v.disabled&&v.focus()},g=(d,u)=>{let v=null;if(d.key==="ArrowRight"){d.preventDefault();for(let C=u+1;C<e.length;C++)if(!e[C].isDisabled){v=C;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let C=u-1;C>=0;C--)if(!e[C].isDisabled){v=C;break}}else if(d.key==="ArrowDown")d.preventDefault(),u+7<e.length&&!e[u+7].isDisabled&&(v=u+7);else if(d.key==="ArrowUp")d.preventDefault(),u-7>=0&&!e[u-7].isDisabled&&(v=u-7);else if(d.key==="Home"){d.preventDefault();let C=u-u%7;for(let R=C;R<C+7&&R<e.length;R++)if(!e[R].isDisabled){v=R;break}}else if(d.key==="End"){d.preventDefault();let C=Math.min(e.length-1,u-u%7+6);for(let R=C;R>=u-u%7;R--)if(!e[R].isDisabled){v=R;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let C=e[u];C&&!C.isDisabled&&r(C.date);return}v!==null&&k(v)};return Wi("div",{ref:f,role:"grid","aria-label":b.months[e[15]?.month||0],className:"w-full",children:[Wi("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&En("div",{role:"columnheader","aria-label":b.weekText||"Week",className:`flex items-center justify-center ${m.cellSize} text-neutral-400 ${m.cellText} font-medium`,children:"#"}),h.map(d=>En("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${m.cellSize} text-neutral-500 ${m.cellText} font-medium`,children:d},d))]}),En("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,u)=>{let v=u%7===0,C="text-neutral-800 hover:bg-neutral-100",R="";d.isDisabled?C="text-neutral-300 cursor-not-allowed line-through":d.isRangeStart||d.isRangeEnd?(C=`${x.selected} font-semibold shadow-xs`,d.isRangeStart&&d.isRangeEnd?R="":d.isRangeStart?R=`${x.rangeBg} rounded-l-full`:d.isRangeEnd&&(R=`${x.rangeBg} rounded-r-full`)):d.isSelected?C=`${x.selected} font-semibold shadow-xs`:d.isInRange||d.isHoveredRange?(C=`${x.rangeBg} ${x.rangeText} rounded-none`,R=`${x.rangeBg}`):d.isCurrentMonth||(C="text-neutral-400 hover:bg-neutral-100");let N=d.isToday&&!d.isSelected?`ring-1 ${x.todayRing} font-bold`:"",D=`${d.day} ${b.months[d.month]} ${d.year}`,V=!d.isDisabled&&(d.isSelected||d.isRangeStart||!p&&d.isToday&&u===y||!p&&y===-1&&u===T);return Wi(qg.Fragment,{children:[l&&v&&Wi("div",{className:`flex items-center justify-center ${m.cellSize} text-neutral-400 ${m.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),En("div",{role:"gridcell","aria-selected":d.isSelected||d.isInRange,className:`relative flex items-center justify-center ${R}`,children:En("button",{type:"button",disabled:d.isDisabled,tabIndex:V?0:-1,onKeyDown:Y=>g(Y,u),onClick:()=>!d.isDisabled&&r(d.date),onMouseEnter:()=>!d.isDisabled&&t?.(d.date),onMouseLeave:()=>t?.(null),"aria-label":D,"aria-current":d.isToday?"date":void 0,"aria-disabled":d.isDisabled,className:`flex items-center justify-center ${m.cellSize} ${m.cellText} ${c} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${C} ${N}`,children:d.day})})]},d.date.toISOString())})})]})}import{useRef as Qg}from"react";import{jsx as Ks}from"react/jsx-runtime";function Oo({currentMonth:e,onSelectMonth:r,size:t="md",color:o="primary",radius:n,locale:a,rangeStart:s,rangeEnd:i,hoveredDate:l,onHoverMonth:b}){let m=Qe(a),x=w(t,Mr,"md"),c=w(o,Nt,"primary"),f=w(n,Rt,"lg"),h=Qg(null),p=e.getFullYear(),y=new Date,S=y.getMonth(),T=y.getFullYear(),k=s&&s.getFullYear()===p?s.getMonth():-1,g=k!==-1?k:T===p?S:0,d=v=>{let R=h.current?.querySelectorAll("button")?.[v];R&&R.focus()},u=(v,C)=>{let R=null;if(v.key==="ArrowRight")v.preventDefault(),C+1<m.monthsShort.length&&(R=C+1);else if(v.key==="ArrowLeft")v.preventDefault(),C-1>=0&&(R=C-1);else if(v.key==="ArrowDown")v.preventDefault(),C+3<m.monthsShort.length&&(R=C+3);else if(v.key==="ArrowUp")v.preventDefault(),C-3>=0&&(R=C-3);else if(v.key==="Home")v.preventDefault(),R=0;else if(v.key==="End")v.preventDefault(),R=m.monthsShort.length-1;else if(v.key==="Enter"||v.key===" "){v.preventDefault(),r(C);return}R!==null&&d(R)};return Ks("div",{ref:h,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>b?.(null),children:m.monthsShort.map((v,C)=>{let R=new Date(p,C,1),N=R.getTime(),D=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,V=i?new Date(i.getFullYear(),i.getMonth(),1).getTime():null,Y=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,L=!!D&&D===N,z=!!V&&V===N,A=!1,O=!1;D&&V?A=N>D&&N<V:D&&!V&&Y&&(Y>D?O=N>D&&N<=Y:Y<D&&(O=N<D&&N>=Y));let G=T===p&&S===C,U=C===g,M="text-neutral-800 hover:bg-neutral-100";return L||z?M=`${c.selected} font-semibold shadow-xs`:A||O?M=`${c.rangeBg} ${c.rangeText}`:G&&(M=`ring-1 ${c.todayRing} font-semibold`),Ks("div",{role:"gridcell","aria-selected":L||z||A,className:"flex items-center justify-center",children:Ks("button",{type:"button",tabIndex:U?0:-1,onKeyDown:P=>u(P,C),onClick:()=>r(C),onMouseEnter:()=>b?.(R),"aria-label":`${v} ${p}`,className:`w-full flex items-center justify-center h-10 ${x.cellText} ${f} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${M}`,children:v})},v)})})}import{useRef as em}from"react";import{jsx as Xs}from"react/jsx-runtime";function Uo({currentMonth:e,onSelectYear:r,size:t="md",color:o="primary",radius:n,rangeStart:a,rangeEnd:s,hoveredDate:i,onHoverYear:l}){let b=w(t,Mr,"md"),m=w(o,Nt,"primary"),x=w(n,Rt,"lg"),c=em(null),f=e.getFullYear(),h=Math.floor(f/10)*10,p=new Date().getFullYear(),y=[];for(let v=0;v<12;v++)y.push(h+v);let S=a?a.getFullYear():f,T=y.indexOf(S),k=y.indexOf(p),g=T!==-1?T:k!==-1?k:0,d=v=>{let R=c.current?.querySelectorAll("button")?.[v];R&&R.focus()},u=(v,C)=>{let R=null;if(v.key==="ArrowRight")v.preventDefault(),C+1<y.length&&(R=C+1);else if(v.key==="ArrowLeft")v.preventDefault(),C-1>=0&&(R=C-1);else if(v.key==="ArrowDown")v.preventDefault(),C+3<y.length&&(R=C+3);else if(v.key==="ArrowUp")v.preventDefault(),C-3>=0&&(R=C-3);else if(v.key==="Home")v.preventDefault(),R=0;else if(v.key==="End")v.preventDefault(),R=y.length-1;else if(v.key==="Enter"||v.key===" "){v.preventDefault();let N=y[C];N!==void 0&&r(N);return}R!==null&&d(R)};return Xs("div",{ref:c,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:y.map((v,C)=>{let R=a?a.getFullYear():null,N=s?s.getFullYear():null,D=i?i.getFullYear():null,V=R!==null&&v===R,Y=N!==null&&v===N,L=!1,z=!1;R!==null&&N!==null?L=v>R&&v<N:R!==null&&N===null&&D!==null&&(D>R?z=v>R&&v<=D:D<R&&(z=v<R&&v>=D));let A=v===p,O=C===g,G="text-neutral-800 hover:bg-neutral-100";return V||Y?G=`${m.selected} font-semibold shadow-xs`:L||z?G=`${m.rangeBg} ${m.rangeText}`:A&&(G=`ring-1 ${m.todayRing} font-semibold`),Xs("div",{role:"gridcell","aria-selected":V||Y||L,className:"flex items-center justify-center",children:Xs("button",{type:"button",tabIndex:O?0:-1,onKeyDown:U=>u(U,C),onClick:()=>r(v),onMouseEnter:()=>l?.(new Date(v,0,1)),"aria-label":`${v}`,className:`w-full flex items-center justify-center h-10 ${b.cellText} ${x} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${G}`,children:v})},v)})})}function Zs(e,r,t){if(!r||!t)return!1;let o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),s=Math.min(n,a),i=Math.max(n,a);return o>=s&&o<=i}function ud(e,r){return new Date(e,r+1,0).getDate()}function _s(e,r,t,o,n,a,s,i,l){let b=o?St(e,o):!1,m=n?St(e,n):!1,x=Zs(e,o||null,n||null),c=o&&!n&&a?Zs(e,o,a):!1,f=!1;return s&&kn(e,s)&&(f=!0),i&&Sn(e,i)&&(f=!0),l&&l(e)&&(f=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:r,isToday:St(e,t),isSelected:b||m,isDisabled:f,isRangeStart:b,isRangeEnd:m,isInRange:x,isHoveredRange:c,weekNumber:Tn(e)}}function $n(e,r,t=1,o,n,a,s,i,l){let b=[],m=new Date,x=new Date(e,r,1).getDay(),c=ud(e,r-1),f=ud(e,r),h=t===1?x===0?6:x-1:x;for(let y=h-1;y>=0;y--){let S=c-y,T=new Date(e,r-1,S);b.push(_s(T,!1,m,o,n,a,s,i,l))}for(let y=1;y<=f;y++){let S=new Date(e,r,y);b.push(_s(S,!0,m,o,n,a,s,i,l))}let p=42-b.length;for(let y=1;y<=p;y++){let S=new Date(e,r+1,y);b.push(_s(S,!1,m,o,n,a,s,i,l))}return b}import{jsx as Or,jsxs as Xi}from"react/jsx-runtime";function Fn({value:e,onChange:r,view:t="days",onViewChange:o,minDate:n,maxDate:a,isDateDisabled:s,locale:i="vi",firstDayOfWeek:l=1,showWeekNumbers:b=!1,showViewTabs:m=!1,viewTabs:x=["days","months","years"],size:c="md",color:f="primary",radius:h,className:p=""}){let y=w(c,Mr,"md"),S=w(h,sd,"lg"),[T,k]=Ln(t),[g,d]=Ln(t);t!==g&&(d(t),k(t));let u=e?e[0]:null,v=e?e[1]:null,[C,R]=Ln(()=>{let Z=u||new Date;return new Date(Z.getFullYear(),Z.getMonth(),1)}),N=Qe(i),D=Ki(()=>{let Z=N.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(x||["days","months","years"]).map(F=>({key:F,label:Z[F]||F}))},[x,N.viewTabs]),V=Z=>{let F=Z;k(F),M(null),o?.(F)},Y=()=>{let Z=new Date(C.getFullYear(),C.getMonth()-1,1);R(Z)},L=()=>{let Z=new Date(C.getFullYear(),C.getMonth()+1,1);R(Z)},z=()=>{let Z=new Date(C.getFullYear()-1,C.getMonth(),1);R(Z)},A=()=>{let Z=new Date(C.getFullYear()+1,C.getMonth(),1);R(Z)},O=()=>{let Z=new Date(C.getFullYear()-10,C.getMonth(),1);R(Z)},G=()=>{let Z=new Date(C.getFullYear()+10,C.getMonth(),1);R(Z)},[U,M]=Ln(null),[P,$]=Ln(null),K=Z=>{if(!U)M(Z),r?.([Z,null]);else{let F=U,j=Z;Z.getTime()<F.getTime()&&(F=Z,j=U),M(null),r?.([F,j])}},X=(Z,F)=>{let j=new Date(Z,F,1);if(R(j),m&&t==="months")if(!U)M(j),r?.([j,null]);else{let re=U,Se=j;j.getTime()<re.getTime()&&(re=j,Se=U),M(null),r?.([re,Se])}else k("days")},B=Z=>{let F=new Date(Z,0,1);if(R(F),m&&t==="years")if(!U)M(F),r?.([F,null]);else{let j=U,re=F;F.getTime()<j.getTime()&&(j=F,re=U),M(null),r?.([j,re])}else k("months")},oe=ur(n),q=ur(a),ee=C,ne=Ki(()=>T==="months"?new Date(C.getFullYear()+1,C.getMonth(),1):T==="years"?new Date(C.getFullYear()+10,C.getMonth(),1):new Date(C.getFullYear(),C.getMonth()+1,1),[C,T]),le=U||u,_=U?null:v,W=Ki(()=>$n(ee.getFullYear(),ee.getMonth(),l,le,_,P,oe,q,s),[ee,l,le,_,P,oe,q,s]),se=Ki(()=>$n(ne.getFullYear(),ne.getMonth(),l,le,_,P,oe,q,s),[ne,l,le,_,P,oe,q,s]);return Xi("div",{className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl ${S} overflow-hidden select-none ${p}`,children:[m&&D.length>0&&Or("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:Or(Wt,{activeKey:t,onChange:V,size:"sm",variant:"solid",color:f,fullWidth:!0,className:"gap-0!",children:Or(Kt,{className:"p-0.5",children:D.map(Z=>Or(Xt,{value:Z.key,className:"py-1 px-2 text-xs",children:Z.label},Z.key))})})}),Or(Mn,{month1:ee,month2:ne,view:T,onViewChange:k,onPrevMonth:Y,onNextMonth:L,onPrevYear:z,onNextYear:A,onPrevDecade:O,onNextDecade:G,size:c,color:f,locale:i}),Xi("div",{className:"flex flex-row divide-x divide-neutral-200",children:[Xi("div",{className:`${y.calendarPadding} min-w-70`,children:[T==="days"&&Or(Yo,{days:W,onSelectDate:K,onHoverDate:$,size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&Or(Oo,{currentMonth:ee,onSelectMonth:Z=>X(ee.getFullYear(),Z),size:c,color:f,radius:h,locale:i,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverMonth:$}),T==="years"&&Or(Uo,{currentMonth:ee,onSelectYear:B,size:c,color:f,radius:h,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverYear:$})]}),Xi("div",{className:`${y.calendarPadding} min-w-70`,children:[T==="days"&&Or(Yo,{days:se,onSelectDate:K,onHoverDate:$,size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&Or(Oo,{currentMonth:ne,onSelectMonth:Z=>X(ne.getFullYear(),Z),size:c,color:f,radius:h,locale:i,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverMonth:$}),T==="years"&&Or(Uo,{currentMonth:ne,onSelectYear:B,size:c,color:f,radius:h,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverYear:$})]})]})]})}import{jsx as mr,jsxs as jo}from"react/jsx-runtime";function Bn({ref:e,value:r,defaultValue:t,onChange:o,separator:n=" - ",format:a="DD/MM/YYYY",displayFormat:s,defaultView:i="days",locale:l="vi",firstDayOfWeek:b=1,minDate:m,maxDate:x,isDateDisabled:c,size:f="md",variant:h="outline",color:p="primary",radius:y,label:S,labelPlacement:T="top",placeholder:k,helperText:g,errorMessage:d,name:u,id:v,autoComplete:C,viewTabs:R=["days","months","years"],view:N,onViewChange:D,onClear:V,placement:Y="bottom-start",disabled:L=!1,readOnly:z=!1,config:A,className:O="",wrapperClassName:G="",inputWrapperClassName:U="",labelClassName:M="",helperClassName:P="",popoverClassName:$=""}){let{isRequired:K=!1,isInvalid:X=!1,isLoading:B=!1,showSpinner:oe=!1,isClearable:q=!0,isFullWidth:ee=!1,showWeekNumbers:ne=!1,showViewTabs:le=!1,closeOnSelect:_=!0}=A??{},W=rm(),se=v||W,Z=`${se}-error-helper`,F=`${se}-popover`,j=N!==void 0,[re,Se]=qs(i),ie=j?N:re,de=s||a,Te=tm(()=>Oi(de,ie),[de,ie]),ye=r!==void 0,[J,E]=qs(()=>{let Ce=t;return Ce&&Array.isArray(Ce)?[ur(Ce[0],a),ur(Ce[1],a)]:[null,null]}),I=ye&&r&&Array.isArray(r)?[ur(r[0],a),ur(r[1],a)]:J,fe=I[0]&&I[1]?`${Sr(I[0],Te,l)}${n}${Sr(I[1],Te,l)}`:I[0]?`${Sr(I[0],Te,l)}${n}`:"",[Q,xe]=qs(!1),{refs:{setReference:ge,setFloating:be},floatingStyles:ce,context:pe}=om({placement:Y,open:Q&&!L&&!z&&!B,onOpenChange:xe,whileElementsMounted:nm,transform:!1,middleware:[im(6),am(),sm({padding:8})]}),De=lm(pe,{escapeKey:!0,outsidePress:!0}),ue=cm(pe,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:he}=um([De,ue]),{isMounted:Be,styles:Me}=dm(pe,{duration:150,initial:({side:Ce})=>({opacity:0,transform:Ce==="top"?"translateY(4px) scale(0.96)":Ce==="bottom"?"translateY(-4px) scale(0.96)":Ce==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:Ce})=>({opacity:0,transform:Ce==="top"?"translateY(4px) scale(0.96)":Ce==="bottom"?"translateY(-4px) scale(0.96)":Ce==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),ze=!!(X||d),Ie=ze?"error":p,Fe=w(f,Mr,"md"),Ge=w(y,Rt,"lg"),Xe=w(h,ld,"outline"),je=h==="other"?"":w(Ie,Xe,"primary"),Je=!!I[0],Ze=Ce=>{j||Se(Ce),D?.(Ce)},_e=Ce=>{ye||E(Ce);let[we,nr]=Ce;if(we&&nr){let ir=[Sr(we,a,l),Sr(nr,a,l)];o?.(ir),_&&xe(!1)}},te=Ce=>{L||z||B||(Ce.key==="ArrowDown"||Ce.key==="Enter"||Ce.key===" "?(Ce.preventDefault(),Q||xe(!0)):Ce.key==="Escape"&&Q&&(Ce.preventDefault(),xe(!1)))},Ae=Ce=>{Ce.stopPropagation(),ye||E([null,null]),o?.(null),V?.()},We=k||`${Te}${n}${Te}`,me=T==="floating",Ue=T==="left",er=()=>{if(!S)return null;let Ce=ze?"text-error-600 font-bold":w(Ie,cd,"primary");return me?jo("label",{htmlFor:se,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${Fe.floatingLabel} ${Ce} ${M}`,children:[S,K&&mr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):jo("label",{htmlFor:se,className:`inline-flex items-center font-bold transition-colors duration-150 ${Fe.label} ${Ce} ${M}`,children:[S,K&&mr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},rr=Ce=>mr("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Fe.icon}`,"aria-hidden":"true",children:Ce}),cr=["group/field relative flex",Ue?"flex-row items-center gap-3":"flex-col",ee?"w-full":"inline-flex",G].filter(Boolean).join(" "),ve=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Fe.inputHeight,Ge,je,L?"opacity-50":"",ee?"w-full":"w-auto",U].filter(Boolean).join(" "),wr=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Fe.inputText,Fe.inputPadding,O].filter(Boolean).join(" ");return jo("div",{className:cr,children:[!me&&er(),jo("div",{className:`flex flex-col ${ee?"w-full":""}`,children:[jo("div",{ref:ge,...Pe(),className:ve,children:[me&&er(),mr("input",{ref:e,id:se,name:u,type:"text",value:fe,onClick:()=>!L&&!z&&!B&&xe(Ce=>!Ce),onKeyDown:te,readOnly:!0,autoComplete:C,placeholder:We,disabled:L||B,role:"combobox","aria-expanded":Q&&!B,"aria-haspopup":"dialog","aria-controls":F,"aria-required":K,"aria-invalid":ze,"aria-busy":B,"aria-disabled":L||B,"aria-describedby":g||d?Z:void 0,"aria-errormessage":d?Z:void 0,className:wr}),jo("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&oe&&mr("div",{className:"flex items-center justify-center shrink-0",children:rr(mr(ke,{}))}),!B&&q&&!L&&!z&&mr("button",{type:"button",onClick:Ae,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Je?0:-1,"aria-hidden":!Je,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Fe.icon} ${Je?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:mr(Le,{className:"size-full"})}),mr("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Q?"rotate-180":"rotate-0"}`,children:rr(mr(tr,{className:"size-full"}))})]})]}),Be&&mr(fm,{children:mr(pm,{context:pe,modal:!1,returnFocus:!0,children:mr("div",{ref:be,id:F,style:{...ce,...Me,zIndex:qe.PICKER},...he(),className:$,children:mr(Fn,{value:I,onChange:_e,view:ie,onViewChange:Ze,minDate:m,maxDate:x,isDateDisabled:c,locale:l,firstDayOfWeek:b,showWeekNumbers:ne,size:f,color:p,radius:y,showViewTabs:le,viewTabs:R})})})}),mr(Ee,{id:Z,helperText:g,errorMessage:d,sizeClassName:Fe.helper,className:P})]})]})}import{useState as xd,useId as mm}from"react";import{useFloating as bm,autoUpdate as hm,offset as xm,flip as vm,shift as ym,useDismiss as wm,useRole as Cm,useInteractions as km,useTransitionStyles as Sm,FloatingPortal as Tm,FloatingFocusManager as Rm}from"@floating-ui/react";import{useMemo as Wo}from"react";var ct={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Vn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Js={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},_i={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}},Qs={primary:"text-primary-500 group-focus-within/timepicker:text-primary-600",secondary:"text-secondary-500 group-focus-within/timepicker:text-secondary-600",error:"text-error-500 group-focus-within/timepicker:text-error-600",success:"text-success-500 group-focus-within/timepicker:text-success-600",warning:"text-warning-500 group-focus-within/timepicker:text-warning-600",info:"text-info-500 group-focus-within/timepicker:text-info-600",neutral:"text-neutral-500 group-focus-within/timepicker:text-neutral-600"},An={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Ur(e){return e<10?`0${e}`:`${e}`}function Dt(e=!1,r=!0){return e?r?"hh:mm:ss A":"hh:mm A":r?"HH:mm:ss":"HH:mm"}function Tr(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let r=e.trim();if(!r)return null;if(r.includes("T")){let n=new Date(r);if(!isNaN(n.getTime()))return n}let t=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,o=r.match(t);if(o){let n=parseInt(o[1],10),a=parseInt(o[2],10),s=o[3]?parseInt(o[3],10):0,i=o[4]?.toUpperCase();if(i&&(i==="PM"&&n<12&&(n+=12),i==="AM"&&n===12&&(n=0)),n>=0&&n<24&&a>=0&&a<60&&s>=0&&s<60){let l=new Date;return l.setHours(n,a,s,0),l}}return null}function yr(e,r="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let t=e.getHours(),o=e.getMinutes(),n=e.getSeconds(),a=t%12;a===0&&(a=12);let s=t>=12?"PM":"AM";return r.replace(/HH/g,Ur(t)).replace(/H/g,`${t}`).replace(/hh/g,Ur(a)).replace(/h/g,`${a}`).replace(/mm/g,Ur(o)).replace(/m/g,`${o}`).replace(/ss/g,Ur(n)).replace(/s/g,`${n}`).replace(/A/g,s).replace(/a/g,s.toLowerCase())}function dd(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let r=e.getHours();return{hours:r,minutes:e.getMinutes(),seconds:e.getSeconds(),period:r>=12?"PM":"AM"}}function _t(e,r,t=0){let o=new Date;return o.setHours(e,r,t,0),o}function fd(e,r,t=!0){return!e||!r?!1:t?e.getHours()===r.getHours()&&e.getMinutes()===r.getMinutes()&&e.getSeconds()===r.getSeconds():e.getHours()===r.getHours()&&e.getMinutes()===r.getMinutes()}function pd(e,r){if(!e||!r)return!1;let t=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return t<o}function gd(e,r){if(!e||!r)return!1;let t=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return t>o}function Zt(e,r,t,o,n,a,s,i,l){if(e==="hour"){if(s?.().includes(r)||n&&r<n.getHours()||a&&r>a.getHours())return!0}else if(e==="minute"){if(i?.(t).includes(r)||n&&(t<n.getHours()||t===n.getHours()&&r<n.getMinutes())||a&&(t>a.getHours()||t===a.getHours()&&r>a.getMinutes()))return!0}else if(e==="second"&&(l?.(t,o).includes(r)||n&&(t<n.getHours()||t===n.getHours()&&o<n.getMinutes()||t===n.getHours()&&o===n.getMinutes()&&r<n.getSeconds())||a&&(t>a.getHours()||t===a.getHours()&&o>a.getMinutes()||t===a.getHours()&&o===a.getMinutes()&&r>a.getSeconds())))return!0;return!1}import{useEffect as gm,useRef as md}from"react";import{jsx as bd}from"react/jsx-runtime";function Pt({items:e,selectedValue:r,onSelect:t,ariaLabel:o,size:n="md",color:a="primary",radius:s,className:i="",itemClassName:l="",selectedItemClassName:b=""}){let m=md(null),x=md(null),c=w(n,ct,"md"),f=w(a,_i,"primary"),h=w(s,Js,"md"),p=e.findIndex(k=>!k.disabled),y=e.some(k=>k.value===r);gm(()=>{if(x.current&&m.current){let k=m.current,g=x.current,d=g.offsetTop-k.offsetTop-(k.clientHeight-g.clientHeight)/2;k.scrollTo({top:Math.max(0,d),behavior:"smooth"}),k.contains(document.activeElement)&&g.focus()}},[r]);let S=k=>{let g=e[k];if(!g||g.disabled)return;t(g.value),m.current?.children[k]?.focus()},T=(k,g)=>{if(e.filter(u=>!u.disabled).length){if(k.key==="ArrowDown"){k.preventDefault();for(let u=g+1;u<e.length;u++)if(!e[u].disabled){S(u);break}}else if(k.key==="ArrowUp"){k.preventDefault();for(let u=g-1;u>=0;u--)if(!e[u].disabled){S(u);break}}else if(k.key==="ArrowRight")k.preventDefault(),m.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(k.key==="ArrowLeft")k.preventDefault(),m.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(k.key==="Home"){k.preventDefault();let u=e.findIndex(v=>!v.disabled);u!==-1&&S(u)}else if(k.key==="End"){k.preventDefault();for(let u=e.length-1;u>=0;u--)if(!e[u].disabled){S(u);break}}else if(k.key==="Enter"||k.key===" "){k.preventDefault();let u=e[g];u&&!u.disabled&&S(g)}}};return bd("ul",{ref:m,role:"listbox","aria-label":o,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${c.columnWidth} ${c.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${i}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((k,g)=>{let d=r===k.value,u=!!k.disabled,v=!u&&(d||!y&&g===p);return bd("li",{ref:d?x:void 0,role:"option","aria-selected":d,"aria-disabled":u,"aria-label":`${k.label} ${o||""}`.trim(),tabIndex:v?0:-1,onKeyDown:C=>T(C,g),onClick:()=>{u||S(g)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${h} ${c.itemHeight} ${c.itemText} ${u?"opacity-30 cursor-not-allowed text-neutral-400":d?`${f.selected} cursor-default ${b}`:`text-neutral-700 ${f.hoverBg} cursor-pointer`} ${l}`,children:k.label},`${k.value}`)})})}import{jsx as Ko,jsxs as hd}from"react/jsx-runtime";function $r({value:e,onChange:r,ariaLabel:t="Time selector",use12Hours:o=!1,showSeconds:n=!0,hourStep:a=1,minuteStep:s=1,secondStep:i=1,minTime:l,maxTime:b,disabledHours:m,disabledMinutes:x,disabledSeconds:c,size:f="md",color:h="primary",radius:p,className:y=""}){let S=Wo(()=>Tr(l),[l]),T=Wo(()=>Tr(b),[b]),k=Dt(o,n),g=w(p,Hn,"lg"),d=w(f,ct,"md"),u=e?e.getHours():0,v=u%12===0?12:u%12,C=e?e.getMinutes():0,R=e?e.getSeconds():0,N=u>=12?"PM":"AM",D=Wo(()=>{let M=[];if(o)for(let P=1;P<=12;P+=a){let $=N==="PM"?P===12?12:P+12:P===12?0:P,K=Zt("hour",$,u,C,S,T,m,x,c);M.push({value:P,label:Ur(P),disabled:K})}else for(let P=0;P<24;P+=a){let $=Zt("hour",P,u,C,S,T,m,x,c);M.push({value:P,label:Ur(P),disabled:$})}return M},[o,a,N,u,C,S,T,m,x,c]),V=Wo(()=>{let M=[];for(let P=0;P<60;P+=s){let $=Zt("minute",P,u,C,S,T,m,x,c);M.push({value:P,label:Ur(P),disabled:$})}return M},[s,u,C,S,T,m,x,c]),Y=Wo(()=>{if(!n)return[];let M=[];for(let P=0;P<60;P+=i){let $=Zt("second",P,u,C,S,T,m,x,c);M.push({value:P,label:Ur(P),disabled:$})}return M},[n,i,u,C,S,T,m,x,c]),L=Wo(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),z=M=>{let P=Number(M);o&&(N==="PM"&&P<12&&(P+=12),N==="AM"&&P===12&&(P=0));let $=_t(P,C,R);r?.($)},A=M=>{let P=Number(M),$=_t(u,P,R);r?.($)},O=M=>{let P=Number(M),$=_t(u,C,P);r?.($)},G=M=>{let P=M,$=u;P==="AM"&&$>=12?$-=12:P==="PM"&&$<12&&($+=12);let K=_t($,C,R);r?.(K)},U=n?"--:--:--":"--:--";return hd("div",{"aria-label":t,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${g} ${y}`,children:[Ko("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:Ko("span",{className:`text-neutral-700 tracking-wider font-mono ${d.headerText}`,children:e?yr(e,k):U})}),hd("div",{className:`flex divide-x divide-neutral-200 ${d.panelPadding}`,children:[Ko(Pt,{ariaLabel:"Gi\u1EDD",items:D,selectedValue:o?v:e?u:null,onSelect:z,size:f,color:h,radius:p}),Ko(Pt,{ariaLabel:"Ph\xFAt",items:V,selectedValue:e?C:null,onSelect:A,size:f,color:h,radius:p}),n&&Ko(Pt,{ariaLabel:"Gi\xE2y",items:Y,selectedValue:e?R:null,onSelect:O,size:f,color:h,radius:p}),o&&Ko(Pt,{ariaLabel:"Bu\u1ED5i",items:L,selectedValue:e?N:null,onSelect:G,size:f,color:h,radius:p})]})]})}import{jsx as br,jsxs as Xo}from"react/jsx-runtime";function el({ref:e,value:r,defaultValue:t,onChange:o,format:n="HH:mm:ss",displayFormat:a,use12Hours:s=!1,showSeconds:i=!0,hourStep:l=1,minuteStep:b=1,secondStep:m=1,minTime:x,maxTime:c,disabledHours:f,disabledMinutes:h,disabledSeconds:p,size:y="md",variant:S="outline",color:T="primary",radius:k,label:g,labelPlacement:d="top",placeholder:u,helperText:v,errorMessage:C,name:R,id:N,autoComplete:D,onClear:V,placement:Y="bottom-start",disabled:L=!1,readOnly:z=!1,config:A,className:O="",wrapperClassName:G="",inputWrapperClassName:U="",labelClassName:M="",helperClassName:P="",popoverClassName:$=""}){let{isRequired:K=!1,isInvalid:X=!1,isLoading:B=!1,showSpinner:oe=!1,isClearable:q=!0,isFullWidth:ee=!1,closeOnSelect:ne=!1}=A??{},le=mm(),_=N||le,W=`${_}-error-helper`,se=`${_}-popover`,Z=Dt(s,i),F=n||Z,j=a||F,re=r!==void 0,[Se,ie]=xd(()=>Tr(t)),de=re?Tr(r):Se,Te=de?yr(de,j):"",[ye,J]=xd(!1),{refs:{setReference:E,setFloating:I},floatingStyles:fe,context:Q}=bm({placement:Y,open:ye&&!L&&!z&&!B,onOpenChange:J,whileElementsMounted:hm,transform:!1,middleware:[xm(6),vm(),ym({padding:8})]}),xe=wm(Q,{escapeKey:!0,outsidePress:!0}),ge=Cm(Q,{role:"dialog"}),{getReferenceProps:be,getFloatingProps:ce}=km([xe,ge]),{isMounted:pe,styles:De}=Sm(Q,{duration:150,initial:({side:me})=>({opacity:0,transform:me==="top"?"translateY(4px) scale(0.96)":me==="bottom"?"translateY(-4px) scale(0.96)":me==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:me})=>({opacity:0,transform:me==="top"?"translateY(4px) scale(0.96)":me==="bottom"?"translateY(-4px) scale(0.96)":me==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),ue=!!(X||C),Pe=ue?"error":T,he=w(y,ct,"md"),Be=w(k,Vn,"lg"),Me=S==="other"?"":w(Pe,w(S,An,"outline"),"primary"),ze=!!de,Ie=me=>{re||ie(me);let Ue=me?yr(me,F):"";o?.(Ue),ne&&J(!1)},Fe=me=>{L||z||B||(me.key==="ArrowDown"||me.key==="Enter"||me.key===" "?(me.preventDefault(),ye||J(!0)):me.key==="Escape"&&ye&&(me.preventDefault(),J(!1)))},Ge=me=>{me.stopPropagation(),re||ie(null),o?.(null),V?.()},Xe=u||j,je=d==="floating",Je=d==="left",Ze=()=>{if(!g)return null;let me=ue?"text-error-600 font-bold":w(Pe,Qs,"primary");return je?Xo("label",{htmlFor:_,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${he.floatingLabel} ${me} ${M}`,children:[g,K&&br("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):Xo("label",{htmlFor:_,className:`inline-flex items-center font-bold transition-colors duration-150 ${he.label} ${me} ${M}`,children:[g,K&&br("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},_e=me=>br("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${he.icon}`,"aria-hidden":"true",children:me}),te=["group/timepicker relative flex",Je?"flex-row items-center gap-3":"flex-col",ee?"w-full":"inline-flex",G].filter(Boolean).join(" "),Ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",he.inputHeight,Be,Me,L?"opacity-50":"",ee?"w-full":"w-auto",U].filter(Boolean).join(" "),We=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",he.inputText,he.inputPadding,O].filter(Boolean).join(" ");return Xo("div",{className:te,children:[!je&&Ze(),Xo("div",{className:`flex flex-col ${ee?"w-full":""}`,children:[Xo("div",{ref:E,...be(),className:Ae,children:[je&&Ze(),br("input",{ref:e,id:_,name:R,type:"text",value:Te,onClick:()=>!L&&!z&&!B&&J(me=>!me),onKeyDown:Fe,readOnly:!0,autoComplete:D,placeholder:Xe,disabled:L||B,role:"combobox","aria-expanded":ye&&!B,"aria-haspopup":"dialog","aria-controls":se,"aria-required":K,"aria-invalid":ue,"aria-busy":B,"aria-disabled":L||B,"aria-describedby":v||C?W:void 0,"aria-errormessage":C?W:void 0,className:We}),Xo("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&oe&&br("div",{className:"flex items-center justify-center shrink-0",children:_e(br(ke,{}))}),!B&&q&&!L&&!z&&br("button",{type:"button",onClick:Ge,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:ze?0:-1,"aria-hidden":!ze,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${he.icon} ${ze?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:br(Le,{className:"size-full"})}),br("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ye?"rotate-180":"rotate-0"}`,children:_e(br(tr,{className:"size-full"}))})]})]}),pe&&br(Tm,{children:br(Rm,{context:Q,modal:!1,returnFocus:!0,children:br("div",{ref:I,id:se,style:{...fe,...De,zIndex:qe.PICKER},...ce(),className:$,children:br($r,{value:de,onChange:Ie,ariaLabel:typeof g=="string"?`${g} selector`:"Time selector",use12Hours:s,showSeconds:i,hourStep:l,minuteStep:b,secondStep:m,minTime:x,maxTime:c,disabledHours:f,disabledMinutes:h,disabledSeconds:p,size:y,color:T,radius:k})})})}),br(Ee,{id:W,helperText:v,errorMessage:C,sizeClassName:he.helper,className:P})]})]})}import{useState as vd,useId as Nm,useMemo as Dm}from"react";import{useFloating as Pm,autoUpdate as zm,offset as Im,flip as Mm,shift as Em,useDismiss as $m,useRole as Lm,useInteractions as Fm,useTransitionStyles as Bm,FloatingPortal as Vm,FloatingFocusManager as Hm}from"@floating-ui/react";var rl=ct,tl=Vn,ol=Hn;var nl=An,il={primary:"text-primary-500 group-focus-within/timerangepicker:text-primary-600",secondary:"text-secondary-500 group-focus-within/timerangepicker:text-secondary-600",error:"text-error-500 group-focus-within/timerangepicker:text-error-600",success:"text-success-500 group-focus-within/timerangepicker:text-success-600",warning:"text-warning-500 group-focus-within/timerangepicker:text-warning-600",info:"text-info-500 group-focus-within/timerangepicker:text-info-600",neutral:"text-neutral-500 group-focus-within/timerangepicker:text-neutral-600"};import{jsx as ar,jsxs as ut}from"react/jsx-runtime";function al({ref:e,value:r,defaultValue:t,onChange:o,format:n,displayFormat:a,separator:s=" - ",startLabel:i="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:b=!1,showSeconds:m=!0,hourStep:x=1,minuteStep:c=1,secondStep:f=1,minTime:h,maxTime:p,disabledHours:y,disabledMinutes:S,disabledSeconds:T,size:k="md",variant:g="outline",color:d="primary",radius:u,label:v,labelPlacement:C="top",placeholder:R,placeholders:N,helperText:D,errorMessage:V,name:Y,id:L,autoComplete:z,disabled:A=!1,readOnly:O=!1,config:G,onClear:U,placement:M="bottom-start",className:P="",wrapperClassName:$="",inputWrapperClassName:K="",labelClassName:X="",helperClassName:B="",popoverClassName:oe=""}){let{isRequired:q=!1,isInvalid:ee=!1,isLoading:ne=!1,showSpinner:le=!1,isClearable:_=!0,isFullWidth:W=!1,closeOnSelect:se=!1}=G??{},Z=Nm(),F=L||Z,j=`${F}-error-helper`,re=`${F}-popover`,Se=Dt(b,m),ie=n||Se,de=a||ie,Te=r!==void 0,[ye,J]=vd(()=>{let we=t;return we&&Array.isArray(we)?[Tr(we[0]),Tr(we[1])]:[null,null]}),E=Te&&r&&Array.isArray(r)?[Tr(r[0]),Tr(r[1])]:ye,I=E[0]?yr(E[0],de):"",fe=E[1]?yr(E[1],de):"",Q=Dm(()=>I&&fe?`${I}${s}${fe}`:I?`${I}${s}`:"",[I,fe,s]),[xe,ge]=vd(!1),{refs:{setReference:be,setFloating:ce},floatingStyles:pe,context:De}=Pm({placement:M,open:xe&&!A&&!O&&!ne,onOpenChange:ge,whileElementsMounted:zm,transform:!1,middleware:[Im(6),Mm(),Em({padding:8})]}),ue=$m(De,{escapeKey:!0,outsidePress:!0}),Pe=Lm(De,{role:"dialog"}),{getReferenceProps:he,getFloatingProps:Be}=Fm([ue,Pe]),{isMounted:Me,styles:ze}=Bm(De,{duration:150,initial:({side:we})=>({opacity:0,transform:we==="top"?"translateY(4px) scale(0.96)":we==="bottom"?"translateY(-4px) scale(0.96)":we==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:we})=>({opacity:0,transform:we==="top"?"translateY(4px) scale(0.96)":we==="bottom"?"translateY(-4px) scale(0.96)":we==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),Ie=!!(ee||V),Fe=Ie?"error":d,Ge=w(k,rl,"md"),Xe=w(u,tl,"lg"),je=w(u,ol,"lg"),Je=g==="other"?"":w(Fe,w(g,nl,"outline"),"primary"),Ze=!!(E[0]||E[1]),_e=we=>{let nr=[we,E[1]];Te||J(nr);let ir=yr(we,ie),fr=E[1]?yr(E[1],ie):"";o?.([ir,fr])},te=we=>{let nr=[E[0],we];Te||J(nr);let ir=E[0]?yr(E[0],ie):"",fr=yr(we,ie);o?.([ir,fr]),se&&ge(!1)},Ae=we=>{A||O||ne||(we.key==="ArrowDown"||we.key==="Enter"||we.key===" "?(we.preventDefault(),xe||ge(!0)):we.key==="Escape"&&xe&&(we.preventDefault(),ge(!1)))},We=we=>{we.stopPropagation(),Te||J([null,null]),o?.(null),U?.()},me=R||(N?`${N[0]}${s}${N[1]}`:`${de}${s}${de}`),Ue=C==="floating",er=C==="left",rr=()=>{if(!v)return null;let we=Ie?"text-error-600 font-bold":w(Fe,il,"primary");return Ue?ut("label",{htmlFor:F,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${Ge.floatingLabel} ${we} ${X}`,children:[v,q&&ar("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):ut("label",{htmlFor:F,className:`inline-flex items-center font-bold transition-colors duration-150 ${Ge.label} ${we} ${X}`,children:[v,q&&ar("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},cr=we=>ar("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ge.icon}`,"aria-hidden":"true",children:we}),ve=["group/timerangepicker relative flex",er?"flex-row items-center gap-3":"flex-col",W?"w-full":"inline-flex",$].filter(Boolean).join(" "),wr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ge.inputHeight,Xe,Je,A?"opacity-50":"",W?"w-full":"w-auto",K].filter(Boolean).join(" "),Ce=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Ge.inputText,Ge.inputPadding,P].filter(Boolean).join(" ");return ut("div",{className:ve,children:[!Ue&&rr(),ut("div",{className:`flex flex-col ${W?"w-full":""}`,children:[ut("div",{ref:be,...he(),className:wr,children:[Ue&&rr(),ar("input",{ref:e,id:F,name:Y,type:"text",value:Q,onClick:()=>!A&&!O&&!ne&&ge(we=>!we),onKeyDown:Ae,readOnly:!0,autoComplete:z,placeholder:me,disabled:A||ne,role:"combobox","aria-expanded":xe&&!ne,"aria-haspopup":"dialog","aria-controls":re,"aria-required":q,"aria-invalid":Ie,"aria-busy":ne,"aria-disabled":A||ne,"aria-describedby":D||V?j:void 0,"aria-errormessage":V?j:void 0,className:Ce}),ut("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ne&&le&&ar("div",{className:"flex items-center justify-center shrink-0",children:cr(ar(ke,{}))}),!ne&&_&&!A&&!O&&ar("button",{type:"button",onClick:We,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Ze?0:-1,"aria-hidden":!Ze,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Ge.icon} ${Ze?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:ar(Le,{className:"size-full"})}),ar("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${xe?"rotate-180":"rotate-0"}`,children:cr(ar(tr,{className:"size-full"}))})]})]}),Me&&ar(Vm,{children:ar(Hm,{context:De,modal:!1,returnFocus:!0,children:ut("div",{ref:ce,id:re,style:{...pe,...ze,zIndex:qe.PICKER},...Be(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${je} ${oe}`,children:[ut("div",{className:"flex flex-col",children:[ar("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:i}),ar($r,{value:E[0],onChange:_e,ariaLabel:i,use12Hours:b,showSeconds:m,hourStep:x,minuteStep:c,secondStep:f,minTime:h,maxTime:E[1]||p,disabledHours:y,disabledMinutes:S,disabledSeconds:T,size:k,color:d,radius:u,className:"border-none shadow-none"})]}),ut("div",{className:"flex flex-col",children:[ar("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),ar($r,{value:E[1],onChange:te,ariaLabel:l,use12Hours:b,showSeconds:m,hourStep:x,minuteStep:c,secondStep:f,minTime:E[0]||h,maxTime:p,disabledHours:y,disabledMinutes:S,disabledSeconds:T,size:k,color:d,radius:u,className:"border-none shadow-none"})]})]})})}),ar(Ee,{id:j,helperText:D,errorMessage:V,sizeClassName:Ge.helper,className:B})]})]})}function yd(e,r,t){if(!e||!r||!t)return!1;let o=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=r.getHours()*3600+r.getMinutes()*60+r.getSeconds(),a=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return o>=n&&o<=a}import{useState as cl,useId as Am}from"react";import{useFloating as Gm,autoUpdate as Ym,offset as Om,flip as Um,shift as jm,useDismiss as Wm,useRole as Km,useInteractions as Xm,useTransitionStyles as _m,FloatingPortal as Zm,FloatingFocusManager as qm}from"@floating-ui/react";function zt(e=!1,r=!0){return e?r?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":r?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function Lr(e,r){if(!e&&!r)return null;let t=e?new Date(e):new Date;return r&&(t.setHours(r.getHours()),t.setMinutes(r.getMinutes()),t.setSeconds(r.getSeconds()),t.setMilliseconds(r.getMilliseconds())),t}function Fr(e,r="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let n=Gn(e,r);if(n)return n}let o=new Date(e);return isNaN(o.getTime())?null:o}let t=e;return typeof t.toDate=="function"?t.toDate():typeof t.epochMilliseconds=="number"?new Date(t.epochMilliseconds):null}function Rr(e,r="DD/MM/YYYY HH:mm:ss",t){return!e||isNaN(e.getTime())?"":Sr(e,r,t)}function Gn(e,r="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let t=e.trim();if(!t)return null;let o=new Date().getFullYear(),n=1,a=1,s=0,i=0,l=0,b=!1,m=!1,x=r.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!x){let p=new Date(t);return isNaN(p.getTime())?null:p}let c="^"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let p of x)p==="YYYY"?c=c.replace("YYYY","(\\d{4})"):p==="YY"?c=c.replace("YY","(\\d{2})"):p==="MM"||p==="M"||p==="DD"||p==="D"||p==="HH"||p==="H"||p==="hh"||p==="h"||p==="mm"||p==="m"||p==="ss"||p==="s"?c=c.replace(p,"(\\d{1,2})"):(p==="A"||p==="a")&&(c=c.replace(p,"(AM|PM|am|pm)"));c+="$";let f=new RegExp(c,"i").exec(t);if(!f){let p=new Date(t);return isNaN(p.getTime())?null:p}x.forEach((p,y)=>{let S=f[y+1];if(!S)return;if(p==="A"||p==="a"){b=!0,S.toUpperCase()==="PM"&&(m=!0);return}let T=parseInt(S,10);isNaN(T)||(p==="YYYY"?o=T:p==="YY"?o=2e3+T:p==="MM"||p==="M"?n=T:p==="DD"||p==="D"?a=T:p==="HH"||p==="H"?s=T:p==="hh"||p==="h"?(b=!0,s=T):p==="mm"||p==="m"?i=T:(p==="ss"||p==="s")&&(l=T))}),b&&(m?s<12&&(s+=12):s===12&&(s=0));let h=new Date(o,n-1,a,s,i,l);return isNaN(h.getTime())?null:h}var Yn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},On={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},sl={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var ll={primary:"text-primary-500 group-focus-within/datetimepicker:text-primary-600",secondary:"text-secondary-500 group-focus-within/datetimepicker:text-secondary-600",error:"text-error-500 group-focus-within/datetimepicker:text-error-600",success:"text-success-500 group-focus-within/datetimepicker:text-success-600",warning:"text-warning-500 group-focus-within/datetimepicker:text-warning-600",info:"text-info-500 group-focus-within/datetimepicker:text-info-600",neutral:"text-neutral-500 group-focus-within/datetimepicker:text-neutral-600"},Un={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as sr,jsxs as qt}from"react/jsx-runtime";function ul({ref:e,value:r,defaultValue:t,onChange:o,format:n,displayFormat:a,layout:s="side-by-side",locale:i="vi",defaultView:l="days",firstDayOfWeek:b=1,minDate:m,maxDate:x,isDateDisabled:c,viewTabs:f,use12Hours:h=!1,showSeconds:p=!0,hourStep:y=1,minuteStep:S=1,secondStep:T=1,minTime:k,maxTime:g,disabledHours:d,disabledMinutes:u,disabledSeconds:v,size:C="md",variant:R="outline",color:N="primary",radius:D,label:V,labelPlacement:Y="top",placeholder:L,helperText:z,errorMessage:A,name:O,id:G,autoComplete:U,disabled:M=!1,readOnly:P=!1,config:$,onClear:K,placement:X="bottom-start",className:B="",wrapperClassName:oe="",inputWrapperClassName:q="",labelClassName:ee="",helperClassName:ne="",popoverClassName:le=""}){let{isRequired:_=!1,isInvalid:W=!1,isLoading:se=!1,showSpinner:Z=!1,isClearable:F=!0,isFullWidth:j=!1,closeOnSelect:re=!1,showWeekNumbers:Se=!1,showViewTabs:ie=!1}=$??{},de=Am(),Te=G||de,ye=`${Te}-error-helper`,J=`${Te}-popover`,E=zt(h,p),I=n||E,fe=a||I,Q=r!==void 0,[xe,ge]=cl(()=>Fr(t,I)),be=Q?Fr(r,I):xe,ce=be?Rr(be,fe,i):"",[pe,De]=cl(l),[ue,Pe]=cl(!1),{refs:{setReference:he,setFloating:Be},floatingStyles:Me,context:ze}=Gm({placement:X,open:ue&&!M&&!P&&!se,onOpenChange:Pe,whileElementsMounted:Ym,transform:!1,middleware:[Om(6),Um(),jm({padding:8})]}),Ie=Wm(ze,{escapeKey:!0,outsidePress:!0}),Fe=Km(ze,{role:"dialog"}),{getReferenceProps:Ge,getFloatingProps:Xe}=Xm([Ie,Fe]),{isMounted:je,styles:Je}=_m(ze,{duration:150,initial:({side:$e})=>({opacity:0,transform:$e==="top"?"translateY(4px) scale(0.96)":$e==="bottom"?"translateY(-4px) scale(0.96)":$e==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:$e})=>({opacity:0,transform:$e==="top"?"translateY(4px) scale(0.96)":$e==="bottom"?"translateY(-4px) scale(0.96)":$e==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),Ze=!!(W||A),_e=Ze?"error":N,te=w(C,sl,"md"),Ae=w(D,Yn,"lg"),We=w(D,On,"lg"),me=R==="other"?"":w(_e,w(R,Un,"outline"),"primary"),Ue=!!be,er=$e=>{let pr=Lr($e,be||new Date);Q||ge(pr);let Wr=pr?Rr(pr,I,i):"";o?.(Wr),re&&Pe(!1)},rr=$e=>{if(!$e)return;let pr=Lr(be||new Date,$e);Q||ge(pr);let Wr=pr?Rr(pr,I,i):"";o?.(Wr),re&&Pe(!1)},cr=$e=>{M||P||se||($e.key==="ArrowDown"||$e.key==="Enter"||$e.key===" "?($e.preventDefault(),ue||Pe(!0)):$e.key==="Escape"&&ue&&($e.preventDefault(),Pe(!1)))},ve=$e=>{$e.stopPropagation(),Q||ge(null),o?.(null),K?.()},wr=L||fe,Ce=Y==="floating",we=Y==="left",nr=()=>{if(!V)return null;let $e=Ze?"text-error-600 font-bold":w(_e,ll,"primary");return Ce?qt("label",{htmlFor:Te,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${te.floatingLabel} ${$e} ${ee}`,children:[V,_&&sr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):qt("label",{htmlFor:Te,className:`inline-flex items-center font-bold transition-colors duration-150 ${te.label} ${$e} ${ee}`,children:[V,_&&sr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},ir=$e=>sr("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${te.icon}`,"aria-hidden":"true",children:$e}),fr=["group/datetimepicker relative flex",we?"flex-row items-center gap-3":"flex-col",j?"w-full":"inline-flex",oe].filter(Boolean).join(" "),Bt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",te.inputHeight,Ae,me,M?"opacity-50":"",j?"w-full":"w-auto",q].filter(Boolean).join(" "),ft=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",te.inputText,te.inputPadding,B].filter(Boolean).join(" ");return qt("div",{className:fr,children:[!Ce&&nr(),qt("div",{className:`flex flex-col ${j?"w-full":""}`,children:[qt("div",{ref:he,...Ge(),className:Bt,children:[Ce&&nr(),sr("input",{ref:e,id:Te,name:O,type:"text",value:ce,onClick:()=>!M&&!P&&!se&&Pe($e=>!$e),onKeyDown:cr,readOnly:!0,autoComplete:U,placeholder:wr,disabled:M||se,role:"combobox","aria-expanded":ue&&!se,"aria-haspopup":"dialog","aria-controls":J,"aria-required":_,"aria-invalid":Ze,"aria-busy":se,"aria-disabled":M||se,"aria-describedby":z||A?ye:void 0,"aria-errormessage":A?ye:void 0,className:ft}),qt("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[se&&Z&&sr("div",{className:"flex items-center justify-center shrink-0",children:ir(sr(ke,{}))}),!se&&F&&!M&&!P&&sr("button",{type:"button",onClick:ve,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Ue?0:-1,"aria-hidden":!Ue,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${te.icon} ${Ue?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:sr(Le,{className:"size-full"})}),sr("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ue?"rotate-180":"rotate-0"}`,children:ir(sr(tr,{className:"size-full"}))})]})]}),je&&sr(Zm,{children:sr(qm,{context:ze,modal:!1,returnFocus:!0,children:qt("div",{ref:Be,id:J,style:{...Me,...Je,zIndex:qe.PICKER},...Xe(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${We} ${s==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${le}`,children:[sr("div",{className:"flex flex-col",children:sr(lt,{value:be,onChange:er,view:pe,onViewChange:De,minDate:m,maxDate:x,isDateDisabled:c,locale:i,firstDayOfWeek:b,showWeekNumbers:Se,size:C,color:N,radius:D,showViewTabs:ie,viewTabs:f,className:"border-none shadow-none rounded-none"})}),sr("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:sr($r,{value:be,onChange:rr,ariaLabel:typeof V=="string"?`${V} time`:"Time selector",use12Hours:h,showSeconds:p,hourStep:y,minuteStep:S,secondStep:T,minTime:k,maxTime:g,disabledHours:d,disabledMinutes:u,disabledSeconds:v,size:C,color:N,radius:D,className:"border-none shadow-none bg-transparent"})})]})})}),sr(Ee,{id:ye,helperText:z,errorMessage:A,sizeClassName:te.helper,className:ne})]})]})}import{useState as Zi,useId as Qm,useMemo as eb}from"react";import{useFloating as rb,autoUpdate as tb,offset as ob,flip as nb,shift as ib,useDismiss as ab,useRole as sb,useInteractions as lb,useTransitionStyles as cb,FloatingPortal as ub,FloatingFocusManager as db}from"@floating-ui/react";var dl={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}},fl=Yn,pl=On;var gl=Un,ml={primary:"text-primary-500 group-focus-within/datetimerangepicker:text-primary-600",secondary:"text-secondary-500 group-focus-within/datetimerangepicker:text-secondary-600",error:"text-error-500 group-focus-within/datetimerangepicker:text-error-600",success:"text-success-500 group-focus-within/datetimerangepicker:text-success-600",warning:"text-warning-500 group-focus-within/datetimerangepicker:text-warning-600",info:"text-info-500 group-focus-within/datetimerangepicker:text-info-600",neutral:"text-neutral-500 group-focus-within/datetimerangepicker:text-neutral-600"},bl={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};import{jsx as or,jsxs as Br}from"react/jsx-runtime";function hl({ref:e,value:r,defaultValue:t,onChange:o,format:n,displayFormat:a,separator:s=" - ",startLabel:i="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:b="side-by-side",locale:m="vi",defaultView:x="days",firstDayOfWeek:c=1,minDate:f,maxDate:h,isDateDisabled:p,viewTabs:y,use12Hours:S=!1,showSeconds:T=!0,hourStep:k=1,minuteStep:g=1,secondStep:d=1,minTime:u,maxTime:v,disabledHours:C,disabledMinutes:R,disabledSeconds:N,size:D="md",variant:V="outline",color:Y="primary",radius:L,label:z,labelPlacement:A="top",placeholder:O,placeholders:G,helperText:U,errorMessage:M,name:P,id:$,autoComplete:K,disabled:X=!1,readOnly:B=!1,config:oe,onClear:q,placement:ee="bottom-start",className:ne="",wrapperClassName:le="",inputWrapperClassName:_="",labelClassName:W="",helperClassName:se="",popoverClassName:Z=""}){let{isRequired:F=!1,isInvalid:j=!1,isLoading:re=!1,showSpinner:Se=!1,isClearable:ie=!0,isFullWidth:de=!1,closeOnSelect:Te=!1,showWeekNumbers:ye=!1,showViewTabs:J=!1}=oe??{},E=Qm(),I=$||E,fe=`${I}-error-helper`,Q=`${I}-popover`,xe=zt(S,T),ge=n||xe,be=a||ge,ce=r!==void 0,[pe,De]=Zi(()=>{let Re=t;return Re&&Array.isArray(Re)?[Fr(Re[0],ge),Fr(Re[1],ge)]:[null,null]}),ue=ce?r&&Array.isArray(r)?[Fr(r[0],ge),Fr(r[1],ge)]:[null,null]:pe,[Pe,he]=Zi("start"),[Be,Me]=Zi(x),[ze,Ie]=Zi(!1),Fe=ue[0]?Rr(ue[0],be,m):"",Ge=ue[1]?Rr(ue[1],be,m):"",Xe=eb(()=>Fe&&Ge?`${Fe}${s}${Ge}`:Fe?`${Fe}${s}`:"",[Fe,Ge,s]),{refs:{setReference:je,setFloating:Je},floatingStyles:Ze,context:_e}=rb({placement:ee,open:ze&&!X&&!B&&!re,onOpenChange:Ie,whileElementsMounted:tb,transform:!1,middleware:[ob(6),nb(),ib({padding:8})]}),te=ab(_e,{escapeKey:!0,outsidePress:!0}),Ae=sb(_e,{role:"dialog"}),{getReferenceProps:We,getFloatingProps:me}=lb([te,Ae]),{isMounted:Ue,styles:er}=cb(_e,{duration:150,initial:({side:Re})=>({opacity:0,transform:Re==="top"?"translateY(4px) scale(0.96)":Re==="bottom"?"translateY(-4px) scale(0.96)":Re==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:Re})=>({opacity:0,transform:Re==="top"?"translateY(4px) scale(0.96)":Re==="bottom"?"translateY(-4px) scale(0.96)":Re==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),rr=!!(j||M),cr=rr?"error":Y,ve=w(D,dl,"md"),wr=w(L,fl,"lg"),Ce=w(L,pl,"lg"),we=w(cr,bl,"primary"),nr=V==="other"?"":w(cr,w(V,gl,"outline"),"primary"),ir=!!(ue[0]||ue[1]),fr=Re=>{ce||De(Re);let hr=Re[0]?Rr(Re[0],ge,m):"",Pr=Re[1]?Rr(Re[1],ge,m):"";o?.(hr||Pr?[hr,Pr]:null),Te&&Re[0]&&Re[1]&&Ie(!1)},Bt=Re=>{if(Pe==="start"){let hr=Lr(Re,ue[0]||new Date),Pr=ue[1];Pr&&hr&&hr.getTime()>Pr.getTime()&&(Pr=null),fr([hr,Pr])}else{let hr=Lr(Re,ue[1]||ue[0]||new Date);fr([ue[0],hr])}},ft=Re=>{if(Re)if(Pe==="start"){let hr=Lr(ue[0]||new Date,Re),Pr=ue[1];Pr&&hr&&hr.getTime()>Pr.getTime()&&(Pr=null),fr([hr,Pr])}else{let hr=Lr(ue[1]||ue[0]||new Date,Re);fr([ue[0],hr])}},$e=Re=>{X||B||re||(Re.key==="ArrowDown"||Re.key==="Enter"||Re.key===" "?(Re.preventDefault(),ze||Ie(!0)):Re.key==="Escape"&&ze&&(Re.preventDefault(),Ie(!1)))},pr=Re=>{Re.stopPropagation(),ce||De([null,null]),o?.(null),q?.()},Wr=O||(G?`${G[0]}${s}${G[1]}`:`${be}${s}${be}`),H=A==="floating",ae=A==="left",Ne=()=>{if(!z)return null;let Re=rr?"text-error-600 font-bold":w(cr,ml,"primary");return H?Br("label",{htmlFor:I,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 cursor-pointer font-bold bg-neutral-white transition-colors duration-150 ${ve.floatingLabel} ${Re} ${W}`,children:[z,F&&or("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):Br("label",{htmlFor:I,className:`inline-flex items-center font-bold transition-colors duration-150 ${ve.label} ${Re} ${W}`,children:[z,F&&or("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Ve=Re=>or("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ve.icon}`,"aria-hidden":"true",children:Re}),Ye=["group/datetimerangepicker relative flex",ae?"flex-row items-center gap-3":"flex-col",de?"w-full":"inline-flex",le].filter(Boolean).join(" "),Oe=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",ve.inputHeight,wr,nr,X?"opacity-50":"",de?"w-full":ve.minWidth||"min-w-80",_].filter(Boolean).join(" "),pt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",ve.inputText,ve.inputPadding,ne].filter(Boolean).join(" "),Ql=Pe==="start"?ue[0]:ue[1];return Br("div",{className:Ye,children:[!H&&Ne(),Br("div",{className:`flex flex-col ${de?"w-full":""}`,children:[Br("div",{ref:je,...We(),className:Oe,children:[H&&Ne(),or("input",{ref:e,id:I,name:P,type:"text",value:Xe,onClick:()=>!X&&!B&&!re&&Ie(Re=>!Re),onKeyDown:$e,readOnly:!0,autoComplete:K,placeholder:Wr,disabled:X||re,role:"combobox","aria-expanded":ze&&!re,"aria-haspopup":"dialog","aria-controls":Q,"aria-required":F,"aria-invalid":rr,"aria-busy":re,"aria-disabled":X||re,"aria-describedby":U||M?fe:void 0,"aria-errormessage":M?fe:void 0,className:pt}),Br("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[re&&Se&&or("div",{className:"flex items-center justify-center shrink-0",children:Ve(or(ke,{}))}),!re&&ie&&!X&&!B&&or("button",{type:"button",onClick:pr,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:ir?0:-1,"aria-hidden":!ir,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ve.icon} ${ir?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:or(Le,{className:"size-full"})}),or("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ze?"rotate-180":"rotate-0"}`,children:Ve(or(tr,{className:"size-full"}))})]})]}),Ue&&or(ub,{children:or(db,{context:_e,modal:!1,returnFocus:!0,children:Br("div",{ref:Je,id:Q,style:{...Ze,...er,zIndex:qe.PICKER},...me(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Ce} ${Z}`,children:[Br("div",{className:`flex ${b==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[or("div",{className:"flex flex-col",children:or(lt,{value:Ql,onChange:Bt,view:Be,onViewChange:Me,minDate:Pe==="end"&&ue[0]||f,maxDate:Pe==="start"&&ue[1]||h,isDateDisabled:p,locale:m,firstDayOfWeek:c,showWeekNumbers:ye,size:D,color:Y,radius:L,showViewTabs:J,viewTabs:y,className:"border-none shadow-none rounded-none"},`calendar-step-${Pe}`)}),or("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:or($r,{value:Ql||ue[0],onChange:ft,ariaLabel:Pe==="start"?`${i} time`:`${l} time`,use12Hours:S,showSeconds:T,hourStep:k,minuteStep:g,secondStep:d,minTime:Pe==="end"&&ue[0]||u,maxTime:Pe==="start"&&ue[1]||v,disabledHours:C,disabledMinutes:R,disabledSeconds:N,size:D,color:Y,radius:L,className:"border-none shadow-none bg-transparent"},`timeview-step-${Pe}`)})]}),Br("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[Br("div",{className:"flex items-center space-x-2",children:[Br("button",{type:"button",onClick:()=>he("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${Pe==="start"?we.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",i]}),Br("button",{type:"button",onClick:()=>he("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${Pe==="end"?we.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),or("button",{type:"button",onClick:()=>Ie(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${we.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),or(Ee,{id:fe,helperText:U,errorMessage:M,sizeClassName:ve.helper,className:se})]})]})}import fb from"react";import pb from"next/image";var qi={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},Ji={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};import{jsx as jn}from"react/jsx-runtime";function _o({preset:e="default",...r}){switch(e){case"search":return jn(Xa,{...r});case"error":return jn(_a,{...r});case"folder":return jn(Za,{...r});case"simple":return jn(qa,{...r});default:return jn(Ka,{...r})}}import{jsx as It,jsxs as wd}from"react/jsx-runtime";var gb=["default","search","error","folder","simple"];function mb(e){return typeof e=="string"&&gb.includes(e)}function bb(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function Wn({size:e="md",layout:r="vertical",image:t="default",imageSize:o,imageClassName:n="",imageAlt:a="Tr\u1ED1ng",title:s,titleClassName:i="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:b="",actions:m,actionsClassName:x="",children:c,className:f="",role:h="status",ref:p,...y}){let S=qi[e]||qi.md,T=Ji[r]||Ji.vertical,k=o?{width:typeof o=="number"?`${o}px`:o,height:typeof o=="number"?`${o}px`:o}:{},g=()=>{if(!t)return null;if(mb(t))return It(_o,{preset:t});if(bb(t)){let D=typeof o=="number"?o:S.defaultImageSize;return It(pb,{src:t,alt:a,width:D,height:D,className:"size-full object-contain pointer-events-none select-none",unoptimized:t.startsWith("data:")||t.endsWith(".svg")})}return fb.isValidElement(t)?t:It(_o,{preset:"default"})},d=["flex items-center justify-center shrink-0",o?"":S.imageWrapper,n].filter(Boolean).join(" "),u=["w-full transition-all",T.container,S.container,S.gap,f].filter(Boolean).join(" "),v=[T.content,S.contentGap].filter(Boolean).join(" "),C=[S.title,i].filter(Boolean).join(" "),R=[S.description,b].filter(Boolean).join(" "),N=["flex flex-wrap items-center gap-2",S.actionsGap,r==="vertical"?"justify-center":"justify-start",x].filter(Boolean).join(" ");return wd("div",{ref:p,role:h,"aria-live":"polite",className:u,...y,children:[t&&It("div",{className:d,style:k,"aria-hidden":"true",children:g()}),(s||l||m||c)&&wd("div",{className:v,children:[s&&It("div",{className:C,children:s}),l&&It("div",{className:R,children:l}),m&&It("div",{className:N,children:m}),c&&It("div",{className:"mt-2 w-full",children:c})]})]})}import{useState as qo,useRef as Dd,useMemo as na,useEffect as Sb,useCallback as kl,useId as Tb}from"react";import{useFloating as Rb,autoUpdate as Nb,offset as Db,flip as Pb,shift as zb,useClick as Ib,useDismiss as Mb,useRole as Eb,useListNavigation as $b,useInteractions as Lb}from"@floating-ui/react";import{rankItem as Fb,compareItems as Bb}from"@tanstack/match-sorter-utils";var Mt={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl"}},Kn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Cd={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Xn={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},xl={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},vl={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"},yl={top:{container:"flex flex-col gap-1.5",label:"text-sm font-bold text-neutral-700 mb-1"},left:{container:"flex flex-row items-center gap-3",label:"text-sm font-bold text-neutral-700 shrink-0"},floating:{container:"relative",label:"absolute left-3 -top-2.5 bg-neutral-white px-1.5 text-xs font-bold text-neutral-600 z-10 transition-all pointer-events-none rounded-sm"}};import{useRef as hb}from"react";import{jsx as dr,jsxs as Qi}from"react/jsx-runtime";function xb({id:e,selectedOptions:r,isOpen:t,size:o="md",variant:n="outline",color:a="primary",radius:s="md",placeholder:i="Ch\u1ECDn...",disabled:l=!1,readOnly:b=!1,isInvalid:m=!1,multiple:x=!1,maxTagCount:c,searchable:f=!1,searchPlacement:h="trigger",searchValue:p="",onSearchChange:y,onRemoveTag:S,onClear:T,clearable:k=!1,loading:g=!1,isLoading:d,startContent:u,endContent:v,renderValue:C,triggerRef:R,getReferenceProps:N,onKeyDown:D,className:V=""}){let Y=!!(d??g),L=hb(null),z=Mt[o]||Mt.md,A=Kn[s]||Kn.md,O=Cd[s]||"md",U=!!m?"error":a,M=n==="other"?"":Xn[n]?.[U]||Xn.outline.primary,P=f&&(h==="trigger"||h==="both"),$=r.length>0,K=k&&($||p.length>0)&&!l&&!b,X=x&&c&&c>0?r.slice(0,c):r,B=x&&c&&c>0?Math.max(0,r.length-c):0,oe=()=>{!l&&!b&&!Y&&P&&L.current?.focus()},q=()=>{if(C&&$)return dr("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:C(x?r:r[0])});if(x)return Qi("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[X.map(le=>dr(tt,{size:z.badgeSize,variant:"soft",color:a,radius:O,onDelete:!l&&!b&&!Y&&S?()=>S(le):void 0,className:"max-w-full truncate",children:dr("span",{className:"truncate",children:le.label})},String(le.value))),B>0&&Qi(tt,{size:z.badgeSize,variant:"soft",color:"neutral",radius:O,children:["+",B]}),P&&!l&&!b&&!Y?dr("input",{ref:L,type:"text","aria-label":"Search",value:p,placeholder:$?"":i,onChange:le=>y?.(le.target.value),onKeyDown:D,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${z.input}`}):$?null:dr("span",{className:"text-neutral-400 truncate",children:i})]});let ne=r[0];return P&&!l&&!b&&!Y?dr("div",{className:"relative flex-1 min-w-0 flex items-center",children:dr("input",{ref:L,type:"text","aria-label":"Search",value:p,placeholder:ne?ne.label:i,onChange:le=>y?.(le.target.value),onKeyDown:D,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!p&&ne?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${z.input}`})}):dr("div",{className:"flex-1 min-w-0 truncate",children:ne?dr("span",{className:"text-neutral-900",children:ne.label}):dr("span",{className:"text-neutral-400",children:i})})},ee=l?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return Qi("div",{ref:R,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:l?-1:0,onClick:oe,"aria-busy":Y,"aria-disabled":l||Y,...N({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${A} ${z.trigger} ${z.gap} ${M} ${ee} ${V}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[u&&dr("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:u}),q(),Qi("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[Y&&dr(ke,{className:`${z.icon} animate-spin text-current`}),K&&!Y&&dr("button",{type:"button","aria-label":"Clear selection",onClick:ne=>{ne.stopPropagation(),T?.(ne)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:dr(Le,{className:"size-3.5"})}),v,dr("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:dr(tr,{className:z.icon})})]})]})}var ea=xb;import{FloatingPortal as wb}from"@floating-ui/react";import{jsx as Zo,jsxs as wl}from"react/jsx-runtime";function vb({option:e,isSelected:r,isActive:t,size:o="md",color:n="primary",radius:a="md",disabled:s=!1,renderOption:i,onClick:l,onMouseEnter:b,ref:m}){let x=Mt[o]||Mt.md,c=a==="none"?"rounded-none":o==="lg"||o==="xl"?"rounded-lg":"rounded-md",f=s||e.disabled;if(i)return Zo("div",{ref:m,role:"option",tabIndex:-1,"aria-selected":r,"aria-disabled":f,"data-active":t,"data-selected":r,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${f?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:f?void 0:l,onMouseEnter:f?void 0:b,children:i(e,{selected:r,active:t})});let h=r?xl[n]||xl.primary:"text-neutral-800 hover:bg-neutral-100",p=t&&!r?vl[n]||vl.primary:"";return wl("div",{ref:m,role:"option",tabIndex:-1,"aria-selected":r,"aria-disabled":f,"data-active":t,"data-selected":r,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${c} ${x.option} ${h} ${p} ${f?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:f?void 0:l,onMouseEnter:f?void 0:b,children:[wl("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&Zo("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),wl("div",{className:"flex flex-col min-w-0 flex-1",children:[Zo("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&Zo("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),r&&Zo("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:Zo(mt,{className:"size-3.5"})})]})}var ra=vb;import{jsx as Vr,jsxs as kd}from"react/jsx-runtime";function yb({filters:e,values:r,onChange:t,onReset:o,layout:n="vertical",gridCols:a=2,showReset:s=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:l="primary",radius:b="md"}){if(!e||e.length===0)return null;let m=c=>{let f=r[c.name]??c.defaultValue;if(c.type==="custom")return c.render?.({value:f,onChange:h=>t(c.name,h)})??null;switch(c.type){case"string":case"text":return Vr(Xr,{size:"sm",color:l,radius:b,label:c.label,placeholder:c.placeholder||"Nh\u1EADp \u0111\u1EC3 t\xECm...",value:f||"",onChange:h=>t(c.name,h.target.value),...c.props||{}});case"number":return Vr(Xr,{size:"sm",type:"number",color:l,radius:b,label:c.label,placeholder:c.placeholder||"Nh\u1EADp s\u1ED1...",value:f||"",onChange:h=>t(c.name,Number(h.target.value)),...c.props||{}});case"date":return Vr(In,{size:"sm",color:l,radius:b,label:c.label,placeholder:c.placeholder||"Ch\u1ECDn ng\xE0y",value:f,onChange:h=>t(c.name,h),...c.props||{}});case"date-range":return Vr(Bn,{size:"sm",color:l,radius:b,label:c.label,placeholder:c.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:f||[null,null],onChange:h=>t(c.name,h),...c.props||{}});case"checkbox-group":return kd("div",{className:"flex flex-col gap-1.5",children:[c.label&&Vr("span",{className:"text-xs font-medium text-zinc-700 dark:text-zinc-300",children:c.label}),Vr(cn,{size:"sm",color:l,value:f||[],onChange:h=>t(c.name,h),...c.props||{},children:Vr("div",{className:"flex flex-wrap gap-2",children:c.options?.map(h=>Vr(ln,{value:String(h.value),disabled:h.disabled,size:"sm",color:l,label:h.label},String(h.value)))})})]});default:return null}};return kd("div",{className:"p-2.5 border-b border-neutral-200 bg-neutral-50/70 rounded-t-lg",children:[Vr("div",{className:n==="grid"?`grid ${a===1?"grid-cols-1":a===3?"grid-cols-1 sm:grid-cols-3":a===4?"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4":"grid-cols-1 sm:grid-cols-2"} gap-2.5 items-end`:"flex flex-col gap-2.5",children:e.map(c=>{let f=c.colSpan?`col-span-${c.colSpan}`:"";return Vr("div",{className:`w-full ${f}`,children:m(c)},c.name)})}),s&&o&&Vr("div",{className:"flex justify-end mt-2 pt-2 border-t border-neutral-200",children:Vr(Kr,{size:"xs",variant:"ghost",onClick:o,className:"text-[11px] h-6 px-2 text-neutral-500 hover:text-neutral-900",children:i})})]})}var ta=yb;import{jsx as Et,jsxs as Sd}from"react/jsx-runtime";var Cb={};function kb({isOpen:e,options:r,selectedValues:t,activeIndex:o,size:n="md",color:a="primary",radius:s="md",loading:i=!1,portal:l=!0,maxMenuHeight:b=280,emptyText:m,emptyProps:x,menuHeader:c,menuFooter:f,menuFilters:h,menuFilterValues:p=Cb,menuFilterLayout:y="vertical",menuFilterGridCols:S=2,showResetFilters:T=!0,resetFiltersText:k,onMenuFilterChange:g,onResetFilters:d,renderOption:u,onSelectOption:v,onOptionMouseEnter:C,floatingStyles:R,floatingRef:N,getFloatingProps:D,listElementsRef:V,className:Y=""}){if(!e)return null;let L=s==="none"?"rounded-none":n==="lg"||n==="xl"?"rounded-xl":"rounded-lg",z=Sd("div",{ref:N,style:{...R,zIndex:qe.SELECT},...D({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${L} ${Y}`}),children:[c,h&&h.length>0&&g&&Et(ta,{filters:h,values:p,onChange:g,onReset:d,layout:y,gridCols:S,showReset:T,resetText:k,color:a,radius:s}),Et("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof b=="number"?`${b}px`:b},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${i?"opacity-75":"opacity-100"}`,children:r.length===0?i?Sd("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[Et(ke,{className:"size-4 animate-spin text-current"}),Et("span",{children:"Loading..."})]}):Et("div",{className:"py-4 px-2",children:Et(Wn,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...x})}):(()=>{let A=new Set(t);return r.map((O,G)=>{let U=A.has(O.value);return Et(ra,{ref:P=>{V.current[G]=P},option:O,isSelected:U,isActive:o===G,size:n,color:a,radius:s,disabled:O.disabled,renderOption:u,onClick:()=>v(O),onMouseEnter:()=>C(G)},String(O.value))})})()}),f]});return l?Et(wb,{children:z}):z}var oa=kb;import{useRef as Td,useEffect as Rd,useCallback as Nd}from"react";function Cl(e,r=300){let t=Td(e),o=Td(null);Rd(()=>{t.current=e},[e]);let n=Nd(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return Rd(()=>n,[n]),{debounced:Nd((...s)=>{n(),o.current=setTimeout(()=>{t.current(...s)},r)},[n,r]),cancel:n}}import{Fragment as Ab,jsx as Jt,jsxs as Sl}from"react/jsx-runtime";var Vb=[];function Hb(e){return!!e.multiple}function Tl(e){let{ref:r,options:t=Vb,size:o="md",variant:n="outline",color:a="primary",radius:s="md",id:i,label:l,labelPlacement:b="top",placeholder:m="Ch\u1ECDn...",helperText:x,errorMessage:c,isInvalid:f=!!c,isDisabled:h=!1,isReadOnly:p=!1,readOnly:y=!1,isRequired:S=!1,name:T,searchable:k=!1,searchMode:g="client",searchPlacement:d="trigger",searchPlaceholder:u,searchValue:v,onSearchChange:C,menuFilters:R,menuFilterValues:N,menuFilterLayout:D="vertical",menuFilterGridCols:V=2,showResetFilters:Y=!0,resetFiltersText:L,onMenuFilterChange:z,menuHeader:A,menuFooter:O,onSearch:G,debounceMs:U=300,filterFn:M,loading:P=!1,isLoading:$,emptyText:K,emptyProps:X,clearable:B=!1,portal:oe=!0,placement:q="bottom-start",maxMenuHeight:ee=280,startContent:ne,endContent:le,renderValue:_,renderOption:W,className:se="",triggerClassName:Z="",menuClassName:F=""}=e,j=Hb(e),re=!!($??P),Se=j?null:e,ie=j?e:null,[de,Te]=qo(Se?.defaultValue??null),[ye,J]=qo(ie?.defaultValue??[]),E=Se?.value!==void 0,I=ie?.value!==void 0,fe=ie?.value,Q=na(()=>I?fe??[]:ye,[I,fe,ye]),xe=Se?.value,ge=na(()=>E?xe??null:de,[E,xe,de]),be=Dd(new Map);Sb(()=>{t.forEach(H=>{be.current.set(H.value,H)})},[t]);let ce=na(()=>j?Q.map(H=>t.find(Ne=>Ne.value===H)||be.current.get(H)||{value:H,label:String(H)}):ge!=null?[t.find(ae=>ae.value===ge)||be.current.get(ge)||{value:ge,label:String(ge)}]:[],[j,Q,ge,t]),[pe,De]=qo(!1),[ue,Pe]=qo(null),[he,Be]=qo(""),Me=v!==void 0,ze=Me?v:he,{debounced:Ie}=Cl((H,ae)=>{g==="server"&&G?.(H,ae)},U),Fe=H=>{Me||Be(H),C?.(H),pe||De(!0),Ie(H,je)},[Ge,Xe]=qo(()=>{let H={};return R?.forEach(ae=>{ae.defaultValue!==void 0&&(H[ae.name]=ae.defaultValue)}),H}),je=N??Ge,Je=(H,ae)=>{let Ne={...je,[H]:ae};N||Xe(Ne),z?.(Ne),Ie(ze,Ne)},Ze=()=>{let H={};R?.forEach(ae=>{ae.defaultValue!==void 0&&(H[ae.name]=ae.defaultValue)}),N||Xe(H),z?.(H),Ie(ze,H)},_e=na(()=>{if(g==="server")return t;let H=t,ae=ze.trim();if(ae){let Ne=[],Ve=[Ye=>Ye.label,Ye=>String(Ye.value),Ye=>String(Ye.description||"")];for(let Ye of H){let Oe=Fb(Ye,ae,{accessors:Ve});Oe.passed&&Ne.push({item:Ye,info:Oe})}Ne.sort((Ye,Oe)=>Bb(Ye.info,Oe.info)),H=Ne.map(Ye=>Ye.item)}return M&&(H=H.filter(Ne=>M(Ne,ze,je))),H},[t,g,ze,M,je]),te=Dd([]),Ae=!!(p||y),We=!h&&!Ae,{refs:me,floatingStyles:Ue,context:er}=Rb({placement:q,open:pe&&We,onOpenChange:H=>{We&&(!re||pe||!H)&&(De(H),H||(Pe(null),!Me&&!j&&Be("")))},whileElementsMounted:Nb,transform:!1,middleware:[Db(4),Pb(),zb({padding:8})]}),rr=Ib(er,{enabled:We&&(!re||pe)}),cr=Mb(er),ve=Eb(er,{role:"listbox"}),wr=$b(er,{listRef:te,activeIndex:ue,onNavigate:Pe,loop:!0}),{getReferenceProps:Ce,getFloatingProps:we}=Lb([rr,cr,ve,wr]),nr=kl(H=>{if(!(H.disabled||h||p))if(be.current.set(H.value,H),j){let ae=e,Ve=Q.includes(H.value)?Q.filter(Oe=>Oe!==H.value):[...Q,H.value];I||J(Ve);let Ye=Ve.map(Oe=>t.find(pt=>pt.value===Oe)||be.current.get(Oe)||{value:Oe,label:String(Oe)});ae.onChange?.(Ve,Ye),Me||Be("")}else{let ae=e;E||Te(H.value),ae.onChange?.(H.value,H),De(!1),Me||Be("")}},[j,h,p,e,Q,I,t,Me,E]),ir=kl(H=>{if(h||p||!j)return;let ae=Q.filter(Ve=>Ve!==H.value);I||J(ae);let Ne=ae.map(Ve=>t.find(Ye=>Ye.value===Ve)||be.current.get(Ve)||{value:Ve,label:String(Ve)});j&&e.onChange?.(ae,Ne)},[h,p,j,Q,I,t,e]),fr=kl(H=>{H.stopPropagation(),!(h||p)&&(j?(I||J([]),e.onChange?.([],[])):(E||Te(null),e.onChange?.(null,null)),Me||Be(""))},[h,p,j,e,I,E,Me]),Bt=H=>{let ae=H.currentTarget?.value??ze;if(H.key==="Backspace"&&(!ae||ae.length===0)&&j&&ce.length>0){H.preventDefault();let Ne=ce[ce.length-1];Ne&&ir(Ne)}else if(H.key==="Enter"&&pe&&ue!==null){H.preventDefault();let Ne=_e[ue];Ne&&nr(Ne)}else H.key==="ArrowDown"&&!pe&&De(!0)},ft=yl[b]||yl.top,$e=Tb(),Wr=`${i||$e}-trigger`;return Sl("div",{ref:r,id:i,className:`${ft.container} ${se}`,"data-disabled":h,"data-invalid":f,children:[l&&Sl("label",{htmlFor:Wr,className:ft.label,children:[l,S&&Jt("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Sl("div",{className:"relative flex-1 min-w-0",children:[Jt(ea,{id:Wr,triggerRef:me.setReference,getReferenceProps:Ce,selectedOptions:ce,isOpen:pe,size:o,variant:n,color:a,radius:s,placeholder:u||m,disabled:h,readOnly:Ae,isInvalid:f,multiple:j,maxTagCount:j?e.maxTagCount:void 0,searchable:k,searchPlacement:d,searchValue:ze,onSearchChange:Fe,onRemoveTag:ir,onClear:fr,clearable:B,loading:re,startContent:ne,endContent:le,renderValue:_,onKeyDown:Bt,className:Z}),Jt(oa,{isOpen:pe,options:_e,selectedValues:j?Q:ge!=null?[ge]:[],activeIndex:ue,size:o,color:a,radius:s,loading:re,portal:oe,maxMenuHeight:ee,emptyText:K,emptyProps:X,menuHeader:A,menuFooter:O,menuFilters:R,menuFilterValues:je,menuFilterLayout:D,menuFilterGridCols:V,showResetFilters:Y,resetFiltersText:L,onMenuFilterChange:Je,onResetFilters:Ze,renderOption:W,onSelectOption:nr,onOptionMouseEnter:Pe,floatingRef:me.setFloating,floatingStyles:Ue,getFloatingProps:we,listElementsRef:te,className:F})]}),T&&Jt(Ab,{children:j?Q.map((H,ae)=>Jt("input",{type:"hidden",name:`${T}[]`,value:String(H)},`${T}-${H}-${ae}`)):ge!=null?Jt("input",{type:"hidden",name:T,value:String(ge)}):null}),(c||x)&&Jt("div",{className:`text-xs ${f?"text-error-600 font-normal":"text-neutral-500 font-normal"}`,children:c||x})]})}var Pd=Tl;import{useEffect as Gb,useState as Yb}from"react";function Ob(e,r=300){let[t,o]=Yb(e);return Gb(()=>{let n=setTimeout(()=>{o(e)},r);return()=>{clearTimeout(n)}},[e,r]),t}import{useEffect as ch,useId as uh,useRef as Hd,useState as ti}from"react";var Jo={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Rl={xs:"sm",sm:"sm",md:"md",lg:"lg",xl:"xl"},Qt={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},Nl={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function ia(){return"upload_"+Math.random().toString(36).substring(2,9)+"_"+Date.now()}function Dl(e,r=1){if(!+e)return"0 B";let t=1024,o=r<0?0:r,n=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,a)).toFixed(o))} ${n[a]}`}function aa(e){return e?typeof e=="string"?[{id:ia(),name:e.split("/").pop()||"image.png",url:e,status:"success"}]:Array.isArray(e)?e.map(r=>typeof r=="string"?{id:ia(),name:r.split("/").pop()||"image.png",url:r,status:"success"}:r):[e]:[]}function sa(e,r){if(!r)return{isValid:!0};if(r.maxSize&&e.size>r.maxSize)return{isValid:!1,error:`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${Dl(r.maxSize)})`};if(r.accept&&r.accept.trim()!=="*"){let t=r.accept.split(",").map(s=>s.trim().toLowerCase()),o=e.type.toLowerCase(),n=e.name.toLowerCase();if(!t.some(s=>{if(s.startsWith("."))return n.endsWith(s);if(s.endsWith("/*")){let i=s.split("/")[0];return o.startsWith(i+"/")}return o===s}))return{isValid:!1,error:`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${r.accept}`}}return{isValid:!0}}function la(e,r){return{id:ia(),name:e.name,size:e.size,type:e.type,url:r,file:e,status:"success"}}function zd(e){if(e?.url&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}}import{useEffect as Xb,useState as _b}from"react";var ca=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],ua=["pdf"],da=["mp4","webm","ogg","mov","avi","mkv"],fa=["mp3","wav","ogg","aac","flac","m4a"],pa=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function $t(e=""){if(!e)return"";let r=e.split("?")[0]?.split("#")[0]||"",t=r.split("/").pop()||r.split("\\").pop()||"",o=t.lastIndexOf(".");return o<=0?t:t.slice(0,o)}function Pl(e=""){let r=e.split("?")[0]?.split("#")[0]||"",t=r.lastIndexOf(".");return t===-1?"":r.slice(t+1).toLowerCase()}function Qo(e=""){let r=Pl(e);return ca.includes(r)?"image":ua.includes(r)?"pdf":da.includes(r)?"video":fa.includes(r)?"audio":pa.includes(r)?"document":"other"}function eo(e){return e?e instanceof File?{name:$t(e.name),type:Qo(e.name),file:e,serverFile:void 0}:{name:e.name??$t(e?.src),type:Qo(e?.src),file:void 0,serverFile:e}:{name:"file",type:"other",file:void 0,serverFile:void 0}}function en(e,r){if(!e)return;let t=document.createElement("a");t.href=e;let o=e.split("?")[0]?.split("#")[0]||"",n=o.split("/").pop()||o.split("\\").pop()||"download";t.download=r||n,t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{try{document.body.removeChild(t)}catch{}},100)}import{createContext as Ub,useContext as jb}from"react";var zl=Ub(null),ga=()=>jb(zl);import{useState as ma}from"react";import Wb from"react-easy-crop";import{jsx as Nr,jsxs as Id}from"react/jsx-runtime";function _n({zoom:e=1,onZoomIn:r,onZoomOut:t,onRotateCw:o,onRotateCcw:n,onFlipHorizontal:a,onReset:s,currentImage:i,tools:l,className:b=""}){let{zoomIn:m=!0,zoomOut:x=!0,reset:c=!0,rotate:f=!0,flip:h=!0,download:p=!0}=l??{},y=Math.round(e*100),S=()=>{i?.src&&en(i.src,i.name)},T="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return Id("div",{className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${b}`,children:[m&&Nr("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=5,onClick:r,className:T,children:Nr(Ro,{width:18,height:18})}),x&&Nr("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=.2,onClick:t,className:T,children:Nr(No,{width:18,height:18})}),c&&Id("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:s,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[y,"%"]}),(f||h||p)&&Nr("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),f&&Nr("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:n,className:T,children:Nr(Po,{width:18,height:18})}),f&&Nr("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:o,className:T,children:Nr(Do,{width:18,height:18})}),h&&Nr("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:a,className:T,children:Nr(Io,{width:18,height:18})}),p&&Nr("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i xu\u1ED1ng",onClick:S,className:T,children:Nr(Yt,{width:18,height:18})})]})}import{jsx as ba,jsxs as Kb}from"react/jsx-runtime";function Zn({src:e,name:r,minZoom:t=.2,maxZoom:o=5,showToolbar:n=!0,toolbarProps:a,children:s}){let[i,l]=ma({x:0,y:0}),[b,m]=ma(1),[x,c]=ma(0),[f,h]=ma(!1),p=()=>m(u=>Math.min(o,Math.round((u+.25)*100)/100)),y=()=>m(u=>Math.max(t,Math.round((u-.25)*100)/100)),S=()=>c(u=>(u+90)%360),T=()=>c(u=>(u-90+360)%360),k=()=>h(u=>!u),g=()=>{l({x:0,y:0}),m(1),c(0),h(!1)},d={src:e,name:r};return e?Kb("div",{className:"flex flex-col w-full select-none",children:[ba("div",{className:"relative w-full h-90 overflow-hidden bg-neutral-50/70 select-none",children:ba(Wb,{image:e,crop:i,zoom:b,rotation:x,minZoom:t,maxZoom:o,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:m,onRotationChange:c,classes:{mediaClassName:f?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),n&&ba("div",{className:"w-full flex items-center justify-center py-3 border-t border-neutral-200 bg-neutral-white z-20",children:ba(_n,{zoom:b,rotation:x,isFlipped:f,onZoomIn:p,onZoomOut:y,onRotateCw:S,onRotateCcw:T,onFlipHorizontal:k,onReset:g,currentImage:d,...a})}),s]}):null}import{jsx as ro,jsxs as Md}from"react/jsx-runtime";function qn({onDownload:e,imageProps:r,className:t=""}){let o=ga(),n=o?.file,a=o?.headerTitle,[s,i]=_b("");Xb(()=>{if(!n){i("");return}if(!(n instanceof File)){let c=eo(n);i(c.serverFile?.src||"");return}let x=URL.createObjectURL(n);return i(x),()=>{URL.revokeObjectURL(x)}},[n]);let l=eo(n),b=(typeof a=="string"?a:"")||l.name||"file",m=()=>{e&&n&&e(n),s&&en(s,b)};return l.type==="image"?ro(Zn,{src:s,name:b,...r}):Md("div",{className:`p-6 text-center ${t}`,children:[ro("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:ro(Yt,{width:32,height:32})}),ro("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:b,children:a??b}),ro("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),Md("button",{type:"button",onClick:m,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[ro(Yt,{width:18,height:18}),ro("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}import{useMemo as ih}from"react";var Ed=250,Lt={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},$d={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};import{createContext as Zb,useContext as qb}from"react";var Il=Zb(null),Hr=()=>qb(Il);import{jsx as Jb}from"react/jsx-runtime";function to({size:e,radius:r,className:t="",children:o,ref:n,...a}){let s=Hr(),i=w(e??s?.size,Lt,"md"),l=w(r,$d,"lg"),b=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",i.dialog,l,t].filter(Boolean).join(" ");return Jb("div",{ref:n,tabIndex:-1,className:b,...a,children:o})}import{useEffect as ha,useEffectEvent as Qb,useCallback as eh,useMemo as rh,useRef as Ld,useState as th}from"react";import{jsx as Ml,jsxs as oh}from"react/jsx-runtime";function oo({open:e=!1,id:r,size:t,isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:a=!0,lockScroll:s=!0,overlayClassName:i="",className:l="",children:b,onClose:m,...x}){let c=Ld(null),[f,h]=th(!1),p=Ld(null),y=eh(()=>{f||o||(h(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h(!1),m?.()},Ed))},[f,o,m]),S=rh(()=>({onClose:y,isLoading:o,size:t}),[y,o,t]);ha(()=>()=>{p.current&&clearTimeout(p.current)},[]),ha(()=>{let u=c.current;if(u)if(e||f){if(!u.open)try{u.showModal()}catch{}}else u.open&&u.close()},[e,f]),ha(()=>{if(!s)return;let u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);let T=Qb(u=>{!e||a===!1||u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),y())});if(ha(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!f)return null;let k=()=>{n&&y()},g=f?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",d=f?"animate-modal-out pointer-events-none":"animate-modal-in";return Ml(Il.Provider,{value:S,children:oh("dialog",{id:r,ref:c,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:u=>{u.preventDefault(),a!==!1&&y()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${g} ${i}`,...x,children:[Ml("div",{"aria-hidden":"true",onClick:k,className:"fixed inset-0 -z-10"}),Ml("div",{className:`w-full flex items-center justify-center pointer-events-none ${d} ${l}`,children:b})]})})}import{jsx as xa,jsxs as Fd}from"react/jsx-runtime";function no({size:e,title:r,description:t,titleClassName:o="",descriptionClassName:n="",showCloseButton:a=!0,onClose:s,closeButtonClassName:i="",className:l="",children:b,...m}){let x=Hr(),c=w(e??x?.size,Lt,"md"),f=x?.isLoading,h=()=>{s?.(),x?.onClose?.()},p=!!(s||x?.onClose);return Fd("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${c.header} ${l}`,...m,children:[Fd("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[r&&xa("h3",{id:"modal-dialog-title",className:`${c.title} truncate ${o}`,children:r}),t&&xa("p",{id:"modal-dialog-description",className:`${c.description} mt-0.5 ${n}`,children:t}),b]}),a&&p&&xa("button",{type:"button",onClick:h,disabled:f,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${c.closeButton} ${i}`,children:xa(Le,{className:c.closeIcon})})]})}import{jsx as nh}from"react/jsx-runtime";function io({size:e,className:r="",children:t,...o}){let n=Hr(),a=w(e??n?.size,Lt,"md");return nh("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${a.body} ${r}`,...o,children:t})}import{jsx as Jn,jsxs as ah}from"react/jsx-runtime";function ao({open:e=!1,onClose:r,file:t,title:o,description:n,size:a,radius:s="xl",showCloseButton:i=!0,closeOnOverlayClick:l=!0,closeOnEsc:b=!0,lockScroll:m=!0,className:x="",overlayClassName:c="",children:f}){let h=eo(t),p=o??h?.name,y=ih(()=>({file:t,headerTitle:p}),[t,p]);return Jn(oo,{open:e,onClose:r,size:a,closeOnOverlayClick:l,closeOnEsc:b,lockScroll:m,overlayClassName:c,children:ah(to,{radius:s,className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${x}`,children:[(p||i)&&Jn(no,{title:p,description:n,showCloseButton:i,className:"px-5 py-3.5 border-b border-neutral-200"}),Jn(io,{children:Jn(zl.Provider,{value:y,children:f||Jn(qn,{})})})]})})}import{jsx as so,jsxs as Bd}from"react/jsx-runtime";function Qn({size:e="md",color:r="primary",variant:t="outline",radius:o,shape:n="rectangle",disabled:a,readOnly:s,isLoading:i,isDragging:l,isInvalid:b,dropzoneTitle:m,dropzoneDescription:x,icon:c,onTriggerUpload:f,className:h="",describedById:p}){let y=Qt[e],S=o?Jo[o]:Jo[Rl[e]],T=b?"error":r,k=t!=="other"?Nl[t][T]:null;return so("div",{role:"button",tabIndex:a?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":b,"aria-describedby":p,"aria-busy":i,onClick:()=>{!a&&!s&&!i&&f()},onKeyDown:u=>{a||s||i||(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),f())},className:`group relative w-full ${y.dropzoneHeight} ${y.dropzonePadding} ${S} border-2 border-dashed flex flex-col items-center justify-center text-center transition-all duration-150 ease-in-out cursor-pointer ${l?k?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":k?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30"} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${h}`,children:i?Bd("div",{className:`flex flex-col items-center justify-center gap-2 ${k?.iconColor||"text-primary-600"}`,children:[so(ke,{width:y.iconSize*.8,height:y.iconSize*.8}),so("span",{className:`${y.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):Bd("div",{className:"flex flex-col items-center justify-center gap-2",children:[so("div",{className:`transition-colors ${k?.iconColor||"text-primary-500"}`,children:c||so(Jr,{width:y.iconSize,height:y.iconSize})}),so("div",{className:`${y.titleSize} font-medium text-neutral-800 ${k?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:m??"K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file"}),so("div",{id:p,className:`${y.descSize} text-neutral-500`,children:x??"H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF"})]})})}import{useState as Vd}from"react";import sh from"next/image";var El={pulse:"animate-pulse",wave:"skeleton-wave",none:""},lo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};import{jsx as $l}from"react/jsx-runtime";function ei({variant:e="pulse",shape:r="rectangle",radius:t="md",width:o,height:n="1rem",lines:a=1,gap:s="0.5rem",className:i="",style:l,...b}){let m=El[e]??"",x=r==="circle"?"rounded-full":lo[t]??lo.md,c=p=>p,f={width:c(o),height:c(n),...l},h=["bg-neutral-200",m,x].filter(Boolean).join(" ");return a>1?$l("div",{role:"status","aria-label":"Loading...",className:["flex flex-col",i].filter(Boolean).join(" "),style:{gap:c(s),...l},...b,children:Array.from({length:a}).map((p,y)=>{let S=y===a-1;return $l("div",{className:h,style:{width:S?"60%":c(o)??"100%",height:c(n)}},y)})}):$l("div",{role:"status","aria-label":"Loading...",className:[h,i].filter(Boolean).join(" "),style:f,...b})}import{jsx as va,jsxs as lh}from"react/jsx-runtime";function co({src:e,alt:r="",width:t,height:o,fill:n,skeletonVariant:a="pulse",radius:s="md",className:i="",wrapperClassName:l="",style:b,wrapperStyle:m,onLoad:x,onError:c,...f}){let[h,p]=Vd(!1),[y,S]=Vd(!1),T=lo[s]??lo.md,k=u=>{p(!0),x?.(u)},g=u=>{S(!0),p(!1),c?.(u)},d={...n?{}:{width:t,height:o},...m};return lh("div",{"data-testid":"loading-image-wrapper",className:["relative overflow-hidden inline-block",T,l].filter(Boolean).join(" "),style:d,children:[!h&&!y&&va(ei,{"data-testid":"loading-image-skeleton",variant:a,radius:s,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),e&&va(sh,{"data-testid":"loading-image-img",src:e,alt:r,width:n?void 0:t,height:n?void 0:o,fill:n,className:["block w-full h-full object-cover transition-opacity duration-200",T,h?"opacity-100":"opacity-0",i].filter(Boolean).join(" "),style:b,onLoad:k,onError:g,...f}),y&&va("div",{"data-testid":"loading-image-error",role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:va(Ri,{width:24,height:24,"aria-hidden":"true"})})]})}import{jsx as jr,jsxs as ri}from"react/jsx-runtime";function uo({items:e,size:r,radius:t,disabled:o,readOnly:n,maxCount:a,onRemove:s,onPreview:i,onTriggerUpload:l,renderItem:b,showAddButton:m=!0,className:x=""}){let c=Qt[r],f=Jo[t],h=!a||e.length<a;return ri("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${c.gap} ${x}`,children:[e.map((p,y)=>{if(b)return jr("li",{className:"list-none",children:b(p,y,{remove:()=>s(p,y),preview:()=>i(p)})},p.id);let S=p.status==="uploading",T=p.status==="error";return ri("li",{tabIndex:o?-1:0,"aria-label":`H\xECnh \u1EA3nh ${p.name}`,onKeyDown:k=>{o||n||(k.key==="Delete"||k.key==="Backspace")&&(k.preventDefault(),s(p,y))},className:`group relative list-none ${c.thumbnailSize} ${f} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 ${T?"border-error-500":"border-neutral-200"} transition-all duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[p.url?jr(co,{src:p.url,alt:p.name,width:80,height:80,radius:t,unoptimized:!0,className:"w-full h-full object-cover",wrapperClassName:"w-full h-full"}):jr("div",{className:"text-xs text-neutral-400 p-1 text-center truncate",children:p.name}),S&&ri("div",{className:"absolute inset-0 bg-neutral-900/50 flex flex-col items-center justify-center text-neutral-white",children:[jr(ke,{width:18,height:18}),typeof p.progress=="number"&&ri("span",{className:"text-xs mt-1 font-medium",children:[Math.round(p.progress),"%"]})]}),!S&&!o&&ri("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[i&&p.url&&jr("button",{type:"button",onClick:k=>{k.stopPropagation(),i(p)},"aria-label":`Xem tr\u01B0\u1EDBc h\xECnh \u1EA3nh ${p.name}`,className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:jr(nn,{width:16,height:16})}),!n&&jr("button",{type:"button",onClick:k=>{k.stopPropagation(),s(p,y)},"aria-label":`X\xF3a h\xECnh \u1EA3nh ${p.name}`,className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:jr(Mo,{width:16,height:16})})]})]},p.id)}),m&&h&&!n&&jr("li",{className:"list-none",children:jr("button",{type:"button",disabled:o,onClick:l,"aria-label":"Th\xEAm h\xECnh \u1EA3nh",className:`${c.thumbnailSize} ${f} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-all duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:jr(bo,{width:c.iconSize*.5,height:c.iconSize*.5})})})]})}import{Fragment as fh,jsx as Dr,jsxs as ya}from"react/jsx-runtime";function dh(e){e.preventDefault(),e.stopPropagation()}function Ll({value:e,defaultValue:r,onChange:t,onRemove:o,onPreview:n,multiple:a=!1,maxCount:s,maxSize:i,accept:l="image/*",beforeUpload:b,viewMode:m="dropzone",shape:x="rectangle",size:c="md",color:f="primary",variant:h="outline",radius:p,label:y,helperText:S,errorMessage:T,isInvalid:k,disabled:g=!1,readOnly:d=!1,isLoading:u=!1,dropzoneTitle:v,dropzoneDescription:C,icon:R,buttonText:N="T\u1EA3i \u1EA3nh l\xEAn",renderItem:D,className:V="",dropzoneClassName:Y="",previewClassName:L="",ariaLabel:z}){let A=uh(),O=`${A}-input`,G=`${A}-helper`,U=`${A}-error`,M=Hd(null),[P,$]=ti(()=>aa(e!==void 0?e:r));ch(()=>{e!==void 0&&$(aa(e))},[e]);let[K,X]=ti(!1),B=Hd(0),[oe,q]=ti(null),[ee,ne]=ti(null),[le,_]=ti(""),W=Qt[c],se=!!(k||T||oe),Z=T||oe,F=s??(a?void 0:1),j=I=>{e===void 0&&$(I),t?.(I)},re=()=>{g||d||M.current&&(M.current.value="",M.current.click())},Se=async I=>{if(g||d)return;q(null);let fe=Array.from(I);if(fe.length===0)return;let Q=P.length,xe=fe;if(F!==void 0)if(a){let ce=F-Q;if(ce<=0){let pe=`Maximum allowed image count reached (${F} images)`;q(pe),_(pe);return}xe=fe.slice(0,ce)}else{let ce=fe[0];if(!ce)return;xe=[ce]}let ge=async ce=>{let pe=sa(ce,{maxSize:i,accept:l});if(!pe.isValid){let De=pe.error||"Invalid file";return q(De),_(`File upload error: ${De}`),null}if(b)try{let De=await b(ce);if(De===!1||typeof De=="string"){let ue=typeof De=="string"?De:`File ${ce.name} was rejected`;return q(ue),_(`L\u1ED7i: ${ue}`),null}}catch(De){let ue=De?.message||`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${ce.name}`;return q(ue),_(`L\u1ED7i: ${ue}`),null}return la(ce)},be=[];for(let ce of xe){let pe=await ge(ce);pe&&be.push(pe)}if(be.length>0){let ce=a?[...P,...be]:be;j(ce),_(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${be.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${ce.length}.`)}},ie=I=>{I.target.files&&Se(I.target.files)},de=I=>{I.preventDefault(),I.stopPropagation(),!(g||d)&&(B.current+=1,I.dataTransfer.items&&I.dataTransfer.items.length>0&&X(!0))},Te=I=>{I.preventDefault(),I.stopPropagation(),!(g||d)&&(B.current-=1,B.current<=0&&(X(!1),B.current=0))},ye=I=>{I.preventDefault(),I.stopPropagation(),X(!1),B.current=0,!(g||d)&&I.dataTransfer.files&&I.dataTransfer.files.length>0&&(Se(I.dataTransfer.files),I.dataTransfer.clearData())},J=(I,fe)=>{if(g||d)return;let Q=P.filter((xe,ge)=>ge!==fe);j(Q),o?.(I,fe),_(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${I.name}`)},E=I=>{(I.url||I.file)&&ne(I),n?.(I)};return ya("div",{className:`relative flex flex-col w-full ${V}`,onDragEnter:de,onDragLeave:Te,onDragOver:dh,onDrop:ye,children:[Dr("input",{ref:M,id:O,type:"file",multiple:a,accept:l,disabled:g,"aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:ie}),Dr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:le}),y&&Dr("label",{htmlFor:O,className:`block font-medium text-neutral-800 ${W.labelSize}`,children:y}),ya("div",{className:"flex flex-col gap-3",children:[m==="dropzone"&&ya(fh,{children:[Dr(Qn,{size:c,color:f,variant:h,radius:p,shape:x,disabled:g,readOnly:d,isLoading:u,isDragging:K,isInvalid:se,dropzoneTitle:v,dropzoneDescription:C,icon:R,onTriggerUpload:re,className:Y,describedById:S?G:void 0}),P.length>0&&Dr(uo,{items:P,size:c,color:f,variant:h,radius:p??"md",disabled:g,readOnly:d,maxCount:F,onRemove:J,onPreview:E,onTriggerUpload:re,renderItem:D,showAddButton:!1,className:L})]}),m==="card-grid"&&Dr(uo,{items:P,size:c,color:f,variant:h,radius:p??"md",disabled:g,readOnly:d,maxCount:F,onRemove:J,onPreview:E,onTriggerUpload:re,renderItem:D,showAddButton:!0,className:L}),m==="button"&&ya("div",{className:"flex flex-col gap-3",children:[Dr("div",{className:"flex items-center gap-3",children:Dr(Kr,{type:"button",size:c,color:se?"error":f==="neutral"?"secondary":f,variant:h==="other"?"filled":h,radius:p,disabled:g||d||F!==void 0&&P.length>=F,onClick:re,leftIcon:Dr(Jr,{width:W.iconSize*.5,height:W.iconSize*.5}),"aria-label":z||"T\u1EA3i \u1EA3nh l\xEAn",children:N})}),P.length>0&&Dr(uo,{items:P,size:c,color:f,variant:h,radius:p??"md",disabled:g,readOnly:d,maxCount:F,onRemove:J,onPreview:E,onTriggerUpload:re,renderItem:D,showAddButton:!1,className:L})]})]}),se&&Z?Dr("p",{id:U,role:"alert",className:`font-medium text-error-600 ${W.helperSize}`,children:Z}):S?Dr("p",{id:G,className:`text-neutral-500 ${W.helperSize}`,children:S}):null,ee&&Dr(ao,{open:!!ee,onClose:()=>ne(null),file:ee.file??(ee.url?{url:ee.url,name:ee.name}:void 0)})]})}import{useEffect as vh,useId as yh,useMemo as wh,useRef as Od,useState as rn}from"react";var Fl={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},wa={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},Ca={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-error-500 hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function ka(e){return e?typeof e=="string"?{url:e,name:$t(e)||"avatar",type:Qo(e)}:e:null}function Bl(e,r){let{maxSize:t,accept:o}=r||{};if(t&&e.size>t)return{isValid:!1,error:`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p ${(t/1048576).toFixed(1)}MB.`};if(o&&o!=="*"){let n=o.split(",").map(l=>l.trim().toLowerCase()),a=e.type.toLowerCase(),s=`.${e.name.split(".").pop()?.toLowerCase()}`;if(!n.some(l=>{if(l.startsWith("."))return s===l;if(l.endsWith("/*")){let b=l.replace("/*","");return a.startsWith(`${b}/`)}return a===l}))return{isValid:!1,error:`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. Cho ph\xE9p: ${o}`}}return{isValid:!0}}import{useRef as hh,useState as dt}from"react";import xh from"react-easy-crop";function Ad(e){return new Promise((r,t)=>{let o=new Image;o.addEventListener("load",()=>r(o)),o.addEventListener("error",n=>t(n)),o.setAttribute("crossOrigin","anonymous"),o.src=e})}function Gd(e){return e*Math.PI/180}function Yd(e,r,t){let o=Gd(t);return{width:Math.abs(Math.cos(o)*e)+Math.abs(Math.sin(o)*r),height:Math.abs(Math.sin(o)*e)+Math.abs(Math.cos(o)*r)}}async function Vl(e,r,t=0,o=!1,n="avatar-cropped.png",a="image/png"){let s=await Ad(e),i=document.createElement("canvas"),l=i.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let b=Gd(t),{width:m,height:x}=Yd(s.width,s.height,t);i.width=m,i.height=x,l.translate(m/2,x/2),l.rotate(b),l.scale(o?-1:1,1),l.translate(-s.width/2,-s.height/2),l.drawImage(s,0,0);let c=document.createElement("canvas"),f=c.getContext("2d");if(!f)throw new Error("No 2d context for cropped canvas");return c.width=r.width,c.height=r.height,f.drawImage(i,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((h,p)=>{c.toBlob(y=>{if(!y){p(new Error("Canvas is empty or failed to generate blob"));return}let S=new File([y],n,{type:a||"image/png"});h(S)},a||"image/png",.95)})}import{jsx as ph}from"react/jsx-runtime";function Hl({size:e,className:r="",children:t,...o}){let n=Hr(),a=w(e??n?.size,Lt,"md");return ph("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${a.footer} ${a.buttonGap} ${r}`,...o,children:t})}import{cloneElement as gh,isValidElement as mh}from"react";import{jsx as bh}from"react/jsx-runtime";function Al({children:e,asChild:r=!0,onClick:t,...o}){let n=Hr(),a=n?.isLoading,s=i=>{t?.(i),i.defaultPrevented||n?.onClose?.()};if(r&&mh(e)){let i=e;return gh(i,{disabled:i.props.disabled||a,onClick:l=>{i.props.onClick?.(l),s(l)},...o})}return bh("button",{type:"button",onClick:s,disabled:a,...o,children:e})}import{jsx as He,jsxs as Gl}from"react/jsx-runtime";function Yl({imageSrc:e,fileName:r="avatar-cropped.png",fileType:t="image/png",aspectRatio:o=1,cropShape:n="round",showGrid:a=!0,minZoom:s=1,maxZoom:i=4,onApply:l,onCancel:b}){let m=hh(null),[x,c]=dt(e),[f,h]=dt(r),[p,y]=dt(t),[S,T]=dt({x:0,y:0}),[k,g]=dt(1),[d,u]=dt(0),[v,C]=dt(!1),[R,N]=dt(null),[D,V]=dt(!1),Y=()=>g(B=>Math.min(i,Math.round((B+.2)*10)/10)),L=()=>g(B=>Math.max(s,Math.round((B-.2)*10)/10)),z=()=>u(B=>(B+90)%360),A=()=>u(B=>(B-90+360)%360),O=()=>C(B=>!B),G=()=>{T({x:0,y:0}),g(1),u(0),C(!1)},U=()=>{m.current&&(m.current.value="",m.current.click())},M=B=>{if(B.target.files&&B.target.files[0]){let oe=B.target.files[0],q=URL.createObjectURL(oe);c(q),h(oe.name),y(oe.type||"image/png"),G()}},P=(B,oe)=>{N(oe)},$=async()=>{if(R)try{V(!0);let B=await Vl(x,R,d,v,f,p);l(B)}catch(B){console.error("Error cropping avatar:",B)}finally{V(!1)}},K=()=>{b?.()},X="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-all focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return Gl("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[He("input",{ref:m,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:M}),He("div",{className:"relative w-full h-80 md:h-90 bg-neutral-950 overflow-hidden select-none",children:He(xh,{image:x,crop:S,zoom:k,rotation:d,aspect:o,cropShape:n,showGrid:a,minZoom:s,maxZoom:i,onCropChange:T,onZoomChange:g,onRotationChange:u,onCropComplete:P,classes:{mediaClassName:v?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),He("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:Gl("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[He("button",{type:"button",onClick:U,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${X} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:He(Jr,{width:16,height:16})}),He("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),He("button",{type:"button",onClick:L,disabled:k<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:X,children:He(No,{width:16,height:16})}),He("button",{type:"button",onClick:Y,disabled:k>=i,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:X,children:He(Ro,{width:16,height:16})}),He("button",{type:"button",onClick:A,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:X,children:He(Po,{width:16,height:16})}),He("button",{type:"button",onClick:z,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:X,children:He(Do,{width:16,height:16})}),He("button",{type:"button",onClick:O,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:X,children:He(Io,{width:16,height:16})}),He("button",{type:"button",onClick:G,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:X,children:He(Ti,{width:16,height:16})}),He("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),He("button",{type:"button",onClick:K,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${X} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:He(Le,{width:16,height:16})}),He("button",{type:"button",onClick:$,disabled:D,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-all active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:D?He(ke,{width:16,height:16}):He(mt,{width:16,height:16})})]})})]})}function Sa({open:e=!0,modalTitle:r="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:t,onCancel:o,onApply:n,...a}){let s=()=>{o?.(),t?.()};return He(oo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:s,children:Gl(to,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[He(no,{title:He("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:r}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),He(io,{className:"p-0 overflow-hidden",children:He(Yl,{...a,onApply:l=>{n(l),t?.()},onCancel:s})})]})})}import{jsx as lr,jsxs as oi}from"react/jsx-runtime";function Ol({size:e="md",variant:r="outline",color:t="primary",shape:o="circle",radius:n,value:a,defaultValue:s,onChange:i,onRemove:l,onPreview:b,onClear:m,maxSize:x,accept:c="image/*",crop:f=!0,label:h,labelPlacement:p="top",isRequired:y=!1,helperText:S,errorMessage:T,isInvalid:k=!1,isLoading:g=!1,disabled:d=!1,readOnly:u=!1,isClearable:v=!1,icon:C,name:R,id:N,isFullWidth:D=!1,className:V="",wrapperClassName:Y="",avatarClassName:L="",avatarWrapperClassName:z="",labelClassName:A="",helperClassName:O="",ariaLabel:G,ref:U}){let M=yh(),P=N||M,$=`${P}-helper`,K=Od(null),X=a!==void 0,[B,oe]=rn(()=>ka(s??null)),q=X?ka(a):B,[ee,ne]=rn(null),[le,_]=rn(!1),W=wh(()=>q?q instanceof File?URL.createObjectURL(q):typeof q.url=="string"?q.url:"":"",[q]);vh(()=>()=>{W&&W.startsWith("blob:")&&URL.revokeObjectURL(W)},[W]);let se=q instanceof File?q.name:q?.name||(typeof q?.url=="string"?$t(q.url):"")||"",[Z,F]=rn(null),[j,re]=rn(!1),Se=Od(0),[ie,de]=rn(""),Te=T||Z,ye=!!(k||Te),J=ye?"error":t,E=wa[e]||wa.md,I=o==="circle"?"rounded-full":n?Fl[n]:"rounded-md",fe=r==="other"?"":Ca[r]?.[J]||Ca.outline.primary,Q=g,xe=te=>{X||oe(te),i?.(te)},ge=()=>{if(d||u||Q)return;let te=typeof U=="object"&&U&&"current"in U&&U.current?U.current:K.current;te&&(te.value="",te.click())},be=f!==!1,ce=typeof f=="object"?f:{},pe=(te,Ae)=>{ne({imageSrc:te,fileName:Ae?.name||se||"avatar.png",fileType:Ae?.type||"image/png"})},De=te=>{if(d||u||Q)return;F(null);let Ae=Bl(te,{maxSize:x,accept:c});if(!Ae.isValid){let We=Ae.error||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";F(We),de(`L\u1ED7i t\u1EC7p: ${We}`);return}if(be){let We=URL.createObjectURL(te);pe(We,te)}else xe(te),de("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")},ue=te=>{te.target.files&&te.target.files[0]&&De(te.target.files[0])},Pe=te=>{te.preventDefault(),te.stopPropagation(),!(d||u||Q)&&(Se.current+=1,te.dataTransfer.items&&te.dataTransfer.items.length>0&&re(!0))},he=te=>{te.preventDefault(),te.stopPropagation(),!(d||u||Q)&&(Se.current-=1,Se.current<=0&&(re(!1),Se.current=0))},Be=te=>{te.preventDefault(),te.stopPropagation(),re(!1),Se.current=0,!(d||u||Q)&&te.dataTransfer.files&&te.dataTransfer.files[0]&&(De(te.dataTransfer.files[0]),te.dataTransfer.clearData())},Me=te=>{if(te?.stopPropagation(),!(d||u||Q)&&q){let Ae=q;xe(null),l?.(Ae),m?.(),de("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},ze=te=>{te?.stopPropagation(),q&&(_(!0),b?.(q))},Ie=te=>{te?.stopPropagation(),W&&pe(W,q instanceof File?q:void 0)},Fe=te=>{d||u||Q||((te.key==="Enter"||te.key===" ")&&(te.preventDefault(),ge()),q&&(te.key==="Delete"||te.key==="Backspace")&&(te.preventDefault(),Me()))},Ge=()=>h?oi("label",{htmlFor:P,className:`inline-flex items-center font-bold transition-colors duration-150 ${E.label} ${ye?"text-error-600":"text-neutral-700 group-focus-within/field:text-primary-600"} ${A}`,children:[h,y&&lr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Xe="group/avatar relative flex items-center justify-center transition-all duration-150 ease-in-out border-2 overflow-hidden select-none",je=d?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer",Je=[Xe,E.avatarSize,I,fe,je,j?"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80":"",L||z].filter(Boolean).join(" ");return oi("div",{className:`group/field flex ${p==="left"?"flex-row items-center gap-3":"flex-col"} ${D?"w-full":"inline-flex"} ${Y||V}`,children:[lr("input",{ref:U||K,id:P,name:R,type:"file",accept:c,disabled:d||Q,"aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:ue}),lr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),Ge(),oi("div",{className:`flex flex-col ${D?"w-full":""}`,children:[oi("div",{role:"button",tabIndex:d||Q?-1:0,"aria-label":G||"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":d||Q,"aria-invalid":ye,"aria-required":y,"aria-describedby":T||S||Z?$:void 0,"aria-busy":g,onClick:ge,onDragEnter:Pe,onDragLeave:he,onDragOver:te=>{te.preventDefault(),te.stopPropagation()},onDrop:Be,onKeyDown:Fe,className:Je,children:[W?lr(co,{src:W,alt:se||"Avatar",width:160,height:160,radius:o==="circle"?"full":n,unoptimized:!0,className:"w-full h-full object-cover",wrapperClassName:"w-full h-full"}):lr("div",{className:`flex flex-col items-center justify-center text-primary-400 group-hover/avatar:text-primary-600 transition-colors ${E.iconClass}`,children:C||lr(Jr,{width:E.iconSize,height:E.iconSize})}),Q&&lr("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:lr(ke,{width:E.iconSize,height:E.iconSize,className:"animate-spin"})}),!Q&&!d&&W&&oi("div",{className:"absolute inset-0 bg-neutral-950/60 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[lr("button",{type:"button",onClick:ze,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:lr(nn,{width:14,height:14})}),be&&!u&&lr("button",{type:"button",onClick:Ie,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:lr(Ni,{width:14,height:14})}),(!u||v)&&lr("button",{type:"button",onClick:Me,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:lr(Mo,{width:14,height:14})})]})]}),lr(Ee,{id:$,helperText:S,errorMessage:Te,sizeClassName:E.helper,className:O}),be&&ee&&lr(Sa,{open:!!ee,imageSrc:ee.imageSrc,fileName:ee.fileName,fileType:ee.fileType,aspectRatio:ce.aspectRatio??1,cropShape:ce.cropShape??(o==="circle"?"round":"rect"),showGrid:ce.showGrid??!0,minZoom:ce.minZoom??1,maxZoom:ce.maxZoom??4,modalTitle:ce.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>ne(null),onApply:te=>{xe(te),de("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),ne(null)}}),le&&q&&lr(ao,{open:le,onClose:()=>_(!1),file:q})]})]})}var Ud=300,Ft={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},jd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Wd={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},Kd={warning:So,error:To,success:ko,info:zr,primary:zr,secondary:zr,neutral:zr};import{createContext as Ch,useContext as kh}from"react";var Ul=Ch(null),Ar=()=>kh(Ul);import{jsx as Sh}from"react/jsx-runtime";function jl({size:e,radius:r,className:t="",children:o,ref:n,...a}){let s=Ar(),i=w(e??s?.size,Ft,"md"),l=w(r,jd,"lg"),b=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",i.dialog,l,t].filter(Boolean).join(" ");return Sh("div",{ref:n,tabIndex:-1,className:b,...a,children:o})}import{useEffect as Ta,useEffectEvent as Th,useCallback as Rh,useMemo as Nh,useRef as Xd,useState as Dh}from"react";import{jsx as Wl,jsxs as Ph}from"react/jsx-runtime";function Kl({open:e=!1,size:r="md",color:t="warning",isLoading:o=!1,closeOnOverlayClick:n=!0,closeOnEsc:a=!0,lockScroll:s=!0,overlayClassName:i="",className:l="",children:b,onClose:m,...x}){let c=Xd(null),[f,h]=Dh(!1),p=Xd(null),y=Rh(()=>{f||o||(h(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h(!1),m?.()},Ud))},[f,o,m]),S=Nh(()=>({onClose:y,isLoading:o,size:r,color:t}),[y,o,r,t]);Ta(()=>()=>{p.current&&clearTimeout(p.current)},[]),Ta(()=>{let u=c.current;if(u)if(e||f){if(!u.open)try{u.showModal()}catch{}}else u.open&&u.close()},[e,f]),Ta(()=>{if(!s)return;let u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);let T=Th(u=>{!e||a===!1||u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),y())});if(Ta(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!f)return null;let k=()=>{n&&y()},g=f?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",d=f?"animate-confirm-out pointer-events-none":"animate-confirm-in";return Wl(Ul.Provider,{value:S,children:Ph("dialog",{ref:c,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:u=>{u.preventDefault(),a!==!1&&y()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${g} ${i}`,...x,children:[Wl("div",{"aria-hidden":"true",onClick:k,className:"fixed inset-0 -z-10"}),Wl("div",{className:`w-full flex items-center justify-center pointer-events-none ${d} ${l}`,children:b})]})})}import{jsx as tn,jsxs as _d}from"react/jsx-runtime";function Xl({size:e,color:r,icon:t=!0,title:o,iconClassName:n="",titleClassName:a="",showCloseButton:s=!1,onClose:i,closeButtonClassName:l="",className:b="",children:m,...x}){let c=Ar(),f=w(e??c?.size,Ft,"md"),h=w(r??c?.color,Wd,"warning"),p=c?.isLoading,y=()=>{i?.(),c?.onClose?.()},S=!!(i||c?.onClose),T=()=>{if(t===!1)return null;if(t!==void 0&&t!==!0)return tn("div",{className:`inline-flex items-center justify-center shrink-0 ${f.iconWrapper} ${h} ${n}`,"aria-hidden":"true",children:t});let k=w(r??c?.color,Kd,"warning");return tn("div",{className:`inline-flex items-center justify-center shrink-0 ${f.iconWrapper} ${h} ${n}`,"aria-hidden":"true",children:tn(k,{className:f.icon})})};return _d("div",{className:`flex items-start justify-between w-full ${f.header} ${b}`,...x,children:[_d("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),o&&tn("h3",{className:`${f.title} truncate ${a}`,id:"confirm-dialog-title",children:o}),m]}),s&&S&&tn("button",{type:"button",onClick:y,disabled:p,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${f.closeButton} ${l}`,children:tn(Le,{className:f.closeIcon})})]})}import{jsx as zh,jsxs as Ih}from"react/jsx-runtime";function _l({size:e,description:r,descriptionClassName:t="",className:o="",children:n,...a}){let s=Ar(),i=w(e??s?.size,Ft,"md");return Ih("div",{className:`w-full ${i.body} ${o}`,id:"confirm-dialog-description",...a,children:[r?zh("p",{className:`${i.description} ${t}`,children:r}):null,n]})}import{jsx as Zl,jsxs as Mh}from"react/jsx-runtime";function ql({size:e,confirmText:r="X\xE1c nh\u1EADn",cancelText:t="H\u1EE7y",confirmVariant:o="filled",cancelVariant:n="outline",confirmColor:a,cancelColor:s="secondary",onConfirm:i,onCancel:l,onClose:b,confirmButtonProps:m,cancelButtonProps:x,className:c="",children:f,...h}){let p=Ar(),y=w(e??p?.size,Ft,"md"),S=a??p?.color??"warning",T=()=>{b?.(),p?.onClose?.()},k=async()=>{try{let d=i?.();d&&"then"in d&&await d,T()}catch{}},g=()=>{l?.(),T()};return f?Zl("div",{className:`flex items-center justify-end w-full ${y.footer} ${y.buttonGap} ${c}`,...h,children:f}):Mh("div",{className:`flex items-center justify-end w-full ${y.footer} ${y.buttonGap} ${c}`,...h,children:[t!==!1&&Zl(Kr,{size:y.buttonSize,variant:n,color:s,onClick:g,disabled:x?.disabled||p?.isLoading,...x,children:t}),Zl(Kr,{size:y.buttonSize,variant:o,color:S,isLoading:p?.isLoading||m?.isLoading,disabled:m?.disabled,onClick:k,...m,children:r})]})}import{cloneElement as Eh,isValidElement as $h}from"react";import{jsx as Lh}from"react/jsx-runtime";function Jl({children:e,asChild:r=!0,onClick:t,...o}){let n=Ar(),a=n?.isLoading,s=i=>{t?.(i),i.defaultPrevented||n?.onClose?.()};if(r&&$h(e)){let i=e;return Eh(i,{disabled:i.props.disabled||a,onClick:l=>{i.props.onClick?.(l),s(l)},...o})}return Lh("button",{type:"button",onClick:s,disabled:a,...o,children:e})}export{fa as AUDIO_EXTENSIONS,Eo as Alert,To as AlertCircleIcon,So as AlertTriangleIcon,tt as Badge,Kr as Button,lt as Calendar,Rn as CalendarHeader,Dc as CalendarIcon,Cu as Carousel,Su as CarouselContent,Nu as CarouselNext,Du as CarouselPagination,Ru as CarouselPrevious,Tu as CarouselSlide,ko as CheckCircleIcon,mt as CheckIcon,ln as Checkbox,cn as CheckboxGroup,sn as CheckboxGroupContext,tr as ChevronDownIcon,Zr as ChevronLeftIcon,qr as ChevronRightIcon,zc as ClockIcon,Le as CloseIcon,gs as Collapse,bn as CollapseContent,mn as CollapseHeader,bs as CollapsePanel,hs as Collapsible,jl as Confirm,_l as ConfirmBody,Jl as ConfirmClose,Kl as ConfirmContainer,ql as ConfirmFooter,Xl as ConfirmHeader,Ni as CropIcon,Qr as DEFAULT_TOAST_DURATION,pa as DOCUMENT_EXTENSIONS,In as DatePicker,Fn as DateRangeCalendar,Yo as DateRangeDayGrid,Mn as DateRangeHeader,Oo as DateRangeMonthGrid,Bn as DateRangePicker,Uo as DateRangeYearGrid,ul as DateTimePicker,hl as DateTimeRangePicker,Dn as DayGrid,yo as DoubleChevronLeftIcon,wo as DoubleChevronRightIcon,Yt as DownloadIcon,Ps as Dropdown,Gu as DropdownGroup,Hu as DropdownHeader,Vu as DropdownItem,Es as DropdownMenu,Au as DropdownSeparator,$u as DropdownTrigger,Wn as Empty,Ka as EmptyDefaultIcon,_a as EmptyErrorIcon,Za as EmptyFolderIcon,_o as EmptyIllustration,Xa as EmptySearchIcon,qa as EmptySimpleIcon,nn as EyeIcon,ao as FileContainer,qn as FilePreview,Io as FlipHorizontalIcon,ca as IMAGE_EXTENSIONS,Da as IconButton,Ri as ImageIcon,Zn as ImagePreview,_n as ImagePreviewToolbar,zr as InfoCircleIcon,Xr as Input,co as LoadingImage,mi as MinusIcon,to as Modal,io as ModalBody,Al as ModalClose,oo as ModalContainer,Hl as ModalFooter,no as ModalHeader,Pn as MonthGrid,Ba as MultiInput,$a as NumberInput,La as OtpInput,ua as PDF_EXTENSIONS,Ma as PasswordInput,bo as PlusIcon,Fs as Popover,_u as PopoverBody,Ju as PopoverClose,Ku as PopoverContent,Zu as PopoverFooter,Xu as PopoverHeader,ju as PopoverTrigger,Ya as Radio,xi as RadioDotIcon,Oa as RadioGroup,un as RadioGroupContext,Ti as ResetIcon,Po as RotateCcwIcon,Do as RotateCwIcon,yf as SearchIcon,Pd as Select,Tl as SelectComponent,oa as SelectMenu,ta as SelectMenuFilter,ra as SelectOption,ea as SelectTrigger,ei as Skeleton,ds as Slider,Ei as SliderMarks,$i as SliderStepDots,fn as SliderThumb,ke as Spinner,Xt as Tab,Kt as TabList,Ss as TabPanel,ks as TabPanels,Wt as Tabs,hn as TabsContext,Va as TextArea,Pt as TimeColumn,el as TimePicker,al as TimeRangePicker,$r as TimeView,ns as Toaster,Wa as Toggle,dn as Tooltip,Mo as TrashIcon,Ol as UploadAvatar,Yl as UploadAvatarCropContent,Sa as UploadAvatarCropModal,Jr as UploadIcon,Ll as UploadImage,Qn as UploadImageDropzone,uo as UploadImageList,da as VIDEO_EXTENSIONS,zn as YearGrid,Ro as ZoomInIcon,No as ZoomOutIcon,Zt as checkIsDisabled,us as clamp,Lr as combineDateTime,_t as createDateWithTime,la as createFileItem,en as downloadFile,Dl as formatBytes,Sr as formatDate,Rr as formatDateTime,gt as formatNumberString,yr as formatTime,Yi as generateCalendarGrid,$n as generateRangeCalendarGrid,zt as getDefaultDateTimeFormat,Dt as getDefaultFormat,Pl as getFileExtension,$t as getFileName,Qo as getFileType,Tn as getISOWeekNumber,pn as getPercentage,Sn as isDateAfter,kn as isDateBefore,St as isSameDay,Gi as isSameMonth,fd as isSameTime,gd as isTimeAfter,pd as isTimeBefore,yd as isTimeInRange,di as isValidOtpChar,eo as normalizePreviewFile,Ur as padZero,Gs as parseDate,Gn as parseDateTime,ui as parseNumber,fc as parseRawNumberString,Tr as parseTimeToDate,Qe as resolveLocale,zd as revokeFileItem,fi as sanitizeOtpString,pi as splitTagsFromText,ur as toDate,Fr as toDateTime,dd as toTimeObject,Kc as toast,Vi as useCarousel,Yr as useCarouselContext,gi as useCheckboxGroupContext,vt as useCollapseContext,Fo as useCollapsePanelContext,Ar as useConfirmContext,Ob as useDebounce,Cl as useDebouncedCallback,rt as useDropdownContext,ga as useFileContext,Hr as useModalContext,vr as usePopoverContext,hi as useRadioGroupContext,yt as useTabsContext,sa as validateFile};
2
+ import{a as C,b as un,c as Ne,d as Oe,e as Un,f as ys,g as ws,h as Cs,i as Mc,j as _f,k as Xf,l as qf,m as Zf,n as Fc,o as Ec,p as $c,q as jn,r as Ii,s as Mi,t as Fi,u as Ei,v as $i}from"./chunk-X4LIYOS5.js";var Li={xs:{button:"h-6 px-2.5 text-[11px] gap-1",iconOnly:"size-6 p-0",icon:"size-3"},sm:{button:"h-8 px-3 text-xs gap-1.5",iconOnly:"size-8 p-0",icon:"size-3.5"},md:{button:"h-10 px-4 text-sm gap-2",iconOnly:"size-10 p-0",icon:"size-4"},lg:{button:"h-12 px-5 text-base gap-2.5",iconOnly:"size-12 p-0",icon:"size-5"},xl:{button:"h-14 px-6 text-lg gap-3",iconOnly:"size-14 p-0",icon:"size-6"}},Bi={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hi={filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950 focus-visible:ring-neutral-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700 focus-visible:ring-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700 focus-visible:ring-success-700",warning:"bg-warning-500 text-neutral-white border-transparent hover:bg-warning-600 active:bg-warning-700 focus-visible:ring-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700 focus-visible:ring-info-700"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200 hover:text-primary-900 active:bg-primary-300 focus-visible:ring-primary-700",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200 hover:text-secondary-900 active:bg-secondary-300 focus-visible:ring-secondary-700",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200 hover:text-neutral-900 active:bg-neutral-300 focus-visible:ring-neutral-700",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200 hover:text-error-900 active:bg-error-300 focus-visible:ring-error-700",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200 hover:text-success-900 active:bg-success-300 focus-visible:ring-success-700",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200 hover:text-warning-900 active:bg-warning-300 focus-visible:ring-warning-700",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200 hover:text-info-900 active:bg-info-300 focus-visible:ring-info-700"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-100 hover:text-primary-900 active:bg-primary-200 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-transparent hover:bg-secondary-100 hover:text-secondary-900 active:bg-secondary-200 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-transparent hover:bg-error-100 hover:text-error-900 active:bg-error-200 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-transparent hover:bg-success-100 hover:text-success-900 active:bg-success-200 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-transparent hover:bg-warning-100 hover:text-warning-900 active:bg-warning-200 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-transparent hover:bg-info-100 hover:text-info-900 active:bg-info-200 focus-visible:ring-info-700"},text:{primary:"bg-transparent text-primary-500 border-transparent px-1 hover:text-primary-600 active:text-primary-700 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-500 border-transparent px-1 hover:text-secondary-600 active:text-secondary-700 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-transparent px-1 hover:text-neutral-800 active:text-neutral-900 focus-visible:ring-neutral-700",error:"bg-transparent text-error-500 border-transparent px-1 hover:text-error-600 active:text-error-700 focus-visible:ring-error-700",success:"bg-transparent text-success-500 border-transparent px-1 hover:text-success-600 active:text-success-700 focus-visible:ring-success-700",warning:"bg-transparent text-warning-500 border-transparent px-1 hover:text-warning-600 active:text-warning-700 focus-visible:ring-warning-700",info:"bg-transparent text-info-500 border-transparent px-1 hover:text-info-600 active:text-info-700 focus-visible:ring-info-700"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50 hover:border-primary-500 hover:text-primary-900 active:bg-primary-100 focus-visible:ring-primary-700",secondary:"bg-transparent text-secondary-700 border-2 border-secondary-400 hover:bg-secondary-50 hover:border-secondary-500 hover:text-secondary-900 active:bg-secondary-100 focus-visible:ring-secondary-700",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-50 hover:border-neutral-400 hover:text-neutral-900 active:bg-neutral-100 focus-visible:ring-neutral-700",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50 hover:border-error-500 hover:text-error-900 active:bg-error-100 focus-visible:ring-error-700",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50 hover:border-success-500 hover:text-success-900 active:bg-success-100 focus-visible:ring-success-700",warning:"bg-transparent text-warning-700 border-2 border-warning-400 hover:bg-warning-50 hover:border-warning-500 hover:text-warning-900 active:bg-warning-100 focus-visible:ring-warning-700",info:"bg-transparent text-info-700 border-2 border-info-400 hover:bg-info-50 hover:border-info-500 hover:text-info-900 active:bg-info-100 focus-visible:ring-info-700"}};import{jsx as ks,jsxs as Jf}from"react/jsx-runtime";function Ut({size:e,variant:t,color:r,radius:n,leftIcon:o,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:h=!1,disabled:d=!1,type:w="button",className:p="",children:m,ref:x,...y}){let b=C(e,Li,"md"),k=t==="other"?"":C(r,C(t,Hi,"filled"),"primary"),T=C(n,Bi,"lg"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 active:scale-[0.98] transition-transform",b.button,T,k,h?"w-full":"",d?"opacity-50":"",p].filter(Boolean).join(" "),u=g=>ks("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${b.icon}`,"aria-hidden":"true",children:g}),c=a&&l?l:m;return Jf("button",{ref:x,type:w,disabled:d||a,"aria-busy":a,"aria-disabled":d||a,className:v,...y,children:[a&&s&&u(ks(Ne,{})),(!a||!s)&&o&&u(o),c&&ks("span",{className:"leading-none",children:c}),!a&&i&&u(i)]})}import{jsx as Ss}from"react/jsx-runtime";function fr({icon:e,size:t,variant:r,color:n,radius:o,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:h="",ref:d,...w}){let p=C(t,Li,"md"),m=r==="other"?"":C(n,C(r,Hi,"filled"),"primary"),x=C(o,Bi,"full"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",p.iconOnly,x,m,s?"opacity-50":"",h].filter(Boolean).join(" "),b=k=>Ss("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:k});return Ss("button",{ref:d,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:y,...w,children:b(i&&a?Ss(Ne,{}):e)})}var Lc={xs:{badge:"h-5 px-2 text-[11px] gap-1",icon:"size-3",dot:"size-1.5",deleteIcon:"size-3"},sm:{badge:"h-6 px-2.5 text-xs gap-1.5",icon:"size-3.5",dot:"size-1.5",deleteIcon:"size-3.5"},md:{badge:"h-7 px-3 text-xs font-medium gap-1.5",icon:"size-3.5",dot:"w-2 h-2",deleteIcon:"size-3.5"},lg:{badge:"h-8 px-3.5 text-sm font-medium gap-2",icon:"size-4",dot:"size-2.5",deleteIcon:"size-4"},xl:{badge:"h-9 px-4 text-sm font-semibold gap-2",icon:"size-4.5",dot:"size-2.5",deleteIcon:"size-4.5"}},Bc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hc={primary:"bg-primary-500",secondary:"bg-secondary-500",error:"bg-error-500",success:"bg-success-500",warning:"bg-warning-500",info:"bg-info-500",neutral:"bg-neutral-500"},Vc={soft:{primary:"bg-primary-100 text-primary-800 border-primary-200 hover:bg-primary-200",secondary:"bg-secondary-100 text-secondary-800 border-secondary-200 hover:bg-secondary-200",error:"bg-error-100 text-error-800 border-error-200 hover:bg-error-200",success:"bg-success-100 text-success-800 border-success-200 hover:bg-success-200",warning:"bg-warning-100 text-warning-800 border-warning-200 hover:bg-warning-200",info:"bg-info-100 text-info-800 border-info-200 hover:bg-info-200",neutral:"bg-neutral-100 text-neutral-800 border-neutral-200 hover:bg-neutral-200"},filled:{primary:"bg-primary-500 text-neutral-white border-transparent hover:bg-primary-600 active:bg-primary-700",secondary:"bg-secondary-500 text-neutral-white border-transparent hover:bg-secondary-600 active:bg-secondary-700",error:"bg-error-500 text-neutral-white border-transparent hover:bg-error-600 active:bg-error-700",success:"bg-success-500 text-neutral-white border-transparent hover:bg-success-600 active:bg-success-700",warning:"bg-warning-500 text-neutral-950 border-transparent hover:bg-warning-600 active:bg-warning-700",info:"bg-info-500 text-neutral-white border-transparent hover:bg-info-600 active:bg-info-700",neutral:"bg-neutral-800 text-neutral-white border-transparent hover:bg-neutral-900 active:bg-neutral-950"},outline:{primary:"bg-transparent text-primary-700 border-2 border-primary-400 hover:bg-primary-50/70",secondary:"bg-transparent text-secondary-800 border-2 border-secondary-400 hover:bg-secondary-50/70",error:"bg-transparent text-error-700 border-2 border-error-400 hover:bg-error-50/70",success:"bg-transparent text-success-700 border-2 border-success-400 hover:bg-success-50/70",warning:"bg-transparent text-warning-800 border-2 border-warning-400 hover:bg-warning-50/70",info:"bg-transparent text-info-800 border-2 border-info-400 hover:bg-info-50/70",neutral:"bg-transparent text-neutral-700 border-2 border-neutral-300 hover:bg-neutral-100/70"},ghost:{primary:"bg-transparent text-primary-700 border-transparent hover:bg-primary-50",secondary:"bg-transparent text-secondary-800 border-transparent hover:bg-secondary-50",error:"bg-transparent text-error-700 border-transparent hover:bg-error-50",success:"bg-transparent text-success-700 border-transparent hover:bg-success-50",warning:"bg-transparent text-warning-800 border-transparent hover:bg-warning-50",info:"bg-transparent text-info-800 border-transparent hover:bg-info-50",neutral:"bg-transparent text-neutral-700 border-transparent hover:bg-neutral-50"}};import{jsx as Fo,jsxs as Qf}from"react/jsx-runtime";function $t({size:e="md",variant:t="soft",color:r="primary",radius:n="full",dot:o=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:h="Remove",className:d="",children:w,onClick:p,ref:m,...x}){let y=C(e,Lc,"md"),b=t==="other"?"":C(r,C(t,Vc,"soft"),"primary"),k=C(r,Hc,"primary"),T=C(n,Bc,"full"),v=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",y.badge,T,b,p?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",d].filter(Boolean).join(" "),u=c=>Fo("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${y.icon}`,"aria-hidden":"true",children:c});return Qf("span",{ref:m,role:p?"button":void 0,tabIndex:p?0:void 0,className:v,onClick:p,...x,children:[o&&Fo("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${y.dot} ${k}`,"aria-hidden":"true"}),a&&u(a),w&&Fo("span",{className:"leading-none",children:w}),s&&!l&&u(s),l&&Fo("button",{type:"button",onClick:c=>{c.stopPropagation(),l()},"aria-label":h,className:`inline-flex items-center justify-center shrink-0 rounded-full hover:bg-black/10 active:bg-black/20 transition-colors p-0.5 -mr-0.5 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current ${y.deleteIcon}`,children:Fo(Oe,{className:"size-full"})})]})}import{useId as tp,useState as rp,useRef as np}from"react";import{useMergeRefs as op}from"@floating-ui/react";var Vi={xs:{wrapper:"h-6 text-[11px]",input:"px-2 py-0.5 text-[11px] leading-tight",icon:"size-3",iconPaddingLeft:"pl-6",iconPaddingRight:"pr-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"h-8 text-xs",input:"px-2.5 py-1 text-xs leading-normal",icon:"size-3.5",iconPaddingLeft:"pl-7.5",iconPaddingRight:"pr-7.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"h-10 text-sm",input:"px-3.5 py-2 text-sm leading-normal",icon:"size-[18px]",iconPaddingLeft:"pl-9",iconPaddingRight:"pr-9",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"h-12 text-base",input:"px-4 py-2.5 text-base leading-normal",icon:"size-5",iconPaddingLeft:"pl-11",iconPaddingRight:"pr-11",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"h-14 text-lg",input:"px-5 py-3 text-lg leading-normal",icon:"size-6",iconPaddingLeft:"pl-13",iconPaddingRight:"pr-13",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Yn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ac={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Oc={xs:{wrapper:"min-h-6 text-[11px] px-1.5 py-0.5",input:"text-[11px] leading-tight min-w-[50px]",gap:"gap-1",badgeSize:"xs",icon:"size-3",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{wrapper:"min-h-8 text-xs px-2 py-1",input:"text-xs leading-normal min-w-[60px]",gap:"gap-1",badgeSize:"xs",icon:"size-3.5",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{wrapper:"min-h-10 text-sm px-2.5 py-1.5",input:"text-sm leading-normal min-w-[70px]",gap:"gap-1.5",badgeSize:"sm",icon:"size-[18px]",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{wrapper:"min-h-12 text-base px-3 py-2",input:"text-base leading-normal min-w-[80px]",gap:"gap-1.5",badgeSize:"md",icon:"size-5",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{wrapper:"min-h-14 text-lg px-3.5 py-2.5",input:"text-lg leading-normal min-w-[90px]",gap:"gap-2",badgeSize:"lg",icon:"size-6",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Wn={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Gc={xs:{slot:"size-6 min-w-6",text:"text-xs",gap:"gap-1",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5"},sm:{slot:"size-8 min-w-8",text:"text-sm",gap:"gap-1.5",label:"text-xs mb-1",helper:"text-[10px] mt-0.5"},md:{slot:"size-10 min-w-10",text:"text-base font-semibold",gap:"gap-2",label:"text-sm mb-1.5",helper:"text-[11px] mt-1"},lg:{slot:"size-12 min-w-12",text:"text-lg font-semibold",gap:"gap-2.5",label:"text-base mb-1.5",helper:"text-xs mt-1"},xl:{slot:"size-14 min-w-14",text:"text-xl font-bold",gap:"gap-3",label:"text-lg mb-2",helper:"text-sm mt-1"}};import{useEffect as ep,useState as Ts}from"react";function Ds(e,t={}){let{exitDuration:r=250}=t,[n,o]=Ts(e),[i,a]=Ts(!1),[s,l]=Ts(e);return e!==s&&(l(e),e?(o(e),a(!1)):a(!0)),ep(()=>{if(!i)return;let h=setTimeout(()=>{o(void 0),a(!1)},r);return()=>clearTimeout(h)},[r,i]),{displayedError:n,isExiting:i}}import{jsx as Rs}from"react/jsx-runtime";function $e({id:e,helperText:t,errorMessage:r,sizeClassName:n="text-xs",className:o=""}){let{displayedError:i,isExiting:a}=Ds(r),s=i||t,l=!!(i||t),h=!!i;return Rs("div",{className:`grid transition-[grid-template-rows,opacity,margin] duration-200 ease-out overflow-hidden ${l?"grid-rows-[1fr] opacity-100 mt-1":"grid-rows-[0fr] opacity-0 mt-0 pointer-events-none"}`,"aria-live":"polite",children:Rs("div",{className:"overflow-hidden",children:Rs("div",{id:e,role:h?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${n} ${h?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${o}`,children:s||"\xA0"})})})}import{jsx as jc,jsxs as Yc}from"react/jsx-runtime";var Ns={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},Uc={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function at({label:e,children:t,htmlFor:r,id:n,isRequired:o=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:h="primary",hasError:d=!1,isInvalid:w=!1,cursor:p,className:m="",colorConfig:x=Ns}){let y=e??t;if(!y)return null;let b=i??a==="floating",k=!!(d||w),T=k?"error":h,v=k?"text-error-600 font-bold":x[T]||Ns[T]||Ns.primary,u=Uc[s]||Uc.md,c=l||(b?u.floatingLabel:u.label),g=p?`cursor-${p}`:b?"cursor-text":"";return b?Yc("label",{htmlFor:r,id:n,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${g} ${c} ${v} ${m}`,children:[y,o&&jc("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):Yc("label",{htmlFor:r,id:n,className:`inline-flex items-center font-bold transition-colors duration-150 ${g} ${c} ${v} ${m}`,children:[y,o&&jc("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}import{jsx as jt,jsxs as Ai}from"react/jsx-runtime";function Ct({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:h,leftAddon:d,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:x="",inputWrapperClassName:y="",labelClassName:b="",helperClassName:k="",id:T,value:v,defaultValue:u,onChange:c,disabled:g=!1,readOnly:f=!1,className:S="",type:D="text",placeholder:R,ref:P,...I}){let{isRequired:E=!1,isInvalid:N=!1,isLoading:M=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!1}=a??{},Y=tp(),$=T||Y,F=`${$}-error-helper`,G=np(null),A=op([G,P]),U=v!==void 0,[B,X]=rp(u),le=U?v:B,ne=ye=>{U||X(ye.target.value),c?.(ye)},ue=()=>{U||X(""),m?.()},ie=le!=null?String(le).length>0:!1,Q=!!(N||l),q=Q?"error":r,ge=C(e,Vi,"md"),ke=C(n,Yn,"md"),L=t==="other"?"":C(q,C(t,Wn,"outline"),"primary"),te=ye=>jt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ge.icon}`,"aria-hidden":"true",children:ye}),Z=i==="floating",he=()=>jt(at,{htmlFor:$,label:o,isRequired:E,isFloating:Z,size:e,color:q,hasError:Q,className:b}),ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",ge.wrapper,ke,L,g?"opacity-50":"",V?"w-full":"w-auto",y].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",ge.input,h?"pl-1.5":"",w||H||M?"pr-1.5":"",S].filter(Boolean).join(" ");return Ai("div",{className:`group/field flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${V?"w-full":"inline-flex"} ${x}`,children:[!Z&&he(),Ai("div",{className:`flex flex-col ${V?"w-full":""}`,children:[Ai("div",{className:"flex items-stretch",children:[d&&jt("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-r-none`:""}`,children:d}),Ai("div",{className:`${ae} ${d?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Z&&he(),h&&jt("div",{className:"flex items-center justify-center pl-3 shrink-0",children:te(h)}),jt("input",{ref:A,id:$,type:D,value:le,onChange:ne,disabled:g||M,readOnly:f,"aria-invalid":Q,"aria-required":E,"aria-describedby":l||s?F:void 0,"aria-errormessage":l?F:void 0,"aria-busy":M,"aria-disabled":g||M,placeholder:R,className:ve,...I}),M&&z&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(jt(Ne,{}))}),!M&&H&&!g&&!f&&jt("button",{type:"button",onClick:ue,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ie?0:-1,"aria-hidden":!ie,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ge.icon} ${ie?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:jt(Oe,{className:"size-full"})}),!M&&w&&jt("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(w)})]}),p&&jt("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-l-none`:""}`,children:p})]}),jt($e,{id:F,helperText:s,errorMessage:l,sizeClassName:ge.helper,className:k})]})]})}import{useState as ip}from"react";import{jsx as Kn,jsxs as Kc}from"react/jsx-runtime";function Ps({width:e=16,height:t=16,className:r="",...n}){return Kc("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Kn("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),Kn("circle",{cx:"12",cy:"12",r:"3"})]})}function Wc({width:e=16,height:t=16,className:r="",...n}){return Kc("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Kn("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),Kn("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),Kn("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),Kn("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Lr=Ps;import{jsx as Oi}from"react/jsx-runtime";function zs({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:n,disabled:o,readOnly:i,...a}){let[s,l]=ip(e);return Oi(Ct,{type:s?"text":"password",disabled:o,readOnly:i,rightIcon:n||Oi("button",{type:"button",onClick:()=>{if(o||i)return;let w=!s;l(w),r?.(w)},disabled:o||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?Oi(Wc,{className:"size-full"}):Oi(Ps,{className:"size-full"})}),...a})}import{useState as ap}from"react";function Br(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),h=String(e).trim();if(!h)return"";let d=l&&h.startsWith("-");if(d&&h==="-")return"-";if(o>0&&h.includes(n)){let b=h.split(n),k=b[0]?.replace(/\D/g,"")??"",T=b.slice(1).join("").replace(/\D/g,"").slice(0,o);if(k||T){let c=parseFloat(`${k||"0"}.${T||"0"}`);if(d&&(c=-c),a!==void 0&&!isNaN(c)&&c>a)return Br(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(c)&&c<i&&(s||d&&i<0))return Br(i,{...t,max:void 0,min:void 0})}let v=k?parseInt(k,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",u=d?"-":"";return b.length>1&&b[1]===""&&T===""?`${u}${v||"0"}${n}`:T.length>0?`${u}${v||"0"}${n}${T}`:`${u}${v}`}let w=h.replace(/\D/g,"");if(!w)return d?"-":"";let p=parseInt(w,10);if(isNaN(p))return"";d&&(p=-p),a!==void 0&&p>a&&(p=a),i!==void 0&&p<i&&(s||d&&i<0)&&(p=i);let m=p<0?"-":"",x=Math.abs(p).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${x}`}function _c(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function Hr(e,t){if(!e)return;let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=e.split(r).join("");if(n!=="."&&(o=o.split(n).join(".")),o=o.replace(/[^\d.-]/g,""),!o||o==="."||o==="-")return;let i=parseFloat(o);return isNaN(i)?void 0:i}function Is(e,t,r,n){let o=n?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let h=e.charAt(l);(/\d/.test(h)||h===o||h==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let h=t.charAt(l);if((/\d/.test(h)||h===o||h==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function Gi(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Ui(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function ji(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(n=>r?n.trim():n).filter(Boolean):[]}import{jsx as sp}from"react/jsx-runtime";function dn({value:e,defaultValue:t,min:r,max:n,thousandSeparator:o=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:h,onBlur:d,ref:w,...p}){let m={max:n,min:r,thousandSeparator:o,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},x=e!==void 0,[y,b]=ap(t),k=x?e:y,T=Br(k,m),v=()=>{x||b(""),h?.()},u=g=>{let f=g.target,S=f.value,D=f.selectionStart||0,R=Br(S,m),P=Is(S,R,D,{decimalSeparator:i});if(x||b(R),f.value=R,l){let I={...g,target:f,currentTarget:f};l(I)}requestAnimationFrame(()=>{f&&f.setSelectionRange&&f.setSelectionRange(P,P)})},c=g=>{if(r!==void 0&&k!==void 0&&k!==null&&k!==""){let f=Hr(String(k),{thousandSeparator:o,decimalSeparator:i});if(f!==void 0&&f<r){let S=Br(r,{...m,clampMin:!0});if(x||b(S),l){g.target.value=S;let D={...g,target:g.target,currentTarget:g.target};l(D)}}}d?.(g)};return sp(Ct,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:T,onChange:u,onBlur:c,onClear:v,...p})}import{useId as lp,useState as cp,useEffect as up,useRef as dp,useImperativeHandle as fp}from"react";import{jsx as fn,jsxs as Eo}from"react/jsx-runtime";function Ms({ref:e,config:t,id:r,name:n,length:o=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:h="numeric",mask:d=!1,size:w="md",variant:p="outline",color:m="primary",radius:x,autoFocus:y=!1,disabled:b=!1,readOnly:k=!1,groupSize:T,separator:v="-",ariaLabel:u="One-time password",getSlotAriaLabel:c,allowOneTimeCode:g=!0,label:f,labelPlacement:S="top",helperText:D,errorMessage:R,className:P="",slotClassName:I="",wrapperClassName:E="",labelClassName:N="",helperClassName:M=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},$=lp(),F=r||$,G=`${F}-slot-0`,A=`${F}-error-helper`,[U,B]=cp(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:o},(O,W)=>J[W]||"")}),X=dp([]),le=i!==void 0,ne=le?Array.from({length:o},(J,O)=>i&&i[O]!==void 0?i[O]:""):U,ue=!!(H||R),ie=ue?"error":m;up(()=>{if(y&&!b&&!k){let J=ne.findIndex(W=>!W),O=J!==-1?J:0;X.current[O]?.focus()}},[y,ne,b,k]),fp(e,()=>({getValue:()=>ne.join(""),clear:()=>{let J=Array(o).fill("");le||B(J),s?.(""),!b&&!k&&X.current[0]?.focus()},focus:(J=0)=>{let O=Math.max(0,Math.min(J,o-1));X.current[O]?.focus()}}),[ne,o,le,s,b,k]);let Q=J=>{le||B(J);let O=J.join("");s?.(O),J.every(W=>W.length>0)&&J.length===o&&l?.(O)},q=(J,O)=>{let W=Ui(J,h);if(!W)return;let we=[...ne],fe=W.length>=o?0:O,se=W.slice(0,o-fe).split("");se.forEach((De,xe)=>{fe+xe<o&&(we[fe+xe]=De)}),Q(we);let me=Math.min(fe+se.length,o-1);X.current[me]?.focus()},ge=(J,O)=>{if(b||k||V)return;let W=J.target.value;if(!W){let fe=[...ne];fe[O]="",Q(fe);return}if(W.length>1){q(W,O);return}let we=W.slice(-1);if(Gi(we,h)){let fe=[...ne];fe[O]=we,Q(fe),O<o-1&&X.current[O+1]?.focus()}},ke=(J,O)=>{if(!(b||k||V)){if(J.key==="Backspace"){J.preventDefault();let W=[...ne];ne[O]?(W[O]="",Q(W)):O>0&&(W[O-1]="",Q(W),X.current[O-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let W=[...ne];W[O]="",Q(W)}else if(J.key==="ArrowLeft")J.preventDefault(),O>0&&X.current[O-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),O<o-1&&X.current[O+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let W=ne.join("");W&&navigator.clipboard?.writeText(W)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let W=ne.join("");W&&navigator.clipboard?.writeText(W);let we=Array(o).fill("");Q(we),X.current[0]?.focus()}}},L=(J,O)=>{if(b||k||V)return;J.preventDefault();let W=J.clipboardData.getData("text/plain");q(W,O)},te=C(w,Gc,"md"),Z=C(w,Vi,"md"),he=C(x,Yn,"md"),ae=p==="other"?"":C(ie,C(p,Wn,"outline"),"primary"),ve=b?"opacity-50":"",Se=()=>f?Eo("label",{htmlFor:G,className:`block font-medium text-neutral-700 select-none ${te.label} ${N}`,children:[f,z&&fn("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return Eo("div",{className:`group/otp flex ${S==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[Se(),Eo("div",{className:"flex flex-col",children:[Eo("div",{role:"group","aria-label":u,"aria-describedby":R||D?A:void 0,className:`inline-flex items-center ${te.gap} ${P}`,children:[Array.from({length:o}).map((J,O)=>{let W=!!(d||h==="password"),we=c?c(O,o):`K\xFD t\u1EF1 ${O+1} tr\xEAn ${o}`,fe=!!(T&&T>0)&&(O+1)%(T||1)===0&&O<o-1;return Eo("div",{className:"inline-flex items-center gap-1.5",children:[fn("input",{id:`${F}-slot-${O}`,ref:se=>{X.current[O]=se},type:W?"password":"text",inputMode:h==="numeric"?"numeric":"text",pattern:h==="numeric"?"[0-9]*":void 0,maxLength:1,value:ne[O]||"",onFocus:se=>se.target.select(),onChange:se=>ge(se,O),onKeyDown:se=>ke(se,O),onPaste:se=>L(se,O),disabled:b||V,readOnly:k,"aria-label":we,"aria-invalid":ue,"aria-required":z,"aria-busy":V,"aria-disabled":b||V,autoComplete:g?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${te.slot} ${te.text} ${he} ${ae} ${ve} ${I}`}),fe&&fn("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:v})]},`${F}-slot-${O}`)}),V&&Y&&fn("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:fn(Ne,{className:`animate-spin ${Z.icon}`})})]}),fn($e,{id:A,helperText:D,errorMessage:R,sizeClassName:te.helper,className:M}),n&&fn("input",{type:"hidden",name:n,value:ne.join(""),disabled:b||V})]})]})}import{useId as gp,useState as Fs,useRef as mp}from"react";import{useMergeRefs as bp}from"@floating-ui/react";import{jsx as Xc,jsxs as pp}from"react/jsx-runtime";function pr({width:e=14,height:t=14,className:r="",...n}){return pp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Xc("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Xc("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{Fragment as hp,jsx as st,jsxs as pn}from"react/jsx-runtime";function Es({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:h,leftAddon:d,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:x="",inputWrapperClassName:y="",labelClassName:b="",helperClassName:k="",id:T,name:v,value:u,defaultValue:c=[],onChange:g,inputValue:f,onInputValueChange:S,delimiters:D=["Enter"],showAddButton:R=!1,renderAddButton:P,addOnBlur:I=!1,addOnPaste:E=!0,pasteSplitRegex:N=/[\r\n,;\t]+/,trimValues:M=!0,allowDuplicates:z=!1,onDuplicate:H,maxTags:V,onMaxTagsReached:Y,maxTagLength:$,validateTag:F,onValidateError:G,maxTagCount:A,renderTag:U,tagVariant:B,tagColor:X,tagRadius:le,tagSize:ne,tagClassName:ue="",addButtonClassName:ie="",disabled:Q=!1,readOnly:q=!1,className:ge="",placeholder:ke="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:L=!1,ref:te}){let{isRequired:Z=!1,isInvalid:he=!1,isLoading:ae=!1,showSpinner:ve=!1,isClearable:Se=!1,isFullWidth:ye=!1}=a??{},J=gp(),O=T||J,W=`${O}-error-helper`,we=o?`${O}-label`:void 0,fe=mp(null),se=bp([fe,te]),me=u!==void 0,[De,xe]=Fs(c),re=me?u||[]:De,de=f!==void 0,[ce,ee]=Fs(""),j=de?f||"":ce,[Ce,Ee]=Fs(""),Fe=Ie=>{de||ee(Ie),S?.(Ie)},oe=Ie=>{me||xe(Ie),g?.(Ie)},Te=Ie=>{if(Q||q||ae)return!1;let Ae=M?Ie.trim():Ie;if(!Ae)return!1;if($&&$>0&&Ae.length>$&&(Ae=Ae.slice(0,$)),V!==void 0&&re.length>=V)return Y?.(Ae),Ee(`Maximum limit of ${V} tags reached`),!1;if(!z&&re.includes(Ae))return H?.(Ae),Ee(`Tag "${Ae}" already exists`),!1;if(F){let pt=F(Ae);if(pt===!1||typeof pt=="string")return G?.(Ae,typeof pt=="string"?pt:void 0),Ee(`Tag "${Ae}" is invalid`),!1}let ut=[...re,Ae];return oe(ut),Fe(""),Ee(`Added tag "${Ae}"`),!0},Pe=Ie=>{if(Q||q||ae)return;let Ae=[...re],ut=new Set(re),pt=0;for(let Tr of Ie){let Et=M?Tr.trim():Tr;if(Et){if($&&$>0&&Et.length>$&&(Et=Et.slice(0,$)),V!==void 0&&Ae.length>=V){Y?.(Et);break}if(!z&&ut.has(Et)){H?.(Et);continue}if(F){let Gn=F(Et);if(Gn===!1||typeof Gn=="string"){G?.(Et,typeof Gn=="string"?Gn:void 0);continue}}Ae.push(Et),ut.add(Et),pt++}}oe(Ae),Fe(""),pt>0&&Ee(`Added ${pt} tags`)},_e=Ie=>{if(Q||q||ae)return;let Ae=re[Ie],ut=re.filter((pt,Tr)=>Tr!==Ie);oe(ut),Ae&&Ee(`Removed tag "${Ae}"`)},Ue=Ie=>{Ie?.stopPropagation(),!(Q||q||ae)&&(oe([]),Fe(""),Ee("Removed all tags"),m?.(),fe.current?.focus())},Le=Ie=>{if(Q||q||ae)return;D.includes(Ie.key)||D.includes("Enter")&&Ie.key==="Enter"||D.includes("Comma")&&(Ie.key===","||Ie.key==="Comma")||D.includes("Tab")&&Ie.key==="Tab"||D.includes("Space")&&(Ie.key===" "||Ie.key==="Space")?j&&(Ie.preventDefault(),Te(j)):Ie.key==="Backspace"&&j===""&&re.length>0&&(Ie.preventDefault(),_e(re.length-1))},Be=Ie=>{if(!(Q||q||ae)&&E){let Ae=Ie.clipboardData.getData("text");if(Ae){let ut=ji(Ae,N,M);(ut.length>1||N.test(Ae))&&(Ie.preventDefault(),Pe(ut))}}},Ke=()=>{I&&j.trim()&&Te(j)},K=re.length>0||j.length>0,_=!!(he||l),ze=_?"error":r,pe=C(e,Oc,"md"),Me=C(n,Yn,"md"),Xe=le||C(n,Ac,"md"),He=ne||pe.badgeSize||"sm",Ze=X||r,qe=B||t,Re=t==="other"?"":C(ze,C(t,Wn,"outline"),"primary"),Ye=i==="floating",be=Ie=>st("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${pe.icon}`,"aria-hidden":"true",children:Ie}),Ve=()=>st(at,{id:we,htmlFor:O,label:o,isRequired:Z,isFloating:Ye,size:e,color:ze,hasError:_,className:b}),rt=A&&A>0?re.slice(0,A):re,Je=A&&A>0?Math.max(0,re.length-A):0,Tt=Q?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",Ft=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",pe.wrapper,Me,Re,Tt,ye?"w-full":"w-auto min-w-[200px]",y].filter(Boolean).join(" "),ot=i==="left",Dt=V===void 0||re.length<V,cn=R&&!Q&&!q;return pn("div",{role:"group","aria-labelledby":we,className:`group/field flex ${ot?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${x}`,children:[st("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Ce}),!Ye&&Ve(),pn("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[pn("div",{className:"flex items-stretch",children:[d&&st("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${Me?`${Me} rounded-r-none`:""}`,children:d}),pn("div",{className:`${Ft} ${d?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Ye&&Ve(),h&&st("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:be(h)}),pn("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${pe.gap}`,children:[(()=>{let Ie=new Map;return rt.map((Ae,ut)=>{let pt=(Ie.get(Ae)??0)+1;Ie.set(Ae,pt);let Tr=`${Ae}_${pt}`;return U?st("span",{className:"inline-flex shrink-0",children:U({value:Ae,index:ut,onRemove:()=>_e(ut),disabled:Q,readOnly:q})},Tr):st("span",{className:"inline-flex shrink-0",children:st($t,{size:He,variant:qe,color:Ze,radius:Xe,deleteAriaLabel:`Remove tag ${Ae}`,onDelete:!Q&&!q?()=>_e(ut):void 0,className:`shrink-0 max-w-full truncate select-none ${ue}`,children:Ae})},Tr)})})(),Je>0&&st("span",{className:"inline-flex shrink-0",children:pn($t,{size:He,variant:"filled",color:"neutral",radius:Xe,className:"shrink-0 font-medium select-none",children:["+",Je]})}),Dt?st("input",{ref:se,id:O,type:"text",value:j,onChange:Ie=>Fe(Ie.target.value),onKeyDown:Le,onPaste:Be,onBlur:Ke,disabled:Q||ae,readOnly:q,autoFocus:L,"aria-invalid":_,"aria-required":Z,"aria-describedby":l||s?W:void 0,"aria-errormessage":l?W:void 0,"aria-busy":ae,"aria-disabled":Q||ae,"aria-autocomplete":"none",placeholder:re.length===0?ke:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${pe.input} ${ge}`}):null]}),cn&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:P?P({onAdd:()=>Te(j),disabled:!j.trim()||!Dt}):st("button",{type:"button",onClick:Ie=>{Ie.stopPropagation(),j.trim()&&Dt?Te(j):fe.current?.focus()},disabled:!j.trim()||!Dt,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ie}`,children:st(pr,{className:pe.icon})})}),ae&&ve&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:be(st(Ne,{}))}),!ae&&Se&&!Q&&!q&&st("button",{type:"button",onClick:Ue,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:K?0:-1,"aria-hidden":!K,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${pe.icon} ${K?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:st(Oe,{className:"size-full"})}),!ae&&w&&st("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:be(w)})]}),p&&st("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${Me?`${Me} rounded-l-none`:""}`,children:p})]}),st($e,{id:W,helperText:s,errorMessage:l,sizeClassName:pe.helper,className:k}),v&&(()=>{let Ie=new Map;return pn(hp,{children:[re.map(Ae=>{let ut=(Ie.get(Ae)??0)+1;Ie.set(Ae,ut);let pt=`${Ae}_${ut}`;return st("input",{type:"hidden",name:`${v}[]`,value:Ae,disabled:Q||ae},`hidden_${pt}`)}),re.length===0&&st("input",{type:"hidden",name:v,value:"",disabled:Q||ae})]})})()]})]})}import{useId as xp,useState as vp,useRef as yp}from"react";import wp from"react-textarea-autosize";import{useMergeRefs as Cp}from"@floating-ui/react";var qc={xs:{textarea:"text-[11px] px-2 py-1 leading-tight",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{textarea:"text-xs px-2.5 py-1.5 leading-normal",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{textarea:"text-sm px-3.5 py-2 leading-normal",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{textarea:"text-base px-4 py-2.5 leading-normal",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{textarea:"text-lg px-5 py-3 leading-normal",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},Zc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Jc={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},Qc={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border border-transparent hover:bg-neutral-100/50 focus-within:bg-neutral-100/50 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as Vr,jsxs as Yi}from"react/jsx-runtime";function $s({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:h,minRows:d=3,maxRows:w,onHeightChange:p,cacheMeasurements:m,resize:x="none",wrapperClassName:y="",textareaWrapperClassName:b="",labelClassName:k="",helperClassName:T="",countClassName:v="",id:u,value:c,defaultValue:g,onChange:f,disabled:S=!1,readOnly:D=!1,className:R="",placeholder:P,maxLength:I,ref:E,style:N,...M}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1,isClearable:$=!1,showCount:F=!1,isFullWidth:G=!1,autoResize:A=!0}=a??{},U=xp(),B=u||U,X=`${B}-error-helper`,le=yp(null),[ne,ue]=vp(g),ie=Cp([le,E]),Q=c!==void 0,q=Q?c:ne,ge=!!(H||l),ke=ge?"error":r,L=C(e,qc,"md"),te=C(n,Zc,"md"),Z=A?"resize-none":C(x,Jc,"none"),he=t==="other"?"":C(ke,C(t,Qc,"outline"),"primary"),ae=q!=null?String(q).length:0,ve=ae>0,Se=De=>{let xe=De.target.value;I!==void 0&&xe.length>I&&(xe=xe.slice(0,I),De.target.value=xe),Q||ue(xe),f?.(De)},ye=()=>{Q||ue(""),h?.()},J=i==="floating",O=()=>Vr(at,{htmlFor:B,label:o,isRequired:z,isFloating:J,size:e,color:ke,hasError:ge,className:k}),W=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",te,he,S?"opacity-50":"",G?"w-full":"w-auto",b].filter(Boolean).join(" "),we=$||V&&Y,fe=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",L.textarea,we?"pr-8":"",F?"pb-6":"",Z,R].filter(Boolean).join(" "),se=i==="left",me={id:B,value:q,onChange:Se,disabled:S||V,readOnly:D,maxLength:I,"aria-invalid":ge,"aria-required":z,"aria-describedby":l||s?X:void 0,"aria-errormessage":l?X:void 0,"aria-busy":V,"aria-disabled":S||V,placeholder:P,className:fe,style:N,...M};return Yi("div",{className:`group/field flex ${se?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${G?"w-full":"inline-flex"} ${y}`,children:[!J&&O(),Yi("div",{className:`flex flex-col ${G?"w-full":""}`,children:[Yi("div",{className:W,children:[J&&O(),A?Vr(wp,{ref:ie,minRows:d,maxRows:w,onHeightChange:p,cacheMeasurements:m,...me}):Vr("textarea",{ref:ie,rows:d,...me}),V&&Y&&Vr("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:Vr(Ne,{className:"size-full animate-spin"})}),!V&&$&&!S&&!D&&Vr("button",{type:"button",onClick:ye,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ve?0:-1,"aria-hidden":!ve,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ve?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Vr(Oe,{className:"size-full"})}),F&&Yi("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${v}`,children:[ae,I!==void 0&&`/${I}`]})]}),Vr($e,{id:X,helperText:s,errorMessage:l,sizeClassName:L.helper,className:T})]})]})}import{useId as kp,useState as Sp}from"react";var Wi={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},eu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},tu={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},ru={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},nu={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};import{jsx as ou}from"react/jsx-runtime";function Ar({width:e=14,height:t=14,className:r="",...n}){return ou("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:ou("polyline",{points:"20 6 9 17 4 12"})})}import{jsx as iu}from"react/jsx-runtime";function Ki({width:e=14,height:t=14,className:r="",...n}){return iu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:iu("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}import{jsx as gr,jsxs as Ls}from"react/jsx-runtime";function mr({size:e="md",variant:t="filled",color:r="primary",radius:n,config:o,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:h="right",icon:d,indeterminateIcon:w,wrapperClassName:p="",boxClassName:m="",labelClassName:x="",helperClassName:y="",className:b="",checked:k,defaultChecked:T,disabled:v=!1,readOnly:u=!1,onChange:c,value:g,id:f,name:S,ref:D,...R}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:N=!1,indeterminate:M=!1}=o??{},z=i||a,H=kp(),V=f||H,Y=`${V}-helper`,$=!!(I??!!l),F=k!==void 0,[G,A]=Sp(T??!1),U=F?k:G,B=Z=>{v||u||E||(F||A(Z.target.checked),c?.(Z))},X=C(e,Wi,"md"),le=C(n,eu,"md"),ne=U||M,ue=C(t==="other"?"filled":t,tu,"filled"),ie;t==="other"?ie="":ne?ie=C(r,ue,"primary"):ie="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",$&&(ie=ne?C("error",ue,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let Q=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",X.box,le,ie,!v&&!u&&!E?"active:scale-95":"",m].filter(Boolean).join(" "),q=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",X.label,v?"opacity-60":"",x].filter(Boolean).join(" "),ge=["group inline-flex relative",h==="left"?"flex-row-reverse justify-between":"flex-row",X.gap,v?"opacity-50":"cursor-pointer",p,b].filter(Boolean).join(" "),ke=()=>E&&N?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:gr(Ne,{className:"size-full animate-spin"})}):M?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:w||gr(Ki,{className:"size-full"})}):U?gr("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:d||gr(Ar,{className:"size-full"})}):null,L=!!z,te=Z=>{(v||u||E)&&Z.preventDefault()};return Ls("div",{className:`inline-flex flex-col ${b}`.trim(),children:[Ls("label",{className:ge,onClick:te,children:[gr("input",{ref:D,type:"checkbox",id:V,name:S,value:g,checked:U,disabled:v||E,readOnly:u,required:P,"aria-checked":M?"mixed":U,"aria-invalid":$,"aria-required":P,"aria-busy":E,"aria-disabled":v||E,"aria-describedby":l||s?Y:void 0,onChange:B,className:"sr-only peer",...R}),gr("span",{className:Q,"aria-hidden":"true",children:ke()}),L&&Ls("span",{className:q,children:[z,P&&gr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),gr($e,{id:Y,helperText:s,errorMessage:l,sizeClassName:X.helper,className:y})]})}import{useState as $o,useId as Rp,useMemo as uu,useCallback as Np}from"react";var Qe={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};import{useRef as au,useEffect as su,useCallback as lu}from"react";function gn(e,t=300){let r=au(e),n=au(null);su(()=>{r.current=e},[e]);let o=lu(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return su(()=>o,[o]),{debounced:lu((...a)=>{o(),n.current=setTimeout(()=>{r.current(...a)},t)},[o,t]),cancel:o}}import{jsx as cu,jsxs as Dp}from"react/jsx-runtime";function Tp({width:e=16,height:t=16,className:r="",...n}){return Dp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[cu("circle",{cx:"11",cy:"11",r:"8"}),cu("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var mn=Tp;import{jsx as Dr,jsxs as du}from"react/jsx-runtime";var Pp=[],zp=[];function bn({value:e,defaultValue:t=zp,onChange:r,size:n="md",color:o="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:h,errorMessage:d,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:x="",labelClassName:y="",helperClassName:b="",options:k=Pp,config:T,searchMode:v="client",searchPlaceholder:u="T\xECm ki\u1EBFm...",searchValue:c,defaultSearchValue:g="",onSearchChange:f,searchClassName:S="",searchField:D="label",filterFn:R,onSearch:P,debounceMs:I=300,emptyText:E="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:N,ref:M,...z}){let{isRequired:H=!1,isInvalid:V,isLoading:Y=!1,showSpinner:$=!1,isReadOnly:F=!1,searchable:G=!1,preserveSelected:A=!0,isSearching:U}=T??{},B=Rp(),X=`${B}-label`,le=`${B}-helper`,ne=`${B}-search`,ue=e!==void 0,[ie,Q]=$o(t),q=ue?e:ie,ge=!!(V??!!d),ke=c!==void 0,[L,te]=$o(g),Z=ke?c:L,[he,ae]=$o(null),[ve,Se]=$o(!1),ye=!!(U??ve),[J,O]=$o(()=>{let ee=new Map;return k.forEach(j=>{ee.set(String(j.value),j)}),ee}),{debounced:W}=gn(async ee=>{if(!(v!=="server"||!P))try{Se(!0);let j=await P(ee);Array.isArray(j)&&ae(j)}catch(j){console.error("Error fetching search options:",j)}finally{Se(!1)}},I),we=ee=>{let j=ee.target.value;ke||te(j),f?.(j),v==="server"&&W(j)},fe=()=>{ke||te(""),f?.(""),v==="server"&&W("")},se=uu(()=>{let ee=Z.trim(),j=v==="server"&&he?he:k;if(!G||!ee)return j;let Ce;if(v==="server"?Ce=j:R?Ce=j.filter(oe=>R(oe,ee)):Ce=un(j,ee,D),!A)return Ce;let Ee=new Set(Ce.map(oe=>String(oe.value))),Fe=[];for(let oe of q)if(!Ee.has(oe)){let Te=J.get(oe);Te?Fe.push(Te):Fe.push({value:oe,label:oe})}return[...Fe,...Ce]},[G,Z,v,he,k,R,D,A,q,J]),me=Np((ee,j)=>{if(s||F||Y)return;if(j){let Fe=(v==="server"&&he?he:k).find(oe=>String(oe.value)===ee);Fe&&O(oe=>{if(oe.has(ee))return oe;let Te=new Map(oe);return Te.set(ee,Fe),Te})}let Ce;j?Ce=[...q,ee]:Ce=q.filter(Ee=>Ee!==ee),ue||Q(Ce),r?.(Ce)},[s,F,Y,q,ue,r,k,v,he]),De=C(w,ru,"vertical"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",y].filter(Boolean).join(" "),re=C(n,Wi,"md"),de=C(n,nu,"md"),ce=uu(()=>new Set(q.map(String)),[q]);return du("div",{ref:M,role:"group","aria-labelledby":l?X:void 0,"aria-describedby":d||h?le:void 0,"aria-disabled":s||Y?"true":void 0,"aria-busy":Y||ye?"true":void 0,className:`inline-flex flex-col ${x}`,...z,children:[l&&du("span",{id:X,className:xe,children:[l,H&&Dr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),G&&Dr("div",{className:`mb-2.5 ${S}`,children:Dr(Ct,{id:ne,variant:"outline",size:de,color:o,value:Z,onChange:we,placeholder:u,disabled:s,leftIcon:Dr(mn,{className:"size-4 text-neutral-400"}),rightIcon:ye?Dr(Ne,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:fe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!ye,isFullWidth:!0}})}),Dr("div",{className:`${De} ${m}`,children:N||(se.length>0?se.map(ee=>{let j=String(ee.value),Ce=ce.has(j);return Dr(mr,{value:ee.value,label:ee.label,helperText:ee.description,disabled:s||!!ee.disabled,readOnly:F||!!ee.isReadOnly,size:n,color:o,variant:i,radius:a,labelPlacement:p,checked:Ce,onChange:Ee=>me(j,Ee.target.checked),config:{indeterminate:ee.indeterminate,isLoading:Y,showSpinner:$,isInvalid:ge,isRequired:H}},ee.value)}):Dr("div",{className:"py-2 text-xs text-neutral-500 dark:text-neutral-400 italic",children:!Z.trim()&&v==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),Dr($e,{id:le,helperText:h,errorMessage:d,sizeClassName:re.helper,className:b})]})}import{useId as Ip,useState as Mp}from"react";var Xi={xs:{box:"size-3.5",dot:"size-1.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",dot:"size-2",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",dot:"size-2.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",dot:"size-3",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",dot:"size-3.5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},qi={filled:{primary:"bg-primary-600 text-neutral-white border-primary-600 dark:bg-primary-500 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-600 text-neutral-white border-secondary-600 dark:bg-secondary-500 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-600 text-neutral-white border-error-600 dark:bg-error-500 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-600 text-neutral-white border-success-600 dark:bg-success-500 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-500 text-neutral-950 border-warning-500 dark:bg-warning-400 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-600 text-neutral-white border-info-600 dark:bg-info-500 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-800 text-neutral-white border-neutral-800 dark:bg-neutral-200 dark:text-neutral-900 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},outline:{primary:"bg-transparent text-primary-600 border-2 border-primary-600 hover:bg-primary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-transparent text-secondary-600 border-2 border-secondary-600 hover:bg-secondary-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-transparent text-error-600 border-2 border-error-600 hover:bg-error-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-transparent text-success-600 border-2 border-success-600 hover:bg-success-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-transparent text-warning-700 border-2 border-warning-500 hover:bg-warning-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-transparent text-info-600 border-2 border-info-600 hover:bg-info-50/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-transparent text-neutral-800 border-2 border-neutral-800 hover:bg-neutral-100/50 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"},soft:{primary:"bg-primary-100 text-primary-800 border-primary-300 hover:bg-primary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",secondary:"bg-secondary-100 text-secondary-800 border-secondary-300 hover:bg-secondary-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400 peer-focus-visible:border-secondary-500",error:"bg-error-100 text-error-800 border-error-300 hover:bg-error-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500",success:"bg-success-100 text-success-800 border-success-300 hover:bg-success-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400 peer-focus-visible:border-success-500",warning:"bg-warning-100 text-warning-900 border-warning-300 hover:bg-warning-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400 peer-focus-visible:border-warning-500",info:"bg-info-100 text-info-800 border-info-300 hover:bg-info-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400 peer-focus-visible:border-info-500",neutral:"bg-neutral-100 text-neutral-800 border-neutral-300 hover:bg-neutral-200/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400 peer-focus-visible:border-neutral-500"}},fu={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},pu={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};import{jsx as gu}from"react/jsx-runtime";function Zi({className:e}){return gu("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:gu("circle",{cx:"5",cy:"5",r:"5"})})}import{jsx as Or,jsxs as Bs}from"react/jsx-runtime";function Lo({size:e="md",variant:t="filled",color:r="primary",disabled:n=!1,readOnly:o=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:h,dotIcon:d,wrapperClassName:w="",boxClassName:p="",labelClassName:m="",helperClassName:x="",className:y="",checked:b,defaultChecked:k=!1,onChange:T,value:v,id:u,name:c,ref:g,...f}){let{isRequired:S=!1,isInvalid:D=!1,isLoading:R=!1}=i??{},P=Ip(),I=u||P,E=`${I}-helper`,N=b!==void 0,[M,z]=Mp(k),H=N?b:M,V=!!(D||h),Y=ie=>{n||o||R||(N||z(ie.target.checked),T?.(ie))},$=C(e,Xi,"md"),F=t==="other"?"":C(r,C(t,qi,"filled"),"primary"),G=V?qi[t==="other"?"filled":t]?.error||qi.filled.error:H?F:"bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",$.box,G,!n&&!o&&!R?"active:scale-95":"",p].filter(Boolean).join(" "),U=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",$.label,n?"opacity-60":"",m].filter(Boolean).join(" "),B=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",$.gap,n?"cursor-not-allowed opacity-60":"cursor-pointer",w,y].filter(Boolean).join(" "),X=()=>R?Or("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:Or(Ne,{className:"size-full animate-spin"})}):H?Or("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:d||Or(Zi,{className:"size-full"})}):null,le=!!s;return Bs("div",{className:"inline-flex flex-col",children:[Bs("label",{className:B,onClick:ie=>{(n||o||R)&&ie.preventDefault()},children:[Or("input",{ref:g,type:"radio",id:I,name:c,value:v,checked:H,disabled:n||R,readOnly:o,required:S,"aria-busy":R,"aria-disabled":n||R,"aria-describedby":h||l?E:void 0,onChange:Y,onClick:ie=>{if(n||o||R){ie.preventDefault();return}f.onClick?.(ie)},className:"sr-only peer",...f}),Or("span",{className:A,"aria-hidden":"true",children:X()}),le&&Bs("span",{className:U,children:[s,S&&Or("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),Or($e,{id:E,helperText:l,errorMessage:h,sizeClassName:$.helper,className:x})]})}import{useState as Bo,useId as mu,useMemo as Fp,useCallback as Ep}from"react";import{jsx as Rr,jsxs as bu}from"react/jsx-runtime";var $p=[];function Hs({options:e=$p,value:t,defaultValue:r=null,onChange:n,size:o="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:h,errorMessage:d,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:x="",labelClassName:y="",helperClassName:b="",config:k,searchPlaceholder:T="T\xECm ki\u1EBFm...",searchValue:v,onSearchChange:u,searchMode:c="client",searchField:g="label",filterFn:f,onSearch:S,debounceMs:D=300,emptyText:R="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:P="",searchInputSize:I,ref:E,...N}){let{isRequired:M=!1,isInvalid:z,isLoading:H=!1,isReadOnly:V=!1,searchable:Y=!1,preserveSelected:$=!0,isSearching:F}=k??{},G=mu(),A=`${G}-label`,U=`${G}-helper`,B=`${G}-search`,X=mu(),le=t!==void 0,[ne,ue]=Bo(r??null),ie=le?t:ne,Q=!!(z||d),q=v!==void 0,[ge,ke]=Bo(""),L=q?v:ge,[te,Z]=Bo(!1),he=F??te,[ae,ve]=Bo(null),[Se,ye]=Bo(()=>{let re=new Map;return e.forEach(de=>{re.set(String(de.value),de)}),re}),{debounced:J}=gn(async re=>{if(!(c!=="server"||!S))try{Z(!0);let de=await S(re);Array.isArray(de)&&ve(de)}catch(de){console.error("Error fetching radio search options:",de)}finally{Z(!1)}},D),O=re=>{let de=re.target.value;q||ke(de),u?.(de),c==="server"&&J(de)},W=()=>{q||ke(""),u?.(""),c==="server"&&ve(null)},we=Fp(()=>{let re=L.trim(),de=c==="server"&&ae?ae:e;if(!Y||!re)return de;let ce;if(c==="server"?ce=de:f?ce=de.filter(Ce=>f(Ce,re)):ce=un(de,re,g),!$||ie===null||ie===void 0)return ce;let ee=String(ie);if(!ce.some(Ce=>String(Ce.value)===ee)){let Ce=Se.get(ee);return Ce?[Ce,...ce]:[{value:ee,label:ee},...ce]}return ce},[Y,L,c,ae,e,f,g,$,ie,Se]),fe=Ep(re=>{if(s||V||H)return;let ce=(c==="server"&&ae?ae:e).find(ee=>String(ee.value)===re);ce&&ye(ee=>{if(ee.has(re))return ee;let j=new Map(ee);return j.set(re,ce),j}),le||ue(re),n?.(re)},[s,V,H,le,n,e,c,ae]),se=C(w,fu,"vertical"),me=C(o,Xi,"md"),De=I??C(o,pu,"md"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",y].filter(Boolean).join(" ");return bu("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":d||h?U:void 0,"aria-errormessage":d?U:void 0,"aria-orientation":w,"aria-required":M?"true":void 0,"aria-invalid":Q?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":H?"true":void 0,className:`inline-flex flex-col ${x}`,...N,children:[l&&bu("span",{id:A,className:xe,children:[l,M&&Rr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&Rr("div",{className:`mb-2.5 ${P}`,children:Rr(Ct,{id:B,variant:"outline",size:De,color:i,value:L,onChange:O,placeholder:T,disabled:s||H,leftIcon:Rr(mn,{className:"size-4 text-neutral-400"}),rightIcon:he?Rr(Ne,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:W,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!he,isFullWidth:!0}})}),Rr("div",{className:`${se} ${m}`,children:we.length>0?we.map(re=>{let de=String(re.value),ce=ie!=null&&String(ie)===de;return Rr(Lo,{name:X,value:re.value,checked:ce,onChange:()=>fe(de),label:re.label,helperText:re.description,disabled:s||!!re.disabled,readOnly:V||!!re.isReadOnly,size:o,color:i,variant:a,labelPlacement:p,config:{isLoading:H,isInvalid:Q,isRequired:M}},re.value)}):Rr("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!L.trim()&&c==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":R})}),Rr($e,{id:U,helperText:h,errorMessage:d,sizeClassName:me.helper,className:b})]})}import{useId as Lp,useState as Bp,useRef as Hp}from"react";import{useMergeRefs as Vp}from"@floating-ui/react";var hu={xs:{track:"w-7 h-4 p-0.5",thumb:"size-3",translate:"translate-x-3",icon:"size-2",content:"text-[9px]",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{track:"w-9 h-5 p-0.5",thumb:"size-4",translate:"translate-x-4",icon:"size-2.5",content:"text-[10px]",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{track:"w-11 h-6 p-0.5",thumb:"size-5",translate:"translate-x-5",icon:"size-3",content:"text-xs",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{track:"w-13 h-7 p-0.5",thumb:"size-6",translate:"translate-x-6",icon:"size-3.5",content:"text-xs",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{track:"w-16 h-9 p-1",thumb:"size-7",translate:"translate-x-7",icon:"size-4",content:"text-sm",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Vs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},xu={filled:{primary:{checked:{track:"bg-primary-600 dark:bg-primary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-primary-600 dark:text-primary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-600 dark:bg-secondary-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-secondary-600 dark:text-secondary-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-600 dark:bg-error-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-error-600 dark:text-error-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-600 dark:bg-success-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-success-600 dark:text-success-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-500 dark:bg-warning-400 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-warning-500 dark:bg-neutral-900 dark:text-warning-400 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-600 dark:bg-info-500 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-info-600 dark:text-info-500 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-800 dark:bg-neutral-200 border-transparent peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200 shadow-sm"},unchecked:{track:"bg-neutral-200 dark:bg-neutral-700 border-transparent hover:bg-neutral-300 dark:hover:bg-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white text-neutral-400 dark:bg-neutral-200 dark:text-neutral-600 shadow-sm"}}},outline:{primary:{checked:{track:"bg-primary-50 dark:bg-primary-950/40 border-2 border-primary-600 dark:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},secondary:{checked:{track:"bg-secondary-50 dark:bg-secondary-950/40 border-2 border-secondary-600 dark:border-secondary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},error:{checked:{track:"bg-error-50 dark:bg-error-950/40 border-2 border-error-600 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},success:{checked:{track:"bg-success-50 dark:bg-success-950/40 border-2 border-success-600 dark:border-success-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},warning:{checked:{track:"bg-warning-50 dark:bg-warning-950/40 border-2 border-warning-500 dark:border-warning-400 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},info:{checked:{track:"bg-info-50 dark:bg-info-950/40 border-2 border-info-600 dark:border-info-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}},neutral:{checked:{track:"bg-neutral-100 dark:bg-neutral-800 border-2 border-neutral-800 dark:border-neutral-200 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-transparent border-2 border-neutral-300 dark:border-neutral-600 hover:border-neutral-400 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-400 dark:bg-neutral-500 text-neutral-white shadow-sm"}}},soft:{primary:{checked:{track:"bg-primary-100 dark:bg-primary-900/50 border border-primary-200 dark:border-primary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-primary-600 dark:bg-primary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},secondary:{checked:{track:"bg-secondary-100 dark:bg-secondary-900/50 border border-secondary-200 dark:border-secondary-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-secondary-600 dark:bg-secondary-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-secondary-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},error:{checked:{track:"bg-error-100 dark:bg-error-900/50 border border-error-200 dark:border-error-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-error-600 dark:bg-error-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},success:{checked:{track:"bg-success-100 dark:bg-success-900/50 border border-success-200 dark:border-success-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-success-600 dark:bg-success-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-success-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},warning:{checked:{track:"bg-warning-100 dark:bg-warning-900/50 border border-warning-200 dark:border-warning-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-warning-500 dark:bg-warning-400 text-neutral-950 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-warning-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},info:{checked:{track:"bg-info-100 dark:bg-info-900/50 border border-info-200 dark:border-info-800 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-info-600 dark:bg-info-500 text-neutral-white shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-info-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}},neutral:{checked:{track:"bg-neutral-200 dark:bg-neutral-700 border border-neutral-300 dark:border-neutral-600 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-800 dark:bg-neutral-200 text-neutral-white dark:text-neutral-900 shadow-sm"},unchecked:{track:"bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-200/70 dark:hover:bg-neutral-700/70 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-neutral-400",thumb:"bg-neutral-white dark:bg-neutral-300 text-neutral-400 dark:text-neutral-600 shadow-sm"}}}};import{jsx as Nr,jsxs as Ji}from"react/jsx-runtime";function As({size:e,variant:t,color:r,radius:n,thumbRadius:o,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:h="right",thumbIcon:d,startContent:w,endContent:p,wrapperClassName:m="",trackClassName:x="",thumbClassName:y="",labelClassName:b="",helperClassName:k="",className:T="",checked:v,defaultChecked:u,disabled:c=!1,readOnly:g=!1,onChange:f,onClick:S,value:D,id:R,name:P,ref:I,...E}){let{isRequired:N=!1,isInvalid:M=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=Lp(),Y=R||V,$=`${Y}-error-helper`,F=Hp(null),G=Vp([F,I]),A=v!==void 0,[U,B]=Bp(u??!1),X=A?!!v:U,le=W=>{c||g||z||(A||B(W.target.checked),f?.(W))},ne=W=>{if(c||g||z){W.preventDefault();return}S?.(W)},ue=W=>{(c||g||z)&&W.preventDefault()},ie=!!(M||l),Q=ie?"error":r,q=C(e,hu,"md"),ge=C(n,Vs,"full"),ke=C(o,Vs,"full"),L=t==="other"?void 0:C(Q,C(t,xu,"filled"),"primary"),te=L?X?L.checked.track:L.unchecked.track:"",Z=L?X?L.checked.thumb:L.unchecked.thumb:"",he=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",q.track,ge,te,c?"opacity-50":"",x].filter(Boolean).join(" "),ae=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",q.thumb,ke,Z,X?q.translate:"translate-x-0",y].filter(Boolean).join(" "),ve=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",q.label,c?"opacity-50":"",b].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",h==="left"?"flex-row-reverse justify-between":"flex-row",q.gap,c?"cursor-not-allowed opacity-60":"cursor-pointer",m,T].filter(Boolean).join(" "),J=()=>z&&H?Nr("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:Nr(Ne,{className:"size-full animate-spin"})}):typeof d=="function"?d({isChecked:X,className:q.icon}):d?Nr("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:d}):null,O=()=>a?Ji("span",{className:ve,children:[a,N&&Nr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return Ji("div",{className:"inline-flex flex-col",children:[Ji("label",{className:ye,onClick:ue,children:[Nr("input",{ref:G,type:"checkbox",role:"switch",id:Y,name:P,value:D,checked:X,onChange:le,onClick:ne,disabled:c||z,readOnly:g,required:N,"aria-checked":X,"aria-invalid":ie,"aria-required":N,"aria-describedby":l||s?$:void 0,"aria-errormessage":l?$:void 0,"aria-busy":z,"aria-disabled":c||z,className:"sr-only peer",...E}),Ji("span",{className:he,"aria-hidden":"true",children:[w&&Nr("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-100":"opacity-0"}`,children:w}),Nr("span",{className:ae,children:J()}),p&&Nr("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-0":"opacity-100"}`,children:p})]}),O()]}),Nr($e,{id:$,helperText:s,errorMessage:l,sizeClassName:q.helper,className:k})]})}import{jsx as vu}from"react/jsx-runtime";function lt({width:e=16,height:t=16,className:r="",...n}){return vu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:vu("path",{d:"m6 9 6 6 6-6"})})}import{jsx as yu}from"react/jsx-runtime";function Yt({width:e=16,height:t=16,className:r="",...n}){return yu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:yu("path",{d:"m15 18-6-6 6-6"})})}import{jsx as wu}from"react/jsx-runtime";function Wt({width:e=16,height:t=16,className:r="",...n}){return wu("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:wu("path",{d:"m9 18 6-6-6-6"})})}import{jsx as Qi,jsxs as Ap}from"react/jsx-runtime";function Cu({width:e=16,height:t=16,className:r="",...n}){return Ap("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Qi("path",{d:"M8 2v4"}),Qi("path",{d:"M16 2v4"}),Qi("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),Qi("path",{d:"M3 10h18"})]})}import{jsx as ku,jsxs as Op}from"react/jsx-runtime";function Su({width:e=16,height:t=16,className:r="",...n}){return Op("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[ku("circle",{cx:"12",cy:"12",r:"10"}),ku("polyline",{points:"12 6 12 12 16 14"})]})}import{jsx as Tu,jsxs as Gp}from"react/jsx-runtime";function Gr({width:e=16,height:t=16,className:r="",...n}){return Gp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Tu("path",{d:"m11 17-5-5 5-5"}),Tu("path",{d:"m18 17-5-5 5-5"})]})}import{jsx as Du,jsxs as Up}from"react/jsx-runtime";function Ur({width:e=16,height:t=16,className:r="",...n}){return Up("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Du("path",{d:"m6 17 5-5-5-5"}),Du("path",{d:"m13 17 5-5-5-5"})]})}import{jsx as or,jsxs as Yp}from"react/jsx-runtime";function jp(e){return Yp("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[or("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),or("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),or("path",{d:"M24 38L16 32L40 22L48 28L24 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M72 38L80 32L56 22L48 28L72 38Z",className:"fill-primary-100/80 dark:fill-primary-950/70 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M24 38L48 28V52L24 62V38Z",className:"fill-primary-300/80 dark:fill-primary-900/80 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M72 38L48 28V52L72 62V38Z",className:"fill-primary-300/60 dark:fill-primary-900/60 stroke-primary-300/40 dark:stroke-primary-700/40",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M48 52L72 62L48 72L24 62L48 52Z",className:"fill-primary-400/40 dark:fill-primary-950/90 stroke-primary-400/30 dark:stroke-primary-700/30",strokeWidth:"1",strokeLinejoin:"round"}),or("path",{d:"M24 38V64L48 76V50L24 38Z",className:"fill-primary-100 dark:fill-primary-900/50 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),or("path",{d:"M72 38V64L48 76V50L72 38Z",className:"fill-primary-200/90 dark:fill-primary-800/60 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"1.8",strokeLinejoin:"round"}),or("path",{d:"M24 38L48 50L38 60L14 48L24 38Z",className:"fill-primary-50 dark:fill-primary-950/90 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"}),or("path",{d:"M72 38L48 50L58 60L82 48L72 38Z",className:"fill-primary-100/90 dark:fill-primary-900/80 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"1.5",strokeLinejoin:"round"})]})}var Os=jp;import{jsx as Pr,jsxs as Ru}from"react/jsx-runtime";function Wp(e){return Ru("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[Pr("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),Pr("rect",{x:"32",y:"24",width:"44",height:"56",rx:"6",className:"fill-white dark:fill-neutral-900 stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2"}),Pr("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Pr("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Pr("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),Ru("g",{transform:"translate(48, 38)",children:[Pr("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),Pr("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),Pr("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),Pr("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var Gs=Wp;import{jsx as hn,jsxs as _p}from"react/jsx-runtime";function Kp(e){return _p("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[hn("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),hn("circle",{cx:"60",cy:"52",r:"32",className:"fill-error-50 dark:fill-error-950/40 stroke-error-200 dark:stroke-error-800",strokeWidth:"2"}),hn("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),hn("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),hn("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),hn("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),hn("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var Us=Kp;import{jsx as _n,jsxs as qp}from"react/jsx-runtime";function Xp(e){return qp("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[_n("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),_n("path",{d:"M24 40C24 36.69 26.69 34 30 34H48L56 42H90C93.31 42 96 44.69 96 48V78C96 81.31 93.31 84 90 84H30C26.69 84 24 81.31 24 78V40Z",className:"fill-primary-200/70 dark:fill-primary-900/60 stroke-primary-300 dark:stroke-primary-700",strokeWidth:"2"}),_n("rect",{x:"36",y:"30",width:"48",height:"40",rx:"4",className:"fill-white dark:fill-neutral-900 stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"1.5"}),_n("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),_n("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),_n("path",{d:"M24 52H96V80C96 83.31 93.31 86 90 86H30C26.69 86 24 83.31 24 80V52Z",className:"fill-primary-300/80 dark:fill-primary-800/70 stroke-primary-400 dark:stroke-primary-600",strokeWidth:"2"})]})}var js=Xp;import{jsx as ea,jsxs as Jp}from"react/jsx-runtime";function Zp(e){return Jp("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[ea("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),ea("path",{d:"M12 24L32 14L52 24L32 34L12 24Z",className:"fill-neutral-100 dark:fill-neutral-800 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ea("path",{d:"M12 24V40L32 50V34L12 24Z",className:"fill-neutral-200 dark:fill-neutral-700 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"}),ea("path",{d:"M52 24V40L32 50V34L52 24Z",className:"fill-neutral-300 dark:fill-neutral-600 stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinejoin:"round"})]})}var Ys=Zp;import{jsx as ta,jsxs as Qp}from"react/jsx-runtime";function Xn({width:e=20,height:t=20,className:r="",...n}){return Qp("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[ta("circle",{cx:"11",cy:"11",r:"8"}),ta("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),ta("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),ta("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Ws,jsxs as eg}from"react/jsx-runtime";function qn({width:e=20,height:t=20,className:r="",...n}){return eg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Ws("circle",{cx:"11",cy:"11",r:"8"}),Ws("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),Ws("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}import{jsx as Nu,jsxs as tg}from"react/jsx-runtime";function jr({width:e=20,height:t=20,className:r="",...n}){return tg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Nu("path",{d:"M21 2v6h-6"}),Nu("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}import{jsx as Pu,jsxs as rg}from"react/jsx-runtime";function Zn({width:e=20,height:t=20,className:r="",...n}){return rg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Pu("path",{d:"M3 2v6h6"}),Pu("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}import{jsx as Jn,jsxs as ng}from"react/jsx-runtime";function Qn({width:e=20,height:t=20,className:r="",...n}){return ng("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Jn("path",{d:"m3 7 5 5-5 5V7z"}),Jn("path",{d:"m21 7-5 5 5 5V7z"}),Jn("path",{d:"M12 20v2"}),Jn("path",{d:"M12 14v2"}),Jn("path",{d:"M12 8v2"}),Jn("path",{d:"M12 2v2"})]})}import{jsx as Ks,jsxs as og}from"react/jsx-runtime";function br({width:e=20,height:t=20,className:r="",...n}){return og("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Ks("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),Ks("polyline",{points:"7 10 12 15 17 10"}),Ks("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}import{jsx as zu,jsxs as ig}from"react/jsx-runtime";function Lt({width:e=20,height:t=20,className:r="",...n}){return ig("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[zu("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),zu("path",{d:"M3 3v5h5"})]})}import{jsx as _s,jsxs as ag}from"react/jsx-runtime";function ra({width:e=20,height:t=20,className:r="",...n}){return ag("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[_s("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),_s("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),_s("polyline",{points:"21 15 16 10 5 21"})]})}import{jsx as Iu,jsxs as sg}from"react/jsx-runtime";function na({width:e=16,height:t=16,className:r="",...n}){return sg("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Iu("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),Iu("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}import{jsx as oa,jsxs as lg}from"react/jsx-runtime";function ir({width:e=16,height:t=16,className:r="",...n}){return lg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[oa("polyline",{points:"3 6 5 6 21 6"}),oa("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),oa("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),oa("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}import{jsx as Mu}from"react/jsx-runtime";function Nt({width:e=24,height:t=24,className:r="",...n}){return Mu("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...n,children:Mu("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"})})}import{jsx as ia,jsxs as cg}from"react/jsx-runtime";function aa({width:e=24,height:t=24,variant:r="solid",className:n="",...o}){return r==="outline"?cg("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,...o,children:[ia("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),ia("circle",{cx:"12",cy:"7",r:"4"})]}):ia("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,...o,children:ia("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}import{jsx as Fu,jsxs as ug}from"react/jsx-runtime";function sa({width:e=16,height:t=16,className:r="",...n}){return ug("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Fu("path",{d:"m7 15 5 5 5-5"}),Fu("path",{d:"m7 9 5-5 5 5"})]})}import{jsx as Eu,jsxs as dg}from"react/jsx-runtime";function la({width:e=16,height:t=16,className:r="",...n}){return dg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[Eu("path",{d:"m5 12 7-7 7 7"}),Eu("path",{d:"M12 19V5"})]})}import{jsx as $u,jsxs as fg}from"react/jsx-runtime";function ca({width:e=16,height:t=16,className:r="",...n}){return fg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[$u("path",{d:"M12 5v14"}),$u("path",{d:"m19 12-7 7-7-7"})]})}import{jsx as zr,jsxs as pg}from"react/jsx-runtime";function ua({width:e=16,height:t=16,className:r="",...n}){return pg("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[zr("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),zr("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),zr("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),zr("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),zr("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),zr("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),zr("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),zr("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),zr("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}import{cloneElement as mg,isValidElement as Xs,useState as Au}from"react";import{useFloating as bg,autoUpdate as hg,offset as xg,flip as vg,shift as yg,arrow as wg,useHover as Cg,useFocus as kg,useDismiss as Sg,useRole as Tg,useInteractions as Dg,useMergeRefs as Rg,FloatingPortal as Ng,FloatingArrow as Pg}from"@floating-ui/react";import{useTransitionStyles as gg}from"@floating-ui/react";function et(e,t={}){let{duration:r=150,offset:n=4,scale:o=.96,animated:i=!0}=t;return gg(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`})})}var Lu={xs:{box:"px-2 py-0.5 text-[11px] leading-tight font-medium",arrowWidth:8,arrowHeight:4},sm:{box:"px-2.5 py-1 text-xs leading-tight font-medium",arrowWidth:10,arrowHeight:5},md:{box:"px-3 py-1.5 text-xs leading-normal font-medium",arrowWidth:12,arrowHeight:6},lg:{box:"px-3.5 py-2 text-sm leading-normal font-medium",arrowWidth:14,arrowHeight:7},xl:{box:"px-4 py-2.5 text-base leading-normal font-semibold",arrowWidth:16,arrowHeight:8}},Bu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hu={filled:{primary:"bg-primary-500 text-neutral-white border border-transparent shadow-md",secondary:"bg-secondary-500 text-neutral-white border border-transparent shadow-md",error:"bg-error-500 text-neutral-white border border-transparent shadow-md",success:"bg-success-500 text-neutral-white border border-transparent shadow-md",warning:"bg-warning-500 text-neutral-950 border border-transparent shadow-md",info:"bg-info-500 text-neutral-white border border-transparent shadow-md",neutral:"bg-neutral-800 text-neutral-white border border-transparent shadow-md"},soft:{primary:"bg-primary-100 text-primary-800 border border-primary-200 shadow-sm",secondary:"bg-secondary-100 text-secondary-800 border border-secondary-200 shadow-sm",error:"bg-error-100 text-error-800 border border-error-200 shadow-sm",success:"bg-success-100 text-success-800 border border-success-200 shadow-sm",warning:"bg-warning-100 text-warning-800 border border-warning-200 shadow-sm",info:"bg-info-100 text-info-800 border border-info-200 shadow-sm",neutral:"bg-neutral-100 text-neutral-800 border border-neutral-200 shadow-sm"},outline:{primary:"bg-neutral-white text-primary-700 border border-primary-400 shadow-md",secondary:"bg-neutral-white text-secondary-800 border border-secondary-400 shadow-md",error:"bg-neutral-white text-error-700 border border-error-400 shadow-md",success:"bg-neutral-white text-success-700 border border-success-400 shadow-md",warning:"bg-neutral-white text-warning-800 border border-warning-400 shadow-md",info:"bg-neutral-white text-info-800 border border-info-400 shadow-md",neutral:"bg-neutral-white text-neutral-800 border border-neutral-300 shadow-md"}},Vu={filled:{primary:"fill-primary-500",secondary:"fill-secondary-500",error:"fill-error-500",success:"fill-success-500",warning:"fill-warning-500",info:"fill-info-500",neutral:"fill-neutral-800"},soft:{primary:"fill-primary-100 stroke-primary-200",secondary:"fill-secondary-100 stroke-secondary-200",error:"fill-error-100 stroke-error-200",success:"fill-success-100 stroke-success-200",warning:"fill-warning-100 stroke-warning-200",info:"fill-info-100 stroke-info-200",neutral:"fill-neutral-100 stroke-neutral-200"},outline:{primary:"fill-neutral-white stroke-primary-400",secondary:"fill-neutral-white stroke-secondary-400",error:"fill-neutral-white stroke-error-400",success:"fill-neutral-white stroke-success-400",warning:"fill-neutral-white stroke-warning-400",info:"fill-neutral-white stroke-info-400",neutral:"fill-neutral-white stroke-neutral-300"}};import{Fragment as Ig,jsx as da,jsxs as Ou}from"react/jsx-runtime";function zg({children:e,ref:t,disabled:r,className:n="",...o}){let i=Xs(e)?e.props?.ref:void 0,a=Rg([t,i]);if(!Xs(e))return null;let s=e.props||{};return mg(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function Ho({content:e,children:t,placement:r="top",variant:n,color:o,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:h=!0,shift:d=!0,delay:w={open:200,close:150},disabled:p=!1,animated:m=!0,animationDuration:x=150,open:y,defaultOpen:b=!1,onOpenChange:k,className:T="",arrowClassName:v="",zIndex:u=Qe.TOOLTIP}){let[c,g]=Au(b),[f,S]=Au(null),D=y!==void 0,R=D?y:c,P=q=>{D||g(q),k?.(q)},I=[xg(l),h?vg():void 0,d?yg({padding:8}):void 0,s?wg({element:f}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:N},floatingStyles:M,context:z,placement:H}=bg({placement:r,open:R&&!p,onOpenChange:P,whileElementsMounted:hg,transform:!1,middleware:I}),V=Cg(z,{move:!1,delay:w,enabled:!p}),Y=kg(z,{enabled:!p}),$=Sg(z),F=Tg(z,{role:"tooltip"}),{getReferenceProps:G,getFloatingProps:A}=Dg([V,Y,$,F]),{isMounted:U,styles:B}=et(z,{duration:x,animated:m}),X=C(i,Lu,"md"),le=C(a,Bu,"md"),ne=n==="other"?"":C(o,C(n,Hu,"filled"),"neutral"),ue=n==="other"?"":C(o,C(n,Vu,"filled"),"neutral"),ie=["select-none pointer-events-none max-w-xs break-words",X.box,le,ne,T].filter(Boolean).join(" "),Q=G();return Ou(Ig,{children:[Xs(t)?da(zg,{ref:E,disabled:p,...Q,children:t}):da("span",{ref:E,...Q,children:t}),da(Ng,{children:U&&!p&&e&&Ou("div",{ref:N,style:{...M,...m?B:{},zIndex:u},className:ie,"data-state":R?"open":"closed","data-placement":H,...A(),children:[e,s&&da(Pg,{ref:S,context:z,width:X.arrowWidth,height:X.arrowHeight,strokeWidth:n==="outline"||n==="soft"?1:0,className:[ue,v].filter(Boolean).join(" ")})]})})]})}import{useId as Fg,useState as Eg}from"react";import*as eo from"@radix-ui/react-slider";var xn={xs:{trackHorizontal:"h-1",trackVertical:"w-1",thumb:"w-3 h-3",thumbSizePx:12,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-[11px]",markText:"text-[10px]",gap:"gap-1",stepDot:"w-1 h-1",tooltipSize:"xs"},sm:{trackHorizontal:"h-1.5",trackVertical:"w-1.5",thumb:"w-4 h-4",thumbSizePx:16,label:"text-xs font-medium",value:"text-xs font-semibold",helper:"text-xs",markText:"text-[11px]",gap:"gap-1.5",stepDot:"w-1.5 h-1.5",tooltipSize:"xs"},md:{trackHorizontal:"h-2",trackVertical:"w-2",thumb:"w-5 h-5",thumbSizePx:20,label:"text-sm font-medium",value:"text-sm font-semibold",helper:"text-xs",markText:"text-xs",gap:"gap-2",stepDot:"w-2 h-2",tooltipSize:"sm"},lg:{trackHorizontal:"h-2.5",trackVertical:"w-2.5",thumb:"w-6 h-6",thumbSizePx:24,label:"text-base font-medium",value:"text-base font-semibold",helper:"text-sm",markText:"text-xs",gap:"gap-2.5",stepDot:"w-2.5 h-2.5",tooltipSize:"md"},xl:{trackHorizontal:"h-3",trackVertical:"w-3",thumb:"w-7 h-7",thumbSizePx:28,label:"text-lg font-medium",value:"text-lg font-semibold",helper:"text-sm",markText:"text-sm",gap:"gap-3",stepDot:"w-3 h-3",tooltipSize:"md"}},qs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Gu={filled:{primary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},soft:{primary:{track:"bg-primary-100 dark:bg-primary-950/40",filler:"bg-primary-400 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-400 text-primary-500 focus-visible:ring-2 focus-visible:ring-primary-400/50 shadow-sm"},secondary:{track:"bg-secondary-100 dark:bg-secondary-950/40",filler:"bg-secondary-400 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-400 text-secondary-500 focus-visible:ring-2 focus-visible:ring-secondary-400/50 shadow-sm"},error:{track:"bg-error-100 dark:bg-error-950/40",filler:"bg-error-400 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-400 text-error-500 focus-visible:ring-2 focus-visible:ring-error-400/50 shadow-sm"},success:{track:"bg-success-100 dark:bg-success-950/40",filler:"bg-success-400 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-400 text-success-500 focus-visible:ring-2 focus-visible:ring-success-400/50 shadow-sm"},warning:{track:"bg-warning-100 dark:bg-warning-950/40",filler:"bg-warning-400 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-400 text-warning-500 focus-visible:ring-2 focus-visible:ring-warning-400/50 shadow-sm"},info:{track:"bg-info-100 dark:bg-info-950/40",filler:"bg-info-400 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-400 text-info-500 focus-visible:ring-2 focus-visible:ring-info-400/50 shadow-sm"},neutral:{track:"bg-neutral-200 dark:bg-neutral-800",filler:"bg-neutral-600 dark:bg-neutral-400",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-600 dark:border-neutral-400 text-neutral-600 focus-visible:ring-2 focus-visible:ring-neutral-400/50 shadow-sm"}},outline:{primary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-primary-500 dark:bg-primary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-primary-500 text-primary-600 focus-visible:ring-2 focus-visible:ring-primary-500/50 shadow-sm"},secondary:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-secondary-500 dark:bg-secondary-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-secondary-500 text-secondary-600 focus-visible:ring-2 focus-visible:ring-secondary-500/50 shadow-sm"},error:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-error-500 dark:bg-error-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-error-500 text-error-600 focus-visible:ring-2 focus-visible:ring-error-500/50 shadow-sm"},success:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-success-500 dark:bg-success-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-success-500 text-success-600 focus-visible:ring-2 focus-visible:ring-success-500/50 shadow-sm"},warning:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-warning-500 dark:bg-warning-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-warning-500 text-warning-600 focus-visible:ring-2 focus-visible:ring-warning-500/50 shadow-sm"},info:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-info-500 dark:bg-info-500",thumb:"bg-white dark:bg-neutral-900 border-2 border-info-500 text-info-600 focus-visible:ring-2 focus-visible:ring-info-500/50 shadow-sm"},neutral:{track:"bg-transparent border border-neutral-300 dark:border-neutral-700",filler:"bg-neutral-800 dark:bg-neutral-200",thumb:"bg-white dark:bg-neutral-900 border-2 border-neutral-800 dark:border-neutral-200 text-neutral-800 dark:text-neutral-200 focus-visible:ring-2 focus-visible:ring-neutral-500/50 shadow-sm"}},other:{primary:{track:"",filler:"",thumb:""},secondary:{track:"",filler:"",thumb:""},error:{track:"",filler:"",thumb:""},success:{track:"",filler:"",thumb:""},warning:{track:"",filler:"",thumb:""},info:{track:"",filler:"",thumb:""},neutral:{track:"",filler:"",thumb:""}}};import{useState as Zs}from"react";import*as Uu from"@radix-ui/react-slider";import{jsx as fa}from"react/jsx-runtime";function Vo({id:e,thumbIdx:t,value:r,orientation:n,size:o,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:h,label:d,helperId:w,tooltipMode:p="none",tooltipPlacement:m,formatTooltip:x}){let{isLoading:y=!1,showSpinner:b=!1,disabled:k=!1,readOnly:T=!1,isRequired:v=!1,isInvalid:u=!1,isRange:c=!1,hasDescription:g=!1}=h??{},f=C(o,xn,"md"),[S,D]=Zs(!1),[R,P]=Zs(!1),[I,E]=Zs(!1),N;p==="always"?N=!0:p==="active"?N=I||R:p==="hover"?N=S||I||R:p==="none"&&(N=!1);let M=m||(n==="vertical"?"right":"top"),z=x?x(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=fa(Uu.Thumb,{id:`${e}-thumb-${t}`,tabIndex:k||y?-1:0,"aria-busy":y,"aria-disabled":k||y,"aria-readonly":T,"aria-required":v,"aria-invalid":u,"aria-errormessage":u?w:void 0,"aria-describedby":g?w:void 0,"aria-valuetext":H,"aria-orientation":n,"aria-label":typeof d=="string"?`${d} ${c?t===0?"minimum":"maximum":""}`:`Slider ${c?t===0?"min":"max":""}`,onFocus:()=>P(!0),onBlur:()=>P(!1),onPointerEnter:()=>D(!0),onPointerLeave:()=>D(!1),onPointerDown:()=>E(!0),onPointerUp:()=>E(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${k||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${f.thumb} ${i} ${a} ${I&&!k&&!y?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:y&&b&&fa("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:fa(Ne,{className:"size-full animate-spin text-current"})})});return p!=="none"?fa(Ho,{content:z,placement:M,open:N,size:f.tooltipSize,className:l,disabled:k||y,children:V}):V}function Js(e,t,r){return Math.min(Math.max(e,t),r)}function Ao(e,t,r){return r<=t?0:Js((e-t)/(r-t)*100,0,100)}import{Fragment as Mg,jsx as pa}from"react/jsx-runtime";function ga({marks:e,min:t,max:r,step:n,orientation:o,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&n>0){let h=Math.floor((r-t)/n);if(h<=20)for(let d=0;d<=h;d++){let w=t+d*n;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,xn,"md");return pa("div",{className:`relative w-full ${o==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(h=>{let d=Ao(h.value,t,r);return pa("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${a}`,style:o==="vertical"?{bottom:`${d}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${d}%`,transform:"translateX(-50%)"},children:h.label??h.value},h.value)})})}function ma({showSteps:e,min:t,max:r,step:n,orientation:o,size:i,isRange:a,currentValues:s}){if(!e||n<=0)return null;let l=Math.floor((r-t)/n);if(l>100)return null;let h=C(i,xn,"md"),d=[];for(let w=0;w<=l;w++){let p=t+w*n,m=Ao(p,t,r),x=a?p>=(s[0]??t)&&p<=(s[1]??r):p<=(s[0]??t);d.push(pa("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${h.stepDot} ${x?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:o==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${p}`))}return pa(Mg,{children:d})}import{Fragment as ju,jsx as Bt,jsxs as vn}from"react/jsx-runtime";function Oo({config:e,value:t,defaultValue:r,min:n=0,max:o=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:h,color:d,radius:w,thumbRadius:p,orientation:m="horizontal",label:x,labelPlacement:y="top",formatValue:b,showTooltip:k="none",tooltipPlacement:T,formatTooltip:v,marks:u=!1,startContent:c,endContent:g,disabled:f=!1,readOnly:S=!1,helperText:D,errorMessage:R,name:P,id:I,onChange:E,onChangeEnd:N,className:M="",wrapperClassName:z="",trackWrapperClassName:H="",trackClassName:V="",fillerClassName:Y="",thumbClassName:$="",labelClassName:F="",valueClassName:G="",helperClassName:A="",tooltipClassName:U="",markClassName:B="",ref:X}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,showSteps:Q=!1,showValue:q=!1,isFullWidth:ge=!0}=e??{},ke=Fg(),L=I||ke,te=`${L}-helper`,Z=!!(ne||R),he=Z?"error":d,ae=Array.isArray(t??r),ve=t!==void 0,[Se,ye]=Eg(()=>r!==void 0?Array.isArray(r)?r:[r]:ae?[n,o]:[n]),J=ve?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,O=ve?Array.isArray(t)?[t[0]??n,t[1]??o]:[t??n,0]:ae?[Se[0]??n,Se[1]??o]:[Se[0]??n,0],W=j=>{if(f||S||ue)return;ve||ye(j);let Ce=ae?[j[0]??n,j[1]??o]:j[0]??n;E?.(Ce)},we=j=>{if(f||S||ue)return;let Ce=ae?[j[0]??n,j[1]??o]:j[0]??n;N?.(Ce)},fe=C(l,xn,"md"),se=C(w,qs,"full"),me=C(p,qs,"full"),De=h==="other"?{track:"",filler:"",thumb:""}:C(he,C(h,Gu,"filled"),"primary"),xe=De.track,re=De.filler,de=De.thumb,ce=()=>{if(!x&&!q)return null;let j="";b?j=b(ae?O:O[0]):ae?j=`${O[0]} - ${O[1]}`:j=`${O[0]}`;let Ce=Z?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return vn("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[x&&vn("label",{htmlFor:`${L}-thumb-0`,className:`font-medium ${Ce} ${fe.label} ${f?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${F}`,children:[x,le&&Bt("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),q&&Bt("span",{className:`select-none text-neutral-700 dark:text-neutral-300 ${fe.value} ${G}`,"aria-hidden":"true",children:j})]})},ee=ae?[O[0],O[1]]:[O[0]];return vn("div",{ref:X,className:`group/field flex flex-col ${ge?"w-full":"inline-flex"} ${f?"opacity-60 cursor-not-allowed":""} ${z||M}`,children:[y==="top"&&ce(),vn("div",{className:`flex items-center ${fe.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[y==="left"&&ce(),c&&Bt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:c}),vn(eo.Root,{min:n,max:o,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:f||ue||S,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:W,onValueCommit:we,className:`relative flex items-center select-none touch-none ${m==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${f||S?"cursor-not-allowed":"cursor-pointer"}`,children:[vn(eo.Track,{className:`relative overflow-hidden ${m==="vertical"?`${fe.trackVertical} h-full`:`${fe.trackHorizontal} w-full`} ${se} ${xe} ${V}`,children:[Bt(ma,{showSteps:Q,min:n,max:o,step:i,orientation:m,size:l||"md",isRange:ae,currentValues:O}),Bt(eo.Range,{className:`absolute ${re} ${se} ${Y}`})]}),ee.map((j,Ce)=>{let Ee=ae?Ce===0?`${L}-thumb-min`:`${L}-thumb-max`:`${L}-thumb-single`;return Bt(Vo,{id:L,thumbIdx:Ce,value:j,orientation:m,size:l||"md",thumbRadiusClass:me,thumbThemeStyles:de,thumbClassName:$,tooltipClassName:U,state:{isLoading:ue,showSpinner:ie,disabled:f,readOnly:S,isRequired:le,isInvalid:Z,isRange:ae,hasDescription:!!(Z||D)},label:x,helperId:te,tooltipMode:k,tooltipPlacement:T,formatTooltip:v},Ee)})]}),g&&Bt("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:g}),y==="right"&&ce()]}),Bt(ga,{marks:u,min:n,max:o,step:i,orientation:m,size:l||"md",markClassName:B}),Bt($e,{id:te,helperText:D,errorMessage:R,sizeClassName:fe.helper,className:A}),P&&Bt(ju,{children:ae?vn(ju,{children:[Bt("input",{type:"hidden",name:`${P}[0]`,value:O[0],disabled:f}),Bt("input",{type:"hidden",name:`${P}[1]`,value:O[1],disabled:f})]}):Bt("input",{type:"hidden",name:P,value:O[0],disabled:f})})]})}import{useState as $g,useMemo as Zu,useCallback as Lg}from"react";var ba={sm:{header:"py-2.5 px-3.5 text-sm",content:"px-3.5 pb-3 text-sm text-neutral-600",title:"font-medium leading-snug",description:"text-xs text-neutral-500 mt-0.5",icon:"size-4",startIcon:"size-4",gap:"gap-2.5"},md:{header:"py-3.5 px-4 text-base",content:"px-4 pb-4 text-sm text-neutral-600",title:"font-semibold leading-snug",description:"text-xs text-neutral-500 mt-1",icon:"size-4.5",startIcon:"size-4.5",gap:"gap-3"},lg:{header:"py-4.5 px-5 text-lg",content:"px-5 pb-5 text-base text-neutral-600",title:"font-semibold leading-snug",description:"text-sm text-neutral-500 mt-1",icon:"size-5",startIcon:"size-5",gap:"gap-3.5"}},ha={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},Yu={outlined:{primary:"border border-primary-200 bg-white divide-y divide-primary-100 overflow-hidden",secondary:"border border-secondary-200 bg-white divide-y divide-secondary-100 overflow-hidden",neutral:"border border-neutral-200 bg-white divide-y divide-neutral-200 overflow-hidden",error:"border border-error-200 bg-white divide-y divide-error-100 overflow-hidden",success:"border border-success-200 bg-white divide-y divide-success-100 overflow-hidden",warning:"border border-warning-200 bg-white divide-y divide-warning-100 overflow-hidden",info:"border border-info-200 bg-white divide-y divide-info-100 overflow-hidden"},filled:{primary:"bg-primary-50/40 border border-primary-100 divide-y divide-primary-100/80 overflow-hidden",secondary:"bg-secondary-50/40 border border-secondary-100 divide-y divide-secondary-100/80 overflow-hidden",neutral:"bg-neutral-50 border border-neutral-200/60 divide-y divide-neutral-200/60 overflow-hidden",error:"bg-error-50/40 border border-error-100 divide-y divide-error-100/80 overflow-hidden",success:"bg-success-50/40 border border-success-100 divide-y divide-success-100/80 overflow-hidden",warning:"bg-warning-50/40 border border-warning-100 divide-y divide-warning-100/80 overflow-hidden",info:"bg-info-50/40 border border-info-100 divide-y divide-info-100/80 overflow-hidden"},separated:{primary:"bg-transparent border-0 space-y-3",secondary:"bg-transparent border-0 space-y-3",neutral:"bg-transparent border-0 space-y-3",error:"bg-transparent border-0 space-y-3",success:"bg-transparent border-0 space-y-3",warning:"bg-transparent border-0 space-y-3",info:"bg-transparent border-0 space-y-3"},ghost:{primary:"bg-transparent border-0 divide-y divide-neutral-200/70",secondary:"bg-transparent border-0 divide-y divide-neutral-200/70",neutral:"bg-transparent border-0 divide-y divide-neutral-200/70",error:"bg-transparent border-0 divide-y divide-neutral-200/70",success:"bg-transparent border-0 divide-y divide-neutral-200/70",warning:"bg-transparent border-0 divide-y divide-neutral-200/70",info:"bg-transparent border-0 divide-y divide-neutral-200/70"}},Wu={outlined:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},filled:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},ghost:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""},separated:{primary:"bg-white border border-primary-200 shadow-xs overflow-hidden",secondary:"bg-white border border-secondary-200 shadow-xs overflow-hidden",neutral:"bg-white border border-neutral-200 shadow-xs overflow-hidden",error:"bg-white border border-error-200 shadow-xs overflow-hidden",success:"bg-white border border-success-200 shadow-xs overflow-hidden",warning:"bg-white border border-warning-200 shadow-xs overflow-hidden",info:"bg-white border border-info-200 shadow-xs overflow-hidden"}},Ku={outlined:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},filled:{primary:"bg-primary-50/80",secondary:"bg-secondary-50/80",neutral:"bg-neutral-100/70",error:"bg-error-50/80",success:"bg-success-50/80",warning:"bg-warning-50/80",info:"bg-info-50/80"},separated:{primary:"bg-primary-50/40",secondary:"bg-secondary-50/40",neutral:"bg-neutral-50/80",error:"bg-error-50/40",success:"bg-success-50/40",warning:"bg-warning-50/40",info:"bg-info-50/40"},ghost:{primary:"bg-transparent",secondary:"bg-transparent",neutral:"bg-transparent",error:"bg-transparent",success:"bg-transparent",warning:"bg-transparent",info:"bg-transparent"}},_u={primary:{focusRing:"focus-visible:ring-primary-500",title:"text-primary-700",activeIndicator:"text-primary-600"},secondary:{focusRing:"focus-visible:ring-secondary-500",title:"text-secondary-700",activeIndicator:"text-secondary-600"},neutral:{focusRing:"focus-visible:ring-neutral-500",title:"text-neutral-900",activeIndicator:"text-neutral-700"},error:{focusRing:"focus-visible:ring-error-500",title:"text-error-700",activeIndicator:"text-error-600"},success:{focusRing:"focus-visible:ring-success-500",title:"text-success-700",activeIndicator:"text-success-600"},warning:{focusRing:"focus-visible:ring-warning-500",title:"text-warning-700",activeIndicator:"text-warning-600"},info:{focusRing:"focus-visible:ring-info-500",title:"text-info-700",activeIndicator:"text-info-600"}};import{createContext as Xu,useContext as qu}from"react";var Qs=Xu(null),el=Xu(null);function Yr(){let e=qu(Qs);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function to(){let e=qu(el);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}import{jsx as Qu}from"react/jsx-runtime";function Ju(e){return e==null?[]:Array.isArray(e)?e:[e]}function tl({activeKey:e,defaultActiveKey:t,onChange:r,accordion:n=!1,size:o="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:h,destroyInactivePanel:d=!1,className:w="",style:p,children:m,ref:x,...y}){let b=e!==void 0,[k,T]=$g(()=>Ju(t)),v=Zu(()=>new Set(b?Ju(e):k),[b,e,k]),u=Lg(D=>{let R,P=v.has(D);if(n)R=P?[]:[D];else{let I=Array.from(v);P?R=I.filter(E=>E!==D):R=[...I,D]}b||T(R),r?.(n?R[0]??"":R)},[n,v,b,r]),c=i==="other"?"":C(a,C(i,Yu,"outlined"),"primary"),g=i!=="separated"&&i!=="ghost"?C(s,ha,"md"):"",f=["w-full transition-colors",c,g,w].filter(Boolean).join(" "),S=Zu(()=>({activeKeys:v,handleToggle:u,accordion:n,size:o,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:h,destroyInactivePanel:d}),[v,u,n,o,i,a,s,l,h,d]);return Qu(Qs.Provider,{value:S,children:Qu("div",{ref:x,className:f,style:p,...y,children:m})})}import{useId as Bg,useMemo as Hg}from"react";import{jsx as yn,jsxs as Go}from"react/jsx-runtime";function Uo({startIcon:e,description:t,extra:r,showArrow:n=!0,children:o,className:i="",ref:a,onClick:s,onKeyDown:l,...h}){let{size:d,variant:w,color:p,expandIconPosition:m,expandIcon:x}=Yr(),{isActive:y,disabled:b,headerId:k,panelId:T,onToggle:v}=to(),u=C(d,ba,"md"),c=C(p,_u,"primary"),g=w==="other"?"":C(p,C(w,Ku,"outlined"),"primary"),f=n&&m!=="none",S=()=>f?typeof x=="function"?yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x({isActive:y,disabled:b})}):x?yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:x}):yn("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${y?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:yn(lt,{className:u.icon})}):null,D=["w-full flex items-center justify-between transition-colors duration-150 select-none",u.header,u.gap,b?"cursor-not-allowed opacity-60":g,i].filter(Boolean).join(" "),R=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",u.gap,b?"cursor-not-allowed pointer-events-none":`${c.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return Go("div",{className:D,children:[Go("button",{ref:a,id:k,type:"button","aria-expanded":y,"aria-controls":T,"aria-disabled":b?!0:void 0,disabled:b,onClick:P=>{v(),s?.(P)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),v()),l?.(P)},className:R,...h,children:[m==="left"&&S(),Go("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&yn("span",{className:`inline-flex items-center justify-center shrink-0 ${c.activeIndicator} ${u.startIcon}`,"aria-hidden":"true",children:e}),Go("div",{className:"flex flex-col min-w-0 flex-1",children:[yn("span",{className:`truncate ${u.title} ${c.title}`,children:o}),t&&yn("span",{className:`line-clamp-2 ${u.description}`,children:t})]})]}),m==="right"&&!r&&S()]}),r&&Go("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&S()]})]})}import{jsx as rl}from"react/jsx-runtime";function jo({destroyInactivePanel:e,children:t,className:r="",style:n,ref:o,...i}){let{size:a,destroyInactivePanel:s}=Yr(),{isActive:l,headerId:h,panelId:d}=to(),w=C(a,ba,"md");return rl("div",{ref:o,id:d,role:"region","aria-labelledby":h,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:n,...i,children:rl("div",{className:"overflow-hidden",children:(!(e??s)||l)&&rl("div",{className:`${w.content} ${r}`,children:t})})})}import{Fragment as Vg,jsx as xa,jsxs as Ag}from"react/jsx-runtime";function nl({value:e,label:t,description:r,startIcon:n,extra:o,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:h,className:d="",children:w,ref:p,...m}){let x=Bg(),{activeKeys:y,handleToggle:b,variant:k,color:T,radius:v}=Yr(),u=y.has(e),c=`collapse-header-${e??x}`,g=`collapse-panel-${e??x}`,f=Hg(()=>({value:e,isActive:u,disabled:i,headerId:c,panelId:g,onToggle:()=>!i&&b(e)}),[e,u,i,c,g,b]),S=k==="separated"?C(v,ha,"md"):"",R=["group",k==="other"?"":C(T,C(k,Wu,"outlined"),"primary"),S,i?"opacity-50 cursor-not-allowed":"",d].filter(Boolean).join(" ");return xa(el.Provider,{value:f,children:xa("div",{ref:p,className:R,"data-state":u?"open":"closed",...m,children:t!==void 0?Ag(Vg,{children:[xa(Uo,{startIcon:n,description:r,extra:o,showArrow:a,className:s,children:t}),xa(jo,{destroyInactivePanel:h,className:l,children:w})]}):w})})}import{useId as Og,useState as Gg}from"react";import{jsx as ed}from"react/jsx-runtime";function ol({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:n="",children:o,ref:i,...a}){let s=Og(),l=e!==void 0,[h]=Gg(t),d=l?e:h;return ed("div",{ref:i,id:s,role:"region","aria-hidden":!d,"data-state":d?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${d?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${n}`,...a,children:ed("div",{className:"overflow-hidden",children:(!r||d)&&o})})}import{useState as Yg,useMemo as Wg,useCallback as td}from"react";import{createContext as Ug,useContext as jg}from"react";var il=Ug(null);function Wr(){let e=jg(il);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}import{jsx as rd}from"react/jsx-runtime";function wn({activeKey:e,defaultActiveKey:t,onChange:r,onClose:n,size:o="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:h="top",fullWidth:d=!1,disabled:w=!1,destroyInactiveTabPane:p=!1,className:m="",children:x,ref:y,...b}){let k=e!==void 0,[T,v]=Yg(t),u=k?e:T,c=td(P=>{k||v(P),r?.(P)},[k,r]),g=td(P=>{n?.(P)},[n]),f=Wg(()=>({activeKey:u,setActiveKey:c,size:o,variant:i,color:a,radius:s,orientation:l,placement:h,fullWidth:d,disabled:w,destroyInactiveTabPane:p,onCloseTab:g}),[u,c,o,i,a,s,l,h,d,w,p,g]),S=l==="vertical",D;S?D=h==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":D=h==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let R=["w-full",D,m].filter(Boolean).join(" ");return rd("div",{ref:y,className:R,...b,children:rd(il.Provider,{value:f,children:x})})}import{useMergeRefs as qg}from"@floating-ui/react";var nd={sm:{tab:"px-3 py-1.5 text-xs font-medium",icon:"size-3.5",gap:"gap-1.5",badge:"text-[10px] px-1.5 py-0.5 min-w-4 h-4",closeBtn:"size-3.5 -mr-1 p-0.5"},md:{tab:"px-4 py-2 text-sm font-medium",icon:"size-4",gap:"gap-2",badge:"text-xs px-2 py-0.5 min-w-5 h-5",closeBtn:"size-4 -mr-1 p-0.5"},lg:{tab:"px-5 py-2.5 text-base font-medium",icon:"size-5",gap:"gap-2.5",badge:"text-xs px-2.5 py-0.5 min-w-5.5 h-5.5",closeBtn:"size-4.5 -mr-1.5 p-0.5"}},va={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},od={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 dark:border-neutral-800 gap-1":"border-r border-neutral-200 dark:border-neutral-800 gap-1":t==="bottom"?"border-t border-neutral-200 dark:border-neutral-800 gap-2":"border-b border-neutral-200 dark:border-neutral-800 gap-2",solid:()=>"bg-neutral-100 dark:bg-neutral-800/80 p-1 gap-1",bordered:()=>"border border-neutral-200 dark:border-neutral-700/80 p-1 gap-1 bg-neutral-50/50 dark:bg-neutral-900/50",flat:()=>"bg-neutral-100/60 dark:bg-neutral-800/40 p-1 gap-1"},id={primary:{line:{active:"text-primary-700 dark:text-primary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-600 dark:hover:text-primary-300"},solid:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-primary-700 dark:text-primary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-primary-700 dark:hover:text-primary-300"}},secondary:{line:{active:"text-secondary-700 dark:text-secondary-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-600 dark:hover:text-secondary-300"},solid:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-secondary-700 dark:text-secondary-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-secondary-700 dark:hover:text-secondary-300"}},neutral:{line:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-950 dark:hover:text-neutral-100"},solid:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-neutral-950 dark:text-neutral-50 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100"}},error:{line:{active:"text-error-700 dark:text-error-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-600 dark:hover:text-error-300"},solid:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-error-700 dark:text-error-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-error-700 dark:hover:text-error-300"}},success:{line:{active:"text-success-700 dark:text-success-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-600 dark:hover:text-success-300"},solid:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-success-700 dark:text-success-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-success-700 dark:hover:text-success-300"}},warning:{line:{active:"text-warning-700 dark:text-warning-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-600 dark:hover:text-warning-300"},solid:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-warning-700 dark:text-warning-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-warning-700 dark:hover:text-warning-300"}},info:{line:{active:"text-info-700 dark:text-info-400 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-600 dark:hover:text-info-300"},solid:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},bordered:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-200"},flat:{active:"text-info-700 dark:text-info-300 font-semibold",inactive:"text-neutral-600 dark:text-neutral-400 hover:text-info-700 dark:hover:text-info-300"}}},ad={line:{primary:"bg-primary-600 dark:bg-primary-400",secondary:"bg-secondary-600 dark:bg-secondary-400",neutral:"bg-neutral-900 dark:bg-neutral-100",error:"bg-error-600 dark:bg-error-400",success:"bg-success-600 dark:bg-success-400",warning:"bg-warning-600 dark:bg-warning-400",info:"bg-info-600 dark:bg-info-400"},solid:{primary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",secondary:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",neutral:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",error:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",success:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",warning:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70",info:"bg-white dark:bg-neutral-900 shadow-xs border border-neutral-200/70 dark:border-neutral-700/70"},bordered:{primary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",secondary:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",neutral:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",error:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",success:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",warning:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs",info:"bg-white dark:bg-neutral-900 border border-neutral-300 dark:border-neutral-600 shadow-xs"},flat:{primary:"bg-primary-100/90 dark:bg-primary-950/80",secondary:"bg-secondary-100/90 dark:bg-secondary-950/80",neutral:"bg-neutral-200/90 dark:bg-neutral-800",error:"bg-error-100/90 dark:bg-error-950/80",success:"bg-success-100/90 dark:bg-success-950/80",warning:"bg-warning-100/90 dark:bg-warning-950/80",info:"bg-info-100/90 dark:bg-info-950/80"}};import{useCallback as sd,useEffect as Kg,useLayoutEffect as _g,useRef as Xg,useState as al}from"react";var ld=typeof window<"u"?_g:Kg;function cd({activeKey:e,orientation:t="horizontal",placement:r="top",variant:n="line",color:o="primary",radius:i="md"}={}){let a=Xg(null),[s,l]=al({opacity:0}),[h,d]=al(!1),[w,p]=al(!1),m=sd(()=>{if(!a.current||t==="vertical"){d(!1),p(!1);return}let{scrollLeft:T,scrollWidth:v,clientWidth:u}=a.current,c=v-u;d(T>1),p(T<c-1)},[t]),x=sd(()=>{if(!a.current)return;m();let T=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(S=>({...S,opacity:0}));return}let v=T.closest("[data-tab-wrapper]")||T;v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:u,offsetTop:c,offsetWidth:g,offsetHeight:f}=v;l(n==="line"?t==="vertical"?{transform:`translate3d(0, ${c}px, 0)`,height:`${f}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${u}px, 0, 0)`,width:`${g}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${u}px, ${c}px, 0)`,width:`${g}px`,height:`${f}px`,top:0,left:0,opacity:1})},[m,t,r,n]);return ld(()=>{x()},[x,e,n,t,r,o,i]),ld(()=>{x();let T=requestAnimationFrame(x),v=new ResizeObserver(x);if(a.current){v.observe(a.current);let c=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let g of c)v.observe(g)}let u=()=>x();return window.addEventListener("resize",u),()=>{cancelAnimationFrame(T),v.disconnect(),window.removeEventListener("resize",u)}},[x]),{listRef:a,indicatorStyle:s,canScrollLeft:h,canScrollRight:w,checkScroll:m,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:T=>{if(!a.current)return;let v=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!v.length)return;let u=v.findIndex(D=>D===document.activeElement||D.getAttribute("aria-selected")==="true"),c=-1,g=t==="horizontal",f=g?"ArrowRight":"ArrowDown",S=g?"ArrowLeft":"ArrowUp";T.key===f?(T.preventDefault(),c=(u+1)%v.length):T.key===S?(T.preventDefault(),c=(u-1+v.length)%v.length):T.key==="Home"?(T.preventDefault(),c=0):T.key==="End"&&(T.preventDefault(),c=v.length-1),c>=0&&v[c]&&(v[c]?.focus(),v[c]?.click())}}}import{jsx as ro,jsxs as ud}from"react/jsx-runtime";function Cn({children:e,className:t="",extra:r,centered:n=!1,ref:o,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:h="line",color:d="primary",radius:w="md",fullWidth:p=!1}=Wr(),{listRef:m,indicatorStyle:x,canScrollLeft:y,canScrollRight:b,checkScroll:k,handleScrollLeft:T,handleScrollRight:v,handleKeyDown:u}=cd({activeKey:a,orientation:s,placement:l,variant:h,color:d,radius:w}),c=qg([m,o]),g=C(w,va,"md"),f=h==="other"?"":C(h,od,"line"),S=typeof f=="function"?f(s,l):"",D=h==="other"?"":C(d,C(h,ad,"line"),"primary"),R=s==="vertical",P=y||b,E=["relative flex-1 min-w-0",R?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${p?"w-full":""}`,n&&!R?"justify-center":"",h!=="line"?g:"",S,t].filter(Boolean).join(" "),N=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",h!=="line"?g:"",D].filter(Boolean).join(" ");return ud("div",{className:R?"flex flex-col items-start gap-2 shrink-0 min-w-44":"flex items-center justify-between gap-1 w-full min-w-0",children:[!R&&P&&ro("button",{type:"button","aria-label":"Scroll tabs left",disabled:!y,onClick:T,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:ro(Yt,{className:"size-4"})}),ud("div",{ref:c,role:"tablist","aria-orientation":s,onKeyDown:u,onScroll:k,className:E,...i,children:[ro("div",{"aria-hidden":"true",className:N,style:x}),e]}),!R&&P&&ro("button",{type:"button","aria-label":"Scroll tabs right",disabled:!b,onClick:v,className:"shrink-0 flex items-center justify-center size-7 rounded-md text-neutral-500 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-800 disabled:opacity-20 disabled:pointer-events-none transition-colors cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500",children:ro(Wt,{className:"size-4"})}),r&&ro("div",{className:R?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}import{useRef as Zg}from"react";import{useMergeRefs as Jg}from"@floating-ui/react";import{jsx as no,jsxs as dd}from"react/jsx-runtime";function kn({value:e,label:t,startIcon:r,endIcon:n,badge:o,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:h,onClick:d,onKeyDown:w,ref:p,...m}){let{activeKey:x,setActiveKey:y,size:b,variant:k,color:T,radius:v,orientation:u,fullWidth:c,disabled:g,onCloseTab:f}=Wr(),S=Zg(null),D=Jg([S,p]),R=g||i,P=x===e,I=B=>{R||(y(e),d?.(B))},E=B=>{B.stopPropagation(),!R&&(s?.(B),f?.(e))},N=C(b,nd,"md"),M=C(v,va,"md"),z=C(T,id,"primary"),H=k==="other"?{active:"",inactive:""}:C(k,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,$=P?H.active:H.inactive,F=u==="vertical",G=["group relative z-10 inline-flex items-center select-none",F?"justify-start text-left w-full":"justify-center text-center",k!=="line"?M:"",c&&!F?"flex-1 text-center":"",R?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",F?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",k!=="line"?M:"",N.tab,N.gap,a?"pr-1.5":"",c&&!F?"flex-1 text-center":"",$,R?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return dd("div",{"data-tab-wrapper":!0,className:G,children:[dd("button",{ref:D,id:V,type:"button",role:"tab","aria-selected":P,"aria-controls":Y,"aria-disabled":R?"true":void 0,tabIndex:P?0:-1,disabled:R,onClick:I,onKeyDown:B=>{if(a&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),R)return;s?.(B),f?.(e)}w?.(B)},className:A,...m,children:[r&&no("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:r}),no("span",{className:`truncate ${F?"flex-1 text-left":""}`,children:t||h}),o!=null&&no("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 transition-colors duration-200 ${N.badge}`,children:o}),n&&no("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:n})]}),a&&no("button",{type:"button","aria-label":"Close tab",disabled:R,tabIndex:P?0:-1,onClick:E,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 dark:hover:bg-neutral-700 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${N.closeBtn}`,children:no(Oe,{className:"size-full pointer-events-none"})})]})}import{jsx as Qg}from"react/jsx-runtime";function sl({children:e,className:t="",ref:r,...n}){return Qg("div",{ref:r,className:`w-full ${t}`,...n,children:e})}import{jsx as em}from"react/jsx-runtime";function ll({value:e,children:t,className:r="",destroyInactiveTabPane:n,ref:o,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Wr(),l=a===e;if((n??s)&&!l)return null;let d=`tab-${e}`,w=`tabpanel-${e}`,p=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return em("div",{ref:o,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":d,hidden:!l,className:p,...i,children:t})}import{createContext as tm,useContext as rm}from"react";var cl=tm(null);function ar(){let e=rm(cl);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}import{useCallback as Pt,useEffect as nm,useRef as Yo,useState as oo}from"react";function ya({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:h=650,pauseOnHover:d=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:x="md"}={}){let[y,b]=oo(t),[k,T]=oo(0),[v,u]=oo(!1),[c,g]=oo(0),[f,S]=oo(!1),[D,R]=oo(!1),P=Yo(new Set),I=Yo(null),E=Yo(null),N=Yo(0),M=Yo(0),z=e!==void 0,H=z?e:y,V=Math.max(0,n?k-1:k-o),Y=Pt(L=>{let te=L;n?k>0?te=(te+k)%k:te=0:te=Math.max(0,Math.min(te,V)),z||b(te),r?.(te)},[z,n,V,r,k]),$=n?k>1:H>0,F=n?k>1:H<k-o,G=Pt(()=>{$&&Y(H-i)},[H,$,Y,i]),A=Pt(()=>{F&&Y(H+i)},[H,F,Y,i]),U=Pt(L=>{Y(L)},[Y]),B=Pt(L=>{P.current.add(L),T(P.current.size)},[]),X=Pt(L=>{P.current.delete(L),T(P.current.size)},[]);nm(()=>{if(!s||k<=o||d&&f||w&&D||v)return;let L=setInterval(()=>{n||H<k-o?A():U(0)},l);return()=>clearInterval(L)},[H,s,l,v,D,f,n,w,d,A,U,o,k]);let le=Pt(L=>{if(!p||k<=o||L.button!==0)return;let te=L.clientX;N.current=te,M.current=te,u(!0),g(0);let Z=L.currentTarget;try{Z.setPointerCapture(L.pointerId)}catch{}},[p,o,k]),ne=Pt(L=>{if(!v)return;let te=L.clientX;M.current=te;let Z=te-N.current;if(!n){if(H===0&&Z>0){g(Z*.3);return}if(H>=k-o&&Z<0){g(Z*.3);return}}g(Z)},[H,v,n,o,k]),ue=Pt(L=>{if(!v)return;u(!1);let te=M.current-N.current;Math.abs(te)>40&&(te>0?G():A()),g(0);try{L.currentTarget.releasePointerCapture(L.pointerId)}catch{}},[v,A,G]),ie=Pt(L=>{L.key==="ArrowLeft"?(L.preventDefault(),G()):L.key==="ArrowRight"?(L.preventDefault(),A()):L.key==="Home"?(L.preventDefault(),U(0)):L.key==="End"&&(L.preventDefault(),U(V))},[V,A,G,U]),Q=Pt(()=>S(!0),[]),q=Pt(()=>S(!1),[]),ge=Pt(()=>R(!0),[]),ke=Pt(()=>R(!1),[]);return{currentIndex:H,totalSlides:k,slidesToShow:o,slidesToScroll:i,spacing:a,loop:n,canScrollPrev:$,canScrollNext:F,size:m,radius:x,transitionDuration:h,isDragging:v,dragOffset:c,scrollPrev:G,scrollNext:A,scrollTo:U,registerSlide:B,unregisterSlide:X,setTotalSlides:T,viewportRef:I,containerRef:E,handlePointerDown:le,handlePointerMove:ne,handlePointerUp:ue,handlePointerCancel:ue,handleKeyDown:ie,handleMouseEnter:Q,handleMouseLeave:q,handleFocus:ge,handleBlur:ke}}var Wo={sm:{arrowBtn:"size-6 p-0.5 text-xs",arrowIcon:"size-3",dot:"size-1.5",activeDot:"size-1.5",line:"w-3.5 h-1",activeLine:"w-6 h-1",fraction:"text-xs px-2 py-0.5",paginationWrapper:"px-2 py-1 gap-1.5",edgeInset:"left-1.5 right-1.5"},md:{arrowBtn:"size-8 p-1.5 text-sm",arrowIcon:"size-3.5",dot:"size-2",activeDot:"size-2",line:"w-5 h-1.5",activeLine:"w-8 h-1.5",fraction:"text-xs px-2.5 py-0.5 font-medium",paginationWrapper:"px-2.5 py-1 gap-2",edgeInset:"left-2 right-2"},lg:{arrowBtn:"size-9 p-2 text-sm",arrowIcon:"size-4",dot:"size-2.5",activeDot:"size-2.5",line:"w-7 h-2",activeLine:"w-11 h-2",fraction:"text-sm px-3 py-1 font-medium",paginationWrapper:"px-3 py-1.5 gap-2.5",edgeInset:"left-2.5 right-2.5"}},fd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ul={glass:"bg-white/40 dark:bg-black/35 backdrop-blur-md border border-white/40 dark:border-white/15 text-primary-950 dark:text-white shadow-md hover:bg-white/70 dark:hover:bg-black/60 active:scale-90 disabled:opacity-25 disabled:pointer-events-none",filled:"bg-primary-600 text-white shadow-md hover:bg-primary-700 active:bg-primary-800 disabled:bg-neutral-300 dark:disabled:bg-neutral-800 disabled:text-neutral-500 disabled:opacity-50",outline:"border border-primary-600 text-primary-600 bg-white/70 dark:bg-neutral-900/70 backdrop-blur-sm hover:bg-primary-50 dark:hover:bg-primary-950 disabled:border-neutral-300 disabled:text-neutral-400",ghost:"text-primary-600 hover:bg-primary-100/60 dark:hover:bg-primary-950/60 active:bg-primary-200/60 disabled:text-neutral-400"},dl="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",Ko={active:"bg-primary-600 dark:bg-primary-400 shadow-sm",inactive:"bg-white/60 dark:bg-white/40 hover:bg-white/90 dark:hover:bg-white/70 transition-colors"};import{jsx as pd}from"react/jsx-runtime";function gd({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:h=650,pauseOnHover:d=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:x="md",children:y,className:b="",style:k,ref:T,...v}){let u=ya({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:n,slidesToShow:o,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:h,pauseOnHover:d,pauseOnFocus:w,draggable:p,size:m,radius:x}),c=C(x,fd,"md");return pd(cl.Provider,{value:u,children:pd("div",{ref:T,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:u.handleKeyDown,onMouseEnter:u.handleMouseEnter,onMouseLeave:u.handleMouseLeave,onFocus:u.handleFocus,onBlur:u.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${c} ${b}`,style:k,...v,children:y})})}import{jsx as md}from"react/jsx-runtime";function bd({children:e,className:t="",style:r,ref:n,...o}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:h,dragOffset:d,viewportRef:w,handlePointerDown:p,handlePointerMove:m,handlePointerUp:x,handlePointerCancel:y}=ar(),b=typeof s=="number"?`${s}px`:s||"0px",k=`translateX(calc(-${i} * ((100% + ${b}) / ${a}) + ${d}px))`,T={display:"flex",flexDirection:"row",gap:b,transform:k,transition:h?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return md("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${h?"cursor-grabbing select-none":""}`,onPointerDown:p,onPointerMove:m,onPointerUp:x,onPointerCancel:y,children:md("div",{ref:n,role:"presentation",className:`flex ${t}`,style:{...T,...r},...o,children:e})})}import{useId as om,useEffect as im}from"react";import{jsx as am}from"react/jsx-runtime";function hd({children:e,className:t="",style:r,ref:n,...o}){let i=om(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:h}=ar();im(()=>(l(i),()=>{h(i)}),[i,l,h]);let d=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||d!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${d}) / ${a})`:w.flex="0 0 100%",am("div",{ref:n,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...o,children:e})}import{jsx as wa}from"react/jsx-runtime";function xd({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:h}=ar(),d=n!==void 0?n:!l,w=C(h,Wo,"md"),p=C(e,ul,"glass"),m=wa(Yt,{className:w.arrowIcon}),x=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return wa("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:d,onClick:y=>{s(),o?.(y)},className:x,...a,children:t||m})}function vd({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:h}=ar(),d=n!==void 0?n:!l,w=C(h,Wo,"md"),p=C(e,ul,"glass"),m=wa(Wt,{className:w.arrowIcon}),x=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return wa("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:d,onClick:y=>{s(),o?.(y)},className:x,...a,children:t||m})}import{jsx as Ca,jsxs as sm}from"react/jsx-runtime";function yd({type:e="dots",clickable:t=!0,className:r="",ref:n,...o}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:h,size:d}=ar();if(e==="none"||a<=1)return null;let w=C(d,Wo,"md"),p=l?a:Math.max(1,a-s+1);return e==="fraction"?Ca("div",{ref:n,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${dl} text-white ${w.fraction} ${r}`,...o,children:sm("span",{children:[Math.min(i+1,p)," / ",p]})}):Ca("div",{ref:n,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${dl} ${w.paginationWrapper} ${r}`,...o,children:Array.from({length:p}).map((m,x)=>{let y=x===i;return e==="line"?Ca("button",{type:"button",role:"tab","aria-selected":y,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&h(x),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${y?`${w.activeLine} ${Ko.active}`:`${w.line} ${Ko.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},x):Ca("button",{type:"button",role:"tab","aria-selected":y,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${x+1}`,disabled:!t,onClick:()=>t&&h(x),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${y?Ko.active:Ko.inactive} ${t?"cursor-pointer":"cursor-default"}`},x)})})}import{useState as wd,useRef as Cd,useMemo as kd,useCallback as um}from"react";import{useFloating as dm,autoUpdate as fm,offset as pm,flip as gm,shift as mm,useClick as bm,useHover as hm,useDismiss as xm,useRole as vm,useListNavigation as ym,useTypeahead as wm,useInteractions as Cm,safePolygon as km}from"@floating-ui/react";import{createContext as lm,useContext as cm}from"react";var fl=lm(null),hr=()=>{let e=cm(fl);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};import{jsx as Sm}from"react/jsx-runtime";function pl({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:h="md",radius:d="md",color:w="primary",disabled:p=!1,animated:m=!0,animationDuration:x=150,closeOnSelect:y=!0}){let[b,k]=wd(r),[T,v]=wd(null),u=Cd([]),c=Cd([]),g=t!==void 0,f=g?t:b,S=um(U=>{g||k(U),U||v(null),n?.(U)},[g,n]),D=kd(()=>[pm(a),s?gm():void 0,l?mm({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:R,floatingStyles:P,context:I,placement:E}=dm({placement:i,open:f&&!p,onOpenChange:S,whileElementsMounted:fm,transform:!1,middleware:D}),N=bm(I,{enabled:!p&&o==="click"}),M=hm(I,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:km()}),z=xm(I),H=vm(I,{role:"menu"}),V=ym(I,{listRef:u,activeIndex:T,onNavigate:v,loop:!0}),Y=wm(I,{listRef:c,activeIndex:T,onMatch:f?v:void 0}),{getReferenceProps:$,getFloatingProps:F,getItemProps:G}=Cm([N,M,z,H,V,Y]),A=kd(()=>({isOpen:f,setIsOpen:S,refs:R,floatingStyles:P,context:I,getReferenceProps:$,getFloatingProps:F,getItemProps:G,elementsRef:u,labelsRef:c,activeIndex:T,setActiveIndex:v,size:h,radius:d,color:w,disabled:p,animated:m,animationDuration:x,closeOnSelect:y,computedPlacement:E}),[f,S,R,P,I,$,F,G,u,c,T,v,h,d,w,p,m,x,y,E]);return Sm(fl.Provider,{value:A,children:e})}import{cloneElement as Tm,isValidElement as gl}from"react";import{useMergeRefs as Td}from"@floating-ui/react";import{jsx as Sd}from"react/jsx-runtime";function Dm({children:e,ref:t,disabled:r,className:n="",...o}){let i=gl(e)?e.props?.ref:void 0,a=Td([t,i]);if(!gl(e))return null;let s=e.props||{};return Tm(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function Rm({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=hr(),h=Td([i.setReference,e]),d=a({...o,"aria-expanded":s,"aria-haspopup":"menu",className:r});return gl(t)&&(n||!0)?Sd(Dm,{ref:h,disabled:l,...d,children:t}):Sd("button",{ref:h,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...d,children:t})}var Dd=Rm;import{FloatingPortal as Nm,FloatingList as Pm,useMergeRefs as zm}from"@floating-ui/react";var io={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},Rd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Nd={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},ml={default:"text-error-600 hover:bg-error-50 hover:text-error-700",active:"bg-error-50 text-error-700",focus:"focus:bg-error-50 focus:text-error-700"};import{jsx as bl}from"react/jsx-runtime";function hl({ref:e,children:t,className:r="",style:n,minWidth:o,zIndex:i=Qe.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:h,context:d,getFloatingProps:w,elementsRef:p,labelsRef:m,size:x,radius:y,animated:b,animationDuration:k,computedPlacement:T}=hr(),v=zm([l.setFloating,e]),{isMounted:u,styles:c}=et(d,{duration:k,animated:b});if(!u)return null;let g=C(x,io,"md"),f=C(y,Rd,"md"),S=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",g.menu,f,r].filter(Boolean).join(" ");return bl(Nm,{children:bl("div",{ref:v,style:{...h,...b?c:{},minWidth:o,zIndex:i,...n},className:S,"data-state":s?"open":"closed","data-placement":T,...w(a),children:bl(Pm,{elementsRef:p,labelsRef:m,children:t})})})}import{useListItem as Im,useMergeRefs as Mm}from"@floating-ui/react";import{jsx as _o,jsxs as Pd}from"react/jsx-runtime";function Fm({ref:e,children:t,onClick:r,disabled:n=!1,danger:o=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:h,className:d="",closeOnSelect:w,...p}){let{getItemProps:m,activeIndex:x,setIsOpen:y,color:b,size:k,closeOnSelect:T}=hr(),v=typeof t=="string"?t:void 0,{ref:u,index:c}=Im({label:v}),g=Mm([u,e]),f=x===c,S=C(k,io,"md"),D=C(b,Nd,"primary"),R=E=>{if(n){E.preventDefault();return}r?.(E),(w??T)&&y(!1)},P=n?"opacity-50 cursor-not-allowed text-neutral-400 select-none":o?`${ml.default} ${f?ml.active:""} cursor-pointer`:i?`${D.selected} cursor-pointer`:`${f?D.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,I=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",S.item,S.itemGap,P,d].filter(Boolean).join(" ");return Pd("button",{ref:g,type:"button",role:"menuitem",disabled:n,"aria-disabled":n,tabIndex:f?0:-1,...m({...p,onClick:R,className:I}),children:[a&&_o("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:a}),Pd("div",{className:"flex-1 flex flex-col min-w-0",children:[_o("span",{className:"truncate",children:t}),h&&_o("span",{className:`text-neutral-500 truncate ${S.description}`,children:h})]}),l&&_o("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${S.shortcut}`,children:l}),s&&_o("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:s})]})}var zd=Fm;import{jsx as Em}from"react/jsx-runtime";function xl({children:e,className:t="",...r}){let{size:n}=hr(),o=C(n,io,"md");return Em("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Id=xl;import{jsx as Lm}from"react/jsx-runtime";function $m({className:e="",...t}){return Lm("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Md=$m;import{jsx as Hm,jsxs as Vm}from"react/jsx-runtime";function Bm({children:e,label:t,className:r="",...n}){return Vm("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...n,children:[t&&Hm(xl,{children:t}),e]})}var Fd=Bm;import{useState as Gm,useMemo as Ed,useCallback as Um}from"react";import{useFloating as jm,autoUpdate as Ym,offset as Wm,flip as Km,shift as _m,useClick as Xm,useHover as qm,useDismiss as Zm,useRole as Jm,useInteractions as Qm,safePolygon as eb}from"@floating-ui/react";import{createContext as Am,useContext as Om}from"react";var vl=Am(null),zt=()=>{let e=Om(vl);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};import{jsx as tb}from"react/jsx-runtime";function Xo({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:h="md",radius:d="md",color:w="neutral",disabled:p=!1,animated:m=!0,animationDuration:x=150,modal:y=!1,closeOnEsc:b=!0,closeOnClickOutside:k=!0}){let[T,v]=Gm(r),u=t!==void 0,c=u?t:T,g=Um(Y=>{u||v(Y),n?.(Y)},[u,n]),f=Ed(()=>[Wm(a),s?Km():void 0,l?_m({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:S,floatingStyles:D,context:R,placement:P}=jm({placement:i,open:c&&!p,onOpenChange:g,whileElementsMounted:Ym,transform:!1,middleware:f}),I=Xm(R,{enabled:!p&&o==="click"}),E=qm(R,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:eb()}),N=Zm(R,{escapeKey:b,outsidePress:k}),M=Jm(R,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=Qm([I,E,N,M]),V=Ed(()=>({isOpen:c,setIsOpen:g,refs:S,floatingStyles:D,context:R,getReferenceProps:z,getFloatingProps:H,size:h,radius:d,color:w,disabled:p,animated:m,animationDuration:x,modal:y,computedPlacement:P}),[c,g,S,D,R,z,H,h,d,w,p,m,x,y,P]);return tb(vl.Provider,{value:V,children:e})}import{cloneElement as rb,isValidElement as yl}from"react";import{useMergeRefs as Ld}from"@floating-ui/react";import{jsx as $d}from"react/jsx-runtime";function nb({children:e,ref:t,disabled:r,className:n="",...o}){let i=yl(e)?e.props?.ref:void 0,a=Ld([t,i]);if(!yl(e))return null;let s=e.props||{};return rb(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function ob({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=zt(),h=Ld([i.setReference,e]),d=a({...o,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return yl(t)&&(n||!0)?$d(nb,{ref:h,disabled:l,...d,children:t}):$d("button",{ref:h,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...d,children:t})}var ka=ob;import{FloatingPortal as ib,FloatingFocusManager as ab,useMergeRefs as sb}from"@floating-ui/react";var Kr={xs:{container:"min-w-44 text-xs",header:"px-2.5 py-1.5 text-xs font-semibold",body:"px-2.5 py-2 text-xs",footer:"px-2.5 py-1.5 text-xs"},sm:{container:"min-w-56 text-xs",header:"px-3 py-2 text-xs font-semibold",body:"px-3 py-2.5 text-xs",footer:"px-3 py-2 text-xs"},md:{container:"min-w-64 text-sm",header:"px-4 py-3 text-sm font-semibold",body:"px-4 py-3 text-sm",footer:"px-4 py-2.5 text-sm"},lg:{container:"min-w-80 text-base",header:"px-5 py-3.5 text-base font-semibold",body:"px-5 py-4 text-base",footer:"px-5 py-3 text-base"},xl:{container:"min-w-96 text-lg",header:"px-6 py-4 text-lg font-semibold",body:"px-6 py-5 text-lg",footer:"px-6 py-4 text-lg"}},Bd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};import{jsx as wl}from"react/jsx-runtime";function Cl({ref:e,children:t,className:r="",style:n,minWidth:o,maxWidth:i,zIndex:a=Qe.POPOVER,...s}){let{isOpen:l,refs:h,floatingStyles:d,context:w,getFloatingProps:p,size:m,radius:x,animated:y,animationDuration:b,modal:k,computedPlacement:T}=zt(),v=sb([h.setFloating,e]),{isMounted:u,styles:c}=et(w,{duration:b,animated:y});if(!u)return null;let g=C(m,Kr,"md"),f=C(x,Bd,"md"),D=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",g.container,f,r].filter(Boolean).join(" "),R=wl(ab,{context:w,modal:k,children:wl("div",{ref:v,style:{...d,...y?c:{},minWidth:o,maxWidth:i,zIndex:a,...n},className:D,"data-state":l?"open":"closed","data-placement":T,...p(s),children:t})});return wl(ib,{children:R})}var Hd=Cl;import{jsx as lb}from"react/jsx-runtime";function kl({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return lb("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Vd=kl;import{jsx as cb}from"react/jsx-runtime";function Sl({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return cb("div",{className:["text-neutral-700",o.body,t].filter(Boolean).join(" "),...r,children:e})}var Ad=Sl;import{jsx as db}from"react/jsx-runtime";function ub({children:e,className:t="",...r}){let{size:n}=zt(),o=C(n,Kr,"md");return db("div",{className:["border-t border-neutral-100 bg-neutral-50/50",o.footer,t].filter(Boolean).join(" "),...r,children:e})}var Od=ub;import{cloneElement as fb,isValidElement as Tl}from"react";import{useMergeRefs as pb}from"@floating-ui/react";import{jsx as Gd}from"react/jsx-runtime";function gb({children:e,ref:t,className:r="",onClick:n,...o}){let i=Tl(e)?e.props?.ref:void 0,a=pb([t,i]);if(!Tl(e))return null;let s=e.props||{};return fb(e,{...o,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),n?.(l)}})}function mb({ref:e,children:t,className:r="",asChild:n=!1,onClick:o,...i}){let{setIsOpen:a}=zt(),s=l=>{o?.(l),l.defaultPrevented||a(!1)};return Tl(t)&&n?Gd(gb,{ref:e,className:r,onClick:s,...i,children:t}):Gd("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Ud=mb;import{useState as Ml,useId as yb,useMemo as wb}from"react";import{useFloating as Cb,autoUpdate as kb,offset as Sb,flip as Tb,shift as Db,useDismiss as Rb,useRole as Nb,useInteractions as Pb,FloatingPortal as zb,FloatingFocusManager as Ib}from"@floating-ui/react";import{useState as Il,useMemo as Xd}from"react";var jd={months:["Th\xE1ng 1","Th\xE1ng 2","Th\xE1ng 3","Th\xE1ng 4","Th\xE1ng 5","Th\xE1ng 6","Th\xE1ng 7","Th\xE1ng 8","Th\xE1ng 9","Th\xE1ng 10","Th\xE1ng 11","Th\xE1ng 12"],monthsShort:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],weekdays:["Ch\u1EE7 Nh\u1EADt","Th\u1EE9 Hai","Th\u1EE9 Ba","Th\u1EE9 T\u01B0","Th\u1EE9 N\u0103m","Th\u1EE9 S\xE1u","Th\u1EE9 B\u1EA3y"],weekdaysShort:["CN","T2","T3","T4","T5","T6","T7"],weekdaysMin:["CN","T2","T3","T4","T5","T6","T7"],todayText:"H\xF4m nay",clearText:"X\xF3a",weekText:"Tu\u1EA7n",viewTabs:{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"}},Yd={months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],todayText:"Today",clearText:"Clear",weekText:"Week",viewTabs:{days:"Day",months:"Month",years:"Year"}},Kt={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var _r={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Wd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Xr={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",selectedText:"text-neutral-white",rangeBg:"bg-primary-100 text-primary-900",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"border-primary-500 text-primary-500",activeText:"text-primary-500",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",selectedText:"text-neutral-white",rangeBg:"bg-secondary-100 text-secondary-900",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"border-secondary-500 text-secondary-500",activeText:"text-secondary-500",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",selectedText:"text-neutral-white",rangeBg:"bg-neutral-200 text-neutral-900",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"border-neutral-600 text-neutral-600",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",selectedText:"text-neutral-white",rangeBg:"bg-error-100 text-error-900",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"border-error-500 text-error-500",activeText:"text-error-500",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",selectedText:"text-neutral-white",rangeBg:"bg-success-100 text-success-900",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"border-success-500 text-success-500",activeText:"text-success-500",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",selectedText:"text-neutral-950",rangeBg:"bg-warning-100 text-warning-900",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"border-warning-500 text-warning-700",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",selectedText:"text-neutral-white",rangeBg:"bg-info-100 text-info-900",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"border-info-500 text-info-500",activeText:"text-info-500",accentBg:"bg-info-500"}},Kd={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function dt(e){return!e||e==="vi"?jd:e==="en"?Yd:e}function mt(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let o=Rl(r,t);if(o)return o}let n=new Date(r);return isNaN(n.getTime())?null:n}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function qr(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Sa(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function qo(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<n}function Zo(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>n}function Jo(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-n.getTime())/864e5+1)/7)}function _d(e,t){return new Date(e,t+1,0).getDate()}function Ta(e,t,r=1,n,o,i,a){let s=[],l=new Date,h=new Date(e,t,1).getDay(),d=_d(e,t-1),w=_d(e,t),p=r===1?h===0?6:h-1:h;for(let x=p-1;x>=0;x--){let y=d-x,b=new Date(e,t-1,y);s.push(Dl(b,!1,l,n,o,i,a))}for(let x=1;x<=w;x++){let y=new Date(e,t,x);s.push(Dl(y,!0,l,n,o,i,a))}let m=42-s.length;for(let x=1;x<=m;x++){let y=new Date(e,t+1,x);s.push(Dl(y,!1,l,n,o,i,a))}return s}function Dl(e,t,r,n,o,i,a){let s=n?qr(e,n):!1,l=!1;return o&&qo(e,o)&&(l=!0),i&&Zo(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:qr(e,r),isSelected:s,isDisabled:l,weekNumber:Jo(e)}}function Ht(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let n=dt(r),o=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),h=e.getSeconds(),d=e.getDay(),w=y=>String(y).padStart(2,"0"),p=s%12||12,m=s>=12?"PM":"AM",x={YYYY:String(o),YY:String(o).slice(-2),MMMM:n.months[i]??"",MMM:n.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:n.weekdays[d]??"",ddd:n.weekdaysShort[d]??"",dd:n.weekdaysMin[d]??"",HH:w(s),H:String(s),hh:w(p),h:String(p),mm:w(l),m:String(l),ss:w(h),s:String(h),A:m,a:m.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,y=>x[y]??y)}function Rl(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,h=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!h){let m=new Date(r);return isNaN(m.getTime())?null:m}let d="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of h)m==="YYYY"?d=d.replace("YYYY","(\\d{4})"):m==="YY"?d=d.replace("YY","(\\d{2})"):(m==="MM"||m==="M"||m==="DD"||m==="D"||m==="HH"||m==="H"||m==="hh"||m==="h"||m==="mm"||m==="m"||m==="ss"||m==="s")&&(d=d.replace(m,"(\\d{1,2})"));d+="$";let w=new RegExp(d).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}h.forEach((m,x)=>{let y=w[x+1];if(!y)return;let b=parseInt(y,10);isNaN(b)||(m==="YYYY"?n=b:m==="YY"?n=2e3+b:m==="MM"||m==="M"?o=b:m==="DD"||m==="D"?i=b:m==="HH"||m==="H"||m==="hh"||m==="h"?a=b:m==="mm"||m==="m"?s=b:(m==="ss"||m==="s")&&(l=b))});let p=new Date(n,o-1,i,a,s,l);return isNaN(p.getTime())?null:p}function Da(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,n=>n.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}import{jsx as Ir,jsxs as Nl}from"react/jsx-runtime";function Qo({currentMonth:e,view:t,onViewChange:r,onPrevMonth:n,onNextMonth:o,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:h="md",color:d="primary",locale:w,showMonthButtons:p=!0}){let m=dt(w),x=C(h,Kt,"md"),y=C(d,Xr,"primary"),b=e.getFullYear(),k=e.getMonth(),T=Math.floor(b/10)*10,v=T+9,u=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},c=()=>{t==="years"?s?s():i():t==="months"?i():n()},g=()=>{t==="years"?l?l():a():t==="months"?a():o()},f=()=>t==="years"?`${T} - ${v}`:t==="months"?`${b}`:`${m.months[k]} ${b}`;return Nl("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[Nl("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&Ir("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Gr,{width:14,height:14})}),p&&Ir("button",{type:"button",onClick:c,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Yt,{width:14,height:14})})]}),Ir("button",{type:"button",onClick:u,className:`${x.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${y.activeText} transition-colors cursor-pointer`,children:f()}),Nl("div",{className:"flex items-center space-x-0.5",children:[p&&Ir("button",{type:"button",onClick:g,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Wt,{width:14,height:14})}),t==="days"&&Ir("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:Ir(Ur,{width:14,height:14})})]})]})}import bb,{useRef as hb}from"react";import{jsx as ei,jsxs as Ra}from"react/jsx-runtime";function ti({days:e,onSelectDate:t,size:r="md",color:n="primary",radius:o,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=dt(i),h=C(r,Kt,"md"),d=C(n,Xr,"primary"),w=C(o,_r,"lg"),p=hb(null),m=[...l.weekdaysShort];if(a===1){let u=m.shift();m.push(u)}let x=e.some(u=>u.isSelected&&!u.isDisabled),y=e.findIndex(u=>u.isToday&&!u.isDisabled),b=e.findIndex(u=>u.isCurrentMonth&&!u.isDisabled),k=b!==-1?b:e.findIndex(u=>!u.isDisabled),T=u=>{let g=p.current?.querySelectorAll("button")?.[u];g&&!g.disabled&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight"){u.preventDefault();for(let f=c+1;f<e.length;f++)if(!e[f].isDisabled){g=f;break}}else if(u.key==="ArrowLeft"){u.preventDefault();for(let f=c-1;f>=0;f--)if(!e[f].isDisabled){g=f;break}}else if(u.key==="ArrowDown")u.preventDefault(),c+7<e.length&&!e[c+7].isDisabled&&(g=c+7);else if(u.key==="ArrowUp")u.preventDefault(),c-7>=0&&!e[c-7].isDisabled&&(g=c-7);else if(u.key==="Home"){u.preventDefault();let f=c-c%7;for(let S=f;S<f+7&&S<e.length;S++)if(!e[S].isDisabled){g=S;break}}else if(u.key==="End"){u.preventDefault();let f=Math.min(e.length-1,c-c%7+6);for(let S=f;S>=c-c%7;S--)if(!e[S].isDisabled){g=S;break}}else if(u.key==="Enter"||u.key===" "){u.preventDefault();let f=e[c];f&&!f.isDisabled&&t(f.date);return}g!==null&&T(g)};return Ra("div",{ref:p,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[Ra("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&ei("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${h.cellSize} text-neutral-400 ${h.cellText} font-medium`,children:"#"}),m.map(u=>ei("div",{role:"columnheader","aria-label":u,className:`flex items-center justify-center ${h.cellSize} text-neutral-500 ${h.cellText} font-medium`,children:u},u))]}),ei("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((u,c)=>{let g=c%7===0,f="text-neutral-800 hover:bg-neutral-100";u.isDisabled?f="text-neutral-300 cursor-not-allowed line-through":u.isSelected?f=`${d.selected} font-semibold shadow-xs`:u.isCurrentMonth||(f="text-neutral-400 hover:bg-neutral-100");let S=u.isToday&&!u.isSelected?`ring-1 ${d.todayRing} font-bold`:"",D=`${u.day} ${l.months[u.month]} ${u.year}`,R=!u.isDisabled&&(u.isSelected||!x&&u.isToday&&c===y||!x&&y===-1&&c===k);return Ra(bb.Fragment,{children:[s&&g&&Ra("div",{className:`flex items-center justify-center ${h.cellSize} text-neutral-400 ${h.cellText} text-[10px] font-mono`,children:["W",u.weekNumber]}),ei("div",{role:"gridcell","aria-selected":u.isSelected,className:"flex items-center justify-center",children:ei("button",{type:"button",disabled:u.isDisabled,tabIndex:R?0:-1,onKeyDown:P=>v(P,c),onClick:()=>!u.isDisabled&&t(u.date),"aria-label":D,"aria-current":u.isToday?"date":void 0,"aria-disabled":u.isDisabled,className:`flex items-center justify-center ${h.cellSize} ${h.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${f} ${S}`,children:u.day})})]},u.date.toISOString())})})]})}import{useRef as xb}from"react";import{jsx as Pl}from"react/jsx-runtime";function ri({currentMonth:e,selectedDate:t,onSelectMonth:r,size:n="md",color:o="primary",radius:i,locale:a}){let s=dt(a),l=C(n,Kt,"md"),h=C(o,Xr,"primary"),d=C(i,_r,"lg"),w=xb(null),p=e.getFullYear(),m=new Date,x=m.getMonth(),y=m.getFullYear(),b=t&&t.getFullYear()===p?t.getMonth():-1,k=b!==-1?b:y===p?x:0,T=u=>{let g=w.current?.querySelectorAll("button")?.[u];g&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight")u.preventDefault(),c+1<s.monthsShort.length&&(g=c+1);else if(u.key==="ArrowLeft")u.preventDefault(),c-1>=0&&(g=c-1);else if(u.key==="ArrowDown")u.preventDefault(),c+3<s.monthsShort.length&&(g=c+3);else if(u.key==="ArrowUp")u.preventDefault(),c-3>=0&&(g=c-3);else if(u.key==="Home")u.preventDefault(),g=0;else if(u.key==="End")u.preventDefault(),g=s.monthsShort.length-1;else if(u.key==="Enter"||u.key===" "){u.preventDefault(),r(c);return}g!==null&&T(g)};return Pl("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((u,c)=>{let g=new Date(p,c,1),f=t?Sa(g,t):!1,S=y===p&&x===c,D=c===k,R="text-neutral-800 hover:bg-neutral-100";return f?R=`${h.selected} font-semibold shadow-xs`:S&&(R=`ring-1 ${h.todayRing} font-semibold`),Pl("div",{role:"gridcell","aria-selected":f,className:"flex items-center justify-center",children:Pl("button",{type:"button",tabIndex:D?0:-1,onKeyDown:P=>v(P,c),onClick:()=>r(c),"aria-label":`${u} ${p}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${d} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:u})},u)})})}import{useRef as vb}from"react";import{jsx as zl}from"react/jsx-runtime";function ni({currentMonth:e,selectedDate:t,onSelectYear:r,size:n="md",color:o="primary",radius:i}){let a=C(n,Kt,"md"),s=C(o,Xr,"primary"),l=C(i,_r,"lg"),h=vb(null),d=e.getFullYear(),w=t?t.getFullYear():d,p=Math.floor(d/10)*10,m=new Date().getFullYear(),x=[];for(let u=0;u<12;u++)x.push(p+u);let y=x.indexOf(w),b=x.indexOf(m),k=y!==-1?y:b!==-1?b:0,T=u=>{let g=h.current?.querySelectorAll("button")?.[u];g&&g.focus()},v=(u,c)=>{let g=null;if(u.key==="ArrowRight")u.preventDefault(),c+1<x.length&&(g=c+1);else if(u.key==="ArrowLeft")u.preventDefault(),c-1>=0&&(g=c-1);else if(u.key==="ArrowDown")u.preventDefault(),c+3<x.length&&(g=c+3);else if(u.key==="ArrowUp")u.preventDefault(),c-3>=0&&(g=c-3);else if(u.key==="Home")u.preventDefault(),g=0;else if(u.key==="End")u.preventDefault(),g=x.length-1;else if(u.key==="Enter"||u.key===" "){u.preventDefault();let f=x[c];f!==void 0&&r(f);return}g!==null&&T(g)};return zl("div",{ref:h,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:x.map((u,c)=>{let g=u===w,f=u===m,S=c===k,D="text-neutral-800 hover:bg-neutral-100";return g?D=`${s.selected} font-semibold shadow-xs`:f&&(D=`ring-1 ${s.todayRing} font-semibold`),zl("div",{role:"gridcell","aria-selected":g,className:"flex items-center justify-center",children:zl("button",{type:"button",tabIndex:S?0:-1,onKeyDown:R=>v(R,c),onClick:()=>r(u),"aria-label":`${u}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${D}`,children:u})},u)})})}import{jsx as Zr,jsxs as qd}from"react/jsx-runtime";function xr({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:h=!1,showViewTabs:d=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:x,className:y="",bordered:b=!0}){let k=C(p,Kt,"md"),T=C(x,Wd,"lg"),[v,u]=Il(r),[c,g]=Il(r);r!==c&&(g(r),u(r));let[f,S]=Il(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),D=dt(s),R=Xd(()=>{let A=D.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(U=>({key:U,label:A[U]||U}))},[w,D.viewTabs]),P=A=>{let U=A;u(U),n?.(U)},I=()=>{let A=new Date(f.getFullYear(),f.getMonth()-1,1);S(A)},E=()=>{let A=new Date(f.getFullYear(),f.getMonth()+1,1);S(A)},N=()=>{let A=new Date(f.getFullYear()-1,f.getMonth(),1);S(A)},M=()=>{let A=new Date(f.getFullYear()+1,f.getMonth(),1);S(A)},z=()=>{let A=new Date(f.getFullYear()-10,f.getMonth(),1);S(A)},H=()=>{let A=new Date(f.getFullYear()+10,f.getMonth(),1);S(A)},V=A=>{let U=new Date(f.getFullYear(),A,1);S(U),r==="months"?t?.(U):u("days")},Y=A=>{let U=new Date(A,f.getMonth(),1);S(U),r==="years"?t?.(U):u("months")},$=mt(o),F=mt(i),G=Xd(()=>Ta(f.getFullYear(),f.getMonth(),l,e,$,F,a),[f,l,e,$,F,a]);return qd("div",{className:`inline-flex flex-col ${b?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${y}`,children:[d&&R.length>0&&Zr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:Zr(wn,{activeKey:r,onChange:P,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:Zr(Cn,{className:"p-0.5",children:R.map(A=>Zr(kn,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),qd("div",{className:`${k.calendarPadding} min-w-70`,children:[Zr(Qo,{currentMonth:f,view:v,onViewChange:u,onPrevMonth:I,onNextMonth:E,onPrevYear:N,onNextYear:M,onPrevDecade:z,onNextDecade:H,size:p,color:m,locale:s,showMonthButtons:!0}),v==="days"&&Zr(ti,{days:G,onSelectDate:A=>t?.(A),size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&Zr(ri,{currentMonth:f,selectedDate:e,onSelectMonth:V,size:p,color:m,radius:x,locale:s}),v==="years"&&Zr(ni,{currentMonth:f,selectedDate:e,onSelectYear:Y,size:p,color:m,radius:x})]})]})}import{jsx as bt,jsxs as Na}from"react/jsx-runtime";function Sn({ref:e,value:t,defaultValue:r,onChange:n,format:o="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:h,maxDate:d,isDateDisabled:w,size:p="md",variant:m="outline",color:x="primary",radius:y,label:b,labelPlacement:k="top",placeholder:T,helperText:v,errorMessage:u,name:c,id:g,autoComplete:f,viewTabs:S=["days","months","years"],view:D,onViewChange:R,onClear:P,placement:I="bottom-start",disabled:E=!1,readOnly:N=!1,portal:M=!0,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:U=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,showWeekNumbers:ue=!1,showViewTabs:ie=!1,closeOnSelect:Q=!0}=z??{},q=yb(),ge=g||q,ke=`${ge}-error-helper`,L=`${ge}-popover`,te=D!==void 0,[Z,he]=Ml(a),ae=te?D:Z,ve=i||o,Se=wb(()=>Da(ve,ae),[ve,ae]),ye=t!==void 0,[J,O]=Ml(()=>mt(r,o)),W=ye?mt(t,o):J,we=W?Ht(W,Se,s):"",[fe,se]=Ml(!1),{refs:{setReference:me,setFloating:De},floatingStyles:xe,context:re}=Cb({placement:I,open:fe&&!E&&!N&&!B,onOpenChange:se,whileElementsMounted:kb,transform:!1,middleware:[Sb(6),Tb(),Db({padding:8})]}),de=Rb(re,{escapeKey:!0,outsidePress:!0}),ce=Nb(re,{role:"dialog"}),{getReferenceProps:ee,getFloatingProps:j}=Pb([de,ce]),{isMounted:Ce,styles:Ee}=et(re),Fe=!!(U||u),oe=Fe?"error":x,Te=C(p,Kt,"md"),Pe=C(y,_r,"lg"),_e=m==="other"?"":C(oe,C(m,Kd,"outline"),"primary"),Ue=!!W,Le=Re=>{te||he(Re),R?.(Re)},Be=Re=>{ye||O(Re);let Ye=Re?Ht(Re,o,s):"";n?.(Ye),Q&&se(!1)},Ke=Re=>{E||N||B||(Re.key==="ArrowDown"||Re.key==="Enter"||Re.key===" "?(Re.preventDefault(),fe||se(!0)):Re.key==="Escape"&&fe&&(Re.preventDefault(),se(!1)))},K=Re=>{Re.stopPropagation(),ye||O(null),n?.(null),P?.()},_=T||Se,ze=k==="floating",pe=k==="left",Me=()=>bt(at,{htmlFor:ge,label:b,isRequired:A,isFloating:ze,size:p,color:oe,hasError:Fe,cursor:"pointer",className:$}),Xe=Re=>bt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Te.icon}`,"aria-hidden":"true",children:Re}),He=["group/field group/datepicker relative flex",pe?"flex-row items-center gap-3":"flex-col",ze?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),Ze=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Te.inputHeight,Pe,_e,E?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),qe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Te.inputText,Te.inputPadding,H].filter(Boolean).join(" ");return M?Na("div",{className:He,children:[!ze&&Me(),Na("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[Na("div",{ref:me,...ee(),className:Ze,children:[ze&&Me(),bt("input",{ref:e,id:ge,name:c,type:"text",value:we,onClick:()=>!E&&!N&&!B&&se(Re=>!Re),onKeyDown:Ke,readOnly:!0,autoComplete:f,placeholder:_,disabled:E||B,role:"combobox","aria-expanded":fe&&!B,"aria-haspopup":"dialog","aria-controls":L,"aria-required":A,"aria-invalid":Fe,"aria-busy":B,"aria-disabled":E||B,"aria-describedby":v||u?ke:void 0,"aria-errormessage":u?ke:void 0,className:qe}),Na("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&bt("div",{className:"flex items-center justify-center shrink-0",children:Xe(bt(Ne,{}))}),!B&&le&&!E&&!N&&bt("button",{type:"button",onClick:K,"aria-label":"X\xF3a ng\xE0y",tabIndex:Ue?0:-1,"aria-hidden":!Ue,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Te.icon} ${Ue?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:bt(Oe,{className:"size-full"})}),bt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${fe?"rotate-180":"rotate-0"}`,children:Xe(bt(lt,{className:"size-full"}))})]})]}),Ce&&bt(zb,{children:bt(Ib,{context:re,modal:!1,returnFocus:!0,children:bt("div",{ref:De,id:L,style:{...xe,...Ee,zIndex:Qe.PICKER},...j(),className:G,children:bt(xr,{value:W,onChange:Be,view:ae,onViewChange:Le,minDate:h,maxDate:d,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:x,radius:y,showViewTabs:ie,viewTabs:S})})})}),bt($e,{id:ke,helperText:v,errorMessage:u,sizeClassName:Te.helper,className:F})]})]}):bt("div",{className:H,children:bt(xr,{bordered:!1,value:W,onChange:Be,view:ae,onViewChange:Le,minDate:h,maxDate:d,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:x,radius:y,showViewTabs:ie,viewTabs:S})})}import{useState as Bl,useId as Lb,useMemo as Bb}from"react";import{useFloating as Hb,autoUpdate as Vb,offset as Ab,flip as Ob,shift as Gb,useDismiss as Ub,useRole as jb,useInteractions as Yb,FloatingPortal as Wb,FloatingFocusManager as Kb}from"@floating-ui/react";import{useState as si,useMemo as Fa}from"react";var _t={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},vr={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Pa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Jr={primary:{selected:"bg-primary-500 text-neutral-white hover:bg-primary-600",rangeBg:"bg-primary-100",rangeText:"text-primary-900",hoverBg:"hover:bg-primary-200 hover:text-primary-900",todayRing:"ring-primary-500 text-primary-600",activeText:"text-primary-600",badge:"bg-primary-100 text-primary-700"},secondary:{selected:"bg-secondary-500 text-neutral-white hover:bg-secondary-600",rangeBg:"bg-secondary-100",rangeText:"text-secondary-900",hoverBg:"hover:bg-secondary-200 hover:text-secondary-900",todayRing:"ring-secondary-500 text-secondary-600",activeText:"text-secondary-600",badge:"bg-secondary-100 text-secondary-700"},neutral:{selected:"bg-neutral-800 text-neutral-white hover:bg-neutral-900",rangeBg:"bg-neutral-200",rangeText:"text-neutral-900",hoverBg:"hover:bg-neutral-300 hover:text-neutral-900",todayRing:"ring-neutral-800 text-neutral-800",activeText:"text-neutral-800",badge:"bg-neutral-200 text-neutral-800"},error:{selected:"bg-error-500 text-neutral-white hover:bg-error-600",rangeBg:"bg-error-100",rangeText:"text-error-900",hoverBg:"hover:bg-error-200 hover:text-error-900",todayRing:"ring-error-500 text-error-600",activeText:"text-error-600",badge:"bg-error-100 text-error-700"},success:{selected:"bg-success-500 text-neutral-white hover:bg-success-600",rangeBg:"bg-success-100",rangeText:"text-success-900",hoverBg:"hover:bg-success-200 hover:text-success-900",todayRing:"ring-success-500 text-success-600",activeText:"text-success-600",badge:"bg-success-100 text-success-700"},warning:{selected:"bg-warning-500 text-neutral-950 hover:bg-warning-600",rangeBg:"bg-warning-100",rangeText:"text-warning-900",hoverBg:"hover:bg-warning-200 hover:text-warning-900",todayRing:"ring-warning-500 text-warning-700",activeText:"text-warning-700",badge:"bg-warning-100 text-warning-700"},info:{selected:"bg-info-500 text-neutral-white hover:bg-info-600",rangeBg:"bg-info-100",rangeText:"text-info-900",hoverBg:"hover:bg-info-200 hover:text-info-900",todayRing:"ring-info-500 text-info-600",activeText:"text-info-600",badge:"bg-info-100 text-info-700"}},za={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"},other:{primary:"",secondary:"",neutral:"",error:"",success:"",warning:"",info:""}};import{jsx as Xt,jsxs as Ia}from"react/jsx-runtime";function oi({month1:e,month2:t,view:r,onViewChange:n,onPrevMonth:o,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:h,size:d="md",color:w="primary",locale:p}){let m=dt(p),x=C(d,_t,"md"),y=C(w,Jr,"primary"),b=m.months[e.getMonth()],k=e.getFullYear(),T=Math.floor(k/10)*10,v=T+9,u=`${b} ${k}`;r==="months"&&(u=`${k}`),r==="years"&&(u=`${T} - ${v}`);let c=m.months[t.getMonth()],g=t.getFullYear(),f=Math.floor(g/10)*10,S=f+9,D=`${c} ${g}`;r==="months"&&(D=`${g}`),r==="years"&&(D=`${f} - ${S}`);let R=()=>{r==="days"?n("months"):r==="months"?n("years"):r==="years"&&n("days")},P=()=>{r==="days"?o():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(h?h():s())};return Ia("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[Ia("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&Xt("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Gr,{width:14,height:14})}),Xt("button",{type:"button",onClick:P,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Yt,{width:x.iconSize,height:x.iconSize})})]}),Ia("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[Xt("div",{className:"flex items-center justify-center",children:Xt("button",{type:"button",onClick:R,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${y.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:u})}),Xt("div",{className:"flex items-center justify-center",children:Xt("button",{type:"button",onClick:R,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${y.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${x.headerText}`,children:D})})]}),Ia("div",{className:"flex items-center space-x-0.5",children:[Xt("button",{type:"button",onClick:I,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Wt,{width:x.iconSize,height:x.iconSize})}),r==="days"&&Xt("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${x.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:Xt(Ur,{width:14,height:14})})]})]})}import Mb,{useRef as Fb}from"react";import{jsx as ii,jsxs as Ma}from"react/jsx-runtime";function ao({days:e,onSelectDate:t,onHoverDate:r,size:n="md",color:o="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let h=dt(a),d=C(n,_t,"md"),w=C(o,Jr,"primary"),p=C(i,vr,"lg"),m=Fb(null),x=[...h.weekdaysShort];if(s===1){let c=x.shift();x.push(c)}let y=e.some(c=>(c.isSelected||c.isRangeStart)&&!c.isDisabled),b=e.findIndex(c=>c.isToday&&!c.isDisabled),k=e.findIndex(c=>c.isCurrentMonth&&!c.isDisabled),T=k!==-1?k:e.findIndex(c=>!c.isDisabled),v=c=>{let f=m.current?.querySelectorAll("button")?.[c];f&&!f.disabled&&f.focus()},u=(c,g)=>{let f=null;if(c.key==="ArrowRight"){c.preventDefault();for(let S=g+1;S<e.length;S++)if(!e[S].isDisabled){f=S;break}}else if(c.key==="ArrowLeft"){c.preventDefault();for(let S=g-1;S>=0;S--)if(!e[S].isDisabled){f=S;break}}else if(c.key==="ArrowDown")c.preventDefault(),g+7<e.length&&!e[g+7].isDisabled&&(f=g+7);else if(c.key==="ArrowUp")c.preventDefault(),g-7>=0&&!e[g-7].isDisabled&&(f=g-7);else if(c.key==="Home"){c.preventDefault();let S=g-g%7;for(let D=S;D<S+7&&D<e.length;D++)if(!e[D].isDisabled){f=D;break}}else if(c.key==="End"){c.preventDefault();let S=Math.min(e.length-1,g-g%7+6);for(let D=S;D>=g-g%7;D--)if(!e[D].isDisabled){f=D;break}}else if(c.key==="Enter"||c.key===" "){c.preventDefault();let S=e[g];S&&!S.isDisabled&&t(S.date);return}f!==null&&v(f)};return Ma("div",{ref:m,role:"grid","aria-label":h.months[e[15]?.month||0],className:"w-full",children:[Ma("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&ii("div",{role:"columnheader","aria-label":h.weekText||"Week",className:`flex items-center justify-center ${d.cellSize} text-neutral-400 ${d.cellText} font-medium`,children:"#"}),x.map(c=>ii("div",{role:"columnheader","aria-label":c,className:`flex items-center justify-center ${d.cellSize} text-neutral-500 ${d.cellText} font-medium`,children:c},c))]}),ii("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((c,g)=>{let f=g%7===0,S="text-neutral-800 hover:bg-neutral-100",D="";c.isDisabled?S="text-neutral-300 cursor-not-allowed line-through":c.isRangeStart||c.isRangeEnd?(S=`${w.selected} font-semibold shadow-xs`,c.isRangeStart&&c.isRangeEnd?D="":c.isRangeStart?D=`${w.rangeBg} rounded-l-full`:c.isRangeEnd&&(D=`${w.rangeBg} rounded-r-full`)):c.isSelected?S=`${w.selected} font-semibold shadow-xs`:c.isInRange||c.isHoveredRange?(S=`${w.rangeBg} ${w.rangeText} rounded-none`,D=`${w.rangeBg}`):c.isCurrentMonth||(S="text-neutral-400 hover:bg-neutral-100");let R=c.isToday&&!c.isSelected?`ring-1 ${w.todayRing} font-bold`:"",P=`${c.day} ${h.months[c.month]} ${c.year}`,I=!c.isDisabled&&(c.isSelected||c.isRangeStart||!y&&c.isToday&&g===b||!y&&b===-1&&g===T);return Ma(Mb.Fragment,{children:[l&&f&&Ma("div",{className:`flex items-center justify-center ${d.cellSize} text-neutral-400 ${d.cellText} text-[10px] font-mono`,children:["W",c.weekNumber]}),ii("div",{role:"gridcell","aria-selected":c.isSelected||c.isInRange,className:`relative flex items-center justify-center ${D}`,children:ii("button",{type:"button",disabled:c.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>u(E,g),onClick:()=>!c.isDisabled&&t(c.date),onMouseEnter:()=>!c.isDisabled&&r?.(c.date),onMouseLeave:()=>r?.(null),"aria-label":P,"aria-current":c.isToday?"date":void 0,"aria-disabled":c.isDisabled,className:`flex items-center justify-center ${d.cellSize} ${d.cellText} ${p} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${S} ${R}`,children:c.day})})]},c.date.toISOString())})})]})}import{useRef as Eb}from"react";import{jsx as Fl}from"react/jsx-runtime";function so({currentMonth:e,onSelectMonth:t,size:r="md",color:n="primary",radius:o,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:h}){let d=dt(i),w=C(r,_t,"md"),p=C(n,Jr,"primary"),m=C(o,vr,"lg"),x=Eb(null),y=e.getFullYear(),b=new Date,k=b.getMonth(),T=b.getFullYear(),v=a&&a.getFullYear()===y?a.getMonth():-1,u=v!==-1?v:T===y?k:0,c=f=>{let D=x.current?.querySelectorAll("button")?.[f];D&&D.focus()},g=(f,S)=>{let D=null;if(f.key==="ArrowRight")f.preventDefault(),S+1<d.monthsShort.length&&(D=S+1);else if(f.key==="ArrowLeft")f.preventDefault(),S-1>=0&&(D=S-1);else if(f.key==="ArrowDown")f.preventDefault(),S+3<d.monthsShort.length&&(D=S+3);else if(f.key==="ArrowUp")f.preventDefault(),S-3>=0&&(D=S-3);else if(f.key==="Home")f.preventDefault(),D=0;else if(f.key==="End")f.preventDefault(),D=d.monthsShort.length-1;else if(f.key==="Enter"||f.key===" "){f.preventDefault(),t(S);return}D!==null&&c(D)};return Fl("div",{ref:x,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>h?.(null),children:d.monthsShort.map((f,S)=>{let D=new Date(y,S,1),R=D.getTime(),P=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,I=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,E=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,N=!!P&&P===R,M=!!I&&I===R,z=!1,H=!1;P&&I?z=R>P&&R<I:P&&!I&&E&&(E>P?H=R>P&&R<=E:E<P&&(H=R<P&&R>=E));let V=T===y&&k===S,Y=S===u,$="text-neutral-800 hover:bg-neutral-100";return N||M?$=`${p.selected} font-semibold shadow-xs`:z||H?$=`${p.rangeBg} ${p.rangeText}`:V&&($=`ring-1 ${p.todayRing} font-semibold`),Fl("div",{role:"gridcell","aria-selected":N||M||z,className:"flex items-center justify-center",children:Fl("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:F=>g(F,S),onClick:()=>t(S),onMouseEnter:()=>h?.(D),"aria-label":`${f} ${y}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${$}`,children:f})},f)})})}import{useRef as $b}from"react";import{jsx as El}from"react/jsx-runtime";function lo({currentMonth:e,onSelectYear:t,size:r="md",color:n="primary",radius:o,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let h=C(r,_t,"md"),d=C(n,Jr,"primary"),w=C(o,vr,"lg"),p=$b(null),m=e.getFullYear(),x=Math.floor(m/10)*10,y=new Date().getFullYear(),b=[];for(let f=0;f<12;f++)b.push(x+f);let k=i?i.getFullYear():m,T=b.indexOf(k),v=b.indexOf(y),u=T!==-1?T:v!==-1?v:0,c=f=>{let D=p.current?.querySelectorAll("button")?.[f];D&&D.focus()},g=(f,S)=>{let D=null;if(f.key==="ArrowRight")f.preventDefault(),S+1<b.length&&(D=S+1);else if(f.key==="ArrowLeft")f.preventDefault(),S-1>=0&&(D=S-1);else if(f.key==="ArrowDown")f.preventDefault(),S+3<b.length&&(D=S+3);else if(f.key==="ArrowUp")f.preventDefault(),S-3>=0&&(D=S-3);else if(f.key==="Home")f.preventDefault(),D=0;else if(f.key==="End")f.preventDefault(),D=b.length-1;else if(f.key==="Enter"||f.key===" "){f.preventDefault();let R=b[S];R!==void 0&&t(R);return}D!==null&&c(D)};return El("div",{ref:p,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:b.map((f,S)=>{let D=i?i.getFullYear():null,R=a?a.getFullYear():null,P=s?s.getFullYear():null,I=D!==null&&f===D,E=R!==null&&f===R,N=!1,M=!1;D!==null&&R!==null?N=f>D&&f<R:D!==null&&R===null&&P!==null&&(P>D?M=f>D&&f<=P:P<D&&(M=f<D&&f>=P));let z=f===y,H=S===u,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${d.selected} font-semibold shadow-xs`:N||M?V=`${d.rangeBg} ${d.rangeText}`:z&&(V=`ring-1 ${d.todayRing} font-semibold`),El("div",{role:"gridcell","aria-selected":I||E||N,className:"flex items-center justify-center",children:El("button",{type:"button",tabIndex:H?0:-1,onKeyDown:Y=>g(Y,S),onClick:()=>t(f),onMouseEnter:()=>l?.(new Date(f,0,1)),"aria-label":`${f}`,className:`w-full flex items-center justify-center h-10 ${h.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:f})},f)})})}function Ll(e,t,r){if(!t||!r)return!1;let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(o,i),s=Math.max(o,i);return n>=a&&n<=s}function Zd(e,t){return new Date(e,t+1,0).getDate()}function $l(e,t,r,n,o,i,a,s,l){let h=n?qr(e,n):!1,d=o?qr(e,o):!1,w=Ll(e,n||null,o||null),p=n&&!o&&i?Ll(e,n,i):!1,m=!1;return a&&qo(e,a)&&(m=!0),s&&Zo(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:qr(e,r),isSelected:h||d,isDisabled:m,isRangeStart:h,isRangeEnd:d,isInRange:w,isHoveredRange:p,weekNumber:Jo(e)}}function ai(e,t,r=1,n,o,i,a,s,l){let h=[],d=new Date,w=new Date(e,t,1).getDay(),p=Zd(e,t-1),m=Zd(e,t),x=r===1?w===0?6:w-1:w;for(let b=x-1;b>=0;b--){let k=p-b,T=new Date(e,t-1,k);h.push($l(T,!1,d,n,o,i,a,s,l))}for(let b=1;b<=m;b++){let k=new Date(e,t,b);h.push($l(k,!0,d,n,o,i,a,s,l))}let y=42-h.length;for(let b=1;b<=y;b++){let k=new Date(e,t+1,b);h.push($l(k,!1,d,n,o,i,a,s,l))}return h}import{jsx as sr,jsxs as Ea}from"react/jsx-runtime";function co({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:h=!1,showViewTabs:d=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:x,className:y="",bordered:b=!0}){let k=C(p,_t,"md"),T=C(x,Pa,"lg"),[v,u]=si(r),[c,g]=si(r);r!==c&&(g(r),u(r));let f=e?e[0]:null,S=e?e[1]:null,[D,R]=si(()=>{let L=f||new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),P=dt(s),I=Fa(()=>{let L=P.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(te=>({key:te,label:L[te]||te}))},[w,P.viewTabs]),E=L=>{let te=L;u(te),F(null),n?.(te)},N=()=>{let L=new Date(D.getFullYear(),D.getMonth()-1,1);R(L)},M=()=>{let L=new Date(D.getFullYear(),D.getMonth()+1,1);R(L)},z=()=>{let L=new Date(D.getFullYear()-1,D.getMonth(),1);R(L)},H=()=>{let L=new Date(D.getFullYear()+1,D.getMonth(),1);R(L)},V=()=>{let L=new Date(D.getFullYear()-10,D.getMonth(),1);R(L)},Y=()=>{let L=new Date(D.getFullYear()+10,D.getMonth(),1);R(L)},[$,F]=si(null),[G,A]=si(null),U=L=>{if(!$)F(L),t?.([L,null]);else{let te=$,Z=L;L.getTime()<te.getTime()&&(te=L,Z=$),F(null),t?.([te,Z])}},B=(L,te)=>{let Z=new Date(L,te,1);if(R(Z),d&&r==="months")if(!$)F(Z),t?.([Z,null]);else{let he=$,ae=Z;Z.getTime()<he.getTime()&&(he=Z,ae=$),F(null),t?.([he,ae])}else u("days")},X=L=>{let te=new Date(L,0,1);if(R(te),d&&r==="years")if(!$)F(te),t?.([te,null]);else{let Z=$,he=te;te.getTime()<Z.getTime()&&(Z=te,he=$),F(null),t?.([Z,he])}else u("months")},le=mt(o),ne=mt(i),ue=D,ie=Fa(()=>v==="months"?new Date(D.getFullYear()+1,D.getMonth(),1):v==="years"?new Date(D.getFullYear()+10,D.getMonth(),1):new Date(D.getFullYear(),D.getMonth()+1,1),[D,v]),Q=$||f,q=$?null:S,ge=Fa(()=>ai(ue.getFullYear(),ue.getMonth(),l,Q,q,G,le,ne,a),[ue,l,Q,q,G,le,ne,a]),ke=Fa(()=>ai(ie.getFullYear(),ie.getMonth(),l,Q,q,G,le,ne,a),[ie,l,Q,q,G,le,ne,a]);return Ea("div",{className:`inline-flex flex-col ${b?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${y}`,children:[d&&I.length>0&&sr("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:sr(wn,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:sr(Cn,{className:"p-0.5",children:I.map(L=>sr(kn,{value:L.key,className:"py-1 px-2 text-xs",children:L.label},L.key))})})}),sr(oi,{month1:ue,month2:ie,view:v,onViewChange:u,onPrevMonth:N,onNextMonth:M,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:Y,size:p,color:m,locale:s}),Ea("div",{className:"flex flex-row divide-x divide-neutral-200",children:[Ea("div",{className:`${k.calendarPadding} min-w-70`,children:[v==="days"&&sr(ao,{days:ge,onSelectDate:U,onHoverDate:A,size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&sr(so,{currentMonth:ue,onSelectMonth:L=>B(ue.getFullYear(),L),size:p,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),v==="years"&&sr(lo,{currentMonth:ue,onSelectYear:X,size:p,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]}),Ea("div",{className:`${k.calendarPadding} min-w-70`,children:[v==="days"&&sr(ao,{days:ke,onSelectDate:U,onHoverDate:A,size:p,color:m,radius:x,locale:s,firstDayOfWeek:l,showWeekNumbers:h}),v==="months"&&sr(so,{currentMonth:ie,onSelectMonth:L=>B(ie.getFullYear(),L),size:p,color:m,radius:x,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),v==="years"&&sr(lo,{currentMonth:ie,onSelectYear:X,size:p,color:m,radius:x,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]})]})]})}import{jsx as ht,jsxs as $a}from"react/jsx-runtime";function Tn({ref:e,value:t,defaultValue:r,onChange:n,separator:o=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:h=1,minDate:d,maxDate:w,isDateDisabled:p,size:m="md",variant:x="outline",color:y="primary",radius:b,label:k,labelPlacement:T="top",placeholder:v,helperText:u,errorMessage:c,name:g,id:f,autoComplete:S,viewTabs:D=["days","months","years"],view:R,onViewChange:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,portal:z=!0,config:H,className:V="",wrapperClassName:Y="",inputWrapperClassName:$="",labelClassName:F="",helperClassName:G="",popoverClassName:A=""}){let{isRequired:U=!1,isInvalid:B=!1,isLoading:X=!1,showSpinner:le=!1,isClearable:ne=!0,isFullWidth:ue=!1,showWeekNumbers:ie=!1,showViewTabs:Q=!1,closeOnSelect:q=!0}=H??{},ge=Lb(),ke=f||ge,L=`${ke}-error-helper`,te=`${ke}-popover`,Z=R!==void 0,[he,ae]=Bl(s),ve=Z?R:he,Se=a||i,ye=Bb(()=>Da(Se,ve),[Se,ve]),J=t!==void 0,[O,W]=Bl(()=>{let be=r;return be&&Array.isArray(be)?[mt(be[0],i),mt(be[1],i)]:[null,null]}),we=J&&t&&Array.isArray(t)?[mt(t[0],i),mt(t[1],i)]:O,fe=we[0]&&we[1]?`${Ht(we[0],ye,l)}${o}${Ht(we[1],ye,l)}`:we[0]?`${Ht(we[0],ye,l)}${o}`:"",[se,me]=Bl(!1),{refs:{setReference:De,setFloating:xe},floatingStyles:re,context:de}=Hb({placement:E,open:se&&!N&&!M&&!X,onOpenChange:me,whileElementsMounted:Vb,transform:!1,middleware:[Ab(6),Ob(),Gb({padding:8})]}),ce=Ub(de,{escapeKey:!0,outsidePress:!0}),ee=jb(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=Yb([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),oe=!!(B||c),Te=oe?"error":y,Pe=C(m,_t,"md"),_e=C(b,vr,"lg"),Ue=C(x,za,"outline"),Le=x==="other"?"":C(Te,Ue,"primary"),Be=!!we[0],Ke=be=>{Z||ae(be),P?.(be)},K=be=>{J||W(be);let[Ve,rt]=be;if(Ve&&rt){let Je=[Ht(Ve,i,l),Ht(rt,i,l)];n?.(Je),q&&me(!1)}},_=be=>{N||M||X||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),J||W([null,null]),n?.(null),I?.()},pe=v||`${ye}${o}${ye}`,Me=T==="floating",Xe=T==="left",He=()=>ht(at,{htmlFor:ke,label:k,isRequired:U,isFloating:Me,size:m,color:Te,hasError:oe,cursor:"pointer",className:F}),Ze=be=>ht("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),qe=["group/field group/daterangepicker relative flex",Xe?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",ue?"w-full":"inline-flex",Y].filter(Boolean).join(" "),Re=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,_e,Le,N?"opacity-50":"",ue?"w-full":"w-auto",$].filter(Boolean).join(" "),Ye=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,V].filter(Boolean).join(" ");return z?$a("div",{className:qe,children:[!Me&&He(),$a("div",{className:`flex flex-col ${ue?"w-full":""}`,children:[$a("div",{ref:De,...j(),className:Re,children:[Me&&He(),ht("input",{ref:e,id:ke,name:g,type:"text",value:fe,onClick:()=>!N&&!M&&!X&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:S,placeholder:pe,disabled:N||X,role:"combobox","aria-expanded":se&&!X,"aria-haspopup":"dialog","aria-controls":te,"aria-required":U,"aria-invalid":oe,"aria-busy":X,"aria-disabled":N||X,"aria-describedby":u||c?L:void 0,"aria-errormessage":c?L:void 0,className:Ye}),$a("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&le&&ht("div",{className:"flex items-center justify-center shrink-0",children:Ze(ht(Ne,{}))}),!X&&ne&&!N&&!M&&ht("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Be?0:-1,"aria-hidden":!Be,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Be?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:ht(Oe,{className:"size-full"})}),ht("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:Ze(ht(lt,{className:"size-full"}))})]})]}),Ee&&ht(Wb,{children:ht(Kb,{context:de,modal:!1,returnFocus:!0,children:ht("div",{ref:xe,id:te,style:{...re,...Fe,zIndex:Qe.PICKER},...Ce(),className:A,children:ht(co,{value:we,onChange:K,view:ve,onViewChange:Ke,minDate:d,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:h,showWeekNumbers:ie,size:m,color:y,radius:b,showViewTabs:Q,viewTabs:D})})})}),ht($e,{id:L,helperText:u,errorMessage:c,sizeClassName:Pe.helper,className:G})]})]}):ht("div",{className:V,children:ht(co,{bordered:!1,value:we,onChange:K,view:ve,onViewChange:Ke,minDate:d,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:h,showWeekNumbers:ie,size:m,color:y,radius:b,showViewTabs:Q,viewTabs:D})})}import{useState as s0,useId as Xb}from"react";import{useFloating as qb,autoUpdate as Zb,offset as Jb,flip as Qb,shift as eh,useDismiss as th,useRole as rh,useInteractions as nh,FloatingPortal as oh,FloatingFocusManager as ih}from"@floating-ui/react";import{useMemo as uo}from"react";var Qr={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,panelPadding:"p-1.5",columnWidth:"w-12",columnHeight:"h-36",itemHeight:"h-6",itemText:"text-[11px]",headerText:"text-[11px] font-semibold",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,panelPadding:"p-2",columnWidth:"w-14",columnHeight:"h-44",itemHeight:"h-7",itemText:"text-xs",headerText:"text-xs font-semibold",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,panelPadding:"p-2.5",columnWidth:"w-16",columnHeight:"h-52",itemHeight:"h-8",itemText:"text-sm",headerText:"text-sm font-semibold",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,panelPadding:"p-3",columnWidth:"w-18",columnHeight:"h-60",itemHeight:"h-9",itemText:"text-base",headerText:"text-base font-semibold",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,panelPadding:"p-3.5",columnWidth:"w-20",columnHeight:"h-68",itemHeight:"h-10",itemText:"text-base",headerText:"text-lg font-semibold",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}},La={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ba={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Jd={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},Qd={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var Ha={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function lr(e){return e<10?`0${e}`:`${e}`}function en(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function Vt(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let o=new Date(t);if(!isNaN(o.getTime()))return o}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,n=t.match(r);if(n){let o=parseInt(n[1],10),i=parseInt(n[2],10),a=n[3]?parseInt(n[3],10):0,s=n[4]?.toUpperCase();if(s&&(s==="PM"&&o<12&&(o+=12),s==="AM"&&o===12&&(o=0)),o>=0&&o<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(o,i,a,0),l}}return null}function It(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,lr(r)).replace(/H/g,`${r}`).replace(/hh/g,lr(i)).replace(/h/g,`${i}`).replace(/mm/g,lr(n)).replace(/m/g,`${n}`).replace(/ss/g,lr(o)).replace(/s/g,`${o}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function e0(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function Dn(e,t,r=0){let n=new Date;return n.setHours(e,t,r,0),n}function t0(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function r0(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<n}function n0(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>n}function Rn(e,t,r,n,o,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||o&&t<o.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&t<o.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,n).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&n<o.getMinutes()||r===o.getHours()&&n===o.getMinutes()&&t<o.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&n>i.getMinutes()||r===i.getHours()&&n===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}import{useEffect as _b,useRef as o0}from"react";import{jsx as i0}from"react/jsx-runtime";function tn({items:e,selectedValue:t,onSelect:r,ariaLabel:n,size:o="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:h=""}){let d=o0(null),w=o0(null),p=C(o,Qr,"md"),m=C(i,Qd,"primary"),x=C(a,Jd,"md"),y=e.findIndex(v=>!v.disabled),b=e.some(v=>v.value===t);_b(()=>{if(w.current&&d.current){let v=d.current,u=w.current,c=u.offsetTop-v.offsetTop-(v.clientHeight-u.clientHeight)/2;v.scrollTo({top:Math.max(0,c),behavior:"smooth"}),v.contains(document.activeElement)&&u.focus()}},[t]);let k=v=>{let u=e[v];if(!u||u.disabled)return;r(u.value),d.current?.children[v]?.focus()},T=(v,u)=>{if(e.filter(g=>!g.disabled).length){if(v.key==="ArrowDown"){v.preventDefault();for(let g=u+1;g<e.length;g++)if(!e[g].disabled){k(g);break}}else if(v.key==="ArrowUp"){v.preventDefault();for(let g=u-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(v.key==="ArrowRight")v.preventDefault(),d.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="ArrowLeft")v.preventDefault(),d.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(v.key==="Home"){v.preventDefault();let g=e.findIndex(f=>!f.disabled);g!==-1&&k(g)}else if(v.key==="End"){v.preventDefault();for(let g=e.length-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(v.key==="Enter"||v.key===" "){v.preventDefault();let g=e[u];g&&!g.disabled&&k(u)}}};return i0("ul",{ref:d,role:"listbox","aria-label":n,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${p.columnWidth} ${p.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((v,u)=>{let c=t===v.value,g=!!v.disabled,f=!g&&(c||!b&&u===y);return i0("li",{ref:c?w:void 0,role:"option","aria-selected":c,"aria-disabled":g,"aria-label":`${v.label} ${n||""}`.trim(),tabIndex:f?0:-1,onKeyDown:S=>T(S,u),onClick:()=>{g||k(u)},className:`flex items-center justify-center shrink-0 transition-colors duration-150 mx-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${x} ${p.itemHeight} ${p.itemText} ${g?"opacity-30 cursor-not-allowed text-neutral-400":c?`${m.selected} cursor-default ${h}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:v.label},`${v.value}`)})})}import{jsx as fo,jsxs as a0}from"react/jsx-runtime";function qt({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:n=!1,showSeconds:o=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:h,disabledHours:d,disabledMinutes:w,disabledSeconds:p,size:m="md",color:x="primary",radius:y,className:b=""}){let k=uo(()=>Vt(l),[l]),T=uo(()=>Vt(h),[h]),v=en(n,o),u=C(y,Ba,"lg"),c=C(m,Qr,"md"),g=e?e.getHours():0,f=g%12===0?12:g%12,S=e?e.getMinutes():0,D=e?e.getSeconds():0,R=g>=12?"PM":"AM",P=uo(()=>{let $=[];if(n)for(let F=1;F<=12;F+=i){let G=R==="PM"?F===12?12:F+12:F===12?0:F,A=Rn("hour",G,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:A})}else for(let F=0;F<24;F+=i){let G=Rn("hour",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[n,i,R,g,S,k,T,d,w,p]),I=uo(()=>{let $=[];for(let F=0;F<60;F+=a){let G=Rn("minute",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[a,g,S,k,T,d,w,p]),E=uo(()=>{if(!o)return[];let $=[];for(let F=0;F<60;F+=s){let G=Rn("second",F,g,S,k,T,d,w,p);$.push({value:F,label:lr(F),disabled:G})}return $},[o,s,g,S,k,T,d,w,p]),N=uo(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),M=$=>{let F=Number($);n&&(R==="PM"&&F<12&&(F+=12),R==="AM"&&F===12&&(F=0));let G=Dn(F,S,D);t?.(G)},z=$=>{let F=Number($),G=Dn(g,F,D);t?.(G)},H=$=>{let F=Number($),G=Dn(g,S,F);t?.(G)},V=$=>{let F=$,G=g;F==="AM"&&G>=12?G-=12:F==="PM"&&G<12&&(G+=12);let A=Dn(G,S,D);t?.(A)},Y=o?"--:--:--":"--:--";return a0("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${u} ${b}`,children:[fo("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:fo("span",{className:`text-neutral-700 tracking-wider font-mono ${c.headerText}`,children:e?It(e,v):Y})}),a0("div",{className:`flex divide-x divide-neutral-200 ${c.panelPadding}`,children:[fo(tn,{ariaLabel:"Gi\u1EDD",items:P,selectedValue:n?f:e?g:null,onSelect:M,size:m,color:x,radius:y}),fo(tn,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?S:null,onSelect:z,size:m,color:x,radius:y}),o&&fo(tn,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?D:null,onSelect:H,size:m,color:x,radius:y}),n&&fo(tn,{ariaLabel:"Bu\u1ED5i",items:N,selectedValue:e?R:null,onSelect:V,size:m,color:x,radius:y})]})]})}import{jsx as Mt,jsxs as Va}from"react/jsx-runtime";function Hl({ref:e,value:t,defaultValue:r,onChange:n,format:o="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:h=1,secondStep:d=1,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:x,disabledSeconds:y,size:b="md",variant:k="outline",color:T="primary",radius:v,label:u,labelPlacement:c="top",placeholder:g,helperText:f,errorMessage:S,name:D,id:R,autoComplete:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:U=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,closeOnSelect:ue=!1}=z??{},ie=Xb(),Q=R||ie,q=`${Q}-error-helper`,ge=`${Q}-popover`,ke=en(a,s),L=o||ke,te=i||L,Z=t!==void 0,[he,ae]=s0(()=>Vt(r)),ve=Z?Vt(t):he,Se=ve?It(ve,te):"",[ye,J]=s0(!1),{refs:{setReference:O,setFloating:W},floatingStyles:we,context:fe}=qb({placement:E,open:ye&&!N&&!M&&!B,onOpenChange:J,whileElementsMounted:Zb,transform:!1,middleware:[Jb(6),Qb(),eh({padding:8})]}),se=th(fe,{escapeKey:!0,outsidePress:!0}),me=rh(fe,{role:"dialog"}),{getReferenceProps:De,getFloatingProps:xe}=nh([se,me]),{isMounted:re,styles:de}=et(fe),ce=!!(U||S),ee=ce?"error":T,j=C(b,Qr,"md"),Ce=C(v,La,"lg"),Ee=k==="other"?"":C(ee,C(k,Ha,"outline"),"primary"),Fe=!!ve,oe=pe=>{Z||ae(pe);let Me=pe?It(pe,L):"";n?.(Me),ue&&J(!1)},Te=pe=>{N||M||B||(pe.key==="ArrowDown"||pe.key==="Enter"||pe.key===" "?(pe.preventDefault(),ye||J(!0)):pe.key==="Escape"&&ye&&(pe.preventDefault(),J(!1)))},Pe=pe=>{pe.stopPropagation(),Z||ae(null),n?.(null),I?.()},_e=g||te,Ue=c==="floating",Le=c==="left",Be=()=>Mt(at,{htmlFor:Q,label:u,isRequired:A,isFloating:Ue,size:b,color:ee,hasError:ce,cursor:"pointer",className:$}),Ke=pe=>Mt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${j.icon}`,"aria-hidden":"true",children:pe}),K=["group/field group/timepicker relative flex",Le?"flex-row items-center gap-3":"flex-col",Ue?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),_=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",j.inputHeight,Ce,Ee,N?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),ze=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",j.inputText,j.inputPadding,H].filter(Boolean).join(" ");return Va("div",{className:K,children:[!Ue&&Be(),Va("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[Va("div",{ref:O,...De(),className:_,children:[Ue&&Be(),Mt("input",{ref:e,id:Q,name:D,type:"text",value:Se,onClick:()=>!N&&!M&&!B&&J(pe=>!pe),onKeyDown:Te,readOnly:!0,autoComplete:P,placeholder:_e,disabled:N||B,role:"combobox","aria-expanded":ye&&!B,"aria-haspopup":"dialog","aria-controls":ge,"aria-required":A,"aria-invalid":ce,"aria-busy":B,"aria-disabled":N||B,"aria-describedby":f||S?q:void 0,"aria-errormessage":S?q:void 0,className:ze}),Va("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&Mt("div",{className:"flex items-center justify-center shrink-0",children:Ke(Mt(Ne,{}))}),!B&&le&&!N&&!M&&Mt("button",{type:"button",onClick:Pe,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:Fe?0:-1,"aria-hidden":!Fe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${j.icon} ${Fe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:Mt(Oe,{className:"size-full"})}),Mt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ye?"rotate-180":"rotate-0"}`,children:Ke(Mt(lt,{className:"size-full"}))})]})]}),re&&Mt(oh,{children:Mt(ih,{context:fe,modal:!1,returnFocus:!0,children:Mt("div",{ref:W,id:ge,style:{...we,...de,zIndex:Qe.PICKER},...xe(),className:G,children:Mt(qt,{value:ve,onChange:oe,ariaLabel:typeof u=="string"?`${u} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:h,secondStep:d,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:x,disabledSeconds:y,size:b,color:T,radius:v})})})}),Mt($e,{id:q,helperText:f,errorMessage:S,sizeClassName:j.helper,className:F})]})]})}import{useState as f0,useId as ah,useMemo as sh}from"react";import{useFloating as lh,autoUpdate as ch,offset as uh,flip as dh,shift as fh,useDismiss as ph,useRole as gh,useInteractions as mh,FloatingPortal as bh,FloatingFocusManager as hh}from"@floating-ui/react";var l0=Qr,c0=La,u0=Ba,d0=Ha;import{jsx as xt,jsxs as Nn}from"react/jsx-runtime";function Vl({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:h=!1,showSeconds:d=!0,hourStep:w=1,minuteStep:p=1,secondStep:m=1,minTime:x,maxTime:y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v="md",variant:u="outline",color:c="primary",radius:g,label:f,labelPlacement:S="top",placeholder:D,placeholders:R,helperText:P,errorMessage:I,name:E,id:N,autoComplete:M,disabled:z=!1,readOnly:H=!1,config:V,onClear:Y,placement:$="bottom-start",className:F="",wrapperClassName:G="",inputWrapperClassName:A="",labelClassName:U="",helperClassName:B="",popoverClassName:X=""}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,isClearable:Q=!0,isFullWidth:q=!1,closeOnSelect:ge=!1}=V??{},ke=ah(),L=N||ke,te=`${L}-error-helper`,Z=`${L}-popover`,he=en(h,d),ae=o||he,ve=i||ae,Se=t!==void 0,[ye,J]=f0(()=>{let be=r;return be&&Array.isArray(be)?[Vt(be[0]),Vt(be[1])]:[null,null]}),O=Se&&t&&Array.isArray(t)?[Vt(t[0]),Vt(t[1])]:ye,W=O[0]?It(O[0],ve):"",we=O[1]?It(O[1],ve):"",fe=sh(()=>W&&we?`${W}${a}${we}`:W?`${W}${a}`:"",[W,we,a]),[se,me]=f0(!1),{refs:{setReference:De,setFloating:xe},floatingStyles:re,context:de}=lh({placement:$,open:se&&!z&&!H&&!ue,onOpenChange:me,whileElementsMounted:ch,transform:!1,middleware:[uh(6),dh(),fh({padding:8})]}),ce=ph(de,{escapeKey:!0,outsidePress:!0}),ee=gh(de,{role:"dialog"}),{getReferenceProps:j,getFloatingProps:Ce}=mh([ce,ee]),{isMounted:Ee,styles:Fe}=et(de),oe=!!(ne||I),Te=oe?"error":c,Pe=C(v,l0,"md"),_e=C(g,c0,"lg"),Ue=C(g,u0,"lg"),Le=u==="other"?"":C(Te,C(u,d0,"outline"),"primary"),Be=!!(O[0]||O[1]),Ke=be=>{let Ve=[be,O[1]];Se||J(Ve);let rt=It(be,ae),Je=O[1]?It(O[1],ae):"";n?.([rt,Je])},K=be=>{let Ve=[O[0],be];Se||J(Ve);let rt=O[0]?It(O[0],ae):"",Je=It(be,ae);n?.([rt,Je]),ge&&me(!1)},_=be=>{z||H||ue||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),Se||J([null,null]),n?.(null),Y?.()},pe=D||(R?`${R[0]}${a}${R[1]}`:`${ve}${a}${ve}`),Me=S==="floating",Xe=S==="left",He=()=>xt(at,{htmlFor:L,label:f,isRequired:le,isFloating:Me,size:v,color:Te,hasError:oe,cursor:"pointer",className:U}),Ze=be=>xt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),qe=["group/field group/timerangepicker relative flex",Xe?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",q?"w-full":"inline-flex",G].filter(Boolean).join(" "),Re=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,_e,Le,z?"opacity-50":"",q?"w-full":"w-auto",A].filter(Boolean).join(" "),Ye=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,F].filter(Boolean).join(" ");return Nn("div",{className:qe,children:[!Me&&He(),Nn("div",{className:`flex flex-col ${q?"w-full":""}`,children:[Nn("div",{ref:De,...j(),className:Re,children:[Me&&He(),xt("input",{ref:e,id:L,name:E,type:"text",value:fe,onClick:()=>!z&&!H&&!ue&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:M,placeholder:pe,disabled:z||ue,role:"combobox","aria-expanded":se&&!ue,"aria-haspopup":"dialog","aria-controls":Z,"aria-required":le,"aria-invalid":oe,"aria-busy":ue,"aria-disabled":z||ue,"aria-describedby":P||I?te:void 0,"aria-errormessage":I?te:void 0,className:Ye}),Nn("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ue&&ie&&xt("div",{className:"flex items-center justify-center shrink-0",children:Ze(xt(Ne,{}))}),!ue&&Q&&!z&&!H&&xt("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Be?0:-1,"aria-hidden":!Be,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Be?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:xt(Oe,{className:"size-full"})}),xt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:Ze(xt(lt,{className:"size-full"}))})]})]}),Ee&&xt(bh,{children:xt(hh,{context:de,modal:!1,returnFocus:!0,children:Nn("div",{ref:xe,id:Z,style:{...re,...Fe,zIndex:Qe.PICKER},...Ce(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${Ue} ${X}`,children:[Nn("div",{className:"flex flex-col",children:[xt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),xt(qt,{value:O[0],onChange:Ke,ariaLabel:s,use12Hours:h,showSeconds:d,hourStep:w,minuteStep:p,secondStep:m,minTime:x,maxTime:O[1]||y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v,color:c,radius:g,className:"border-none shadow-none"})]}),Nn("div",{className:"flex flex-col",children:[xt("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:l}),xt(qt,{value:O[1],onChange:K,ariaLabel:l,use12Hours:h,showSeconds:d,hourStep:w,minuteStep:p,secondStep:m,minTime:O[0]||x,maxTime:y,disabledHours:b,disabledMinutes:k,disabledSeconds:T,size:v,color:c,radius:g,className:"border-none shadow-none"})]})]})})}),xt($e,{id:te,helperText:P,errorMessage:I,sizeClassName:Pe.helper,className:B})]})]})}function p0(e,t,r){if(!e||!t||!r)return!1;let n=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return n>=o&&n<=i}import{useState as Al,useId as xh}from"react";import{useFloating as vh,autoUpdate as yh,offset as wh,flip as Ch,shift as kh,useDismiss as Sh,useRole as Th,useInteractions as Dh,FloatingPortal as Rh,FloatingFocusManager as Nh}from"@floating-ui/react";function rn(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function Zt(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function Jt(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let o=li(e,t);if(o)return o}let n=new Date(e);return isNaN(n.getTime())?null:n}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function At(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":Ht(e,t,r)}function li(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,h=!1,d=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let y=new Date(r);return isNaN(y.getTime())?null:y}let p="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let y of w)y==="YYYY"?p=p.replace("YYYY","(\\d{4})"):y==="YY"?p=p.replace("YY","(\\d{2})"):y==="MM"||y==="M"||y==="DD"||y==="D"||y==="HH"||y==="H"||y==="hh"||y==="h"||y==="mm"||y==="m"||y==="ss"||y==="s"?p=p.replace(y,"(\\d{1,2})"):(y==="A"||y==="a")&&(p=p.replace(y,"(AM|PM|am|pm)"));p+="$";let m=new RegExp(p,"i").exec(r);if(!m){let y=new Date(r);return isNaN(y.getTime())?null:y}w.forEach((y,b)=>{let k=m[b+1];if(!k)return;if(y==="A"||y==="a"){h=!0,k.toUpperCase()==="PM"&&(d=!0);return}let T=parseInt(k,10);isNaN(T)||(y==="YYYY"?n=T:y==="YY"?n=2e3+T:y==="MM"||y==="M"?o=T:y==="DD"||y==="D"?i=T:y==="HH"||y==="H"?a=T:y==="hh"||y==="h"?(h=!0,a=T):y==="mm"||y==="m"?s=T:(y==="ss"||y==="s")&&(l=T))}),h&&(d?a<12&&(a+=12):a===12&&(a=0));let x=new Date(n,o-1,i,a,s,l);return isNaN(x.getTime())?null:x}var g0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},m0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},b0={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var h0={outline:{primary:"bg-neutral-white border-2 border-neutral-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-2 border-neutral-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-2 border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-2 border-neutral-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-2 border-neutral-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-2 border-neutral-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-2 border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-2 border-transparent hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-2 border-transparent hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-error-50/60 border-2 border-transparent hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-2 border-transparent hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-2 border-transparent hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-2 border-transparent hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-50/60 border-2 border-transparent hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},ghost:{primary:"bg-transparent border-2 border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-2 border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-transparent border-2 border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-2 border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-2 border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-2 border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-transparent border-2 border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20"}};import{jsx as vt,jsxs as ci}from"react/jsx-runtime";function Ol({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:h=1,minDate:d,maxDate:w,isDateDisabled:p,viewTabs:m,use12Hours:x=!1,showSeconds:y=!0,hourStep:b=1,minuteStep:k=1,secondStep:T=1,minTime:v,maxTime:u,disabledHours:c,disabledMinutes:g,disabledSeconds:f,size:S="md",variant:D="outline",color:R="primary",radius:P,label:I,labelPlacement:E="top",placeholder:N,helperText:M,errorMessage:z,name:H,id:V,autoComplete:Y,disabled:$=!1,readOnly:F=!1,config:G,onClear:A,placement:U="bottom-start",className:B="",wrapperClassName:X="",inputWrapperClassName:le="",labelClassName:ne="",helperClassName:ue="",popoverClassName:ie=""}){let{isRequired:Q=!1,isInvalid:q=!1,isLoading:ge=!1,showSpinner:ke=!1,isClearable:L=!0,isFullWidth:te=!1,closeOnSelect:Z=!1,showWeekNumbers:he=!1,showViewTabs:ae=!1}=G??{},ve=xh(),Se=V||ve,ye=`${Se}-error-helper`,J=`${Se}-popover`,O=rn(x,y),W=o||O,we=i||W,fe=t!==void 0,[se,me]=Al(()=>Jt(r,W)),De=fe?Jt(t,W):se,xe=De?At(De,we,s):"",[re,de]=Al(l),[ce,ee]=Al(!1),{refs:{setReference:j,setFloating:Ce},floatingStyles:Ee,context:Fe}=vh({placement:U,open:ce&&!$&&!F&&!ge,onOpenChange:ee,whileElementsMounted:yh,transform:!1,middleware:[wh(6),Ch(),kh({padding:8})]}),oe=Sh(Fe,{escapeKey:!0,outsidePress:!0}),Te=Th(Fe,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:_e}=Dh([oe,Te]),{isMounted:Ue,styles:Le}=et(Fe),Be=!!(q||z),Ke=Be?"error":R,K=C(S,b0,"md"),_=C(P,g0,"lg"),ze=C(P,m0,"lg"),pe=D==="other"?"":C(Ke,C(D,h0,"outline"),"primary"),Me=!!De,Xe=ot=>{let Dt=Zt(ot,De||new Date);fe||me(Dt);let cn=Dt?At(Dt,W,s):"";n?.(cn),Z&&ee(!1)},He=ot=>{if(!ot)return;let Dt=Zt(De||new Date,ot);fe||me(Dt);let cn=Dt?At(Dt,W,s):"";n?.(cn),Z&&ee(!1)},Ze=ot=>{$||F||ge||(ot.key==="ArrowDown"||ot.key==="Enter"||ot.key===" "?(ot.preventDefault(),ce||ee(!0)):ot.key==="Escape"&&ce&&(ot.preventDefault(),ee(!1)))},qe=ot=>{ot.stopPropagation(),fe||me(null),n?.(null),A?.()},Re=N||we,Ye=E==="floating",be=E==="left",Ve=()=>vt(at,{htmlFor:Se,label:I,isRequired:Q,isFloating:Ye,size:S,color:Ke,hasError:Be,cursor:"pointer",className:ne}),rt=ot=>vt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${K.icon}`,"aria-hidden":"true",children:ot}),Je=["group/field group/datetimepicker relative flex",be?"flex-row items-center gap-3":"flex-col",Ye?"pt-2":"",te?"w-full":"inline-flex",X].filter(Boolean).join(" "),Tt=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",K.inputHeight,_,pe,$?"opacity-50":"",te?"w-full":"w-auto",le].filter(Boolean).join(" "),Ft=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",K.inputText,K.inputPadding,B].filter(Boolean).join(" ");return ci("div",{className:Je,children:[!Ye&&Ve(),ci("div",{className:`flex flex-col ${te?"w-full":""}`,children:[ci("div",{ref:j,...Pe(),className:Tt,children:[Ye&&Ve(),vt("input",{ref:e,id:Se,name:H,type:"text",value:xe,onClick:()=>!$&&!F&&!ge&&ee(ot=>!ot),onKeyDown:Ze,readOnly:!0,autoComplete:Y,placeholder:Re,disabled:$||ge,role:"combobox","aria-expanded":ce&&!ge,"aria-haspopup":"dialog","aria-controls":J,"aria-required":Q,"aria-invalid":Be,"aria-busy":ge,"aria-disabled":$||ge,"aria-describedby":M||z?ye:void 0,"aria-errormessage":z?ye:void 0,className:Ft}),ci("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ge&&ke&&vt("div",{className:"flex items-center justify-center shrink-0",children:rt(vt(Ne,{}))}),!ge&&L&&!$&&!F&&vt("button",{type:"button",onClick:qe,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Me?0:-1,"aria-hidden":!Me,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${K.icon} ${Me?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:vt(Oe,{className:"size-full"})}),vt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ce?"rotate-180":"rotate-0"}`,children:rt(vt(lt,{className:"size-full"}))})]})]}),Ue&&vt(Rh,{children:vt(Nh,{context:Fe,modal:!1,returnFocus:!0,children:ci("div",{ref:Ce,id:J,style:{...Ee,...Le,zIndex:Qe.PICKER},..._e(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ze} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ie}`,children:[vt("div",{className:"flex flex-col",children:vt(xr,{value:De,onChange:Xe,view:re,onViewChange:de,minDate:d,maxDate:w,isDateDisabled:p,locale:s,firstDayOfWeek:h,showWeekNumbers:he,size:S,color:R,radius:P,showViewTabs:ae,viewTabs:m,className:"border-none shadow-none rounded-none"})}),vt("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:vt(qt,{value:De,onChange:He,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:x,showSeconds:y,hourStep:b,minuteStep:k,secondStep:T,minTime:v,maxTime:u,disabledHours:c,disabledMinutes:g,disabledSeconds:f,size:S,color:R,radius:P,className:"border-none shadow-none bg-transparent"})})]})})}),vt($e,{id:ye,helperText:M,errorMessage:z,sizeClassName:K.helper,className:ue})]})]})}import{useState as Aa,useId as Ph,useMemo as zh}from"react";import{useFloating as Ih,autoUpdate as Mh,offset as Fh,flip as Eh,shift as $h,useDismiss as Lh,useRole as Bh,useInteractions as Hh,FloatingPortal as Vh,FloatingFocusManager as Ah}from"@floating-ui/react";var x0={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var v0={primary:{activeStep:"bg-primary-500 border-primary-500 text-neutral-white shadow-xs",applyButton:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-neutral-white shadow-xs"},secondary:{activeStep:"bg-secondary-500 border-secondary-500 text-neutral-white shadow-xs",applyButton:"bg-secondary-500 hover:bg-secondary-600 active:bg-secondary-700 text-neutral-white shadow-xs"},error:{activeStep:"bg-error-500 border-error-500 text-neutral-white shadow-xs",applyButton:"bg-error-500 hover:bg-error-600 active:bg-error-700 text-neutral-white shadow-xs"},success:{activeStep:"bg-success-500 border-success-500 text-neutral-white shadow-xs",applyButton:"bg-success-500 hover:bg-success-600 active:bg-success-700 text-neutral-white shadow-xs"},warning:{activeStep:"bg-warning-500 border-warning-500 text-neutral-950 shadow-xs",applyButton:"bg-warning-500 hover:bg-warning-600 active:bg-warning-700 text-neutral-950 shadow-xs"},info:{activeStep:"bg-info-500 border-info-500 text-neutral-white shadow-xs",applyButton:"bg-info-500 hover:bg-info-600 active:bg-info-700 text-neutral-white shadow-xs"},neutral:{activeStep:"bg-neutral-800 border-neutral-800 text-neutral-white shadow-xs",applyButton:"bg-neutral-800 hover:bg-neutral-900 active:bg-neutral-950 text-neutral-white shadow-xs"}};import{jsx as gt,jsxs as yr}from"react/jsx-runtime";function Gl({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:h="side-by-side",locale:d="vi",defaultView:w="days",firstDayOfWeek:p=1,minDate:m,maxDate:x,isDateDisabled:y,viewTabs:b,use12Hours:k=!1,showSeconds:T=!0,hourStep:v=1,minuteStep:u=1,secondStep:c=1,minTime:g,maxTime:f,disabledHours:S,disabledMinutes:D,disabledSeconds:R,size:P="md",variant:I="outline",color:E="primary",radius:N,label:M,labelPlacement:z="top",placeholder:H,placeholders:V,helperText:Y,errorMessage:$,name:F,id:G,autoComplete:A,disabled:U=!1,readOnly:B=!1,config:X,onClear:le,placement:ne="bottom-start",className:ue="",wrapperClassName:ie="",inputWrapperClassName:Q="",labelClassName:q="",helperClassName:ge="",popoverClassName:ke=""}){let{isRequired:L=!1,isInvalid:te=!1,isLoading:Z=!1,showSpinner:he=!1,isClearable:ae=!0,isFullWidth:ve=!1,closeOnSelect:Se=!1,showWeekNumbers:ye=!1,showViewTabs:J=!1}=X??{},O=Ph(),W=G||O,we=`${W}-error-helper`,fe=`${W}-popover`,se=rn(k,T),me=o||se,De=i||me,xe=t!==void 0,[re,de]=Aa(()=>{let je=r;return je&&Array.isArray(je)?[Jt(je[0],me),Jt(je[1],me)]:[null,null]}),ce=xe?t&&Array.isArray(t)?[Jt(t[0],me),Jt(t[1],me)]:[null,null]:re,[ee,j]=Aa("start"),[Ce,Ee]=Aa(w),[Fe,oe]=Aa(!1),Te=ce[0]?At(ce[0],De,d):"",Pe=ce[1]?At(ce[1],De,d):"",_e=zh(()=>Te&&Pe?`${Te}${a}${Pe}`:Te?`${Te}${a}`:"",[Te,Pe,a]),{refs:{setReference:Ue,setFloating:Le},floatingStyles:Be,context:Ke}=Ih({placement:ne,open:Fe&&!U&&!B&&!Z,onOpenChange:oe,whileElementsMounted:Mh,transform:!1,middleware:[Fh(6),Eh(),$h({padding:8})]}),K=Lh(Ke,{escapeKey:!0,outsidePress:!0}),_=Bh(Ke,{role:"dialog"}),{getReferenceProps:ze,getFloatingProps:pe}=Hh([K,_]),{isMounted:Me,styles:Xe}=et(Ke),He=!!(te||$),Ze=He?"error":E,qe=C(P,x0,"md"),Re=C(N,vr,"lg"),Ye=C(N,Pa,"lg"),be=C(Ze,v0,"primary"),Ve=I==="other"?"":C(Ze,C(I,za,"outline"),"primary"),rt=!!(ce[0]||ce[1]),Je=je=>{xe||de(je);let Rt=je[0]?At(je[0],me,d):"",Gt=je[1]?At(je[1],me,d):"";n?.(Rt||Gt?[Rt,Gt]:null),Se&&je[0]&&je[1]&&oe(!1)},Tt=je=>{if(ee==="start"){let Rt=Zt(je,ce[0]||new Date),Gt=ce[1];Gt&&Rt&&Rt.getTime()>Gt.getTime()&&(Gt=null),Je([Rt,Gt])}else{let Rt=Zt(je,ce[1]||ce[0]||new Date);Je([ce[0],Rt])}},Ft=je=>{if(je)if(ee==="start"){let Rt=Zt(ce[0]||new Date,je),Gt=ce[1];Gt&&Rt&&Rt.getTime()>Gt.getTime()&&(Gt=null),Je([Rt,Gt])}else{let Rt=Zt(ce[1]||ce[0]||new Date,je);Je([ce[0],Rt])}},ot=je=>{U||B||Z||(je.key==="ArrowDown"||je.key==="Enter"||je.key===" "?(je.preventDefault(),Fe||oe(!0)):je.key==="Escape"&&Fe&&(je.preventDefault(),oe(!1)))},Dt=je=>{je.stopPropagation(),xe||de([null,null]),n?.(null),le?.()},cn=H||(V?`${V[0]}${a}${V[1]}`:`${De}${a}${De}`),Ie=z==="floating",Ae=z==="left",ut=()=>gt(at,{htmlFor:W,label:M,isRequired:L,isFloating:Ie,size:P,color:Ze,hasError:He,cursor:"pointer",className:q}),pt=je=>gt("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${qe.icon}`,"aria-hidden":"true",children:je}),Tr=["group/field group/datetimerangepicker relative flex",Ae?"flex-row items-center gap-3":"flex-col",Ie?"pt-2":"",ve?"w-full":"inline-flex",ie].filter(Boolean).join(" "),Et=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",qe.inputHeight,Re,Ve,U?"opacity-50":"",ve?"w-full":qe.minWidth||"min-w-80",Q].filter(Boolean).join(" "),Gn=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",qe.inputText,qe.inputPadding,ue].filter(Boolean).join(" "),Ic=ee==="start"?ce[0]:ce[1];return yr("div",{className:Tr,children:[!Ie&&ut(),yr("div",{className:`flex flex-col ${ve?"w-full":""}`,children:[yr("div",{ref:Ue,...ze(),className:Et,children:[Ie&&ut(),gt("input",{ref:e,id:W,name:F,type:"text",value:_e,onClick:()=>!U&&!B&&!Z&&oe(je=>!je),onKeyDown:ot,readOnly:!0,autoComplete:A,placeholder:cn,disabled:U||Z,role:"combobox","aria-expanded":Fe&&!Z,"aria-haspopup":"dialog","aria-controls":fe,"aria-required":L,"aria-invalid":He,"aria-busy":Z,"aria-disabled":U||Z,"aria-describedby":Y||$?we:void 0,"aria-errormessage":$?we:void 0,className:Gn}),yr("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[Z&&he&&gt("div",{className:"flex items-center justify-center shrink-0",children:pt(gt(Ne,{}))}),!Z&&ae&&!U&&!B&&gt("button",{type:"button",onClick:Dt,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:rt?0:-1,"aria-hidden":!rt,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${qe.icon} ${rt?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:gt(Oe,{className:"size-full"})}),gt("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${Fe?"rotate-180":"rotate-0"}`,children:pt(gt(lt,{className:"size-full"}))})]})]}),Me&&gt(Vh,{children:gt(Ah,{context:Ke,modal:!1,returnFocus:!0,children:yr("div",{ref:Le,id:fe,style:{...Be,...Xe,zIndex:Qe.PICKER},...pe(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Ye} ${ke}`,children:[yr("div",{className:`flex ${h==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[gt("div",{className:"flex flex-col",children:gt(xr,{value:Ic,onChange:Tt,view:Ce,onViewChange:Ee,minDate:ee==="end"&&ce[0]||m,maxDate:ee==="start"&&ce[1]||x,isDateDisabled:y,locale:d,firstDayOfWeek:p,showWeekNumbers:ye,size:P,color:E,radius:N,showViewTabs:J,viewTabs:b,className:"border-none shadow-none rounded-none"},`calendar-step-${ee}`)}),gt("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:gt(qt,{value:Ic||ce[0],onChange:Ft,ariaLabel:ee==="start"?`${s} time`:`${l} time`,use12Hours:k,showSeconds:T,hourStep:v,minuteStep:u,secondStep:c,minTime:ee==="end"&&ce[0]||g,maxTime:ee==="start"&&ce[1]||f,disabledHours:S,disabledMinutes:D,disabledSeconds:R,size:P,color:E,radius:N,className:"border-none shadow-none bg-transparent"},`timeview-step-${ee}`)})]}),yr("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[yr("div",{className:"flex items-center space-x-2",children:[yr("button",{type:"button",onClick:()=>j("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="start"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),yr("button",{type:"button",onClick:()=>j("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="end"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),gt("button",{type:"button",onClick:()=>oe(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${be.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),gt($e,{id:we,helperText:Y,errorMessage:$,sizeClassName:qe.helper,className:ge})]})]})}import{isValidElement as Oh}from"react";import Gh from"next/image";var y0={sm:{container:"p-3",imageWrapper:"w-16 h-16",defaultImageSize:64,title:"text-xs font-semibold text-neutral-800",description:"text-xs text-neutral-500",gap:"gap-2.5",contentGap:"gap-1",actionsGap:"mt-2"},md:{container:"p-6",imageWrapper:"w-28 h-28",defaultImageSize:112,title:"text-sm font-semibold text-neutral-800",description:"text-xs sm:text-sm text-neutral-500",gap:"gap-4",contentGap:"gap-1.5",actionsGap:"mt-3.5"},lg:{container:"p-10",imageWrapper:"w-40 h-40",defaultImageSize:160,title:"text-base font-semibold text-neutral-900",description:"text-sm text-neutral-500",gap:"gap-6",contentGap:"gap-2",actionsGap:"mt-5"}},w0={vertical:{container:"flex flex-col items-center justify-center text-center",content:"flex flex-col items-center justify-center text-center"},horizontal:{container:"flex flex-row items-center justify-start text-left",content:"flex flex-col items-start justify-center text-left flex-1"}};import{jsx as ui}from"react/jsx-runtime";function po({preset:e="default",...t}){switch(e){case"search":return ui(Gs,{...t});case"error":return ui(Us,{...t});case"folder":return ui(js,{...t});case"simple":return ui(Ys,{...t});default:return ui(Os,{...t})}}var C0=["default","search","error","folder","simple"];function Ul(e){return typeof e=="string"&&C0.includes(e)}function jl(e){return typeof e!="string"?!1:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")||e.startsWith("./")||e.startsWith("data:")||/\.(png|jpe?g|svg|webp|gif|avif)$/i.test(e)}function Yl(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}import{jsx as nn,jsxs as k0}from"react/jsx-runtime";function Pn({size:e="md",layout:t="vertical",image:r="default",imageSize:n,imageClassName:o="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:h="",actions:d,actionsClassName:w="",children:p,className:m="",role:x="status",ref:y,...b}){let k=C(e,y0,"md"),T=C(t,w0,"vertical"),v=Yl(n),u=()=>{if(!r)return null;if(Ul(r))return nn(po,{preset:r});if(jl(r)){let P=typeof n=="number"?n:k.defaultImageSize;return nn(Gh,{src:r,alt:i,width:P,height:P,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return Oh(r)?r:nn(po,{preset:"default"})},c=["flex items-center justify-center shrink-0",n?"":k.imageWrapper,o].filter(Boolean).join(" "),g=["w-full transition-all",T.container,k.container,k.gap,m].filter(Boolean).join(" "),f=[T.content,k.contentGap].filter(Boolean).join(" "),S=[k.title,s].filter(Boolean).join(" "),D=[k.description,h].filter(Boolean).join(" "),R=["flex flex-wrap items-center gap-2",k.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return k0("div",{ref:y,role:x,"aria-live":"polite",className:g,...b,children:[r&&nn("div",{className:c,style:v,"aria-hidden":"true",children:u()}),(a||l||d||p)&&k0("div",{className:f,children:[a&&nn("div",{className:S,children:a}),l&&nn("div",{className:D,children:l}),d&&nn("div",{className:R,children:d}),p&&nn("div",{className:"mt-2 w-full",children:p})]})]})}import{useState as Ya,useMemo as bx,useCallback as H0,useId as hx}from"react";import{useRef as jh}from"react";var go={xs:{trigger:"min-h-6 text-[11px] px-2 py-0.5",input:"text-[11px] leading-tight",text:"text-[11px]",icon:"size-3",option:"px-2 py-1 text-[11px] min-h-6",gap:"gap-1",badgeSize:"xs",defaultRadius:"sm"},sm:{trigger:"min-h-8 text-xs px-2.5 py-1",input:"text-xs leading-normal",text:"text-xs",icon:"size-3.5",option:"px-2.5 py-1.5 text-xs min-h-7",gap:"gap-1",badgeSize:"xs",defaultRadius:"md"},md:{trigger:"min-h-10 text-sm px-3.5 py-1.5",input:"text-sm leading-normal",text:"text-sm",icon:"size-[18px]",option:"px-3 py-2 text-sm min-h-9",gap:"gap-1.5",badgeSize:"sm",defaultRadius:"lg"},lg:{trigger:"min-h-12 text-base px-4 py-2",input:"text-base leading-normal",text:"text-base",icon:"size-5",option:"px-3.5 py-2.5 text-base min-h-11",gap:"gap-2",badgeSize:"md",defaultRadius:"xl"},xl:{trigger:"min-h-14 text-lg px-5 py-2.5",input:"text-lg leading-normal",text:"text-lg",icon:"size-6",option:"px-4 py-3 text-lg min-h-12",gap:"gap-2",badgeSize:"lg",defaultRadius:"xl"}},mo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},di={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},S0={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},bo={outline:{primary:"bg-neutral-white border-primary-400 hover:border-primary-500 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-neutral-white border-secondary-400 hover:border-secondary-500 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-neutral-white border-error-500 hover:border-error-600 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-neutral-white border-success-400 hover:border-success-500 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-neutral-white border-warning-400 hover:border-warning-500 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-neutral-white border-info-400 hover:border-info-500 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},filled:{primary:"bg-primary-50/60 border border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-secondary-50/60 border border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-error-50/60 border border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-success-50/60 border border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-warning-50/60 border border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-info-50/60 border border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-neutral-50/60 border border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"},ghost:{primary:"bg-transparent border border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20 text-neutral-900",secondary:"bg-transparent border border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20 text-neutral-900",error:"bg-transparent border border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20 text-neutral-900",success:"bg-transparent border border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20 text-neutral-900",warning:"bg-transparent border border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20 text-neutral-900",info:"bg-transparent border border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20 text-neutral-900",neutral:"bg-transparent border border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20 text-neutral-900"}},T0={primary:"bg-primary-50 text-primary-700 font-medium",secondary:"bg-secondary-50 text-secondary-700 font-medium",error:"bg-error-50 text-error-700 font-medium",success:"bg-success-50 text-success-700 font-medium",warning:"bg-warning-50 text-warning-700 font-medium",info:"bg-info-50 text-info-700 font-medium",neutral:"bg-neutral-100 text-neutral-900 font-medium"},D0={primary:"bg-primary-50/60",secondary:"bg-secondary-50/60",error:"bg-error-50/60",success:"bg-success-50/60",warning:"bg-warning-50/60",info:"bg-info-50/60",neutral:"bg-neutral-100"};import{jsx as ho,jsxs as R0}from"react/jsx-runtime";function Uh({id:e,isOpen:t,disabled:r=!1,isLoading:n=!1,showClear:o=!1,onClear:i,startContent:a,endContent:s,triggerRef:l,getReferenceProps:h,onClick:d,roundedClass:w,currentSize:p,variantStyle:m,className:x="",children:y}){let b=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return R0("div",{ref:l,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:d,"aria-busy":n,"aria-disabled":r||n,...h({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${w} ${p.trigger} ${p.gap} ${m} ${b} ${x}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[a&&ho("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:a}),y,R0("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[n&&ho(Ne,{className:`${p.icon} animate-spin text-current`}),o&&!n&&ho("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),i?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:ho(Oe,{className:"size-3.5"})}),s,ho("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:ho(lt,{className:p.icon})})]})]})}var Oa=Uh;import{jsx as zn}from"react/jsx-runtime";function Yh({id:e,selectedOption:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:h=!1,isInvalid:d=!1,searchable:w=!1,searchPlacement:p="trigger",searchValue:m="",onSearchChange:x,onClear:y,clearable:b=!1,isLoading:k=!1,startContent:T,endContent:v,renderValue:u,triggerRef:c,getReferenceProps:g,onKeyDown:f,className:S=""}){let D=jh(null),R=C(n,go,"md"),P=C(a,mo,"md"),E=!!d?"error":i,N=o==="other"?"":bo[o]?.[E]||bo.outline.primary,M=w&&(p==="trigger"||p==="both"),z=t!=null,H=b&&(z||m.length>0)&&!l&&!h;return zn(Oa,{id:e,isOpen:r,disabled:l,isLoading:k,showClear:H,onClear:y,startContent:T,endContent:v,triggerRef:c,getReferenceProps:g,onClick:()=>{!l&&!h&&!k&&M&&D.current?.focus()},roundedClass:P,currentSize:R,variantStyle:N,className:S,children:u&&z&&t?zn("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:u(t)}):M&&!l&&!h&&!k?zn("div",{className:"relative flex-1 min-w-0 flex items-center",children:zn("input",{ref:D,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:$=>x?.($.target.value),onKeyDown:f,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!m&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${R.input}`})}):zn("div",{className:"flex-1 min-w-0 truncate",children:t?zn("span",{className:"text-neutral-900",children:t.label}):zn("span",{className:"text-neutral-400",children:s})})})}var xo=Yh;import{FloatingPortal as Qh}from"@floating-ui/react";import{jsx as vo,jsxs as Wl}from"react/jsx-runtime";function Wh({option:e,isSelected:t,isActive:r,size:n="md",color:o="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:h,ref:d}){let w=C(n,go,"md"),p=C(i,mo,"md"),m=a||e.disabled;if(s)return vo("div",{ref:d,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${m?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:h,children:s(e,{selected:t,active:r})});let x=t?C(o,T0,"primary"):"text-neutral-800 hover:bg-neutral-100",y=r&&!t?C(o,D0,"primary"):"";return Wl("div",{ref:d,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${p} ${w.option} ${x} ${y} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:h,children:[Wl("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&vo("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),Wl("div",{className:"flex flex-col min-w-0 flex-1",children:[vo("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&vo("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&vo("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:vo(Ar,{className:"size-3.5"})})]})}var Ga=Wh;import{useState as ql,useRef as Kh,useEffect as _h,useMemo as Xh}from"react";import{useFloating as N0,autoUpdate as P0,offset as z0,flip as I0,shift as M0,useClick as F0,useDismiss as E0,useInteractions as $0,FloatingPortal as L0}from"@floating-ui/react";function fi(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function Kl(e,t,r){return e==null?null:t.find(n=>n.value===e)||r?.get(e)||{value:e,label:String(e)}}function Ua(e,t,r){return e.map(n=>t.find(o=>o.value===n)||r?.get(n)||{value:n,label:String(n)})}function _l(e,t){let r=t&&t>0?e.slice(0,t):e,n=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:n}}function Xl(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}import{Fragment as Jh,jsx as tt,jsxs as Qt}from"react/jsx-runtime";function qh({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:h},floatingStyles:d,context:w}=N0({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[z0(6),I0(),M0({padding:8})],whileElementsMounted:P0}),{isMounted:p,styles:m}=et(w),x=C(s,di,"md"),y=F0(w),b=E0(w,{outsidePress:f=>!f.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:k,getFloatingProps:T}=$0([y,b]),v=Kh(null);_h(()=>{r&&v.current?.focus({preventScroll:!0})},[r]);let u=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),c=Xl(e,t),g=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:f=>i(e.name,f)})??null;switch(e.type){case"string":case"text":return tt(Ct,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:f=>i(e.name,f.target.value),...e.props||{}});case"number":return tt(dn,{ref:v,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:f=>{let S=f.target.value;if(S==="")i(e.name,"");else{let D=Hr(S);i(e.name,D!==void 0?D:S)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return tt(Sn,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:f=>i(e.name,f),...e.props||{}});case"date-range":return tt(Tn,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:f=>i(e.name,f),...e.props||{}});case"checkbox-group":return tt(bn,{size:"sm",color:a,value:t||[],onChange:f=>i(e.name,f),options:(e.options||[]).map(f=>({value:String(f.value),label:f.label,disabled:f.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return Qt(Jh,{children:[tt("div",{ref:h,...k({className:"inline-flex items-center"}),children:Qt($t,{size:"sm",variant:"soft",color:u||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[Qt("span",{className:"font-semibold",children:[e.label,":"]}),tt("span",{className:u?"font-medium":"opacity-70 italic",children:c})]})}),p&&tt(L0,{children:Qt("div",{ref:l,"data-select-filter-popover":"true",style:{...d,...m,zIndex:Qe.SELECT_FILTER},...T({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${x} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[Qt("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[tt("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),tt("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:tt(Oe,{className:"size-3.5"})})]}),tt("div",{className:"mt-1",children:g()}),Qt("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[tt("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),tt("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-3 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Zh({filters:e,values:t,onChange:r,onReset:n,showReset:o=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,h]=ql(()=>{let N=[];return e?.forEach(M=>{let z=t?.[M.name]??M.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&N.push(M.name)}),N}),[d,w]=ql(null),[p,m]=ql(!1),{refs:{setFloating:x,setReference:y},floatingStyles:b,context:k}=N0({open:p,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[z0(6),I0(),M0({padding:8})],whileElementsMounted:P0}),{isMounted:T,styles:v}=et(k,{duration:120}),u=F0(k),c=E0(k,{outsidePress:N=>!N.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:g,getFloatingProps:f}=$0([u,c]),S=N=>{l.includes(N.name)||h(M=>[...M,N.name]),m(!1),w(N.name)},D=N=>{h(M=>M.filter(z=>z!==N)),d===N&&w(null),r(N,void 0)},R=N=>{N.stopPropagation(),h([]),w(null),n?.()},P=Xh(()=>new Set(l),[l]),I=l.length>0,E=C(s,di,"md");return!e||e.length===0?null:tt("div",{onClick:N=>N.stopPropagation(),onMouseDown:N=>N.stopPropagation(),className:"p-2.5 border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50/90 dark:bg-neutral-900/80 rounded-t-lg select-text",children:Qt("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[Qt("div",{className:"inline-flex",children:[Qt("button",{ref:y,type:"button",...g({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[tt(pr,{className:"size-3.5 text-neutral-500"}),tt("span",{children:"B\u1ED9 l\u1ECDc"}),tt(lt,{className:`size-3 text-neutral-400 transition-transform ${p?"rotate-180":""}`})]}),T&&tt(L0,{children:Qt("div",{ref:x,"data-select-filter-popover":"true",style:{...b,...v,zIndex:Qe.SELECT_FILTER},...f({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${E} p-1 shadow-2xl min-w-44`}),children:[tt("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),tt("div",{className:"space-y-0.5 mt-0.5",children:e.map(N=>{let M=P.has(N.name);return Qt("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),S(N)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${M?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[tt("span",{children:N.label}),M&&tt("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},N.name)})})]})})]}),l.map(N=>{let M=e.find(H=>H.name===N);if(!M)return null;let z=t[N]??M.defaultValue;return tt(qh,{field:M,currentValue:z,isOpen:d===N,onOpenChange:H=>w(H?N:null),onRemove:()=>D(N),onChange:r,color:a,radius:s},N)}),o&&n&&I&&Qt("button",{type:"button",onClick:R,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200 px-2.5 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[tt(Lt,{className:"size-3"}),tt("span",{children:i})]})]})})}var ja=Zh;import{Fragment as rx,jsx as on,jsxs as Zl}from"react/jsx-runtime";var ex={};function tx({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:n,options:o,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:h="md",isLoading:d=!1,portal:w=!0,maxMenuHeight:p=280,emptyText:m,emptyProps:x,menuHeader:y,menuFooter:b,listFooter:k,menuFilters:T,menuFilterValues:v=ex,menuFilterLayout:u="vertical",menuFilterGridCols:c=2,showResetFilters:g=!0,resetFiltersText:f,onMenuFilterChange:S,onResetFilters:D,renderOption:R,onSelectOption:P,onOptionMouseEnter:I,floatingStyles:E,floatingRef:N,getFloatingProps:M,listElementsRef:z,className:H=""}){if(!(t!==void 0?t:e))return null;let Y=C(h,di,"md"),$=Zl("div",{ref:N,"data-state":e?"open":"closed",style:{...E,...r?n:{},zIndex:Qe.SELECT},...M({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${Y} ${H}`}),children:[y,T&&T.length>0&&S&&on(ja,{filters:T,values:v,onChange:S,onReset:D,layout:u,gridCols:c,showReset:g,resetText:f,color:l,radius:h}),on("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof p=="number"?`${p}px`:p},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${d?"opacity-75":"opacity-100"}`,children:o.length===0?d?Zl("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[on(Ne,{className:"size-4 animate-spin text-current"}),on("span",{children:"Loading..."})]}):on("div",{className:"py-4 px-2",children:on(Pn,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...x})}):Zl(rx,{children:[(()=>{let F=new Set(i);return o.map((G,A)=>{let U=F.has(G.value);return on(Ga,{ref:X=>{z.current[A]=X},option:G,isSelected:U,isActive:a===A,size:s,color:l,radius:h,disabled:G.disabled,renderOption:R,onClick:()=>P(G),onMouseEnter:()=>I(A)},String(G.value))})})(),k]})}),b]});return w?on(Qh,{children:$}):$}var yo=tx;import{useRef as nx}from"react";import{useFloating as ox,autoUpdate as ix,offset as ax,flip as sx,shift as lx,useClick as cx,useDismiss as ux,useRole as dx,useListNavigation as fx,useInteractions as px}from"@floating-ui/react";function pi({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:n=!1,readOnly:o=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:h}){let d=nx([]),w=!n&&!o,{refs:p,floatingStyles:m,context:x}=ox({placement:e,open:t&&w,onOpenChange:f=>{w&&(!i||t||!f)&&r(f)},whileElementsMounted:ix,transform:!1,middleware:[ax(4),sx(),lx({padding:8})]}),y=cx(x,{enabled:w&&(!i||t)}),b=ux(x,{outsidePress:f=>!f.target?.closest?.("[data-select-filter-popover]")}),k=dx(x,{role:"listbox"}),T=fx(x,{listRef:d,activeIndex:l,onNavigate:h,loop:!0}),{getReferenceProps:v,getFloatingProps:u}=px([y,b,k,T]),{isMounted:c,styles:g}=et(x,{duration:s,animated:a});return{refs:p,floatingStyles:m,transitionStyles:g,isMounted:c,context:x,getReferenceProps:v,getFloatingProps:u,elementsRef:d}}import{useState as B0,useMemo as gx}from"react";var mx=[];function gi({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:n,searchField:o=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:h=300,filterFn:d,isOpen:w,setIsOpen:p,preserveSelected:m=!1,selectedValues:x=mx,historicalOptions:y}){let[b,k]=B0(""),T=r!==void 0,v=T?r:b,[u,c]=B0(()=>{let N={};return i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),N}),g=a??u,{debounced:f,cancel:S}=gn((N,M)=>{t==="server"&&l?.(N,M)},h),D=N=>{T||k(N),n?.(N),w||p(!0),f(N,g)},R=()=>{S(),T||k(""),n?.(""),t==="server"&&l?.("",g)},P=(N,M)=>{let z={...g,[N]:M};a||c(z),s?.(z),f(v,z)},I=()=>{let N={};i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),a||c(N),s?.(N),f(v,N)},E=gx(()=>{if(t==="server")return e;let N=e,M=v.trim();if(M?d?N=N.filter(z=>d(z,v,g)):N=un(N,M,o):d&&(N=N.filter(z=>d(z,v,g))),m&&M&&x.length>0&&y){let z=new Set(N.map(V=>V.value)),H=[];for(let V of x)if(!z.has(V)){let Y=y.get(V);Y&&H.push(Y)}H.length>0&&(N=[...H,...N])}return N},[e,t,v,d,g,o,m,x,y]);return{searchInput:v,handleSearchChange:D,resetSearch:R,currentFilters:g,handleFilterChange:P,handleResetFilters:I,filteredOptions:E}}import{jsx as mi,jsxs as V0}from"react/jsx-runtime";var xx=[];function bi({ref:e,options:t=xx,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:h,label:d,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:y,isDisabled:b=!1,readOnly:k=!1,isRequired:T=!1,name:v,searchable:u=!1,searchMode:c="client",searchPlacement:g="trigger",searchPlaceholder:f,searchField:S=["label","value"],searchValue:D,onSearchChange:R,menuFilters:P,menuFilterValues:I,menuFilterLayout:E="vertical",menuFilterGridCols:N=2,showResetFilters:M=!0,resetFiltersText:z,onMenuFilterChange:H,menuHeader:V,menuFooter:Y,listFooter:$,onSearch:F,debounceMs:G=300,filterFn:A,isLoading:U=!1,emptyText:B,emptyProps:X,clearable:le=!1,portal:ne=!0,placement:ue="bottom-start",maxMenuHeight:ie=280,animated:Q=!0,animationDuration:q=150,startContent:ge,endContent:ke,renderValue:L,renderOption:te,className:Z="",triggerClassName:he="",menuClassName:ae="",labelClassName:ve="",...Se}){let ye=!!(y??!!x),J=r!==void 0,[O,W]=Ya(n??null),we=J?r??null:O,[fe,se]=Ya(()=>fi(t)),me=bx(()=>Kl(we,t,fe),[we,t,fe]),[De,xe]=Ya(!1),[re,de]=Ya(null),{searchInput:ce,handleSearchChange:ee,resetSearch:j,currentFilters:Ce,handleFilterChange:Ee,handleResetFilters:Fe,filteredOptions:oe}=gi({options:t,searchMode:c,controlledSearchValue:D,onSearchChange:R,searchField:S,menuFilters:P,controlledFilterValues:I,onMenuFilterChange:H,onSearch:F,debounceMs:G,filterFn:A,isOpen:De,setIsOpen:xe}),{refs:Te,floatingStyles:Pe,transitionStyles:_e,isMounted:Ue,getReferenceProps:Le,getFloatingProps:Be,elementsRef:Ke}=pi({placement:ue,isOpen:De,onOpenChange:Re=>{xe(Re),Re||(de(null),j())},disabled:b,readOnly:k,isLoading:U,animated:Q,animationDuration:q,activeIndex:re,onNavigate:de}),K=H0(Re=>{Re.disabled||b||k||(se(Ye=>{if(Ye.has(Re.value))return Ye;let be=new Map(Ye);return be.set(Re.value,Re),be}),J||W(Re.value),o?.(Re.value,Re),xe(!1),j())},[b,k,J,o,j]),_=H0(Re=>{Re.stopPropagation(),!(b||k)&&(J||W(null),o?.(null,null),j())},[b,k,J,o,j]),ze=Re=>{if(Re.key==="Enter"&&De&&re!==null){Re.preventDefault();let Ye=oe[re];Ye&&K(Ye)}else Re.key==="ArrowDown"&&!De&&xe(!0)},pe=w==="floating",Me=w==="left",Xe=hx(),He=h||Xe,Ze=`${He}-trigger`,qe=()=>mi(at,{htmlFor:Ze,label:d,isRequired:T,isFloating:pe,size:i,color:s,hasError:ye,cursor:"pointer",className:ve});return V0("div",{ref:e,id:h,className:`group/field flex ${Me?"flex-row items-center gap-3":"flex-col"} ${pe?"pt-2":""} ${Z}`,"data-disabled":b,"data-invalid":ye,...Se,children:[!pe&&qe(),V0("div",{className:"relative flex-1 min-w-0",children:[pe&&qe(),mi(xo,{id:Ze,triggerRef:Te.setReference,getReferenceProps:Le,selectedOption:me,isOpen:De,size:i,variant:a,color:s,radius:l,placeholder:f||p,disabled:b,readOnly:k,isInvalid:ye,searchable:u,searchPlacement:g,searchValue:ce,onSearchChange:ee,onClear:_,clearable:le,isLoading:U,startContent:ge,endContent:ke,renderValue:L,onKeyDown:ze,className:he}),mi(yo,{isOpen:De,isMounted:Ue,animated:Q,transitionStyles:_e,options:oe,selectedValues:we!=null?[we]:[],activeIndex:re,size:i,color:s,radius:l,isLoading:U,portal:ne,maxMenuHeight:ie,emptyText:B,emptyProps:X,menuHeader:V,menuFooter:Y,listFooter:$,menuFilters:P,menuFilterValues:Ce,menuFilterLayout:E,menuFilterGridCols:N,showResetFilters:M,resetFiltersText:z,onMenuFilterChange:Ee,onResetFilters:Fe,renderOption:te,onSelectOption:K,onOptionMouseEnter:de,floatingRef:Te.setFloating,floatingStyles:Pe,getFloatingProps:Be,listElementsRef:Ke,className:ae})]}),v&&we!==null&&we!==void 0&&mi("input",{type:"hidden",name:v,value:String(we)}),mi($e,{id:`${He}-helper`,errorMessage:x,helperText:m})]})}var A0=bi;import{useState as Ka,useMemo as wx,useCallback as Jl,useId as Cx}from"react";import{useRef as vx}from"react";import{jsx as wo,jsxs as O0}from"react/jsx-runtime";function yx({id:e,selectedOptions:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:h=!1,isInvalid:d=!1,maxTagCount:w,searchable:p=!1,searchPlacement:m="trigger",searchValue:x="",onSearchChange:y,onRemoveTag:b,onClear:k,clearable:T=!1,isLoading:v=!1,startContent:u,endContent:c,renderValue:g,triggerRef:f,getReferenceProps:S,onKeyDown:D,className:R=""}){let P=vx(null),I=C(n,go,"md"),E=C(a,mo,"md"),N=C(a,S0,"md"),z=!!d?"error":i,H=o==="other"?"":bo[o]?.[z]||bo.outline.primary,V=p&&(m==="trigger"||m==="both"),Y=t.length>0,$=T&&(Y||x.length>0)&&!l&&!h,{visibleTags:F,hiddenTagCount:G}=_l(t,w);return wo(Oa,{id:e,isOpen:r,disabled:l,isLoading:v,showClear:$,onClear:k,startContent:u,endContent:c,triggerRef:f,getReferenceProps:S,onClick:()=>{!l&&!h&&!v&&V&&P.current?.focus()},roundedClass:E,currentSize:I,variantStyle:H,className:R,children:g&&Y?wo("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:g(t)}):O0("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[F.map(B=>wo($t,{size:I.badgeSize,variant:"soft",color:i,radius:N,onDelete:!l&&!h&&!v&&b?()=>b(B):void 0,className:"max-w-full truncate",children:wo("span",{className:"truncate",children:B.label})},String(B.value))),G>0&&O0($t,{size:I.badgeSize,variant:"soft",color:"neutral",radius:N,children:["+",G]}),V&&!l&&!h&&!v?wo("input",{ref:P,type:"text","aria-label":"Search",value:x,placeholder:Y?"":s,onChange:B=>y?.(B.target.value),onKeyDown:D,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${I.input}`}):Y?null:wo("span",{className:"text-neutral-400 truncate",children:s})]})})}var Wa=yx;import{jsx as hi,jsxs as U0}from"react/jsx-runtime";var kx=[],G0=[];function Sx({ref:e,options:t=kx,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:h,label:d,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:x,isInvalid:y,isDisabled:b=!1,readOnly:k=!1,isRequired:T=!1,name:v,maxTagCount:u,searchable:c=!1,searchMode:g="client",searchPlacement:f="trigger",searchPlaceholder:S,searchField:D=["label","value"],preserveSelected:R=!0,searchValue:P,onSearchChange:I,menuFilters:E,menuFilterValues:N,menuFilterLayout:M="vertical",menuFilterGridCols:z=2,showResetFilters:H=!0,resetFiltersText:V,onMenuFilterChange:Y,menuHeader:$,menuFooter:F,listFooter:G,onSearch:A,debounceMs:U=300,filterFn:B,isLoading:X=!1,emptyText:le,emptyProps:ne,clearable:ue=!1,portal:ie=!0,placement:Q="bottom-start",maxMenuHeight:q=280,animated:ge=!0,animationDuration:ke=150,startContent:L,endContent:te,renderValue:Z,renderOption:he,className:ae="",triggerClassName:ve="",menuClassName:Se="",labelClassName:ye="",...J}){let O=!!(y??!!x),W=r!==void 0,[we,fe]=Ka(n??G0),se=W?r??G0:we,[me,De]=Ka(()=>fi(t)),xe=wx(()=>Ua(se,t,me),[se,t,me]),[re,de]=Ka(!1),[ce,ee]=Ka(null),{searchInput:j,handleSearchChange:Ce,resetSearch:Ee,currentFilters:Fe,handleFilterChange:oe,handleResetFilters:Te,filteredOptions:Pe}=gi({options:t,searchMode:g,controlledSearchValue:P,onSearchChange:I,searchField:D,menuFilters:E,controlledFilterValues:N,onMenuFilterChange:Y,onSearch:A,debounceMs:U,filterFn:B,isOpen:re,setIsOpen:de,preserveSelected:R,selectedValues:se,historicalOptions:me}),{refs:_e,floatingStyles:Ue,transitionStyles:Le,isMounted:Be,getReferenceProps:Ke,getFloatingProps:K,elementsRef:_}=pi({placement:Q,isOpen:re,onOpenChange:Ve=>{de(Ve),Ve||ee(null)},disabled:b,readOnly:k,isLoading:X,animated:ge,animationDuration:ke,activeIndex:ce,onNavigate:ee}),ze=Jl(Ve=>{if(Ve.disabled||b||k)return;De(Ft=>{if(Ft.has(Ve.value))return Ft;let ot=new Map(Ft);return ot.set(Ve.value,Ve),ot});let Je=se.includes(Ve.value)?se.filter(Ft=>Ft!==Ve.value):[...se,Ve.value];W||fe(Je);let Tt=Ua(Je,t,me);o?.(Je,Tt),Ee()},[b,k,se,W,t,o,Ee,me]),pe=Jl(Ve=>{if(b||k)return;let rt=se.filter(Tt=>Tt!==Ve.value);W||fe(rt);let Je=rt.map(Tt=>t.find(Ft=>Ft.value===Tt)||me.get(Tt)||{value:Tt,label:String(Tt)});o?.(rt,Je)},[b,k,se,W,t,o,me]),Me=Jl(Ve=>{Ve.stopPropagation(),!(b||k)&&(W||fe([]),o?.([],[]),Ee())},[b,k,W,o,Ee]),Xe=Ve=>{let rt=Ve.currentTarget?.value??j;if(Ve.key==="Backspace"&&(!rt||rt.length===0)&&xe.length>0){Ve.preventDefault();let Je=xe[xe.length-1];Je&&pe(Je)}else if(Ve.key==="Enter"&&re&&ce!==null){Ve.preventDefault();let Je=Pe[ce];Je&&ze(Je)}else Ve.key==="ArrowDown"&&!re&&de(!0)},He=w==="floating",Ze=w==="left",qe=Cx(),Re=h||qe,Ye=`${Re}-trigger`,be=()=>hi(at,{htmlFor:Ye,label:d,isRequired:T,isFloating:He,size:i,color:s,hasError:O,cursor:"pointer",className:ye});return U0("div",{ref:e,id:h,className:`group/field flex ${Ze?"flex-row items-center gap-3":"flex-col"} ${He?"pt-2":""} ${ae}`,"data-disabled":b,"data-invalid":O,...J,children:[!He&&be(),U0("div",{className:"relative flex-1 min-w-0",children:[He&&be(),hi(Wa,{id:Ye,triggerRef:_e.setReference,getReferenceProps:Ke,selectedOptions:xe,isOpen:re,size:i,variant:a,color:s,radius:l,placeholder:S||p,disabled:b,readOnly:k,isInvalid:O,maxTagCount:u,searchable:c,searchPlacement:f,searchValue:j,onSearchChange:Ce,onRemoveTag:pe,onClear:Me,clearable:ue,isLoading:X,startContent:L,endContent:te,renderValue:Z,onKeyDown:Xe,className:ve}),hi(yo,{isOpen:re,isMounted:Be,animated:ge,transitionStyles:Le,options:Pe,selectedValues:se,activeIndex:ce,size:i,color:s,radius:l,isLoading:X,portal:ie,maxMenuHeight:q,emptyText:le,emptyProps:ne,menuHeader:$,menuFooter:F,listFooter:G,menuFilters:E,menuFilterValues:Fe,menuFilterLayout:M,menuFilterGridCols:z,showResetFilters:H,resetFiltersText:V,onMenuFilterChange:oe,onResetFilters:Te,renderOption:he,onSelectOption:ze,onOptionMouseEnter:ee,floatingRef:_e.setFloating,floatingStyles:Ue,getFloatingProps:K,listElementsRef:_,className:Se})]}),v&&se.map((Ve,rt)=>hi("input",{type:"hidden",name:`${v}[]`,value:String(Ve)},`${v}-${Ve}-${rt}`)),hi($e,{id:`${Re}-helper`,errorMessage:x,helperText:m})]})}var j0=Sx;import{useEffect as Tx,useState as Dx}from"react";function Rx(e,t=300){let[r,n]=Dx(e);return Tx(()=>{let o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}import{useId as qx,useMemo as lf,useState as ss}from"react";import{useDropzone as Zx}from"react-dropzone";var _a={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Y0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},W0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Co={xs:{dropzoneHeight:"min-h-[80px]",dropzonePadding:"p-3",avatarSize:"size-12",thumbnailSize:"size-12",iconSize:24,titleSize:"text-[11px]",descSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",gap:"gap-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzonePadding:"p-4",avatarSize:"size-16",thumbnailSize:"size-16",iconSize:32,titleSize:"text-xs",descSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",gap:"gap-2"},md:{dropzoneHeight:"min-h-[130px]",dropzonePadding:"p-5",avatarSize:"size-24",thumbnailSize:"size-20",iconSize:44,titleSize:"text-sm",descSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",gap:"gap-3"},lg:{dropzoneHeight:"min-h-[160px]",dropzonePadding:"p-6",avatarSize:"size-28",thumbnailSize:"size-24",iconSize:54,titleSize:"text-base",descSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",gap:"gap-3.5"},xl:{dropzoneHeight:"min-h-[200px]",dropzonePadding:"p-8",avatarSize:"size-36",thumbnailSize:"size-28",iconSize:64,titleSize:"text-lg",descSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",gap:"gap-4"}},K0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}},filled:{primary:{idle:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 hover:border-primary-400 text-primary-900",active:"bg-primary-100 border-primary-500 ring-2 ring-primary-500/20 text-primary-950",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700"},secondary:{idle:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 hover:border-secondary-400 text-secondary-900",active:"bg-secondary-100 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-950",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700"},neutral:{idle:"bg-neutral-100/70 border-neutral-200 hover:bg-neutral-200/70 hover:border-neutral-400 text-neutral-800",active:"bg-neutral-200 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-950"},error:{idle:"bg-error-50/60 border-error-200 hover:bg-error-100/60 hover:border-error-400 text-error-900",active:"bg-error-100 border-error-500 ring-2 ring-error-500/20 text-error-950",iconColor:"text-error-600",titleHover:"group-hover:text-error-700"},success:{idle:"bg-success-50/60 border-success-200 hover:bg-success-100/60 hover:border-success-400 text-success-900",active:"bg-success-100 border-success-500 ring-2 ring-success-500/20 text-success-950",iconColor:"text-success-600",titleHover:"group-hover:text-success-700"},warning:{idle:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 hover:border-warning-400 text-warning-900",active:"bg-warning-100 border-warning-500 ring-2 ring-warning-500/20 text-warning-950",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700"},info:{idle:"bg-info-50/60 border-info-200 hover:bg-info-100/60 hover:border-info-400 text-info-900",active:"bg-info-100 border-info-500 ring-2 ring-info-500/20 text-info-950",iconColor:"text-info-600",titleHover:"group-hover:text-info-700"}},ghost:{primary:{idle:"bg-transparent border-transparent hover:bg-primary-50/60 hover:border-primary-300 text-neutral-700",active:"bg-primary-50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600"},secondary:{idle:"bg-transparent border-transparent hover:bg-secondary-50/60 hover:border-secondary-300 text-neutral-700",active:"bg-secondary-50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600"},neutral:{idle:"bg-transparent border-transparent hover:bg-neutral-100 hover:border-neutral-300 text-neutral-700",active:"bg-neutral-100 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900"},error:{idle:"bg-transparent border-transparent hover:bg-error-50/60 hover:border-error-300 text-neutral-700",active:"bg-error-50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600"},success:{idle:"bg-transparent border-transparent hover:bg-success-50/60 hover:border-success-300 text-neutral-700",active:"bg-success-50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600"},warning:{idle:"bg-transparent border-transparent hover:bg-warning-50/60 hover:border-warning-300 text-neutral-700",active:"bg-warning-50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600"},info:{idle:"bg-transparent border-transparent hover:bg-info-50/60 hover:border-info-300 text-neutral-700",active:"bg-info-50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600"}}};function wr(e,t=1){if(!e||!+e)return"0 B";let r=1024,n=t<0?0:t,o=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(n))} ${o[i]}`}function In(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var Xa={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},_0={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},X0={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Cr={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},q0={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},Z0={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},J0={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var qa=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],Za=["pdf"],Ja=["mp4","webm","ogg","mov","avi","mkv"],Qa=["mp3","wav","ogg","aac","flac","m4a"],es=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function ct(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?ct(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",n=r.lastIndexOf(".");return n<=0?r:r.slice(0,n)}return""}function xi(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function ko(e=""){let t=xi(e);return qa.includes(t)?"image":Za.includes(t)?"pdf":Ja.includes(t)?"video":Qa.includes(t)?"audio":es.includes(t)?"document":"other"}function Ql(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Mr(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let n=ct(e)||"file";return{name:n,type:ko(e),file:void 0,serverFile:{src:e,name:n}}}if(e instanceof File)return{name:ct(e.name),type:ko(e.name),file:e,serverFile:void 0};let t=e.name??ct(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=ko(e.name)),r==="other"&&e?.src&&(r=ko(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function kr(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let n=e.split("?")[0]?.split("#")[0]||"",o=n.split("/").pop()||n.split("\\").pop()||"download";r.download=t||o,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function ec(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function tc(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,n=typeof t.progress=="number"?t.progress:void 0,o=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||n!==void 0&&n>=0&&n<100?i="uploading":r==="error"||o?i="error":(r==="success"||r==="done"||n!==void 0&&n>=100)&&(i="success"),{status:i,progress:n,error:o}}function ts(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let n=xi(t);if(n){for(let[o,i]of Object.entries(Z0))if(i.includes(n))return o}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function Q0(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${ct(e)}-${t}`}function vi(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean),n={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let o of r)if(o.startsWith(".")){let i=o.toLowerCase(),a=n[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[o]||(t[o]=[]);return t}import{useEffect as Mx,useState as Fx}from"react";import{createContext as Nx,useContext as Px}from"react";var rc=Nx(null),rs=()=>Px(rc);import{useState as ns}from"react";import zx from"react-easy-crop";import{jsx as kt,jsxs as ef}from"react/jsx-runtime";function yi({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:n=.05,onZoomChange:o,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:h,onFlipHorizontal:d,onReset:w,currentImage:p,tools:m,className:x=""}){let{zoomIn:y=!0,zoomOut:b=!0,zoomSlider:k=!0,reset:T=!0,rotate:v=!0,flip:u=!0,download:c=!0}=m??{},g=Math.round(e*100),f=()=>{p?.src&&kr(p.src,p.name)},S=R=>{if(typeof R=="number"){let P=Math.round(R*100)/100;o?.(P)}},D="p-2 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-100 active:scale-95 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500 cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent";return ef("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${x}`,children:[b&&kt("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:D,children:kt(qn,{width:18,height:18})}),k&&kt("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:kt(Oo,{value:e,min:t,max:r,step:n,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!o&&!i?.onChange,onChange:S,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),y&&kt("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:D,children:kt(Xn,{width:18,height:18})}),T&&ef("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[g,"%"]}),(v||u||c)&&kt("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),v&&kt("button",{type:"button","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",onClick:h,className:D,children:kt(Zn,{width:18,height:18})}),v&&kt("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:D,children:kt(jr,{width:18,height:18})}),u&&kt("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:d,className:D,children:kt(Qn,{width:18,height:18})}),c&&kt("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:f,className:D,children:kt(br,{width:18,height:18})})]})}import{jsx as os,jsxs as Ix}from"react/jsx-runtime";function wi({src:e,name:t,minZoom:r=.2,maxZoom:n=5,showToolbar:o=!0,toolbarProps:i,children:a}){let[s,l]=ns({x:0,y:0}),[h,d]=ns(1),[w,p]=ns(0),[m,x]=ns(!1),y=()=>d(g=>Math.min(n,Math.round((g+.25)*100)/100)),b=()=>d(g=>Math.max(r,Math.round((g-.25)*100)/100)),k=()=>p(g=>(g+90)%360),T=()=>p(g=>(g-90+360)%360),v=()=>x(g=>!g),u=()=>{l({x:0,y:0}),d(1),p(0),x(!1)},c={src:e,name:t};return e?Ix("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[os("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:os(zx,{image:e,crop:s,zoom:h,rotation:w,minZoom:r,maxZoom:n,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:d,onRotationChange:p,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),o&&os("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:os(yi,{zoom:h,minZoom:r,maxZoom:n,onZoomChange:d,rotation:w,isFlipped:m,onZoomIn:y,onZoomOut:b,onRotateCw:k,onRotateCcw:T,onFlipHorizontal:v,onReset:u,currentImage:c,...i})}),a]}):null}import{jsx as Mn,jsxs as tf}from"react/jsx-runtime";function Fr({onDownload:e,imageProps:t,className:r=""}){let n=rs(),o=n?.file,i=n?.headerTitle,[a,s]=Fx("");Mx(()=>{if(!o){s("");return}if(!(o instanceof File)){let p=Mr(o);s(p.serverFile?.src||"");return}let w=URL.createObjectURL(o);return s(w),()=>{URL.revokeObjectURL(w)}},[o]);let l=Mr(o),h=(typeof i=="string"?i:"")||l.name||"file",d=()=>{e&&o&&e(o),a&&kr(a,h)};return l.type==="image"?Mn(wi,{src:a,name:h,...t}):tf("div",{className:`p-6 text-center ${r}`,children:[Mn("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:Mn(br,{width:32,height:32})}),Mn("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:h,children:i??h}),Mn("p",{className:"text-sm text-neutral-500 mb-6",children:"\u0110\u1ECBnh d\u1EA1ng file ch\u01B0a h\u1ED7 tr\u1EE3 xem tr\u1EF1c ti\u1EBFp. B\u1EA1n c\xF3 th\u1EC3 t\u1EA3i file v\u1EC1 \u0111\u1EC3 xem."}),tf("button",{type:"button",onClick:d,className:"inline-flex items-center justify-center gap-2 w-full py-2.5 px-4 bg-primary-600 hover:bg-primary-500 text-white font-medium rounded-xl transition-colors shadow-md cursor-pointer",children:[Mn(br,{width:18,height:18}),Mn("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}import{useMemo as Ux}from"react";var rf=250,an={xs:{dialog:"max-w-[320px] p-3 gap-1.5",header:"gap-1.5",body:"text-xs",footer:"gap-1.5 pt-1.5",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",buttonGap:"gap-1.5",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[400px] p-3.5 gap-2",header:"gap-2",body:"text-sm",footer:"gap-2 pt-2",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",buttonGap:"gap-2",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[540px] p-4 gap-2.5",header:"gap-2.5",body:"text-sm",footer:"gap-2 pt-2",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-7 p-1 -mr-1 -mt-1",closeIcon:"size-4"},lg:{dialog:"max-w-[720px] p-4.5 gap-3",header:"gap-3",body:"text-base",footer:"gap-2.5 pt-2.5",title:"text-xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"},xl:{dialog:"max-w-[960px] p-5 gap-3.5",header:"gap-3.5",body:"text-base",footer:"gap-3 pt-3",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-3.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-5"},full:{dialog:"max-w-[calc(100vw-2rem)] w-full h-[calc(100vh-2rem)] p-4 gap-2.5",header:"gap-2.5",body:"text-base",footer:"gap-2 pt-2",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",buttonGap:"gap-2.5",closeButton:"size-8 p-1 -mr-1 -mt-1",closeIcon:"size-4.5"}},nf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};import{createContext as Ex,useContext as $x}from"react";var nc=Ex(null),er=()=>$x(nc);import{jsx as Lx}from"react/jsx-runtime";function Fn({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=er(),s=C(e??a?.size,an,"md"),l=C(t,nf,"lg"),h=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return Lx("div",{ref:o,tabIndex:-1,className:h,...i,children:n})}import{useEffect as is,useEffectEvent as Bx,useCallback as Hx,useMemo as Vx,useRef as of,useState as Ax}from"react";import{jsx as oc,jsxs as Ox}from"react/jsx-runtime";function En({open:e=!1,id:t,size:r,isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:h,onClose:d,...w}){let p=of(null),[m,x]=Ax(!1),y=of(null),b=Hx(()=>{m||n||(x(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{x(!1),d?.()},rf))},[m,n,d]),k=Vx(()=>({onClose:b,isLoading:n,size:r}),[b,n,r]);is(()=>()=>{y.current&&clearTimeout(y.current)},[]),is(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),is(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=Bx(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),b())});if(is(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let v=()=>{o&&b()},u=m?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",c=m?"animate-modal-out pointer-events-none":"animate-modal-in";return oc(nc.Provider,{value:k,children:Ox("dialog",{id:t,ref:p,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&b()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...w,children:[oc("div",{"aria-hidden":"true",onClick:v,className:"fixed inset-0 -z-10"}),oc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:h})]})})}import{jsx as as,jsxs as af}from"react/jsx-runtime";function $n({size:e,title:t,description:r,titleClassName:n="",descriptionClassName:o="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:h,...d}){let w=er(),p=C(e??w?.size,an,"md"),m=w?.isLoading,x=()=>{a?.(),w?.onClose?.()},y=!!(a||w?.onClose);return af("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${p.header} ${l}`,...d,children:[af("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&as("h3",{id:"modal-dialog-title",className:`${p.title} truncate ${n}`,children:t}),r&&as("p",{id:"modal-dialog-description",className:`${p.description} mt-0.5 ${o}`,children:r}),h]}),i&&y&&as("button",{type:"button",onClick:x,disabled:m,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${p.closeButton} ${s}`,children:as(Oe,{className:p.closeIcon})})]})}import{jsx as Gx}from"react/jsx-runtime";function Ln({size:e,className:t="",children:r,...n}){let o=er(),i=C(e??o?.size,an,"md");return Gx("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...n,children:r})}import{jsx as Ci,jsxs as jx}from"react/jsx-runtime";function cr({open:e=!1,onClose:t,file:r,title:n,description:o,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:h=!0,lockScroll:d=!0,className:w="",overlayClassName:p="",children:m}){let x=Mr(r),y=n??x?.name,b=Ux(()=>({file:r,headerTitle:y}),[r,y]);return Ci(En,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:h,lockScroll:d,overlayClassName:p,children:jx(Fn,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(y||s)&&Ci($n,{title:y,description:o,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),Ci(Ln,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:Ci(rc.Provider,{value:b,children:m||Ci(Fr,{})})})]})})}import{useState as ki,useEffect as Yx,useMemo as Wx}from"react";import Kx from"next/image";import{Fragment as _x,jsx as So,jsxs as sf}from"react/jsx-runtime";function Er({src:e,alt:t="",width:r,height:n,fill:o,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:h="",wrapperClassName:d="",style:w,wrapperStyle:p,onLoad:m,onError:x,onClick:y,ref:b,...k}){let[T,v]=ki(!1),[u,c]=ki(!1),[g,f]=ki(null),[S,D]=ki(!1),R=$c(e),[P,I]=ki(R),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),N=Ql(e)?e:void 0,M=N?.src,z=E?g:N?M:e,H=E||!!N||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||N?.name||"";R!==P&&(I(R),v(!1),c(!1)),Yx(()=>{if(!(e instanceof File||e instanceof Blob)){f(null);return}let ne=URL.createObjectURL(e);return f(ne),()=>URL.revokeObjectURL(ne)},[e]);let Y=Wx(()=>{if(z)return e instanceof File?e:N?{...N,src:N.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,N,V]),$=C(a,Fc,"md"),F=C(s,Ec,"cover"),G=ne=>{v(!0),m?.(ne)},A=ne=>{c(!0),v(!1),x?.(ne)},U=ne=>{y?.(ne),!ne.defaultPrevented&&l&&T&&!u&&Y&&D(!0)},B=!!(l&&T&&!u||y),X=ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),U(ne))},le={...o?{}:{width:r,height:n},...p};return sf(_x,{children:[sf("div",{ref:b,role:B?"button":void 0,tabIndex:B?0:void 0,onClick:U,onKeyDown:X,className:["relative overflow-hidden inline-block",$,B?"cursor-pointer":"",d].filter(Boolean).join(" "),style:le,children:[!T&&!u&&So(jn,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?So(Kx,{src:z,alt:V,width:o?void 0:r,height:o?void 0:n,fill:o,unoptimized:H?!0:k.unoptimized,className:["block w-full h-full transition-opacity duration-200",F,$,T?"opacity-100":"opacity-0",h].filter(Boolean).join(" "),style:w,onLoad:G,onError:A,...k}):null,u&&So("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:So(ra,{width:24,height:24,"aria-hidden":"true"})})]}),S&&Y&&So(cr,{open:S,onClose:()=>D(!1),file:Y,title:V||"Xem \u1EA3nh",children:So(Fr,{})})]})}import{Fragment as Xx,jsx as yt,jsxs as To}from"react/jsx-runtime";function Si({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:h="idle",isInvalid:d,dropzoneTitle:w,dropzoneDescription:p,icon:m,item:x,onRemove:y,onPreview:b,onTriggerUpload:k,getRootProps:T,className:v="",describedById:u}){let c=C(e,Co,"md"),g=C(n,_a,"md"),f=o==="square"?"aspect-square w-full":C(e,W0,"md"),S=d?"error":t,D=r!=="other"?C(r,K0,"outline"):null,R=D?C(S,D,"primary"):null,P="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",I="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",E=h==="active",N=h==="reject",M=E,z=N?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":M?R?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":R?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",H=x?`group relative w-full ${f} ${g} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${M?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`:`group relative w-full ${o==="square"?"aspect-square w-full":c.dropzoneHeight} ${c.dropzonePadding} ${g} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${v}`,V=ct(x),Y={role:"button",tabIndex:a?-1:0,"aria-label":x?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":d,"aria-describedby":u,"aria-busy":l,className:H,onClick:()=>{a||l||x&&b?.()},onKeyDown:F=>{a||l||(F.key==="Enter"||F.key===" ")&&x&&(F.preventDefault(),b?.())}},$=T?T(Y):Y;return yt("div",{...$,children:x?To(Xx,{children:[yt(Er,{src:x,alt:V,fill:!0,radius:n??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&To("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&yt("button",{type:"button",onClick:F=>{F.stopPropagation(),k?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:yt(Lt,{width:16,height:16})}),!s&&yt("button",{type:"button",onClick:F=>{F.stopPropagation(),y?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:yt(ir,{width:16,height:16})})]}),l&&To("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[yt(Ne,{width:c.iconSize*.8,height:c.iconSize*.8,className:"animate-spin"}),yt("span",{className:`${c.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),M&&To("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[yt(Nt,{width:c.iconSize,height:c.iconSize,className:"animate-bounce"}),yt("span",{className:`${c.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?To("div",{className:`flex flex-col items-center justify-center gap-2 ${R?.iconColor||"text-primary-600"}`,children:[yt(Ne,{width:c.iconSize*.8,height:c.iconSize*.8}),yt("span",{className:`${c.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):To("div",{className:"flex flex-col items-center justify-center gap-2",children:[yt("div",{className:`transition-colors ${R?.iconColor||"text-primary-500"}`,children:m||yt(Nt,{width:c.iconSize,height:c.iconSize})}),yt("div",{className:`${c.titleSize} font-medium text-neutral-800 ${R?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??P}),yt("div",{id:u,className:`${c.descSize} text-neutral-500`,children:p??I})]})})}import{jsx as $r,jsxs as ic}from"react/jsx-runtime";function Bn({items:e,size:t,radius:r,objectFit:n="cover",disabled:o,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:h,renderItem:d,showAddButton:w=!0,className:p=""}){let m=C(t,Co,"md"),x=C(r,_a,"md"),y=!a||e.length<a;return ic("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${m.gap} ${p}`,children:[e.map((b,k)=>{let T=ct(b),v=typeof b=="object"&&b&&"id"in b&&b.id?String(b.id):b instanceof File?`${b.name}-${b.size}-${b.lastModified}`:typeof b=="string"?b:b?.src||T;return d?$r("li",{"data-testid":"upload-image-item",className:"list-none",children:d(b,k,{remove:()=>s(b,k),preview:()=>l(b)})},v):ic("li",{"data-testid":"upload-image-item",tabIndex:o?-1:0,"aria-label":`H\xECnh \u1EA3nh ${T}`,onKeyDown:u=>{o||i||(u.key==="Delete"||u.key==="Backspace")&&(u.preventDefault(),s(b,k))},className:`group relative list-none ${m.thumbnailSize} ${x} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[$r(Er,{src:b,alt:T,width:80,height:80,radius:r,objectFit:n,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!o&&ic("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&$r("button",{type:"button",onClick:u=>{u.stopPropagation(),l(b)},"aria-label":`Preview image ${T}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:$r(Lr,{width:16,height:16})}),!i&&$r("button",{type:"button",onClick:u=>{u.stopPropagation(),s(b,k)},"aria-label":`Remove image ${T}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:$r(ir,{width:16,height:16})})]})]},v)}),w&&y&&!i&&$r("li",{className:"list-none",children:$r("button",{type:"button",disabled:o,onClick:h,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${m.thumbnailSize} ${x} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:$r(pr,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}import{Fragment as Jx,jsx as Ot,jsxs as Ti}from"react/jsx-runtime";function ac({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:h,viewMode:d="dropzone",shape:w="rectangle",objectFit:p,size:m="md",color:x="primary",variant:y="outline",radius:b,label:k,isRequired:T=!1,labelClassName:v="",helperText:u,errorMessage:c,isInvalid:g,disabled:f=!1,readOnly:S=!1,isLoading:D=!1,dropzoneTitle:R,dropzoneDescription:P,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:N,className:M="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let Y=qx(),$=`${Y}-input`,F=`${Y}-error-helper`,G=e!==void 0,[A,U]=ss(()=>In(t)),B=lf(()=>G?In(e):A,[G,e,A]),[X,le]=ss(null),[ne,ue]=ss(null),[ie,Q]=ss(""),q=C(m,Co,"md"),ge=b??"md",ke=!!(g||c||X),L=c||X,Z=ke?"text-error-600":C(ke?"error":x,Y0,"primary"),he=a??(i?void 0:1),ae=!i||he===1,ve=ae&&B.length===1?B[0]:null,Se=xe=>{G||U(xe),r?.(xe)},ye=lf(()=>vi(l),[l]),J=d==="dropzone"&&!!ve,{getRootProps:O,getInputProps:W,isDragActive:we,isDragReject:fe,open:se}=Zx({multiple:i,maxSize:s,accept:ye,disabled:f||S||D,noClick:d!=="dropzone"||J,noKeyboard:d!=="dropzone"||J,onDropAccepted:async xe=>{if(f||S||(le(null),xe.length===0))return;let re=xe,de=B.length;if(he!==void 0)if(i){let j=he-de;if(j<=0){let Ce=`Maximum allowed image count reached (${he} images)`;le(Ce),Q(Ce);return}re=xe.slice(0,j)}else{let j=xe[0];if(!j)return;re=[j]}let ce=await Promise.all(re.map(async j=>{if(h)try{let Ce=await h(j);if(Ce===!1||typeof Ce=="string")return{file:null,error:typeof Ce=="string"?Ce:`File ${j.name} was rejected`}}catch(Ce){return{file:null,error:Ce instanceof Error?Ce.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${j.name}`}}return{file:j,error:null}})),ee=[];for(let j of ce)j.error?(le(j.error),Q(`L\u1ED7i: ${j.error}`)):j.file&&ee.push(j.file);if(ee.length>0){let j=i?[...B,...ee]:ee;Se(j),Q(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ee.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${j.length}.`)}},onDropRejected:xe=>{let re=xe[0]?.errors[0];if(!re)return;let de=re.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";re.code==="file-too-large"?de=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${wr(s||0)})`:re.code==="file-invalid-type"?de=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:re.code==="too-many-files"&&(de=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${he} h\xECnh \u1EA3nh)`),le(de),Q(`L\u1ED7i t\u1EC7p: ${de}`)}}),me=(xe,re)=>{if(f||S)return;let de=B.filter((ce,ee)=>ee!==re);Se(de),n?.(xe,re),Q(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${ct(xe)}`)},De=xe=>{ue(xe),o?.(xe)};return Ti("div",{className:`group/field relative flex flex-col w-full ${M}`,children:[Ot("input",{...W({id:$,disabled:f||D,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),Ot("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),k&&Ti("label",{htmlFor:$,className:`block font-medium transition-colors duration-150 ${q.labelSize} ${Z} ${v}`,children:[k,T&&Ot("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Ti("div",{className:"flex flex-col gap-3",children:[d==="dropzone"&&Ti(Jx,{children:[Ot(Si,{size:m,color:x,variant:y,radius:ge,shape:w,objectFit:p,disabled:f,readOnly:S,isLoading:D,dragStatus:fe?"reject":we?"active":"idle",isInvalid:ke,dropzoneTitle:R,dropzoneDescription:P,icon:I,item:ve,onRemove:()=>ve&&me(ve,0),onPreview:()=>ve&&De(ve),getRootProps:O,onTriggerUpload:se,className:z,describedById:L||u?F:void 0}),!ae&&B.length>0&&Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]}),d==="card-grid"&&Ot("div",{...O({className:"w-full focus-visible:outline-hidden"}),children:Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!0,className:H})}),d==="button"&&Ti("div",{className:"flex flex-col gap-3",children:[Ot("div",{className:"flex items-center gap-3",children:Ot(Ut,{type:"button",size:m,color:ke?"error":x==="neutral"?"secondary":x,variant:y==="other"?"filled":y,radius:b,disabled:f||S||he!==void 0&&B.length>=he,onClick:se,leftIcon:Ot(Nt,{width:q.iconSize*.5,height:q.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:E})}),B.length>0&&Ot(Bn,{items:B,size:m,color:x,variant:y,radius:ge,objectFit:p,disabled:f,readOnly:S,maxCount:he,onRemove:me,onPreview:De,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]})]}),Ot($e,{id:F,helperText:u,errorMessage:ke?L:void 0,sizeClassName:q.helperSize,className:V}),ne&&Ot(cr,{open:!!ne,onClose:()=>ue(null),file:ne})]})}import{useId as tv,useMemo as rv,useState as Di}from"react";import{useDropzone as nv}from"react-dropzone";import{useMergeRefs as ov}from"@floating-ui/react";var cf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},uf={xs:{avatarSize:"size-12",iconSize:20,iconClass:"size-5",label:"text-[11px] mb-1",helper:"text-[9px] mt-0.5",rounded:"rounded"},sm:{avatarSize:"size-16",iconSize:24,iconClass:"size-6",label:"text-xs mb-1",helper:"text-[10px] mt-0.5",rounded:"rounded-md"},md:{avatarSize:"size-20",iconSize:32,iconClass:"size-8",label:"text-sm mb-1.5",helper:"text-[11px] mt-1",rounded:"rounded-lg"},lg:{avatarSize:"size-24",iconSize:40,iconClass:"size-10",label:"text-base mb-1.5",helper:"text-xs mt-1",rounded:"rounded-xl"},xl:{avatarSize:"size-32",iconSize:52,iconClass:"size-12",label:"text-lg mb-2",helper:"text-sm mt-1",rounded:"rounded-2xl"}},df={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}},ff={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},pf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600",neutral:"text-neutral-500 group-focus-within/field:text-neutral-600"},gf={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function mf(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r)if(n.startsWith(".")){let o=n.toLowerCase();o===".jpg"||o===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],o]:o===".png"?t["image/png"]=[...t["image/png"]||[],o]:o===".webp"?t["image/webp"]=[...t["image/webp"]||[],o]:o===".gif"?t["image/gif"]=[...t["image/gif"]||[],o]:o===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],o]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],o]}else t[n]||(t[n]=[]);return t}import{useEffect as Qx,useRef as ls,useState as Hn}from"react";import ev from"react-easy-crop";function bf(e){return new Promise((t,r)=>{let n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",o=>r(o)),n.setAttribute("crossOrigin","anonymous"),n.src=e})}function hf(e){return e*Math.PI/180}function xf(e,t,r){let n=hf(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function sc(e,t,r=0,n=!1,o="avatar-cropped.png",i="image/png"){let a=await bf(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let h=hf(r),d=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:p,height:m}=xf(d,w,r);s.width=p,s.height=m,l.translate(p/2,m/2),l.rotate(h),l.scale(n?-1:1,1),l.translate(-d/2,-w/2),l.drawImage(a,0,0);let x=document.createElement("canvas"),y=x.getContext("2d");if(!y)throw new Error("No 2d context for cropped canvas");return x.width=t.width,x.height=t.height,y.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((b,k)=>{x.toBlob(T=>{if(!T){k(new Error("Canvas is empty or failed to generate blob"));return}let v=new File([T],o,{type:i||"image/png"});b(v)},i||"image/png",.95)})}import{jsx as We,jsxs as lc}from"react/jsx-runtime";function cc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:n="image/png",aspectRatio:o=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:h,onCancel:d}){let w=ls(null),[p,m]=Hn(t??null),[x,y]=Hn(e),b=ls(t?.name||r),k=ls(t?.type||n),[T,v]=Hn({x:0,y:0}),[u,c]=Hn(1),[g,f]=Hn(0),[S,D]=Hn(!1),R=ls(null),[P,I]=Hn(!1);Qx(()=>{if(!p)return;let B=URL.createObjectURL(p);return y(B),()=>{URL.revokeObjectURL(B)}},[p]);let E=()=>c(B=>Math.min(l,Math.round((B+.2)*10)/10)),N=()=>c(B=>Math.max(s,Math.round((B-.2)*10)/10)),M=()=>f(B=>(B+90)%360),z=()=>f(B=>(B-90+360)%360),H=()=>D(B=>!B),V=()=>{v({x:0,y:0}),c(1),f(0),D(!1)},Y=()=>{w.current&&(w.current.value="",w.current.click())},$=B=>{if(B.target.files&&B.target.files[0]){let X=B.target.files[0];b.current=X.name,k.current=X.type||"image/png",m(X),V()}},F=(B,X)=>{R.current=X},G=async()=>{if(R.current)try{I(!0);let B=await sc(x,R.current,g,S,b.current,k.current);h(B)}catch(B){console.error("Error cropping avatar:",B)}finally{I(!1)}},A=()=>{d?.()},U="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return lc("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[We("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:$}),We("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:We(ev,{image:x,crop:T,zoom:u,rotation:g,aspect:o,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:v,onZoomChange:c,onRotationChange:f,onCropComplete:F,classes:{mediaClassName:S?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),We("div",{className:"w-full flex items-center justify-center py-2.5 px-3 bg-neutral-white border-t border-neutral-200 overflow-x-auto ui-scrollbar",children:lc("div",{className:"inline-flex items-center flex-nowrap shrink-0 gap-1 bg-neutral-50 border border-neutral-200 rounded-full px-2.5 py-1 shadow-xs text-neutral-700",children:[We("button",{type:"button",onClick:Y,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${U} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:We(Nt,{width:16,height:16})}),We("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),We("button",{type:"button",onClick:N,disabled:u<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:U,children:We(qn,{width:16,height:16})}),We("button",{type:"button",onClick:E,disabled:u>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:U,children:We(Xn,{width:16,height:16})}),We("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:We(Zn,{width:16,height:16})}),We("button",{type:"button",onClick:M,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:U,children:We(jr,{width:16,height:16})}),We("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:U,children:We(Qn,{width:16,height:16})}),We("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:U,children:We(Lt,{width:16,height:16})}),We("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),We("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${U} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:We(Oe,{width:16,height:16})}),We("button",{type:"button",onClick:G,disabled:P,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:P?We(Ne,{width:16,height:16}):We(Ar,{width:16,height:16})})]})})]})}function cs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:n,onApply:o,...i}){let a=()=>{n?.(),r?.()};return We(En,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:lc(Fn,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[We($n,{title:We("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),We(Ln,{className:"p-0 overflow-hidden",children:We(cc,{...i,onApply:l=>{o(l),r?.()},onCancel:a})})]})})}import{jsx as ft,jsxs as Ri}from"react/jsx-runtime";function uc({size:e="md",variant:t="outline",color:r="primary",shape:n="circle",radius:o,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:h,onClear:d,maxSize:w,accept:p="image/*",crop:m=!0,label:x,labelPlacement:y="top",config:b,helperText:k,errorMessage:T,disabled:v=!1,readOnly:u=!1,icon:c,name:g,id:f,className:S="",wrapperClassName:D="",avatarClassName:R="",avatarWrapperClassName:P="",labelClassName:I="",helperClassName:E="",ref:N}){let{isRequired:M=!1,isInvalid:z=!1,isLoading:H=!1,showSpinner:V=!1,isClearable:Y=!1,isFullWidth:$=!1}=b??{},F=tv(),G=f||F,A=`${G}-error-helper`,U=i!==void 0,[B,X]=Di(a??null),le=U?i??null:B,ne=Mr(le),ue=ne.name,[ie,Q]=Di(null),[q,ge]=Di(!1),[ke,L]=Di(null),[te,Z]=Di(""),he=T||ke,ae=!!(z||he),ve=ae?"error":r,Se=C(e,uf,"md"),ye=n==="circle"?"rounded-full":C(o,cf,"md"),J=t==="other"?"":C(ve,C(t,df,"outline"),"primary"),O=C(ve,ff,"primary"),W=ae?"text-error-600 font-bold":C(ve,pf,"primary"),we=C(ve,gf,"primary"),fe=K=>{U||X(K),s?.(K)},se=m!==!1,me=typeof m=="object"?m:{},De=K=>{Q({file:K.file,imageSrc:K.imageSrc,fileName:ue||"avatar.png",fileType:ne.type||"image/png"})},xe=K=>{if(K?.stopPropagation(),!(v||u||H)&&le){let _=le;fe(null),l?.(_),d?.(),Z("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},re=K=>{K?.stopPropagation(),le&&(ge(!0),h?.(le))},de=K=>{K?.stopPropagation(),le&&(ne.file?De({file:ne.file}):ne.serverFile?.src&&De({imageSrc:ne.serverFile.src}))},{getRootProps:ce,getInputProps:ee,isDragActive:j,isDragReject:Ce,inputRef:Ee}=nv({multiple:!1,maxSize:w,accept:rv(()=>mf(p),[p]),disabled:v||u||H,onDropAccepted:([K])=>{K&&(L(null),se?De({file:K}):(fe(K),Z("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:K=>{let _=K[0]?.errors[0],ze=_?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:_?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":_?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";L(ze),Z(`L\u1ED7i t\u1EC7p: ${ze}`)}}),Fe=ov([Ee,N]),oe=K=>{v||u||H||le&&(K.key==="Delete"||K.key==="Backspace")&&(K.preventDefault(),K.stopPropagation(),xe())},Te=()=>x?Ri("label",{htmlFor:G,className:`inline-flex items-center font-bold transition-colors duration-150 ${Se.label} ${W} ${I}`,children:[x,M&&ft("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Pe="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",_e=v?"opacity-50":"cursor-pointer",Ue=Ce?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":j?we:"",Le=[Pe,Se.avatarSize,ye,J,_e,Ue,R||P].filter(Boolean).join(" ");return Ri("div",{className:`group/field flex ${y==="left"?"flex-row items-center gap-3":"flex-col"} ${$?"w-full":"inline-flex"} ${D||S}`,children:[ft("input",{...ee({id:G,name:g,disabled:v||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Fe}),ft("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:te}),Te(),Ri("div",{className:`flex flex-col ${$?"w-full":""}`,children:[Ri("div",{...ce({role:"button",tabIndex:v||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":v||H,"aria-invalid":ae,"aria-required":M,"aria-describedby":T||k||ke?A:void 0,"aria-busy":H,onKeyDown:oe,className:Le}),children:[le?ft(Er,{src:le,alt:ue||"Avatar",fill:!0,radius:n==="circle"?"full":o,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):ft("div",{className:`flex flex-col items-center justify-center transition-colors ${O} ${Se.iconClass}`,children:c||ft(aa,{width:Se.iconSize,height:Se.iconSize})}),H&&V&&ft("div",{className:"absolute inset-0 bg-neutral-950/60 flex items-center justify-center text-neutral-white z-20",role:"status","aria-label":"\u0110ang t\u1EA3i",children:ft(Ne,{width:Se.iconSize,height:Se.iconSize,className:"animate-spin"})}),!H&&!v&&le&&Ri("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[ft("button",{type:"button",onClick:re,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:ft(Lr,{width:14,height:14})}),se&&!u&&ft("button",{type:"button",onClick:de,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:ft(na,{width:14,height:14})}),(!u||Y)&&ft("button",{type:"button",onClick:xe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:ft(ir,{width:14,height:14})})]})]}),ft($e,{id:A,helperText:k,errorMessage:he,sizeClassName:Se.helper,className:E}),se&&ie&&ft(cs,{open:!!ie,file:ie.file,imageSrc:ie.imageSrc,fileName:ie.fileName,fileType:ie.fileType,aspectRatio:me.aspectRatio??1,cropShape:me.cropShape??(n==="circle"?"round":"rect"),showGrid:me.showGrid??!0,minZoom:me.minZoom??1,maxZoom:me.maxZoom??4,modalTitle:me.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>Q(null),onApply:K=>{fe(K),Z("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),Q(null)}}),q&&le&&ft(cr,{open:q,onClose:()=>ge(!1),file:le,title:ue||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:ft(Fr,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}import{useId as av,useMemo as wf,useState as ds}from"react";import{useDropzone as sv}from"react-dropzone";import{jsx as tr,jsxs as us}from"react/jsx-runtime";function Do({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:h=!1,dragStatus:d="idle",isInvalid:w=!1,dropzoneTitle:p,dropzoneDescription:m,icon:x,onTriggerUpload:y,getRootProps:b,className:k="",describedById:T}){let v=C(e,Cr,"md"),u=C(n,Xa,"md"),c=w?"error":t,g=r!=="other"?C(r,q0,"outline"):null,f=g?C(c,g,"primary"):null,S="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",D="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",I=d==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":d==="active"?f?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":f?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",E=H=>{a||l||s||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),y?.())};if(i){let H=`group relative w-full ${v.compactMinHeight} ${v.compactPadding} ${u} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:H,onKeyDown:E},Y=b?b(V):V;return us("div",{...Y,children:[us("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[tr("div",{className:`transition-colors shrink-0 ${f?.iconColor||"text-primary-500"}`,children:l&&h?tr(Ne,{width:18,height:18,className:"animate-spin text-primary-600"}):x||tr(Nt,{width:18,height:18})}),tr("span",{className:`truncate text-neutral-700 font-medium ${v.descSize}`,children:p||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),tr("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${v.descSize}`,children:"Ch\u1ECDn file"})]})}let N=`group relative w-full ${o==="square"?"aspect-square w-full":C(e,X0,"md")} ${v.dropzonePadding} ${u} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,M={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:N,onKeyDown:E},z=b?b(M):M;return tr("div",{...z,children:l&&h?us("div",{className:`flex flex-col items-center justify-center gap-2 ${f?.iconColor||"text-primary-600"}`,children:[tr(Ne,{width:v.iconSize*.8,height:v.iconSize*.8}),tr("span",{className:`${v.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):us("div",{className:"flex flex-col items-center justify-center gap-2",children:[tr("div",{className:`transition-colors ${f?.iconColor||"text-primary-500"}`,children:x||tr(Nt,{width:v.iconSize,height:v.iconSize})}),tr("div",{className:`${v.titleSize} font-medium text-neutral-800 ${f?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":p??S}),tr("div",{id:T,className:`${v.descSize} text-neutral-500`,children:m??D})]})})}import{useMemo as iv}from"react";import{jsx as Ni,jsxs as vf}from"react/jsx-runtime";function Ro({file:e,fileName:t,category:r,size:n="md",className:o=""}){let i=iv(()=>{if(r)return r;let h=t||(e?ct(e):"");return ts(e||h)},[r,e,t]),a=C(i,J0,"other"),s=typeof n=="number"?n:C(n,Cr,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return vf("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${o}`,children:[vf("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[Ni("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),Ni("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),Ni("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),Ni("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ni("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}import{jsx as Ge,jsxs as ur}from"react/jsx-runtime";function Pi({item:e,index:t,listType:r="list",size:n="md",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:h=!0,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x,className:y=""}){let b=C(n,Cr,"md"),k=C(o,Xa,"md"),T=ct(e),v=ec(e),{status:u,progress:c,error:g}=tc(e),f=u==="uploading",S=u==="error",D=()=>{i||a||d?.(e,t)},R=()=>{i||w?.(e)},P=()=>{i||p?.(e)},I=()=>{i||a||m?.(e,t)};if(x)return Ge("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:x(e,t,{remove:D,preview:R,download:P})});let E=N=>{i||(N.key==="Delete"||N.key==="Backspace")&&!a&&(N.preventDefault(),D())};return r==="grid"?ur("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col justify-between p-3 ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${y}`,children:[ur("div",{className:"flex items-start gap-2.5",children:[Ge(Ro,{file:e,size:n}),ur("div",{className:"flex-1 min-w-0",children:[w&&!i?Ge("button",{type:"button",title:T,onClick:R,className:`truncate text-left font-medium text-neutral-800 ${b.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:T}):Ge("p",{title:T,className:`truncate font-medium text-neutral-800 ${b.fileNameSize}`,children:T}),Ge("p",{className:`text-neutral-500 ${b.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate block",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):f?ur("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(Ne,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",c!==void 0?`${c}%`:""]}):v!==void 0?wr(v):null})]})]}),f&&c!==void 0&&Ge("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:Ge("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,c))}%`}})}),ur("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[S&&m&&!a&&Ge("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:14,height:14})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lr,{width:14,height:14})}),l&&Ge("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(br,{width:14,height:14})}),h&&!a&&Ge("button",{type:"button",disabled:i,onClick:D,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ir,{width:14,height:14})})]})]}):ur("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col w-full ${b.itemPadding} ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${y}`,children:[ur("div",{className:"flex items-center justify-between gap-3 w-full",children:[ur("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[Ge(Ro,{file:e,size:n}),ur("div",{className:"flex flex-col min-w-0 flex-1",children:[Ge("div",{className:"flex items-center gap-2",children:w&&!i?Ge("button",{type:"button",title:T,onClick:R,className:`truncate text-left font-medium text-neutral-800 ${b.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:T}):Ge("span",{title:T,className:`truncate font-medium text-neutral-800 ${b.fileNameSize}`,children:T})}),Ge("div",{className:`flex items-center gap-2 text-neutral-500 ${b.fileMetaSize}`,children:S?Ge("span",{className:"text-error-600 font-medium truncate",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):f?ur("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[Ge(Ne,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",c!==void 0?`${c}%`:""]}):v!==void 0?Ge("span",{children:wr(v)}):null})]})]}),ur("div",{className:"flex items-center gap-1 shrink-0",children:[S&&m&&!a&&Ge("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lt,{width:15,height:15})}),s&&w&&Ge("button",{type:"button",disabled:i,onClick:R,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(Lr,{width:15,height:15})}),l&&Ge("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(br,{width:15,height:15})}),h&&!a&&Ge("button",{type:"button",disabled:i,onClick:D,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${b.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:Ge(ir,{width:15,height:15})})]})]}),f&&c!==void 0&&Ge("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:Ge("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,c))}%`}})})]})}import{jsx as yf}from"react/jsx-runtime";function zi({items:e,listType:t="list",size:r="md",color:n="primary",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:h=!0,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x,className:y=""}){let b=C(r,Cr,"md"),k=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${b.gap} list-none p-0 m-0 ${y}`:`flex flex-col ${b.gap} list-none p-0 m-0 ${y}`;return!e||e.length===0?null:yf("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:k,children:e.map((T,v)=>{let u=Q0(T,v);return yf(Pi,{item:T,index:v,listType:t,size:r,radius:o,color:n,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:h,onRemove:d,onPreview:w,onDownload:p,onRetry:m,renderItem:x},u)})})}import{jsx as dr,jsxs as dc}from"react/jsx-runtime";function fc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:h,accept:d,beforeUpload:w,viewMode:p="dropzone",listType:m="list",shape:x="rectangle",size:y="md",color:b="primary",variant:k="outline",radius:T,label:v,labelClassName:u="",helperText:c,errorMessage:g,disabled:f=!1,readOnly:S=!1,dropzoneTitle:D,dropzoneDescription:R,buttonText:P="T\u1EA3i t\u1EC7p l\xEAn",icon:I,renderItem:E,className:N="",dropzoneClassName:M="",listClassName:z="",previewClassName:H="",helperClassName:V="",config:Y}){let{isRequired:$=!1,isInvalid:F=!1,isLoading:G=!1,showSpinner:A=!1,multiple:U=!1,showFileList:B=!0,showPreviewButton:X=!0,showDownloadButton:le=!0,showRemoveButton:ne=!0}=Y??{},ue=av(),ie=`${ue}-input`,Q=`${ue}-error-helper`,q=e!==void 0,[ge,ke]=ds(()=>In(t)),L=wf(()=>q?In(e):ge,[q,e,ge]),[te,Z]=ds(null),[he,ae]=ds(null),[ve,Se]=ds(""),ye=C(y,Cr,"md"),J=T??"md",O=!!(F||g||te),W=g||te,fe=O?"text-error-600":C(O?"error":b,_0,"primary"),se=s??(U?void 0:1),me=oe=>{q||ke(oe),r?.(oe)},De=wf(()=>vi(d),[d]),{getRootProps:xe,getInputProps:re,isDragActive:de,isDragReject:ce,open:ee}=sv({multiple:U,maxSize:l,minSize:h,accept:De,disabled:f||S||G,noClick:p==="button",noKeyboard:p==="button",onDropAccepted:async oe=>{if(f||S||(Z(null),oe.length===0))return;let Te=oe,Pe=L.length;if(se!==void 0)if(U){let Le=se-Pe;if(Le<=0){let Be=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${se} t\u1EC7p)`;Z(Be),Se(Be);return}Te=oe.slice(0,Le)}else{let Le=oe[0];if(!Le)return;Te=[Le]}let _e=await Promise.all(Te.map(async Le=>{if(w)try{let Be=await w(Le);if(Be===!1||typeof Be=="string")return{file:null,error:typeof Be=="string"?Be:`T\u1EC7p ${Le.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(Be){return{file:null,error:Be instanceof Error?Be.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Le.name}`}}return{file:Le,error:null}})),Ue=[];for(let Le of _e)Le.error?(Z(Le.error),Se(`L\u1ED7i: ${Le.error}`)):Le.file&&Ue.push(Le.file);if(Ue.length>0){let Le=U?[...L,...Ue]:Ue;me(Le),Se(`\u0110\xE3 th\xEAm ${Ue.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Le.length} t\u1EC7p.`)}},onDropRejected:oe=>{let Te=oe[0]?.errors[0];if(!Te)return;let Pe=Te.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";Te.code==="file-too-large"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${wr(l||0)})`:Te.code==="file-too-small"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${wr(h||0)})`:Te.code==="file-invalid-type"?Pe=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof d=="string"?d:Object.keys(d||{}).join(", ")}`:Te.code==="too-many-files"&&(Pe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${se} t\u1EC7p)`),Z(Pe),Se(`L\u1ED7i t\u1EC7p: ${Pe}`)}}),j=(oe,Te)=>{if(f||S)return;let Pe=L.filter((_e,Ue)=>Ue!==Te);me(Pe),n?.(oe,Te),Se(`\u0110\xE3 x\xF3a t\u1EC7p tin ${ct(oe)}`)},Ce=oe=>{ae(oe),o?.(oe)},Ee=oe=>{i?.(oe);let Te=ct(oe);if(oe instanceof File){let Pe=URL.createObjectURL(oe);kr(Pe,oe.name),setTimeout(()=>URL.revokeObjectURL(Pe),1e3);return}if(typeof oe=="string"){kr(oe,Te);return}typeof oe=="object"&&oe&&typeof oe.src=="string"&&kr(oe.src,oe.name||Te)},Fe=H||z;return dc("div",{className:`group/field relative flex flex-col w-full ${N}`,children:[dr("input",{...re({id:ie,disabled:f||G,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),dr("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ve}),v&&dc("label",{htmlFor:ie,className:`block font-medium transition-colors duration-150 ${ye.labelSize} ${fe} ${u}`,children:[v,$&&dr("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),dc("div",{className:"flex flex-col gap-3",children:[p==="dropzone"&&dr(Do,{size:y,color:b,variant:k,radius:J,shape:x,disabled:f,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:D,dropzoneDescription:R,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),p==="compact"&&dr(Do,{size:y,color:b,variant:k,radius:J,compact:!0,disabled:f,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:D,dropzoneDescription:R,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||c?Q:void 0}),p==="button"&&dr("div",{className:"flex items-center gap-3",children:dr(Ut,{type:"button",size:ye.buttonSize,color:O?"error":b==="neutral"?"secondary":b,variant:k==="other"?"filled":k,radius:T,disabled:f||S||G||se!==void 0&&L.length>=se,isLoading:G,showSpinner:A,onClick:ee,leftIcon:dr(Nt,{width:ye.iconSize*.5,height:ye.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:P})}),B&&L.length>0&&dr(zi,{items:L,listType:m,size:y,color:b,variant:k,radius:J,disabled:f,readOnly:S,maxCount:se,showPreviewButton:X,showDownloadButton:le,showRemoveButton:ne,onRemove:j,onPreview:Ce,onDownload:Ee,onRetry:a,renderItem:E,className:Fe})]}),dr($e,{id:Q,helperText:c,errorMessage:O?W:void 0,sizeClassName:ye.helperSize,className:V}),he&&dr(cr,{open:!!he,onClose:()=>ae(null),file:he})]})}var Cf=300,sn={xs:{dialog:"max-w-[320px] p-4 gap-3",header:"gap-2.5",body:"text-xs",footer:"gap-2 pt-2",title:"text-sm font-semibold leading-tight text-neutral-900",description:"text-xs leading-normal text-neutral-600",iconWrapper:"size-7 rounded-full",icon:"size-4",buttonSize:"xs",buttonGap:"gap-2",closeButton:"size-5 p-0.5 -mr-1 -mt-1",closeIcon:"size-3.5"},sm:{dialog:"max-w-[380px] p-5 gap-3.5",header:"gap-3",body:"text-sm",footer:"gap-2.5 pt-2.5",title:"text-base font-semibold leading-tight text-neutral-900",description:"text-sm leading-normal text-neutral-600",iconWrapper:"size-9 rounded-full",icon:"size-5",buttonSize:"sm",buttonGap:"gap-2.5",closeButton:"size-6 p-0.5 -mr-1 -mt-1",closeIcon:"size-4"},md:{dialog:"max-w-[440px] p-6 gap-4",header:"gap-3.5",body:"text-sm",footer:"gap-3 pt-3",title:"text-lg font-semibold leading-tight text-neutral-900",description:"text-sm leading-relaxed text-neutral-600",iconWrapper:"size-10 rounded-full",icon:"size-5",buttonSize:"md",buttonGap:"gap-3",closeButton:"size-7 p-1 -mr-1.5 -mt-1.5",closeIcon:"size-4"},lg:{dialog:"max-w-[520px] p-7 gap-5",header:"gap-4",body:"text-base",footer:"gap-3.5 pt-3.5",title:"text-xl font-semibold leading-snug text-neutral-900",description:"text-base leading-relaxed text-neutral-600",iconWrapper:"size-12 rounded-full",icon:"size-6",buttonSize:"lg",buttonGap:"gap-3.5",closeButton:"size-8 p-1.5 -mr-1.5 -mt-1.5",closeIcon:"size-4.5"},xl:{dialog:"max-w-[600px] p-8 gap-6",header:"gap-4.5",body:"text-lg",footer:"gap-4 pt-4",title:"text-2xl font-bold leading-snug text-neutral-900",description:"text-lg leading-relaxed text-neutral-600",iconWrapper:"size-14 rounded-full",icon:"size-7",buttonSize:"xl",buttonGap:"gap-4",closeButton:"size-9 p-1.5 -mr-2 -mt-2",closeIcon:"size-5"}},kf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Sf={primary:"bg-primary-50 text-primary-600 border border-primary-200",secondary:"bg-secondary-50 text-secondary-600 border border-secondary-200",neutral:"bg-neutral-100 text-neutral-600 border border-neutral-200",error:"bg-error-50 text-error-600 border border-error-200",success:"bg-success-50 text-success-600 border border-success-200",warning:"bg-warning-50 text-warning-600 border border-warning-200",info:"bg-info-50 text-info-600 border border-info-200"},Tf={warning:ws,error:Cs,success:ys,info:Un,primary:Un,secondary:Un,neutral:Un};import{createContext as lv,useContext as cv}from"react";var pc=lv(null),rr=()=>cv(pc);import{jsx as uv}from"react/jsx-runtime";function gc({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=rr(),s=C(e??a?.size,sn,"md"),l=C(t,kf,"lg"),h=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return uv("div",{ref:o,tabIndex:-1,className:h,...i,children:n})}import{useEffect as fs,useEffectEvent as dv,useCallback as fv,useMemo as pv,useRef as Df,useState as gv}from"react";import{jsx as mc,jsxs as mv}from"react/jsx-runtime";function bc({open:e=!1,size:t="md",color:r="warning",isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:h,onClose:d,...w}){let p=Df(null),[m,x]=gv(!1),y=Df(null),b=fv(()=>{m||n||(x(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{x(!1),d?.()},Cf))},[m,n,d]),k=pv(()=>({onClose:b,isLoading:n,size:t,color:r}),[b,n,t,r]);fs(()=>()=>{y.current&&clearTimeout(y.current)},[]),fs(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),fs(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=dv(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),b())});if(fs(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let v=()=>{o&&b()},u=m?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",c=m?"animate-confirm-out pointer-events-none":"animate-confirm-in";return mc(pc.Provider,{value:k,children:mv("dialog",{ref:p,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&b()},className:`fixed inset-0 flex items-center justify-center p-4 bg-neutral-950/40 backdrop-blur-xs border-none m-0 max-w-none max-h-none w-screen h-screen overflow-visible backdrop:bg-transparent ${u} ${s}`,...w,children:[mc("div",{"aria-hidden":"true",onClick:v,className:"fixed inset-0 -z-10"}),mc("div",{className:`w-full flex items-center justify-center pointer-events-none ${c} ${l}`,children:h})]})})}import{jsx as No,jsxs as Rf}from"react/jsx-runtime";function hc({size:e,color:t,icon:r=!0,title:n,iconClassName:o="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:h="",children:d,...w}){let p=rr(),m=C(e??p?.size,sn,"md"),x=C(t??p?.color,Sf,"warning"),y=p?.isLoading,b=()=>{s?.(),p?.onClose?.()},k=!!(s||p?.onClose),T=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return No("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${o}`,"aria-hidden":"true",children:r});let v=C(t??p?.color,Tf,"warning");return No("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${x} ${o}`,"aria-hidden":"true",children:No(v,{className:m.icon})})};return Rf("div",{className:`flex items-start justify-between w-full ${m.header} ${h}`,...w,children:[Rf("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),n&&No("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:n}),d]}),a&&k&&No("button",{type:"button",onClick:b,disabled:y,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${m.closeButton} ${l}`,children:No(Oe,{className:m.closeIcon})})]})}import{jsx as bv,jsxs as hv}from"react/jsx-runtime";function xc({size:e,description:t,descriptionClassName:r="",className:n="",children:o,...i}){let a=rr(),s=C(e??a?.size,sn,"md");return hv("div",{className:`w-full ${s.body} ${n}`,id:"confirm-dialog-description",...i,children:[t?bv("p",{className:`${s.description} ${r}`,children:t}):null,o]})}import{jsx as vc,jsxs as xv}from"react/jsx-runtime";function yc({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:n="filled",cancelVariant:o="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:h,confirmButtonProps:d,cancelButtonProps:w,className:p="",children:m,...x}){let y=rr(),b=C(e??y?.size,sn,"md"),k=i??y?.color??"warning",T=()=>{h?.(),y?.onClose?.()},v=async()=>{try{let c=s?.();c&&"then"in c&&await c,T()}catch{}},u=()=>{l?.(),T()};return m?vc("div",{className:`flex items-center justify-end w-full ${b.footer} ${b.buttonGap} ${p}`,...x,children:m}):xv("div",{className:`flex items-center justify-end w-full ${b.footer} ${b.buttonGap} ${p}`,...x,children:[r!==!1&&vc(Ut,{size:b.buttonSize,variant:o,color:a,onClick:u,disabled:w?.disabled||y?.isLoading,...w,children:r}),vc(Ut,{size:b.buttonSize,variant:n,color:k,isLoading:y?.isLoading||d?.isLoading,disabled:d?.disabled,onClick:v,...d,children:t})]})}import{cloneElement as vv,isValidElement as yv}from"react";import{jsx as wv}from"react/jsx-runtime";function wc({children:e,asChild:t=!0,onClick:r,...n}){let o=rr(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&yv(e)){let s=e;return vv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return wv("button",{type:"button",onClick:a,disabled:i,...n,children:e})}import{jsx as Cv}from"react/jsx-runtime";function Cc({size:e,className:t="",children:r,...n}){let o=er(),i=C(e??o?.size,an,"md");return Cv("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...n,children:r})}import{cloneElement as kv,isValidElement as Sv}from"react";import{jsx as Tv}from"react/jsx-runtime";function kc({children:e,asChild:t=!0,onClick:r,...n}){let o=er(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&Sv(e)){let s=e;return kv(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return Tv("button",{type:"button",onClick:a,disabled:i,...n,children:e})}import{createContext as Dv,useContext as Rv,useMemo as Nv}from"react";import{jsx as Sr}from"react/jsx-runtime";var Nf=Dv({size:"md",variantStyles:Mi.default}),Po=()=>Rv(Nf);function ps({variant:e="default",size:t="md",className:r="",containerClassName:n="",wrapperProps:o,children:i,ref:a,...s}){let l=C(e,Mi,"default"),h=Nv(()=>({size:t,variantStyles:l}),[t,l]);return Sr(Nf.Provider,{value:h,children:Sr("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${n}`.trim(),...o,children:Sr("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function gs({className:e="",children:t,ref:r,...n}){let{variantStyles:o}=Po();return Sr("thead",{ref:r,className:`${o.head} ${e}`.trim(),...n,children:t})}function ms({className:e="",children:t,ref:r,...n}){return Sr("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...n,children:t})}function Pf({className:e="",children:t,ref:r,...n}){return Sr("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...n,children:t})}function Vn({isSelected:e=!1,isHoverable:t=!0,className:r="",children:n,ref:o,...i}){let{variantStyles:a}=Po(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return Sr("tr",{ref:o,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:n})}function ln({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i}=Po(),a=C(i,Ii,"md"),s=C(e,Fi,"left");return Sr("th",{ref:n,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...o,children:r})}function zo({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i,variantStyles:a}=Po(),s=C(i,Ii,"md"),l=C(e,Fi,"left");return Sr("td",{ref:n,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...o,children:r})}function zf({className:e="",children:t,ref:r,...n}){return Sr("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...n,children:t})}import{jsx as An,jsxs as Pv}from"react/jsx-runtime";function Io({column:e,title:t,className:r="",...n}){if(!e.getCanSort())return An("div",{className:`font-semibold ${r}`.trim(),...n,children:t});let o=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return An("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...n,children:Pv("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[An("span",{children:t}),An("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:o==="asc"?An(la,{className:"w-3.5 h-3.5 text-primary-600"}):o==="desc"?An(ca,{className:"w-3.5 h-3.5 text-primary-600"}):An(sa,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}import{useSortable as zv}from"@dnd-kit/sortable";import{CSS as Iv}from"@dnd-kit/utilities";import{jsx as If}from"react/jsx-runtime";function Sc({header:e,canSort:t=!1,headerContent:r,ariaSort:n,disabled:o=!1,className:i=""}){let a=e.column.id==="_select",s=o||a,{attributes:l,listeners:h,setNodeRef:d,transform:w,transition:p,isDragging:m}=zv({id:e.column.id,disabled:s}),x={transform:Iv.Translate.toString(w),transition:p,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},y=t&&typeof e.column.columnDef.header=="string"?If(Io,{column:e.column,title:e.column.columnDef.header}):r;return If(ln,{ref:d,style:x,"aria-sort":n,"data-column-id":e.column.id,...s?{}:l,...s?{}:h,className:`
3
+ ${s?"":"select-none cursor-grab active:cursor-grabbing transition-colors"}
4
+ ${m?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
5
+ ${i}
6
+ `.trim(),children:y})}import{useMemo as Mf}from"react";import{jsx as St,jsxs as Tc}from"react/jsx-runtime";function Mv(e,t){return t<=7?Array.from({length:t},(r,n)=>n+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function bs({table:e,pageSizeOptions:t=Ei,showPageSizeSelector:r=!0,className:n=""}){let o=e.state.pagination,i=o?.pageIndex??0,a=o?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),h=i+1,d=e.getCanPreviousPage(),w=e.getCanNextPage(),p=Mf(()=>t.map(x=>({label:`${x}`,value:x})),[t]),m=Mf(()=>Mv(h,l),[h,l]);return Tc("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${n}`.trim(),children:[r?Tc("div",{className:"flex items-center gap-2",children:[St("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),St("div",{className:"w-20","data-testid":"table-page-size-selector",children:St(bi,{size:"sm",options:p,value:a,onChange:x=>{x!=null&&e.setPageSize(Number(x))},searchable:!1,clearable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):St("div",{}),Tc("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[St(fr,{icon:St(Gr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!d,onClick:()=>e.firstPage()}),St(fr,{icon:St(Yt,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!d,onClick:()=>e.previousPage()}),St("div",{className:"flex items-center gap-1 px-1",children:m.map((x,y)=>{if(x==="...")return St("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${y}`);let b=Number(x),k=b===h;return St("button",{type:"button",onClick:()=>e.setPageIndex(b-1),"aria-label":`Trang ${b}`,"aria-current":k?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${k?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:b},b)})}),St(fr,{icon:St(Wt,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),St(fr,{icon:St(Ur,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}import{useState as Dc,useRef as Fv,useEffect as Ev,useMemo as Ff}from"react";import{useFloating as Ef,autoUpdate as $f,offset as Lf,flip as Bf,shift as Hf,useClick as Vf,useDismiss as Af,useInteractions as Of,FloatingPortal as Gf}from"@floating-ui/react";import{Fragment as Lv,jsx as nt,jsxs as nr}from"react/jsx-runtime";function Uf(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(n=>String(n.value)===String(t));if(r)return String(r.label)}return String(t)}function $v({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:h,context:d}=Ef({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[Lf(6),Bf(),Hf({padding:8})],whileElementsMounted:$f}),{isMounted:w,styles:p}=et(d),m=Vf(d),x=Af(d,{outsidePress:g=>!g.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:y,getFloatingProps:b}=Of([m,x]),k=Fv(null);Ev(()=>{r&&k.current?.focus({preventScroll:!0})},[r]);let T=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),v=Uf(e,t),u=e.type==="date"||e.type==="date-range",c=()=>e.type==="custom"?e.render?.({value:t,onChange:g=>i(a,g)})??null:e.type==="date-range"?nt(Tn,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:g=>i(a,g),...e.props||{}}):e.type==="date"?nt(Sn,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:g=>i(a,g),...e.props||{}}):e.type==="number"?nt(dn,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:g=>{let f=g.target.value;if(f==="")i(a,"");else{let S=Hr(f);i(a,S!==void 0?S:f)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?nt(bn,{size:"sm",value:t||[],onChange:g=>i(a,g),options:(e.options||[]).map(g=>({value:String(g.value),label:g.label,disabled:g.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):nt(Ct,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:g=>i(a,g.target.value),...e.props||{}});return nr(Lv,{children:[nt("div",{ref:l,...y({className:"inline-flex items-center"}),children:nr($t,{size:"sm",variant:"soft",color:T||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[nr("span",{className:"font-semibold",children:[e.label,":"]}),nt("span",{"data-testid":`filter-chip-val-${a}`,className:T?"font-medium":"opacity-70 italic",children:v})]})}),w&&nt(Gf,{children:nr("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...h,...p,zIndex:Qe.SELECT_FILTER},...b({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-3 shadow-2xl ${u?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[nr("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[nt("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),nt("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:nt(Oe,{className:"w-3.5 h-3.5"})})]}),nt("div",{className:"mt-1",children:c()}),nr("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[nt("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),nt("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-2 py-0.5 rounded border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function Rc({filters:e,values:t,onChange:r,onReset:n,className:o=""}){let[i,a]=Dc([]),s=Ff(()=>{let P=[],I=new Set;return e?.forEach(E=>{let N=t?.[E.name];N!=null&&N!==""&&(!Array.isArray(N)||N.length>0&&(N[0]!=null||N[1]!=null))&&(P.push(E.name),I.add(E.name))}),i.forEach(E=>{I.has(E)||(P.push(E),I.add(E))}),P},[e,t,i]),l=Ff(()=>new Set(s),[s]),[h,d]=Dc(null),[w,p]=Dc(!1),{refs:{setFloating:m,setReference:x},floatingStyles:y,context:b}=Ef({open:w,onOpenChange:p,placement:"bottom-start",transform:!1,middleware:[Lf(6),Bf(),Hf({padding:8})],whileElementsMounted:$f}),{isMounted:k,styles:T}=et(b,{duration:120}),v=Vf(b),u=Af(b,{outsidePress:P=>!P.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:c,getFloatingProps:g}=Of([v,u]),f=P=>{l.has(P.name)||a(I=>[...I,P.name]),p(!1),d(P.name)},S=P=>{a(I=>I.filter(E=>E!==P)),h===P&&d(null),r(P,void 0)},D=P=>{P.stopPropagation(),a([]),d(null),n?.()},R=s.length>0;return!e||e.length===0?null:nr("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${o}`.trim(),children:[nr("div",{className:"inline-flex",children:[nr("button",{ref:x,type:"button","data-testid":"table-add-filter-button",...c({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[nt(pr,{className:"w-3.5 h-3.5 text-neutral-500"}),nt("span",{children:"B\u1ED9 l\u1ECDc"}),nt(lt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),k&&nt(Gf,{children:nr("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...y,...T,zIndex:Qe.SELECT_FILTER},...g({className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[nt("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),nt("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let I=l.has(P.name);return nr("button",{type:"button","data-testid":`filter-option-${P.name}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),f(P)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${I?"text-primary-600 font-medium bg-primary-50 dark:bg-primary-950/40":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[nt("span",{children:P.label}),I&&nt("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),e.map(P=>{if(!l.has(P.name))return null;let I=t?.[P.name],E=h===P.name;return nt($v,{field:P,currentValue:I,isOpen:E,onOpenChange:N=>{d(N?P.name:null)},onRemove:()=>S(P.name),onChange:r},P.name)}),R&&nr("button",{type:"button","data-testid":"table-filter-reset-button",onClick:D,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[nt(Lt,{className:"w-3.5 h-3.5"}),nt("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}import{jsx as wt,jsxs as Mo}from"react/jsx-runtime";var Bv={};function hs({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:n=!0,isRefresh:o=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:h=Bv,onFilterChange:d,onFilterReset:w,className:p=""}){let m=e.state.globalFilter??"",x=e.getAllLeafColumns().filter(v=>v.getCanHide()),y=e.getSelectedRowModel?.()?.rows??[],b=y.length,k=v=>{e.setGlobalFilter(v.target.value)},T=()=>{e.setGlobalFilter("")};return Mo("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${p}`.trim(),children:[Mo("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&Mo("div",{className:"relative w-full sm:w-64 max-w-xs",children:[wt("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:wt(mn,{className:"w-4 h-4"})}),wt("input",{type:"text",value:m,onChange:k,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),m&&wt("button",{type:"button",onClick:T,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:wt(Oe,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&d&&wt(Rc,{filters:l,values:h,onChange:d,onReset:w}),b>0&&s&&wt("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(y)})]}),Mo("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(o||!!i)&&wt(fr,{icon:wt(jr,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),n&&x.length>0&&Mo(Xo,{size:"sm",placement:"bottom-end",children:[wt(ka,{asChild:!0,children:wt(Ut,{variant:"outline",size:"sm",color:"neutral",leftIcon:wt(ua,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),Mo(Cl,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[wt(kl,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),wt(Sl,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:x.map(v=>{let u=typeof v.columnDef.header=="string"?v.columnDef.header:v.id;return wt("div",{className:"w-full",children:wt(mr,{size:"sm",label:u,checked:v.getIsVisible(),onChange:v.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},v.id)})})]})]}),a]})]})}import{useMemo as Pc,useState as On}from"react";import{flexRender as zc}from"@tanstack/react-table";import{DndContext as Qv,closestCenter as ey,PointerSensor as ty,KeyboardSensor as ry,useSensor as Yf,useSensors as ny}from"@dnd-kit/core";import{restrictToHorizontalAxis as oy}from"@dnd-kit/modifiers";import{arrayMove as iy,SortableContext as ay,horizontalListSortingStrategy as sy}from"@dnd-kit/sortable";import{tableFeatures as Vv,rowSortingFeature as Av,rowPaginationFeature as Ov,rowSelectionFeature as Gv,columnFilteringFeature as Uv,globalFilteringFeature as jv,columnVisibilityFeature as Yv,columnPinningFeature as Wv,columnOrderingFeature as Kv,createSortedRowModel as _v,createPaginatedRowModel as Xv,createFilteredRowModel as qv,createColumnHelper as Zv,useTable as Jv}from"@tanstack/react-table";import{rankItem as Hv}from"@tanstack/match-sorter-utils";var xs=(e,t,r,n)=>{let o=Hv(e.getValue(t),String(r??""));return n?.({itemRank:o}),o.passed};var Nc=Vv({rowSortingFeature:Av,rowPaginationFeature:Ov,rowSelectionFeature:Gv,columnFilteringFeature:Uv,globalFilteringFeature:jv,columnVisibilityFeature:Yv,columnPinningFeature:Wv,columnOrderingFeature:Kv,sortedRowModel:_v(),paginatedRowModel:Xv(),filteredRowModel:qv(),filterFns:{fuzzy:xs}});function jf(){return Zv()}function vs(e){let{features:t=Nc,columns:r,...n}=e;return Jv({features:t,columns:r,...n})}import{jsx as it,jsxs as Wf}from"react/jsx-runtime";function Kf({columns:e,data:t,variant:r="default",size:n="md",isLoading:o=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:h,enableSorting:d=!0,enableFiltering:w=!0,enablePagination:p=!0,enableRowSelection:m=!1,enableColumnVisibility:x=!0,enableColumnOrdering:y=!1,filters:b,searchPlaceholder:k,toolbarActions:T,renderBulkActions:v,pageSizeOptions:u,initialPageSize:c=$i,manualPagination:g=!1,manualSorting:f=!1,manualFiltering:S=!1,pageCount:D,rowCount:R,pagination:P,onPaginationChange:I,sorting:E,onSortingChange:N,rowSelection:M,onRowSelectionChange:z,columnVisibility:H,onColumnVisibilityChange:V,columnOrder:Y,onColumnOrderChange:$,globalFilter:F,onGlobalFilterChange:G,globalFilterFn:A,columnFilters:U,onColumnFiltersChange:B,onRowClick:X,className:le="",containerClassName:ne=""}){let[ue,ie]=On([]),[Q,q]=On({pageIndex:0,pageSize:c}),[ge,ke]=On({}),[L,te]=On({}),[Z,he]=On([]),[ae,ve]=On(""),[Se,ye]=On(()=>{if(!b)return[];let K=[];return b.forEach(_=>{_.defaultValue!==void 0&&_.defaultValue!==null&&_.defaultValue!==""&&(!Array.isArray(_.defaultValue)||_.defaultValue.length>0)&&K.push({id:_.name,value:_.defaultValue})}),K}),J=E??ue,O=K=>{let _=typeof K=="function"?K(J):K;N?N(_):ie(_)},W=P??Q,we=K=>{let _=typeof K=="function"?K(W):K;I?I(_):q(_)},fe=M??ge,se=K=>{let _=typeof K=="function"?K(fe):K;z?z(_):ke(_)},me=H??L,De=K=>{let _=typeof K=="function"?K(me):K;V?V(_):te(_)},xe=Y??Z,re=K=>{let _=typeof K=="function"?K(xe):K;$?$(_):he(_)},de=F??ae,ce=K=>{let _=typeof K=="function"?K(de):K;G?G(String(_??"")):ve(String(_??""))},ee=U??Se,j=Pc(()=>{let K={};return ee.forEach(_=>{K[_.id]=_.value}),K},[ee]),Ce=(K,_)=>{let ze=ee.filter(Me=>Me.id!==K);_!=null&&_!==""&&(!Array.isArray(_)||_.length>0)&&ze.push({id:K,value:_}),B?B(ze):ye(ze)},Ee=()=>{B?B([]):ye([])},Fe=Pc(()=>{let K=e;return!S&&b&&b.length>0&&(K=K.map(_=>{let ze=_.id??_.accessorKey,pe=b.find(Me=>Me.name===ze);return!pe||_.filterFn?_:pe.type==="select"||pe.type==="checkbox-group"?{..._,filterFn:(Me,Xe,He)=>{if(!He||Array.isArray(He)&&He.length===0)return!0;let Ze=Me.getValue(Xe);return Array.isArray(He)?He.some(qe=>String(qe).toLowerCase()===String(Ze).toLowerCase()):String(Ze).toLowerCase()===String(He).toLowerCase()}}:pe.type==="date-range"?{..._,filterFn:(Me,Xe,He)=>{if(!He||!Array.isArray(He))return!0;let[Ze,qe]=He;if(!Ze&&!qe)return!0;let Re=Me.getValue(Xe);if(!Re)return!1;let Ye=Re instanceof Date?Re:new Date(Re);if(isNaN(Ye.getTime()))return!1;if(Ze){let be=new Date(Ze);if(be.setHours(0,0,0,0),Ye<be)return!1}if(qe){let be=new Date(qe);if(be.setHours(23,59,59,999),Ye>be)return!1}return!0}}:_})),m&&!e.some(ze=>ze.id==="_select")?[{id:"_select",header:({table:pe})=>it("div",{className:"flex items-center justify-center",children:it(mr,{size:"sm",checked:pe.getIsAllPageRowsSelected(),config:{indeterminate:pe.getIsSomePageRowsSelected()},onChange:pe.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:pe})=>it("div",{className:"flex items-center justify-center",children:it(mr,{size:"sm",checked:pe.getIsSelected(),disabled:!pe.getCanSelect(),onChange:pe.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${pe.id}`})}),enableSorting:!1,enableHiding:!1},...K]:K},[e,m,S,b]),oe=vs({data:t,columns:Fe,state:{sorting:J,pagination:W,rowSelection:fe,columnVisibility:me,columnOrder:xe,globalFilter:de,columnFilters:S?[]:ee},enableSorting:d,enableRowSelection:m,manualPagination:g,manualSorting:f,manualFiltering:!1,globalFilterFn:A??"fuzzy",pageCount:D,rowCount:R,onSortingChange:O,onPaginationChange:we,onRowSelectionChange:se,onColumnVisibilityChange:De,onColumnOrderChange:re,onGlobalFilterChange:ce}),Te=oe.getVisibleLeafColumns().length,Pe=p?oe.getRowModel().rows:oe.getPrePaginatedRowModel?.()?.rows??oe.getRowModel().rows,_e=w||x||!!(b&&b.length>0)||!!(i||a)||!!T||!!v,Ue=ny(Yf(ty,{activationConstraint:{distance:8}}),Yf(ry)),Le=Pc(()=>oe.getVisibleLeafColumns().map(K=>K.id),[oe]),Be=K=>{let{active:_,over:ze}=K;if(_&&ze&&_.id!==ze.id){if(_.id==="_select"||ze.id==="_select")return;let pe=oe.getVisibleLeafColumns().map(He=>He.id),Me=pe.indexOf(_.id),Xe=pe.indexOf(ze.id);if(Me!==-1&&Xe!==-1){let He=iy(pe,Me,Xe);re(He)}}},Ke=Wf(ps,{variant:r,size:n,containerClassName:ne,children:[it(gs,{children:oe.getHeaderGroups().map(K=>it(Vn,{isHoverable:!1,children:y?it(ay,{items:Le,strategy:sy,children:K.headers.map(_=>{if(_.isPlaceholder)return it(ln,{},_.id);let ze=_.column.getCanSort()&&d,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=zc(_.column.columnDef.header,_.getContext());return it(Sc,{header:_,canSort:ze,ariaSort:Me,headerContent:Xe},_.id)})}):K.headers.map(_=>{if(_.isPlaceholder)return it(ln,{},_.id);let ze=_.column.getCanSort()&&d,pe=_.column.getIsSorted(),Me=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,Xe=zc(_.column.columnDef.header,_.getContext());return it(ln,{"aria-sort":Me,"data-column-id":_.column.id,children:ze&&typeof _.column.columnDef.header=="string"?it(Io,{column:_.column,title:_.column.columnDef.header}):Xe},_.id)})},K.id))}),it(ms,{children:o||i?Array.from({length:s}).map((K,_)=>it(Vn,{isHoverable:!1,children:Array.from({length:Te}).map((ze,pe)=>it(zo,{children:it(jn,{className:"h-4 w-full rounded"})},`skeleton-cell-${_}-${pe}`))},`skeleton-row-${_}`)):Pe.length===0?it(Vn,{isHoverable:!1,children:it(zo,{colSpan:Te,className:"py-12 text-center",children:h??it(Pn,{size:"sm",image:de?"search":"default",description:l||(de?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):Pe.map(K=>{let _=K.getIsSelected();return it(Vn,{isSelected:_,isHoverable:!0,onClick:()=>X?.(K),className:X?"cursor-pointer":void 0,children:K.getVisibleCells().map(ze=>it(zo,{children:zc(ze.column.columnDef.cell,ze.getContext())},ze.id))},K.id)})})]});return Wf("div",{className:`w-full space-y-2 ${le}`.trim(),children:[_e&&it(hs,{table:oe,searchPlaceholder:k,enableGlobalFilter:w,enableColumnVisibility:x,isRefresh:i,onRefresh:a,actions:T,selectedActions:v,filters:b,filterValues:j,onFilterChange:Ce,onFilterReset:Ee}),y?it(Qv,{collisionDetection:ey,modifiers:[oy],onDragEnd:Be,sensors:Ue,children:Ke}):Ke,p&&!o&&Pe.length>0&&it(bs,{table:oe,pageSizeOptions:u})]})}export{Qa as AUDIO_EXTENSIONS,Mc as Alert,Cs as AlertCircleIcon,ws as AlertTriangleIcon,ca as ArrowDownIcon,sa as ArrowUpDownIcon,la as ArrowUpIcon,aa as AvatarIcon,$t as Badge,Ut as Button,xr as Calendar,Qo as CalendarHeader,Cu as CalendarIcon,gd as Carousel,bd as CarouselContent,vd as CarouselNext,yd as CarouselPagination,xd as CarouselPrevious,hd as CarouselSlide,ys as CheckCircleIcon,Ar as CheckIcon,mr as Checkbox,bn as CheckboxGroup,lt as ChevronDownIcon,Yt as ChevronLeftIcon,Wt as ChevronRightIcon,Su as ClockIcon,Oe as CloseIcon,tl as Collapse,jo as CollapseContent,Uo as CollapseHeader,nl as CollapsePanel,ol as Collapsible,gc as Confirm,xc as ConfirmBody,wc as ConfirmClose,bc as ConfirmContainer,yc as ConfirmFooter,hc as ConfirmHeader,na as CropIcon,$i as DEFAULT_PAGE_SIZE,Ei as DEFAULT_PAGE_SIZE_OPTIONS,_f as DEFAULT_TOAST_DURATION,es as DOCUMENT_EXTENSIONS,Kf as DataTable,Sn as DatePicker,co as DateRangeCalendar,ao as DateRangeDayGrid,oi as DateRangeHeader,so as DateRangeMonthGrid,Tn as DateRangePicker,lo as DateRangeYearGrid,Ol as DateTimePicker,Gl as DateTimeRangePicker,ti as DayGrid,Gr as DoubleChevronLeftIcon,Ur as DoubleChevronRightIcon,br as DownloadIcon,pl as Dropdown,Fd as DropdownGroup,Id as DropdownHeader,zd as DropdownItem,hl as DropdownMenu,Md as DropdownSeparator,Dd as DropdownTrigger,Pn as Empty,Os as EmptyDefaultIcon,Us as EmptyErrorIcon,js as EmptyFolderIcon,po as EmptyIllustration,Gs as EmptySearchIcon,Ys as EmptySimpleIcon,Lr as EyeIcon,cr as FileContainer,Ro as FileIcon,Fr as FilePreview,Qn as FlipHorizontalIcon,qa as IMAGE_EXTENSIONS,fr as IconButton,ra as ImageIcon,wi as ImagePreview,yi as ImagePreviewToolbar,Un as InfoCircleIcon,Ct as Input,Er as LoadingImage,Ki as MinusIcon,Fn as Modal,Ln as ModalBody,kc as ModalClose,En as ModalContainer,Cc as ModalFooter,$n as ModalHeader,ri as MonthGrid,Es as MultiInput,j0 as MultiSelect,Wa as MultiSelectTrigger,dn as NumberInput,Ms as OtpInput,Za as PDF_EXTENSIONS,zs as PasswordInput,pr as PlusIcon,Xo as Popover,Ad as PopoverBody,Ud as PopoverClose,Hd as PopoverContent,Od as PopoverFooter,Vd as PopoverHeader,ka as PopoverTrigger,Lo as Radio,Zi as RadioDotIcon,Hs as RadioGroup,Lt as ResetIcon,Zn as RotateCcwIcon,jr as RotateCwIcon,mn as SearchIcon,A0 as Select,bi as SelectComponent,yo as SelectMenu,ja as SelectMenuFilter,Ga as SelectOption,xo as SelectTrigger,xo as SingleSelectTrigger,jn as Skeleton,Oo as Slider,ga as SliderMarks,ma as SliderStepDots,Vo as SliderThumb,ua as SlidersHorizontalIcon,Ne as Spinner,kn as Tab,Cn as TabList,ll as TabPanel,sl as TabPanels,ps as Table,ms as TableBody,zf as TableCaption,zo as TableCell,Io as TableColumnHeader,Pf as TableFooter,ln as TableHead,gs as TableHeader,bs as TablePagination,Vn as TableRow,hs as TableToolbar,wn as Tabs,$s as TextArea,tn as TimeColumn,Hl as TimePicker,Vl as TimeRangePicker,qt as TimeView,Xf as Toaster,As as Toggle,Ho as Tooltip,ir as TrashIcon,uc as UploadAvatar,cc as UploadAvatarCropContent,cs as UploadAvatarCropModal,fc as UploadFile,Do as UploadFileDropzone,Pi as UploadFileItemRow,zi as UploadFileList,Nt as UploadIcon,ac as UploadImage,Si as UploadImageDropzone,Bn as UploadImageList,Ja as VIDEO_EXTENSIONS,ni as YearGrid,Xn as ZoomInIcon,qn as ZoomOutIcon,Rn as checkIsDisabled,Js as clamp,Zt as combineDateTime,Dn as createDateWithTime,jf as createTableColumnHelper,Nc as defaultTableFeatures,kr as downloadFile,wr as formatBytes,Ht as formatDate,At as formatDateTime,Br as formatNumberString,It as formatTime,xs as fuzzyFilter,Ta as generateCalendarGrid,ai as generateRangeCalendarGrid,rn as getDefaultDateTimeFormat,en as getDefaultFormat,ts as getFileCategory,xi as getFileExtension,ct as getFileName,ko as getFileType,Jo as getISOWeekNumber,Ao as getPercentage,C as getSafeConfig,Zo as isDateAfter,qo as isDateBefore,qr as isSameDay,Sa as isSameMonth,t0 as isSameTime,n0 as isTimeAfter,r0 as isTimeBefore,p0 as isTimeInRange,Gi as isValidOtpChar,Mr as normalizePreviewFile,lr as padZero,Rl as parseDate,li as parseDateTime,Hr as parseNumber,_c as parseRawNumberString,Vt as parseTimeToDate,un as rankAndFilterItems,dt as resolveLocale,Ui as sanitizeOtpString,ji as splitTagsFromText,mt as toDate,Jt as toDateTime,e0 as toTimeObject,qf as toast,Ds as useAnimatedError,ya as useCarousel,ar as useCarouselContext,Yr as useCollapseContext,to as useCollapsePanelContext,rr as useConfirmContext,vs as useDataTable,Rx as useDebounce,gn as useDebouncedCallback,hr as useDropdownContext,rs as useFileContext,et as useFloatingTransition,Zf as useInfiniteScroll,er as useModalContext,zt as usePopoverContext,Po as useTableStyles,Wr as useTabsContext};
3
7
  //# sourceMappingURL=index.js.map