@openway/ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
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};
3
+ //# sourceMappingURL=index.js.map