@openway/ui 1.0.0 → 1.0.1
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/README.md +203 -181
- package/dist/chunk-CJQNI3QX.js +3 -0
- package/dist/chunk-CJQNI3QX.js.map +1 -0
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2642 -1103
- package/dist/index.d.ts +2642 -1103
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/query.cjs +3 -0
- package/dist/query.cjs.map +1 -0
- package/dist/query.d.cts +309 -0
- package/dist/query.d.ts +309 -0
- package/dist/query.js +3 -0
- package/dist/query.js.map +1 -0
- package/dist/useInfiniteScroll-DAlgjUN4.d.cts +325 -0
- package/dist/useInfiniteScroll-DAlgjUN4.d.ts +325 -0
- package/docs/AGENTS.md +144 -0
- package/docs/README.md +150 -0
- package/docs/SKILL.md +54 -0
- package/docs/components/alert.md +246 -0
- package/docs/components/badge.md +238 -0
- package/docs/components/button.md +262 -0
- package/docs/components/carousel.md +354 -0
- package/docs/components/checkbox.md +252 -0
- package/docs/components/collapse.md +318 -0
- package/docs/components/confirm.md +322 -0
- package/docs/components/datepicker.md +259 -0
- package/docs/components/daterangepicker.md +260 -0
- package/docs/components/datetimepicker.md +226 -0
- package/docs/components/datetimerangepicker.md +222 -0
- package/docs/components/dropdown.md +275 -0
- package/docs/components/empty.md +200 -0
- package/docs/components/file-preview.md +180 -0
- package/docs/components/input.md +559 -0
- package/docs/components/modal.md +293 -0
- package/docs/components/popover.md +255 -0
- package/docs/components/radio.md +245 -0
- package/docs/components/select.md +254 -0
- package/docs/components/skeleton.md +150 -0
- package/docs/components/slider.md +346 -0
- package/docs/components/table.md +316 -0
- package/docs/components/tabs.md +432 -0
- package/docs/components/textarea.md +193 -0
- package/docs/components/timepicker.md +242 -0
- package/docs/components/timerangepicker.md +210 -0
- package/docs/components/toast.md +282 -0
- package/docs/components/toggle.md +211 -0
- package/docs/components/tooltip.md +213 -0
- package/docs/components/upload-avatar.md +318 -0
- package/docs/components/upload-file.md +245 -0
- package/docs/components/upload-image.md +126 -0
- package/docs/hooks/useDebounce.md +92 -0
- package/docs/hooks/useInfiniteScroll.md +95 -0
- package/docs/hooks/useSelectInfiniteQuery.md +123 -0
- package/docs/hooks/useTableQuery.md +124 -0
- package/package.json +31 -12
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var w0=Object.create;var ja=Object.defineProperty;var C0=Object.getOwnPropertyDescriptor;var k0=Object.getOwnPropertyNames;var S0=Object.getPrototypeOf,T0=Object.prototype.hasOwnProperty;var R0=(e,r)=>{for(var t in r)ja(e,t,{get:r[t],enumerable:!0})},Nu=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of k0(r))!T0.call(e,n)&&n!==t&&ja(e,n,{get:()=>r[n],enumerable:!(o=C0(r,n))||o.enumerable});return e};var Ft=(e,r,t)=>(t=e!=null?w0(S0(e)):{},Nu(r||!e||!e.__esModule?ja(t,"default",{value:e,enumerable:!0}):t,e)),N0=e=>Nu(ja({},"__esModule",{value:!0}),e);var lf={};R0(lf,{AUDIO_EXTENSIONS:()=>Aa,Alert:()=>hn,AlertCircleIcon:()=>ln,AlertTriangleIcon:()=>sn,Badge:()=>Bt,Button:()=>wt,Calendar:()=>Wt,CalendarHeader:()=>yi,CalendarIcon:()=>_l,Carousel:()=>gc,CarouselContent:()=>bc,CarouselNext:()=>vc,CarouselPagination:()=>yc,CarouselPrevious:()=>xc,CarouselSlide:()=>hc,CheckCircleIcon:()=>an,CheckIcon:()=>Zt,Checkbox:()=>Xn,CheckboxGroup:()=>_n,CheckboxGroupContext:()=>Kn,ChevronDownIcon:()=>kr,ChevronLeftIcon:()=>kt,ChevronRightIcon:()=>St,ClockIcon:()=>Zl,CloseIcon:()=>$e,Collapse:()=>Ts,CollapseContent:()=>di,CollapseHeader:()=>ui,CollapsePanel:()=>Ds,Collapsible:()=>zs,Confirm:()=>Dl,ConfirmBody:()=>Il,ConfirmClose:()=>Ll,ConfirmContainer:()=>Pl,ConfirmFooter:()=>El,ConfirmHeader:()=>zl,CropIcon:()=>ca,DEFAULT_TOAST_DURATION:()=>Rt,DOCUMENT_EXTENSIONS:()=>Ga,DatePicker:()=>Si,DateRangeCalendar:()=>Ni,DateRangeDayGrid:()=>Nn,DateRangeHeader:()=>Ti,DateRangeMonthGrid:()=>Dn,DateRangePicker:()=>Di,DateRangeYearGrid:()=>Pn,DateTimePicker:()=>tl,DateTimeRangePicker:()=>ol,DayGrid:()=>wi,DoubleChevronLeftIcon:()=>tn,DoubleChevronRightIcon:()=>on,DownloadIcon:()=>Co,Dropdown:()=>Bs,DropdownGroup:()=>zc,DropdownHeader:()=>Dc,DropdownItem:()=>Rc,DropdownMenu:()=>Hs,DropdownSeparator:()=>Pc,DropdownTrigger:()=>Sc,Empty:()=>Mi,EmptyDefaultIcon:()=>ds,EmptyErrorIcon:()=>ps,EmptyFolderIcon:()=>gs,EmptyIllustration:()=>Mn,EmptySearchIcon:()=>fs,EmptySimpleIcon:()=>ms,EyeIcon:()=>Un,FileContainer:()=>Ko,FilePreview:()=>Fi,FlipHorizontalIcon:()=>gn,IMAGE_EXTENSIONS:()=>Ba,IconButton:()=>Za,ImageIcon:()=>sa,ImagePreview:()=>Li,ImagePreviewToolbar:()=>$i,InfoCircleIcon:()=>ot,Input:()=>Ct,LoadingImage:()=>Xo,MinusIcon:()=>Zi,Modal:()=>Go,ModalBody:()=>jo,ModalClose:()=>Sl,ModalContainer:()=>Yo,ModalFooter:()=>Cl,ModalHeader:()=>Uo,MonthGrid:()=>Ci,MultiInput:()=>os,NumberInput:()=>rs,OtpInput:()=>ts,PDF_EXTENSIONS:()=>Va,PasswordInput:()=>es,PlusIcon:()=>Jo,Popover:()=>Os,PopoverBody:()=>Bc,PopoverClose:()=>Ac,PopoverContent:()=>Lc,PopoverFooter:()=>Vc,PopoverHeader:()=>Fc,PopoverTrigger:()=>$c,Radio:()=>ss,RadioDotIcon:()=>Ji,RadioGroup:()=>ls,RadioGroupContext:()=>qn,ResetIcon:()=>aa,RotateCcwIcon:()=>pn,RotateCwIcon:()=>fn,SearchIcon:()=>Zu,Select:()=>gu,SelectComponent:()=>ll,SelectMenu:()=>$a,SelectMenuFilter:()=>Ea,SelectOption:()=>Ma,SelectTrigger:()=>Ia,Skeleton:()=>Hi,Slider:()=>Cs,SliderMarks:()=>fa,SliderStepDots:()=>pa,SliderThumb:()=>ai,Spinner:()=>Ce,Tab:()=>Ro,TabList:()=>To,TabPanel:()=>Es,TabPanels:()=>Ms,Tabs:()=>So,TabsContext:()=>fi,TextArea:()=>ns,TimeColumn:()=>lo,TimePicker:()=>el,TimeRangePicker:()=>rl,TimeView:()=>it,Toaster:()=>bs,Toggle:()=>us,Tooltip:()=>ii,TrashIcon:()=>bn,UploadAvatar:()=>Rl,UploadAvatarCropContent:()=>Tl,UploadAvatarCropModal:()=>Ua,UploadIcon:()=>Tt,UploadImage:()=>xl,UploadImageDropzone:()=>Vi,UploadImageList:()=>_o,VIDEO_EXTENSIONS:()=>Ha,YearGrid:()=>ki,ZoomInIcon:()=>un,ZoomOutIcon:()=>dn,checkIsDisabled:()=>Bo,clamp:()=>ys,combineDateTime:()=>at,createDateWithTime:()=>Fo,createFileItem:()=>Fa,downloadFile:()=>Ln,formatBytes:()=>dl,formatDate:()=>_r,formatDateTime:()=>Jr,formatNumberString:()=>_t,formatTime:()=>Ur,generateCalendarGrid:()=>ya,generateRangeCalendarGrid:()=>Ri,getDefaultDateTimeFormat:()=>co,getDefaultFormat:()=>so,getFileExtension:()=>pl,getFileName:()=>po,getFileType:()=>$n,getISOWeekNumber:()=>vi,getPercentage:()=>si,isDateAfter:()=>xi,isDateBefore:()=>hi,isSameDay:()=>io,isSameMonth:()=>va,isSameTime:()=>Kc,isTimeAfter:()=>_c,isTimeBefore:()=>Xc,isTimeInRange:()=>tu,isValidOtpChar:()=>ji,normalizePreviewFile:()=>Ho,padZero:()=>ht,parseDate:()=>js,parseDateTime:()=>Pi,parseNumber:()=>Ui,parseRawNumberString:()=>Vl,parseTimeToDate:()=>qr,resolveLocale:()=>yr,revokeFileItem:()=>hu,sanitizeOtpString:()=>Wi,splitTagsFromText:()=>Ki,toDate:()=>Ir,toDateTime:()=>st,toTimeObject:()=>Wc,toast:()=>Ql,useCarousel:()=>ma,useCarouselContext:()=>pt,useCheckboxGroupContext:()=>_i,useCollapseContext:()=>ro,useCollapsePanelContext:()=>wn,useConfirmContext:()=>ut,useDebounce:()=>r0,useDebouncedCallback:()=>al,useDropdownContext:()=>Nt,useFileContext:()=>Ya,useModalContext:()=>lt,usePopoverContext:()=>Or,useRadioGroupContext:()=>qi,useTabsContext:()=>oo,validateFile:()=>La});module.exports=N0(lf);var Wa={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"}},Ka={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Xa={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]}var Yi=require("react/jsx-runtime");function Ce({width:e=16,height:r=16,className:t="",...o}){return(0,Yi.jsxs)("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:[(0,Yi.jsx)("path",{d:"M0 0h25v24H0z",fill:"none"}),(0,Yi.jsx)("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"})]})}var Hn=require("react/jsx-runtime");function wt({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,Wa,"md"),S=r==="other"?"":w(t,w(r,Xa,"filled"),"primary"),T=w(o,Ka,"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=>(0,Hn.jsx)("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(0,Hn.jsxs)("button",{ref:h,type:x,disabled:m||s,"aria-busy":s,"aria-disabled":m||s,className:k,...p,children:[s&&i&&g((0,Hn.jsx)(Ce,{})),(!s||!i)&&n&&g(n),d&&(0,Hn.jsx)("span",{className:"leading-none",children:d}),!s&&a&&g(a)]})}var _a=require("react/jsx-runtime");function Za({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,Wa,"md"),f=t==="other"?"":w(o,w(t,Xa,"filled"),"primary"),h=w(n,Ka,"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=>(0,_a.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${c.icon}`,"aria-hidden":"true",children:S});return(0,_a.jsx)("button",{ref:m,type:l,disabled:i||a,"aria-busy":a,"aria-disabled":i||a,className:p,...x,children:y(a&&s?(0,_a.jsx)(Ce,{}):e)})}var Du={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"}},Pu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},zu={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"},Iu={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"}};var Fl=require("react/jsx-runtime");function $e({width:e=14,height:r=14,className:t="",...o}){return(0,Fl.jsx)("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:(0,Fl.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}var bo=require("react/jsx-runtime");function Bt({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,Du,"md"),y=r==="other"?"":w(t,w(r,Iu,"soft"),"primary"),S=w(t,zu,"primary"),T=w(o,Pu,"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=>(0,bo.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:d});return(0,bo.jsxs)("span",{ref:f,role:c?"button":void 0,tabIndex:c?0:void 0,className:k,onClick:c,...h,children:[n&&(0,bo.jsx)("span",{className:`relative inline-block shrink-0 rounded-full ${a?"animate-pulse":""} ${p.dot} ${S}`,"aria-hidden":"true"}),s&&g(s),x&&(0,bo.jsx)("span",{className:"leading-none",children:x}),i&&!l&&g(i),l&&(0,bo.jsx)("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:(0,bo.jsx)($e,{className:"size-full"})})]})}var On=require("react"),Fu=require("@floating-ui/react");var qa={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"}},An={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Mu={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Eu={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"}},Gn={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"}},Ja={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"},$u={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"}};var Yn=require("react");function Lu(e,r={}){let{exitDuration:t=250}=r,[o,n]=(0,Yn.useState)(e),[a,s]=(0,Yn.useState)(!1),[i,l]=(0,Yn.useState)(e);return e!==i&&(l(e),e?(n(e),s(!1)):s(!0)),(0,Yn.useEffect)(()=>{if(!a)return;let b=setTimeout(()=>{n(void 0),s(!1)},t);return()=>clearTimeout(b)},[t,a]),{displayedError:o,isExiting:a}}var Qa=require("react/jsx-runtime");function Le({id:e,helperText:r,errorMessage:t,sizeClassName:o="text-xs",className:n=""}){let{displayedError:a,isExiting:s}=Lu(t),i=a||r,l=!!(a||r),b=!!a;return(0,Qa.jsx)("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:(0,Qa.jsx)("div",{className:"overflow-hidden",children:(0,Qa.jsx)("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"})})})}var hr=require("react/jsx-runtime");function Ct({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=(0,On.useId)(),M=T||U,P=`${M}-error-helper`,$=(0,On.useRef)(null),K=(0,Fu.useMergeRefs)([$,D]),X=k!==void 0,[B,oe]=(0,On.useState)(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,qa,"md"),Z=w(o,An,"md"),F=r==="other"?"":w(W,w(r,Gn,"outline"),"primary"),j=ye=>(0,hr.jsx)("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,Ja,"primary");return re?(0,hr.jsxs)("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&&(0,hr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,hr.jsxs)("label",{htmlFor:M,className:`inline-flex items-center font-bold transition-colors duration-150 ${se.label} ${ye} ${y}`,children:[n,Y&&(0,hr.jsx)("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(0,hr.jsxs)("div",{className:`group/field flex ${a==="left"?"flex-row items-center gap-3":"flex-col"} ${G?"w-full":"inline-flex"} ${h}`,children:[!re&&Se(),(0,hr.jsxs)("div",{className:`flex flex-col ${G?"w-full":""}`,children:[(0,hr.jsxs)("div",{className:"flex items-stretch",children:[m&&(0,hr.jsx)("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}),(0,hr.jsxs)("div",{className:`${ie} ${m?"rounded-l-none!":""} ${c?"rounded-r-none!":""}`,children:[re&&Se(),b&&(0,hr.jsx)("div",{className:"flex items-center justify-center pl-3 shrink-0",children:j(b)}),(0,hr.jsx)("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&&(0,hr.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:j((0,hr.jsx)(Ce,{}))}),!z&&O&&!u&&!v&&(0,hr.jsx)("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:(0,hr.jsx)($e,{className:"size-full"})}),!z&&x&&(0,hr.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:j(x)})]}),c&&(0,hr.jsx)("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})]}),(0,hr.jsx)(Le,{id:P,helperText:i,errorMessage:l,sizeClassName:se.helper,className:S})]})]})}var Vu=require("react");var Vt=require("react/jsx-runtime");function Bl({width:e=16,height:r=16,className:t="",...o}){return(0,Vt.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,Vt.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,Vt.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function Bu({width:e=16,height:r=16,className:t="",...o}){return(0,Vt.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,Vt.jsx)("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),(0,Vt.jsx)("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"}),(0,Vt.jsx)("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"}),(0,Vt.jsx)("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Un=Bl;var Oi=require("react/jsx-runtime");function es({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]=(0,Vu.useState)(e);return(0,Oi.jsx)(Ct,{type:i?"text":"password",disabled:n,readOnly:a,rightIcon:o||(0,Oi.jsx)("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?(0,Oi.jsx)(Bu,{className:"size-full"}):(0,Oi.jsx)(Bl,{className:"size-full"})}),...s})}var Hu=require("react");function _t(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 _t(s,{...r,max:void 0,min:void 0});if(a!==void 0&&!isNaN(d)&&d<a&&(i||m&&a<0))return _t(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 Vl(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 Hl(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 ji(e,r="numeric"){return r==="numeric"?/^\d$/.test(e):r==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Wi(e,r="numeric"){return r==="numeric"?e.replace(/\D/g,""):r==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function Ki(e,r=/[\r\n,;\t]+/,t=!0){return e?e.split(r).map(o=>t?o.trim():o).filter(Boolean):[]}var Au=require("react/jsx-runtime");function rs({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]=(0,Hu.useState)(r),S=h?e:p,T=_t(S,f),k=()=>{h||y(""),b?.()},g=u=>{let v=u.target,C=v.value,R=v.selectionStart||0,N=_t(C,f),D=Hl(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=_t(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(0,Au.jsx)(Ct,{ref:x,type:"text",inputMode:s>0?"decimal":"numeric",value:T,onChange:g,onBlur:d,onClear:k,...c})}var Ht=require("react");var Wr=require("react/jsx-runtime");function ts({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=(0,Ht.useId)(),P=t||M,$=`${P}-slot-0`,K=`${P}-error-helper`,[X,B]=(0,Ht.useState)(()=>{let J=(a!==void 0?a:s).split("");return Array.from({length:n},(E,I)=>J[I]||"")}),oe=(0,Ht.useRef)([]),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;(0,Ht.useEffect)(()=>{if(p&&!y&&!S){let J=ee.findIndex(I=>!I),E=J!==-1?J:0;oe.current[E]?.focus()}},[p,ee,y,S]),(0,Ht.useImperativeHandle)(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=Wi(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(ji(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,$u,"md"),re=w(x,qa,"md"),Se=w(h,An,"md"),ie=c==="other"?"":w(le,w(c,Gn,"outline"),"primary"),de=y?"opacity-50":"",Te=()=>v?(0,Wr.jsxs)("label",{htmlFor:$,className:`block font-medium text-neutral-700 select-none ${j.label} ${L}`,children:[v,A&&(0,Wr.jsx)("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return(0,Wr.jsxs)("div",{className:`group/otp flex ${C==="left"?"flex-row items-start gap-3":"flex-col"} ${Y}`,children:[Te(),(0,Wr.jsxs)("div",{className:"flex flex-col",children:[(0,Wr.jsxs)("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(0,Wr.jsxs)("div",{className:"inline-flex items-center gap-1.5",children:[(0,Wr.jsx)("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&&(0,Wr.jsx)("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&&(0,Wr.jsx)("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:(0,Wr.jsx)(Ce,{className:`animate-spin ${re.icon}`})})]}),(0,Wr.jsx)(Le,{id:K,helperText:R,errorMessage:N,sizeClassName:j.helper,className:z}),o&&(0,Wr.jsx)("input",{type:"hidden",name:o,value:ee.join(""),disabled:y||G})]})]})}var ho=require("react"),Gu=require("@floating-ui/react");var Xi=require("react/jsx-runtime");function Jo({width:e=14,height:r=14,className:t="",...o}){return(0,Xi.jsxs)("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:[(0,Xi.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Xi.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var Me=require("react/jsx-runtime");function os({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=(0,ho.useId)(),E=T||J,I=`${E}-error-helper`,fe=n?`${E}-label`:void 0,Q=(0,ho.useRef)(null),xe=(0,Gu.useMergeRefs)([Q,j]),ge=g!==void 0,[be,ce]=(0,ho.useState)(d),pe=ge?g||[]:be,De=v!==void 0,[ue,Pe]=(0,ho.useState)(""),he=De?v||"":ue,[Ae,Ee]=(0,ho.useState)(""),ze=H=>{De||Pe(H),C?.(H)},Ie=H=>{ge||ce(H),u?.(H)},Ve=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),Ee(`Maximum limit of ${G} tags reached`),!1;if(!A&&pe.includes(ae))return O?.(ae),Ee(`Tag "${ae}" already exists`),!1;if(P){let Ge=P(ae);if(Ge===!1||typeof Ge=="string")return $?.(ae,typeof Ge=="string"?Ge:void 0),Ee(`Tag "${ae}" is invalid`),!1}let Ne=[...pe,ae];return Ie(Ne),ze(""),Ee(`Added tag "${ae}"`),!0},We=H=>{if(_||W||ie)return;let ae=[...pe],Ne=new Set(pe),Ge=0;for(let Ke of H){let Ze=z?Ke.trim():Ke;if(Ze){if(M&&M>0&&Ze.length>M&&(Ze=Ze.slice(0,M)),G!==void 0&&ae.length>=G){U?.(Ze);break}if(!A&&Ne.has(Ze)){O?.(Ze);continue}if(P){let mo=P(Ze);if(mo===!1||typeof mo=="string"){$?.(Ze,typeof mo=="string"?mo:void 0);continue}}ae.push(Ze),Ne.add(Ze),Ge++}}Ie(ae),ze(""),Ge>0&&Ee(`Added ${Ge} tags`)},ar=H=>{if(_||W||ie)return;let ae=pe[H],Ne=pe.filter((Ge,Ke)=>Ke!==H);Ie(Ne),ae&&Ee(`Removed tag "${ae}"`)},er=H=>{H?.stopPropagation(),!(_||W||ie)&&(Ie([]),ze(""),Ee("Removed all tags"),f?.(),Q.current?.focus())},Cr=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(),Ve(he)):H.key==="Backspace"&&he===""&&pe.length>0&&(H.preventDefault(),ar(pe.length-1))},br=H=>{if(!(_||W||ie)&&Y){let ae=H.clipboardData.getData("text");if(ae){let Ne=Ki(ae,L,z);(Ne.length>1||L.test(ae))&&(H.preventDefault(),We(Ne))}}},sr=()=>{V&&he.trim()&&Ve(he)},te=pe.length>0||he.length>0,Ue=!!(Se||l),rr=Ue?"error":t,me=w(e,Eu,"md"),Je=w(o,An,"md"),Sr=q||w(o,Mu,"md"),Tr=ee||me.badgeSize||"sm",$r=oe||t,ve=B||r,et=r==="other"?"":w(rr,w(r,Gn,"outline"),"primary"),ke=a==="floating",we=H=>(0,Me.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${me.icon}`,"aria-hidden":"true",children:H}),Dr=()=>{if(!n)return null;let H=Ue?"text-error-600 font-bold":w(rr,Ja,"primary");return ke?(0,Me.jsxs)("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&&(0,Me.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,Me.jsxs)("label",{id:fe,htmlFor:E,className:`inline-flex items-center font-bold transition-colors duration-150 ${me.label} ${H} ${y}`,children:[n,re&&(0,Me.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Pr=K&&K>0?pe.slice(0,K):pe,Hr=K&&K>0?Math.max(0,pe.length-K):0,qo=_?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",go=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",me.wrapper,Je,et,qo,ye?"w-full":"w-auto min-w-[200px]",p].filter(Boolean).join(" "),Be=a==="left",Ar=G===void 0||pe.length<G,Lt=N&&!_&&!W;return(0,Me.jsxs)("div",{role:"group","aria-labelledby":fe,className:`group/field flex ${Be?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${h}`,children:[(0,Me.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Ae}),!ke&&Dr(),(0,Me.jsxs)("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[(0,Me.jsxs)("div",{className:"flex items-stretch",children:[m&&(0,Me.jsx)("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 ${Je?`${Je} rounded-r-none`:""}`,children:m}),(0,Me.jsxs)("div",{className:`${go} ${m?"rounded-l-none!":""} ${c?"rounded-r-none!":""}`,children:[ke&&Dr(),b&&(0,Me.jsx)("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:we(b)}),(0,Me.jsxs)("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${me.gap}`,children:[(()=>{let H=new Map;return Pr.map((ae,Ne)=>{let Ge=(H.get(ae)??0)+1;H.set(ae,Ge);let Ke=`${ae}_${Ge}`;return X?(0,Me.jsx)("span",{className:"inline-flex shrink-0",children:X({value:ae,index:Ne,onRemove:()=>ar(Ne),disabled:_,readOnly:W})},Ke):(0,Me.jsx)("span",{className:"inline-flex shrink-0",children:(0,Me.jsx)(Bt,{size:Tr,variant:ve,color:$r,radius:Sr,deleteAriaLabel:`Remove tag ${ae}`,onDelete:!_&&!W?()=>ar(Ne):void 0,className:`shrink-0 max-w-full truncate select-none ${ne}`,children:ae})},Ke)})})(),Hr>0&&(0,Me.jsx)("span",{className:"inline-flex shrink-0",children:(0,Me.jsxs)(Bt,{size:Tr,variant:"filled",color:"neutral",radius:Sr,className:"shrink-0 font-medium select-none",children:["+",Hr]})}),Ar?(0,Me.jsx)("input",{ref:xe,id:E,type:"text",value:he,onChange:H=>ze(H.target.value),onKeyDown:Cr,onPaste:br,onBlur:sr,disabled:_||ie,readOnly:W,autoFocus:F,"aria-invalid":Ue,"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]}),Lt&&(0,Me.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:D?D({onAdd:()=>Ve(he),disabled:!he.trim()||!Ar}):(0,Me.jsx)("button",{type:"button",onClick:H=>{H.stopPropagation(),he.trim()&&Ar?Ve(he):Q.current?.focus()},disabled:!he.trim()||!Ar,"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:(0,Me.jsx)(Jo,{className:me.icon})})}),ie&&de&&(0,Me.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:we((0,Me.jsx)(Ce,{}))}),!ie&&Te&&!_&&!W&&(0,Me.jsx)("button",{type:"button",onClick:er,"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:(0,Me.jsx)($e,{className:"size-full"})}),!ie&&x&&(0,Me.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:we(x)})]}),c&&(0,Me.jsx)("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 ${Je?`${Je} rounded-l-none`:""}`,children:c})]}),(0,Me.jsx)(Le,{id:I,helperText:i,errorMessage:l,sizeClassName:me.helper,className:S}),k&&(()=>{let H=new Map;return(0,Me.jsxs)(Me.Fragment,{children:[pe.map(ae=>{let Ne=(H.get(ae)??0)+1;H.set(ae,Ne);let Ge=`${ae}_${Ne}`;return(0,Me.jsx)("input",{type:"hidden",name:`${k}[]`,value:ae,disabled:_||ie},`hidden_${Ge}`)}),pe.length===0&&(0,Me.jsx)("input",{type:"hidden",name:k,value:"",disabled:_||ie})]})})()]})]})}var jn=require("react"),Ku=Ft(require("react-textarea-autosize"),1),Xu=require("@floating-ui/react");var Yu={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"}},Ou={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Uu={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},ju={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"}},Wu={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"};var zr=require("react/jsx-runtime");function ns({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=(0,jn.useId)(),B=g||X,oe=`${B}-error-helper`,q=(0,jn.useRef)(null),[ee,ne]=(0,jn.useState)(u),le=(0,Xu.useMergeRefs)([q,Y]),_=d!==void 0,W=_?d:ee,se=!!(O||l),Z=se?"error":t,F=w(e,Yu,"md"),j=w(o,Ou,"md"),re=K?"resize-none":w(h,Uu,"none"),Se=r==="other"?"":w(Z,w(r,ju,"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,Wu,"primary");return J?(0,zr.jsxs)("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&&(0,zr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,zr.jsxs)("label",{htmlFor:B,className:`inline-flex items-center font-bold transition-colors duration-150 ${F.label} ${be} ${S}`,children:[n,A&&(0,zr.jsx)("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(0,zr.jsxs)("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(),(0,zr.jsxs)("div",{className:`flex flex-col ${$?"w-full":""}`,children:[(0,zr.jsxs)("div",{className:I,children:[J&&E(),K?(0,zr.jsx)(Ku.default,{ref:le,minRows:m,maxRows:x,onHeightChange:c,cacheMeasurements:f,...ge}):(0,zr.jsx)("textarea",{ref:le,rows:m,...ge}),G&&U&&(0,zr.jsx)("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:(0,zr.jsx)(Ce,{className:"size-full animate-spin"})}),!G&&M&&!C&&!R&&(0,zr.jsx)("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:(0,zr.jsx)($e,{className:"size-full"})}),P&&(0,zr.jsxs)("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}`]})]}),(0,zr.jsx)(Le,{id:oe,helperText:i,errorMessage:l,sizeClassName:F.helper,className:T})]})]})}var At=require("react");var Qo={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"}},Al={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Wn={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"}};var is=require("react"),Kn=(0,is.createContext)(void 0),_i=()=>(0,is.useContext)(Kn);var Gl=require("react/jsx-runtime");function Zt({width:e=14,height:r=14,className:t="",...o}){return(0,Gl.jsx)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:(0,Gl.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var Yl=require("react/jsx-runtime");function Zi({width:e=14,height:r=14,className:t="",...o}){return(0,Yl.jsx)("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:(0,Yl.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}var Gr=require("react/jsx-runtime");function Xn({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=_i(),A=(0,At.useId)(),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]=(0,At.useState)(d??!1),se=ne?z.value.includes(String(R)):le?g:_,Z=(0,At.useRef)(null);(0,At.useImperativeHandle)(V,()=>Z.current),(0,At.useEffect)(()=>{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=Qo[U]||Qo.md,re=$?Al[$]:j.rounded,Se=se||n,ie;M==="other"?ie="":Se?ie=Wn[M]?.[P]||Wn.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?Wn[M==="other"?"filled":M]?.error||Wn.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?(0,Gr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:(0,Gr.jsx)(Ce,{className:"size-full animate-spin"})}):n?(0,Gr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:h||(0,Gr.jsx)(Zi,{className:"size-full"})}):se?(0,Gr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${j.icon}`,"aria-hidden":"true",children:f||(0,Gr.jsx)(Zt,{className:"size-full"})}):null,E=!!L;return(0,Gr.jsxs)("div",{className:"inline-flex flex-col",children:[(0,Gr.jsxs)("label",{className:ye,onClick:fe=>{(K||X||B)&&fe.preventDefault()},children:[(0,Gr.jsx)("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}),(0,Gr.jsx)("span",{className:de,"aria-hidden":"true",children:J()}),E&&(0,Gr.jsxs)("span",{className:Te,children:[L,oe&&(0,Gr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,Gr.jsx)(Le,{id:G,helperText:m,errorMessage:x,sizeClassName:j.helper,className:T})]})}var vo=require("react");var xo=require("react/jsx-runtime");function _n({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=(0,vo.useId)(),R=`${C}-label`,N=`${C}-helper`,D=e!==void 0,[V,Y]=(0,vo.useState)(r),L=D?e:V,z=!!(m??!!h),A=(0,vo.useCallback)((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=(0,vo.useMemo)(()=>({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=Qo[o]||Qo.md;return(0,xo.jsxs)("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&&(0,xo.jsxs)("span",{id:R,className:U,children:[c,x&&(0,xo.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,xo.jsx)("div",{className:`${G} ${S}`,children:(0,xo.jsx)(Kn.Provider,{value:O,children:d})}),(0,xo.jsx)(Le,{id:N,helperText:f,errorMessage:h,sizeClassName:M.helper,className:g})]})}var yo=require("react");var en={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"}},Zn={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"}};var as=require("react"),qn=(0,as.createContext)(void 0),qi=()=>(0,as.useContext)(qn);var Ol=require("react/jsx-runtime");function Ji({className:e}){return(0,Ol.jsx)("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:(0,Ol.jsx)("circle",{cx:"5",cy:"5",r:"5"})})}var rt=require("react/jsx-runtime");function ss({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=qi(),D=(0,yo.useId)(),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]=(0,yo.useState)(S??!1),ee=X?N.value===String(d):B?y:oe,ne=(0,yo.useRef)(null);(0,yo.useImperativeHandle)(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))},_=en[L]||en.md,W="";z==="other"?W="":ee?W=Zn[z]?.[A]||Zn.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?Zn[z==="other"?"filled":z]?.error||Zn.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?(0,rt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${_.dot}`,"aria-hidden":"true",children:(0,rt.jsx)(Ce,{className:"size-full animate-spin"})}):ee?(0,rt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${_.dot}`,"aria-hidden":"true",children:m||(0,rt.jsx)(Ji,{className:"size-full"})}):null,re=!!s;return(0,rt.jsxs)("div",{className:"inline-flex flex-col",children:[(0,rt.jsxs)("label",{className:F,onClick:de=>{(O||G||U)&&de.preventDefault()},children:[(0,rt.jsx)("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}),(0,rt.jsx)("span",{className:se,"aria-hidden":"true",children:j()}),re&&(0,rt.jsxs)("span",{className:Z,children:[s,M&&(0,rt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,rt.jsx)(Le,{id:Y,helperText:i,errorMessage:l,sizeClassName:_.helper,className:h})]})}var qt=require("react");var wo=require("react/jsx-runtime");function ls({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=(0,qt.useId)(),C=`${v}-label`,R=`${v}-helper`,N=(0,qt.useId)(),D=e!==void 0,[V,Y]=(0,qt.useState)(r??null),L=D?e:V,z=!!(b??!!f),A=(0,qt.useCallback)(P=>{s||i||l||(D||Y(P),t?.(P))},[s,i,l,D,t]),O=(0,qt.useMemo)(()=>({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=en[o]||en.md;return(0,wo.jsxs)("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&&(0,wo.jsxs)("span",{id:C,className:U,children:[x,m&&(0,wo.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,wo.jsx)("div",{className:`${G} ${y}`,children:(0,wo.jsx)(qn.Provider,{value:O,children:g})}),(0,wo.jsx)(Le,{id:R,helperText:c,errorMessage:f,sizeClassName:M.helper,className:k})]})}var Jn=require("react"),_u=require("@floating-ui/react");var Ul={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"}},cs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},jl={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"}}}};var Yr=require("react/jsx-runtime");function us({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=(0,Jn.useId)(),U=N||G,M=`${U}-error-helper`,P=(0,Jn.useRef)(null),$=(0,_u.useMergeRefs)([P,V]),K=k!==void 0,[X,B]=(0,Jn.useState)(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,Ul,"md"),se=w(o,cs,"full"),Z=w(n,cs,"full"),F=r==="other"?void 0:w(_,w(r,jl,"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?(0,Yr.jsx)("span",{className:`inline-flex items-center justify-center ${W.icon}`,"aria-hidden":"true",children:(0,Yr.jsx)(Ce,{className:"size-full animate-spin"})}):typeof m=="function"?m({isChecked:oe,className:W.icon}):m?(0,Yr.jsx)("span",{className:`inline-flex items-center justify-center ${W.icon}`,"aria-hidden":"true",children:m}):null,E=()=>s?(0,Yr.jsxs)("span",{className:de,children:[s,L&&(0,Yr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return(0,Yr.jsxs)("div",{className:"inline-flex flex-col",children:[(0,Yr.jsxs)("label",{className:ye,onClick:ne,children:[(0,Yr.jsx)("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}),(0,Yr.jsxs)("span",{className:Se,"aria-hidden":"true",children:[x&&(0,Yr.jsx)("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}),(0,Yr.jsx)("span",{className:ie,children:J()}),c&&(0,Yr.jsx)("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()]}),(0,Yr.jsx)(Le,{id:M,helperText:i,errorMessage:l,sizeClassName:W.helper,className:S})]})}var Wl=require("react/jsx-runtime");function kr({width:e=16,height:r=16,className:t="",...o}){return(0,Wl.jsx)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:(0,Wl.jsx)("path",{d:"m6 9 6 6 6-6"})})}var Kl=require("react/jsx-runtime");function kt({width:e=16,height:r=16,className:t="",...o}){return(0,Kl.jsx)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:(0,Kl.jsx)("path",{d:"m15 18-6-6 6-6"})})}var Xl=require("react/jsx-runtime");function St({width:e=16,height:r=16,className:t="",...o}){return(0,Xl.jsx)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:(0,Xl.jsx)("path",{d:"m9 18 6-6-6-6"})})}var rn=require("react/jsx-runtime");function _l({width:e=16,height:r=16,className:t="",...o}){return(0,rn.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,rn.jsx)("path",{d:"M8 2v4"}),(0,rn.jsx)("path",{d:"M16 2v4"}),(0,rn.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,rn.jsx)("path",{d:"M3 10h18"})]})}var Qi=require("react/jsx-runtime");function Zl({width:e=16,height:r=16,className:t="",...o}){return(0,Qi.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,Qi.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Qi.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}var ea=require("react/jsx-runtime");function tn({width:e=16,height:r=16,className:t="",...o}){return(0,ea.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ea.jsx)("path",{d:"m11 17-5-5 5-5"}),(0,ea.jsx)("path",{d:"m18 17-5-5 5-5"})]})}var ra=require("react/jsx-runtime");function on({width:e=16,height:r=16,className:t="",...o}){return(0,ra.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ra.jsx)("path",{d:"m6 17 5-5-5-5"}),(0,ra.jsx)("path",{d:"m13 17 5-5-5-5"})]})}var Kr=require("react/jsx-runtime");function D0(e){return(0,Kr.jsxs)("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Kr.jsx)("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),(0,Kr.jsx)("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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"}),(0,Kr.jsx)("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 ds=D0;var tt=require("react/jsx-runtime");function P0(e){return(0,tt.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,tt.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,tt.jsx)("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"}),(0,tt.jsx)("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,tt.jsx)("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,tt.jsx)("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,tt.jsxs)("g",{transform:"translate(48, 38)",children:[(0,tt.jsx)("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),(0,tt.jsx)("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),(0,tt.jsx)("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),(0,tt.jsx)("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var fs=P0;var Gt=require("react/jsx-runtime");function z0(e){return(0,Gt.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Gt.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Gt.jsx)("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"}),(0,Gt.jsx)("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,Gt.jsx)("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Gt.jsx)("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),(0,Gt.jsx)("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),(0,Gt.jsx)("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var ps=z0;var Jt=require("react/jsx-runtime");function I0(e){return(0,Jt.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Jt.jsx)("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Jt.jsx)("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"}),(0,Jt.jsx)("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"}),(0,Jt.jsx)("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Jt.jsx)("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Jt.jsx)("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 gs=I0;var nn=require("react/jsx-runtime");function M0(e){return(0,nn.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,nn.jsx)("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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"}),(0,nn.jsx)("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 ms=M0;var Qn=require("react/jsx-runtime");function ot({width:e=20,height:r=20,className:t="",...o}){return(0,Qn.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,Qn.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Qn.jsx)("path",{d:"M12 16v-4"}),(0,Qn.jsx)("path",{d:"M12 8h.01"})]})}var ta=require("react/jsx-runtime");function an({width:e=20,height:r=20,className:t="",...o}){return(0,ta.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ta.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ta.jsx)("path",{d:"m9 12 2 2 4-4"})]})}var ei=require("react/jsx-runtime");function sn({width:e=20,height:r=20,className:t="",...o}){return(0,ei.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ei.jsx)("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"}),(0,ei.jsx)("path",{d:"M12 9v4"}),(0,ei.jsx)("path",{d:"M12 17h.01"})]})}var ri=require("react/jsx-runtime");function ln({width:e=20,height:r=20,className:t="",...o}){return(0,ri.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ri.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ri.jsx)("path",{d:"M12 8v4"}),(0,ri.jsx)("path",{d:"M12 16h.01"})]})}var cn=require("react/jsx-runtime");function un({width:e=20,height:r=20,className:t="",...o}){return(0,cn.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,cn.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,cn.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,cn.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),(0,cn.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var ti=require("react/jsx-runtime");function dn({width:e=20,height:r=20,className:t="",...o}){return(0,ti.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ti.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,ti.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,ti.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var oa=require("react/jsx-runtime");function fn({width:e=20,height:r=20,className:t="",...o}){return(0,oa.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,oa.jsx)("path",{d:"M21 2v6h-6"}),(0,oa.jsx)("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}var na=require("react/jsx-runtime");function pn({width:e=20,height:r=20,className:t="",...o}){return(0,na.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,na.jsx)("path",{d:"M3 2v6h6"}),(0,na.jsx)("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}var Qt=require("react/jsx-runtime");function gn({width:e=20,height:r=20,className:t="",...o}){return(0,Qt.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,Qt.jsx)("path",{d:"m3 7 5 5-5 5V7z"}),(0,Qt.jsx)("path",{d:"m21 7-5 5 5 5V7z"}),(0,Qt.jsx)("path",{d:"M12 20v2"}),(0,Qt.jsx)("path",{d:"M12 14v2"}),(0,Qt.jsx)("path",{d:"M12 8v2"}),(0,Qt.jsx)("path",{d:"M12 2v2"})]})}var oi=require("react/jsx-runtime");function Co({width:e=20,height:r=20,className:t="",...o}){return(0,oi.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,oi.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,oi.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,oi.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}var ia=require("react/jsx-runtime");function aa({width:e=20,height:r=20,className:t="",...o}){return(0,ia.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ia.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,ia.jsx)("path",{d:"M3 3v5h5"})]})}var ni=require("react/jsx-runtime");function sa({width:e=20,height:r=20,className:t="",...o}){return(0,ni.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ni.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,ni.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,ni.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}var la=require("react/jsx-runtime");function ca({width:e=16,height:r=16,className:t="",...o}){return(0,la.jsxs)("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:[(0,la.jsx)("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),(0,la.jsx)("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}var ua=require("react/jsx-runtime");function E0({width:e=16,height:r=16,className:t="",...o}){return(0,ua.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,ua.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,ua.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var Zu=E0;var mn=require("react/jsx-runtime");function bn({width:e=16,height:r=16,className:t="",...o}){return(0,mn.jsxs)("svg",{width:e,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,...o,children:[(0,mn.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,mn.jsx)("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"}),(0,mn.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,mn.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var ql=require("react/jsx-runtime");function Tt({width:e=24,height:r=24,className:t="",...o}){return(0,ql.jsx)("svg",{width:e,height:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:t,...o,children:(0,ql.jsx)("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 qu={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"}},Ju={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Qu={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"}},ed={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"}},rd={primary:ot,secondary:ot,neutral:ot,info:ot,success:an,warning:sn,error:ln};var ft=require("react/jsx-runtime");function hn({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,qu,"md"),v=x?"rounded-none border-x-0 w-full":w(o,Ju,"lg"),C=r==="other"?"":w(t,w(r,Qu,"soft"),"info"),R=r==="other"?"":w(t,w(r,ed,"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(0,ft.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${u.icon} ${p}`,"aria-hidden":"true",children:s});let U=w(t,rd,"info");return(0,ft.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${u.icon} ${R} ${p}`,"aria-hidden":"true",children:(0,ft.jsx)(U,{className:"size-full"})})},G=["relative flex w-full",u.container,v,C,S].filter(Boolean).join(" ");return(0,ft.jsxs)("div",{ref:g,role:Y,"aria-live":L,className:G,...d,children:[O(),(0,ft.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[n&&(0,ft.jsx)("div",{className:`${u.title} ${c}`,children:n}),A&&(0,ft.jsx)("div",{className:`${u.description} ${n?"mt-0.5":""} ${f}`,children:z})]}),i&&(0,ft.jsx)("div",{className:`inline-flex items-center shrink-0 ${u.action} ${h}`,children:i}),N&&(0,ft.jsx)("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:(0,ft.jsx)($e,{className:u.closeIcon})})]})}var td=require("sonner");var Rt=4e3;var od=require("react/jsx-runtime");function bs({position:e="top-right",visibleToasts:r=3,expand:t=!1,duration:o=4e3,closeButton:n=!1,className:a="",toastOptions:s,...i}){return(0,od.jsx)(td.Toaster,{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})}var nd=require("react"),xn=require("sonner");var hs=require("react/jsx-runtime");function ko(e,r="info",t="soft",o,n={},a){let{duration:s,position:i,onDismiss:l,onAutoClose:b,...m}=n;return xn.toast.custom(x=>(0,hs.jsx)(hn,{color:r,variant:t,title:e,description:o,closable:m.closable??!0,onClose:()=>{m.onClose?.(),xn.toast.dismiss(x)},...m}),{id:a,duration:s??4e3,position:i,onDismiss:l,onAutoClose:b})}function $0(e){return typeof e=="object"&&e!==null&&!(0,nd.isValidElement)(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function Jl(e,r,t){return $0(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 Yt=((e,r,t)=>{let o=t||{};return ko(e,o.color||"info",o.variant||"soft",r,o)});Yt.custom=(e,r={})=>{if(typeof e=="function")return xn.toast.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 xn.toast.custom(i=>(0,hs.jsx)(hn,{closable:s.closable??!0,onClose:()=>{s.onClose?.(),xn.toast.dismiss(i)},...s}),{duration:t??4e3,position:o,onDismiss:n,onAutoClose:a})};Yt.success=(e,r,t)=>{let o=t||{};return ko(e,o.color||"success",o.variant||"soft",r,o)};Yt.error=(e,r,t)=>{let o=t||{};return ko(e,o.color||"error",o.variant||"soft",r,o)};Yt.warning=(e,r,t)=>{let o=t||{};return ko(e,o.color||"warning",o.variant||"soft",r,o)};Yt.info=(e,r,t)=>{let o=t||{};return ko(e,o.color||"info",o.variant||"soft",r,o)};Yt.loading=(e,r,t)=>{let o=t||{};return ko(e,o.color||"info",o.variant||"soft",r,{...o,icon:o.icon??(0,hs.jsx)(Ce,{className:"size-full animate-spin"}),duration:o.duration??1/0,closable:o.closable??!1})};Yt.promise=async(e,r)=>{let t=typeof e=="function"?e():e,{title:o,description:n}=Jl(r.loading,"info",r.variant||"soft"),a=Yt.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}=Jl(i,"success",r.variant||"soft");return ko(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}=Jl(i,"error",r.variant||"soft");throw ko(l,m,x,b,{duration:r.duration??4e3,size:r.size,radius:r.radius},a),s}finally{r.finally&&await r.finally()}};Yt.dismiss=e=>xn.toast.dismiss(e);var Ql=Yt;var eo=require("react"),Ye=require("@floating-ui/react");var id={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}},ad={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},sd={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"}},ld={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 xr={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60};var Ot=require("react/jsx-runtime");function L0({children:e,ref:r,disabled:t,className:o="",...n}){let a=(0,eo.isValidElement)(e)?e.props?.ref:void 0,s=(0,Ye.useMergeRefs)([r,a]);if(!(0,eo.isValidElement)(e))return null;let i=e.props||{};return(0,eo.cloneElement)(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function ii({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=xr.TOOLTIP}){let[d,u]=(0,eo.useState)(y),[v,C]=(0,eo.useState)(null),R=p!==void 0,N=R?p:d,D=W=>{R||u(W),S?.(W)},V=[(0,Ye.offset)(l),b?(0,Ye.flip)():void 0,m?(0,Ye.shift)({padding:8}):void 0,i?(0,Ye.arrow)({element:v}):void 0].filter(Boolean),{refs:{setReference:Y,setFloating:L},floatingStyles:z,context:A,placement:O}=(0,Ye.useFloating)({placement:t,open:N&&!c,onOpenChange:D,whileElementsMounted:Ye.autoUpdate,transform:!1,middleware:V}),G=(0,Ye.useHover)(A,{move:!1,delay:x,enabled:!c}),U=(0,Ye.useFocus)(A,{enabled:!c}),M=(0,Ye.useDismiss)(A),P=(0,Ye.useRole)(A,{role:"tooltip"}),{getReferenceProps:$,getFloatingProps:K}=(0,Ye.useInteractions)([G,U,M,P]),{isMounted:X,styles:B}=(0,Ye.useTransitionStyles)(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,id,"md"),q=w(s,ad,"md"),ee=o==="other"?"":w(n,w(o,sd,"filled"),"neutral"),ne=o==="other"?"":w(n,w(o,ld,"filled"),"neutral"),le=["select-none pointer-events-none max-w-xs break-words",oe.box,q,ee,T].filter(Boolean).join(" "),_=$();return(0,Ot.jsxs)(Ot.Fragment,{children:[(0,eo.isValidElement)(r)?(0,Ot.jsx)(L0,{ref:Y,disabled:c,..._,children:r}):(0,Ot.jsx)("span",{ref:Y,..._,children:r}),(0,Ot.jsx)(Ye.FloatingPortal,{children:X&&!c&&e&&(0,Ot.jsxs)("div",{ref:L,style:{...z,...f?B:{},zIndex:g},className:le,"data-state":N?"open":"closed","data-placement":O,...K(),children:[e,i&&(0,Ot.jsx)(Ye.FloatingArrow,{ref:C,context:A,width:oe.arrowWidth,height:oe.arrowHeight,strokeWidth:o==="outline"||o==="soft"?1:0,className:[ne,k].filter(Boolean).join(" ")})]})})]})}var ws=require("react"),li=Ft(require("@radix-ui/react-slider"),1);var vn={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"}},ec={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},cd={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:""}}};var vs=require("react"),ud=Ft(require("@radix-ui/react-slider"),1);var da=require("react/jsx-runtime");function ai({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,vn,"md"),[C,R]=(0,vs.useState)(!1),[N,D]=(0,vs.useState)(!1),[V,Y]=(0,vs.useState)(!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=(0,da.jsx)(ud.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&&(0,da.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:(0,da.jsx)(Ce,{className:"size-full animate-spin text-current"})})});return c!=="none"?(0,da.jsx)(ii,{content:A,placement:z,open:L,size:v.tooltipSize,className:l,disabled:S||p,children:G}):G}function ys(e,r,t){return Math.min(Math.max(e,r),t)}function si(e,r,t){return t<=r?0:ys((e-r)/(t-r)*100,0,100)}var yn=require("react/jsx-runtime");function fa({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,vn,"md");return(0,yn.jsx)("div",{className:`relative w-full ${n==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:i.map(b=>{let m=si(b.value,r,t);return(0,yn.jsx)("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 pa({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,vn,"md"),m=[];for(let x=0;x<=l;x++){let c=r+x*o,f=si(c,r,t),h=s?c>=(i[0]??r)&&c<=(i[1]??t):c<=(i[0]??r);m.push((0,yn.jsx)("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(0,yn.jsx)(yn.Fragment,{children:m})}var qe=require("react/jsx-runtime");function Cs({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=(0,ws.useId)(),F=V||Z,j=`${F}-helper`,re=!!(ee||N),Se=re?"error":m,ie=Array.isArray(r??t),de=r!==void 0,[Te,ye]=(0,ws.useState)(()=>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 Ae=ie?[he[0]??o,he[1]??n]:he[0]??o;Y?.(Ae)},fe=he=>{if(v||C||ne)return;let Ae=ie?[he[0]??o,he[1]??n]:he[0]??o;L?.(Ae)},Q=w(l,vn,"md"),xe=w(x,ec,"full"),ge=w(c,ec,"full"),be=b==="other"?{track:"",filler:"",thumb:""}:w(Se,w(b,cd,"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 Ae=re?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return(0,qe.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[h&&(0,qe.jsxs)("label",{htmlFor:`${F}-thumb-0`,className:`font-medium ${Ae} ${Q.label} ${v?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${P}`,children:[h,q&&(0,qe.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),W&&(0,qe.jsx)("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(0,qe.jsxs)("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(),(0,qe.jsxs)("div",{className:`flex items-center ${Q.gap} ${f==="vertical"?"flex-col h-48":"flex-row w-full"} ${O}`,children:[p==="left"&&ue(),d&&(0,qe.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:d}),(0,qe.jsxs)(li.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:[(0,qe.jsxs)(li.Track,{className:`relative overflow-hidden ${f==="vertical"?`${Q.trackVertical} h-full`:`${Q.trackHorizontal} w-full`} ${xe} ${ce} ${G}`,children:[(0,qe.jsx)(pa,{showSteps:_,min:o,max:n,step:a,orientation:f,size:l||"md",isRange:ie,currentValues:E}),(0,qe.jsx)(li.Range,{className:`absolute ${pe} ${xe} ${U}`})]}),Pe.map((he,Ae)=>{let Ee=ie?Ae===0?`${F}-thumb-min`:`${F}-thumb-max`:`${F}-thumb-single`;return(0,qe.jsx)(ai,{id:F,thumbIdx:Ae,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},Ee)})]}),u&&(0,qe.jsx)("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()]}),(0,qe.jsx)(fa,{marks:g,min:o,max:n,step:a,orientation:f,size:l||"md",markClassName:B}),(0,qe.jsx)(Le,{id:j,helperText:R,errorMessage:N,sizeClassName:Q.helper,className:K}),D&&(0,qe.jsx)(qe.Fragment,{children:ie?(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)("input",{type:"hidden",name:`${D}[0]`,value:E[0],disabled:v}),(0,qe.jsx)("input",{type:"hidden",name:`${D}[1]`,value:E[1],disabled:v})]}):(0,qe.jsx)("input",{type:"hidden",name:D,value:E[0],disabled:v})})]})}var Cn=require("react");var ks={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"}},Ss={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},dd={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"}},fd={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"}},pd={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"}},gd={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"}};var ci=require("react"),rc=(0,ci.createContext)(null),tc=(0,ci.createContext)(null);function ro(){let e=(0,ci.useContext)(rc);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function wn(){let e=(0,ci.useContext)(tc);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}var oc=require("react/jsx-runtime");function md(e){return e==null?[]:Array.isArray(e)?e:[e]}function Ts({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]=(0,Cn.useState)(()=>md(r)),k=(0,Cn.useMemo)(()=>new Set(y?md(e):S),[y,e,S]),g=(0,Cn.useCallback)(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,dd,"outlined"),"primary"),u=a!=="separated"&&a!=="ghost"?w(i,Ss,"md"):"",v=["w-full transition-colors",d,u,x].filter(Boolean).join(" "),C=(0,Cn.useMemo)(()=>({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(0,oc.jsx)(rc.Provider,{value:C,children:(0,oc.jsx)("div",{ref:h,className:v,style:c,...p,children:f})})}var Ns=require("react");var Xr=require("react/jsx-runtime");function ui({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}=ro(),{isActive:p,disabled:y,headerId:S,panelId:T,onToggle:k}=wn(),g=w(m,ks,"md"),d=w(c,gd,"primary"),u=x==="other"?"":w(c,w(x,pd,"outlined"),"primary"),v=o&&f!=="none",C=()=>v?typeof h=="function"?(0,Xr.jsx)("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?(0,Xr.jsx)("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}):(0,Xr.jsx)("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:(0,Xr.jsx)(kr,{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(0,Xr.jsxs)("div",{className:R,children:[(0,Xr.jsxs)("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(),(0,Xr.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&(0,Xr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 ${d.activeIndicator} ${g.startIcon}`,"aria-hidden":"true",children:e}),(0,Xr.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,Xr.jsx)("span",{className:`truncate ${g.title} ${d.title}`,children:n}),r&&(0,Xr.jsx)("span",{className:`line-clamp-2 ${g.description}`,children:r})]})]}),f==="right"&&!t&&C()]}),t&&(0,Xr.jsxs)("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[t,f==="right"&&C()]})]})}var Rs=require("react/jsx-runtime");function di({destroyInactivePanel:e,children:r,className:t="",style:o,ref:n,...a}){let{size:s,destroyInactivePanel:i}=ro(),{isActive:l,headerId:b,panelId:m}=wn(),x=w(s,ks,"md");return(0,Rs.jsx)("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:(0,Rs.jsx)("div",{className:"overflow-hidden",children:(!(e??i)||l)&&(0,Rs.jsx)("div",{className:`${x.content} ${t}`,children:r})})})}var to=require("react/jsx-runtime");function Ds({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=(0,Ns.useId)(),{activeKeys:p,handleToggle:y,variant:S,color:T,radius:k}=ro(),g=p.has(e),d=`collapse-header-${e??h}`,u=`collapse-panel-${e??h}`,v=(0,Ns.useMemo)(()=>({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,Ss,"md"):"",N=["group",S==="other"?"":w(T,w(S,fd,"outlined"),"primary"),C,a?"opacity-50 cursor-not-allowed":"",m].filter(Boolean).join(" ");return(0,to.jsx)(tc.Provider,{value:v,children:(0,to.jsx)("div",{ref:c,className:N,"data-state":g?"open":"closed",...f,children:r!==void 0?(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)(ui,{startIcon:o,description:t,extra:n,showArrow:s,className:i,children:r}),(0,to.jsx)(di,{destroyInactivePanel:b,className:l,children:x})]}):x})})}var Ps=require("react"),nc=require("react/jsx-runtime");function zs({open:e,defaultOpen:r=!1,destroyInactivePanel:t=!1,className:o="",children:n,ref:a,...s}){let i=(0,Ps.useId)(),l=e!==void 0,[b]=(0,Ps.useState)(r),m=l?e:b;return(0,nc.jsx)("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:(0,nc.jsx)("div",{className:"overflow-hidden",children:(!t||m)&&n})})}var kn=require("react");var Is=require("react"),fi=(0,Is.createContext)(null);function oo(){let e=(0,Is.useContext)(fi);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}var ic=require("react/jsx-runtime");function So({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]=(0,kn.useState)(r),g=S?e:T,d=(0,kn.useCallback)(D=>{S||k(D),t?.(D)},[S,t]),u=(0,kn.useCallback)(D=>{o?.(D)},[o]),v=(0,kn.useMemo)(()=>({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(0,ic.jsx)("div",{ref:p,className:N,...y,children:(0,ic.jsx)(fi.Provider,{value:v,children:h})})}var xd=require("@floating-ui/react");var ac={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"}},ga={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},sc={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"},lc={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"}}},cc={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"}};var nt=require("react"),bd=typeof window<"u"?nt.useLayoutEffect:nt.useEffect;function hd({activeKey:e,orientation:r="horizontal",placement:t="top",variant:o="line",color:n="primary",radius:a="md"}={}){let s=(0,nt.useRef)(null),[i,l]=(0,nt.useState)({opacity:0}),[b,m]=(0,nt.useState)(!1),[x,c]=(0,nt.useState)(!1),f=(0,nt.useCallback)(()=>{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=(0,nt.useCallback)(()=>{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 bd(()=>{h()},[h,e,o,r,t,n,a]),bd(()=>{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())}}}var Ut=require("react/jsx-runtime");function To({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}=oo(),{listRef:f,indicatorStyle:h,canScrollLeft:p,canScrollRight:y,checkScroll:S,handleScrollLeft:T,handleScrollRight:k,handleKeyDown:g}=hd({activeKey:s,orientation:i,placement:l,variant:b,color:m,radius:x}),d=(0,xd.useMergeRefs)([f,n]),u=w(x,ga,"md"),v=b==="other"?"":w(b,sc,"line"),C=typeof v=="function"?v(i,l):"",R=b==="other"?"":w(m,w(b,cc,"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(0,Ut.jsxs)("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&&(0,Ut.jsx)("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:(0,Ut.jsx)(kt,{className:"size-4"})}),(0,Ut.jsxs)("div",{ref:d,role:"tablist","aria-orientation":i,onKeyDown:g,onScroll:S,className:Y,...a,children:[(0,Ut.jsx)("div",{"aria-hidden":"true",className:L,style:h}),e]}),!N&&D&&(0,Ut.jsx)("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:(0,Ut.jsx)(St,{className:"size-4"})}),t&&(0,Ut.jsx)("div",{className:N?"w-full mt-1":"shrink-0 ml-auto pl-1",children:t})]})}var vd=require("react"),yd=require("@floating-ui/react");var jt=require("react/jsx-runtime");function Ro({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}=oo(),C=(0,vd.useRef)(null),R=(0,yd.useMergeRefs)([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,ac,"md"),z=w(k,ga,"md"),A=w(T,lc,"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(0,jt.jsxs)("div",{"data-tab-wrapper":!0,className:$,children:[(0,jt.jsxs)("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&&(0,jt.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${L.icon}`,"aria-hidden":"true",children:t}),(0,jt.jsx)("span",{className:`truncate ${P?"flex-1 text-left":""}`,children:r||b}),n!=null&&(0,jt.jsx)("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&&(0,jt.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${L.icon}`,"aria-hidden":"true",children:o})]}),s&&(0,jt.jsx)("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:(0,jt.jsx)($e,{className:"size-full pointer-events-none"})})]})}var wd=require("react/jsx-runtime");function Ms({children:e,className:r="",ref:t,...o}){return(0,wd.jsx)("div",{ref:t,className:`w-full ${r}`,...o,children:e})}var Cd=require("react/jsx-runtime");function Es({value:e,children:r,className:t="",destroyInactiveTabPane:o,ref:n,...a}){let{activeKey:s,destroyInactiveTabPane:i}=oo(),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(0,Cd.jsx)("div",{ref:n,id:x,role:"tabpanel",tabIndex:0,"aria-labelledby":m,hidden:!l,className:c,...a,children:r})}var $s=require("react"),uc=(0,$s.createContext)(null);function pt(){let e=(0,$s.useContext)(uc);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}var Oe=require("react");function ma({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]=(0,Oe.useState)(r),[S,T]=(0,Oe.useState)(0),[k,g]=(0,Oe.useState)(!1),[d,u]=(0,Oe.useState)(0),[v,C]=(0,Oe.useState)(!1),[R,N]=(0,Oe.useState)(!1),D=(0,Oe.useRef)(new Set),V=(0,Oe.useRef)(null),Y=(0,Oe.useRef)(null),L=(0,Oe.useRef)(0),z=(0,Oe.useRef)(0),A=e!==void 0,O=A?e:p,G=Math.max(0,o?S-1:S-n),U=(0,Oe.useCallback)(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,$=(0,Oe.useCallback)(()=>{M&&U(O-a)},[O,M,U,a]),K=(0,Oe.useCallback)(()=>{P&&U(O+a)},[O,P,U,a]),X=(0,Oe.useCallback)(F=>{U(F)},[U]),B=(0,Oe.useCallback)(F=>{D.current.add(F),T(D.current.size)},[]),oe=(0,Oe.useCallback)(F=>{D.current.delete(F),T(D.current.size)},[]);(0,Oe.useEffect)(()=>{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=(0,Oe.useCallback)(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=(0,Oe.useCallback)(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=(0,Oe.useCallback)(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=(0,Oe.useCallback)(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]),_=(0,Oe.useCallback)(()=>C(!0),[]),W=(0,Oe.useCallback)(()=>C(!1),[]),se=(0,Oe.useCallback)(()=>N(!0),[]),Z=(0,Oe.useCallback)(()=>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 ba={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"}},kd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},dc={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"},fc="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",ha={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"};var pc=require("react/jsx-runtime");function gc({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=ma({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,kd,"md");return(0,pc.jsx)(uc.Provider,{value:g,children:(0,pc.jsx)("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})})}var mc=require("react/jsx-runtime");function bc({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}=pt(),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(0,mc.jsx)("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:(0,mc.jsx)("div",{ref:o,role:"presentation",className:`flex ${r}`,style:{...T,...t},...n,children:e})})}var Ls=require("react");var Sd=require("react/jsx-runtime");function hc({children:e,className:r="",style:t,ref:o,...n}){let a=(0,Ls.useId)(),{slidesToShow:s,spacing:i,registerSlide:l,unregisterSlide:b}=pt();(0,Ls.useEffect)(()=>(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%",(0,Sd.jsx)("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})}var xa=require("react/jsx-runtime");function xc({variant:e="glass",icon:r,className:t="",disabled:o,onClick:n,ref:a,...s}){let{scrollPrev:i,canScrollPrev:l,size:b}=pt(),m=o!==void 0?o:!l,x=w(b,ba,"md"),c=w(e,dc,"glass"),f=(0,xa.jsx)(kt,{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(0,xa.jsx)("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 vc({variant:e="glass",icon:r,className:t="",disabled:o,onClick:n,ref:a,...s}){let{scrollNext:i,canScrollNext:l,size:b}=pt(),m=o!==void 0?o:!l,x=w(b,ba,"md"),c=w(e,dc,"glass"),f=(0,xa.jsx)(St,{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(0,xa.jsx)("button",{ref:a,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:m,onClick:p=>{i(),n?.(p)},className:h,...s,children:r||f})}var Sn=require("react/jsx-runtime");function yc({type:e="dots",clickable:r=!0,className:t="",ref:o,...n}){let{currentIndex:a,totalSlides:s,slidesToShow:i,loop:l,scrollTo:b,size:m}=pt();if(e==="none"||s<=1)return null;let x=w(m,ba,"md"),c=l?s:Math.max(1,s-i+1);return e==="fraction"?(0,Sn.jsx)("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 ${fc} text-white ${x.fraction} ${t}`,...n,children:(0,Sn.jsxs)("span",{children:[Math.min(a+1,c)," / ",c]})}):(0,Sn.jsx)("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 ${fc} ${x.paginationWrapper} ${t}`,...n,children:Array.from({length:c}).map((f,h)=>{let p=h===a;return e==="line"?(0,Sn.jsx)("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} ${ha.active}`:`${x.line} ${ha.inactive}`} ${r?"cursor-pointer":"cursor-default"}`},h):(0,Sn.jsx)("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?ha.active:ha.inactive} ${r?"cursor-pointer":"cursor-default"}`},h)})})}var Dt=require("react"),Xe=require("@floating-ui/react");var Fs=require("react"),wc=(0,Fs.createContext)(null),Nt=()=>{let e=(0,Fs.useContext)(wc);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};var Td=require("react/jsx-runtime");function Bs({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]=(0,Dt.useState)(t),[T,k]=(0,Dt.useState)(null),g=(0,Dt.useRef)([]),d=(0,Dt.useRef)([]),u=r!==void 0,v=u?r:y,C=(0,Dt.useCallback)(X=>{u||S(X),X||k(null),o?.(X)},[u,o]),R=(0,Dt.useMemo)(()=>[(0,Xe.offset)(s),i?(0,Xe.flip)():void 0,l?(0,Xe.shift)({padding:8}):void 0].filter(Boolean),[s,i,l]),{refs:N,floatingStyles:D,context:V,placement:Y}=(0,Xe.useFloating)({placement:a,open:v&&!c,onOpenChange:C,whileElementsMounted:Xe.autoUpdate,transform:!1,middleware:R}),L=(0,Xe.useClick)(V,{enabled:!c&&n==="click"}),z=(0,Xe.useHover)(V,{enabled:!c&&n==="hover",delay:{open:100,close:150},handleClose:(0,Xe.safePolygon)()}),A=(0,Xe.useDismiss)(V),O=(0,Xe.useRole)(V,{role:"menu"}),G=(0,Xe.useListNavigation)(V,{listRef:g,activeIndex:T,onNavigate:k,loop:!0}),U=(0,Xe.useTypeahead)(V,{listRef:d,activeIndex:T,onMatch:v?k:void 0}),{getReferenceProps:M,getFloatingProps:P,getItemProps:$}=(0,Xe.useInteractions)([L,z,A,O,G,U]),K=(0,Dt.useMemo)(()=>({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(0,Td.jsx)(wc.Provider,{value:K,children:e})}var pi=require("react");var kc=require("@floating-ui/react"),Cc=require("react/jsx-runtime");function F0({children:e,ref:r,disabled:t,className:o="",...n}){let a=(0,pi.isValidElement)(e)?e.props?.ref:void 0,s=(0,kc.useMergeRefs)([r,a]);if(!(0,pi.isValidElement)(e))return null;let i=e.props||{};return(0,pi.cloneElement)(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function B0({ref:e,children:r,className:t="",asChild:o=!1,...n}){let{refs:a,getReferenceProps:s,isOpen:i,disabled:l}=Nt(),b=(0,kc.useMergeRefs)([a.setReference,e]),m=s({...n,"aria-expanded":i,"aria-haspopup":"menu",className:t});return(0,pi.isValidElement)(r)&&(o||!0)?(0,Cc.jsx)(F0,{ref:b,disabled:l,...m,children:r}):(0,Cc.jsx)("button",{ref:b,type:"button",disabled:l,"aria-expanded":i,"aria-haspopup":"menu",className:t,...m,children:r})}var Sc=B0;var No=require("@floating-ui/react");var gi={xs:{menu:"p-1 min-w-36 text-xs",item:"px-2 py-1 text-xs rounded",itemGap:"gap-1.5",icon:"size-3.5",header:"px-2 py-1 text-[10px]",description:"text-[10px]",shortcut:"text-[10px] px-1 py-0.5"},sm:{menu:"p-1.5 min-w-44 text-xs",item:"px-2.5 py-1.5 text-xs rounded-md",itemGap:"gap-2",icon:"size-4",header:"px-2.5 py-1 text-xs",description:"text-[11px]",shortcut:"text-[11px] px-1.5 py-0.5"},md:{menu:"p-1.5 min-w-52 text-sm",item:"px-3 py-2 text-sm rounded-lg",itemGap:"gap-2.5",icon:"size-4.5",header:"px-3 py-1.5 text-xs",description:"text-xs",shortcut:"text-xs px-1.5 py-0.5"},lg:{menu:"p-2 min-w-60 text-base",item:"px-3.5 py-2.5 text-base rounded-xl",itemGap:"gap-3",icon:"size-5",header:"px-3.5 py-1.5 text-sm",description:"text-sm",shortcut:"text-sm px-2 py-0.5"},xl:{menu:"p-2.5 min-w-72 text-lg",item:"px-4 py-3 text-lg rounded-2xl",itemGap:"gap-3.5",icon:"size-6",header:"px-4 py-2 text-base",description:"text-base",shortcut:"text-base px-2 py-1"}},Rd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},Nd={primary:{active:"bg-primary-50 text-primary-900",selected:"bg-primary-100 text-primary-900 font-medium",focus:"focus:bg-primary-50 focus:text-primary-900"},secondary:{active:"bg-secondary-50 text-secondary-900",selected:"bg-secondary-100 text-secondary-900 font-medium",focus:"focus:bg-secondary-50 focus:text-secondary-900"},neutral:{active:"bg-neutral-100 text-neutral-900",selected:"bg-neutral-200 text-neutral-900 font-medium",focus:"focus:bg-neutral-100 focus:text-neutral-900"},error:{active:"bg-error-50 text-error-900",selected:"bg-error-100 text-error-900 font-medium",focus:"focus:bg-error-50 focus:text-error-900"},success:{active:"bg-success-50 text-success-900",selected:"bg-success-100 text-success-900 font-medium",focus:"focus:bg-success-50 focus:text-success-900"},warning:{active:"bg-warning-50 text-warning-900",selected:"bg-warning-100 text-warning-900 font-medium",focus:"focus:bg-warning-50 focus:text-warning-900"},info:{active:"bg-info-50 text-info-900",selected:"bg-info-100 text-info-900 font-medium",focus:"focus:bg-info-50 focus:text-info-900"}},Tc={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"};var Vs=require("react/jsx-runtime");function Hs({ref:e,children:r,className:t="",style:o,minWidth:n,zIndex:a=xr.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}=Nt(),k=(0,No.useMergeRefs)([l.setFloating,e]),{isMounted:g,styles:d}=(0,No.useTransitionStyles)(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,gi,"md"),v=w(p,Rd,"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(0,Vs.jsx)(No.FloatingPortal,{children:(0,Vs.jsx)("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:(0,Vs.jsx)(No.FloatingList,{elementsRef:c,labelsRef:f,children:r})})})}var As=require("@floating-ui/react");var no=require("react/jsx-runtime");function V0({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}=Nt(),k=typeof r=="string"?r:void 0,{ref:g,index:d}=(0,As.useListItem)({label:k}),u=(0,As.useMergeRefs)([g,e]),v=h===d,C=w(S,gi,"md"),R=w(y,Nd,"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?`${Tc.default} ${v?Tc.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(0,no.jsxs)("button",{ref:u,type:"button",role:"menuitem",disabled:o,"aria-disabled":o,tabIndex:v?0:-1,...f({...c,onClick:N,className:V}),children:[s&&(0,no.jsx)("span",{className:`flex items-center justify-center shrink-0 ${C.icon}`,children:s}),(0,no.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,no.jsx)("span",{className:"truncate",children:r}),b&&(0,no.jsx)("span",{className:`text-neutral-500 truncate ${C.description}`,children:b})]}),l&&(0,no.jsx)("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${C.shortcut}`,children:l}),i&&(0,no.jsx)("span",{className:`flex items-center justify-center shrink-0 ${C.icon}`,children:i})]})}var Rc=V0;var Dd=require("react/jsx-runtime");function Nc({children:e,className:r="",...t}){let{size:o}=Nt(),n=w(o,gi,"md");return(0,Dd.jsx)("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",n.header,r].filter(Boolean).join(" "),...t,children:e})}var Dc=Nc;var Pd=require("react/jsx-runtime");function H0({className:e="",...r}){return(0,Pd.jsx)("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...r})}var Pc=H0;var Gs=require("react/jsx-runtime");function A0({children:e,label:r,className:t="",...o}){return(0,Gs.jsxs)("div",{role:"group",className:["flex flex-col",t].filter(Boolean).join(" "),...o,children:[r&&(0,Gs.jsx)(Nc,{children:r}),e]})}var zc=A0;var Tn=require("react"),lr=require("@floating-ui/react");var Ys=require("react"),Ic=(0,Ys.createContext)(null),Or=()=>{let e=(0,Ys.useContext)(Ic);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};var zd=require("react/jsx-runtime");function Os({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]=(0,Tn.useState)(t),g=r!==void 0,d=g?r:T,u=(0,Tn.useCallback)(U=>{g||k(U),o?.(U)},[g,o]),v=(0,Tn.useMemo)(()=>[(0,lr.offset)(s),i?(0,lr.flip)():void 0,l?(0,lr.shift)({padding:8}):void 0].filter(Boolean),[s,i,l]),{refs:C,floatingStyles:R,context:N,placement:D}=(0,lr.useFloating)({placement:a,open:d&&!c,onOpenChange:u,whileElementsMounted:lr.autoUpdate,transform:!1,middleware:v}),V=(0,lr.useClick)(N,{enabled:!c&&n==="click"}),Y=(0,lr.useHover)(N,{enabled:!c&&n==="hover",delay:{open:100,close:150},handleClose:(0,lr.safePolygon)()}),L=(0,lr.useDismiss)(N,{escapeKey:y,outsidePress:S}),z=(0,lr.useRole)(N,{role:"dialog"}),{getReferenceProps:A,getFloatingProps:O}=(0,lr.useInteractions)([V,Y,L,z]),G=(0,Tn.useMemo)(()=>({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(0,zd.jsx)(Ic.Provider,{value:G,children:e})}var mi=require("react");var Ec=require("@floating-ui/react"),Mc=require("react/jsx-runtime");function G0({children:e,ref:r,disabled:t,className:o="",...n}){let a=(0,mi.isValidElement)(e)?e.props?.ref:void 0,s=(0,Ec.useMergeRefs)([r,a]);if(!(0,mi.isValidElement)(e))return null;let i=e.props||{};return(0,mi.cloneElement)(e,{...n,...i,ref:s,disabled:t?!0:i.disabled,className:[i.className,o].filter(Boolean).join(" ")})}function Y0({ref:e,children:r,className:t="",asChild:o=!1,...n}){let{refs:a,getReferenceProps:s,isOpen:i,disabled:l}=Or(),b=(0,Ec.useMergeRefs)([a.setReference,e]),m=s({...n,"aria-expanded":i,"aria-haspopup":"dialog",className:t});return(0,mi.isValidElement)(r)&&(o||!0)?(0,Mc.jsx)(G0,{ref:b,disabled:l,...m,children:r}):(0,Mc.jsx)("button",{ref:b,type:"button",disabled:l,"aria-expanded":i,"aria-haspopup":"dialog",className:t,...m,children:r})}var $c=Y0;var Po=require("@floating-ui/react");var Do={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"}},Id={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};var Us=require("react/jsx-runtime");function O0({ref:e,children:r,className:t="",style:o,minWidth:n,maxWidth:a,zIndex:s=xr.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}=Or(),k=(0,Po.useMergeRefs)([b.setFloating,e]),{isMounted:g,styles:d}=(0,Po.useTransitionStyles)(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,Do,"md"),v=w(h,Id,"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=(0,Us.jsx)(Po.FloatingFocusManager,{context:x,modal:S,children:(0,Us.jsx)("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(0,Us.jsx)(Po.FloatingPortal,{children:N})}var Lc=O0;var Md=require("react/jsx-runtime");function U0({children:e,className:r="",...t}){let{size:o}=Or(),n=w(o,Do,"md");return(0,Md.jsx)("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",n.header,r].filter(Boolean).join(" "),...t,children:e})}var Fc=U0;var Ed=require("react/jsx-runtime");function j0({children:e,className:r="",...t}){let{size:o}=Or(),n=w(o,Do,"md");return(0,Ed.jsx)("div",{className:["text-neutral-700",n.body,r].filter(Boolean).join(" "),...t,children:e})}var Bc=j0;var $d=require("react/jsx-runtime");function W0({children:e,className:r="",...t}){let{size:o}=Or(),n=w(o,Do,"md");return(0,$d.jsx)("div",{className:["border-t border-neutral-100 bg-neutral-50/50",n.footer,r].filter(Boolean).join(" "),...t,children:e})}var Vc=W0;var bi=require("react");var Ld=require("@floating-ui/react"),Hc=require("react/jsx-runtime");function K0({children:e,ref:r,className:t="",onClick:o,...n}){let a=(0,bi.isValidElement)(e)?e.props?.ref:void 0,s=(0,Ld.useMergeRefs)([r,a]);if(!(0,bi.isValidElement)(e))return null;let i=e.props||{};return(0,bi.cloneElement)(e,{...n,...i,ref:s,className:[i.className,t].filter(Boolean).join(" "),onClick:l=>{i.onClick?.(l),o?.(l)}})}function X0({ref:e,children:r,className:t="",asChild:o=!1,onClick:n,...a}){let{setIsOpen:s}=Or(),i=l=>{n?.(l),l.defaultPrevented||s(!1)};return(0,bi.isValidElement)(r)&&o?(0,Hc.jsx)(K0,{ref:e,className:t,onClick:i,...a,children:r}):(0,Hc.jsx)("button",{ref:e,type:"button",className:t,onClick:i,...a,children:r})}var Ac=X0;var Mo=require("react"),cr=require("@floating-ui/react");var Rn=require("react");var Fd={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"}},Bd={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"}},gt={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"}},Vd={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"},zo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Hd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Io={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"}},Ad={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 yr(e){return!e||e==="vi"?Fd:e==="en"?Bd:e}function Ir(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=js(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 io(e,r){return!e||!r?!1:e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function va(e,r){return!e||!r?!1:e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()}function hi(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 xi(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 vi(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 Gd(e,r){return new Date(e,r+1,0).getDate()}function ya(e,r,t=1,o,n,a,s){let i=[],l=new Date,b=new Date(e,r,1).getDay(),m=Gd(e,r-1),x=Gd(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(Gc(y,!1,l,o,n,a,s))}for(let h=1;h<=x;h++){let p=new Date(e,r,h);i.push(Gc(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(Gc(p,!1,l,o,n,a,s))}return i}function Gc(e,r,t,o,n,a,s){let i=o?io(e,o):!1,l=!1;return n&&hi(e,n)&&(l=!0),a&&xi(e,a)&&(l=!0),s&&s(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:r,isToday:io(e,t),isSelected:i,isDisabled:l,weekNumber:vi(e)}}function _r(e,r="DD/MM/YYYY",t){if(!e||isNaN(e.getTime()))return"";let o=yr(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 js(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 Ws(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}var Zr=require("react/jsx-runtime");function yi({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=yr(x),h=w(b,gt,"md"),p=w(m,Io,"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(0,Zr.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[(0,Zr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&(0,Zr.jsx)("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:(0,Zr.jsx)(tn,{width:14,height:14})}),c&&(0,Zr.jsx)("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:(0,Zr.jsx)(kt,{width:14,height:14})})]}),(0,Zr.jsx)("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()}),(0,Zr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[c&&(0,Zr.jsx)("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:(0,Zr.jsx)(St,{width:14,height:14})}),r==="days"&&(0,Zr.jsx)("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:(0,Zr.jsx)(on,{width:14,height:14})})]})]})}var Ks=Ft(require("react"),1);var Pt=require("react/jsx-runtime");function wi({days:e,onSelectDate:r,size:t="md",color:o="primary",radius:n,locale:a,firstDayOfWeek:s=1,showWeekNumbers:i=!1}){let l=yr(a),b=w(t,gt,"md"),m=w(o,Io,"primary"),x=w(n,zo,"lg"),c=(0,Ks.useRef)(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(0,Pt.jsxs)("div",{ref:c,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[(0,Pt.jsxs)("div",{role:"row",className:`grid ${i?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[i&&(0,Pt.jsx)("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=>(0,Pt.jsx)("div",{role:"columnheader","aria-label":g,className:`flex items-center justify-center ${b.cellSize} text-neutral-500 ${b.cellText} font-medium`,children:g},g))]}),(0,Pt.jsx)("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(0,Pt.jsxs)(Ks.default.Fragment,{children:[i&&u&&(0,Pt.jsxs)("div",{className:`flex items-center justify-center ${b.cellSize} text-neutral-400 ${b.cellText} text-[10px] font-mono`,children:["W",g.weekNumber]}),(0,Pt.jsx)("div",{role:"gridcell","aria-selected":g.isSelected,className:"flex items-center justify-center",children:(0,Pt.jsx)("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())})})]})}var Yd=require("react");var Xs=require("react/jsx-runtime");function Ci({currentMonth:e,selectedDate:r,onSelectMonth:t,size:o="md",color:n="primary",radius:a,locale:s}){let i=yr(s),l=w(o,gt,"md"),b=w(n,Io,"primary"),m=w(a,zo,"lg"),x=(0,Yd.useRef)(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(0,Xs.jsx)("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?va(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`),(0,Xs.jsx)("div",{role:"gridcell","aria-selected":v,className:"flex items-center justify-center",children:(0,Xs.jsx)("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)})})}var Od=require("react");var _s=require("react/jsx-runtime");function ki({currentMonth:e,selectedDate:r,onSelectYear:t,size:o="md",color:n="primary",radius:a}){let s=w(o,gt,"md"),i=w(n,Io,"primary"),l=w(a,zo,"lg"),b=(0,Od.useRef)(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(0,_s.jsx)("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`),(0,_s.jsx)("div",{role:"gridcell","aria-selected":u,className:"flex items-center justify-center",children:(0,_s.jsx)("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)})})}var mt=require("react/jsx-runtime");function Wt({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,gt,"md"),S=w(h,Hd,"lg"),[T,k]=(0,Rn.useState)(t),[g,d]=(0,Rn.useState)(t);t!==g&&(d(t),k(t));let[u,v]=(0,Rn.useState)(()=>{let $=e||new Date;return new Date($.getFullYear(),$.getMonth(),1)}),C=yr(i),R=(0,Rn.useMemo)(()=>{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=Ir(n),M=Ir(a),P=(0,Rn.useMemo)(()=>ya(u.getFullYear(),u.getMonth(),l,e,U,M,s),[u,l,e,U,M,s]);return(0,mt.jsxs)("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&&(0,mt.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,mt.jsx)(So,{activeKey:t,onChange:N,size:"sm",variant:"solid",color:f,fullWidth:!0,className:"gap-0!",children:(0,mt.jsx)(To,{className:"p-0.5",children:R.map($=>(0,mt.jsx)(Ro,{value:$.key,className:"py-1 px-2 text-xs",children:$.label},$.key))})})}),(0,mt.jsxs)("div",{className:`${y.calendarPadding} min-w-70`,children:[(0,mt.jsx)(yi,{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"&&(0,mt.jsx)(wi,{days:P,onSelectDate:$=>r?.($),size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&(0,mt.jsx)(Ci,{currentMonth:u,selectedDate:e,onSelectMonth:O,size:c,color:f,radius:h,locale:i}),T==="years"&&(0,mt.jsx)(ki,{currentMonth:u,selectedDate:e,onSelectYear:G,size:c,color:f,radius:h})]})]})}var tr=require("react/jsx-runtime");function Si({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??{},_=(0,Mo.useId)(),W=u||_,se=`${W}-error-helper`,Z=`${W}-popover`,F=R!==void 0,[j,re]=(0,Mo.useState)(s),Se=F?R:j,ie=a||n,de=(0,Mo.useMemo)(()=>Ws(ie,Se),[ie,Se]),Te=r!==void 0,[ye,J]=(0,Mo.useState)(()=>Ir(t,n)),E=Te?Ir(r,n):ye,I=E?_r(E,de,i):"",[fe,Q]=(0,Mo.useState)(!1),{refs:{setReference:xe,setFloating:ge},floatingStyles:be,context:ce}=(0,cr.useFloating)({placement:V,open:fe&&!Y&&!L&&!X,onOpenChange:Q,whileElementsMounted:cr.autoUpdate,transform:!1,middleware:[(0,cr.offset)(6),(0,cr.flip)(),(0,cr.shift)({padding:8})]}),pe=(0,cr.useDismiss)(ce,{escapeKey:!0,outsidePress:!0}),De=(0,cr.useRole)(ce,{role:"dialog"}),{getReferenceProps:ue,getFloatingProps:Pe}=(0,cr.useInteractions)([pe,De]),{isMounted:he,styles:Ae}=(0,cr.useTransitionStyles)(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)"})}),Ee=!!(K||g),ze=Ee?"error":h,Ie=w(c,gt,"md"),Ve=w(p,zo,"lg"),We=f==="other"?"":w(ze,w(f,Ad,"outline"),"primary"),ar=!!E,er=ve=>{F||re(ve),N?.(ve)},Cr=ve=>{Te||J(ve);let et=ve?_r(ve,n,i):"";o?.(et),le&&Q(!1)},br=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)))},sr=ve=>{ve.stopPropagation(),Te||J(null),o?.(null),D?.()},te=T||de,Ue=S==="floating",rr=S==="left",me=()=>{if(!y)return null;let ve=Ee?"text-error-600 font-bold":w(ze,Vd,"primary");return Ue?(0,tr.jsxs)("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,$&&(0,tr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,tr.jsxs)("label",{htmlFor:W,className:`inline-flex items-center font-bold transition-colors duration-150 ${Ie.label} ${ve} ${U}`,children:[y,$&&(0,tr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Je=ve=>(0,tr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ie.icon}`,"aria-hidden":"true",children:ve}),Sr=["group/field relative flex",rr?"flex-row items-center gap-3":"flex-col",q?"w-full":"inline-flex",O].filter(Boolean).join(" "),Tr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Ie.inputHeight,Ve,We,Y?"opacity-50":"",q?"w-full":"w-auto",G].filter(Boolean).join(" "),$r=["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(0,tr.jsxs)("div",{className:Sr,children:[!Ue&&me(),(0,tr.jsxs)("div",{className:`flex flex-col ${q?"w-full":""}`,children:[(0,tr.jsxs)("div",{ref:xe,...ue(),className:Tr,children:[Ue&&me(),(0,tr.jsx)("input",{ref:e,id:W,name:d,type:"text",value:I,onClick:()=>!Y&&!L&&!X&&Q(ve=>!ve),onKeyDown:br,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":Ee,"aria-busy":X,"aria-disabled":Y||X,"aria-describedby":k||g?se:void 0,"aria-errormessage":g?se:void 0,className:$r}),(0,tr.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&B&&(0,tr.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Je((0,tr.jsx)(Ce,{}))}),!X&&oe&&!Y&&!L&&(0,tr.jsx)("button",{type:"button",onClick:sr,"aria-label":"X\xF3a ng\xE0y",tabIndex:ar?0:-1,"aria-hidden":!ar,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} ${ar?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,tr.jsx)($e,{className:"size-full"})}),(0,tr.jsx)("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:Je((0,tr.jsx)(kr,{className:"size-full"}))})]})]}),he&&(0,tr.jsx)(cr.FloatingPortal,{children:(0,tr.jsx)(cr.FloatingFocusManager,{context:ce,modal:!1,returnFocus:!0,children:(0,tr.jsx)("div",{ref:ge,id:Z,style:{...be,...Ae,zIndex:xr.PICKER},...Pe(),className:P,children:(0,tr.jsx)(Wt,{value:E,onChange:Cr,view:Se,onViewChange:er,minDate:b,maxDate:m,isDateDisabled:x,locale:i,firstDayOfWeek:l,showWeekNumbers:ee,size:c,color:h,radius:p,showViewTabs:ne,viewTabs:C})})})}),(0,tr.jsx)(Le,{id:se,helperText:k,errorMessage:g,sizeClassName:Ie.helper,className:M})]})]})}var Lo=require("react"),ur=require("@floating-ui/react");var It=require("react");var bt={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"}},Eo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ud={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},$o={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"}},jd={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:""}},Wd={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"};var Rr=require("react/jsx-runtime");function Ti({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=yr(c),h=w(m,bt,"md"),p=w(x,$o,"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(0,Rr.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[(0,Rr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&(0,Rr.jsx)("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:(0,Rr.jsx)(tn,{width:14,height:14})}),(0,Rr.jsx)("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:(0,Rr.jsx)(kt,{width:h.iconSize,height:h.iconSize})})]}),(0,Rr.jsxs)("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[(0,Rr.jsx)("div",{className:"flex items-center justify-center",children:(0,Rr.jsx)("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})}),(0,Rr.jsx)("div",{className:"flex items-center justify-center",children:(0,Rr.jsx)("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})})]}),(0,Rr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[(0,Rr.jsx)("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:(0,Rr.jsx)(St,{width:h.iconSize,height:h.iconSize})}),t==="days"&&(0,Rr.jsx)("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:(0,Rr.jsx)(on,{width:14,height:14})})]})]})}var Zs=Ft(require("react"),1);var zt=require("react/jsx-runtime");function Nn({days:e,onSelectDate:r,onHoverDate:t,size:o="md",color:n="primary",radius:a,locale:s,firstDayOfWeek:i=1,showWeekNumbers:l=!1}){let b=yr(s),m=w(o,bt,"md"),x=w(n,$o,"primary"),c=w(a,Eo,"lg"),f=(0,Zs.useRef)(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(0,zt.jsxs)("div",{ref:f,role:"grid","aria-label":b.months[e[15]?.month||0],className:"w-full",children:[(0,zt.jsxs)("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&(0,zt.jsx)("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=>(0,zt.jsx)("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${m.cellSize} text-neutral-500 ${m.cellText} font-medium`,children:d},d))]}),(0,zt.jsx)("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(0,zt.jsxs)(Zs.default.Fragment,{children:[l&&v&&(0,zt.jsxs)("div",{className:`flex items-center justify-center ${m.cellSize} text-neutral-400 ${m.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),(0,zt.jsx)("div",{role:"gridcell","aria-selected":d.isSelected||d.isInRange,className:`relative flex items-center justify-center ${R}`,children:(0,zt.jsx)("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())})})]})}var Kd=require("react");var qs=require("react/jsx-runtime");function Dn({currentMonth:e,onSelectMonth:r,size:t="md",color:o="primary",radius:n,locale:a,rangeStart:s,rangeEnd:i,hoveredDate:l,onHoverMonth:b}){let m=yr(a),x=w(t,bt,"md"),c=w(o,$o,"primary"),f=w(n,Eo,"lg"),h=(0,Kd.useRef)(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(0,qs.jsx)("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`),(0,qs.jsx)("div",{role:"gridcell","aria-selected":L||z||A,className:"flex items-center justify-center",children:(0,qs.jsx)("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)})})}var Xd=require("react");var Js=require("react/jsx-runtime");function Pn({currentMonth:e,onSelectYear:r,size:t="md",color:o="primary",radius:n,rangeStart:a,rangeEnd:s,hoveredDate:i,onHoverYear:l}){let b=w(t,bt,"md"),m=w(o,$o,"primary"),x=w(n,Eo,"lg"),c=(0,Xd.useRef)(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(0,Js.jsx)("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`),(0,Js.jsx)("div",{role:"gridcell","aria-selected":V||Y||L,className:"flex items-center justify-center",children:(0,Js.jsx)("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 Oc(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 _d(e,r){return new Date(e,r+1,0).getDate()}function Yc(e,r,t,o,n,a,s,i,l){let b=o?io(e,o):!1,m=n?io(e,n):!1,x=Oc(e,o||null,n||null),c=o&&!n&&a?Oc(e,o,a):!1,f=!1;return s&&hi(e,s)&&(f=!0),i&&xi(e,i)&&(f=!0),l&&l(e)&&(f=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:r,isToday:io(e,t),isSelected:b||m,isDisabled:f,isRangeStart:b,isRangeEnd:m,isInRange:x,isHoveredRange:c,weekNumber:vi(e)}}function Ri(e,r,t=1,o,n,a,s,i,l){let b=[],m=new Date,x=new Date(e,r,1).getDay(),c=_d(e,r-1),f=_d(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(Yc(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(Yc(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(Yc(S,!1,m,o,n,a,s,i,l))}return b}var Mr=require("react/jsx-runtime");function Ni({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,bt,"md"),S=w(h,Ud,"lg"),[T,k]=(0,It.useState)(t),[g,d]=(0,It.useState)(t);t!==g&&(d(t),k(t));let u=e?e[0]:null,v=e?e[1]:null,[C,R]=(0,It.useState)(()=>{let Z=u||new Date;return new Date(Z.getFullYear(),Z.getMonth(),1)}),N=yr(i),D=(0,It.useMemo)(()=>{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]=(0,It.useState)(null),[P,$]=(0,It.useState)(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=Ir(n),q=Ir(a),ee=C,ne=(0,It.useMemo)(()=>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=(0,It.useMemo)(()=>Ri(ee.getFullYear(),ee.getMonth(),l,le,_,P,oe,q,s),[ee,l,le,_,P,oe,q,s]),se=(0,It.useMemo)(()=>Ri(ne.getFullYear(),ne.getMonth(),l,le,_,P,oe,q,s),[ne,l,le,_,P,oe,q,s]);return(0,Mr.jsxs)("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&&(0,Mr.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Mr.jsx)(So,{activeKey:t,onChange:V,size:"sm",variant:"solid",color:f,fullWidth:!0,className:"gap-0!",children:(0,Mr.jsx)(To,{className:"p-0.5",children:D.map(Z=>(0,Mr.jsx)(Ro,{value:Z.key,className:"py-1 px-2 text-xs",children:Z.label},Z.key))})})}),(0,Mr.jsx)(Ti,{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}),(0,Mr.jsxs)("div",{className:"flex flex-row divide-x divide-neutral-200",children:[(0,Mr.jsxs)("div",{className:`${y.calendarPadding} min-w-70`,children:[T==="days"&&(0,Mr.jsx)(Nn,{days:W,onSelectDate:K,onHoverDate:$,size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&(0,Mr.jsx)(Dn,{currentMonth:ee,onSelectMonth:Z=>X(ee.getFullYear(),Z),size:c,color:f,radius:h,locale:i,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverMonth:$}),T==="years"&&(0,Mr.jsx)(Pn,{currentMonth:ee,onSelectYear:B,size:c,color:f,radius:h,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverYear:$})]}),(0,Mr.jsxs)("div",{className:`${y.calendarPadding} min-w-70`,children:[T==="days"&&(0,Mr.jsx)(Nn,{days:se,onSelectDate:K,onHoverDate:$,size:c,color:f,radius:h,locale:i,firstDayOfWeek:l,showWeekNumbers:b}),T==="months"&&(0,Mr.jsx)(Dn,{currentMonth:ne,onSelectMonth:Z=>X(ne.getFullYear(),Z),size:c,color:f,radius:h,locale:i,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverMonth:$}),T==="years"&&(0,Mr.jsx)(Pn,{currentMonth:ne,onSelectYear:B,size:c,color:f,radius:h,rangeStart:le,rangeEnd:_,hoveredDate:P,onHoverYear:$})]})]})]})}var or=require("react/jsx-runtime");function Di({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=(0,Lo.useId)(),se=v||W,Z=`${se}-error-helper`,F=`${se}-popover`,j=N!==void 0,[re,Se]=(0,Lo.useState)(i),ie=j?N:re,de=s||a,Te=(0,Lo.useMemo)(()=>Ws(de,ie),[de,ie]),ye=r!==void 0,[J,E]=(0,Lo.useState)(()=>{let ke=t;return ke&&Array.isArray(ke)?[Ir(ke[0],a),Ir(ke[1],a)]:[null,null]}),I=ye&&r&&Array.isArray(r)?[Ir(r[0],a),Ir(r[1],a)]:J,fe=I[0]&&I[1]?`${_r(I[0],Te,l)}${n}${_r(I[1],Te,l)}`:I[0]?`${_r(I[0],Te,l)}${n}`:"",[Q,xe]=(0,Lo.useState)(!1),{refs:{setReference:ge,setFloating:be},floatingStyles:ce,context:pe}=(0,ur.useFloating)({placement:Y,open:Q&&!L&&!z&&!B,onOpenChange:xe,whileElementsMounted:ur.autoUpdate,transform:!1,middleware:[(0,ur.offset)(6),(0,ur.flip)(),(0,ur.shift)({padding:8})]}),De=(0,ur.useDismiss)(pe,{escapeKey:!0,outsidePress:!0}),ue=(0,ur.useRole)(pe,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:he}=(0,ur.useInteractions)([De,ue]),{isMounted:Ae,styles:Ee}=(0,ur.useTransitionStyles)(pe,{duration:150,initial:({side:ke})=>({opacity:0,transform:ke==="top"?"translateY(4px) scale(0.96)":ke==="bottom"?"translateY(-4px) scale(0.96)":ke==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:ke})=>({opacity:0,transform:ke==="top"?"translateY(4px) scale(0.96)":ke==="bottom"?"translateY(-4px) scale(0.96)":ke==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),ze=!!(X||d),Ie=ze?"error":p,Ve=w(f,bt,"md"),We=w(y,Eo,"lg"),ar=w(h,jd,"outline"),er=h==="other"?"":w(Ie,ar,"primary"),Cr=!!I[0],br=ke=>{j||Se(ke),D?.(ke)},sr=ke=>{ye||E(ke);let[we,Dr]=ke;if(we&&Dr){let Pr=[_r(we,a,l),_r(Dr,a,l)];o?.(Pr),_&&xe(!1)}},te=ke=>{L||z||B||(ke.key==="ArrowDown"||ke.key==="Enter"||ke.key===" "?(ke.preventDefault(),Q||xe(!0)):ke.key==="Escape"&&Q&&(ke.preventDefault(),xe(!1)))},Ue=ke=>{ke.stopPropagation(),ye||E([null,null]),o?.(null),V?.()},rr=k||`${Te}${n}${Te}`,me=T==="floating",Je=T==="left",Sr=()=>{if(!S)return null;let ke=ze?"text-error-600 font-bold":w(Ie,Wd,"primary");return me?(0,or.jsxs)("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 ${Ve.floatingLabel} ${ke} ${M}`,children:[S,K&&(0,or.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,or.jsxs)("label",{htmlFor:se,className:`inline-flex items-center font-bold transition-colors duration-150 ${Ve.label} ${ke} ${M}`,children:[S,K&&(0,or.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Tr=ke=>(0,or.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Ve.icon}`,"aria-hidden":"true",children:ke}),$r=["group/field relative flex",Je?"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",Ve.inputHeight,We,er,L?"opacity-50":"",ee?"w-full":"w-auto",U].filter(Boolean).join(" "),et=["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,O].filter(Boolean).join(" ");return(0,or.jsxs)("div",{className:$r,children:[!me&&Sr(),(0,or.jsxs)("div",{className:`flex flex-col ${ee?"w-full":""}`,children:[(0,or.jsxs)("div",{ref:ge,...Pe(),className:ve,children:[me&&Sr(),(0,or.jsx)("input",{ref:e,id:se,name:u,type:"text",value:fe,onClick:()=>!L&&!z&&!B&&xe(ke=>!ke),onKeyDown:te,readOnly:!0,autoComplete:C,placeholder:rr,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:et}),(0,or.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&oe&&(0,or.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Tr((0,or.jsx)(Ce,{}))}),!B&&q&&!L&&!z&&(0,or.jsx)("button",{type:"button",onClick:Ue,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Cr?0:-1,"aria-hidden":!Cr,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} ${Cr?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,or.jsx)($e,{className:"size-full"})}),(0,or.jsx)("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:Tr((0,or.jsx)(kr,{className:"size-full"}))})]})]}),Ae&&(0,or.jsx)(ur.FloatingPortal,{children:(0,or.jsx)(ur.FloatingFocusManager,{context:pe,modal:!1,returnFocus:!0,children:(0,or.jsx)("div",{ref:be,id:F,style:{...ce,...Ee,zIndex:xr.PICKER},...he(),className:$,children:(0,or.jsx)(Ni,{value:I,onChange:sr,view:ie,onViewChange:br,minDate:m,maxDate:x,isDateDisabled:c,locale:l,firstDayOfWeek:b,showWeekNumbers:ne,size:f,color:p,radius:y,showViewTabs:le,viewTabs:R})})})}),(0,or.jsx)(Le,{id:Z,helperText:g,errorMessage:d,sizeClassName:Ve.helper,className:P})]})]})}var Ta=require("react"),dr=require("@floating-ui/react");var zn=require("react");var ao={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"}},wa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ca={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Uc={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},Qs={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"}},jc={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"},ka={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 ht(e){return e<10?`0${e}`:`${e}`}function so(e=!1,r=!0){return e?r?"hh:mm:ss A":"hh:mm A":r?"HH:mm:ss":"HH:mm"}function qr(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 Ur(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,ht(t)).replace(/H/g,`${t}`).replace(/hh/g,ht(a)).replace(/h/g,`${a}`).replace(/mm/g,ht(o)).replace(/m/g,`${o}`).replace(/ss/g,ht(n)).replace(/s/g,`${n}`).replace(/A/g,s).replace(/a/g,s.toLowerCase())}function Wc(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 Fo(e,r,t=0){let o=new Date;return o.setHours(e,r,t,0),o}function Kc(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 Xc(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 _c(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 Bo(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}var Sa=require("react");var Zc=require("react/jsx-runtime");function lo({items:e,selectedValue:r,onSelect:t,ariaLabel:o,size:n="md",color:a="primary",radius:s,className:i="",itemClassName:l="",selectedItemClassName:b=""}){let m=(0,Sa.useRef)(null),x=(0,Sa.useRef)(null),c=w(n,ao,"md"),f=w(a,Qs,"primary"),h=w(s,Uc,"md"),p=e.findIndex(k=>!k.disabled),y=e.some(k=>k.value===r);(0,Sa.useEffect)(()=>{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(0,Zc.jsx)("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(0,Zc.jsx)("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}`)})})}var Kt=require("react/jsx-runtime");function it({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=(0,zn.useMemo)(()=>qr(l),[l]),T=(0,zn.useMemo)(()=>qr(b),[b]),k=so(o,n),g=w(p,Ca,"lg"),d=w(f,ao,"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=(0,zn.useMemo)(()=>{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=Bo("hour",$,u,C,S,T,m,x,c);M.push({value:P,label:ht(P),disabled:K})}else for(let P=0;P<24;P+=a){let $=Bo("hour",P,u,C,S,T,m,x,c);M.push({value:P,label:ht(P),disabled:$})}return M},[o,a,N,u,C,S,T,m,x,c]),V=(0,zn.useMemo)(()=>{let M=[];for(let P=0;P<60;P+=s){let $=Bo("minute",P,u,C,S,T,m,x,c);M.push({value:P,label:ht(P),disabled:$})}return M},[s,u,C,S,T,m,x,c]),Y=(0,zn.useMemo)(()=>{if(!n)return[];let M=[];for(let P=0;P<60;P+=i){let $=Bo("second",P,u,C,S,T,m,x,c);M.push({value:P,label:ht(P),disabled:$})}return M},[n,i,u,C,S,T,m,x,c]),L=(0,zn.useMemo)(()=>[{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 $=Fo(P,C,R);r?.($)},A=M=>{let P=Number(M),$=Fo(u,P,R);r?.($)},O=M=>{let P=Number(M),$=Fo(u,C,P);r?.($)},G=M=>{let P=M,$=u;P==="AM"&&$>=12?$-=12:P==="PM"&&$<12&&($+=12);let K=Fo($,C,R);r?.(K)},U=n?"--:--:--":"--:--";return(0,Kt.jsxs)("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:[(0,Kt.jsx)("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:(0,Kt.jsx)("span",{className:`text-neutral-700 tracking-wider font-mono ${d.headerText}`,children:e?Ur(e,k):U})}),(0,Kt.jsxs)("div",{className:`flex divide-x divide-neutral-200 ${d.panelPadding}`,children:[(0,Kt.jsx)(lo,{ariaLabel:"Gi\u1EDD",items:D,selectedValue:o?v:e?u:null,onSelect:z,size:f,color:h,radius:p}),(0,Kt.jsx)(lo,{ariaLabel:"Ph\xFAt",items:V,selectedValue:e?C:null,onSelect:A,size:f,color:h,radius:p}),n&&(0,Kt.jsx)(lo,{ariaLabel:"Gi\xE2y",items:Y,selectedValue:e?R:null,onSelect:O,size:f,color:h,radius:p}),o&&(0,Kt.jsx)(lo,{ariaLabel:"Bu\u1ED5i",items:L,selectedValue:e?N:null,onSelect:G,size:f,color:h,radius:p})]})]})}var nr=require("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=(0,Ta.useId)(),_=N||le,W=`${_}-error-helper`,se=`${_}-popover`,Z=so(s,i),F=n||Z,j=a||F,re=r!==void 0,[Se,ie]=(0,Ta.useState)(()=>qr(t)),de=re?qr(r):Se,Te=de?Ur(de,j):"",[ye,J]=(0,Ta.useState)(!1),{refs:{setReference:E,setFloating:I},floatingStyles:fe,context:Q}=(0,dr.useFloating)({placement:Y,open:ye&&!L&&!z&&!B,onOpenChange:J,whileElementsMounted:dr.autoUpdate,transform:!1,middleware:[(0,dr.offset)(6),(0,dr.flip)(),(0,dr.shift)({padding:8})]}),xe=(0,dr.useDismiss)(Q,{escapeKey:!0,outsidePress:!0}),ge=(0,dr.useRole)(Q,{role:"dialog"}),{getReferenceProps:be,getFloatingProps:ce}=(0,dr.useInteractions)([xe,ge]),{isMounted:pe,styles:De}=(0,dr.useTransitionStyles)(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,ao,"md"),Ae=w(k,wa,"lg"),Ee=S==="other"?"":w(Pe,w(S,ka,"outline"),"primary"),ze=!!de,Ie=me=>{re||ie(me);let Je=me?Ur(me,F):"";o?.(Je),ne&&J(!1)},Ve=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)))},We=me=>{me.stopPropagation(),re||ie(null),o?.(null),V?.()},ar=u||j,er=d==="floating",Cr=d==="left",br=()=>{if(!g)return null;let me=ue?"text-error-600 font-bold":w(Pe,jc,"primary");return er?(0,nr.jsxs)("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&&(0,nr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,nr.jsxs)("label",{htmlFor:_,className:`inline-flex items-center font-bold transition-colors duration-150 ${he.label} ${me} ${M}`,children:[g,K&&(0,nr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},sr=me=>(0,nr.jsx)("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",Cr?"flex-row items-center gap-3":"flex-col",ee?"w-full":"inline-flex",G].filter(Boolean).join(" "),Ue=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",he.inputHeight,Ae,Ee,L?"opacity-50":"",ee?"w-full":"w-auto",U].filter(Boolean).join(" "),rr=["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(0,nr.jsxs)("div",{className:te,children:[!er&&br(),(0,nr.jsxs)("div",{className:`flex flex-col ${ee?"w-full":""}`,children:[(0,nr.jsxs)("div",{ref:E,...be(),className:Ue,children:[er&&br(),(0,nr.jsx)("input",{ref:e,id:_,name:R,type:"text",value:Te,onClick:()=>!L&&!z&&!B&&J(me=>!me),onKeyDown:Ve,readOnly:!0,autoComplete:D,placeholder:ar,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:rr}),(0,nr.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&oe&&(0,nr.jsx)("div",{className:"flex items-center justify-center shrink-0",children:sr((0,nr.jsx)(Ce,{}))}),!B&&q&&!L&&!z&&(0,nr.jsx)("button",{type:"button",onClick:We,"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:(0,nr.jsx)($e,{className:"size-full"})}),(0,nr.jsx)("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:sr((0,nr.jsx)(kr,{className:"size-full"}))})]})]}),pe&&(0,nr.jsx)(dr.FloatingPortal,{children:(0,nr.jsx)(dr.FloatingFocusManager,{context:Q,modal:!1,returnFocus:!0,children:(0,nr.jsx)("div",{ref:I,id:se,style:{...fe,...De,zIndex:xr.PICKER},...ce(),className:$,children:(0,nr.jsx)(it,{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})})})}),(0,nr.jsx)(Le,{id:W,helperText:v,errorMessage:C,sizeClassName:he.helper,className:P})]})]})}var In=require("react"),fr=require("@floating-ui/react");var qc=ao,Jc=wa,Qc=Ca;var eu=ka,ru={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"};var je=require("react/jsx-runtime");function rl({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=(0,In.useId)(),F=L||Z,j=`${F}-error-helper`,re=`${F}-popover`,Se=so(b,m),ie=n||Se,de=a||ie,Te=r!==void 0,[ye,J]=(0,In.useState)(()=>{let we=t;return we&&Array.isArray(we)?[qr(we[0]),qr(we[1])]:[null,null]}),E=Te&&r&&Array.isArray(r)?[qr(r[0]),qr(r[1])]:ye,I=E[0]?Ur(E[0],de):"",fe=E[1]?Ur(E[1],de):"",Q=(0,In.useMemo)(()=>I&&fe?`${I}${s}${fe}`:I?`${I}${s}`:"",[I,fe,s]),[xe,ge]=(0,In.useState)(!1),{refs:{setReference:be,setFloating:ce},floatingStyles:pe,context:De}=(0,fr.useFloating)({placement:M,open:xe&&!A&&!O&&!ne,onOpenChange:ge,whileElementsMounted:fr.autoUpdate,transform:!1,middleware:[(0,fr.offset)(6),(0,fr.flip)(),(0,fr.shift)({padding:8})]}),ue=(0,fr.useDismiss)(De,{escapeKey:!0,outsidePress:!0}),Pe=(0,fr.useRole)(De,{role:"dialog"}),{getReferenceProps:he,getFloatingProps:Ae}=(0,fr.useInteractions)([ue,Pe]),{isMounted:Ee,styles:ze}=(0,fr.useTransitionStyles)(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),Ve=Ie?"error":d,We=w(k,qc,"md"),ar=w(u,Jc,"lg"),er=w(u,Qc,"lg"),Cr=g==="other"?"":w(Ve,w(g,eu,"outline"),"primary"),br=!!(E[0]||E[1]),sr=we=>{let Dr=[we,E[1]];Te||J(Dr);let Pr=Ur(we,ie),Hr=E[1]?Ur(E[1],ie):"";o?.([Pr,Hr])},te=we=>{let Dr=[E[0],we];Te||J(Dr);let Pr=E[0]?Ur(E[0],ie):"",Hr=Ur(we,ie);o?.([Pr,Hr]),se&&ge(!1)},Ue=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)))},rr=we=>{we.stopPropagation(),Te||J([null,null]),o?.(null),U?.()},me=R||(N?`${N[0]}${s}${N[1]}`:`${de}${s}${de}`),Je=C==="floating",Sr=C==="left",Tr=()=>{if(!v)return null;let we=Ie?"text-error-600 font-bold":w(Ve,ru,"primary");return Je?(0,je.jsxs)("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 ${We.floatingLabel} ${we} ${X}`,children:[v,q&&(0,je.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,je.jsxs)("label",{htmlFor:F,className:`inline-flex items-center font-bold transition-colors duration-150 ${We.label} ${we} ${X}`,children:[v,q&&(0,je.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},$r=we=>(0,je.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${We.icon}`,"aria-hidden":"true",children:we}),ve=["group/timerangepicker relative flex",Sr?"flex-row items-center gap-3":"flex-col",W?"w-full":"inline-flex",$].filter(Boolean).join(" "),et=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",We.inputHeight,ar,Cr,A?"opacity-50":"",W?"w-full":"w-auto",K].filter(Boolean).join(" "),ke=["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",We.inputText,We.inputPadding,P].filter(Boolean).join(" ");return(0,je.jsxs)("div",{className:ve,children:[!Je&&Tr(),(0,je.jsxs)("div",{className:`flex flex-col ${W?"w-full":""}`,children:[(0,je.jsxs)("div",{ref:be,...he(),className:et,children:[Je&&Tr(),(0,je.jsx)("input",{ref:e,id:F,name:Y,type:"text",value:Q,onClick:()=>!A&&!O&&!ne&&ge(we=>!we),onKeyDown:Ue,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:ke}),(0,je.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ne&&le&&(0,je.jsx)("div",{className:"flex items-center justify-center shrink-0",children:$r((0,je.jsx)(Ce,{}))}),!ne&&_&&!A&&!O&&(0,je.jsx)("button",{type:"button",onClick:rr,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:br?0:-1,"aria-hidden":!br,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 ${We.icon} ${br?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,je.jsx)($e,{className:"size-full"})}),(0,je.jsx)("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:$r((0,je.jsx)(kr,{className:"size-full"}))})]})]}),Ee&&(0,je.jsx)(fr.FloatingPortal,{children:(0,je.jsx)(fr.FloatingFocusManager,{context:De,modal:!1,returnFocus:!0,children:(0,je.jsxs)("div",{ref:ce,id:re,style:{...pe,...ze,zIndex:xr.PICKER},...Ae(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${er} ${oe}`,children:[(0,je.jsxs)("div",{className:"flex flex-col",children:[(0,je.jsx)("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}),(0,je.jsx)(it,{value:E[0],onChange:sr,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"})]}),(0,je.jsxs)("div",{className:"flex flex-col",children:[(0,je.jsx)("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}),(0,je.jsx)(it,{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"})]})]})})}),(0,je.jsx)(Le,{id:j,helperText:D,errorMessage:V,sizeClassName:We.helper,className:B})]})]})}function tu(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}var zi=require("react"),pr=require("@floating-ui/react");function co(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 at(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 st(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=Pi(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 Jr(e,r="DD/MM/YYYY HH:mm:ss",t){return!e||isNaN(e.getTime())?"":_r(e,r,t)}function Pi(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 Ra={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Na={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},ou={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 nu={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"},Da={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"}};var _e=require("react/jsx-runtime");function tl({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=(0,zi.useId)(),Te=G||de,ye=`${Te}-error-helper`,J=`${Te}-popover`,E=co(h,p),I=n||E,fe=a||I,Q=r!==void 0,[xe,ge]=(0,zi.useState)(()=>st(t,I)),be=Q?st(r,I):xe,ce=be?Jr(be,fe,i):"",[pe,De]=(0,zi.useState)(l),[ue,Pe]=(0,zi.useState)(!1),{refs:{setReference:he,setFloating:Ae},floatingStyles:Ee,context:ze}=(0,pr.useFloating)({placement:X,open:ue&&!M&&!P&&!se,onOpenChange:Pe,whileElementsMounted:pr.autoUpdate,transform:!1,middleware:[(0,pr.offset)(6),(0,pr.flip)(),(0,pr.shift)({padding:8})]}),Ie=(0,pr.useDismiss)(ze,{escapeKey:!0,outsidePress:!0}),Ve=(0,pr.useRole)(ze,{role:"dialog"}),{getReferenceProps:We,getFloatingProps:ar}=(0,pr.useInteractions)([Ie,Ve]),{isMounted:er,styles:Cr}=(0,pr.useTransitionStyles)(ze,{duration:150,initial:({side:Be})=>({opacity:0,transform:Be==="top"?"translateY(4px) scale(0.96)":Be==="bottom"?"translateY(-4px) scale(0.96)":Be==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:Be})=>({opacity:0,transform:Be==="top"?"translateY(4px) scale(0.96)":Be==="bottom"?"translateY(-4px) scale(0.96)":Be==="left"?"translateX(4px) scale(0.96)":"translateX(-4px) scale(0.96)"})}),br=!!(W||A),sr=br?"error":N,te=w(C,ou,"md"),Ue=w(D,Ra,"lg"),rr=w(D,Na,"lg"),me=R==="other"?"":w(sr,w(R,Da,"outline"),"primary"),Je=!!be,Sr=Be=>{let Ar=at(Be,be||new Date);Q||ge(Ar);let Lt=Ar?Jr(Ar,I,i):"";o?.(Lt),re&&Pe(!1)},Tr=Be=>{if(!Be)return;let Ar=at(be||new Date,Be);Q||ge(Ar);let Lt=Ar?Jr(Ar,I,i):"";o?.(Lt),re&&Pe(!1)},$r=Be=>{M||P||se||(Be.key==="ArrowDown"||Be.key==="Enter"||Be.key===" "?(Be.preventDefault(),ue||Pe(!0)):Be.key==="Escape"&&ue&&(Be.preventDefault(),Pe(!1)))},ve=Be=>{Be.stopPropagation(),Q||ge(null),o?.(null),K?.()},et=L||fe,ke=Y==="floating",we=Y==="left",Dr=()=>{if(!V)return null;let Be=br?"text-error-600 font-bold":w(sr,nu,"primary");return ke?(0,_e.jsxs)("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} ${Be} ${ee}`,children:[V,_&&(0,_e.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,_e.jsxs)("label",{htmlFor:Te,className:`inline-flex items-center font-bold transition-colors duration-150 ${te.label} ${Be} ${ee}`,children:[V,_&&(0,_e.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Pr=Be=>(0,_e.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${te.icon}`,"aria-hidden":"true",children:Be}),Hr=["group/datetimepicker relative flex",we?"flex-row items-center gap-3":"flex-col",j?"w-full":"inline-flex",oe].filter(Boolean).join(" "),qo=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",te.inputHeight,Ue,me,M?"opacity-50":"",j?"w-full":"w-auto",q].filter(Boolean).join(" "),go=["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(0,_e.jsxs)("div",{className:Hr,children:[!ke&&Dr(),(0,_e.jsxs)("div",{className:`flex flex-col ${j?"w-full":""}`,children:[(0,_e.jsxs)("div",{ref:he,...We(),className:qo,children:[ke&&Dr(),(0,_e.jsx)("input",{ref:e,id:Te,name:O,type:"text",value:ce,onClick:()=>!M&&!P&&!se&&Pe(Be=>!Be),onKeyDown:$r,readOnly:!0,autoComplete:U,placeholder:et,disabled:M||se,role:"combobox","aria-expanded":ue&&!se,"aria-haspopup":"dialog","aria-controls":J,"aria-required":_,"aria-invalid":br,"aria-busy":se,"aria-disabled":M||se,"aria-describedby":z||A?ye:void 0,"aria-errormessage":A?ye:void 0,className:go}),(0,_e.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[se&&Z&&(0,_e.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Pr((0,_e.jsx)(Ce,{}))}),!se&&F&&!M&&!P&&(0,_e.jsx)("button",{type:"button",onClick:ve,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",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 ${te.icon} ${Je?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,_e.jsx)($e,{className:"size-full"})}),(0,_e.jsx)("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:Pr((0,_e.jsx)(kr,{className:"size-full"}))})]})]}),er&&(0,_e.jsx)(pr.FloatingPortal,{children:(0,_e.jsx)(pr.FloatingFocusManager,{context:ze,modal:!1,returnFocus:!0,children:(0,_e.jsxs)("div",{ref:Ae,id:J,style:{...Ee,...Cr,zIndex:xr.PICKER},...ar(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${rr} ${s==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${le}`,children:[(0,_e.jsx)("div",{className:"flex flex-col",children:(0,_e.jsx)(Wt,{value:be,onChange:Sr,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"})}),(0,_e.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,_e.jsx)(it,{value:be,onChange:Tr,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"})})]})})}),(0,_e.jsx)(Le,{id:ye,helperText:z,errorMessage:A,sizeClassName:te.helper,className:ne})]})]})}var uo=require("react"),gr=require("@floating-ui/react");var iu={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"}},au=Ra,su=Na;var lu=Da,cu={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"},uu={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"}};var He=require("react/jsx-runtime");function ol({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=(0,uo.useId)(),I=$||E,fe=`${I}-error-helper`,Q=`${I}-popover`,xe=co(S,T),ge=n||xe,be=a||ge,ce=r!==void 0,[pe,De]=(0,uo.useState)(()=>{let Re=t;return Re&&Array.isArray(Re)?[st(Re[0],ge),st(Re[1],ge)]:[null,null]}),ue=ce?r&&Array.isArray(r)?[st(r[0],ge),st(r[1],ge)]:[null,null]:pe,[Pe,he]=(0,uo.useState)("start"),[Ae,Ee]=(0,uo.useState)(x),[ze,Ie]=(0,uo.useState)(!1),Ve=ue[0]?Jr(ue[0],be,m):"",We=ue[1]?Jr(ue[1],be,m):"",ar=(0,uo.useMemo)(()=>Ve&&We?`${Ve}${s}${We}`:Ve?`${Ve}${s}`:"",[Ve,We,s]),{refs:{setReference:er,setFloating:Cr},floatingStyles:br,context:sr}=(0,gr.useFloating)({placement:ee,open:ze&&!X&&!B&&!re,onOpenChange:Ie,whileElementsMounted:gr.autoUpdate,transform:!1,middleware:[(0,gr.offset)(6),(0,gr.flip)(),(0,gr.shift)({padding:8})]}),te=(0,gr.useDismiss)(sr,{escapeKey:!0,outsidePress:!0}),Ue=(0,gr.useRole)(sr,{role:"dialog"}),{getReferenceProps:rr,getFloatingProps:me}=(0,gr.useInteractions)([te,Ue]),{isMounted:Je,styles:Sr}=(0,gr.useTransitionStyles)(sr,{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)"})}),Tr=!!(j||M),$r=Tr?"error":Y,ve=w(D,iu,"md"),et=w(L,au,"lg"),ke=w(L,su,"lg"),we=w($r,uu,"primary"),Dr=V==="other"?"":w($r,w(V,lu,"outline"),"primary"),Pr=!!(ue[0]||ue[1]),Hr=Re=>{ce||De(Re);let jr=Re[0]?Jr(Re[0],ge,m):"",dt=Re[1]?Jr(Re[1],ge,m):"";o?.(jr||dt?[jr,dt]:null),Te&&Re[0]&&Re[1]&&Ie(!1)},qo=Re=>{if(Pe==="start"){let jr=at(Re,ue[0]||new Date),dt=ue[1];dt&&jr&&jr.getTime()>dt.getTime()&&(dt=null),Hr([jr,dt])}else{let jr=at(Re,ue[1]||ue[0]||new Date);Hr([ue[0],jr])}},go=Re=>{if(Re)if(Pe==="start"){let jr=at(ue[0]||new Date,Re),dt=ue[1];dt&&jr&&jr.getTime()>dt.getTime()&&(dt=null),Hr([jr,dt])}else{let jr=at(ue[1]||ue[0]||new Date,Re);Hr([ue[0],jr])}},Be=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)))},Ar=Re=>{Re.stopPropagation(),ce||De([null,null]),o?.(null),q?.()},Lt=O||(G?`${G[0]}${s}${G[1]}`:`${be}${s}${be}`),H=A==="floating",ae=A==="left",Ne=()=>{if(!z)return null;let Re=Tr?"text-error-600 font-bold":w($r,cu,"primary");return H?(0,He.jsxs)("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&&(0,He.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,He.jsxs)("label",{htmlFor:I,className:`inline-flex items-center font-bold transition-colors duration-150 ${ve.label} ${Re} ${W}`,children:[z,F&&(0,He.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})},Ge=Re=>(0,He.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ve.icon}`,"aria-hidden":"true",children:Re}),Ke=["group/datetimerangepicker relative flex",ae?"flex-row items-center gap-3":"flex-col",de?"w-full":"inline-flex",le].filter(Boolean).join(" "),Ze=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",ve.inputHeight,et,Dr,X?"opacity-50":"",de?"w-full":ve.minWidth||"min-w-80",_].filter(Boolean).join(" "),mo=["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(" "),Ru=Pe==="start"?ue[0]:ue[1];return(0,He.jsxs)("div",{className:Ke,children:[!H&&Ne(),(0,He.jsxs)("div",{className:`flex flex-col ${de?"w-full":""}`,children:[(0,He.jsxs)("div",{ref:er,...rr(),className:Ze,children:[H&&Ne(),(0,He.jsx)("input",{ref:e,id:I,name:P,type:"text",value:ar,onClick:()=>!X&&!B&&!re&&Ie(Re=>!Re),onKeyDown:Be,readOnly:!0,autoComplete:K,placeholder:Lt,disabled:X||re,role:"combobox","aria-expanded":ze&&!re,"aria-haspopup":"dialog","aria-controls":Q,"aria-required":F,"aria-invalid":Tr,"aria-busy":re,"aria-disabled":X||re,"aria-describedby":U||M?fe:void 0,"aria-errormessage":M?fe:void 0,className:mo}),(0,He.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[re&&Se&&(0,He.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Ge((0,He.jsx)(Ce,{}))}),!re&&ie&&!X&&!B&&(0,He.jsx)("button",{type:"button",onClick:Ar,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:Pr?0:-1,"aria-hidden":!Pr,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} ${Pr?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,He.jsx)($e,{className:"size-full"})}),(0,He.jsx)("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:Ge((0,He.jsx)(kr,{className:"size-full"}))})]})]}),Je&&(0,He.jsx)(gr.FloatingPortal,{children:(0,He.jsx)(gr.FloatingFocusManager,{context:sr,modal:!1,returnFocus:!0,children:(0,He.jsxs)("div",{ref:Cr,id:Q,style:{...br,...Sr,zIndex:xr.PICKER},...me(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ke} ${Z}`,children:[(0,He.jsxs)("div",{className:`flex ${b==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[(0,He.jsx)("div",{className:"flex flex-col",children:(0,He.jsx)(Wt,{value:Ru,onChange:qo,view:Ae,onViewChange:Ee,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}`)}),(0,He.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,He.jsx)(it,{value:Ru||ue[0],onChange:go,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}`)})]}),(0,He.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[(0,He.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,He.jsxs)("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]}),(0,He.jsxs)("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"]})]}),(0,He.jsx)("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"})]})]})})}),(0,He.jsx)(Le,{id:fe,helperText:U,errorMessage:M,sizeClassName:ve.helper,className:se})]})]})}var Zd=Ft(require("react"),1),qd=Ft(require("next/image"),1);var nl={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"}},il={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"}};var Ii=require("react/jsx-runtime");function Mn({preset:e="default",...r}){switch(e){case"search":return(0,Ii.jsx)(fs,{...r});case"error":return(0,Ii.jsx)(ps,{...r});case"folder":return(0,Ii.jsx)(gs,{...r});case"simple":return(0,Ii.jsx)(ms,{...r});default:return(0,Ii.jsx)(ds,{...r})}}var xt=require("react/jsx-runtime"),Z0=["default","search","error","folder","simple"];function q0(e){return typeof e=="string"&&Z0.includes(e)}function J0(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 Mi({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=nl[e]||nl.md,T=il[r]||il.vertical,k=o?{width:typeof o=="number"?`${o}px`:o,height:typeof o=="number"?`${o}px`:o}:{},g=()=>{if(!t)return null;if(q0(t))return(0,xt.jsx)(Mn,{preset:t});if(J0(t)){let D=typeof o=="number"?o:S.defaultImageSize;return(0,xt.jsx)(qd.default,{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 Zd.default.isValidElement(t)?t:(0,xt.jsx)(Mn,{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(0,xt.jsxs)("div",{ref:p,role:h,"aria-live":"polite",className:u,...y,children:[t&&(0,xt.jsx)("div",{className:d,style:k,"aria-hidden":"true",children:g()}),(s||l||m||c)&&(0,xt.jsxs)("div",{className:v,children:[s&&(0,xt.jsx)("div",{className:C,children:s}),l&&(0,xt.jsx)("div",{className:R,children:l}),m&&(0,xt.jsx)("div",{className:N,children:m}),c&&(0,xt.jsx)("div",{className:"mt-2 w-full",children:c})]})]})}var ir=require("react"),wr=require("@floating-ui/react"),sl=require("@tanstack/match-sorter-utils");var Vo={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"}},Pa={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Jd={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},za={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"}},du={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"},fu={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"},pu={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"}};var Qd=require("react");var mr=require("react/jsx-runtime");function Q0({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=(0,Qd.useRef)(null),z=Vo[o]||Vo.md,A=Pa[s]||Pa.md,O=Jd[s]||"md",U=!!m?"error":a,M=n==="other"?"":za[n]?.[U]||za.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(0,mr.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:C(x?r:r[0])});if(x)return(0,mr.jsxs)("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[X.map(le=>(0,mr.jsx)(Bt,{size:z.badgeSize,variant:"soft",color:a,radius:O,onDelete:!l&&!b&&!Y&&S?()=>S(le):void 0,className:"max-w-full truncate",children:(0,mr.jsx)("span",{className:"truncate",children:le.label})},String(le.value))),B>0&&(0,mr.jsxs)(Bt,{size:z.badgeSize,variant:"soft",color:"neutral",radius:O,children:["+",B]}),P&&!l&&!b&&!Y?(0,mr.jsx)("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:(0,mr.jsx)("span",{className:"text-neutral-400 truncate",children:i})]});let ne=r[0];return P&&!l&&!b&&!Y?(0,mr.jsx)("div",{className:"relative flex-1 min-w-0 flex items-center",children:(0,mr.jsx)("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}`})}):(0,mr.jsx)("div",{className:"flex-1 min-w-0 truncate",children:ne?(0,mr.jsx)("span",{className:"text-neutral-900",children:ne.label}):(0,mr.jsx)("span",{className:"text-neutral-400",children:i})})},ee=l?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return(0,mr.jsxs)("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&&(0,mr.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:u}),q(),(0,mr.jsxs)("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[Y&&(0,mr.jsx)(Ce,{className:`${z.icon} animate-spin text-current`}),K&&!Y&&(0,mr.jsx)("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:(0,mr.jsx)($e,{className:"size-3.5"})}),v,(0,mr.jsx)("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:(0,mr.jsx)(kr,{className:z.icon})})]})]})}var Ia=Q0;var e0=require("@floating-ui/react");var Mt=require("react/jsx-runtime");function ef({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=Vo[o]||Vo.md,c=a==="none"?"rounded-none":o==="lg"||o==="xl"?"rounded-lg":"rounded-md",f=s||e.disabled;if(i)return(0,Mt.jsx)("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?du[n]||du.primary:"text-neutral-800 hover:bg-neutral-100",p=t&&!r?fu[n]||fu.primary:"";return(0,Mt.jsxs)("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:[(0,Mt.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&(0,Mt.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),(0,Mt.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,Mt.jsx)("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&(0,Mt.jsx)("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),r&&(0,Mt.jsx)("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:(0,Mt.jsx)(Zt,{className:"size-3.5"})})]})}var Ma=ef;var Lr=require("react/jsx-runtime");function rf({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(0,Lr.jsx)(Ct,{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(0,Lr.jsx)(Ct,{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(0,Lr.jsx)(Si,{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(0,Lr.jsx)(Di,{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(0,Lr.jsxs)("div",{className:"flex flex-col gap-1.5",children:[c.label&&(0,Lr.jsx)("span",{className:"text-xs font-medium text-zinc-700 dark:text-zinc-300",children:c.label}),(0,Lr.jsx)(_n,{size:"sm",color:l,value:f||[],onChange:h=>t(c.name,h),...c.props||{},children:(0,Lr.jsx)("div",{className:"flex flex-wrap gap-2",children:c.options?.map(h=>(0,Lr.jsx)(Xn,{value:String(h.value),disabled:h.disabled,size:"sm",color:l,label:h.label},String(h.value)))})})]});default:return null}};return(0,Lr.jsxs)("div",{className:"p-2.5 border-b border-neutral-200 bg-neutral-50/70 rounded-t-lg",children:[(0,Lr.jsx)("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(0,Lr.jsx)("div",{className:`w-full ${f}`,children:m(c)},c.name)})}),s&&o&&(0,Lr.jsx)("div",{className:"flex justify-end mt-2 pt-2 border-t border-neutral-200",children:(0,Lr.jsx)(wt,{size:"xs",variant:"ghost",onClick:o,className:"text-[11px] h-6 px-2 text-neutral-500 hover:text-neutral-900",children:i})})]})}var Ea=rf;var vt=require("react/jsx-runtime"),tf={};function of({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=tf,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=(0,vt.jsxs)("div",{ref:N,style:{...R,zIndex:xr.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&&(0,vt.jsx)(Ea,{filters:h,values:p,onChange:g,onReset:d,layout:y,gridCols:S,showReset:T,resetText:k,color:a,radius:s}),(0,vt.jsx)("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?(0,vt.jsxs)("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[(0,vt.jsx)(Ce,{className:"size-4 animate-spin text-current"}),(0,vt.jsx)("span",{children:"Loading..."})]}):(0,vt.jsx)("div",{className:"py-4 px-2",children:(0,vt.jsx)(Mi,{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(0,vt.jsx)(Ma,{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?(0,vt.jsx)(e0.FloatingPortal,{children:z}):z}var $a=of;var fo=require("react");function al(e,r=300){let t=(0,fo.useRef)(e),o=(0,fo.useRef)(null);(0,fo.useEffect)(()=>{t.current=e},[e]);let n=(0,fo.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);return(0,fo.useEffect)(()=>n,[n]),{debounced:(0,fo.useCallback)((...s)=>{n(),o.current=setTimeout(()=>{t.current(...s)},r)},[n,r]),cancel:n}}var Qr=require("react/jsx-runtime"),nf=[];function af(e){return!!e.multiple}function ll(e){let{ref:r,options:t=nf,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=af(e),re=!!($??P),Se=j?null:e,ie=j?e:null,[de,Te]=(0,ir.useState)(Se?.defaultValue??null),[ye,J]=(0,ir.useState)(ie?.defaultValue??[]),E=Se?.value!==void 0,I=ie?.value!==void 0,fe=ie?.value,Q=(0,ir.useMemo)(()=>I?fe??[]:ye,[I,fe,ye]),xe=Se?.value,ge=(0,ir.useMemo)(()=>E?xe??null:de,[E,xe,de]),be=(0,ir.useRef)(new Map);(0,ir.useEffect)(()=>{t.forEach(H=>{be.current.set(H.value,H)})},[t]);let ce=(0,ir.useMemo)(()=>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]=(0,ir.useState)(!1),[ue,Pe]=(0,ir.useState)(null),[he,Ae]=(0,ir.useState)(""),Ee=v!==void 0,ze=Ee?v:he,{debounced:Ie}=al((H,ae)=>{g==="server"&&G?.(H,ae)},U),Ve=H=>{Ee||Ae(H),C?.(H),pe||De(!0),Ie(H,er)},[We,ar]=(0,ir.useState)(()=>{let H={};return R?.forEach(ae=>{ae.defaultValue!==void 0&&(H[ae.name]=ae.defaultValue)}),H}),er=N??We,Cr=(H,ae)=>{let Ne={...er,[H]:ae};N||ar(Ne),z?.(Ne),Ie(ze,Ne)},br=()=>{let H={};R?.forEach(ae=>{ae.defaultValue!==void 0&&(H[ae.name]=ae.defaultValue)}),N||ar(H),z?.(H),Ie(ze,H)},sr=(0,ir.useMemo)(()=>{if(g==="server")return t;let H=t,ae=ze.trim();if(ae){let Ne=[],Ge=[Ke=>Ke.label,Ke=>String(Ke.value),Ke=>String(Ke.description||"")];for(let Ke of H){let Ze=(0,sl.rankItem)(Ke,ae,{accessors:Ge});Ze.passed&&Ne.push({item:Ke,info:Ze})}Ne.sort((Ke,Ze)=>(0,sl.compareItems)(Ke.info,Ze.info)),H=Ne.map(Ke=>Ke.item)}return M&&(H=H.filter(Ne=>M(Ne,ze,er))),H},[t,g,ze,M,er]),te=(0,ir.useRef)([]),Ue=!!(p||y),rr=!h&&!Ue,{refs:me,floatingStyles:Je,context:Sr}=(0,wr.useFloating)({placement:q,open:pe&&rr,onOpenChange:H=>{rr&&(!re||pe||!H)&&(De(H),H||(Pe(null),!Ee&&!j&&Ae("")))},whileElementsMounted:wr.autoUpdate,transform:!1,middleware:[(0,wr.offset)(4),(0,wr.flip)(),(0,wr.shift)({padding:8})]}),Tr=(0,wr.useClick)(Sr,{enabled:rr&&(!re||pe)}),$r=(0,wr.useDismiss)(Sr),ve=(0,wr.useRole)(Sr,{role:"listbox"}),et=(0,wr.useListNavigation)(Sr,{listRef:te,activeIndex:ue,onNavigate:Pe,loop:!0}),{getReferenceProps:ke,getFloatingProps:we}=(0,wr.useInteractions)([Tr,$r,ve,et]),Dr=(0,ir.useCallback)(H=>{if(!(H.disabled||h||p))if(be.current.set(H.value,H),j){let ae=e,Ge=Q.includes(H.value)?Q.filter(Ze=>Ze!==H.value):[...Q,H.value];I||J(Ge);let Ke=Ge.map(Ze=>t.find(mo=>mo.value===Ze)||be.current.get(Ze)||{value:Ze,label:String(Ze)});ae.onChange?.(Ge,Ke),Ee||Ae("")}else{let ae=e;E||Te(H.value),ae.onChange?.(H.value,H),De(!1),Ee||Ae("")}},[j,h,p,e,Q,I,t,Ee,E]),Pr=(0,ir.useCallback)(H=>{if(h||p||!j)return;let ae=Q.filter(Ge=>Ge!==H.value);I||J(ae);let Ne=ae.map(Ge=>t.find(Ke=>Ke.value===Ge)||be.current.get(Ge)||{value:Ge,label:String(Ge)});j&&e.onChange?.(ae,Ne)},[h,p,j,Q,I,t,e]),Hr=(0,ir.useCallback)(H=>{H.stopPropagation(),!(h||p)&&(j?(I||J([]),e.onChange?.([],[])):(E||Te(null),e.onChange?.(null,null)),Ee||Ae(""))},[h,p,j,e,I,E,Ee]),qo=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&&Pr(Ne)}else if(H.key==="Enter"&&pe&&ue!==null){H.preventDefault();let Ne=sr[ue];Ne&&Dr(Ne)}else H.key==="ArrowDown"&&!pe&&De(!0)},go=pu[b]||pu.top,Be=(0,ir.useId)(),Lt=`${i||Be}-trigger`;return(0,Qr.jsxs)("div",{ref:r,id:i,className:`${go.container} ${se}`,"data-disabled":h,"data-invalid":f,children:[l&&(0,Qr.jsxs)("label",{htmlFor:Lt,className:go.label,children:[l,S&&(0,Qr.jsx)("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Qr.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,Qr.jsx)(Ia,{id:Lt,triggerRef:me.setReference,getReferenceProps:ke,selectedOptions:ce,isOpen:pe,size:o,variant:n,color:a,radius:s,placeholder:u||m,disabled:h,readOnly:Ue,isInvalid:f,multiple:j,maxTagCount:j?e.maxTagCount:void 0,searchable:k,searchPlacement:d,searchValue:ze,onSearchChange:Ve,onRemoveTag:Pr,onClear:Hr,clearable:B,loading:re,startContent:ne,endContent:le,renderValue:_,onKeyDown:qo,className:Z}),(0,Qr.jsx)($a,{isOpen:pe,options:sr,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:er,menuFilterLayout:D,menuFilterGridCols:V,showResetFilters:Y,resetFiltersText:L,onMenuFilterChange:Cr,onResetFilters:br,renderOption:W,onSelectOption:Dr,onOptionMouseEnter:Pe,floatingRef:me.setFloating,floatingStyles:Je,getFloatingProps:we,listElementsRef:te,className:F})]}),T&&(0,Qr.jsx)(Qr.Fragment,{children:j?Q.map((H,ae)=>(0,Qr.jsx)("input",{type:"hidden",name:`${T}[]`,value:String(H)},`${T}-${H}-${ae}`)):ge!=null?(0,Qr.jsx)("input",{type:"hidden",name:T,value:String(ge)}):null}),(c||x)&&(0,Qr.jsx)("div",{className:`text-xs ${f?"text-error-600 font-normal":"text-neutral-500 font-normal"}`,children:c||x})]})}var gu=ll;var cl=require("react");function r0(e,r=300){let[t,o]=(0,cl.useState)(e);return(0,cl.useEffect)(()=>{let n=setTimeout(()=>{o(e)},r);return()=>{clearTimeout(n)}},[e,r]),t}var ct=require("react");var Ei={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},mu={xs:"sm",sm:"sm",md:"md",lg:"lg",xl:"xl"},En={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"}},bu={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 ul(){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 fl(e){return e?typeof e=="string"?[{id:ul(),name:e.split("/").pop()||"image.png",url:e,status:"success"}]:Array.isArray(e)?e.map(r=>typeof r=="string"?{id:ul(),name:r.split("/").pop()||"image.png",url:r,status:"success"}:r):[e]:[]}function La(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 Fa(e,r){return{id:ul(),name:e.name,size:e.size,type:e.type,url:r,file:e,status:"success"}}function hu(e){if(e?.url&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}}var ml=require("react");var Ba=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],Va=["pdf"],Ha=["mp4","webm","ogg","mov","avi","mkv"],Aa=["mp3","wav","ogg","aac","flac","m4a"],Ga=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function po(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 $n(e=""){let r=pl(e);return Ba.includes(r)?"image":Va.includes(r)?"pdf":Ha.includes(r)?"video":Aa.includes(r)?"audio":Ga.includes(r)?"document":"other"}function Ho(e){return e?e instanceof File?{name:po(e.name),type:$n(e.name),file:e,serverFile:void 0}:{name:e.name??po(e?.src),type:$n(e?.src),file:void 0,serverFile:e}:{name:"file",type:"other",file:void 0,serverFile:void 0}}function Ln(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)}var gl=require("react"),xu=(0,gl.createContext)(null),Ya=()=>(0,gl.useContext)(xu);var Oa=require("react"),t0=Ft(require("react-easy-crop"),1);var Er=require("react/jsx-runtime");function $i({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&&Ln(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(0,Er.jsxs)("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&&(0,Er.jsx)("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=5,onClick:r,className:T,children:(0,Er.jsx)(un,{width:18,height:18})}),x&&(0,Er.jsx)("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=.2,onClick:t,className:T,children:(0,Er.jsx)(dn,{width:18,height:18})}),c&&(0,Er.jsxs)("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)&&(0,Er.jsx)("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),f&&(0,Er.jsx)("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:(0,Er.jsx)(pn,{width:18,height:18})}),f&&(0,Er.jsx)("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:(0,Er.jsx)(fn,{width:18,height:18})}),h&&(0,Er.jsx)("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:a,className:T,children:(0,Er.jsx)(gn,{width:18,height:18})}),p&&(0,Er.jsx)("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i xu\u1ED1ng",onClick:S,className:T,children:(0,Er.jsx)(Co,{width:18,height:18})})]})}var Fn=require("react/jsx-runtime");function Li({src:e,name:r,minZoom:t=.2,maxZoom:o=5,showToolbar:n=!0,toolbarProps:a,children:s}){let[i,l]=(0,Oa.useState)({x:0,y:0}),[b,m]=(0,Oa.useState)(1),[x,c]=(0,Oa.useState)(0),[f,h]=(0,Oa.useState)(!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?(0,Fn.jsxs)("div",{className:"flex flex-col w-full select-none",children:[(0,Fn.jsx)("div",{className:"relative w-full h-90 overflow-hidden bg-neutral-50/70 select-none",children:(0,Fn.jsx)(t0.default,{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&&(0,Fn.jsx)("div",{className:"w-full flex items-center justify-center py-3 border-t border-neutral-200 bg-neutral-white z-20",children:(0,Fn.jsx)($i,{zoom:b,rotation:x,isFlipped:f,onZoomIn:p,onZoomOut:y,onRotateCw:S,onRotateCcw:T,onFlipHorizontal:k,onReset:g,currentImage:d,...a})}),s]}):null}var Et=require("react/jsx-runtime");function Fi({onDownload:e,imageProps:r,className:t=""}){let o=Ya(),n=o?.file,a=o?.headerTitle,[s,i]=(0,ml.useState)("");(0,ml.useEffect)(()=>{if(!n){i("");return}if(!(n instanceof File)){let c=Ho(n);i(c.serverFile?.src||"");return}let x=URL.createObjectURL(n);return i(x),()=>{URL.revokeObjectURL(x)}},[n]);let l=Ho(n),b=(typeof a=="string"?a:"")||l.name||"file",m=()=>{e&&n&&e(n),s&&Ln(s,b)};return l.type==="image"?(0,Et.jsx)(Li,{src:s,name:b,...r}):(0,Et.jsxs)("div",{className:`p-6 text-center ${t}`,children:[(0,Et.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:(0,Et.jsx)(Co,{width:32,height:32})}),(0,Et.jsx)("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:b,children:a??b}),(0,Et.jsx)("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."}),(0,Et.jsxs)("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:[(0,Et.jsx)(Co,{width:18,height:18}),(0,Et.jsx)("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}var s0=require("react");var o0=250,Ao={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"}},n0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};var bl=require("react"),vu=(0,bl.createContext)(null),lt=()=>(0,bl.useContext)(vu);var i0=require("react/jsx-runtime");function Go({size:e,radius:r,className:t="",children:o,ref:n,...a}){let s=lt(),i=w(e??s?.size,Ao,"md"),l=w(r,n0,"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(0,i0.jsx)("div",{ref:n,tabIndex:-1,className:b,...a,children:o})}var Fr=require("react");var Bi=require("react/jsx-runtime");function Yo({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=(0,Fr.useRef)(null),[f,h]=(0,Fr.useState)(!1),p=(0,Fr.useRef)(null),y=(0,Fr.useCallback)(()=>{f||o||(h(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h(!1),m?.()},o0))},[f,o,m]),S=(0,Fr.useMemo)(()=>({onClose:y,isLoading:o,size:t}),[y,o,t]);(0,Fr.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]),(0,Fr.useEffect)(()=>{let u=c.current;if(u)if(e||f){if(!u.open)try{u.showModal()}catch{}}else u.open&&u.close()},[e,f]),(0,Fr.useEffect)(()=>{if(!s)return;let u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);let T=(0,Fr.useEffectEvent)(u=>{!e||a===!1||u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),y())});if((0,Fr.useEffect)(()=>(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(0,Bi.jsx)(vu.Provider,{value:S,children:(0,Bi.jsxs)("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:[(0,Bi.jsx)("div",{"aria-hidden":"true",onClick:k,className:"fixed inset-0 -z-10"}),(0,Bi.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${d} ${l}`,children:b})]})})}var Oo=require("react/jsx-runtime");function Uo({size:e,title:r,description:t,titleClassName:o="",descriptionClassName:n="",showCloseButton:a=!0,onClose:s,closeButtonClassName:i="",className:l="",children:b,...m}){let x=lt(),c=w(e??x?.size,Ao,"md"),f=x?.isLoading,h=()=>{s?.(),x?.onClose?.()},p=!!(s||x?.onClose);return(0,Oo.jsxs)("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${c.header} ${l}`,...m,children:[(0,Oo.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[r&&(0,Oo.jsx)("h3",{id:"modal-dialog-title",className:`${c.title} truncate ${o}`,children:r}),t&&(0,Oo.jsx)("p",{id:"modal-dialog-description",className:`${c.description} mt-0.5 ${n}`,children:t}),b]}),a&&p&&(0,Oo.jsx)("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:(0,Oo.jsx)($e,{className:c.closeIcon})})]})}var a0=require("react/jsx-runtime");function jo({size:e,className:r="",children:t,...o}){let n=lt(),a=w(e??n?.size,Ao,"md");return(0,a0.jsx)("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${a.body} ${r}`,...o,children:t})}var Wo=require("react/jsx-runtime");function Ko({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=Ho(t),p=o??h?.name,y=(0,s0.useMemo)(()=>({file:t,headerTitle:p}),[t,p]);return(0,Wo.jsx)(Yo,{open:e,onClose:r,size:a,closeOnOverlayClick:l,closeOnEsc:b,lockScroll:m,overlayClassName:c,children:(0,Wo.jsxs)(Go,{radius:s,className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${x}`,children:[(p||i)&&(0,Wo.jsx)(Uo,{title:p,description:n,showCloseButton:i,className:"px-5 py-3.5 border-b border-neutral-200"}),(0,Wo.jsx)(jo,{children:(0,Wo.jsx)(xu.Provider,{value:y,children:f||(0,Wo.jsx)(Fi,{})})})]})})}var $t=require("react/jsx-runtime");function Vi({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=En[e],S=o?Ei[o]:Ei[mu[e]],T=b?"error":r,k=t!=="other"?bu[t][T]:null;return(0,$t.jsx)("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?(0,$t.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${k?.iconColor||"text-primary-600"}`,children:[(0,$t.jsx)(Ce,{width:y.iconSize*.8,height:y.iconSize*.8}),(0,$t.jsx)("span",{className:`${y.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):(0,$t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,$t.jsx)("div",{className:`transition-colors ${k?.iconColor||"text-primary-500"}`,children:c||(0,$t.jsx)(Tt,{width:y.iconSize,height:y.iconSize})}),(0,$t.jsx)("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"}),(0,$t.jsx)("div",{id:p,className:`${y.descSize} text-neutral-500`,children:x??"H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF"})]})})}var wu=require("react"),l0=Ft(require("next/image"),1);var yu={pulse:"animate-pulse",wave:"skeleton-wave",none:""},Bn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"};var hl=require("react/jsx-runtime");function Hi({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=yu[e]??"",x=r==="circle"?"rounded-full":Bn[t]??Bn.md,c=p=>p,f={width:c(o),height:c(n),...l},h=["bg-neutral-200",m,x].filter(Boolean).join(" ");return a>1?(0,hl.jsx)("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(0,hl.jsx)("div",{className:h,style:{width:S?"60%":c(o)??"100%",height:c(n)}},y)})}):(0,hl.jsx)("div",{role:"status","aria-label":"Loading...",className:[h,i].filter(Boolean).join(" "),style:f,...b})}var Vn=require("react/jsx-runtime");function Xo({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]=(0,wu.useState)(!1),[y,S]=(0,wu.useState)(!1),T=Bn[s]??Bn.md,k=u=>{p(!0),x?.(u)},g=u=>{S(!0),p(!1),c?.(u)},d={...n?{}:{width:t,height:o},...m};return(0,Vn.jsxs)("div",{"data-testid":"loading-image-wrapper",className:["relative overflow-hidden inline-block",T,l].filter(Boolean).join(" "),style:d,children:[!h&&!y&&(0,Vn.jsx)(Hi,{"data-testid":"loading-image-skeleton",variant:a,radius:s,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),e&&(0,Vn.jsx)(l0.default,{"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&&(0,Vn.jsx)("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:(0,Vn.jsx)(sa,{width:24,height:24,"aria-hidden":"true"})})]})}var Nr=require("react/jsx-runtime");function _o({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=En[r],f=Ei[t],h=!a||e.length<a;return(0,Nr.jsxs)("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(0,Nr.jsx)("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(0,Nr.jsxs)("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?(0,Nr.jsx)(Xo,{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"}):(0,Nr.jsx)("div",{className:"text-xs text-neutral-400 p-1 text-center truncate",children:p.name}),S&&(0,Nr.jsxs)("div",{className:"absolute inset-0 bg-neutral-900/50 flex flex-col items-center justify-center text-neutral-white",children:[(0,Nr.jsx)(Ce,{width:18,height:18}),typeof p.progress=="number"&&(0,Nr.jsxs)("span",{className:"text-xs mt-1 font-medium",children:[Math.round(p.progress),"%"]})]}),!S&&!o&&(0,Nr.jsxs)("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&&(0,Nr.jsx)("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:(0,Nr.jsx)(Un,{width:16,height:16})}),!n&&(0,Nr.jsx)("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:(0,Nr.jsx)(bn,{width:16,height:16})})]})]},p.id)}),m&&h&&!n&&(0,Nr.jsx)("li",{className:"list-none",children:(0,Nr.jsx)("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:(0,Nr.jsx)(Jo,{width:c.iconSize*.5,height:c.iconSize*.5})})})]})}var vr=require("react/jsx-runtime");function sf(e){e.preventDefault(),e.stopPropagation()}function xl({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=(0,ct.useId)(),O=`${A}-input`,G=`${A}-helper`,U=`${A}-error`,M=(0,ct.useRef)(null),[P,$]=(0,ct.useState)(()=>fl(e!==void 0?e:r));(0,ct.useEffect)(()=>{e!==void 0&&$(fl(e))},[e]);let[K,X]=(0,ct.useState)(!1),B=(0,ct.useRef)(0),[oe,q]=(0,ct.useState)(null),[ee,ne]=(0,ct.useState)(null),[le,_]=(0,ct.useState)(""),W=En[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=La(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 Fa(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(0,vr.jsxs)("div",{className:`relative flex flex-col w-full ${V}`,onDragEnter:de,onDragLeave:Te,onDragOver:sf,onDrop:ye,children:[(0,vr.jsx)("input",{ref:M,id:O,type:"file",multiple:a,accept:l,disabled:g,"aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:ie}),(0,vr.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:le}),y&&(0,vr.jsx)("label",{htmlFor:O,className:`block font-medium text-neutral-800 ${W.labelSize}`,children:y}),(0,vr.jsxs)("div",{className:"flex flex-col gap-3",children:[m==="dropzone"&&(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(Vi,{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&&(0,vr.jsx)(_o,{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"&&(0,vr.jsx)(_o,{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"&&(0,vr.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,vr.jsx)("div",{className:"flex items-center gap-3",children:(0,vr.jsx)(wt,{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:(0,vr.jsx)(Tt,{width:W.iconSize*.5,height:W.iconSize*.5}),"aria-label":z||"T\u1EA3i \u1EA3nh l\xEAn",children:N})}),P.length>0&&(0,vr.jsx)(_o,{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?(0,vr.jsx)("p",{id:U,role:"alert",className:`font-medium text-error-600 ${W.helperSize}`,children:Z}):S?(0,vr.jsx)("p",{id:G,className:`text-neutral-500 ${W.helperSize}`,children:S}):null,ee&&(0,vr.jsx)(Ko,{open:!!ee,onClose:()=>ne(null),file:ee.file??(ee.url?{url:ee.url,name:ee.name}:void 0)})]})}var Br=require("react");var Cu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},vl={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"}},yl={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 wl(e){return e?typeof e=="string"?{url:e,name:po(e)||"avatar",type:$n(e)}:e:null}function ku(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}}var yt=require("react"),g0=Ft(require("react-easy-crop"),1);function c0(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 u0(e){return e*Math.PI/180}function d0(e,r,t){let o=u0(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 Su(e,r,t=0,o=!1,n="avatar-cropped.png",a="image/png"){let s=await c0(e),i=document.createElement("canvas"),l=i.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let b=u0(t),{width:m,height:x}=d0(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)})}var f0=require("react/jsx-runtime");function Cl({size:e,className:r="",children:t,...o}){let n=lt(),a=w(e??n?.size,Ao,"md");return(0,f0.jsx)("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${a.footer} ${a.buttonGap} ${r}`,...o,children:t})}var kl=require("react");var p0=require("react/jsx-runtime");function Sl({children:e,asChild:r=!0,onClick:t,...o}){let n=lt(),a=n?.isLoading,s=i=>{t?.(i),i.defaultPrevented||n?.onClose?.()};if(r&&(0,kl.isValidElement)(e)){let i=e;return(0,kl.cloneElement)(i,{disabled:i.props.disabled||a,onClick:l=>{i.props.onClick?.(l),s(l)},...o})}return(0,p0.jsx)("button",{type:"button",onClick:s,disabled:a,...o,children:e})}var Fe=require("react/jsx-runtime");function Tl({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=(0,yt.useRef)(null),[x,c]=(0,yt.useState)(e),[f,h]=(0,yt.useState)(r),[p,y]=(0,yt.useState)(t),[S,T]=(0,yt.useState)({x:0,y:0}),[k,g]=(0,yt.useState)(1),[d,u]=(0,yt.useState)(0),[v,C]=(0,yt.useState)(!1),[R,N]=(0,yt.useState)(null),[D,V]=(0,yt.useState)(!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 Su(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(0,Fe.jsxs)("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[(0,Fe.jsx)("input",{ref:m,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:M}),(0,Fe.jsx)("div",{className:"relative w-full h-80 md:h-90 bg-neutral-950 overflow-hidden select-none",children:(0,Fe.jsx)(g0.default,{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%"}}})}),(0,Fe.jsx)("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:(0,Fe.jsxs)("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:[(0,Fe.jsx)("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:(0,Fe.jsx)(Tt,{width:16,height:16})}),(0,Fe.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Fe.jsx)("button",{type:"button",onClick:L,disabled:k<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:X,children:(0,Fe.jsx)(dn,{width:16,height:16})}),(0,Fe.jsx)("button",{type:"button",onClick:Y,disabled:k>=i,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:X,children:(0,Fe.jsx)(un,{width:16,height:16})}),(0,Fe.jsx)("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:(0,Fe.jsx)(pn,{width:16,height:16})}),(0,Fe.jsx)("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:(0,Fe.jsx)(fn,{width:16,height:16})}),(0,Fe.jsx)("button",{type:"button",onClick:O,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:X,children:(0,Fe.jsx)(gn,{width:16,height:16})}),(0,Fe.jsx)("button",{type:"button",onClick:G,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:X,children:(0,Fe.jsx)(aa,{width:16,height:16})}),(0,Fe.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Fe.jsx)("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:(0,Fe.jsx)($e,{width:16,height:16})}),(0,Fe.jsx)("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?(0,Fe.jsx)(Ce,{width:16,height:16}):(0,Fe.jsx)(Zt,{width:16,height:16})})]})})]})}function Ua({open:e=!0,modalTitle:r="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:t,onCancel:o,onApply:n,...a}){let s=()=>{o?.(),t?.()};return(0,Fe.jsx)(Yo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:s,children:(0,Fe.jsxs)(Go,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[(0,Fe.jsx)(Uo,{title:(0,Fe.jsx)("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}),(0,Fe.jsx)(jo,{className:"p-0 overflow-hidden",children:(0,Fe.jsx)(Tl,{...a,onApply:l=>{n(l),t?.()},onCancel:s})})]})})}var Qe=require("react/jsx-runtime");function Rl({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=(0,Br.useId)(),P=N||M,$=`${P}-helper`,K=(0,Br.useRef)(null),X=a!==void 0,[B,oe]=(0,Br.useState)(()=>wl(s??null)),q=X?wl(a):B,[ee,ne]=(0,Br.useState)(null),[le,_]=(0,Br.useState)(!1),W=(0,Br.useMemo)(()=>q?q instanceof File?URL.createObjectURL(q):typeof q.url=="string"?q.url:"":"",[q]);(0,Br.useEffect)(()=>()=>{W&&W.startsWith("blob:")&&URL.revokeObjectURL(W)},[W]);let se=q instanceof File?q.name:q?.name||(typeof q?.url=="string"?po(q.url):"")||"",[Z,F]=(0,Br.useState)(null),[j,re]=(0,Br.useState)(!1),Se=(0,Br.useRef)(0),[ie,de]=(0,Br.useState)(""),Te=T||Z,ye=!!(k||Te),J=ye?"error":t,E=vl[e]||vl.md,I=o==="circle"?"rounded-full":n?Cu[n]:"rounded-md",fe=r==="other"?"":yl[r]?.[J]||yl.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,Ue)=>{ne({imageSrc:te,fileName:Ue?.name||se||"avatar.png",fileType:Ue?.type||"image/png"})},De=te=>{if(d||u||Q)return;F(null);let Ue=ku(te,{maxSize:x,accept:c});if(!Ue.isValid){let rr=Ue.error||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";F(rr),de(`L\u1ED7i t\u1EC7p: ${rr}`);return}if(be){let rr=URL.createObjectURL(te);pe(rr,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))},Ae=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())},Ee=te=>{if(te?.stopPropagation(),!(d||u||Q)&&q){let Ue=q;xe(null),l?.(Ue),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)},Ve=te=>{d||u||Q||((te.key==="Enter"||te.key===" ")&&(te.preventDefault(),ge()),q&&(te.key==="Delete"||te.key==="Backspace")&&(te.preventDefault(),Ee()))},We=()=>h?(0,Qe.jsxs)("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&&(0,Qe.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,ar="group/avatar relative flex items-center justify-center transition-all duration-150 ease-in-out border-2 overflow-hidden select-none",er=d?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer",Cr=[ar,E.avatarSize,I,fe,er,j?"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80":"",L||z].filter(Boolean).join(" ");return(0,Qe.jsxs)("div",{className:`group/field flex ${p==="left"?"flex-row items-center gap-3":"flex-col"} ${D?"w-full":"inline-flex"} ${Y||V}`,children:[(0,Qe.jsx)("input",{ref:U||K,id:P,name:R,type:"file",accept:c,disabled:d||Q,"aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:ue}),(0,Qe.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),We(),(0,Qe.jsxs)("div",{className:`flex flex-col ${D?"w-full":""}`,children:[(0,Qe.jsxs)("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:Ae,onKeyDown:Ve,className:Cr,children:[W?(0,Qe.jsx)(Xo,{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"}):(0,Qe.jsx)("div",{className:`flex flex-col items-center justify-center text-primary-400 group-hover/avatar:text-primary-600 transition-colors ${E.iconClass}`,children:C||(0,Qe.jsx)(Tt,{width:E.iconSize,height:E.iconSize})}),Q&&(0,Qe.jsx)("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:(0,Qe.jsx)(Ce,{width:E.iconSize,height:E.iconSize,className:"animate-spin"})}),!Q&&!d&&W&&(0,Qe.jsxs)("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:[(0,Qe.jsx)("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:(0,Qe.jsx)(Un,{width:14,height:14})}),be&&!u&&(0,Qe.jsx)("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:(0,Qe.jsx)(ca,{width:14,height:14})}),(!u||v)&&(0,Qe.jsx)("button",{type:"button",onClick:Ee,"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:(0,Qe.jsx)(bn,{width:14,height:14})})]})]}),(0,Qe.jsx)(Le,{id:$,helperText:S,errorMessage:Te,sizeClassName:E.helper,className:O}),be&&ee&&(0,Qe.jsx)(Ua,{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&&(0,Qe.jsx)(Ko,{open:le,onClose:()=>_(!1),file:q})]})]})}var m0=300,Zo={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"}},b0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},h0={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"},x0={warning:sn,error:ln,success:an,info:ot,primary:ot,secondary:ot,neutral:ot};var Nl=require("react"),Tu=(0,Nl.createContext)(null),ut=()=>(0,Nl.useContext)(Tu);var v0=require("react/jsx-runtime");function Dl({size:e,radius:r,className:t="",children:o,ref:n,...a}){let s=ut(),i=w(e??s?.size,Zo,"md"),l=w(r,b0,"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(0,v0.jsx)("div",{ref:n,tabIndex:-1,className:b,...a,children:o})}var Vr=require("react");var Ai=require("react/jsx-runtime");function Pl({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=(0,Vr.useRef)(null),[f,h]=(0,Vr.useState)(!1),p=(0,Vr.useRef)(null),y=(0,Vr.useCallback)(()=>{f||o||(h(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h(!1),m?.()},m0))},[f,o,m]),S=(0,Vr.useMemo)(()=>({onClose:y,isLoading:o,size:r,color:t}),[y,o,r,t]);(0,Vr.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]),(0,Vr.useEffect)(()=>{let u=c.current;if(u)if(e||f){if(!u.open)try{u.showModal()}catch{}}else u.open&&u.close()},[e,f]),(0,Vr.useEffect)(()=>{if(!s)return;let u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);let T=(0,Vr.useEffectEvent)(u=>{!e||a===!1||u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),y())});if((0,Vr.useEffect)(()=>(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(0,Ai.jsx)(Tu.Provider,{value:S,children:(0,Ai.jsxs)("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:[(0,Ai.jsx)("div",{"aria-hidden":"true",onClick:k,className:"fixed inset-0 -z-10"}),(0,Ai.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${d} ${l}`,children:b})]})})}var Xt=require("react/jsx-runtime");function zl({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=ut(),f=w(e??c?.size,Zo,"md"),h=w(r??c?.color,h0,"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(0,Xt.jsx)("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,x0,"warning");return(0,Xt.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${f.iconWrapper} ${h} ${n}`,"aria-hidden":"true",children:(0,Xt.jsx)(k,{className:f.icon})})};return(0,Xt.jsxs)("div",{className:`flex items-start justify-between w-full ${f.header} ${b}`,...x,children:[(0,Xt.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),o&&(0,Xt.jsx)("h3",{className:`${f.title} truncate ${a}`,id:"confirm-dialog-title",children:o}),m]}),s&&S&&(0,Xt.jsx)("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:(0,Xt.jsx)($e,{className:f.closeIcon})})]})}var Ml=require("react/jsx-runtime");function Il({size:e,description:r,descriptionClassName:t="",className:o="",children:n,...a}){let s=ut(),i=w(e??s?.size,Zo,"md");return(0,Ml.jsxs)("div",{className:`w-full ${i.body} ${o}`,id:"confirm-dialog-description",...a,children:[r?(0,Ml.jsx)("p",{className:`${i.description} ${t}`,children:r}):null,n]})}var Gi=require("react/jsx-runtime");function El({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=ut(),y=w(e??p?.size,Zo,"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?(0,Gi.jsx)("div",{className:`flex items-center justify-end w-full ${y.footer} ${y.buttonGap} ${c}`,...h,children:f}):(0,Gi.jsxs)("div",{className:`flex items-center justify-end w-full ${y.footer} ${y.buttonGap} ${c}`,...h,children:[t!==!1&&(0,Gi.jsx)(wt,{size:y.buttonSize,variant:n,color:s,onClick:g,disabled:x?.disabled||p?.isLoading,...x,children:t}),(0,Gi.jsx)(wt,{size:y.buttonSize,variant:o,color:S,isLoading:p?.isLoading||m?.isLoading,disabled:m?.disabled,onClick:k,...m,children:r})]})}var $l=require("react");var y0=require("react/jsx-runtime");function Ll({children:e,asChild:r=!0,onClick:t,...o}){let n=ut(),a=n?.isLoading,s=i=>{t?.(i),i.defaultPrevented||n?.onClose?.()};if(r&&(0,$l.isValidElement)(e)){let i=e;return(0,$l.cloneElement)(i,{disabled:i.props.disabled||a,onClick:l=>{i.props.onClick?.(l),s(l)},...o})}return(0,y0.jsx)("button",{type:"button",onClick:s,disabled:a,...o,children:e})}0&&(module.exports={AUDIO_EXTENSIONS,Alert,AlertCircleIcon,AlertTriangleIcon,Badge,Button,Calendar,CalendarHeader,CalendarIcon,Carousel,CarouselContent,CarouselNext,CarouselPagination,CarouselPrevious,CarouselSlide,CheckCircleIcon,CheckIcon,Checkbox,CheckboxGroup,CheckboxGroupContext,ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon,ClockIcon,CloseIcon,Collapse,CollapseContent,CollapseHeader,CollapsePanel,Collapsible,Confirm,ConfirmBody,ConfirmClose,ConfirmContainer,ConfirmFooter,ConfirmHeader,CropIcon,DEFAULT_TOAST_DURATION,DOCUMENT_EXTENSIONS,DatePicker,DateRangeCalendar,DateRangeDayGrid,DateRangeHeader,DateRangeMonthGrid,DateRangePicker,DateRangeYearGrid,DateTimePicker,DateTimeRangePicker,DayGrid,DoubleChevronLeftIcon,DoubleChevronRightIcon,DownloadIcon,Dropdown,DropdownGroup,DropdownHeader,DropdownItem,DropdownMenu,DropdownSeparator,DropdownTrigger,Empty,EmptyDefaultIcon,EmptyErrorIcon,EmptyFolderIcon,EmptyIllustration,EmptySearchIcon,EmptySimpleIcon,EyeIcon,FileContainer,FilePreview,FlipHorizontalIcon,IMAGE_EXTENSIONS,IconButton,ImageIcon,ImagePreview,ImagePreviewToolbar,InfoCircleIcon,Input,LoadingImage,MinusIcon,Modal,ModalBody,ModalClose,ModalContainer,ModalFooter,ModalHeader,MonthGrid,MultiInput,NumberInput,OtpInput,PDF_EXTENSIONS,PasswordInput,PlusIcon,Popover,PopoverBody,PopoverClose,PopoverContent,PopoverFooter,PopoverHeader,PopoverTrigger,Radio,RadioDotIcon,RadioGroup,RadioGroupContext,ResetIcon,RotateCcwIcon,RotateCwIcon,SearchIcon,Select,SelectComponent,SelectMenu,SelectMenuFilter,SelectOption,SelectTrigger,Skeleton,Slider,SliderMarks,SliderStepDots,SliderThumb,Spinner,Tab,TabList,TabPanel,TabPanels,Tabs,TabsContext,TextArea,TimeColumn,TimePicker,TimeRangePicker,TimeView,Toaster,Toggle,Tooltip,TrashIcon,UploadAvatar,UploadAvatarCropContent,UploadAvatarCropModal,UploadIcon,UploadImage,UploadImageDropzone,UploadImageList,VIDEO_EXTENSIONS,YearGrid,ZoomInIcon,ZoomOutIcon,checkIsDisabled,clamp,combineDateTime,createDateWithTime,createFileItem,downloadFile,formatBytes,formatDate,formatDateTime,formatNumberString,formatTime,generateCalendarGrid,generateRangeCalendarGrid,getDefaultDateTimeFormat,getDefaultFormat,getFileExtension,getFileName,getFileType,getISOWeekNumber,getPercentage,isDateAfter,isDateBefore,isSameDay,isSameMonth,isSameTime,isTimeAfter,isTimeBefore,isTimeInRange,isValidOtpChar,normalizePreviewFile,padZero,parseDate,parseDateTime,parseNumber,parseRawNumberString,parseTimeToDate,resolveLocale,revokeFileItem,sanitizeOtpString,splitTagsFromText,toDate,toDateTime,toTimeObject,toast,useCarousel,useCarouselContext,useCheckboxGroupContext,useCollapseContext,useCollapsePanelContext,useConfirmContext,useDebounce,useDebouncedCallback,useDropdownContext,useFileContext,useModalContext,usePopoverContext,useRadioGroupContext,useTabsContext,validateFile});
|
|
2
|
+
"use strict";var Sp=Object.create;var Xs=Object.defineProperty;var Tp=Object.getOwnPropertyDescriptor;var Rp=Object.getOwnPropertyNames;var Dp=Object.getPrototypeOf,Np=Object.prototype.hasOwnProperty;var Pp=(e,t)=>{for(var r in t)Xs(e,r,{get:t[r],enumerable:!0})},Td=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Rp(t))!Np.call(e,o)&&o!==r&&Xs(e,o,{get:()=>t[o],enumerable:!(n=Tp(t,o))||n.enumerable});return e};var Hn=(e,t,r)=>(r=e!=null?Sp(Dp(e)):{},Td(t||!e||!e.__esModule?Xs(r,"default",{value:e,enumerable:!0}):r,e)),zp=e=>Td(Xs({},"__esModule",{value:!0}),e);var pg={};Pp(pg,{AUDIO_EXTENSIONS:()=>Fs,Alert:()=>oi,AlertCircleIcon:()=>qo,AlertTriangleIcon:()=>Xo,ArrowDownIcon:()=>ls,ArrowUpDownIcon:()=>os,ArrowUpIcon:()=>as,AvatarIcon:()=>rs,Badge:()=>ir,Button:()=>xr,Calendar:()=>on,CalendarHeader:()=>fa,CalendarIcon:()=>eu,Carousel:()=>bu,CarouselContent:()=>xu,CarouselNext:()=>wu,CarouselPagination:()=>Cu,CarouselPrevious:()=>yu,CarouselSlide:()=>vu,CheckCircleIcon:()=>_o,CheckIcon:()=>Gn,Checkbox:()=>Jr,CheckboxGroup:()=>bo,ChevronDownIcon:()=>yt,ChevronLeftIcon:()=>Sr,ChevronRightIcon:()=>Tr,ClockIcon:()=>tu,CloseIcon:()=>Ve,Collapse:()=>Nl,CollapseContent:()=>ta,CollapseHeader:()=>ea,CollapsePanel:()=>Il,Collapsible:()=>Fl,Confirm:()=>Rc,ConfirmBody:()=>Pc,ConfirmClose:()=>Fc,ConfirmContainer:()=>Dc,ConfirmFooter:()=>Ic,ConfirmHeader:()=>Nc,CropIcon:()=>ts,DEFAULT_PAGE_SIZE:()=>Os,DEFAULT_PAGE_SIZE_OPTIONS:()=>As,DEFAULT_TOAST_DURATION:()=>en,DOCUMENT_EXTENSIONS:()=>Es,DataTable:()=>kd,DatePicker:()=>To,DateRangeCalendar:()=>hi,DateRangeDayGrid:()=>gi,DateRangeHeader:()=>ba,DateRangeMonthGrid:()=>mi,DateRangePicker:()=>No,DateRangeYearGrid:()=>bi,DateTimePicker:()=>cc,DateTimeRangePicker:()=>uc,DayGrid:()=>pa,DoubleChevronLeftIcon:()=>Un,DoubleChevronRightIcon:()=>Yn,DownloadIcon:()=>Qr,Dropdown:()=>Ol,DropdownGroup:()=>Mu,DropdownHeader:()=>zu,DropdownItem:()=>Nu,DropdownMenu:()=>jl,DropdownSeparator:()=>Iu,DropdownTrigger:()=>Ru,Empty:()=>Mo,EmptyDefaultIcon:()=>bl,EmptyErrorIcon:()=>xl,EmptyFolderIcon:()=>vl,EmptyIllustration:()=>yi,EmptySearchIcon:()=>hl,EmptySimpleIcon:()=>yl,EyeIcon:()=>Vn,FileContainer:()=>Kr,FileIcon:()=>Ni,FilePreview:()=>Pn,FlipHorizontalIcon:()=>ti,IMAGE_EXTENSIONS:()=>zs,IconButton:()=>qr,ImageIcon:()=>Qa,ImagePreview:()=>Na,ImagePreviewToolbar:()=>Da,InfoCircleIcon:()=>Dr,Input:()=>Yt,LoadingImage:()=>In,MinusIcon:()=>ja,Modal:()=>$o,ModalBody:()=>Vo,ModalClose:()=>Lc,ModalContainer:()=>Lo,ModalFooter:()=>Ec,ModalHeader:()=>Ho,MonthGrid:()=>ga,MultiInput:()=>al,MultiSelect:()=>sd,MultiSelectTrigger:()=>Ps,NumberInput:()=>fo,OtpInput:()=>il,PDF_EXTENSIONS:()=>Is,PasswordInput:()=>ol,PlusIcon:()=>Zr,Popover:()=>ia,PopoverBody:()=>Ou,PopoverClose:()=>Uu,PopoverContent:()=>Bu,PopoverFooter:()=>Gu,PopoverHeader:()=>Vu,PopoverTrigger:()=>hs,Radio:()=>Ai,RadioDotIcon:()=>Ya,RadioGroup:()=>gl,ResetIcon:()=>cr,RotateCcwIcon:()=>ei,RotateCwIcon:()=>Kn,SearchIcon:()=>mo,Select:()=>ad,SelectComponent:()=>Sa,SelectMenu:()=>Ci,SelectMenuFilter:()=>Ts,SelectOption:()=>ks,SelectTrigger:()=>wi,SingleSelectTrigger:()=>wi,Skeleton:()=>Oo,Slider:()=>Ji,SliderMarks:()=>ds,SliderStepDots:()=>fs,SliderThumb:()=>Xi,SlidersHorizontalIcon:()=>cs,Spinner:()=>De,Tab:()=>yo,TabList:()=>vo,TabPanel:()=>Bl,TabPanels:()=>Ll,Table:()=>Gs,TableBody:()=>Us,TableCaption:()=>hd,TableCell:()=>zi,TableColumnHeader:()=>Ii,TableFooter:()=>bd,TableHead:()=>lo,TableHeader:()=>js,TablePagination:()=>Ys,TableRow:()=>Uo,TableToolbar:()=>Ws,Tabs:()=>xo,TextArea:()=>sl,TimeColumn:()=>ro,TimePicker:()=>sc,TimeRangePicker:()=>lc,TimeView:()=>Pr,Toaster:()=>wl,Toggle:()=>ml,Tooltip:()=>_i,TrashIcon:()=>Br,UploadAvatar:()=>kc,UploadAvatarCropContent:()=>Cc,UploadAvatarCropModal:()=>Vs,UploadFile:()=>Sc,UploadFileDropzone:()=>Di,UploadFileItemRow:()=>Ia,UploadFileList:()=>Ma,UploadIcon:()=>Zt,UploadImage:()=>wc,UploadImageDropzone:()=>za,UploadImageList:()=>Go,VIDEO_EXTENSIONS:()=>Ms,YearGrid:()=>ma,ZoomInIcon:()=>Jo,ZoomOutIcon:()=>Qo,checkIsDisabled:()=>Io,clamp:()=>Sl,combineDateTime:()=>zr,createDateWithTime:()=>zo,createTableColumnHelper:()=>Cd,defaultTableFeatures:()=>Ac,downloadFile:()=>dn,formatBytes:()=>un,formatDate:()=>dr,formatDateTime:()=>gr,formatNumberString:()=>An,formatTime:()=>Qt,fuzzyFilter:()=>Ks,generateCalendarGrid:()=>vs,generateRangeCalendarGrid:()=>ha,getDefaultDateTimeFormat:()=>no,getDefaultFormat:()=>to,getFileCategory:()=>$s,getFileExtension:()=>Ra,getFileName:()=>Tt,getFileType:()=>Si,getISOWeekNumber:()=>da,getPercentage:()=>qi,getSafeConfig:()=>C,isDateAfter:()=>ua,isDateBefore:()=>ca,isSameDay:()=>eo,isSameMonth:()=>xs,isSameTime:()=>Xu,isTimeAfter:()=>Zu,isTimeBefore:()=>qu,isTimeInRange:()=>Qu,isValidOtpChar:()=>Va,normalizePreviewFile:()=>Nn,padZero:()=>Ur,parseDate:()=>_l,parseDateTime:()=>xa,parseNumber:()=>On,parseRawNumberString:()=>Yc,parseTimeToDate:()=>pr,rankAndFilterItems:()=>co,resolveLocale:()=>Dt,sanitizeOtpString:()=>Aa,splitTagsFromText:()=>Oa,toDate:()=>jt,toDateTime:()=>Ir,toTimeObject:()=>_u,toast:()=>ou,useAnimatedError:()=>rl,useCarousel:()=>ps,useCarouselContext:()=>Ar,useCollapseContext:()=>qn,useCollapsePanelContext:()=>li,useConfirmContext:()=>Er,useDataTable:()=>_s,useDebounce:()=>Df,useDebouncedCallback:()=>go,useDropdownContext:()=>tn,useFileContext:()=>Bs,useFloatingTransition:()=>rt,useInfiniteScroll:()=>Nf,useModalContext:()=>Fr,usePopoverContext:()=>Jt,useTableStyles:()=>Pi,useTabsContext:()=>Jn});module.exports=zp(pg);var qs={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"}},Zs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Js={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"}};var Qs=require("@tanstack/match-sorter-utils");function C(e,t,r){return e!=null&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:t[r]}function co(e,t,r){let n=t.trim();if(!n||!e.length)return e;let o=r?Array.isArray(r)?r:[r]:[],i=[];if(o.length>0)for(let s of o)typeof s=="function"?i.push(l=>{let f=s(l);return f!=null?String(f):""}):i.push(l=>{let f=l,c=f[s];if(c!=null)return String(c);if(f.data&&typeof f.data=="object"){let w=f.data[s];if(w!=null)return String(w)}return""});else i.push(s=>{if(s&&typeof s=="object"){let l=s;return l.label!=null?String(l.label):l.value!=null?String(l.value):""}return s!=null?String(s):""});let a=[];for(let s of e){let l=(0,Qs.rankItem)(s,n,{accessors:i});l.passed&&a.push({item:s,info:l})}return a.sort((s,l)=>(0,Qs.compareItems)(s.info,l.info)),a.map(s=>s.item)}var Ba=require("react/jsx-runtime");function De({width:e=16,height:t=16,className:r="",...n}){return(0,Ba.jsxs)("svg",{width:e,height:t,className:`animate-[spin_1s_steps(8)_infinite] ${r}`,viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[(0,Ba.jsx)("path",{d:"M0 0h25v24H0z",fill:"none"}),(0,Ba.jsx)("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"})]})}var Fi=require("react/jsx-runtime");function xr({size:e,variant:t,color:r,radius:n,leftIcon:o,rightIcon:i,isLoading:a=!1,showSpinner:s=!1,loadingText:l,isFullWidth:f=!1,disabled:c=!1,type:w="button",className:p="",children:m,ref:v,...x}){let h=C(e,qs,"md"),k=t==="other"?"":C(r,C(t,Js,"filled"),"primary"),T=C(n,Zs,"lg"),y=["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",h.button,T,k,f?"w-full":"",c?"opacity-50":"",p].filter(Boolean).join(" "),d=g=>(0,Fi.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${h.icon}`,"aria-hidden":"true",children:g}),u=a&&l?l:m;return(0,Fi.jsxs)("button",{ref:v,type:w,disabled:c||a,"aria-busy":a,"aria-disabled":c||a,className:y,...x,children:[a&&s&&d((0,Fi.jsx)(De,{})),(!a||!s)&&o&&d(o),u&&(0,Fi.jsx)("span",{className:"leading-none",children:u}),!a&&i&&d(i)]})}var el=require("react/jsx-runtime");function qr({icon:e,size:t,variant:r,color:n,radius:o,isLoading:i=!1,showSpinner:a=!1,disabled:s=!1,type:l="button",className:f="",ref:c,...w}){let p=C(t,qs,"md"),m=r==="other"?"":C(n,C(r,Js,"filled"),"primary"),v=C(o,Zs,"full"),x=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 active:scale-[0.98] transition-transform cursor-pointer select-none whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",p.iconOnly,v,m,s?"opacity-50":"",f].filter(Boolean).join(" "),h=k=>(0,el.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${p.icon}`,"aria-hidden":"true",children:k});return(0,el.jsx)("button",{ref:c,type:l,disabled:s||i,"aria-busy":i,"aria-disabled":s||i,className:x,...w,children:h(i&&a?(0,el.jsx)(De,{}):e)})}var Rd={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"}},Dd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Nd={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"},Pd={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"}};var Gc=require("react/jsx-runtime");function Ve({width:e=14,height:t=14,className:r="",...n}){return(0,Gc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Gc.jsx)("path",{d:"M18 6 6 18M6 6l12 12"})})}var uo=require("react/jsx-runtime");function ir({size:e="md",variant:t="soft",color:r="primary",radius:n="full",dot:o=!1,dotPing:i=!1,leftIcon:a,rightIcon:s,onDelete:l,deleteAriaLabel:f="Remove",className:c="",children:w,onClick:p,ref:m,...v}){let x=C(e,Rd,"md"),h=t==="other"?"":C(r,C(t,Pd,"soft"),"primary"),k=C(r,Nd,"primary"),T=C(n,Dd,"full"),y=["inline-flex items-center justify-center font-medium leading-none border transition-colors duration-150 whitespace-nowrap",x.badge,T,h,p?"cursor-pointer select-none active:scale-[0.98] transition-transform duration-100":"",c].filter(Boolean).join(" "),d=u=>(0,uo.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${x.icon}`,"aria-hidden":"true",children:u});return(0,uo.jsxs)("span",{ref:m,role:p?"button":void 0,tabIndex:p?0:void 0,className:y,onClick:p,...v,children:[o&&(0,uo.jsx)("span",{className:`relative inline-block shrink-0 rounded-full ${i?"animate-pulse":""} ${x.dot} ${k}`,"aria-hidden":"true"}),a&&d(a),w&&(0,uo.jsx)("span",{className:"leading-none",children:w}),s&&!l&&d(s),l&&(0,uo.jsx)("button",{type:"button",onClick:u=>{u.stopPropagation(),l()},"aria-label":f,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 ${x.deleteIcon}`,children:(0,uo.jsx)(Ve,{className:"size-full"})})]})}var Hi=require("react"),Ed=require("@floating-ui/react");var tl={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"}},Ei={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},zd={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},Id={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"}},$i={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};var Md={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"}};var Li=require("react");function rl(e,t={}){let{exitDuration:r=250}=t,[n,o]=(0,Li.useState)(e),[i,a]=(0,Li.useState)(!1),[s,l]=(0,Li.useState)(e);return e!==s&&(l(e),e?(o(e),a(!1)):a(!0)),(0,Li.useEffect)(()=>{if(!i)return;let f=setTimeout(()=>{o(void 0),a(!1)},r);return()=>clearTimeout(f)},[r,i]),{displayedError:n,isExiting:i}}var nl=require("react/jsx-runtime");function Le({id:e,helperText:t,errorMessage:r,sizeClassName:n="text-xs",className:o=""}){let{displayedError:i,isExiting:a}=rl(r),s=i||t,l=!!(i||t),f=!!i;return(0,nl.jsx)("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:(0,nl.jsx)("div",{className:"overflow-hidden",children:(0,nl.jsx)("div",{id:e,role:f?"alert":"status",className:`leading-tight transition-colors duration-200 font-normal ${n} ${f?a?"text-error-600 animate-error-out":"text-error-600 animate-error-in":"text-neutral-500 dark:text-neutral-400"} ${o}`,children:s||"\xA0"})})})}var Bi=require("react/jsx-runtime"),jc={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"},Fd={xs:{label:"text-[11px] mb-1",floatingLabel:"text-[10px]"},sm:{label:"text-xs mb-1",floatingLabel:"text-[10px]"},md:{label:"text-sm mb-1.5",floatingLabel:"text-[11px]"},lg:{label:"text-base mb-1.5",floatingLabel:"text-xs"},xl:{label:"text-lg mb-2",floatingLabel:"text-xs"}};function vt({label:e,children:t,htmlFor:r,id:n,isRequired:o=!1,isFloating:i,placement:a,size:s="md",sizeClassName:l,color:f="primary",hasError:c=!1,isInvalid:w=!1,cursor:p,className:m="",colorConfig:v=jc}){let x=e??t;if(!x)return null;let h=i??a==="floating",k=!!(c||w),T=k?"error":f,y=k?"text-error-600 font-bold":v[T]||jc[T]||jc.primary,d=Fd[s]||Fd.md,u=l||(h?d.floatingLabel:d.label),g=p?`cursor-${p}`:h?"cursor-text":"";return h?(0,Bi.jsxs)("label",{htmlFor:r,id:n,className:`absolute top-0 -translate-y-1/2 left-3 px-1.5 rounded-sm select-none z-10 font-bold bg-neutral-white transition-colors duration-150 ${g} ${u} ${y} ${m}`,children:[x,o&&(0,Bi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):(0,Bi.jsxs)("label",{htmlFor:r,id:n,className:`inline-flex items-center font-bold transition-colors duration-150 ${g} ${u} ${y} ${m}`,children:[x,o&&(0,Bi.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})}var Vt=require("react/jsx-runtime");function Yt({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:c,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:v="",inputWrapperClassName:x="",labelClassName:h="",helperClassName:k="",id:T,value:y,defaultValue:d,onChange:u,disabled:g=!1,readOnly:b=!1,className:S="",type:R="text",placeholder:D,ref:P,...I}){let{isRequired:E=!1,isInvalid:N=!1,isLoading:M=!1,showSpinner:z=!1,isClearable:H=!1,isFullWidth:V=!1}=a??{},Y=(0,Hi.useId)(),$=T||Y,F=`${$}-error-helper`,G=(0,Hi.useRef)(null),A=(0,Ed.useMergeRefs)([G,P]),j=y!==void 0,[B,X]=(0,Hi.useState)(d),le=j?y:B,ne=ye=>{j||X(ye.target.value),u?.(ye)},ue=()=>{j||X(""),m?.()},ie=le!=null?String(le).length>0:!1,Q=!!(N||l),q=Q?"error":r,ge=C(e,tl,"md"),ke=C(n,Ei,"md"),L=t==="other"?"":C(q,C(t,$i,"outline"),"primary"),te=ye=>(0,Vt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${ge.icon}`,"aria-hidden":"true",children:ye}),Z=i==="floating",he=()=>(0,Vt.jsx)(vt,{htmlFor:$,label:o,isRequired:E,isFloating:Z,size:e,color:q,hasError:Q,className:h}),ae=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",ge.wrapper,ke,L,g?"opacity-50":"",V?"w-full":"w-auto",x].filter(Boolean).join(" "),ve=["w-full h-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed",ge.input,f?"pl-1.5":"",w||H||M?"pr-1.5":"",S].filter(Boolean).join(" ");return(0,Vt.jsxs)("div",{className:`group/field flex ${i==="left"?"flex-row items-center gap-3":"flex-col"} ${V?"w-full":"inline-flex"} ${v}`,children:[!Z&&he(),(0,Vt.jsxs)("div",{className:`flex flex-col ${V?"w-full":""}`,children:[(0,Vt.jsxs)("div",{className:"flex items-stretch",children:[c&&(0,Vt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-r-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-r-none`:""}`,children:c}),(0,Vt.jsxs)("div",{className:`${ae} ${c?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Z&&he(),f&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pl-3 shrink-0",children:te(f)}),(0,Vt.jsx)("input",{ref:A,id:$,type:R,value:le,onChange:ne,disabled:g||M,readOnly:b,"aria-invalid":Q,"aria-required":E,"aria-describedby":l||s?F:void 0,"aria-errormessage":l?F:void 0,"aria-busy":M,"aria-disabled":g||M,placeholder:D,className:ve,...I}),M&&z&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te((0,Vt.jsx)(De,{}))}),!M&&H&&!g&&!b&&(0,Vt.jsx)("button",{type:"button",onClick:ue,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ie?0:-1,"aria-hidden":!ie,className:`inline-flex items-center justify-center mr-2 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${ge.icon} ${ie?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Vt.jsx)(Ve,{className:"size-full"})}),!M&&w&&(0,Vt.jsx)("div",{className:"flex items-center justify-center pr-3 shrink-0",children:te(w)})]}),p&&(0,Vt.jsx)("div",{className:`inline-flex items-center px-3 text-neutral-600 bg-neutral-100 border border-l-0 border-neutral-300 text-sm font-medium ${ke?`${ke} rounded-l-none`:""}`,children:p})]}),(0,Vt.jsx)(Le,{id:F,helperText:s,errorMessage:l,sizeClassName:ge.helper,className:k})]})]})}var Ld=require("react");var mn=require("react/jsx-runtime");function Uc({width:e=16,height:t=16,className:r="",...n}){return(0,mn.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,mn.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,mn.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function $d({width:e=16,height:t=16,className:r="",...n}){return(0,mn.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,mn.jsx)("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),(0,mn.jsx)("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"}),(0,mn.jsx)("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"}),(0,mn.jsx)("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})}var Vn=Uc;var Ha=require("react/jsx-runtime");function ol({defaultVisible:e=!1,toggleAriaLabel:t="Hi\u1EC3n th\u1ECB/\u1EA9n m\u1EADt kh\u1EA9u",onVisibilityChange:r,rightIcon:n,disabled:o,readOnly:i,...a}){let[s,l]=(0,Ld.useState)(e);return(0,Ha.jsx)(Yt,{type:s?"text":"password",disabled:o,readOnly:i,rightIcon:n||(0,Ha.jsx)("button",{type:"button",onClick:()=>{if(o||i)return;let w=!s;l(w),r?.(w)},disabled:o||i,"aria-label":t,className:"inline-flex items-center justify-center size-full p-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded",children:s?(0,Ha.jsx)($d,{className:"size-full"}):(0,Ha.jsx)(Uc,{className:"size-full"})}),...a})}var Bd=require("react");function An(e,t){if(e==null||e==="")return"";let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=t?.maxDecimalDigits??0,i=t?.min,a=t?.max,s=t?.clampMin??!1,l=t?.allowNegative??(i===void 0||i<0),f=String(e).trim();if(!f)return"";let c=l&&f.startsWith("-");if(c&&f==="-")return"-";if(o>0&&f.includes(n)){let h=f.split(n),k=h[0]?.replace(/\D/g,"")??"",T=h.slice(1).join("").replace(/\D/g,"").slice(0,o);if(k||T){let u=parseFloat(`${k||"0"}.${T||"0"}`);if(c&&(u=-u),a!==void 0&&!isNaN(u)&&u>a)return An(a,{...t,max:void 0,min:void 0});if(i!==void 0&&!isNaN(u)&&u<i&&(s||c&&i<0))return An(i,{...t,max:void 0,min:void 0})}let y=k?parseInt(k,10).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r):"",d=c?"-":"";return h.length>1&&h[1]===""&&T===""?`${d}${y||"0"}${n}`:T.length>0?`${d}${y||"0"}${n}${T}`:`${d}${y}`}let w=f.replace(/\D/g,"");if(!w)return c?"-":"";let p=parseInt(w,10);if(isNaN(p))return"";c&&(p=-p),a!==void 0&&p>a&&(p=a),i!==void 0&&p<i&&(s||c&&i<0)&&(p=i);let m=p<0?"-":"",v=Math.abs(p).toString().replace(/\B(?=(\d{3})+(?!\d))/g,r);return`${m}${v}`}function Yc(e,t){let r=t?.thousandSeparator??".";return e.split(r).join("")}function On(e,t){if(!e)return;let r=t?.thousandSeparator??".",n=t?.decimalSeparator??",",o=e.split(r).join("");if(n!=="."&&(o=o.split(n).join(".")),o=o.replace(/[^\d.-]/g,""),!o||o==="."||o==="-")return;let i=parseFloat(o);return isNaN(i)?void 0:i}function Wc(e,t,r,n){let o=n?.decimalSeparator??",",i=0;for(let l=0;l<r&&l<e.length;l++){let f=e.charAt(l);(/\d/.test(f)||f===o||f==="-")&&i++}if(i===0)return 0;let a=t.length,s=0;for(let l=0;l<t.length;l++){let f=t.charAt(l);if((/\d/.test(f)||f===o||f==="-")&&s++,s===i){a=l+1;break}}return Math.min(a,t.length)}function Va(e,t="numeric"){return t==="numeric"?/^\d$/.test(e):t==="alphanumeric"?/^[a-zA-Z0-9]$/.test(e):!0}function Aa(e,t="numeric"){return t==="numeric"?e.replace(/\D/g,""):t==="alphanumeric"?e.replace(/[^a-zA-Z0-9]/g,""):e}function Oa(e,t=/[\r\n,;\t]+/,r=!0){return e?e.split(t).map(n=>r?n.trim():n).filter(Boolean):[]}var Hd=require("react/jsx-runtime");function fo({value:e,defaultValue:t,min:r,max:n,thousandSeparator:o=".",decimalSeparator:i=",",maxDecimalDigits:a=0,allowNegative:s,onChange:l,onClear:f,onBlur:c,ref:w,...p}){let m={max:n,min:r,thousandSeparator:o,decimalSeparator:i,maxDecimalDigits:a,allowNegative:s},v=e!==void 0,[x,h]=(0,Bd.useState)(t),k=v?e:x,T=An(k,m),y=()=>{v||h(""),f?.()},d=g=>{let b=g.target,S=b.value,R=b.selectionStart||0,D=An(S,m),P=Wc(S,D,R,{decimalSeparator:i});if(v||h(D),b.value=D,l){let I={...g,target:b,currentTarget:b};l(I)}requestAnimationFrame(()=>{b&&b.setSelectionRange&&b.setSelectionRange(P,P)})},u=g=>{if(r!==void 0&&k!==void 0&&k!==null&&k!==""){let b=On(String(k),{thousandSeparator:o,decimalSeparator:i});if(b!==void 0&&b<r){let S=An(r,{...m,clampMin:!0});if(v||h(S),l){g.target.value=S;let R={...g,target:g.target,currentTarget:g.target};l(R)}}}c?.(g)};return(0,Hd.jsx)(Yt,{ref:w,type:"text",inputMode:a>0?"decimal":"numeric",value:T,onChange:d,onBlur:u,onClear:y,...p})}var bn=require("react");var ar=require("react/jsx-runtime");function il({ref:e,config:t,id:r,name:n,length:o=6,value:i,defaultValue:a="",onChange:s,onComplete:l,type:f="numeric",mask:c=!1,size:w="md",variant:p="outline",color:m="primary",radius:v,autoFocus:x=!1,disabled:h=!1,readOnly:k=!1,groupSize:T,separator:y="-",ariaLabel:d="One-time password",getSlotAriaLabel:u,allowOneTimeCode:g=!0,label:b,labelPlacement:S="top",helperText:R,errorMessage:D,className:P="",slotClassName:I="",wrapperClassName:E="",labelClassName:N="",helperClassName:M=""}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1}=t??{},$=(0,bn.useId)(),F=r||$,G=`${F}-slot-0`,A=`${F}-error-helper`,[j,B]=(0,bn.useState)(()=>{let J=(i!==void 0?i:a).split("");return Array.from({length:o},(O,W)=>J[W]||"")}),X=(0,bn.useRef)([]),le=i!==void 0,ne=le?Array.from({length:o},(J,O)=>i&&i[O]!==void 0?i[O]:""):j,ue=!!(H||D),ie=ue?"error":m;(0,bn.useEffect)(()=>{if(x&&!h&&!k){let J=ne.findIndex(W=>!W),O=J!==-1?J:0;X.current[O]?.focus()}},[x,ne,h,k]),(0,bn.useImperativeHandle)(e,()=>({getValue:()=>ne.join(""),clear:()=>{let J=Array(o).fill("");le||B(J),s?.(""),!h&&!k&&X.current[0]?.focus()},focus:(J=0)=>{let O=Math.max(0,Math.min(J,o-1));X.current[O]?.focus()}}),[ne,o,le,s,h,k]);let Q=J=>{le||B(J);let O=J.join("");s?.(O),J.every(W=>W.length>0)&&J.length===o&&l?.(O)},q=(J,O)=>{let W=Aa(J,f);if(!W)return;let we=[...ne],fe=W.length>=o?0:O,se=W.slice(0,o-fe).split("");se.forEach((Re,xe)=>{fe+xe<o&&(we[fe+xe]=Re)}),Q(we);let me=Math.min(fe+se.length,o-1);X.current[me]?.focus()},ge=(J,O)=>{if(h||k||V)return;let W=J.target.value;if(!W){let fe=[...ne];fe[O]="",Q(fe);return}if(W.length>1){q(W,O);return}let we=W.slice(-1);if(Va(we,f)){let fe=[...ne];fe[O]=we,Q(fe),O<o-1&&X.current[O+1]?.focus()}},ke=(J,O)=>{if(!(h||k||V)){if(J.key==="Backspace"){J.preventDefault();let W=[...ne];ne[O]?(W[O]="",Q(W)):O>0&&(W[O-1]="",Q(W),X.current[O-1]?.focus())}else if(J.key==="Delete"){J.preventDefault();let W=[...ne];W[O]="",Q(W)}else if(J.key==="ArrowLeft")J.preventDefault(),O>0&&X.current[O-1]?.focus();else if(J.key==="ArrowRight")J.preventDefault(),O<o-1&&X.current[O+1]?.focus();else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="c"){let W=ne.join("");W&&navigator.clipboard?.writeText(W)}else if((J.ctrlKey||J.metaKey)&&J.key.toLowerCase()==="x"){J.preventDefault();let W=ne.join("");W&&navigator.clipboard?.writeText(W);let we=Array(o).fill("");Q(we),X.current[0]?.focus()}}},L=(J,O)=>{if(h||k||V)return;J.preventDefault();let W=J.clipboardData.getData("text/plain");q(W,O)},te=C(w,Md,"md"),Z=C(w,tl,"md"),he=C(v,Ei,"md"),ae=p==="other"?"":C(ie,C(p,$i,"outline"),"primary"),ve=h?"opacity-50":"",Se=()=>b?(0,ar.jsxs)("label",{htmlFor:G,className:`block font-medium text-neutral-700 select-none ${te.label} ${N}`,children:[b,z&&(0,ar.jsx)("span",{className:"text-error-500 ml-0.5",children:"*"})]}):null;return(0,ar.jsxs)("div",{className:`group/otp flex ${S==="left"?"flex-row items-start gap-3":"flex-col"} ${E}`,children:[Se(),(0,ar.jsxs)("div",{className:"flex flex-col",children:[(0,ar.jsxs)("div",{role:"group","aria-label":d,"aria-describedby":D||R?A:void 0,className:`inline-flex items-center ${te.gap} ${P}`,children:[Array.from({length:o}).map((J,O)=>{let W=!!(c||f==="password"),we=u?u(O,o):`K\xFD t\u1EF1 ${O+1} tr\xEAn ${o}`,fe=!!(T&&T>0)&&(O+1)%(T||1)===0&&O<o-1;return(0,ar.jsxs)("div",{className:"inline-flex items-center gap-1.5",children:[(0,ar.jsx)("input",{id:`${F}-slot-${O}`,ref:se=>{X.current[O]=se},type:W?"password":"text",inputMode:f==="numeric"?"numeric":"text",pattern:f==="numeric"?"[0-9]*":void 0,maxLength:1,value:ne[O]||"",onFocus:se=>se.target.select(),onChange:se=>ge(se,O),onKeyDown:se=>ke(se,O),onPaste:se=>L(se,O),disabled:h||V,readOnly:k,"aria-label":we,"aria-invalid":ue,"aria-required":z,"aria-busy":V,"aria-disabled":h||V,autoComplete:g?"one-time-code":"off",autoCorrect:"off",autoCapitalize:"none",spellCheck:!1,"data-1p-ignore":"true","data-lpignore":"true","data-form-type":"other",className:`border-2 text-center p-0 outline-none transition-all duration-150 ease-in-out text-neutral-900 ${te.slot} ${te.text} ${he} ${ae} ${ve} ${I}`}),fe&&(0,ar.jsx)("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center text-neutral-400 select-none font-bold shrink-0",children:y})]},`${F}-slot-${O}`)}),V&&Y&&(0,ar.jsx)("div",{role:"status","aria-label":"\u0110ang t\u1EA3i",className:"inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400",children:(0,ar.jsx)(De,{className:`animate-spin ${Z.icon}`})})]}),(0,ar.jsx)(Le,{id:A,helperText:R,errorMessage:D,sizeClassName:te.helper,className:M}),n&&(0,ar.jsx)("input",{type:"hidden",name:n,value:ne.join(""),disabled:h||V})]})]})}var po=require("react"),Vd=require("@floating-ui/react");var Ga=require("react/jsx-runtime");function Zr({width:e=14,height:t=14,className:r="",...n}){return(0,Ga.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ga.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,Ga.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var Ke=require("react/jsx-runtime");function al({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,leftIcon:f,leftAddon:c,rightIcon:w,rightAddon:p,onClear:m,wrapperClassName:v="",inputWrapperClassName:x="",labelClassName:h="",helperClassName:k="",id:T,name:y,value:d,defaultValue:u=[],onChange:g,inputValue:b,onInputValueChange:S,delimiters:R=["Enter"],showAddButton:D=!1,renderAddButton:P,addOnBlur:I=!1,addOnPaste:E=!0,pasteSplitRegex:N=/[\r\n,;\t]+/,trimValues:M=!0,allowDuplicates:z=!1,onDuplicate:H,maxTags:V,onMaxTagsReached:Y,maxTagLength:$,validateTag:F,onValidateError:G,maxTagCount:A,renderTag:j,tagVariant:B,tagColor:X,tagRadius:le,tagSize:ne,tagClassName:ue="",addButtonClassName:ie="",disabled:Q=!1,readOnly:q=!1,className:ge="",placeholder:ke="Nh\u1EADp v\xE0 nh\u1EA5n Enter...",autoFocus:L=!1,ref:te}){let{isRequired:Z=!1,isInvalid:he=!1,isLoading:ae=!1,showSpinner:ve=!1,isClearable:Se=!1,isFullWidth:ye=!1}=a??{},J=(0,po.useId)(),O=T||J,W=`${O}-error-helper`,we=o?`${O}-label`:void 0,fe=(0,po.useRef)(null),se=(0,Vd.useMergeRefs)([fe,te]),me=d!==void 0,[Re,xe]=(0,po.useState)(u),re=me?d||[]:Re,de=b!==void 0,[ce,ee]=(0,po.useState)(""),U=de?b||"":ce,[Ce,$e]=(0,po.useState)(""),Ee=Me=>{de||ee(Me),S?.(Me)},oe=Me=>{me||xe(Me),g?.(Me)},Te=Me=>{if(Q||q||ae)return!1;let Ue=M?Me.trim():Me;if(!Ue)return!1;if($&&$>0&&Ue.length>$&&(Ue=Ue.slice(0,$)),V!==void 0&&re.length>=V)return Y?.(Ue),$e(`Maximum limit of ${V} tags reached`),!1;if(!z&&re.includes(Ue))return H?.(Ue),$e(`Tag "${Ue}" already exists`),!1;if(F){let Gt=F(Ue);if(Gt===!1||typeof Gt=="string")return G?.(Ue,typeof Gt=="string"?Gt:void 0),$e(`Tag "${Ue}" is invalid`),!1}let Bt=[...re,Ue];return oe(Bt),Ee(""),$e(`Added tag "${Ue}"`),!0},Pe=Me=>{if(Q||q||ae)return;let Ue=[...re],Bt=new Set(re),Gt=0;for(let Bn of Me){let hr=M?Bn.trim():Bn;if(hr){if($&&$>0&&hr.length>$&&(hr=hr.slice(0,$)),V!==void 0&&Ue.length>=V){Y?.(hr);break}if(!z&&Bt.has(hr)){H?.(hr);continue}if(F){let Mi=F(hr);if(Mi===!1||typeof Mi=="string"){G?.(hr,typeof Mi=="string"?Mi:void 0);continue}}Ue.push(hr),Bt.add(hr),Gt++}}oe(Ue),Ee(""),Gt>0&&$e(`Added ${Gt} tags`)},Qe=Me=>{if(Q||q||ae)return;let Ue=re[Me],Bt=re.filter((Gt,Bn)=>Bn!==Me);oe(Bt),Ue&&$e(`Removed tag "${Ue}"`)},We=Me=>{Me?.stopPropagation(),!(Q||q||ae)&&(oe([]),Ee(""),$e("Removed all tags"),m?.(),fe.current?.focus())},Be=Me=>{if(Q||q||ae)return;R.includes(Me.key)||R.includes("Enter")&&Me.key==="Enter"||R.includes("Comma")&&(Me.key===","||Me.key==="Comma")||R.includes("Tab")&&Me.key==="Tab"||R.includes("Space")&&(Me.key===" "||Me.key==="Space")?U&&(Me.preventDefault(),Te(U)):Me.key==="Backspace"&&U===""&&re.length>0&&(Me.preventDefault(),Qe(re.length-1))},Oe=Me=>{if(!(Q||q||ae)&&E){let Ue=Me.clipboardData.getData("text");if(Ue){let Bt=Oa(Ue,N,M);(Bt.length>1||N.test(Ue))&&(Me.preventDefault(),Pe(Bt))}}},Ze=()=>{I&&U.trim()&&Te(U)},K=re.length>0||U.length>0,_=!!(he||l),ze=_?"error":r,pe=C(e,Id,"md"),Fe=C(n,Ei,"md"),et=le||C(n,zd,"md"),Ge=ne||pe.badgeSize||"sm",at=X||r,tt=B||t,Ne=t==="other"?"":C(ze,C(t,$i,"outline"),"primary"),Xe=i==="floating",be=Me=>(0,Ke.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${pe.icon}`,"aria-hidden":"true",children:Me}),je=()=>(0,Ke.jsx)(vt,{id:we,htmlFor:O,label:o,isRequired:Z,isFloating:Xe,size:e,color:ze,hasError:_,className:h}),pt=A&&A>0?re.slice(0,A):re,st=A&&A>0?Math.max(0,re.length-A):0,rr=Q?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-text",br=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2",pe.wrapper,Fe,Ne,rr,ye?"w-full":"w-auto min-w-[200px]",x].filter(Boolean).join(" "),ht=i==="left",nr=V===void 0||re.length<V,Yo=D&&!Q&&!q;return(0,Ke.jsxs)("div",{role:"group","aria-labelledby":we,className:`group/field flex ${ht?"flex-row items-center gap-3":"flex-col"} ${ye?"w-full":"inline-flex"} ${v}`,children:[(0,Ke.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:Ce}),!Xe&&je(),(0,Ke.jsxs)("div",{className:`flex flex-col ${ye?"w-full":""}`,children:[(0,Ke.jsxs)("div",{className:"flex items-stretch",children:[c&&(0,Ke.jsx)("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 ${Fe?`${Fe} rounded-r-none`:""}`,children:c}),(0,Ke.jsxs)("div",{className:`${br} ${c?"rounded-l-none!":""} ${p?"rounded-r-none!":""}`,children:[Xe&&je(),f&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1 pr-1.5 shrink-0",children:be(f)}),(0,Ke.jsxs)("div",{className:`flex flex-wrap items-center flex-1 min-w-0 ${pe.gap}`,children:[(()=>{let Me=new Map;return pt.map((Ue,Bt)=>{let Gt=(Me.get(Ue)??0)+1;Me.set(Ue,Gt);let Bn=`${Ue}_${Gt}`;return j?(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:j({value:Ue,index:Bt,onRemove:()=>Qe(Bt),disabled:Q,readOnly:q})},Bn):(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:(0,Ke.jsx)(ir,{size:Ge,variant:tt,color:at,radius:et,deleteAriaLabel:`Remove tag ${Ue}`,onDelete:!Q&&!q?()=>Qe(Bt):void 0,className:`shrink-0 max-w-full truncate select-none ${ue}`,children:Ue})},Bn)})})(),st>0&&(0,Ke.jsx)("span",{className:"inline-flex shrink-0",children:(0,Ke.jsxs)(ir,{size:Ge,variant:"filled",color:"neutral",radius:et,className:"shrink-0 font-medium select-none",children:["+",st]})}),nr?(0,Ke.jsx)("input",{ref:se,id:O,type:"text",value:U,onChange:Me=>Ee(Me.target.value),onKeyDown:Be,onPaste:Oe,onBlur:Ze,disabled:Q||ae,readOnly:q,autoFocus:L,"aria-invalid":_,"aria-required":Z,"aria-describedby":l||s?W:void 0,"aria-errormessage":l?W:void 0,"aria-busy":ae,"aria-disabled":Q||ae,"aria-autocomplete":"none",placeholder:re.length===0?ke:"",className:`flex-1 bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ${pe.input} ${ge}`}):null]}),Yo&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:P?P({onAdd:()=>Te(U),disabled:!U.trim()||!nr}):(0,Ke.jsx)("button",{type:"button",onClick:Me=>{Me.stopPropagation(),U.trim()&&nr?Te(U):fe.current?.focus()},disabled:!U.trim()||!nr,"aria-label":"Th\xEAm th\u1EBB",className:`inline-flex items-center justify-center p-1 rounded hover:bg-neutral-200 active:scale-95 disabled:opacity-40 disabled:pointer-events-none transition-all cursor-pointer text-neutral-600 hover:text-neutral-900 ${ie}`,children:(0,Ke.jsx)(Zr,{className:pe.icon})})}),ae&&ve&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",role:"status","aria-label":"\u0110ang t\u1EA3i",children:be((0,Ke.jsx)(De,{}))}),!ae&&Se&&!Q&&!q&&(0,Ke.jsx)("button",{type:"button",onClick:We,"aria-label":"X\xF3a t\u1EA5t c\u1EA3 c\xE1c th\u1EBB",tabIndex:K?0:-1,"aria-hidden":!K,className:`inline-flex items-center justify-center pl-1.5 shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${pe.icon} ${K?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Ke.jsx)(Ve,{className:"size-full"})}),!ae&&w&&(0,Ke.jsx)("div",{className:"flex items-center justify-center pl-1.5 shrink-0",children:be(w)})]}),p&&(0,Ke.jsx)("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 ${Fe?`${Fe} rounded-l-none`:""}`,children:p})]}),(0,Ke.jsx)(Le,{id:W,helperText:s,errorMessage:l,sizeClassName:pe.helper,className:k}),y&&(()=>{let Me=new Map;return(0,Ke.jsxs)(Ke.Fragment,{children:[re.map(Ue=>{let Bt=(Me.get(Ue)??0)+1;Me.set(Ue,Bt);let Gt=`${Ue}_${Bt}`;return(0,Ke.jsx)("input",{type:"hidden",name:`${y}[]`,value:Ue,disabled:Q||ae},`hidden_${Gt}`)}),re.length===0&&(0,Ke.jsx)("input",{type:"hidden",name:y,value:"",disabled:Q||ae})]})})()]})]})}var Vi=require("react"),Ud=Hn(require("react-textarea-autosize"),1),Yd=require("@floating-ui/react");var Ad={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"}},Od={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Gd={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},jd={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"}};var sr=require("react/jsx-runtime");function sl({size:e,variant:t,color:r,radius:n,label:o,labelPlacement:i="floating",config:a,helperText:s,errorMessage:l,onClear:f,minRows:c=3,maxRows:w,onHeightChange:p,cacheMeasurements:m,resize:v="none",wrapperClassName:x="",textareaWrapperClassName:h="",labelClassName:k="",helperClassName:T="",countClassName:y="",id:d,value:u,defaultValue:g,onChange:b,disabled:S=!1,readOnly:R=!1,className:D="",placeholder:P,maxLength:I,ref:E,style:N,...M}){let{isRequired:z=!1,isInvalid:H=!1,isLoading:V=!1,showSpinner:Y=!1,isClearable:$=!1,showCount:F=!1,isFullWidth:G=!1,autoResize:A=!0}=a??{},j=(0,Vi.useId)(),B=d||j,X=`${B}-error-helper`,le=(0,Vi.useRef)(null),[ne,ue]=(0,Vi.useState)(g),ie=(0,Yd.useMergeRefs)([le,E]),Q=u!==void 0,q=Q?u:ne,ge=!!(H||l),ke=ge?"error":r,L=C(e,Ad,"md"),te=C(n,Od,"md"),Z=A?"resize-none":C(v,Gd,"none"),he=t==="other"?"":C(ke,C(t,jd,"outline"),"primary"),ae=q!=null?String(q).length:0,ve=ae>0,Se=Re=>{let xe=Re.target.value;I!==void 0&&xe.length>I&&(xe=xe.slice(0,I),Re.target.value=xe),Q||ue(xe),b?.(Re)},ye=()=>{Q||ue(""),f?.()},J=i==="floating",O=()=>(0,sr.jsx)(vt,{htmlFor:B,label:o,isRequired:z,isFloating:J,size:e,color:ke,hasError:ge,className:k}),W=["group/textarea relative flex flex-col transition-all duration-150 ease-in-out border-2",te,he,S?"opacity-50":"",G?"w-full":"w-auto",h].filter(Boolean).join(" "),we=$||V&&Y,fe=["w-full bg-transparent outline-none border-none text-neutral-900 placeholder:text-neutral-400 disabled:cursor-not-allowed ui-scrollbar",L.textarea,we?"pr-8":"",F?"pb-6":"",Z,D].filter(Boolean).join(" "),se=i==="left",me={id:B,value:q,onChange:Se,disabled:S||V,readOnly:R,maxLength:I,"aria-invalid":ge,"aria-required":z,"aria-describedby":l||s?X:void 0,"aria-errormessage":l?X:void 0,"aria-busy":V,"aria-disabled":S||V,placeholder:P,className:fe,style:N,...M};return(0,sr.jsxs)("div",{className:`group/field flex ${se?"flex-row items-start gap-3":"flex-col"} ${J?"pt-2":""} ${G?"w-full":"inline-flex"} ${x}`,children:[!J&&O(),(0,sr.jsxs)("div",{className:`flex flex-col ${G?"w-full":""}`,children:[(0,sr.jsxs)("div",{className:W,children:[J&&O(),A?(0,sr.jsx)(Ud.default,{ref:ie,minRows:c,maxRows:w,onHeightChange:p,cacheMeasurements:m,...me}):(0,sr.jsx)("textarea",{ref:ie,rows:c,...me}),V&&Y&&(0,sr.jsx)("div",{className:"absolute top-2.5 right-2.5 text-neutral-400 size-4 select-none pointer-events-none",children:(0,sr.jsx)(De,{className:"size-full animate-spin"})}),!V&&$&&!S&&!R&&(0,sr.jsx)("button",{type:"button",onClick:ye,"aria-label":"X\xF3a n\u1ED9i dung",tabIndex:ve?0:-1,"aria-hidden":!ve,className:`absolute top-2.5 right-2.5 inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full size-4 ${ve?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,sr.jsx)(Ve,{className:"size-full"})}),F&&(0,sr.jsxs)("div",{className:`absolute bottom-2 right-2.5 text-[11px] font-mono select-none pointer-events-none z-10 text-neutral-400 ${y}`,children:[ae,I!==void 0&&`/${I}`]})]}),(0,sr.jsx)(Le,{id:X,helperText:s,errorMessage:l,sizeClassName:L.helper,className:T})]})]})}var cl=require("react");var ll={xs:{box:"size-3.5",icon:"size-2.5",label:"text-xs leading-4",gap:"gap-1.5",helper:"text-[10px]"},sm:{box:"size-4",icon:"size-3",label:"text-sm leading-4",gap:"gap-2",helper:"text-[11px]"},md:{box:"size-5",icon:"size-3.5",label:"text-sm leading-5",gap:"gap-2.5",helper:"text-xs"},lg:{box:"size-6",icon:"size-4",label:"text-base leading-6",gap:"gap-3",helper:"text-xs"},xl:{box:"size-7",icon:"size-5",label:"text-lg leading-7",gap:"gap-3.5",helper:"text-sm"}},Wd={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Kd={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"}},_d={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Xd={xs:"sm",sm:"sm",md:"md",lg:"md",xl:"lg"};var Kc=require("react/jsx-runtime");function Gn({width:e=14,height:t=14,className:r="",...n}){return(0,Kc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Kc.jsx)("polyline",{points:"20 6 9 17 4 12"})})}var _c=require("react/jsx-runtime");function ja({width:e=14,height:t=14,className:r="",...n}){return(0,_c.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,_c.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}var Xt=require("react/jsx-runtime");function Jr({size:e="md",variant:t="filled",color:r="primary",radius:n,config:o,label:i,children:a,helperText:s,errorMessage:l,labelPlacement:f="right",icon:c,indeterminateIcon:w,wrapperClassName:p="",boxClassName:m="",labelClassName:v="",helperClassName:x="",className:h="",checked:k,defaultChecked:T,disabled:y=!1,readOnly:d=!1,onChange:u,value:g,id:b,name:S,ref:R,...D}){let{isRequired:P=!1,isInvalid:I=!1,isLoading:E=!1,showSpinner:N=!1,indeterminate:M=!1}=o??{},z=i||a,H=(0,cl.useId)(),V=b||H,Y=`${V}-helper`,$=!!(I??!!l),F=k!==void 0,[G,A]=(0,cl.useState)(T??!1),j=F?k:G,B=Z=>{y||d||E||(F||A(Z.target.checked),u?.(Z))},X=C(e,ll,"md"),le=C(n,Wd,"md"),ne=j||M,ue=C(t==="other"?"filled":t,Kd,"filled"),ie;t==="other"?ie="":ne?ie=C(r,ue,"primary"):ie="bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",$&&(ie=ne?C("error",ue,"primary"):"bg-neutral-white border-error-500 hover:border-error-600 text-error-600 dark:bg-neutral-900 dark:border-error-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-error-400 peer-focus-visible:border-error-500");let Q=["inline-flex items-center justify-center shrink-0 border transition-all duration-150 select-none",X.box,le,ie,!y&&!d&&!E?"active:scale-95":"",m].filter(Boolean).join(" "),q=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",X.label,y?"opacity-60":"",v].filter(Boolean).join(" "),ge=["group inline-flex relative",f==="left"?"flex-row-reverse justify-between":"flex-row",X.gap,y?"opacity-50":"cursor-pointer",p,h].filter(Boolean).join(" "),ke=()=>E&&N?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:(0,Xt.jsx)(De,{className:"size-full animate-spin"})}):M?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:w||(0,Xt.jsx)(ja,{className:"size-full"})}):j?(0,Xt.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${X.icon}`,"aria-hidden":"true",children:c||(0,Xt.jsx)(Gn,{className:"size-full"})}):null,L=!!z,te=Z=>{(y||d||E)&&Z.preventDefault()};return(0,Xt.jsxs)("div",{className:`inline-flex flex-col ${h}`.trim(),children:[(0,Xt.jsxs)("label",{className:ge,onClick:te,children:[(0,Xt.jsx)("input",{ref:R,type:"checkbox",id:V,name:S,value:g,checked:j,disabled:y||E,readOnly:d,required:P,"aria-checked":M?"mixed":j,"aria-invalid":$,"aria-required":P,"aria-busy":E,"aria-disabled":y||E,"aria-describedby":l||s?Y:void 0,onChange:B,className:"sr-only peer",...D}),(0,Xt.jsx)("span",{className:Q,"aria-hidden":"true",children:ke()}),L&&(0,Xt.jsxs)("span",{className:q,children:[z,P&&(0,Xt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,Xt.jsx)(Le,{id:Y,helperText:s,errorMessage:l,sizeClassName:X.helper,className:x})]})}var yr=require("react");var lt={BASE:0,STICKY:10,DROPDOWN:50,POPOVER:50,SELECT:50,PICKER:50,TOOLTIP:60,SELECT_FILTER:100,MAX:99999};var jn=require("react");function go(e,t=300){let r=(0,jn.useRef)(e),n=(0,jn.useRef)(null);(0,jn.useEffect)(()=>{r.current=e},[e]);let o=(0,jn.useCallback)(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return(0,jn.useEffect)(()=>o,[o]),{debounced:(0,jn.useCallback)((...a)=>{o(),n.current=setTimeout(()=>{r.current(...a)},t)},[o,t]),cancel:o}}var Ua=require("react/jsx-runtime");function Ip({width:e=16,height:t=16,className:r="",...n}){return(0,Ua.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ua.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Ua.jsx)("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"})]})}var mo=Ip;var vr=require("react/jsx-runtime"),Mp=[],Fp=[];function bo({value:e,defaultValue:t=Fp,onChange:r,size:n="md",color:o="primary",variant:i="filled",radius:a,disabled:s=!1,label:l,helperText:f,errorMessage:c,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:v="",labelClassName:x="",helperClassName:h="",options:k=Mp,config:T,searchMode:y="client",searchPlaceholder:d="T\xECm ki\u1EBFm...",searchValue:u,defaultSearchValue:g="",onSearchChange:b,searchClassName:S="",searchField:R="label",filterFn:D,onSearch:P,debounceMs:I=300,emptyText:E="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",children:N,ref:M,...z}){let{isRequired:H=!1,isInvalid:V,isLoading:Y=!1,showSpinner:$=!1,isReadOnly:F=!1,searchable:G=!1,preserveSelected:A=!0,isSearching:j}=T??{},B=(0,yr.useId)(),X=`${B}-label`,le=`${B}-helper`,ne=`${B}-search`,ue=e!==void 0,[ie,Q]=(0,yr.useState)(t),q=ue?e:ie,ge=!!(V??!!c),ke=u!==void 0,[L,te]=(0,yr.useState)(g),Z=ke?u:L,[he,ae]=(0,yr.useState)(null),[ve,Se]=(0,yr.useState)(!1),ye=!!(j??ve),[J,O]=(0,yr.useState)(()=>{let ee=new Map;return k.forEach(U=>{ee.set(String(U.value),U)}),ee}),{debounced:W}=go(async ee=>{if(!(y!=="server"||!P))try{Se(!0);let U=await P(ee);Array.isArray(U)&&ae(U)}catch(U){console.error("Error fetching search options:",U)}finally{Se(!1)}},I),we=ee=>{let U=ee.target.value;ke||te(U),b?.(U),y==="server"&&W(U)},fe=()=>{ke||te(""),b?.(""),y==="server"&&W("")},se=(0,yr.useMemo)(()=>{let ee=Z.trim(),U=y==="server"&&he?he:k;if(!G||!ee)return U;let Ce;if(y==="server"?Ce=U:D?Ce=U.filter(oe=>D(oe,ee)):Ce=co(U,ee,R),!A)return Ce;let $e=new Set(Ce.map(oe=>String(oe.value))),Ee=[];for(let oe of q)if(!$e.has(oe)){let Te=J.get(oe);Te?Ee.push(Te):Ee.push({value:oe,label:oe})}return[...Ee,...Ce]},[G,Z,y,he,k,D,R,A,q,J]),me=(0,yr.useCallback)((ee,U)=>{if(s||F||Y)return;if(U){let Ee=(y==="server"&&he?he:k).find(oe=>String(oe.value)===ee);Ee&&O(oe=>{if(oe.has(ee))return oe;let Te=new Map(oe);return Te.set(ee,Ee),Te})}let Ce;U?Ce=[...q,ee]:Ce=q.filter($e=>$e!==ee),ue||Q(Ce),r?.(Ce)},[s,F,Y,q,ue,r,k,y,he]),Re=C(w,_d,"vertical"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",x].filter(Boolean).join(" "),re=C(n,ll,"md"),de=C(n,Xd,"md"),ce=(0,yr.useMemo)(()=>new Set(q.map(String)),[q]);return(0,vr.jsxs)("div",{ref:M,role:"group","aria-labelledby":l?X:void 0,"aria-describedby":c||f?le:void 0,"aria-disabled":s||Y?"true":void 0,"aria-busy":Y||ye?"true":void 0,className:`inline-flex flex-col ${v}`,...z,children:[l&&(0,vr.jsxs)("span",{id:X,className:xe,children:[l,H&&(0,vr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),G&&(0,vr.jsx)("div",{className:`mb-2.5 ${S}`,children:(0,vr.jsx)(Yt,{id:ne,variant:"outline",size:de,color:o,value:Z,onChange:we,placeholder:d,disabled:s,leftIcon:(0,vr.jsx)(mo,{className:"size-4 text-neutral-400"}),rightIcon:ye?(0,vr.jsx)(De,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:fe,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!ye,isFullWidth:!0}})}),(0,vr.jsx)("div",{className:`${Re} ${m}`,children:N||(se.length>0?se.map(ee=>{let U=String(ee.value),Ce=ce.has(U);return(0,vr.jsx)(Jr,{value:ee.value,label:ee.label,helperText:ee.description,disabled:s||!!ee.disabled,readOnly:F||!!ee.isReadOnly,size:n,color:o,variant:i,radius:a,labelPlacement:p,checked:Ce,onChange:$e=>me(U,$e.target.checked),config:{indeterminate:ee.indeterminate,isLoading:Y,showSpinner:$,isInvalid:ge,isRequired:H}},ee.value)}):(0,vr.jsx)("div",{className:"py-2 text-xs text-neutral-500 dark:text-neutral-400 italic",children:!Z.trim()&&y==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm...":E}))}),(0,vr.jsx)(Le,{id:le,helperText:f,errorMessage:c,sizeClassName:re.helper,className:h})]})}var pl=require("react");var dl={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"}},fl={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"}},qd={horizontal:"flex flex-row flex-wrap gap-4 items-center",vertical:"flex flex-col gap-2.5"},Zd={xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"xl"};var Xc=require("react/jsx-runtime");function Ya({className:e}){return(0,Xc.jsx)("svg",{viewBox:"0 0 10 10",className:e,fill:"currentColor","aria-hidden":"true",children:(0,Xc.jsx)("circle",{cx:"5",cy:"5",r:"5"})})}var wr=require("react/jsx-runtime");function Ai({size:e="md",variant:t="filled",color:r="primary",disabled:n=!1,readOnly:o=!1,config:i,labelPlacement:a="right",label:s,helperText:l,errorMessage:f,dotIcon:c,wrapperClassName:w="",boxClassName:p="",labelClassName:m="",helperClassName:v="",className:x="",checked:h,defaultChecked:k=!1,onChange:T,value:y,id:d,name:u,ref:g,...b}){let{isRequired:S=!1,isInvalid:R=!1,isLoading:D=!1}=i??{},P=(0,pl.useId)(),I=d||P,E=`${I}-helper`,N=h!==void 0,[M,z]=(0,pl.useState)(k),H=N?h:M,V=!!(R||f),Y=ie=>{n||o||D||(N||z(ie.target.checked),T?.(ie))},$=C(e,dl,"md"),F=t==="other"?"":C(r,C(t,fl,"filled"),"primary"),G=V?fl[t==="other"?"filled":t]?.error||fl.filled.error:H?F:"bg-neutral-white border-neutral-300 hover:border-neutral-400 dark:bg-neutral-900 dark:border-neutral-700 dark:hover:border-neutral-500 peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-primary-400 peer-focus-visible:border-primary-500",A=["inline-flex items-center justify-center shrink-0 border rounded-full transition-all duration-150 select-none",$.box,G,!n&&!o&&!D?"active:scale-95":"",p].filter(Boolean).join(" "),j=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",$.label,n?"opacity-60":"",m].filter(Boolean).join(" "),B=["group inline-flex relative",a==="left"?"flex-row-reverse justify-between":"flex-row",$.gap,n?"cursor-not-allowed opacity-60":"cursor-pointer",w,x].filter(Boolean).join(" "),X=()=>D?(0,wr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:(0,wr.jsx)(De,{className:"size-full animate-spin"})}):H?(0,wr.jsx)("span",{className:`inline-flex items-center justify-center animate-in zoom-in-75 duration-100 ${$.dot}`,"aria-hidden":"true",children:c||(0,wr.jsx)(Ya,{className:"size-full"})}):null,le=!!s;return(0,wr.jsxs)("div",{className:"inline-flex flex-col",children:[(0,wr.jsxs)("label",{className:B,onClick:ie=>{(n||o||D)&&ie.preventDefault()},children:[(0,wr.jsx)("input",{ref:g,type:"radio",id:I,name:u,value:y,checked:H,disabled:n||D,readOnly:o,required:S,"aria-busy":D,"aria-disabled":n||D,"aria-describedby":f||l?E:void 0,onChange:Y,onClick:ie=>{if(n||o||D){ie.preventDefault();return}b.onClick?.(ie)},className:"sr-only peer",...b}),(0,wr.jsx)("span",{className:A,"aria-hidden":"true",children:X()}),le&&(0,wr.jsxs)("span",{className:j,children:[s,S&&(0,wr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]})]}),(0,wr.jsx)(Le,{id:E,helperText:l,errorMessage:f,sizeClassName:$.helper,className:v})]})}var kr=require("react");var Cr=require("react/jsx-runtime"),Ep=[];function gl({options:e=Ep,value:t,defaultValue:r=null,onChange:n,size:o="md",color:i="primary",variant:a="filled",disabled:s=!1,label:l,helperText:f,errorMessage:c,orientation:w="vertical",labelPlacement:p="right",className:m="",wrapperClassName:v="",labelClassName:x="",helperClassName:h="",config:k,searchPlaceholder:T="T\xECm ki\u1EBFm...",searchValue:y,onSearchChange:d,searchMode:u="client",searchField:g="label",filterFn:b,onSearch:S,debounceMs:R=300,emptyText:D="Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3",searchClassName:P="",searchInputSize:I,ref:E,...N}){let{isRequired:M=!1,isInvalid:z,isLoading:H=!1,isReadOnly:V=!1,searchable:Y=!1,preserveSelected:$=!0,isSearching:F}=k??{},G=(0,kr.useId)(),A=`${G}-label`,j=`${G}-helper`,B=`${G}-search`,X=(0,kr.useId)(),le=t!==void 0,[ne,ue]=(0,kr.useState)(r??null),ie=le?t:ne,Q=!!(z||c),q=y!==void 0,[ge,ke]=(0,kr.useState)(""),L=q?y:ge,[te,Z]=(0,kr.useState)(!1),he=F??te,[ae,ve]=(0,kr.useState)(null),[Se,ye]=(0,kr.useState)(()=>{let re=new Map;return e.forEach(de=>{re.set(String(de.value),de)}),re}),{debounced:J}=go(async re=>{if(!(u!=="server"||!S))try{Z(!0);let de=await S(re);Array.isArray(de)&&ve(de)}catch(de){console.error("Error fetching radio search options:",de)}finally{Z(!1)}},R),O=re=>{let de=re.target.value;q||ke(de),d?.(de),u==="server"&&J(de)},W=()=>{q||ke(""),d?.(""),u==="server"&&ve(null)},we=(0,kr.useMemo)(()=>{let re=L.trim(),de=u==="server"&&ae?ae:e;if(!Y||!re)return de;let ce;if(u==="server"?ce=de:b?ce=de.filter(Ce=>b(Ce,re)):ce=co(de,re,g),!$||ie===null||ie===void 0)return ce;let ee=String(ie);if(!ce.some(Ce=>String(Ce.value)===ee)){let Ce=Se.get(ee);return Ce?[Ce,...ce]:[{value:ee,label:ee},...ce]}return ce},[Y,L,u,ae,e,b,g,$,ie,Se]),fe=(0,kr.useCallback)(re=>{if(s||V||H)return;let ce=(u==="server"&&ae?ae:e).find(ee=>String(ee.value)===re);ce&&ye(ee=>{if(ee.has(re))return ee;let U=new Map(ee);return U.set(re,ce),U}),le||ue(re),n?.(re)},[s,V,H,le,n,e,u,ae]),se=C(w,qd,"vertical"),me=C(o,dl,"md"),Re=I??C(o,Zd,"md"),xe=["text-sm font-semibold text-neutral-900 dark:text-neutral-100 mb-1.5 select-none",s?"opacity-60":"",x].filter(Boolean).join(" ");return(0,Cr.jsxs)("div",{ref:E,role:"radiogroup","aria-labelledby":l?A:void 0,"aria-describedby":c||f?j:void 0,"aria-errormessage":c?j:void 0,"aria-orientation":w,"aria-required":M?"true":void 0,"aria-invalid":Q?"true":void 0,"aria-disabled":s?"true":void 0,"aria-readonly":V?"true":void 0,"aria-busy":H?"true":void 0,className:`inline-flex flex-col ${v}`,...N,children:[l&&(0,Cr.jsxs)("span",{id:A,className:xe,children:[l,M&&(0,Cr.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),Y&&(0,Cr.jsx)("div",{className:`mb-2.5 ${P}`,children:(0,Cr.jsx)(Yt,{id:B,variant:"outline",size:Re,color:i,value:L,onChange:O,placeholder:T,disabled:s||H,leftIcon:(0,Cr.jsx)(mo,{className:"size-4 text-neutral-400"}),rightIcon:he?(0,Cr.jsx)(De,{className:"size-4 animate-spin text-neutral-400"}):void 0,onClear:W,"aria-label":typeof l=="string"?`T\xECm ki\u1EBFm ${l}`:"T\xECm ki\u1EBFm",config:{isClearable:!he,isFullWidth:!0}})}),(0,Cr.jsx)("div",{className:`${se} ${m}`,children:we.length>0?we.map(re=>{let de=String(re.value),ce=ie!=null&&String(ie)===de;return(0,Cr.jsx)(Ai,{name:X,value:re.value,checked:ce,onChange:()=>fe(de),label:re.label,helperText:re.description,disabled:s||!!re.disabled,readOnly:V||!!re.isReadOnly,size:o,color:i,variant:a,labelPlacement:p,config:{isLoading:H,isInvalid:Q,isRequired:M}},re.value)}):(0,Cr.jsx)("div",{className:"py-3 text-center text-sm text-neutral-400 select-none",children:!L.trim()&&u==="server"?"Nh\u1EADp t\u1EEB kh\xF3a \u0111\u1EC3 t\xECm ki\u1EBFm s\u1EA3n ph\u1EA9m...":D})}),(0,Cr.jsx)(Le,{id:j,helperText:f,errorMessage:c,sizeClassName:me.helper,className:h})]})}var Oi=require("react"),e0=require("@floating-ui/react");var Jd={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"}},qc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Qd={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"}}}};var qt=require("react/jsx-runtime");function ml({size:e,variant:t,color:r,radius:n,thumbRadius:o,config:i,label:a,helperText:s,errorMessage:l,labelPlacement:f="right",thumbIcon:c,startContent:w,endContent:p,wrapperClassName:m="",trackClassName:v="",thumbClassName:x="",labelClassName:h="",helperClassName:k="",className:T="",checked:y,defaultChecked:d,disabled:u=!1,readOnly:g=!1,onChange:b,onClick:S,value:R,id:D,name:P,ref:I,...E}){let{isRequired:N=!1,isInvalid:M=!1,isLoading:z=!1,showSpinner:H=!1}=i??{},V=(0,Oi.useId)(),Y=D||V,$=`${Y}-error-helper`,F=(0,Oi.useRef)(null),G=(0,e0.useMergeRefs)([F,I]),A=y!==void 0,[j,B]=(0,Oi.useState)(d??!1),X=A?!!y:j,le=W=>{u||g||z||(A||B(W.target.checked),b?.(W))},ne=W=>{if(u||g||z){W.preventDefault();return}S?.(W)},ue=W=>{(u||g||z)&&W.preventDefault()},ie=!!(M||l),Q=ie?"error":r,q=C(e,Jd,"md"),ge=C(n,qc,"full"),ke=C(o,qc,"full"),L=t==="other"?void 0:C(Q,C(t,Qd,"filled"),"primary"),te=L?X?L.checked.track:L.unchecked.track:"",Z=L?X?L.checked.thumb:L.unchecked.thumb:"",he=["relative inline-flex items-center shrink-0 border box-border transition-colors duration-200 ease-in-out cursor-pointer select-none",q.track,ge,te,u?"opacity-50":"",v].filter(Boolean).join(" "),ae=["pointer-events-none inline-flex items-center justify-center transition-transform duration-200 ease-in-out select-none",q.thumb,ke,Z,X?q.translate:"translate-x-0",x].filter(Boolean).join(" "),ve=["select-none font-medium text-neutral-900 dark:text-neutral-100 transition-colors",q.label,u?"opacity-50":"",h].filter(Boolean).join(" "),ye=["group inline-flex items-center relative",f==="left"?"flex-row-reverse justify-between":"flex-row",q.gap,u?"cursor-not-allowed opacity-60":"cursor-pointer",m,T].filter(Boolean).join(" "),J=()=>z&&H?(0,qt.jsx)("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:(0,qt.jsx)(De,{className:"size-full animate-spin"})}):typeof c=="function"?c({isChecked:X,className:q.icon}):c?(0,qt.jsx)("span",{className:`inline-flex items-center justify-center ${q.icon}`,"aria-hidden":"true",children:c}):null,O=()=>a?(0,qt.jsxs)("span",{className:ve,children:[a,N&&(0,qt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null;return(0,qt.jsxs)("div",{className:"inline-flex flex-col",children:[(0,qt.jsxs)("label",{className:ye,onClick:ue,children:[(0,qt.jsx)("input",{ref:G,type:"checkbox",role:"switch",id:Y,name:P,value:R,checked:X,onChange:le,onClick:ne,disabled:u||z,readOnly:g,required:N,"aria-checked":X,"aria-invalid":ie,"aria-required":N,"aria-describedby":l||s?$:void 0,"aria-errormessage":l?$:void 0,"aria-busy":z,"aria-disabled":u||z,className:"sr-only peer",...E}),(0,qt.jsxs)("span",{className:he,"aria-hidden":"true",children:[w&&(0,qt.jsx)("span",{className:`absolute left-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-100":"opacity-0"}`,children:w}),(0,qt.jsx)("span",{className:ae,children:J()}),p&&(0,qt.jsx)("span",{className:`absolute right-1.5 inline-flex items-center justify-center select-none font-medium transition-opacity duration-200 ${q.content} ${X?"opacity-0":"opacity-100"}`,children:p})]}),O()]}),(0,qt.jsx)(Le,{id:$,helperText:s,errorMessage:l,sizeClassName:q.helper,className:k})]})}var Zc=require("react/jsx-runtime");function yt({width:e=16,height:t=16,className:r="",...n}){return(0,Zc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Zc.jsx)("path",{d:"m6 9 6 6 6-6"})})}var Jc=require("react/jsx-runtime");function Sr({width:e=16,height:t=16,className:r="",...n}){return(0,Jc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Jc.jsx)("path",{d:"m15 18-6-6 6-6"})})}var Qc=require("react/jsx-runtime");function Tr({width:e=16,height:t=16,className:r="",...n}){return(0,Qc.jsx)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:(0,Qc.jsx)("path",{d:"m9 18 6-6-6-6"})})}var Wo=require("react/jsx-runtime");function eu({width:e=16,height:t=16,className:r="",...n}){return(0,Wo.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wo.jsx)("path",{d:"M8 2v4"}),(0,Wo.jsx)("path",{d:"M16 2v4"}),(0,Wo.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,Wo.jsx)("path",{d:"M3 10h18"})]})}var Wa=require("react/jsx-runtime");function tu({width:e=16,height:t=16,className:r="",...n}){return(0,Wa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wa.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Wa.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}var Ka=require("react/jsx-runtime");function Un({width:e=16,height:t=16,className:r="",...n}){return(0,Ka.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ka.jsx)("path",{d:"m11 17-5-5 5-5"}),(0,Ka.jsx)("path",{d:"m18 17-5-5 5-5"})]})}var _a=require("react/jsx-runtime");function Yn({width:e=16,height:t=16,className:r="",...n}){return(0,_a.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,_a.jsx)("path",{d:"m6 17 5-5-5-5"}),(0,_a.jsx)("path",{d:"m13 17 5-5-5-5"})]})}var lr=require("react/jsx-runtime");function $p(e){return(0,lr.jsxs)("svg",{viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,lr.jsx)("ellipse",{cx:"48",cy:"80",rx:"36",ry:"8",className:"fill-neutral-200/60 dark:fill-neutral-800/60"}),(0,lr.jsx)("ellipse",{cx:"48",cy:"80",rx:"22",ry:"4.5",className:"fill-neutral-300/50 dark:fill-neutral-700/50"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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"}),(0,lr.jsx)("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 bl=$p;var Rr=require("react/jsx-runtime");function Lp(e){return(0,Rr.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Rr.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Rr.jsx)("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"}),(0,Rr.jsx)("line",{x1:"42",y1:"36",x2:"66",y2:"36",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsx)("line",{x1:"42",y1:"44",x2:"60",y2:"44",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsx)("line",{x1:"42",y1:"52",x2:"52",y2:"52",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2.5",strokeLinecap:"round"}),(0,Rr.jsxs)("g",{transform:"translate(48, 38)",children:[(0,Rr.jsx)("circle",{cx:"28",cy:"28",r:"20",className:"fill-primary-50/80 dark:fill-primary-950/70 stroke-primary-500",strokeWidth:"3"}),(0,Rr.jsx)("path",{d:"M18 20A14 14 0 0 1 34 16",className:"stroke-primary-300",strokeWidth:"2",strokeLinecap:"round"}),(0,Rr.jsx)("path",{d:"M24 24L32 32M32 24L24 32",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"2",strokeLinecap:"round"}),(0,Rr.jsx)("path",{d:"M42 42L58 58",className:"stroke-primary-700 dark:stroke-primary-400",strokeWidth:"5",strokeLinecap:"round"})]})]})}var hl=Lp;var hn=require("react/jsx-runtime");function Bp(e){return(0,hn.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,hn.jsx)("ellipse",{cx:"60",cy:"100",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,hn.jsx)("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"}),(0,hn.jsx)("path",{d:"M60 30L78 64H42L60 30Z",className:"fill-error-100 dark:fill-error-900/60 stroke-error-500",strokeWidth:"2.5",strokeLinejoin:"round"}),(0,hn.jsx)("line",{x1:"60",y1:"42",x2:"60",y2:"52",className:"stroke-error-600",strokeWidth:"2.5",strokeLinecap:"round"}),(0,hn.jsx)("circle",{cx:"60",cy:"58",r:"1.5",className:"fill-error-600"}),(0,hn.jsx)("path",{d:"M22 66L32 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"}),(0,hn.jsx)("path",{d:"M98 66L88 60",className:"stroke-neutral-300 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 3"})]})}var xl=Bp;var Wn=require("react/jsx-runtime");function Hp(e){return(0,Wn.jsxs)("svg",{viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Wn.jsx)("ellipse",{cx:"60",cy:"98",rx:"42",ry:"10",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Wn.jsx)("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"}),(0,Wn.jsx)("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"}),(0,Wn.jsx)("line",{x1:"44",y1:"40",x2:"68",y2:"40",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Wn.jsx)("line",{x1:"44",y1:"48",x2:"60",y2:"48",className:"stroke-neutral-200 dark:stroke-neutral-700",strokeWidth:"2",strokeLinecap:"round"}),(0,Wn.jsx)("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 vl=Hp;var Ko=require("react/jsx-runtime");function Vp(e){return(0,Ko.jsxs)("svg",{viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"size-full",...e,children:[(0,Ko.jsx)("ellipse",{cx:"32",cy:"54",rx:"24",ry:"5",className:"fill-neutral-200/50 dark:fill-neutral-800/50"}),(0,Ko.jsx)("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"}),(0,Ko.jsx)("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"}),(0,Ko.jsx)("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 yl=Vp;var Gi=require("react/jsx-runtime");function Dr({width:e=20,height:t=20,className:r="",...n}){return(0,Gi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Gi.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Gi.jsx)("path",{d:"M12 16v-4"}),(0,Gi.jsx)("path",{d:"M12 8h.01"})]})}var Xa=require("react/jsx-runtime");function _o({width:e=20,height:t=20,className:r="",...n}){return(0,Xa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Xa.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Xa.jsx)("path",{d:"m9 12 2 2 4-4"})]})}var ji=require("react/jsx-runtime");function Xo({width:e=20,height:t=20,className:r="",...n}){return(0,ji.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ji.jsx)("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"}),(0,ji.jsx)("path",{d:"M12 9v4"}),(0,ji.jsx)("path",{d:"M12 17h.01"})]})}var Ui=require("react/jsx-runtime");function qo({width:e=20,height:t=20,className:r="",...n}){return(0,Ui.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ui.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ui.jsx)("path",{d:"M12 8v4"}),(0,Ui.jsx)("path",{d:"M12 16h.01"})]})}var Zo=require("react/jsx-runtime");function Jo({width:e=20,height:t=20,className:r="",...n}){return(0,Zo.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Zo.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Zo.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,Zo.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),(0,Zo.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var Yi=require("react/jsx-runtime");function Qo({width:e=20,height:t=20,className:r="",...n}){return(0,Yi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Yi.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,Yi.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,Yi.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}var qa=require("react/jsx-runtime");function Kn({width:e=20,height:t=20,className:r="",...n}){return(0,qa.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,qa.jsx)("path",{d:"M21 2v6h-6"}),(0,qa.jsx)("path",{d:"M21 8A10 10 0 1 0 22 13"})]})}var Za=require("react/jsx-runtime");function ei({width:e=20,height:t=20,className:r="",...n}){return(0,Za.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Za.jsx)("path",{d:"M3 2v6h6"}),(0,Za.jsx)("path",{d:"M3 8a10 10 0 1 1-1 5"})]})}var _n=require("react/jsx-runtime");function ti({width:e=20,height:t=20,className:r="",...n}){return(0,_n.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,_n.jsx)("path",{d:"m3 7 5 5-5 5V7z"}),(0,_n.jsx)("path",{d:"m21 7-5 5 5 5V7z"}),(0,_n.jsx)("path",{d:"M12 20v2"}),(0,_n.jsx)("path",{d:"M12 14v2"}),(0,_n.jsx)("path",{d:"M12 8v2"}),(0,_n.jsx)("path",{d:"M12 2v2"})]})}var Wi=require("react/jsx-runtime");function Qr({width:e=20,height:t=20,className:r="",...n}){return(0,Wi.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Wi.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Wi.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,Wi.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}var Ja=require("react/jsx-runtime");function cr({width:e=20,height:t=20,className:r="",...n}){return(0,Ja.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ja.jsx)("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,Ja.jsx)("path",{d:"M3 3v5h5"})]})}var Ki=require("react/jsx-runtime");function Qa({width:e=20,height:t=20,className:r="",...n}){return(0,Ki.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Ki.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,Ki.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,Ki.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}var es=require("react/jsx-runtime");function ts({width:e=16,height:t=16,className:r="",...n}){return(0,es.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,es.jsx)("path",{d:"M6 2v14a2 2 0 0 0 2 2h14"}),(0,es.jsx)("path",{d:"M18 22V8a2 2 0 0 0-2-2H2"})]})}var ri=require("react/jsx-runtime");function Br({width:e=16,height:t=16,className:r="",...n}){return(0,ri.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ri.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,ri.jsx)("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"}),(0,ri.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,ri.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var ru=require("react/jsx-runtime");function Zt({width:e=24,height:t=24,className:r="",...n}){return(0,ru.jsx)("svg",{width:e,height:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:r,...n,children:(0,ru.jsx)("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 ni=require("react/jsx-runtime");function rs({width:e=24,height:t=24,variant:r="solid",className:n="",...o}){return r==="outline"?(0,ni.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,...o,children:[(0,ni.jsx)("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),(0,ni.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}):(0,ni.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,...o,children:(0,ni.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z"})})}var ns=require("react/jsx-runtime");function os({width:e=16,height:t=16,className:r="",...n}){return(0,ns.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ns.jsx)("path",{d:"m7 15 5 5 5-5"}),(0,ns.jsx)("path",{d:"m7 9 5-5 5 5"})]})}var is=require("react/jsx-runtime");function as({width:e=16,height:t=16,className:r="",...n}){return(0,is.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,is.jsx)("path",{d:"m5 12 7-7 7 7"}),(0,is.jsx)("path",{d:"M12 19V5"})]})}var ss=require("react/jsx-runtime");function ls({width:e=16,height:t=16,className:r="",...n}){return(0,ss.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,ss.jsx)("path",{d:"M12 5v14"}),(0,ss.jsx)("path",{d:"m19 12-7 7-7-7"})]})}var Hr=require("react/jsx-runtime");function cs({width:e=16,height:t=16,className:r="",...n}){return(0,Hr.jsxs)("svg",{width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:r,...n,children:[(0,Hr.jsx)("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),(0,Hr.jsx)("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),(0,Hr.jsx)("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),(0,Hr.jsx)("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),(0,Hr.jsx)("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),(0,Hr.jsx)("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),(0,Hr.jsx)("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),(0,Hr.jsx)("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),(0,Hr.jsx)("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}var t0={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"}},r0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},n0={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"}},o0={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"}},i0={primary:Dr,secondary:Dr,neutral:Dr,info:Dr,success:_o,warning:Xo,error:qo};var Vr=require("react/jsx-runtime");function oi({size:e,variant:t,color:r,radius:n,title:o,description:i,icon:a=!0,action:s,closable:l=!0,onClose:f,closeAriaLabel:c="\u0110\xF3ng c\u1EA3nh b\xE1o",banner:w=!1,titleClassName:p="",descriptionClassName:m="",actionClassName:v="",iconClassName:x="",closeButtonClassName:h="",className:k="",children:T,role:y,ref:d,...u}){let g=C(e,t0,"md"),b=w?"rounded-none border-x-0 w-full":C(n,r0,"lg"),S=t==="other"?"":C(r,C(t,n0,"soft"),"info"),R=t==="other"?"":C(r,C(t,o0,"soft"),"info"),D=l||!!f,P=Y=>{Y.stopPropagation(),f?.()},E=y||(r==="error"||r==="warning"?"alert":"status"),N=r==="error"||r==="warning"?"assertive":"polite",M=i??T,z=!!M,H=()=>{if(a===!1)return null;if(a!==!0&&a!==void 0)return(0,Vr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon} ${x}`,"aria-hidden":"true",children:a});let Y=C(r,i0,"info");return(0,Vr.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 leading-none ${g.icon} ${R} ${x}`,"aria-hidden":"true",children:(0,Vr.jsx)(Y,{className:"size-full"})})},V=["relative flex w-full",g.container,b,S,k].filter(Boolean).join(" ");return(0,Vr.jsxs)("div",{ref:d,role:E,"aria-live":N,className:V,...u,children:[H(),(0,Vr.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[o&&(0,Vr.jsx)("div",{className:`${g.title} ${p}`,children:o}),z&&(0,Vr.jsx)("div",{className:`${g.description} ${o?"mt-0.5":""} ${m}`,children:M})]}),s&&(0,Vr.jsx)("div",{className:`inline-flex items-center shrink-0 ${g.action} ${v}`,children:s}),D&&(0,Vr.jsx)("button",{type:"button",onClick:P,"aria-label":c,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 ${t==="filled"?"hover:bg-white/20 active:bg-white/30":"hover:bg-black/5 active:bg-black/10"} ${g.closeButton} ${h}`,children:(0,Vr.jsx)(Ve,{className:g.closeIcon})})]})}var a0=require("sonner");var en=4e3;var s0=require("react/jsx-runtime");function wl({position:e="top-right",visibleToasts:t=3,expand:r=!1,duration:n=4e3,closeButton:o=!1,className:i="",toastOptions:a,...s}){return(0,s0.jsx)(a0.Toaster,{position:e,visibleToasts:t,expand:r,duration:n,closeButton:o,className:`toaster group ${i}`,toastOptions:{unstyled:!0,className:"w-full max-w-md pointer-events-auto",...a},...s})}var l0=require("react"),ii=require("sonner");var Cl=require("react/jsx-runtime");function ho(e,t="info",r="soft",n,o={},i){let{duration:a,position:s,onDismiss:l,onAutoClose:f,...c}=o;return ii.toast.custom(w=>(0,Cl.jsx)(oi,{color:t,variant:r,title:e,description:n,closable:c.closable??!0,onClose:()=>{c.onClose?.(),ii.toast.dismiss(w)},...c}),{id:i,duration:a??4e3,position:s,onDismiss:l,onAutoClose:f})}function Ap(e){return typeof e=="object"&&e!==null&&!(0,l0.isValidElement)(e)&&!Array.isArray(e)&&("title"in e||"description"in e||"color"in e||"variant"in e)}function nu(e,t,r){return Ap(e)?{title:e.title??"",description:e.description,color:e.color??t,variant:e.variant??r}:{title:e,description:void 0,color:t,variant:r}}var xn=((e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,n)});xn.custom=(e,t={})=>{if(typeof e=="function")return ii.toast.custom(s=>e(s),{duration:t.duration??4e3,position:t.position,onDismiss:t.onDismiss,onAutoClose:t.onAutoClose});let{duration:r,position:n,onDismiss:o,onAutoClose:i,...a}=e;return ii.toast.custom(s=>(0,Cl.jsx)(oi,{closable:a.closable??!0,onClose:()=>{a.onClose?.(),ii.toast.dismiss(s)},...a}),{duration:r??4e3,position:n,onDismiss:o,onAutoClose:i})};xn.success=(e,t,r)=>{let n=r||{};return ho(e,n.color||"success",n.variant||"soft",t,n)};xn.error=(e,t,r)=>{let n=r||{};return ho(e,n.color||"error",n.variant||"soft",t,n)};xn.warning=(e,t,r)=>{let n=r||{};return ho(e,n.color||"warning",n.variant||"soft",t,n)};xn.info=(e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,n)};xn.loading=(e,t,r)=>{let n=r||{};return ho(e,n.color||"info",n.variant||"soft",t,{...n,icon:n.icon??(0,Cl.jsx)(De,{className:"size-full animate-spin"}),duration:n.duration??1/0,closable:n.closable??!1})};xn.promise=async(e,t)=>{let r=typeof e=="function"?e():e,{title:n,description:o}=nu(t.loading,"info",t.variant||"soft"),i=xn.loading(n,o,{size:t.size,variant:t.variant,radius:t.radius});try{let a=await r,s=typeof t.success=="function"?t.success(a):t.success,{title:l,description:f,color:c,variant:w}=nu(s,"success",t.variant||"soft");return ho(l,c,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}catch(a){let s=typeof t.error=="function"?t.error(a):t.error,{title:l,description:f,color:c,variant:w}=nu(s,"error",t.variant||"soft");throw ho(l,c,w,f,{duration:t.duration??4e3,size:t.size,radius:t.radius},i),a}finally{t.finally&&await t.finally()}};xn.dismiss=e=>ii.toast.dismiss(e);var ou=xn;var Xn=require("react"),nt=require("@floating-ui/react");var c0=require("@floating-ui/react");function rt(e,t={}){let{duration:r=150,offset:n=4,scale:o=.96,animated:i=!0}=t;return(0,c0.useTransitionStyles)(e,{duration:i?r:0,initial:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`}),open:{opacity:1,transform:"translate(0px, 0px) scale(1)"},close:({side:a})=>({opacity:0,transform:a==="top"?`translateY(${n}px) scale(${o})`:a==="bottom"?`translateY(-${n}px) scale(${o})`:a==="left"?`translateX(${n}px) scale(${o})`:`translateX(-${n}px) scale(${o})`})})}var u0={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}},d0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},f0={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"}},p0={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 vn=require("react/jsx-runtime");function Op({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,Xn.isValidElement)(e)?e.props?.ref:void 0,a=(0,nt.useMergeRefs)([t,i]);if(!(0,Xn.isValidElement)(e))return null;let s=e.props||{};return(0,Xn.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function _i({content:e,children:t,placement:r="top",variant:n,color:o,size:i,radius:a,hasArrow:s=!0,offset:l=8,flip:f=!0,shift:c=!0,delay:w={open:200,close:150},disabled:p=!1,animated:m=!0,animationDuration:v=150,open:x,defaultOpen:h=!1,onOpenChange:k,className:T="",arrowClassName:y="",zIndex:d=lt.TOOLTIP}){let[u,g]=(0,Xn.useState)(h),[b,S]=(0,Xn.useState)(null),R=x!==void 0,D=R?x:u,P=q=>{R||g(q),k?.(q)},I=[(0,nt.offset)(l),f?(0,nt.flip)():void 0,c?(0,nt.shift)({padding:8}):void 0,s?(0,nt.arrow)({element:b}):void 0].filter(Boolean),{refs:{setReference:E,setFloating:N},floatingStyles:M,context:z,placement:H}=(0,nt.useFloating)({placement:r,open:D&&!p,onOpenChange:P,whileElementsMounted:nt.autoUpdate,transform:!1,middleware:I}),V=(0,nt.useHover)(z,{move:!1,delay:w,enabled:!p}),Y=(0,nt.useFocus)(z,{enabled:!p}),$=(0,nt.useDismiss)(z),F=(0,nt.useRole)(z,{role:"tooltip"}),{getReferenceProps:G,getFloatingProps:A}=(0,nt.useInteractions)([V,Y,$,F]),{isMounted:j,styles:B}=rt(z,{duration:v,animated:m}),X=C(i,u0,"md"),le=C(a,d0,"md"),ne=n==="other"?"":C(o,C(n,f0,"filled"),"neutral"),ue=n==="other"?"":C(o,C(n,p0,"filled"),"neutral"),ie=["select-none pointer-events-none max-w-xs break-words",X.box,le,ne,T].filter(Boolean).join(" "),Q=G();return(0,vn.jsxs)(vn.Fragment,{children:[(0,Xn.isValidElement)(t)?(0,vn.jsx)(Op,{ref:E,disabled:p,...Q,children:t}):(0,vn.jsx)("span",{ref:E,...Q,children:t}),(0,vn.jsx)(nt.FloatingPortal,{children:j&&!p&&e&&(0,vn.jsxs)("div",{ref:N,style:{...M,...m?B:{},zIndex:d},className:ie,"data-state":D?"open":"closed","data-placement":H,...A(),children:[e,s&&(0,vn.jsx)(nt.FloatingArrow,{ref:S,context:z,width:X.arrowWidth,height:X.arrowHeight,strokeWidth:n==="outline"||n==="soft"?1:0,className:[ue,y].filter(Boolean).join(" ")})]})})]})}var Tl=require("react"),Zi=Hn(require("@radix-ui/react-slider"),1);var ai={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"}},iu={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},g0={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:""}}};var kl=require("react"),m0=Hn(require("@radix-ui/react-slider"),1);var us=require("react/jsx-runtime");function Xi({id:e,thumbIdx:t,value:r,orientation:n,size:o,thumbRadiusClass:i,thumbThemeStyles:a,thumbClassName:s="",tooltipClassName:l="",state:f,label:c,helperId:w,tooltipMode:p="none",tooltipPlacement:m,formatTooltip:v}){let{isLoading:x=!1,showSpinner:h=!1,disabled:k=!1,readOnly:T=!1,isRequired:y=!1,isInvalid:d=!1,isRange:u=!1,hasDescription:g=!1}=f??{},b=C(o,ai,"md"),[S,R]=(0,kl.useState)(!1),[D,P]=(0,kl.useState)(!1),[I,E]=(0,kl.useState)(!1),N;p==="always"?N=!0:p==="active"?N=I||D:p==="hover"?N=S||I||D:p==="none"&&(N=!1);let M=m||(n==="vertical"?"right":"top"),z=v?v(r):r.toString(),H=typeof z=="string"||typeof z=="number"?String(z):void 0,V=(0,us.jsx)(m0.Thumb,{id:`${e}-thumb-${t}`,tabIndex:k||x?-1:0,"aria-busy":x,"aria-disabled":k||x,"aria-readonly":T,"aria-required":y,"aria-invalid":d,"aria-errormessage":d?w:void 0,"aria-describedby":g?w:void 0,"aria-valuetext":H,"aria-orientation":n,"aria-label":typeof c=="string"?`${c} ${u?t===0?"minimum":"maximum":""}`:`Slider ${u?t===0?"min":"max":""}`,onFocus:()=>P(!0),onBlur:()=>P(!1),onPointerEnter:()=>R(!0),onPointerLeave:()=>R(!1),onPointerDown:()=>E(!0),onPointerUp:()=>E(!1),className:`block relative z-10 select-none outline-none transition-transform duration-100 ease-out ${k||T?"cursor-not-allowed opacity-60 shadow-none":"cursor-grab active:cursor-grabbing hover:scale-105"} ${b.thumb} ${i} ${a} ${I&&!k&&!x?"scale-110 ring-4 ring-primary-500/20":""} ${s}`,children:x&&h&&(0,us.jsx)("div",{className:"absolute inset-0 flex items-center justify-center p-0.5","aria-hidden":"true",children:(0,us.jsx)(De,{className:"size-full animate-spin text-current"})})});return p!=="none"?(0,us.jsx)(_i,{content:z,placement:M,open:N,size:b.tooltipSize,className:l,disabled:k||x,children:V}):V}function Sl(e,t,r){return Math.min(Math.max(e,t),r)}function qi(e,t,r){return r<=t?0:Sl((e-t)/(r-t)*100,0,100)}var si=require("react/jsx-runtime");function ds({marks:e,min:t,max:r,step:n,orientation:o,size:i,markClassName:a=""}){if(!e)return null;let s=[];if(Array.isArray(e))s=e;else if(e===!0&&n>0){let f=Math.floor((r-t)/n);if(f<=20)for(let c=0;c<=f;c++){let w=t+c*n;s.push({value:w,label:w.toString()})}}if(!s.length)return null;let l=C(i,ai,"md");return(0,si.jsx)("div",{className:`relative w-full ${o==="vertical"?"h-full":"mt-2"}`,"aria-hidden":"true",children:s.map(f=>{let c=qi(f.value,t,r);return(0,si.jsx)("div",{className:`absolute flex items-center justify-center select-none text-neutral-500 dark:text-neutral-400 ${l.markText} ${a}`,style:o==="vertical"?{bottom:`${c}%`,left:"100%",transform:"translateY(50%) translateX(6px)"}:{left:`${c}%`,transform:"translateX(-50%)"},children:f.label??f.value},f.value)})})}function fs({showSteps:e,min:t,max:r,step:n,orientation:o,size:i,isRange:a,currentValues:s}){if(!e||n<=0)return null;let l=Math.floor((r-t)/n);if(l>100)return null;let f=C(i,ai,"md"),c=[];for(let w=0;w<=l;w++){let p=t+w*n,m=qi(p,t,r),v=a?p>=(s[0]??t)&&p<=(s[1]??r):p<=(s[0]??t);c.push((0,si.jsx)("span",{"aria-hidden":"true",className:`absolute rounded-full -translate-x-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-150 ${f.stepDot} ${v?"bg-white/80 dark:bg-neutral-900/80":"bg-neutral-400/60 dark:bg-neutral-500/60"}`,style:o==="vertical"?{bottom:`${m}%`,left:"50%"}:{left:`${m}%`,top:"50%"}},`step-dot-${p}`))}return(0,si.jsx)(si.Fragment,{children:c})}var gt=require("react/jsx-runtime");function Ji({config:e,value:t,defaultValue:r,min:n=0,max:o=100,step:i=1,minStepsBetweenThumbs:a=0,inverted:s=!1,size:l,variant:f,color:c,radius:w,thumbRadius:p,orientation:m="horizontal",label:v,labelPlacement:x="top",formatValue:h,showTooltip:k="none",tooltipPlacement:T,formatTooltip:y,marks:d=!1,startContent:u,endContent:g,disabled:b=!1,readOnly:S=!1,helperText:R,errorMessage:D,name:P,id:I,onChange:E,onChangeEnd:N,className:M="",wrapperClassName:z="",trackWrapperClassName:H="",trackClassName:V="",fillerClassName:Y="",thumbClassName:$="",labelClassName:F="",valueClassName:G="",helperClassName:A="",tooltipClassName:j="",markClassName:B="",ref:X}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,showSteps:Q=!1,showValue:q=!1,isFullWidth:ge=!0}=e??{},ke=(0,Tl.useId)(),L=I||ke,te=`${L}-helper`,Z=!!(ne||D),he=Z?"error":c,ae=Array.isArray(t??r),ve=t!==void 0,[Se,ye]=(0,Tl.useState)(()=>r!==void 0?Array.isArray(r)?r:[r]:ae?[n,o]:[n]),J=ve?Array.isArray(t)?t:t!==void 0?[t]:void 0:void 0,O=ve?Array.isArray(t)?[t[0]??n,t[1]??o]:[t??n,0]:ae?[Se[0]??n,Se[1]??o]:[Se[0]??n,0],W=U=>{if(b||S||ue)return;ve||ye(U);let Ce=ae?[U[0]??n,U[1]??o]:U[0]??n;E?.(Ce)},we=U=>{if(b||S||ue)return;let Ce=ae?[U[0]??n,U[1]??o]:U[0]??n;N?.(Ce)},fe=C(l,ai,"md"),se=C(w,iu,"full"),me=C(p,iu,"full"),Re=f==="other"?{track:"",filler:"",thumb:""}:C(he,C(f,g0,"filled"),"primary"),xe=Re.track,re=Re.filler,de=Re.thumb,ce=()=>{if(!v&&!q)return null;let U="";h?U=h(ae?O:O[0]):ae?U=`${O[0]} - ${O[1]}`:U=`${O[0]}`;let Ce=Z?"text-error-600 font-medium":"text-neutral-900 dark:text-neutral-100";return(0,gt.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5 select-none",children:[v&&(0,gt.jsxs)("label",{htmlFor:`${L}-thumb-0`,className:`font-medium ${Ce} ${fe.label} ${b?"opacity-60 cursor-not-allowed":"cursor-pointer"} ${F}`,children:[v,le&&(0,gt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),q&&(0,gt.jsx)("span",{className:`select-none text-neutral-700 dark:text-neutral-300 ${fe.value} ${G}`,"aria-hidden":"true",children:U})]})},ee=ae?[O[0],O[1]]:[O[0]];return(0,gt.jsxs)("div",{ref:X,className:`group/field flex flex-col ${ge?"w-full":"inline-flex"} ${b?"opacity-60 cursor-not-allowed":""} ${z||M}`,children:[x==="top"&&ce(),(0,gt.jsxs)("div",{className:`flex items-center ${fe.gap} ${m==="vertical"?"flex-col h-48":"flex-row w-full"} ${H}`,children:[x==="left"&&ce(),u&&(0,gt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:u}),(0,gt.jsxs)(Zi.Root,{min:n,max:o,step:i,minStepsBetweenThumbs:a,inverted:s,orientation:m,disabled:b||ue||S,value:J,defaultValue:r!==void 0?Array.isArray(r)?r:[r]:void 0,onValueChange:W,onValueCommit:we,className:`relative flex items-center select-none touch-none ${m==="vertical"?"flex-col h-full w-auto justify-center":"w-full h-auto justify-center"} ${b||S?"cursor-not-allowed":"cursor-pointer"}`,children:[(0,gt.jsxs)(Zi.Track,{className:`relative overflow-hidden ${m==="vertical"?`${fe.trackVertical} h-full`:`${fe.trackHorizontal} w-full`} ${se} ${xe} ${V}`,children:[(0,gt.jsx)(fs,{showSteps:Q,min:n,max:o,step:i,orientation:m,size:l||"md",isRange:ae,currentValues:O}),(0,gt.jsx)(Zi.Range,{className:`absolute ${re} ${se} ${Y}`})]}),ee.map((U,Ce)=>{let $e=ae?Ce===0?`${L}-thumb-min`:`${L}-thumb-max`:`${L}-thumb-single`;return(0,gt.jsx)(Xi,{id:L,thumbIdx:Ce,value:U,orientation:m,size:l||"md",thumbRadiusClass:me,thumbThemeStyles:de,thumbClassName:$,tooltipClassName:j,state:{isLoading:ue,showSpinner:ie,disabled:b,readOnly:S,isRequired:le,isInvalid:Z,isRange:ae,hasDescription:!!(Z||R)},label:v,helperId:te,tooltipMode:k,tooltipPlacement:T,formatTooltip:y},$e)})]}),g&&(0,gt.jsx)("div",{className:"inline-flex shrink-0 items-center justify-center select-none text-neutral-500 dark:text-neutral-400","aria-hidden":"true",children:g}),x==="right"&&ce()]}),(0,gt.jsx)(ds,{marks:d,min:n,max:o,step:i,orientation:m,size:l||"md",markClassName:B}),(0,gt.jsx)(Le,{id:te,helperText:R,errorMessage:D,sizeClassName:fe.helper,className:A}),P&&(0,gt.jsx)(gt.Fragment,{children:ae?(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("input",{type:"hidden",name:`${P}[0]`,value:O[0],disabled:b}),(0,gt.jsx)("input",{type:"hidden",name:`${P}[1]`,value:O[1],disabled:b})]}):(0,gt.jsx)("input",{type:"hidden",name:P,value:O[0],disabled:b})})]})}var ci=require("react");var Rl={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"}},Dl={none:"rounded-none",sm:"rounded-md",md:"rounded-xl",lg:"rounded-2xl",xl:"rounded-3xl",full:"rounded-3xl"},b0={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"}},h0={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"}},x0={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"}},v0={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"}};var Qi=require("react"),au=(0,Qi.createContext)(null),su=(0,Qi.createContext)(null);function qn(){let e=(0,Qi.useContext)(au);if(!e)throw new Error("Collapse compound components must be rendered within a <Collapse> provider");return e}function li(){let e=(0,Qi.useContext)(su);if(!e)throw new Error("Collapse subcomponents (CollapseHeader, CollapseContent) must be rendered within a <CollapsePanel>");return e}var lu=require("react/jsx-runtime");function y0(e){return e==null?[]:Array.isArray(e)?e:[e]}function Nl({activeKey:e,defaultActiveKey:t,onChange:r,accordion:n=!1,size:o="md",variant:i="outlined",color:a="primary",radius:s="md",expandIconPosition:l="right",expandIcon:f,destroyInactivePanel:c=!1,className:w="",style:p,children:m,ref:v,...x}){let h=e!==void 0,[k,T]=(0,ci.useState)(()=>y0(t)),y=(0,ci.useMemo)(()=>new Set(h?y0(e):k),[h,e,k]),d=(0,ci.useCallback)(R=>{let D,P=y.has(R);if(n)D=P?[]:[R];else{let I=Array.from(y);P?D=I.filter(E=>E!==R):D=[...I,R]}h||T(D),r?.(n?D[0]??"":D)},[n,y,h,r]),u=i==="other"?"":C(a,C(i,b0,"outlined"),"primary"),g=i!=="separated"&&i!=="ghost"?C(s,Dl,"md"):"",b=["w-full transition-colors",u,g,w].filter(Boolean).join(" "),S=(0,ci.useMemo)(()=>({activeKeys:y,handleToggle:d,accordion:n,size:o,variant:i,color:a,radius:s,expandIconPosition:l,expandIcon:f,destroyInactivePanel:c}),[y,d,n,o,i,a,s,l,f,c]);return(0,lu.jsx)(au.Provider,{value:S,children:(0,lu.jsx)("div",{ref:v,className:b,style:p,...x,children:m})})}var zl=require("react");var ur=require("react/jsx-runtime");function ea({startIcon:e,description:t,extra:r,showArrow:n=!0,children:o,className:i="",ref:a,onClick:s,onKeyDown:l,...f}){let{size:c,variant:w,color:p,expandIconPosition:m,expandIcon:v}=qn(),{isActive:x,disabled:h,headerId:k,panelId:T,onToggle:y}=li(),d=C(c,Rl,"md"),u=C(p,v0,"primary"),g=w==="other"?"":C(p,C(w,x0,"outlined"),"primary"),b=n&&m!=="none",S=()=>b?typeof v=="function"?(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:v({isActive:x,disabled:h})}):v?(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180":"rotate-0"}`,"aria-hidden":"true",children:v}):(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 transition-transform duration-200 text-neutral-400 ${x?"rotate-180 text-neutral-700":"rotate-0"}`,"aria-hidden":"true",children:(0,ur.jsx)(yt,{className:d.icon})}):null,R=["w-full flex items-center justify-between transition-colors duration-150 select-none",d.header,d.gap,h?"cursor-not-allowed opacity-60":g,i].filter(Boolean).join(" "),D=["flex items-center flex-1 min-w-0 text-left outline-none cursor-pointer bg-transparent border-0 p-0",d.gap,h?"cursor-not-allowed pointer-events-none":`${u.focusRing} focus-visible:ring-2 focus-visible:ring-offset-1 rounded-lg`].filter(Boolean).join(" ");return(0,ur.jsxs)("div",{className:R,children:[(0,ur.jsxs)("button",{ref:a,id:k,type:"button","aria-expanded":x,"aria-controls":T,"aria-disabled":h?!0:void 0,disabled:h,onClick:P=>{y(),s?.(P)},onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),y()),l?.(P)},className:D,...f,children:[m==="left"&&S(),(0,ur.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e&&(0,ur.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 ${u.activeIndicator} ${d.startIcon}`,"aria-hidden":"true",children:e}),(0,ur.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,ur.jsx)("span",{className:`truncate ${d.title} ${u.title}`,children:o}),t&&(0,ur.jsx)("span",{className:`line-clamp-2 ${d.description}`,children:t})]})]}),m==="right"&&!r&&S()]}),r&&(0,ur.jsxs)("div",{className:"inline-flex items-center gap-2.5 shrink-0 ml-3",children:[r,m==="right"&&S()]})]})}var Pl=require("react/jsx-runtime");function ta({destroyInactivePanel:e,children:t,className:r="",style:n,ref:o,...i}){let{size:a,destroyInactivePanel:s}=qn(),{isActive:l,headerId:f,panelId:c}=li(),w=C(a,Rl,"md");return(0,Pl.jsx)("div",{ref:o,id:c,role:"region","aria-labelledby":f,"aria-hidden":!l,"data-state":l?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${l?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,style:n,...i,children:(0,Pl.jsx)("div",{className:"overflow-hidden",children:(!(e??s)||l)&&(0,Pl.jsx)("div",{className:`${w.content} ${r}`,children:t})})})}var Zn=require("react/jsx-runtime");function Il({value:e,label:t,description:r,startIcon:n,extra:o,disabled:i=!1,showArrow:a=!0,headerClassName:s="",contentClassName:l="",destroyInactivePanel:f,className:c="",children:w,ref:p,...m}){let v=(0,zl.useId)(),{activeKeys:x,handleToggle:h,variant:k,color:T,radius:y}=qn(),d=x.has(e),u=`collapse-header-${e??v}`,g=`collapse-panel-${e??v}`,b=(0,zl.useMemo)(()=>({value:e,isActive:d,disabled:i,headerId:u,panelId:g,onToggle:()=>!i&&h(e)}),[e,d,i,u,g,h]),S=k==="separated"?C(y,Dl,"md"):"",D=["group",k==="other"?"":C(T,C(k,h0,"outlined"),"primary"),S,i?"opacity-50 cursor-not-allowed":"",c].filter(Boolean).join(" ");return(0,Zn.jsx)(su.Provider,{value:b,children:(0,Zn.jsx)("div",{ref:p,className:D,"data-state":d?"open":"closed",...m,children:t!==void 0?(0,Zn.jsxs)(Zn.Fragment,{children:[(0,Zn.jsx)(ea,{startIcon:n,description:r,extra:o,showArrow:a,className:s,children:t}),(0,Zn.jsx)(ta,{destroyInactivePanel:f,className:l,children:w})]}):w})})}var Ml=require("react"),cu=require("react/jsx-runtime");function Fl({open:e,defaultOpen:t=!1,destroyInactivePanel:r=!1,className:n="",children:o,ref:i,...a}){let s=(0,Ml.useId)(),l=e!==void 0,[f]=(0,Ml.useState)(t),c=l?e:f;return(0,cu.jsx)("div",{ref:i,id:s,role:"region","aria-hidden":!c,"data-state":c?"open":"closed",className:`grid transition-[grid-template-rows] duration-200 ease-in-out ${c?"grid-rows-[1fr]":"grid-rows-[0fr]"} ${n}`,...a,children:(0,cu.jsx)("div",{className:"overflow-hidden",children:(!r||c)&&o})})}var ui=require("react");var El=require("react"),uu=(0,El.createContext)(null);function Jn(){let e=(0,El.useContext)(uu);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}var du=require("react/jsx-runtime");function xo({activeKey:e,defaultActiveKey:t,onChange:r,onClose:n,size:o="md",variant:i="line",color:a="primary",radius:s="md",orientation:l="horizontal",placement:f="top",fullWidth:c=!1,disabled:w=!1,destroyInactiveTabPane:p=!1,className:m="",children:v,ref:x,...h}){let k=e!==void 0,[T,y]=(0,ui.useState)(t),d=k?e:T,u=(0,ui.useCallback)(P=>{k||y(P),r?.(P)},[k,r]),g=(0,ui.useCallback)(P=>{n?.(P)},[n]),b=(0,ui.useMemo)(()=>({activeKey:d,setActiveKey:u,size:o,variant:i,color:a,radius:s,orientation:l,placement:f,fullWidth:c,disabled:w,destroyInactiveTabPane:p,onCloseTab:g}),[d,u,o,i,a,s,l,f,c,w,p,g]),S=l==="vertical",R;S?R=f==="right"?"flex flex-row-reverse gap-4 items-start":"flex flex-row gap-4 items-start":R=f==="bottom"?"flex flex-col-reverse gap-3":"flex flex-col gap-3";let D=["w-full",R,m].filter(Boolean).join(" ");return(0,du.jsx)("div",{ref:x,className:D,...h,children:(0,du.jsx)(uu.Provider,{value:b,children:v})})}var D0=require("@floating-ui/react");var w0={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"}},$l={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},C0={line:(e,t)=>e==="vertical"?t==="right"?"border-l border-neutral-200 dark:border-neutral-800 gap-1":"border-r border-neutral-200 dark:border-neutral-800 gap-1":t==="bottom"?"border-t border-neutral-200 dark:border-neutral-800 gap-2":"border-b border-neutral-200 dark:border-neutral-800 gap-2",solid:()=>"bg-neutral-100 dark:bg-neutral-800/80 p-1 gap-1",bordered:()=>"border border-neutral-200 dark:border-neutral-700/80 p-1 gap-1 bg-neutral-50/50 dark:bg-neutral-900/50",flat:()=>"bg-neutral-100/60 dark:bg-neutral-800/40 p-1 gap-1"},k0={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"}}},S0={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"}};var Nr=require("react"),T0=typeof window<"u"?Nr.useLayoutEffect:Nr.useEffect;function R0({activeKey:e,orientation:t="horizontal",placement:r="top",variant:n="line",color:o="primary",radius:i="md"}={}){let a=(0,Nr.useRef)(null),[s,l]=(0,Nr.useState)({opacity:0}),[f,c]=(0,Nr.useState)(!1),[w,p]=(0,Nr.useState)(!1),m=(0,Nr.useCallback)(()=>{if(!a.current||t==="vertical"){c(!1),p(!1);return}let{scrollLeft:T,scrollWidth:y,clientWidth:d}=a.current,u=y-d;c(T>1),p(T<u-1)},[t]),v=(0,Nr.useCallback)(()=>{if(!a.current)return;m();let T=a.current.querySelector('[role="tab"][aria-selected="true"]');if(!T){l(S=>({...S,opacity:0}));return}let y=T.closest("[data-tab-wrapper]")||T;y.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});let{offsetLeft:d,offsetTop:u,offsetWidth:g,offsetHeight:b}=y;l(n==="line"?t==="vertical"?{transform:`translate3d(0, ${u}px, 0)`,height:`${b}px`,width:"2px",top:0,left:r==="right"?0:void 0,right:r!=="right"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, 0, 0)`,width:`${g}px`,height:"2px",left:0,top:r==="bottom"?0:void 0,bottom:r!=="bottom"?0:void 0,opacity:1}:{transform:`translate3d(${d}px, ${u}px, 0)`,width:`${g}px`,height:`${b}px`,top:0,left:0,opacity:1})},[m,t,r,n]);return T0(()=>{v()},[v,e,n,t,r,o,i]),T0(()=>{v();let T=requestAnimationFrame(v),y=new ResizeObserver(v);if(a.current){y.observe(a.current);let u=a.current.querySelectorAll("[data-tab-wrapper], [role='tab']");for(let g of u)y.observe(g)}let d=()=>v();return window.addEventListener("resize",d),()=>{cancelAnimationFrame(T),y.disconnect(),window.removeEventListener("resize",d)}},[v]),{listRef:a,indicatorStyle:s,canScrollLeft:f,canScrollRight:w,checkScroll:m,handleScrollLeft:()=>{a.current&&a.current.scrollBy({left:-200,behavior:"smooth"})},handleScrollRight:()=>{a.current&&a.current.scrollBy({left:200,behavior:"smooth"})},handleKeyDown:T=>{if(!a.current)return;let y=Array.from(a.current.querySelectorAll('[role="tab"]:not([disabled])'));if(!y.length)return;let d=y.findIndex(R=>R===document.activeElement||R.getAttribute("aria-selected")==="true"),u=-1,g=t==="horizontal",b=g?"ArrowRight":"ArrowDown",S=g?"ArrowLeft":"ArrowUp";T.key===b?(T.preventDefault(),u=(d+1)%y.length):T.key===S?(T.preventDefault(),u=(d-1+y.length)%y.length):T.key==="Home"?(T.preventDefault(),u=0):T.key==="End"&&(T.preventDefault(),u=y.length-1),u>=0&&y[u]&&(y[u]?.focus(),y[u]?.click())}}}var yn=require("react/jsx-runtime");function vo({children:e,className:t="",extra:r,centered:n=!1,ref:o,...i}){let{activeKey:a,orientation:s="horizontal",placement:l="top",variant:f="line",color:c="primary",radius:w="md",fullWidth:p=!1}=Jn(),{listRef:m,indicatorStyle:v,canScrollLeft:x,canScrollRight:h,checkScroll:k,handleScrollLeft:T,handleScrollRight:y,handleKeyDown:d}=R0({activeKey:a,orientation:s,placement:l,variant:f,color:c,radius:w}),u=(0,D0.useMergeRefs)([m,o]),g=C(w,$l,"md"),b=f==="other"?"":C(f,C0,"line"),S=typeof b=="function"?b(s,l):"",R=f==="other"?"":C(c,C(f,S0,"line"),"primary"),D=s==="vertical",P=x||h,E=["relative flex-1 min-w-0",D?"flex flex-col items-stretch justify-start w-full":`flex flex-row items-center overflow-x-auto overflow-y-hidden [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden scroll-smooth ${p?"w-full":""}`,n&&!D?"justify-center":"",f!=="line"?g:"",S,t].filter(Boolean).join(" "),N=["absolute pointer-events-none z-0 transition-all duration-300 ease-out",f!=="line"?g:"",R].filter(Boolean).join(" ");return(0,yn.jsxs)("div",{className:D?"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:[!D&&P&&(0,yn.jsx)("button",{type:"button","aria-label":"Scroll tabs left",disabled:!x,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:(0,yn.jsx)(Sr,{className:"size-4"})}),(0,yn.jsxs)("div",{ref:u,role:"tablist","aria-orientation":s,onKeyDown:d,onScroll:k,className:E,...i,children:[(0,yn.jsx)("div",{"aria-hidden":"true",className:N,style:v}),e]}),!D&&P&&(0,yn.jsx)("button",{type:"button","aria-label":"Scroll tabs right",disabled:!h,onClick:y,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:(0,yn.jsx)(Tr,{className:"size-4"})}),r&&(0,yn.jsx)("div",{className:D?"w-full mt-1":"shrink-0 ml-auto pl-1",children:r})]})}var N0=require("react"),P0=require("@floating-ui/react");var wn=require("react/jsx-runtime");function yo({value:e,label:t,startIcon:r,endIcon:n,badge:o,disabled:i=!1,closable:a=!1,onClose:s,className:l="",children:f,onClick:c,onKeyDown:w,ref:p,...m}){let{activeKey:v,setActiveKey:x,size:h,variant:k,color:T,radius:y,orientation:d,fullWidth:u,disabled:g,onCloseTab:b}=Jn(),S=(0,N0.useRef)(null),R=(0,P0.useMergeRefs)([S,p]),D=g||i,P=v===e,I=B=>{D||(x(e),c?.(B))},E=B=>{B.stopPropagation(),!D&&(s?.(B),b?.(e))},N=C(h,w0,"md"),M=C(y,$l,"md"),z=C(T,k0,"primary"),H=k==="other"?{active:"",inactive:""}:C(k,z,"line"),V=`tab-${e}`,Y=`tabpanel-${e}`,$=P?H.active:H.inactive,F=d==="vertical",G=["group relative z-10 inline-flex items-center select-none",F?"justify-start text-left w-full":"justify-center text-center",k!=="line"?M:"",u&&!F?"flex-1 text-center":"",D?"opacity-40 cursor-not-allowed pointer-events-none":"",l].filter(Boolean).join(" "),A=["inline-flex items-center cursor-pointer select-none bg-transparent",F?"justify-start text-left w-full":"justify-center text-center","transition-colors duration-200 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",k!=="line"?M:"",N.tab,N.gap,a?"pr-1.5":"",u&&!F?"flex-1 text-center":"",$,D?"opacity-40 cursor-not-allowed pointer-events-none":""].filter(Boolean).join(" ");return(0,wn.jsxs)("div",{"data-tab-wrapper":!0,className:G,children:[(0,wn.jsxs)("button",{ref:R,id:V,type:"button",role:"tab","aria-selected":P,"aria-controls":Y,"aria-disabled":D?"true":void 0,tabIndex:P?0:-1,disabled:D,onClick:I,onKeyDown:B=>{if(a&&(B.key==="Delete"||B.key==="Backspace")){if(B.preventDefault(),B.stopPropagation(),D)return;s?.(B),b?.(e)}w?.(B)},className:A,...m,children:[r&&(0,wn.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:r}),(0,wn.jsx)("span",{className:`truncate ${F?"flex-1 text-left":""}`,children:t||f}),o!=null&&(0,wn.jsx)("span",{className:`inline-flex items-center justify-center font-medium rounded-full bg-neutral-200/80 dark:bg-neutral-700 text-neutral-700 dark:text-neutral-300 transition-colors duration-200 ${N.badge}`,children:o}),n&&(0,wn.jsx)("span",{className:`shrink-0 inline-flex items-center justify-center transition-colors duration-200 ${N.icon}`,"aria-hidden":"true",children:n})]}),a&&(0,wn.jsx)("button",{type:"button","aria-label":"Close tab",disabled:D,tabIndex:P?0:-1,onClick:E,className:`shrink-0 cursor-pointer rounded-full hover:bg-neutral-200/80 dark:hover:bg-neutral-700 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200 transition-colors inline-flex items-center justify-center focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 mr-2 ${N.closeBtn}`,children:(0,wn.jsx)(Ve,{className:"size-full pointer-events-none"})})]})}var z0=require("react/jsx-runtime");function Ll({children:e,className:t="",ref:r,...n}){return(0,z0.jsx)("div",{ref:r,className:`w-full ${t}`,...n,children:e})}var I0=require("react/jsx-runtime");function Bl({value:e,children:t,className:r="",destroyInactiveTabPane:n,ref:o,...i}){let{activeKey:a,destroyInactiveTabPane:s}=Jn(),l=a===e;if((n??s)&&!l)return null;let c=`tab-${e}`,w=`tabpanel-${e}`,p=["focus-visible:outline-hidden",l?"":"hidden",r].filter(Boolean).join(" ");return(0,I0.jsx)("div",{ref:o,id:w,role:"tabpanel",tabIndex:0,"aria-labelledby":c,hidden:!l,className:p,...i,children:t})}var Hl=require("react"),fu=(0,Hl.createContext)(null);function Ar(){let e=(0,Hl.useContext)(fu);if(!e)throw new Error("Carousel compound components (CarouselContent, CarouselSlide, CarouselPrevious, CarouselNext, CarouselPagination) must be used within <Carousel>");return e}var qe=require("react");function ps({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:c=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:v="md"}={}){let[x,h]=(0,qe.useState)(t),[k,T]=(0,qe.useState)(0),[y,d]=(0,qe.useState)(!1),[u,g]=(0,qe.useState)(0),[b,S]=(0,qe.useState)(!1),[R,D]=(0,qe.useState)(!1),P=(0,qe.useRef)(new Set),I=(0,qe.useRef)(null),E=(0,qe.useRef)(null),N=(0,qe.useRef)(0),M=(0,qe.useRef)(0),z=e!==void 0,H=z?e:x,V=Math.max(0,n?k-1:k-o),Y=(0,qe.useCallback)(L=>{let te=L;n?k>0?te=(te+k)%k:te=0:te=Math.max(0,Math.min(te,V)),z||h(te),r?.(te)},[z,n,V,r,k]),$=n?k>1:H>0,F=n?k>1:H<k-o,G=(0,qe.useCallback)(()=>{$&&Y(H-i)},[H,$,Y,i]),A=(0,qe.useCallback)(()=>{F&&Y(H+i)},[H,F,Y,i]),j=(0,qe.useCallback)(L=>{Y(L)},[Y]),B=(0,qe.useCallback)(L=>{P.current.add(L),T(P.current.size)},[]),X=(0,qe.useCallback)(L=>{P.current.delete(L),T(P.current.size)},[]);(0,qe.useEffect)(()=>{if(!s||k<=o||c&&b||w&&R||y)return;let L=setInterval(()=>{n||H<k-o?A():j(0)},l);return()=>clearInterval(L)},[H,s,l,y,R,b,n,w,c,A,j,o,k]);let le=(0,qe.useCallback)(L=>{if(!p||k<=o||L.button!==0)return;let te=L.clientX;N.current=te,M.current=te,d(!0),g(0);let Z=L.currentTarget;try{Z.setPointerCapture(L.pointerId)}catch{}},[p,o,k]),ne=(0,qe.useCallback)(L=>{if(!y)return;let te=L.clientX;M.current=te;let Z=te-N.current;if(!n){if(H===0&&Z>0){g(Z*.3);return}if(H>=k-o&&Z<0){g(Z*.3);return}}g(Z)},[H,y,n,o,k]),ue=(0,qe.useCallback)(L=>{if(!y)return;d(!1);let te=M.current-N.current;Math.abs(te)>40&&(te>0?G():A()),g(0);try{L.currentTarget.releasePointerCapture(L.pointerId)}catch{}},[y,A,G]),ie=(0,qe.useCallback)(L=>{L.key==="ArrowLeft"?(L.preventDefault(),G()):L.key==="ArrowRight"?(L.preventDefault(),A()):L.key==="Home"?(L.preventDefault(),j(0)):L.key==="End"&&(L.preventDefault(),j(V))},[V,A,G,j]),Q=(0,qe.useCallback)(()=>S(!0),[]),q=(0,qe.useCallback)(()=>S(!1),[]),ge=(0,qe.useCallback)(()=>D(!0),[]),ke=(0,qe.useCallback)(()=>D(!1),[]);return{currentIndex:H,totalSlides:k,slidesToShow:o,slidesToScroll:i,spacing:a,loop:n,canScrollPrev:$,canScrollNext:F,size:m,radius:v,transitionDuration:f,isDragging:y,dragOffset:u,scrollPrev:G,scrollNext:A,scrollTo:j,registerSlide:B,unregisterSlide:X,setTotalSlides:T,viewportRef:I,containerRef:E,handlePointerDown:le,handlePointerMove:ne,handlePointerUp:ue,handlePointerCancel:ue,handleKeyDown:ie,handleMouseEnter:Q,handleMouseLeave:q,handleFocus:ge,handleBlur:ke}}var gs={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"}},M0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},pu={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"},gu="bg-black/25 dark:bg-white/15 backdrop-blur-md border border-white/20 dark:border-white/15 shadow-sm rounded-full",ms={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"};var mu=require("react/jsx-runtime");function bu({currentIndex:e,defaultIndex:t=0,onIndexChange:r,loop:n=!1,slidesToShow:o=1,slidesToScroll:i=1,spacing:a=0,autoPlay:s=!0,interval:l=3e3,transitionDuration:f=650,pauseOnHover:c=!0,pauseOnFocus:w=!0,draggable:p=!0,size:m="md",radius:v="md",children:x,className:h="",style:k,ref:T,...y}){let d=ps({currentIndex:e,defaultIndex:t,onIndexChange:r,loop:n,slidesToShow:o,slidesToScroll:i,spacing:a,autoPlay:s,interval:l,transitionDuration:f,pauseOnHover:c,pauseOnFocus:w,draggable:p,size:m,radius:v}),u=C(v,M0,"md");return(0,mu.jsx)(fu.Provider,{value:d,children:(0,mu.jsx)("div",{ref:T,role:"region","aria-roledescription":"carousel","aria-label":"B\u0103ng chuy\u1EC1n",tabIndex:0,onKeyDown:d.handleKeyDown,onMouseEnter:d.handleMouseEnter,onMouseLeave:d.handleMouseLeave,onFocus:d.handleFocus,onBlur:d.handleBlur,className:`relative overflow-hidden group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${u} ${h}`,style:k,...y,children:x})})}var hu=require("react/jsx-runtime");function xu({children:e,className:t="",style:r,ref:n,...o}){let{currentIndex:i,slidesToShow:a,spacing:s,transitionDuration:l,isDragging:f,dragOffset:c,viewportRef:w,handlePointerDown:p,handlePointerMove:m,handlePointerUp:v,handlePointerCancel:x}=Ar(),h=typeof s=="number"?`${s}px`:s||"0px",k=`translateX(calc(-${i} * ((100% + ${h}) / ${a}) + ${c}px))`,T={display:"flex",flexDirection:"row",gap:h,transform:k,transition:f?"none":`transform ${l}ms cubic-bezier(0.25, 1, 0.5, 1)`,touchAction:"pan-y",width:"100%"};return(0,hu.jsx)("div",{ref:w,className:`overflow-hidden relative w-full h-full cursor-grab ${f?"cursor-grabbing select-none":""}`,onPointerDown:p,onPointerMove:m,onPointerUp:v,onPointerCancel:x,children:(0,hu.jsx)("div",{ref:n,role:"presentation",className:`flex ${t}`,style:{...T,...r},...o,children:e})})}var Vl=require("react");var F0=require("react/jsx-runtime");function vu({children:e,className:t="",style:r,ref:n,...o}){let i=(0,Vl.useId)(),{slidesToShow:a,spacing:s,registerSlide:l,unregisterSlide:f}=Ar();(0,Vl.useEffect)(()=>(l(i),()=>{f(i)}),[i,l,f]);let c=typeof s=="number"?`${s}px`:s||"0px",w={...r};return a>1||c!=="0px"?w.flex=`0 0 calc((100% - ${a-1} * ${c}) / ${a})`:w.flex="0 0 100%",(0,F0.jsx)("div",{ref:n,role:"group","aria-roledescription":"slide",className:`min-w-0 shrink-0 grow-0 select-none box-border relative overflow-hidden ${t}`,style:w,...o,children:e})}var bs=require("react/jsx-runtime");function yu({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollPrev:s,canScrollPrev:l,size:f}=Ar(),c=n!==void 0?n:!l,w=C(f,gs,"md"),p=C(e,pu,"glass"),m=(0,bs.jsx)(Sr,{className:w.arrowIcon}),v=["absolute left-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return(0,bs.jsx)("button",{ref:i,type:"button","aria-label":"Slide tr\u01B0\u1EDBc",disabled:c,onClick:x=>{s(),o?.(x)},className:v,...a,children:t||m})}function wu({variant:e="glass",icon:t,className:r="",disabled:n,onClick:o,ref:i,...a}){let{scrollNext:s,canScrollNext:l,size:f}=Ar(),c=n!==void 0?n:!l,w=C(f,gs,"md"),p=C(e,pu,"glass"),m=(0,bs.jsx)(Tr,{className:w.arrowIcon}),v=["absolute right-2 top-1/2 -translate-y-1/2 inline-flex items-center justify-center font-medium leading-none rounded-full transition-all duration-200 cursor-pointer select-none outline-none disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-25 focus-visible:ring-2 focus-visible:ring-primary-500/50 active:scale-90 z-10",p,w.arrowBtn,r].filter(Boolean).join(" ");return(0,bs.jsx)("button",{ref:i,type:"button","aria-label":"Slide ti\u1EBFp theo",disabled:c,onClick:x=>{s(),o?.(x)},className:v,...a,children:t||m})}var di=require("react/jsx-runtime");function Cu({type:e="dots",clickable:t=!0,className:r="",ref:n,...o}){let{currentIndex:i,totalSlides:a,slidesToShow:s,loop:l,scrollTo:f,size:c}=Ar();if(e==="none"||a<=1)return null;let w=C(c,gs,"md"),p=l?a:Math.max(1,a-s+1);return e==="fraction"?(0,di.jsx)("div",{ref:n,role:"status","aria-live":"polite",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center font-medium ${gu} text-white ${w.fraction} ${r}`,...o,children:(0,di.jsxs)("span",{children:[Math.min(i+1,p)," / ",p]})}):(0,di.jsx)("div",{ref:n,role:"tablist","aria-label":"Ph\xE2n trang b\u0103ng chuy\u1EC1n",className:`absolute z-10 bottom-2.5 left-1/2 -translate-x-1/2 inline-flex items-center justify-center ${gu} ${w.paginationWrapper} ${r}`,...o,children:Array.from({length:p}).map((m,v)=>{let x=v===i;return e==="line"?(0,di.jsx)("button",{type:"button",role:"tab","aria-selected":x,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${v+1}`,disabled:!t,onClick:()=>t&&f(v),className:`transition-all duration-300 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${x?`${w.activeLine} ${ms.active}`:`${w.line} ${ms.inactive}`} ${t?"cursor-pointer":"cursor-default"}`},v):(0,di.jsx)("button",{type:"button",role:"tab","aria-selected":x,"aria-label":`Chuy\u1EC3n \u0111\u1EBFn slide ${v+1}`,disabled:!t,onClick:()=>t&&f(v),className:`transition-colors duration-200 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${w.dot} ${x?ms.active:ms.inactive} ${t?"cursor-pointer":"cursor-default"}`},v)})})}var rn=require("react"),dt=require("@floating-ui/react");var Al=require("react"),ku=(0,Al.createContext)(null),tn=()=>{let e=(0,Al.useContext)(ku);if(!e)throw new Error("Dropdown compound components must be used within a <Dropdown> component.");return e};var E0=require("react/jsx-runtime");function Ol({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom-start",offset:a=4,flip:s=!0,shift:l=!0,size:f="md",radius:c="md",color:w="primary",disabled:p=!1,animated:m=!0,animationDuration:v=150,closeOnSelect:x=!0}){let[h,k]=(0,rn.useState)(r),[T,y]=(0,rn.useState)(null),d=(0,rn.useRef)([]),u=(0,rn.useRef)([]),g=t!==void 0,b=g?t:h,S=(0,rn.useCallback)(j=>{g||k(j),j||y(null),n?.(j)},[g,n]),R=(0,rn.useMemo)(()=>[(0,dt.offset)(a),s?(0,dt.flip)():void 0,l?(0,dt.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:D,floatingStyles:P,context:I,placement:E}=(0,dt.useFloating)({placement:i,open:b&&!p,onOpenChange:S,whileElementsMounted:dt.autoUpdate,transform:!1,middleware:R}),N=(0,dt.useClick)(I,{enabled:!p&&o==="click"}),M=(0,dt.useHover)(I,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:(0,dt.safePolygon)()}),z=(0,dt.useDismiss)(I),H=(0,dt.useRole)(I,{role:"menu"}),V=(0,dt.useListNavigation)(I,{listRef:d,activeIndex:T,onNavigate:y,loop:!0}),Y=(0,dt.useTypeahead)(I,{listRef:u,activeIndex:T,onMatch:b?y:void 0}),{getReferenceProps:$,getFloatingProps:F,getItemProps:G}=(0,dt.useInteractions)([N,M,z,H,V,Y]),A=(0,rn.useMemo)(()=>({isOpen:b,setIsOpen:S,refs:D,floatingStyles:P,context:I,getReferenceProps:$,getFloatingProps:F,getItemProps:G,elementsRef:d,labelsRef:u,activeIndex:T,setActiveIndex:y,size:f,radius:c,color:w,disabled:p,animated:m,animationDuration:v,closeOnSelect:x,computedPlacement:E}),[b,S,D,P,I,$,F,G,d,u,T,y,f,c,w,p,m,v,x,E]);return(0,E0.jsx)(ku.Provider,{value:A,children:e})}var ra=require("react");var Tu=require("@floating-ui/react"),Su=require("react/jsx-runtime");function Gp({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,ra.isValidElement)(e)?e.props?.ref:void 0,a=(0,Tu.useMergeRefs)([t,i]);if(!(0,ra.isValidElement)(e))return null;let s=e.props||{};return(0,ra.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function jp({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=tn(),f=(0,Tu.useMergeRefs)([i.setReference,e]),c=a({...o,"aria-expanded":s,"aria-haspopup":"menu",className:r});return(0,ra.isValidElement)(t)&&(n||!0)?(0,Su.jsx)(Gp,{ref:f,disabled:l,...c,children:t}):(0,Su.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"menu",className:r,...c,children:t})}var Ru=jp;var oa=require("@floating-ui/react");var na={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"}},$0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},L0={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"}},Du={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"};var Gl=require("react/jsx-runtime");function jl({ref:e,children:t,className:r="",style:n,minWidth:o,zIndex:i=lt.DROPDOWN,...a}){let{isOpen:s,refs:l,floatingStyles:f,context:c,getFloatingProps:w,elementsRef:p,labelsRef:m,size:v,radius:x,animated:h,animationDuration:k,computedPlacement:T}=tn(),y=(0,oa.useMergeRefs)([l.setFloating,e]),{isMounted:d,styles:u}=rt(c,{duration:k,animated:h});if(!d)return null;let g=C(v,na,"md"),b=C(x,$0,"md"),S=["bg-neutral-white border-2 border-neutral-200 shadow-lg outline-none focus:outline-none flex flex-col",g.menu,b,r].filter(Boolean).join(" ");return(0,Gl.jsx)(oa.FloatingPortal,{children:(0,Gl.jsx)("div",{ref:y,style:{...f,...h?u:{},minWidth:o,zIndex:i,...n},className:S,"data-state":s?"open":"closed","data-placement":T,...w(a),children:(0,Gl.jsx)(oa.FloatingList,{elementsRef:p,labelsRef:m,children:t})})})}var Ul=require("@floating-ui/react");var Qn=require("react/jsx-runtime");function Up({ref:e,children:t,onClick:r,disabled:n=!1,danger:o=!1,selected:i=!1,startIcon:a,endIcon:s,shortcut:l,description:f,className:c="",closeOnSelect:w,...p}){let{getItemProps:m,activeIndex:v,setIsOpen:x,color:h,size:k,closeOnSelect:T}=tn(),y=typeof t=="string"?t:void 0,{ref:d,index:u}=(0,Ul.useListItem)({label:y}),g=(0,Ul.useMergeRefs)([d,e]),b=v===u,S=C(k,na,"md"),R=C(h,L0,"primary"),D=E=>{if(n){E.preventDefault();return}r?.(E),(w??T)&&x(!1)},P=n?"opacity-50 cursor-not-allowed text-neutral-400 select-none":o?`${Du.default} ${b?Du.active:""} cursor-pointer`:i?`${R.selected} cursor-pointer`:`${b?R.active:"text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900"} cursor-pointer`,I=["w-full text-left flex items-center select-none transition-colors duration-100 outline-none focus:outline-none",S.item,S.itemGap,P,c].filter(Boolean).join(" ");return(0,Qn.jsxs)("button",{ref:g,type:"button",role:"menuitem",disabled:n,"aria-disabled":n,tabIndex:b?0:-1,...m({...p,onClick:D,className:I}),children:[a&&(0,Qn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:a}),(0,Qn.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,Qn.jsx)("span",{className:"truncate",children:t}),f&&(0,Qn.jsx)("span",{className:`text-neutral-500 truncate ${S.description}`,children:f})]}),l&&(0,Qn.jsx)("kbd",{className:`shrink-0 rounded border border-neutral-200 bg-neutral-50 font-mono text-neutral-500 tracking-wider ${S.shortcut}`,children:l}),s&&(0,Qn.jsx)("span",{className:`flex items-center justify-center shrink-0 ${S.icon}`,children:s})]})}var Nu=Up;var B0=require("react/jsx-runtime");function Pu({children:e,className:t="",...r}){let{size:n}=tn(),o=C(n,na,"md");return(0,B0.jsx)("div",{role:"presentation",className:["font-semibold text-neutral-500 uppercase tracking-wider select-none",o.header,t].filter(Boolean).join(" "),...r,children:e})}var zu=Pu;var H0=require("react/jsx-runtime");function Yp({className:e="",...t}){return(0,H0.jsx)("hr",{className:["-mx-1 my-1 h-px border-0 bg-neutral-200",e].filter(Boolean).join(" "),...t})}var Iu=Yp;var Yl=require("react/jsx-runtime");function Wp({children:e,label:t,className:r="",...n}){return(0,Yl.jsxs)("div",{role:"group",className:["flex flex-col",r].filter(Boolean).join(" "),...n,children:[t&&(0,Yl.jsx)(Pu,{children:t}),e]})}var Mu=Wp;var fi=require("react"),Ct=require("@floating-ui/react");var Wl=require("react"),Fu=(0,Wl.createContext)(null),Jt=()=>{let e=(0,Wl.useContext)(Fu);if(!e)throw new Error("Popover compound components must be used within a <Popover> component.");return e};var V0=require("react/jsx-runtime");function ia({children:e,open:t,defaultOpen:r=!1,onOpenChange:n,trigger:o="click",placement:i="bottom",offset:a=8,flip:s=!0,shift:l=!0,size:f="md",radius:c="md",color:w="neutral",disabled:p=!1,animated:m=!0,animationDuration:v=150,modal:x=!1,closeOnEsc:h=!0,closeOnClickOutside:k=!0}){let[T,y]=(0,fi.useState)(r),d=t!==void 0,u=d?t:T,g=(0,fi.useCallback)(Y=>{d||y(Y),n?.(Y)},[d,n]),b=(0,fi.useMemo)(()=>[(0,Ct.offset)(a),s?(0,Ct.flip)():void 0,l?(0,Ct.shift)({padding:8}):void 0].filter(Boolean),[a,s,l]),{refs:S,floatingStyles:R,context:D,placement:P}=(0,Ct.useFloating)({placement:i,open:u&&!p,onOpenChange:g,whileElementsMounted:Ct.autoUpdate,transform:!1,middleware:b}),I=(0,Ct.useClick)(D,{enabled:!p&&o==="click"}),E=(0,Ct.useHover)(D,{enabled:!p&&o==="hover",delay:{open:100,close:150},handleClose:(0,Ct.safePolygon)()}),N=(0,Ct.useDismiss)(D,{escapeKey:h,outsidePress:k}),M=(0,Ct.useRole)(D,{role:"dialog"}),{getReferenceProps:z,getFloatingProps:H}=(0,Ct.useInteractions)([I,E,N,M]),V=(0,fi.useMemo)(()=>({isOpen:u,setIsOpen:g,refs:S,floatingStyles:R,context:D,getReferenceProps:z,getFloatingProps:H,size:f,radius:c,color:w,disabled:p,animated:m,animationDuration:v,modal:x,computedPlacement:P}),[u,g,S,R,D,z,H,f,c,w,p,m,v,x,P]);return(0,V0.jsx)(Fu.Provider,{value:V,children:e})}var aa=require("react");var $u=require("@floating-ui/react"),Eu=require("react/jsx-runtime");function Kp({children:e,ref:t,disabled:r,className:n="",...o}){let i=(0,aa.isValidElement)(e)?e.props?.ref:void 0,a=(0,$u.useMergeRefs)([t,i]);if(!(0,aa.isValidElement)(e))return null;let s=e.props||{};return(0,aa.cloneElement)(e,{...o,...s,ref:a,disabled:r?!0:s.disabled,className:[s.className,n].filter(Boolean).join(" ")})}function _p({ref:e,children:t,className:r="",asChild:n=!1,...o}){let{refs:i,getReferenceProps:a,isOpen:s,disabled:l}=Jt(),f=(0,$u.useMergeRefs)([i.setReference,e]),c=a({...o,"aria-expanded":s,"aria-haspopup":"dialog",className:r});return(0,aa.isValidElement)(t)&&(n||!0)?(0,Eu.jsx)(Kp,{ref:f,disabled:l,...c,children:t}):(0,Eu.jsx)("button",{ref:f,type:"button",disabled:l,"aria-expanded":s,"aria-haspopup":"dialog",className:r,...c,children:t})}var hs=_p;var sa=require("@floating-ui/react");var wo={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"}},A0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"};var Kl=require("react/jsx-runtime");function Lu({ref:e,children:t,className:r="",style:n,minWidth:o,maxWidth:i,zIndex:a=lt.POPOVER,...s}){let{isOpen:l,refs:f,floatingStyles:c,context:w,getFloatingProps:p,size:m,radius:v,animated:x,animationDuration:h,modal:k,computedPlacement:T}=Jt(),y=(0,sa.useMergeRefs)([f.setFloating,e]),{isMounted:d,styles:u}=rt(w,{duration:h,animated:x});if(!d)return null;let g=C(m,wo,"md"),b=C(v,A0,"md"),R=["bg-neutral-white shadow-xl outline-none focus:outline-none flex flex-col border-2 border-neutral-200",g.container,b,r].filter(Boolean).join(" "),D=(0,Kl.jsx)(sa.FloatingFocusManager,{context:w,modal:k,children:(0,Kl.jsx)("div",{ref:y,style:{...c,...x?u:{},minWidth:o,maxWidth:i,zIndex:a,...n},className:R,"data-state":l?"open":"closed","data-placement":T,...p(s),children:t})});return(0,Kl.jsx)(sa.FloatingPortal,{children:D})}var Bu=Lu;var O0=require("react/jsx-runtime");function Hu({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,O0.jsx)("h2",{className:["text-neutral-900 border-b border-neutral-100 font-semibold",o.header,t].filter(Boolean).join(" "),...r,children:e})}var Vu=Hu;var G0=require("react/jsx-runtime");function Au({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,G0.jsx)("div",{className:["text-neutral-700",o.body,t].filter(Boolean).join(" "),...r,children:e})}var Ou=Au;var j0=require("react/jsx-runtime");function Xp({children:e,className:t="",...r}){let{size:n}=Jt(),o=C(n,wo,"md");return(0,j0.jsx)("div",{className:["border-t border-neutral-100 bg-neutral-50/50",o.footer,t].filter(Boolean).join(" "),...r,children:e})}var Gu=Xp;var la=require("react");var U0=require("@floating-ui/react"),ju=require("react/jsx-runtime");function qp({children:e,ref:t,className:r="",onClick:n,...o}){let i=(0,la.isValidElement)(e)?e.props?.ref:void 0,a=(0,U0.useMergeRefs)([t,i]);if(!(0,la.isValidElement)(e))return null;let s=e.props||{};return(0,la.cloneElement)(e,{...o,...s,ref:a,className:[s.className,r].filter(Boolean).join(" "),onClick:l=>{s.onClick?.(l),n?.(l)}})}function Zp({ref:e,children:t,className:r="",asChild:n=!1,onClick:o,...i}){let{setIsOpen:a}=Jt(),s=l=>{o?.(l),l.defaultPrevented||a(!1)};return(0,la.isValidElement)(t)&&n?(0,ju.jsx)(qp,{ref:e,className:r,onClick:s,...i,children:t}):(0,ju.jsx)("button",{ref:e,type:"button",className:r,onClick:s,...i,children:t})}var Uu=Zp;var So=require("react"),Nt=require("@floating-ui/react");var pi=require("react");var Y0={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"}},W0={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"}},Or={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",icon:"size-6",iconSize:20,calendarPadding:"p-4.5",cellSize:"w-11 h-11",cellText:"text-base",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-xs",helper:"text-sm mt-1"}};var Co={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},K0={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},ko={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"}},_0={outline:{primary:"bg-neutral-white border-primary-300 hover:border-primary-400 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-neutral-white border-secondary-300 hover:border-secondary-400 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",error:"bg-neutral-white border-error-300 hover:border-error-400 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-neutral-white border-success-300 hover:border-success-400 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-neutral-white border-warning-300 hover:border-warning-400 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-neutral-white border-info-300 hover:border-info-400 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20",neutral:"bg-neutral-white border-neutral-300 hover:border-neutral-400 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20"},filled:{primary:"bg-primary-50/60 border-primary-200 hover:bg-primary-100/60 focus-within:bg-primary-100/60 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-secondary-50/60 border-secondary-200 hover:bg-secondary-100/60 focus-within:bg-secondary-100/60 focus-within:border-secondary-500 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-neutral-50/60 border-neutral-200 hover:bg-neutral-200/60 focus-within:bg-neutral-200/60 focus-within:border-neutral-500 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-error-50/60 border-error-500 hover:border-error-600 hover:bg-error-100/60 focus-within:bg-error-100/60 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-success-50/60 border-success-200 hover:bg-success-100/60 focus-within:bg-success-100/60 focus-within:border-success-500 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-warning-50/60 border-warning-200 hover:bg-warning-100/60 focus-within:bg-warning-100/60 focus-within:border-warning-500 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-info-50/60 border-info-200 hover:bg-info-100/60 focus-within:bg-info-100/60 focus-within:border-info-500 focus-within:ring-2 focus-within:ring-info-500/20"},ghost:{primary:"bg-transparent border-transparent hover:bg-primary-50/50 focus-within:bg-primary-50/50 focus-within:border-primary-200/20 focus-within:ring-2 focus-within:ring-primary-500/20",secondary:"bg-transparent border-transparent hover:bg-secondary-50/50 focus-within:bg-secondary-50/50 focus-within:border-secondary-200/20 focus-within:ring-2 focus-within:ring-secondary-500/20",neutral:"bg-transparent border-transparent hover:bg-neutral-50/50 focus-within:bg-neutral-50/50 focus-within:border-neutral-200/20 focus-within:ring-2 focus-within:ring-neutral-500/20",error:"bg-transparent border-transparent hover:bg-error-50/50 focus-within:bg-error-50/50 focus-within:border-error-500 focus-within:ring-2 focus-within:ring-error-500/20",success:"bg-transparent border-transparent hover:bg-success-50/50 focus-within:bg-success-50/50 focus-within:border-success-200/20 focus-within:ring-2 focus-within:ring-success-500/20",warning:"bg-transparent border-transparent hover:bg-warning-50/50 focus-within:bg-warning-50/50 focus-within:border-warning-200/20 focus-within:ring-2 focus-within:ring-warning-500/20",info:"bg-transparent border-transparent hover:bg-info-50/50 focus-within:bg-info-50/50 focus-within:border-info-200/20 focus-within:ring-2 focus-within:ring-info-500/20"}};function Dt(e){return!e||e==="vi"?Y0:e==="en"?W0:e}function jt(e,t){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"){let r=e.trim();if(!r)return null;if(t){let o=_l(r,t);if(o)return o}let n=new Date(r);return isNaN(n.getTime())?null:n}if(typeof e=="number"){let r=new Date(e);return isNaN(r.getTime())?null:r}return null}function eo(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xs(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}function ca(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r<n}function ua(e,t){let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return r>n}function da(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),r=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-r);let n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-n.getTime())/864e5+1)/7)}function X0(e,t){return new Date(e,t+1,0).getDate()}function vs(e,t,r=1,n,o,i,a){let s=[],l=new Date,f=new Date(e,t,1).getDay(),c=X0(e,t-1),w=X0(e,t),p=r===1?f===0?6:f-1:f;for(let v=p-1;v>=0;v--){let x=c-v,h=new Date(e,t-1,x);s.push(Yu(h,!1,l,n,o,i,a))}for(let v=1;v<=w;v++){let x=new Date(e,t,v);s.push(Yu(x,!0,l,n,o,i,a))}let m=42-s.length;for(let v=1;v<=m;v++){let x=new Date(e,t+1,v);s.push(Yu(x,!1,l,n,o,i,a))}return s}function Yu(e,t,r,n,o,i,a){let s=n?eo(e,n):!1,l=!1;return o&&ca(e,o)&&(l=!0),i&&ua(e,i)&&(l=!0),a&&a(e)&&(l=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:eo(e,r),isSelected:s,isDisabled:l,weekNumber:da(e)}}function dr(e,t="DD/MM/YYYY",r){if(!e||isNaN(e.getTime()))return"";let n=Dt(r),o=e.getFullYear(),i=e.getMonth(),a=e.getDate(),s=e.getHours(),l=e.getMinutes(),f=e.getSeconds(),c=e.getDay(),w=x=>String(x).padStart(2,"0"),p=s%12||12,m=s>=12?"PM":"AM",v={YYYY:String(o),YY:String(o).slice(-2),MMMM:n.months[i]??"",MMM:n.monthsShort[i]??"",MM:w(i+1),M:String(i+1),DD:w(a),D:String(a),dddd:n.weekdays[c]??"",ddd:n.weekdaysShort[c]??"",dd:n.weekdaysMin[c]??"",HH:w(s),H:String(s),hh:w(p),h:String(p),mm:w(l),m:String(l),ss:w(f),s:String(f),A:m,a:m.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|dd|HH|H|hh|h|mm|m|ss|s|A|a/g,x=>v[x]??x)}function _l(e,t="DD/MM/YYYY"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,f=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s/g);if(!f){let m=new Date(r);return isNaN(m.getTime())?null:m}let c="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let m of f)m==="YYYY"?c=c.replace("YYYY","(\\d{4})"):m==="YY"?c=c.replace("YY","(\\d{2})"):(m==="MM"||m==="M"||m==="DD"||m==="D"||m==="HH"||m==="H"||m==="hh"||m==="h"||m==="mm"||m==="m"||m==="ss"||m==="s")&&(c=c.replace(m,"(\\d{1,2})"));c+="$";let w=new RegExp(c).exec(r);if(!w){let m=new Date(r);return isNaN(m.getTime())?null:m}f.forEach((m,v)=>{let x=w[v+1];if(!x)return;let h=parseInt(x,10);isNaN(h)||(m==="YYYY"?n=h:m==="YY"?n=2e3+h:m==="MM"||m==="M"?o=h:m==="DD"||m==="D"?i=h:m==="HH"||m==="H"||m==="hh"||m==="h"?a=h:m==="mm"||m==="m"?s=h:(m==="ss"||m==="s")&&(l=h))});let p=new Date(n,o-1,i,a,s,l);return isNaN(p.getTime())?null:p}function Xl(e,t="days"){if(t==="days")return e;if(t==="years")return e.includes("YYYY")?"YYYY":e.includes("YY")?"YY":"YYYY";if(t==="months"){let r=e.replace(/(?:DD|D|dddd|ddd|dd)\s*[-/.,\s]+\s*/,"");return r=r.replace(/\s*[-/.,\s]+\s*(?:DD|D|dddd|ddd|dd)/,""),r=r.replace(/[-/.,\s]{2,}/g,n=>n.charAt(0)).trim(),!r||!r.includes("M")&&!r.includes("Y")?e.includes("-")?"MM-YYYY":"MM/YYYY":r}return e}var fr=require("react/jsx-runtime");function fa({currentMonth:e,view:t,onViewChange:r,onPrevMonth:n,onNextMonth:o,onPrevYear:i,onNextYear:a,onPrevDecade:s,onNextDecade:l,size:f="md",color:c="primary",locale:w,showMonthButtons:p=!0}){let m=Dt(w),v=C(f,Or,"md"),x=C(c,ko,"primary"),h=e.getFullYear(),k=e.getMonth(),T=Math.floor(h/10)*10,y=T+9,d=()=>{t==="days"?r("months"):t==="months"?r("years"):t==="years"&&r("days")},u=()=>{t==="years"?s?s():i():t==="months"?i():n()},g=()=>{t==="years"?l?l():a():t==="months"?a():o()},b=()=>t==="years"?`${T} - ${y}`:t==="months"?`${h}`:`${m.months[k]} ${h}`;return(0,fr.jsxs)("div",{className:"flex items-center justify-between px-1 pb-1.5 border-b border-neutral-200",children:[(0,fr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[t==="days"&&(0,fr.jsx)("button",{type:"button",onClick:i,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Un,{width:14,height:14})}),p&&(0,fr.jsx)("button",{type:"button",onClick:u,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Sr,{width:14,height:14})})]}),(0,fr.jsx)("button",{type:"button",onClick:d,className:`${v.headerText} px-2 py-1 rounded-md text-neutral-800 hover:bg-neutral-100 hover:${x.activeText} transition-colors cursor-pointer`,children:b()}),(0,fr.jsxs)("div",{className:"flex items-center space-x-0.5",children:[p&&(0,fr.jsx)("button",{type:"button",onClick:g,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Tr,{width:14,height:14})}),t==="days"&&(0,fr.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors`,children:(0,fr.jsx)(Yn,{width:14,height:14})})]})]})}var ql=Hn(require("react"),1);var nn=require("react/jsx-runtime");function pa({days:e,onSelectDate:t,size:r="md",color:n="primary",radius:o,locale:i,firstDayOfWeek:a=1,showWeekNumbers:s=!1}){let l=Dt(i),f=C(r,Or,"md"),c=C(n,ko,"primary"),w=C(o,Co,"lg"),p=(0,ql.useRef)(null),m=[...l.weekdaysShort];if(a===1){let d=m.shift();m.push(d)}let v=e.some(d=>d.isSelected&&!d.isDisabled),x=e.findIndex(d=>d.isToday&&!d.isDisabled),h=e.findIndex(d=>d.isCurrentMonth&&!d.isDisabled),k=h!==-1?h:e.findIndex(d=>!d.isDisabled),T=d=>{let g=p.current?.querySelectorAll("button")?.[d];g&&!g.disabled&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight"){d.preventDefault();for(let b=u+1;b<e.length;b++)if(!e[b].isDisabled){g=b;break}}else if(d.key==="ArrowLeft"){d.preventDefault();for(let b=u-1;b>=0;b--)if(!e[b].isDisabled){g=b;break}}else if(d.key==="ArrowDown")d.preventDefault(),u+7<e.length&&!e[u+7].isDisabled&&(g=u+7);else if(d.key==="ArrowUp")d.preventDefault(),u-7>=0&&!e[u-7].isDisabled&&(g=u-7);else if(d.key==="Home"){d.preventDefault();let b=u-u%7;for(let S=b;S<b+7&&S<e.length;S++)if(!e[S].isDisabled){g=S;break}}else if(d.key==="End"){d.preventDefault();let b=Math.min(e.length-1,u-u%7+6);for(let S=b;S>=u-u%7;S--)if(!e[S].isDisabled){g=S;break}}else if(d.key==="Enter"||d.key===" "){d.preventDefault();let b=e[u];b&&!b.isDisabled&&t(b.date);return}g!==null&&T(g)};return(0,nn.jsxs)("div",{ref:p,role:"grid","aria-label":l.months[e[15]?.month||0],className:"w-full",children:[(0,nn.jsxs)("div",{role:"row",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[s&&(0,nn.jsx)("div",{role:"columnheader","aria-label":l.weekText||"Week",className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} font-medium`,children:"#"}),m.map(d=>(0,nn.jsx)("div",{role:"columnheader","aria-label":d,className:`flex items-center justify-center ${f.cellSize} text-neutral-500 ${f.cellText} font-medium`,children:d},d))]}),(0,nn.jsx)("div",{role:"rowgroup",className:`grid ${s?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((d,u)=>{let g=u%7===0,b="text-neutral-800 hover:bg-neutral-100";d.isDisabled?b="text-neutral-300 cursor-not-allowed line-through":d.isSelected?b=`${c.selected} font-semibold shadow-xs`:d.isCurrentMonth||(b="text-neutral-400 hover:bg-neutral-100");let S=d.isToday&&!d.isSelected?`ring-1 ${c.todayRing} font-bold`:"",R=`${d.day} ${l.months[d.month]} ${d.year}`,D=!d.isDisabled&&(d.isSelected||!v&&d.isToday&&u===x||!v&&x===-1&&u===k);return(0,nn.jsxs)(ql.default.Fragment,{children:[s&&g&&(0,nn.jsxs)("div",{className:`flex items-center justify-center ${f.cellSize} text-neutral-400 ${f.cellText} text-[10px] font-mono`,children:["W",d.weekNumber]}),(0,nn.jsx)("div",{role:"gridcell","aria-selected":d.isSelected,className:"flex items-center justify-center",children:(0,nn.jsx)("button",{type:"button",disabled:d.isDisabled,tabIndex:D?0:-1,onKeyDown:P=>y(P,u),onClick:()=>!d.isDisabled&&t(d.date),"aria-label":R,"aria-current":d.isToday?"date":void 0,"aria-disabled":d.isDisabled,className:`flex items-center justify-center ${f.cellSize} ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${b} ${S}`,children:d.day})})]},d.date.toISOString())})})]})}var q0=require("react");var Zl=require("react/jsx-runtime");function ga({currentMonth:e,selectedDate:t,onSelectMonth:r,size:n="md",color:o="primary",radius:i,locale:a}){let s=Dt(a),l=C(n,Or,"md"),f=C(o,ko,"primary"),c=C(i,Co,"lg"),w=(0,q0.useRef)(null),p=e.getFullYear(),m=new Date,v=m.getMonth(),x=m.getFullYear(),h=t&&t.getFullYear()===p?t.getMonth():-1,k=h!==-1?h:x===p?v:0,T=d=>{let g=w.current?.querySelectorAll("button")?.[d];g&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<s.monthsShort.length&&(g=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(g=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<s.monthsShort.length&&(g=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(g=u-3);else if(d.key==="Home")d.preventDefault(),g=0;else if(d.key==="End")d.preventDefault(),g=s.monthsShort.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault(),r(u);return}g!==null&&T(g)};return(0,Zl.jsx)("div",{ref:w,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",children:s.monthsShort.map((d,u)=>{let g=new Date(p,u,1),b=t?xs(g,t):!1,S=x===p&&v===u,R=u===k,D="text-neutral-800 hover:bg-neutral-100";return b?D=`${f.selected} font-semibold shadow-xs`:S&&(D=`ring-1 ${f.todayRing} font-semibold`),(0,Zl.jsx)("div",{role:"gridcell","aria-selected":b,className:"flex items-center justify-center",children:(0,Zl.jsx)("button",{type:"button",tabIndex:R?0:-1,onKeyDown:P=>y(P,u),onClick:()=>r(u),"aria-label":`${d} ${p}`,className:`w-full flex items-center justify-center h-10 ${l.cellText} ${c} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${D}`,children:d})},d)})})}var Z0=require("react");var Jl=require("react/jsx-runtime");function ma({currentMonth:e,selectedDate:t,onSelectYear:r,size:n="md",color:o="primary",radius:i}){let a=C(n,Or,"md"),s=C(o,ko,"primary"),l=C(i,Co,"lg"),f=(0,Z0.useRef)(null),c=e.getFullYear(),w=t?t.getFullYear():c,p=Math.floor(c/10)*10,m=new Date().getFullYear(),v=[];for(let d=0;d<12;d++)v.push(p+d);let x=v.indexOf(w),h=v.indexOf(m),k=x!==-1?x:h!==-1?h:0,T=d=>{let g=f.current?.querySelectorAll("button")?.[d];g&&g.focus()},y=(d,u)=>{let g=null;if(d.key==="ArrowRight")d.preventDefault(),u+1<v.length&&(g=u+1);else if(d.key==="ArrowLeft")d.preventDefault(),u-1>=0&&(g=u-1);else if(d.key==="ArrowDown")d.preventDefault(),u+3<v.length&&(g=u+3);else if(d.key==="ArrowUp")d.preventDefault(),u-3>=0&&(g=u-3);else if(d.key==="Home")d.preventDefault(),g=0;else if(d.key==="End")d.preventDefault(),g=v.length-1;else if(d.key==="Enter"||d.key===" "){d.preventDefault();let b=v[u];b!==void 0&&r(b);return}g!==null&&T(g)};return(0,Jl.jsx)("div",{ref:f,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",children:v.map((d,u)=>{let g=d===w,b=d===m,S=u===k,R="text-neutral-800 hover:bg-neutral-100";return g?R=`${s.selected} font-semibold shadow-xs`:b&&(R=`ring-1 ${s.todayRing} font-semibold`),(0,Jl.jsx)("div",{role:"gridcell","aria-selected":g,className:"flex items-center justify-center",children:(0,Jl.jsx)("button",{type:"button",tabIndex:S?0:-1,onKeyDown:D=>y(D,u),onClick:()=>r(d),"aria-label":`${d}`,className:`w-full flex items-center justify-center h-10 ${a.cellText} ${l} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${R}`,children:d})},d)})})}var Gr=require("react/jsx-runtime");function on({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:c=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:v,className:x="",bordered:h=!0}){let k=C(p,Or,"md"),T=C(v,K0,"lg"),[y,d]=(0,pi.useState)(r),[u,g]=(0,pi.useState)(r);r!==u&&(g(r),d(r));let[b,S]=(0,pi.useState)(()=>{let A=e||new Date;return new Date(A.getFullYear(),A.getMonth(),1)}),R=Dt(s),D=(0,pi.useMemo)(()=>{let A=R.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(j=>({key:j,label:A[j]||j}))},[w,R.viewTabs]),P=A=>{let j=A;d(j),n?.(j)},I=()=>{let A=new Date(b.getFullYear(),b.getMonth()-1,1);S(A)},E=()=>{let A=new Date(b.getFullYear(),b.getMonth()+1,1);S(A)},N=()=>{let A=new Date(b.getFullYear()-1,b.getMonth(),1);S(A)},M=()=>{let A=new Date(b.getFullYear()+1,b.getMonth(),1);S(A)},z=()=>{let A=new Date(b.getFullYear()-10,b.getMonth(),1);S(A)},H=()=>{let A=new Date(b.getFullYear()+10,b.getMonth(),1);S(A)},V=A=>{let j=new Date(b.getFullYear(),A,1);S(j),r==="months"?t?.(j):d("days")},Y=A=>{let j=new Date(A,b.getMonth(),1);S(j),r==="years"?t?.(j):d("months")},$=jt(o),F=jt(i),G=(0,pi.useMemo)(()=>vs(b.getFullYear(),b.getMonth(),l,e,$,F,a),[b,l,e,$,F,a]);return(0,Gr.jsxs)("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${x}`,children:[c&&D.length>0&&(0,Gr.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Gr.jsx)(xo,{activeKey:r,onChange:P,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,Gr.jsx)(vo,{className:"p-0.5",children:D.map(A=>(0,Gr.jsx)(yo,{value:A.key,className:"py-1 px-2 text-xs",children:A.label},A.key))})})}),(0,Gr.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[(0,Gr.jsx)(fa,{currentMonth:b,view:y,onViewChange:d,onPrevMonth:I,onNextMonth:E,onPrevYear:N,onNextYear:M,onPrevDecade:z,onNextDecade:H,size:p,color:m,locale:s,showMonthButtons:!0}),y==="days"&&(0,Gr.jsx)(pa,{days:G,onSelectDate:A=>t?.(A),size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Gr.jsx)(ga,{currentMonth:b,selectedDate:e,onSelectMonth:V,size:p,color:m,radius:v,locale:s}),y==="years"&&(0,Gr.jsx)(ma,{currentMonth:b,selectedDate:e,onSelectYear:Y,size:p,color:m,radius:v})]})]})}var kt=require("react/jsx-runtime");function To({ref:e,value:t,defaultValue:r,onChange:n,format:o="DD/MM/YYYY",displayFormat:i,defaultView:a="days",locale:s="vi",firstDayOfWeek:l=1,minDate:f,maxDate:c,isDateDisabled:w,size:p="md",variant:m="outline",color:v="primary",radius:x,label:h,labelPlacement:k="top",placeholder:T,helperText:y,errorMessage:d,name:u,id:g,autoComplete:b,viewTabs:S=["days","months","years"],view:R,onViewChange:D,onClear:P,placement:I="bottom-start",disabled:E=!1,readOnly:N=!1,portal:M=!0,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:j=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,showWeekNumbers:ue=!1,showViewTabs:ie=!1,closeOnSelect:Q=!0}=z??{},q=(0,So.useId)(),ge=g||q,ke=`${ge}-error-helper`,L=`${ge}-popover`,te=R!==void 0,[Z,he]=(0,So.useState)(a),ae=te?R:Z,ve=i||o,Se=(0,So.useMemo)(()=>Xl(ve,ae),[ve,ae]),ye=t!==void 0,[J,O]=(0,So.useState)(()=>jt(r,o)),W=ye?jt(t,o):J,we=W?dr(W,Se,s):"",[fe,se]=(0,So.useState)(!1),{refs:{setReference:me,setFloating:Re},floatingStyles:xe,context:re}=(0,Nt.useFloating)({placement:I,open:fe&&!E&&!N&&!B,onOpenChange:se,whileElementsMounted:Nt.autoUpdate,transform:!1,middleware:[(0,Nt.offset)(6),(0,Nt.flip)(),(0,Nt.shift)({padding:8})]}),de=(0,Nt.useDismiss)(re,{escapeKey:!0,outsidePress:!0}),ce=(0,Nt.useRole)(re,{role:"dialog"}),{getReferenceProps:ee,getFloatingProps:U}=(0,Nt.useInteractions)([de,ce]),{isMounted:Ce,styles:$e}=rt(re),Ee=!!(j||d),oe=Ee?"error":v,Te=C(p,Or,"md"),Pe=C(x,Co,"lg"),Qe=m==="other"?"":C(oe,C(m,_0,"outline"),"primary"),We=!!W,Be=Ne=>{te||he(Ne),D?.(Ne)},Oe=Ne=>{ye||O(Ne);let Xe=Ne?dr(Ne,o,s):"";n?.(Xe),Q&&se(!1)},Ze=Ne=>{E||N||B||(Ne.key==="ArrowDown"||Ne.key==="Enter"||Ne.key===" "?(Ne.preventDefault(),fe||se(!0)):Ne.key==="Escape"&&fe&&(Ne.preventDefault(),se(!1)))},K=Ne=>{Ne.stopPropagation(),ye||O(null),n?.(null),P?.()},_=T||Se,ze=k==="floating",pe=k==="left",Fe=()=>(0,kt.jsx)(vt,{htmlFor:ge,label:h,isRequired:A,isFloating:ze,size:p,color:oe,hasError:Ee,cursor:"pointer",className:$}),et=Ne=>(0,kt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Te.icon}`,"aria-hidden":"true",children:Ne}),Ge=["group/field group/datepicker relative flex",pe?"flex-row items-center gap-3":"flex-col",ze?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),at=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Te.inputHeight,Pe,Qe,E?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),tt=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Te.inputText,Te.inputPadding,H].filter(Boolean).join(" ");return M?(0,kt.jsxs)("div",{className:Ge,children:[!ze&&Fe(),(0,kt.jsxs)("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[(0,kt.jsxs)("div",{ref:me,...ee(),className:at,children:[ze&&Fe(),(0,kt.jsx)("input",{ref:e,id:ge,name:u,type:"text",value:we,onClick:()=>!E&&!N&&!B&&se(Ne=>!Ne),onKeyDown:Ze,readOnly:!0,autoComplete:b,placeholder:_,disabled:E||B,role:"combobox","aria-expanded":fe&&!B,"aria-haspopup":"dialog","aria-controls":L,"aria-required":A,"aria-invalid":Ee,"aria-busy":B,"aria-disabled":E||B,"aria-describedby":y||d?ke:void 0,"aria-errormessage":d?ke:void 0,className:tt}),(0,kt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&(0,kt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:et((0,kt.jsx)(De,{}))}),!B&&le&&!E&&!N&&(0,kt.jsx)("button",{type:"button",onClick:K,"aria-label":"X\xF3a ng\xE0y",tabIndex:We?0:-1,"aria-hidden":!We,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} ${We?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,kt.jsx)(Ve,{className:"size-full"})}),(0,kt.jsx)("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:et((0,kt.jsx)(yt,{className:"size-full"}))})]})]}),Ce&&(0,kt.jsx)(Nt.FloatingPortal,{children:(0,kt.jsx)(Nt.FloatingFocusManager,{context:re,modal:!1,returnFocus:!0,children:(0,kt.jsx)("div",{ref:Re,id:L,style:{...xe,...$e,zIndex:lt.PICKER},...U(),className:G,children:(0,kt.jsx)(on,{value:W,onChange:Oe,view:ae,onViewChange:Be,minDate:f,maxDate:c,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:v,radius:x,showViewTabs:ie,viewTabs:S})})})}),(0,kt.jsx)(Le,{id:ke,helperText:y,errorMessage:d,sizeClassName:Te.helper,className:F})]})]}):(0,kt.jsx)("div",{className:H,children:(0,kt.jsx)(on,{bordered:!1,value:W,onChange:Oe,view:ae,onViewChange:Be,minDate:f,maxDate:c,isDateDisabled:w,locale:s,firstDayOfWeek:l,showWeekNumbers:ue,size:p,color:v,radius:x,showViewTabs:ie,viewTabs:S})})}var Do=require("react"),Pt=require("@floating-ui/react");var sn=require("react");var jr={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"}},Cn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Ql={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},Ro={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"}},ec={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:""}};var At=require("react/jsx-runtime");function ba({month1:e,month2:t,view:r,onViewChange:n,onPrevMonth:o,onNextMonth:i,onPrevYear:a,onNextYear:s,onPrevDecade:l,onNextDecade:f,size:c="md",color:w="primary",locale:p}){let m=Dt(p),v=C(c,jr,"md"),x=C(w,Ro,"primary"),h=m.months[e.getMonth()],k=e.getFullYear(),T=Math.floor(k/10)*10,y=T+9,d=`${h} ${k}`;r==="months"&&(d=`${k}`),r==="years"&&(d=`${T} - ${y}`);let u=m.months[t.getMonth()],g=t.getFullYear(),b=Math.floor(g/10)*10,S=b+9,R=`${u} ${g}`;r==="months"&&(R=`${g}`),r==="years"&&(R=`${b} - ${S}`);let D=()=>{r==="days"?n("months"):r==="months"?n("years"):r==="years"&&n("days")},P=()=>{r==="days"?o():r==="months"?a():r==="years"&&(l?l():a())},I=()=>{r==="days"?i():r==="months"?s():r==="years"&&(f?f():s())};return(0,At.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-neutral-200",children:[(0,At.jsxs)("div",{className:"flex items-center space-x-0.5",children:[r==="days"&&(0,At.jsx)("button",{type:"button",onClick:a,"aria-label":"N\u0103m tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Un,{width:14,height:14})}),(0,At.jsx)("button",{type:"button",onClick:P,"aria-label":"Th\xE1ng tr\u01B0\u1EDBc",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Sr,{width:v.iconSize,height:v.iconSize})})]}),(0,At.jsxs)("div",{className:"grid grid-cols-2 flex-1 text-center divide-x divide-transparent px-2",children:[(0,At.jsx)("div",{className:"flex items-center justify-center",children:(0,At.jsx)("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${x.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${v.headerText}`,children:d})}),(0,At.jsx)("div",{className:"flex items-center justify-center",children:(0,At.jsx)("button",{type:"button",onClick:D,"aria-label":"\u0110\u1ED5i ch\u1EBF \u0111\u1ED9 xem l\u1ECBch",className:`font-semibold text-neutral-800 hover:${x.activeText} hover:bg-neutral-100 rounded-md px-2 py-1 transition-colors cursor-pointer ${v.headerText}`,children:R})})]}),(0,At.jsxs)("div",{className:"flex items-center space-x-0.5",children:[(0,At.jsx)("button",{type:"button",onClick:I,"aria-label":"Th\xE1ng ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Tr,{width:v.iconSize,height:v.iconSize})}),r==="days"&&(0,At.jsx)("button",{type:"button",onClick:s,"aria-label":"N\u0103m ti\u1EBFp theo",className:`flex items-center justify-center ${v.headerButtonSize} rounded-md text-neutral-500 hover:text-neutral-800 hover:bg-neutral-100 transition-colors cursor-pointer`,children:(0,At.jsx)(Yn,{width:14,height:14})})]})]})}var tc=Hn(require("react"),1);var an=require("react/jsx-runtime");function gi({days:e,onSelectDate:t,onHoverDate:r,size:n="md",color:o="primary",radius:i,locale:a,firstDayOfWeek:s=1,showWeekNumbers:l=!1}){let f=Dt(a),c=C(n,jr,"md"),w=C(o,Ro,"primary"),p=C(i,Cn,"lg"),m=(0,tc.useRef)(null),v=[...f.weekdaysShort];if(s===1){let u=v.shift();v.push(u)}let x=e.some(u=>(u.isSelected||u.isRangeStart)&&!u.isDisabled),h=e.findIndex(u=>u.isToday&&!u.isDisabled),k=e.findIndex(u=>u.isCurrentMonth&&!u.isDisabled),T=k!==-1?k:e.findIndex(u=>!u.isDisabled),y=u=>{let b=m.current?.querySelectorAll("button")?.[u];b&&!b.disabled&&b.focus()},d=(u,g)=>{let b=null;if(u.key==="ArrowRight"){u.preventDefault();for(let S=g+1;S<e.length;S++)if(!e[S].isDisabled){b=S;break}}else if(u.key==="ArrowLeft"){u.preventDefault();for(let S=g-1;S>=0;S--)if(!e[S].isDisabled){b=S;break}}else if(u.key==="ArrowDown")u.preventDefault(),g+7<e.length&&!e[g+7].isDisabled&&(b=g+7);else if(u.key==="ArrowUp")u.preventDefault(),g-7>=0&&!e[g-7].isDisabled&&(b=g-7);else if(u.key==="Home"){u.preventDefault();let S=g-g%7;for(let R=S;R<S+7&&R<e.length;R++)if(!e[R].isDisabled){b=R;break}}else if(u.key==="End"){u.preventDefault();let S=Math.min(e.length-1,g-g%7+6);for(let R=S;R>=g-g%7;R--)if(!e[R].isDisabled){b=R;break}}else if(u.key==="Enter"||u.key===" "){u.preventDefault();let S=e[g];S&&!S.isDisabled&&t(S.date);return}b!==null&&y(b)};return(0,an.jsxs)("div",{ref:m,role:"grid","aria-label":f.months[e[15]?.month||0],className:"w-full",children:[(0,an.jsxs)("div",{role:"row",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-1 mb-1 text-center`,children:[l&&(0,an.jsx)("div",{role:"columnheader","aria-label":f.weekText||"Week",className:`flex items-center justify-center ${c.cellSize} text-neutral-400 ${c.cellText} font-medium`,children:"#"}),v.map(u=>(0,an.jsx)("div",{role:"columnheader","aria-label":u,className:`flex items-center justify-center ${c.cellSize} text-neutral-500 ${c.cellText} font-medium`,children:u},u))]}),(0,an.jsx)("div",{role:"rowgroup",className:`grid ${l?"grid-cols-8":"grid-cols-7"} gap-y-1 gap-x-1`,children:e.map((u,g)=>{let b=g%7===0,S="text-neutral-800 hover:bg-neutral-100",R="";u.isDisabled?S="text-neutral-300 cursor-not-allowed line-through":u.isRangeStart||u.isRangeEnd?(S=`${w.selected} font-semibold shadow-xs`,u.isRangeStart&&u.isRangeEnd?R="":u.isRangeStart?R=`${w.rangeBg} rounded-l-full`:u.isRangeEnd&&(R=`${w.rangeBg} rounded-r-full`)):u.isSelected?S=`${w.selected} font-semibold shadow-xs`:u.isInRange||u.isHoveredRange?(S=`${w.rangeBg} ${w.rangeText} rounded-none`,R=`${w.rangeBg}`):u.isCurrentMonth||(S="text-neutral-400 hover:bg-neutral-100");let D=u.isToday&&!u.isSelected?`ring-1 ${w.todayRing} font-bold`:"",P=`${u.day} ${f.months[u.month]} ${u.year}`,I=!u.isDisabled&&(u.isSelected||u.isRangeStart||!x&&u.isToday&&g===h||!x&&h===-1&&g===T);return(0,an.jsxs)(tc.default.Fragment,{children:[l&&b&&(0,an.jsxs)("div",{className:`flex items-center justify-center ${c.cellSize} text-neutral-400 ${c.cellText} text-[10px] font-mono`,children:["W",u.weekNumber]}),(0,an.jsx)("div",{role:"gridcell","aria-selected":u.isSelected||u.isInRange,className:`relative flex items-center justify-center ${R}`,children:(0,an.jsx)("button",{type:"button",disabled:u.isDisabled,tabIndex:I?0:-1,onKeyDown:E=>d(E,g),onClick:()=>!u.isDisabled&&t(u.date),onMouseEnter:()=>!u.isDisabled&&r?.(u.date),onMouseLeave:()=>r?.(null),"aria-label":P,"aria-current":u.isToday?"date":void 0,"aria-disabled":u.isDisabled,className:`flex items-center justify-center ${c.cellSize} ${c.cellText} ${p} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${S} ${D}`,children:u.day})})]},u.date.toISOString())})})]})}var J0=require("react");var rc=require("react/jsx-runtime");function mi({currentMonth:e,onSelectMonth:t,size:r="md",color:n="primary",radius:o,locale:i,rangeStart:a,rangeEnd:s,hoveredDate:l,onHoverMonth:f}){let c=Dt(i),w=C(r,jr,"md"),p=C(n,Ro,"primary"),m=C(o,Cn,"lg"),v=(0,J0.useRef)(null),x=e.getFullYear(),h=new Date,k=h.getMonth(),T=h.getFullYear(),y=a&&a.getFullYear()===x?a.getMonth():-1,d=y!==-1?y:T===x?k:0,u=b=>{let R=v.current?.querySelectorAll("button")?.[b];R&&R.focus()},g=(b,S)=>{let R=null;if(b.key==="ArrowRight")b.preventDefault(),S+1<c.monthsShort.length&&(R=S+1);else if(b.key==="ArrowLeft")b.preventDefault(),S-1>=0&&(R=S-1);else if(b.key==="ArrowDown")b.preventDefault(),S+3<c.monthsShort.length&&(R=S+3);else if(b.key==="ArrowUp")b.preventDefault(),S-3>=0&&(R=S-3);else if(b.key==="Home")b.preventDefault(),R=0;else if(b.key==="End")b.preventDefault(),R=c.monthsShort.length-1;else if(b.key==="Enter"||b.key===" "){b.preventDefault(),t(S);return}R!==null&&u(R)};return(0,rc.jsx)("div",{ref:v,role:"grid","aria-label":"Ch\u1ECDn th\xE1ng",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>f?.(null),children:c.monthsShort.map((b,S)=>{let R=new Date(x,S,1),D=R.getTime(),P=a?new Date(a.getFullYear(),a.getMonth(),1).getTime():null,I=s?new Date(s.getFullYear(),s.getMonth(),1).getTime():null,E=l?new Date(l.getFullYear(),l.getMonth(),1).getTime():null,N=!!P&&P===D,M=!!I&&I===D,z=!1,H=!1;P&&I?z=D>P&&D<I:P&&!I&&E&&(E>P?H=D>P&&D<=E:E<P&&(H=D<P&&D>=E));let V=T===x&&k===S,Y=S===d,$="text-neutral-800 hover:bg-neutral-100";return N||M?$=`${p.selected} font-semibold shadow-xs`:z||H?$=`${p.rangeBg} ${p.rangeText}`:V&&($=`ring-1 ${p.todayRing} font-semibold`),(0,rc.jsx)("div",{role:"gridcell","aria-selected":N||M||z,className:"flex items-center justify-center",children:(0,rc.jsx)("button",{type:"button",tabIndex:Y?0:-1,onKeyDown:F=>g(F,S),onClick:()=>t(S),onMouseEnter:()=>f?.(R),"aria-label":`${b} ${x}`,className:`w-full flex items-center justify-center h-10 ${w.cellText} ${m} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${$}`,children:b})},b)})})}var Q0=require("react");var nc=require("react/jsx-runtime");function bi({currentMonth:e,onSelectYear:t,size:r="md",color:n="primary",radius:o,rangeStart:i,rangeEnd:a,hoveredDate:s,onHoverYear:l}){let f=C(r,jr,"md"),c=C(n,Ro,"primary"),w=C(o,Cn,"lg"),p=(0,Q0.useRef)(null),m=e.getFullYear(),v=Math.floor(m/10)*10,x=new Date().getFullYear(),h=[];for(let b=0;b<12;b++)h.push(v+b);let k=i?i.getFullYear():m,T=h.indexOf(k),y=h.indexOf(x),d=T!==-1?T:y!==-1?y:0,u=b=>{let R=p.current?.querySelectorAll("button")?.[b];R&&R.focus()},g=(b,S)=>{let R=null;if(b.key==="ArrowRight")b.preventDefault(),S+1<h.length&&(R=S+1);else if(b.key==="ArrowLeft")b.preventDefault(),S-1>=0&&(R=S-1);else if(b.key==="ArrowDown")b.preventDefault(),S+3<h.length&&(R=S+3);else if(b.key==="ArrowUp")b.preventDefault(),S-3>=0&&(R=S-3);else if(b.key==="Home")b.preventDefault(),R=0;else if(b.key==="End")b.preventDefault(),R=h.length-1;else if(b.key==="Enter"||b.key===" "){b.preventDefault();let D=h[S];D!==void 0&&t(D);return}R!==null&&u(R)};return(0,nc.jsx)("div",{ref:p,role:"grid","aria-label":"Ch\u1ECDn n\u0103m",className:"grid grid-cols-3 gap-2 py-2",onMouseLeave:()=>l?.(null),children:h.map((b,S)=>{let R=i?i.getFullYear():null,D=a?a.getFullYear():null,P=s?s.getFullYear():null,I=R!==null&&b===R,E=D!==null&&b===D,N=!1,M=!1;R!==null&&D!==null?N=b>R&&b<D:R!==null&&D===null&&P!==null&&(P>R?M=b>R&&b<=P:P<R&&(M=b<R&&b>=P));let z=b===x,H=S===d,V="text-neutral-800 hover:bg-neutral-100";return I||E?V=`${c.selected} font-semibold shadow-xs`:N||M?V=`${c.rangeBg} ${c.rangeText}`:z&&(V=`ring-1 ${c.todayRing} font-semibold`),(0,nc.jsx)("div",{role:"gridcell","aria-selected":I||E||N,className:"flex items-center justify-center",children:(0,nc.jsx)("button",{type:"button",tabIndex:H?0:-1,onKeyDown:Y=>g(Y,S),onClick:()=>t(b),onMouseEnter:()=>l?.(new Date(b,0,1)),"aria-label":`${b}`,className:`w-full flex items-center justify-center h-10 ${f.cellText} ${w} transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50 ${V}`,children:b})},b)})})}function Ku(e,t,r){if(!t||!r)return!1;let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),a=Math.min(o,i),s=Math.max(o,i);return n>=a&&n<=s}function ef(e,t){return new Date(e,t+1,0).getDate()}function Wu(e,t,r,n,o,i,a,s,l){let f=n?eo(e,n):!1,c=o?eo(e,o):!1,w=Ku(e,n||null,o||null),p=n&&!o&&i?Ku(e,n,i):!1,m=!1;return a&&ca(e,a)&&(m=!0),s&&ua(e,s)&&(m=!0),l&&l(e)&&(m=!0),{date:e,day:e.getDate(),month:e.getMonth(),year:e.getFullYear(),isCurrentMonth:t,isToday:eo(e,r),isSelected:f||c,isDisabled:m,isRangeStart:f,isRangeEnd:c,isInRange:w,isHoveredRange:p,weekNumber:da(e)}}function ha(e,t,r=1,n,o,i,a,s,l){let f=[],c=new Date,w=new Date(e,t,1).getDay(),p=ef(e,t-1),m=ef(e,t),v=r===1?w===0?6:w-1:w;for(let h=v-1;h>=0;h--){let k=p-h,T=new Date(e,t-1,k);f.push(Wu(T,!1,c,n,o,i,a,s,l))}for(let h=1;h<=m;h++){let k=new Date(e,t,h);f.push(Wu(k,!0,c,n,o,i,a,s,l))}let x=42-f.length;for(let h=1;h<=x;h++){let k=new Date(e,t+1,h);f.push(Wu(k,!1,c,n,o,i,a,s,l))}return f}var Ut=require("react/jsx-runtime");function hi({value:e,onChange:t,view:r="days",onViewChange:n,minDate:o,maxDate:i,isDateDisabled:a,locale:s="vi",firstDayOfWeek:l=1,showWeekNumbers:f=!1,showViewTabs:c=!1,viewTabs:w=["days","months","years"],size:p="md",color:m="primary",radius:v,className:x="",bordered:h=!0}){let k=C(p,jr,"md"),T=C(v,Ql,"lg"),[y,d]=(0,sn.useState)(r),[u,g]=(0,sn.useState)(r);r!==u&&(g(r),d(r));let b=e?e[0]:null,S=e?e[1]:null,[R,D]=(0,sn.useState)(()=>{let L=b||new Date;return new Date(L.getFullYear(),L.getMonth(),1)}),P=Dt(s),I=(0,sn.useMemo)(()=>{let L=P.viewTabs||{days:"Ng\xE0y",months:"Th\xE1ng",years:"N\u0103m"};return(w||["days","months","years"]).map(te=>({key:te,label:L[te]||te}))},[w,P.viewTabs]),E=L=>{let te=L;d(te),F(null),n?.(te)},N=()=>{let L=new Date(R.getFullYear(),R.getMonth()-1,1);D(L)},M=()=>{let L=new Date(R.getFullYear(),R.getMonth()+1,1);D(L)},z=()=>{let L=new Date(R.getFullYear()-1,R.getMonth(),1);D(L)},H=()=>{let L=new Date(R.getFullYear()+1,R.getMonth(),1);D(L)},V=()=>{let L=new Date(R.getFullYear()-10,R.getMonth(),1);D(L)},Y=()=>{let L=new Date(R.getFullYear()+10,R.getMonth(),1);D(L)},[$,F]=(0,sn.useState)(null),[G,A]=(0,sn.useState)(null),j=L=>{if(!$)F(L),t?.([L,null]);else{let te=$,Z=L;L.getTime()<te.getTime()&&(te=L,Z=$),F(null),t?.([te,Z])}},B=(L,te)=>{let Z=new Date(L,te,1);if(D(Z),c&&r==="months")if(!$)F(Z),t?.([Z,null]);else{let he=$,ae=Z;Z.getTime()<he.getTime()&&(he=Z,ae=$),F(null),t?.([he,ae])}else d("days")},X=L=>{let te=new Date(L,0,1);if(D(te),c&&r==="years")if(!$)F(te),t?.([te,null]);else{let Z=$,he=te;te.getTime()<Z.getTime()&&(Z=te,he=$),F(null),t?.([Z,he])}else d("months")},le=jt(o),ne=jt(i),ue=R,ie=(0,sn.useMemo)(()=>y==="months"?new Date(R.getFullYear()+1,R.getMonth(),1):y==="years"?new Date(R.getFullYear()+10,R.getMonth(),1):new Date(R.getFullYear(),R.getMonth()+1,1),[R,y]),Q=$||b,q=$?null:S,ge=(0,sn.useMemo)(()=>ha(ue.getFullYear(),ue.getMonth(),l,Q,q,G,le,ne,a),[ue,l,Q,q,G,le,ne,a]),ke=(0,sn.useMemo)(()=>ha(ie.getFullYear(),ie.getMonth(),l,Q,q,G,le,ne,a),[ie,l,Q,q,G,le,ne,a]);return(0,Ut.jsxs)("div",{className:`inline-flex flex-col ${h?"border-2 border-neutral-200 bg-neutral-white shadow-xl":"border-0 shadow-none bg-transparent"} ${T} overflow-hidden select-none ${x}`,children:[c&&I.length>0&&(0,Ut.jsx)("div",{className:"px-2.5 py-1.5 border-b border-neutral-200",children:(0,Ut.jsx)(xo,{activeKey:r,onChange:E,size:"sm",variant:"solid",color:m,fullWidth:!0,className:"gap-0!",children:(0,Ut.jsx)(vo,{className:"p-0.5",children:I.map(L=>(0,Ut.jsx)(yo,{value:L.key,className:"py-1 px-2 text-xs",children:L.label},L.key))})})}),(0,Ut.jsx)(ba,{month1:ue,month2:ie,view:y,onViewChange:d,onPrevMonth:N,onNextMonth:M,onPrevYear:z,onNextYear:H,onPrevDecade:V,onNextDecade:Y,size:p,color:m,locale:s}),(0,Ut.jsxs)("div",{className:"flex flex-row divide-x divide-neutral-200",children:[(0,Ut.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&(0,Ut.jsx)(gi,{days:ge,onSelectDate:j,onHoverDate:A,size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Ut.jsx)(mi,{currentMonth:ue,onSelectMonth:L=>B(ue.getFullYear(),L),size:p,color:m,radius:v,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&(0,Ut.jsx)(bi,{currentMonth:ue,onSelectYear:X,size:p,color:m,radius:v,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]}),(0,Ut.jsxs)("div",{className:`${k.calendarPadding} min-w-70`,children:[y==="days"&&(0,Ut.jsx)(gi,{days:ke,onSelectDate:j,onHoverDate:A,size:p,color:m,radius:v,locale:s,firstDayOfWeek:l,showWeekNumbers:f}),y==="months"&&(0,Ut.jsx)(mi,{currentMonth:ie,onSelectMonth:L=>B(ie.getFullYear(),L),size:p,color:m,radius:v,locale:s,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverMonth:A}),y==="years"&&(0,Ut.jsx)(bi,{currentMonth:ie,onSelectYear:X,size:p,color:m,radius:v,rangeStart:Q,rangeEnd:q,hoveredDate:G,onHoverYear:A})]})]})]})}var St=require("react/jsx-runtime");function No({ref:e,value:t,defaultValue:r,onChange:n,separator:o=" - ",format:i="DD/MM/YYYY",displayFormat:a,defaultView:s="days",locale:l="vi",firstDayOfWeek:f=1,minDate:c,maxDate:w,isDateDisabled:p,size:m="md",variant:v="outline",color:x="primary",radius:h,label:k,labelPlacement:T="top",placeholder:y,helperText:d,errorMessage:u,name:g,id:b,autoComplete:S,viewTabs:R=["days","months","years"],view:D,onViewChange:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,portal:z=!0,config:H,className:V="",wrapperClassName:Y="",inputWrapperClassName:$="",labelClassName:F="",helperClassName:G="",popoverClassName:A=""}){let{isRequired:j=!1,isInvalid:B=!1,isLoading:X=!1,showSpinner:le=!1,isClearable:ne=!0,isFullWidth:ue=!1,showWeekNumbers:ie=!1,showViewTabs:Q=!1,closeOnSelect:q=!0}=H??{},ge=(0,Do.useId)(),ke=b||ge,L=`${ke}-error-helper`,te=`${ke}-popover`,Z=D!==void 0,[he,ae]=(0,Do.useState)(s),ve=Z?D:he,Se=a||i,ye=(0,Do.useMemo)(()=>Xl(Se,ve),[Se,ve]),J=t!==void 0,[O,W]=(0,Do.useState)(()=>{let be=r;return be&&Array.isArray(be)?[jt(be[0],i),jt(be[1],i)]:[null,null]}),we=J&&t&&Array.isArray(t)?[jt(t[0],i),jt(t[1],i)]:O,fe=we[0]&&we[1]?`${dr(we[0],ye,l)}${o}${dr(we[1],ye,l)}`:we[0]?`${dr(we[0],ye,l)}${o}`:"",[se,me]=(0,Do.useState)(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=(0,Pt.useFloating)({placement:E,open:se&&!N&&!M&&!X,onOpenChange:me,whileElementsMounted:Pt.autoUpdate,transform:!1,middleware:[(0,Pt.offset)(6),(0,Pt.flip)(),(0,Pt.shift)({padding:8})]}),ce=(0,Pt.useDismiss)(de,{escapeKey:!0,outsidePress:!0}),ee=(0,Pt.useRole)(de,{role:"dialog"}),{getReferenceProps:U,getFloatingProps:Ce}=(0,Pt.useInteractions)([ce,ee]),{isMounted:$e,styles:Ee}=rt(de),oe=!!(B||u),Te=oe?"error":x,Pe=C(m,jr,"md"),Qe=C(h,Cn,"lg"),We=C(v,ec,"outline"),Be=v==="other"?"":C(Te,We,"primary"),Oe=!!we[0],Ze=be=>{Z||ae(be),P?.(be)},K=be=>{J||W(be);let[je,pt]=be;if(je&&pt){let st=[dr(je,i,l),dr(pt,i,l)];n?.(st),q&&me(!1)}},_=be=>{N||M||X||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),J||W([null,null]),n?.(null),I?.()},pe=y||`${ye}${o}${ye}`,Fe=T==="floating",et=T==="left",Ge=()=>(0,St.jsx)(vt,{htmlFor:ke,label:k,isRequired:j,isFloating:Fe,size:m,color:Te,hasError:oe,cursor:"pointer",className:F}),at=be=>(0,St.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),tt=["group/field group/daterangepicker relative flex",et?"flex-row items-center gap-3":"flex-col",Fe?"pt-2":"",ue?"w-full":"inline-flex",Y].filter(Boolean).join(" "),Ne=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,Qe,Be,N?"opacity-50":"",ue?"w-full":"w-auto",$].filter(Boolean).join(" "),Xe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,V].filter(Boolean).join(" ");return z?(0,St.jsxs)("div",{className:tt,children:[!Fe&&Ge(),(0,St.jsxs)("div",{className:`flex flex-col ${ue?"w-full":""}`,children:[(0,St.jsxs)("div",{ref:Re,...U(),className:Ne,children:[Fe&&Ge(),(0,St.jsx)("input",{ref:e,id:ke,name:g,type:"text",value:fe,onClick:()=>!N&&!M&&!X&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:S,placeholder:pe,disabled:N||X,role:"combobox","aria-expanded":se&&!X,"aria-haspopup":"dialog","aria-controls":te,"aria-required":j,"aria-invalid":oe,"aria-busy":X,"aria-disabled":N||X,"aria-describedby":d||u?L:void 0,"aria-errormessage":u?L:void 0,className:Xe}),(0,St.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[X&&le&&(0,St.jsx)("div",{className:"flex items-center justify-center shrink-0",children:at((0,St.jsx)(De,{}))}),!X&&ne&&!N&&!M&&(0,St.jsx)("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y",tabIndex:Oe?0:-1,"aria-hidden":!Oe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Oe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,St.jsx)(Ve,{className:"size-full"})}),(0,St.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:at((0,St.jsx)(yt,{className:"size-full"}))})]})]}),$e&&(0,St.jsx)(Pt.FloatingPortal,{children:(0,St.jsx)(Pt.FloatingFocusManager,{context:de,modal:!1,returnFocus:!0,children:(0,St.jsx)("div",{ref:xe,id:te,style:{...re,...Ee,zIndex:lt.PICKER},...Ce(),className:A,children:(0,St.jsx)(hi,{value:we,onChange:K,view:ve,onViewChange:Ze,minDate:c,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:f,showWeekNumbers:ie,size:m,color:x,radius:h,showViewTabs:Q,viewTabs:R})})})}),(0,St.jsx)(Le,{id:L,helperText:d,errorMessage:u,sizeClassName:Pe.helper,className:G})]})]}):(0,St.jsx)("div",{className:V,children:(0,St.jsx)(hi,{bordered:!1,value:we,onChange:K,view:ve,onViewChange:Ze,minDate:c,maxDate:w,isDateDisabled:p,locale:l,firstDayOfWeek:f,showWeekNumbers:ie,size:m,color:x,radius:h,showViewTabs:Q,viewTabs:R})})}var ws=require("react"),It=require("@floating-ui/react");var xi=require("react");var Po={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"}},oc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},ic={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},tf={none:"rounded-none",sm:"rounded-xs",md:"rounded-md",lg:"rounded-lg",xl:"rounded-lg",full:"rounded-full"},rf={primary:{selected:"bg-primary-500 text-neutral-white font-semibold shadow-xs hover:bg-primary-600",hoverBg:"hover:bg-primary-100 hover:text-primary-900",activeText:"text-primary-600",accentBg:"bg-primary-500"},secondary:{selected:"bg-secondary-500 text-neutral-white font-semibold shadow-xs hover:bg-secondary-600",hoverBg:"hover:bg-secondary-100 hover:text-secondary-900",activeText:"text-secondary-600",accentBg:"bg-secondary-500"},neutral:{selected:"bg-neutral-800 text-neutral-white font-semibold shadow-xs hover:bg-neutral-900",hoverBg:"hover:bg-neutral-200 hover:text-neutral-900",activeText:"text-neutral-800",accentBg:"bg-neutral-800"},error:{selected:"bg-error-500 text-neutral-white font-semibold shadow-xs hover:bg-error-600",hoverBg:"hover:bg-error-100 hover:text-error-900",activeText:"text-error-600",accentBg:"bg-error-500"},success:{selected:"bg-success-500 text-neutral-white font-semibold shadow-xs hover:bg-success-600",hoverBg:"hover:bg-success-100 hover:text-success-900",activeText:"text-success-600",accentBg:"bg-success-500"},warning:{selected:"bg-warning-500 text-neutral-950 font-semibold shadow-xs hover:bg-warning-600",hoverBg:"hover:bg-warning-100 hover:text-warning-900",activeText:"text-warning-700",accentBg:"bg-warning-500"},info:{selected:"bg-info-500 text-neutral-white font-semibold shadow-xs hover:bg-info-600",hoverBg:"hover:bg-info-100 hover:text-info-900",activeText:"text-info-600",accentBg:"bg-info-500"}};var ac={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 to(e=!1,t=!0){return e?t?"hh:mm:ss A":"hh:mm A":t?"HH:mm:ss":"HH:mm"}function pr(e){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e);if(typeof e!="string")return null;let t=e.trim();if(!t)return null;if(t.includes("T")){let o=new Date(t);if(!isNaN(o.getTime()))return o}let r=/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\s*([ap]m))?$/i,n=t.match(r);if(n){let o=parseInt(n[1],10),i=parseInt(n[2],10),a=n[3]?parseInt(n[3],10):0,s=n[4]?.toUpperCase();if(s&&(s==="PM"&&o<12&&(o+=12),s==="AM"&&o===12&&(o=0)),o>=0&&o<24&&i>=0&&i<60&&a>=0&&a<60){let l=new Date;return l.setHours(o,i,a,0),l}}return null}function Qt(e,t="HH:mm:ss"){if(!e||isNaN(e.getTime()))return"";let r=e.getHours(),n=e.getMinutes(),o=e.getSeconds(),i=r%12;i===0&&(i=12);let a=r>=12?"PM":"AM";return t.replace(/HH/g,Ur(r)).replace(/H/g,`${r}`).replace(/hh/g,Ur(i)).replace(/h/g,`${i}`).replace(/mm/g,Ur(n)).replace(/m/g,`${n}`).replace(/ss/g,Ur(o)).replace(/s/g,`${o}`).replace(/A/g,a).replace(/a/g,a.toLowerCase())}function _u(e){if(!e)return{hours:0,minutes:0,seconds:0,period:"AM"};let t=e.getHours();return{hours:t,minutes:e.getMinutes(),seconds:e.getSeconds(),period:t>=12?"PM":"AM"}}function zo(e,t,r=0){let n=new Date;return n.setHours(e,t,r,0),n}function Xu(e,t,r=!0){return!e||!t?!1:r?e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()&&e.getSeconds()===t.getSeconds():e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes()}function qu(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r<n}function Zu(e,t){if(!e||!t)return!1;let r=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),n=t.getHours()*3600+t.getMinutes()*60+t.getSeconds();return r>n}function Io(e,t,r,n,o,i,a,s,l){if(e==="hour"){if(a?.().includes(t)||o&&t<o.getHours()||i&&t>i.getHours())return!0}else if(e==="minute"){if(s?.(r).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&t<o.getMinutes())||i&&(r>i.getHours()||r===i.getHours()&&t>i.getMinutes()))return!0}else if(e==="second"&&(l?.(r,n).includes(t)||o&&(r<o.getHours()||r===o.getHours()&&n<o.getMinutes()||r===o.getHours()&&n===o.getMinutes()&&t<o.getSeconds())||i&&(r>i.getHours()||r===i.getHours()&&n>i.getMinutes()||r===i.getHours()&&n===i.getMinutes()&&t>i.getSeconds())))return!0;return!1}var ys=require("react");var Ju=require("react/jsx-runtime");function ro({items:e,selectedValue:t,onSelect:r,ariaLabel:n,size:o="md",color:i="primary",radius:a,className:s="",itemClassName:l="",selectedItemClassName:f=""}){let c=(0,ys.useRef)(null),w=(0,ys.useRef)(null),p=C(o,Po,"md"),m=C(i,rf,"primary"),v=C(a,tf,"md"),x=e.findIndex(y=>!y.disabled),h=e.some(y=>y.value===t);(0,ys.useEffect)(()=>{if(w.current&&c.current){let y=c.current,d=w.current,u=d.offsetTop-y.offsetTop-(y.clientHeight-d.clientHeight)/2;y.scrollTo({top:Math.max(0,u),behavior:"smooth"}),y.contains(document.activeElement)&&d.focus()}},[t]);let k=y=>{let d=e[y];if(!d||d.disabled)return;r(d.value),c.current?.children[y]?.focus()},T=(y,d)=>{if(e.filter(g=>!g.disabled).length){if(y.key==="ArrowDown"){y.preventDefault();for(let g=d+1;g<e.length;g++)if(!e[g].disabled){k(g);break}}else if(y.key==="ArrowUp"){y.preventDefault();for(let g=d-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(y.key==="ArrowRight")y.preventDefault(),c.current?.nextElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="ArrowLeft")y.preventDefault(),c.current?.previousElementSibling?.querySelector('[tabindex="0"], [role="option"]:not([aria-disabled="true"])')?.focus();else if(y.key==="Home"){y.preventDefault();let g=e.findIndex(b=>!b.disabled);g!==-1&&k(g)}else if(y.key==="End"){y.preventDefault();for(let g=e.length-1;g>=0;g--)if(!e[g].disabled){k(g);break}}else if(y.key==="Enter"||y.key===" "){y.preventDefault();let g=e[d];g&&!g.disabled&&k(d)}}};return(0,Ju.jsx)("ul",{ref:c,role:"listbox","aria-label":n,tabIndex:-1,className:`relative flex flex-col overflow-y-auto select-none ${p.columnWidth} ${p.columnHeight} scrollbar-thin scrollbar-thumb-neutral-300 hover:scrollbar-thumb-neutral-400 py-1 focus:outline-none ${s}`,style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map((y,d)=>{let u=t===y.value,g=!!y.disabled,b=!g&&(u||!h&&d===x);return(0,Ju.jsx)("li",{ref:u?w:void 0,role:"option","aria-selected":u,"aria-disabled":g,"aria-label":`${y.label} ${n||""}`.trim(),tabIndex:b?0:-1,onKeyDown:S=>T(S,d),onClick:()=>{g||k(d)},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 ${v} ${p.itemHeight} ${p.itemText} ${g?"opacity-30 cursor-not-allowed text-neutral-400":u?`${m.selected} cursor-default ${f}`:`text-neutral-700 ${m.hoverBg} cursor-pointer`} ${l}`,children:y.label},`${y.value}`)})})}var kn=require("react/jsx-runtime");function Pr({value:e,onChange:t,ariaLabel:r="Time selector",use12Hours:n=!1,showSeconds:o=!0,hourStep:i=1,minuteStep:a=1,secondStep:s=1,minTime:l,maxTime:f,disabledHours:c,disabledMinutes:w,disabledSeconds:p,size:m="md",color:v="primary",radius:x,className:h=""}){let k=(0,xi.useMemo)(()=>pr(l),[l]),T=(0,xi.useMemo)(()=>pr(f),[f]),y=to(n,o),d=C(x,ic,"lg"),u=C(m,Po,"md"),g=e?e.getHours():0,b=g%12===0?12:g%12,S=e?e.getMinutes():0,R=e?e.getSeconds():0,D=g>=12?"PM":"AM",P=(0,xi.useMemo)(()=>{let $=[];if(n)for(let F=1;F<=12;F+=i){let G=D==="PM"?F===12?12:F+12:F===12?0:F,A=Io("hour",G,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:A})}else for(let F=0;F<24;F+=i){let G=Io("hour",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[n,i,D,g,S,k,T,c,w,p]),I=(0,xi.useMemo)(()=>{let $=[];for(let F=0;F<60;F+=a){let G=Io("minute",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[a,g,S,k,T,c,w,p]),E=(0,xi.useMemo)(()=>{if(!o)return[];let $=[];for(let F=0;F<60;F+=s){let G=Io("second",F,g,S,k,T,c,w,p);$.push({value:F,label:Ur(F),disabled:G})}return $},[o,s,g,S,k,T,c,w,p]),N=(0,xi.useMemo)(()=>[{value:"AM",label:"AM"},{value:"PM",label:"PM"}],[]),M=$=>{let F=Number($);n&&(D==="PM"&&F<12&&(F+=12),D==="AM"&&F===12&&(F=0));let G=zo(F,S,R);t?.(G)},z=$=>{let F=Number($),G=zo(g,F,R);t?.(G)},H=$=>{let F=Number($),G=zo(g,S,F);t?.(G)},V=$=>{let F=$,G=g;F==="AM"&&G>=12?G-=12:F==="PM"&&G<12&&(G+=12);let A=zo(G,S,R);t?.(A)},Y=o?"--:--:--":"--:--";return(0,kn.jsxs)("div",{"aria-label":r,className:`inline-flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${d} ${h}`,children:[(0,kn.jsx)("div",{className:"flex items-center justify-center px-4 py-2 border-b border-neutral-200 bg-neutral-50/50",children:(0,kn.jsx)("span",{className:`text-neutral-700 tracking-wider font-mono ${u.headerText}`,children:e?Qt(e,y):Y})}),(0,kn.jsxs)("div",{className:`flex divide-x divide-neutral-200 ${u.panelPadding}`,children:[(0,kn.jsx)(ro,{ariaLabel:"Gi\u1EDD",items:P,selectedValue:n?b:e?g:null,onSelect:M,size:m,color:v,radius:x}),(0,kn.jsx)(ro,{ariaLabel:"Ph\xFAt",items:I,selectedValue:e?S:null,onSelect:z,size:m,color:v,radius:x}),o&&(0,kn.jsx)(ro,{ariaLabel:"Gi\xE2y",items:E,selectedValue:e?R:null,onSelect:H,size:m,color:v,radius:x}),n&&(0,kn.jsx)(ro,{ariaLabel:"Bu\u1ED5i",items:N,selectedValue:e?D:null,onSelect:V,size:m,color:v,radius:x})]})]})}var zt=require("react/jsx-runtime");function sc({ref:e,value:t,defaultValue:r,onChange:n,format:o="HH:mm:ss",displayFormat:i,use12Hours:a=!1,showSeconds:s=!0,hourStep:l=1,minuteStep:f=1,secondStep:c=1,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:v,disabledSeconds:x,size:h="md",variant:k="outline",color:T="primary",radius:y,label:d,labelPlacement:u="top",placeholder:g,helperText:b,errorMessage:S,name:R,id:D,autoComplete:P,onClear:I,placement:E="bottom-start",disabled:N=!1,readOnly:M=!1,config:z,className:H="",wrapperClassName:V="",inputWrapperClassName:Y="",labelClassName:$="",helperClassName:F="",popoverClassName:G=""}){let{isRequired:A=!1,isInvalid:j=!1,isLoading:B=!1,showSpinner:X=!1,isClearable:le=!0,isFullWidth:ne=!1,closeOnSelect:ue=!1}=z??{},ie=(0,ws.useId)(),Q=D||ie,q=`${Q}-error-helper`,ge=`${Q}-popover`,ke=to(a,s),L=o||ke,te=i||L,Z=t!==void 0,[he,ae]=(0,ws.useState)(()=>pr(r)),ve=Z?pr(t):he,Se=ve?Qt(ve,te):"",[ye,J]=(0,ws.useState)(!1),{refs:{setReference:O,setFloating:W},floatingStyles:we,context:fe}=(0,It.useFloating)({placement:E,open:ye&&!N&&!M&&!B,onOpenChange:J,whileElementsMounted:It.autoUpdate,transform:!1,middleware:[(0,It.offset)(6),(0,It.flip)(),(0,It.shift)({padding:8})]}),se=(0,It.useDismiss)(fe,{escapeKey:!0,outsidePress:!0}),me=(0,It.useRole)(fe,{role:"dialog"}),{getReferenceProps:Re,getFloatingProps:xe}=(0,It.useInteractions)([se,me]),{isMounted:re,styles:de}=rt(fe),ce=!!(j||S),ee=ce?"error":T,U=C(h,Po,"md"),Ce=C(y,oc,"lg"),$e=k==="other"?"":C(ee,C(k,ac,"outline"),"primary"),Ee=!!ve,oe=pe=>{Z||ae(pe);let Fe=pe?Qt(pe,L):"";n?.(Fe),ue&&J(!1)},Te=pe=>{N||M||B||(pe.key==="ArrowDown"||pe.key==="Enter"||pe.key===" "?(pe.preventDefault(),ye||J(!0)):pe.key==="Escape"&&ye&&(pe.preventDefault(),J(!1)))},Pe=pe=>{pe.stopPropagation(),Z||ae(null),n?.(null),I?.()},Qe=g||te,We=u==="floating",Be=u==="left",Oe=()=>(0,zt.jsx)(vt,{htmlFor:Q,label:d,isRequired:A,isFloating:We,size:h,color:ee,hasError:ce,cursor:"pointer",className:$}),Ze=pe=>(0,zt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${U.icon}`,"aria-hidden":"true",children:pe}),K=["group/field group/timepicker relative flex",Be?"flex-row items-center gap-3":"flex-col",We?"pt-2":"",ne?"w-full":"inline-flex",V].filter(Boolean).join(" "),_=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",U.inputHeight,Ce,$e,N?"opacity-50":"",ne?"w-full":"w-auto",Y].filter(Boolean).join(" "),ze=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",U.inputText,U.inputPadding,H].filter(Boolean).join(" ");return(0,zt.jsxs)("div",{className:K,children:[!We&&Oe(),(0,zt.jsxs)("div",{className:`flex flex-col ${ne?"w-full":""}`,children:[(0,zt.jsxs)("div",{ref:O,...Re(),className:_,children:[We&&Oe(),(0,zt.jsx)("input",{ref:e,id:Q,name:R,type:"text",value:Se,onClick:()=>!N&&!M&&!B&&J(pe=>!pe),onKeyDown:Te,readOnly:!0,autoComplete:P,placeholder:Qe,disabled:N||B,role:"combobox","aria-expanded":ye&&!B,"aria-haspopup":"dialog","aria-controls":ge,"aria-required":A,"aria-invalid":ce,"aria-busy":B,"aria-disabled":N||B,"aria-describedby":b||S?q:void 0,"aria-errormessage":S?q:void 0,className:ze}),(0,zt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[B&&X&&(0,zt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Ze((0,zt.jsx)(De,{}))}),!B&&le&&!N&&!M&&(0,zt.jsx)("button",{type:"button",onClick:Pe,"aria-label":"X\xF3a th\u1EDDi gian",tabIndex:Ee?0:-1,"aria-hidden":!Ee,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 ${U.icon} ${Ee?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,zt.jsx)(Ve,{className:"size-full"})}),(0,zt.jsx)("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:Ze((0,zt.jsx)(yt,{className:"size-full"}))})]})]}),re&&(0,zt.jsx)(It.FloatingPortal,{children:(0,zt.jsx)(It.FloatingFocusManager,{context:fe,modal:!1,returnFocus:!0,children:(0,zt.jsx)("div",{ref:W,id:ge,style:{...we,...de,zIndex:lt.PICKER},...xe(),className:G,children:(0,zt.jsx)(Pr,{value:ve,onChange:oe,ariaLabel:typeof d=="string"?`${d} selector`:"Time selector",use12Hours:a,showSeconds:s,hourStep:l,minuteStep:f,secondStep:c,minTime:w,maxTime:p,disabledHours:m,disabledMinutes:v,disabledSeconds:x,size:h,color:T,radius:y})})})}),(0,zt.jsx)(Le,{id:q,helperText:b,errorMessage:S,sizeClassName:U.helper,className:F})]})]})}var vi=require("react"),Mt=require("@floating-ui/react");var nf=Po,of=oc,af=ic,sf=ac;var mt=require("react/jsx-runtime");function lc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",use12Hours:f=!1,showSeconds:c=!0,hourStep:w=1,minuteStep:p=1,secondStep:m=1,minTime:v,maxTime:x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y="md",variant:d="outline",color:u="primary",radius:g,label:b,labelPlacement:S="top",placeholder:R,placeholders:D,helperText:P,errorMessage:I,name:E,id:N,autoComplete:M,disabled:z=!1,readOnly:H=!1,config:V,onClear:Y,placement:$="bottom-start",className:F="",wrapperClassName:G="",inputWrapperClassName:A="",labelClassName:j="",helperClassName:B="",popoverClassName:X=""}){let{isRequired:le=!1,isInvalid:ne=!1,isLoading:ue=!1,showSpinner:ie=!1,isClearable:Q=!0,isFullWidth:q=!1,closeOnSelect:ge=!1}=V??{},ke=(0,vi.useId)(),L=N||ke,te=`${L}-error-helper`,Z=`${L}-popover`,he=to(f,c),ae=o||he,ve=i||ae,Se=t!==void 0,[ye,J]=(0,vi.useState)(()=>{let be=r;return be&&Array.isArray(be)?[pr(be[0]),pr(be[1])]:[null,null]}),O=Se&&t&&Array.isArray(t)?[pr(t[0]),pr(t[1])]:ye,W=O[0]?Qt(O[0],ve):"",we=O[1]?Qt(O[1],ve):"",fe=(0,vi.useMemo)(()=>W&&we?`${W}${a}${we}`:W?`${W}${a}`:"",[W,we,a]),[se,me]=(0,vi.useState)(!1),{refs:{setReference:Re,setFloating:xe},floatingStyles:re,context:de}=(0,Mt.useFloating)({placement:$,open:se&&!z&&!H&&!ue,onOpenChange:me,whileElementsMounted:Mt.autoUpdate,transform:!1,middleware:[(0,Mt.offset)(6),(0,Mt.flip)(),(0,Mt.shift)({padding:8})]}),ce=(0,Mt.useDismiss)(de,{escapeKey:!0,outsidePress:!0}),ee=(0,Mt.useRole)(de,{role:"dialog"}),{getReferenceProps:U,getFloatingProps:Ce}=(0,Mt.useInteractions)([ce,ee]),{isMounted:$e,styles:Ee}=rt(de),oe=!!(ne||I),Te=oe?"error":u,Pe=C(y,nf,"md"),Qe=C(g,of,"lg"),We=C(g,af,"lg"),Be=d==="other"?"":C(Te,C(d,sf,"outline"),"primary"),Oe=!!(O[0]||O[1]),Ze=be=>{let je=[be,O[1]];Se||J(je);let pt=Qt(be,ae),st=O[1]?Qt(O[1],ae):"";n?.([pt,st])},K=be=>{let je=[O[0],be];Se||J(je);let pt=O[0]?Qt(O[0],ae):"",st=Qt(be,ae);n?.([pt,st]),ge&&me(!1)},_=be=>{z||H||ue||(be.key==="ArrowDown"||be.key==="Enter"||be.key===" "?(be.preventDefault(),se||me(!0)):be.key==="Escape"&&se&&(be.preventDefault(),me(!1)))},ze=be=>{be.stopPropagation(),Se||J([null,null]),n?.(null),Y?.()},pe=R||(D?`${D[0]}${a}${D[1]}`:`${ve}${a}${ve}`),Fe=S==="floating",et=S==="left",Ge=()=>(0,mt.jsx)(vt,{htmlFor:L,label:b,isRequired:le,isFloating:Fe,size:y,color:Te,hasError:oe,cursor:"pointer",className:j}),at=be=>(0,mt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${Pe.icon}`,"aria-hidden":"true",children:be}),tt=["group/field group/timerangepicker relative flex",et?"flex-row items-center gap-3":"flex-col",Fe?"pt-2":"",q?"w-full":"inline-flex",G].filter(Boolean).join(" "),Ne=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",Pe.inputHeight,Qe,Be,z?"opacity-50":"",q?"w-full":"w-auto",A].filter(Boolean).join(" "),Xe=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",Pe.inputText,Pe.inputPadding,F].filter(Boolean).join(" ");return(0,mt.jsxs)("div",{className:tt,children:[!Fe&&Ge(),(0,mt.jsxs)("div",{className:`flex flex-col ${q?"w-full":""}`,children:[(0,mt.jsxs)("div",{ref:Re,...U(),className:Ne,children:[Fe&&Ge(),(0,mt.jsx)("input",{ref:e,id:L,name:E,type:"text",value:fe,onClick:()=>!z&&!H&&!ue&&me(be=>!be),onKeyDown:_,readOnly:!0,autoComplete:M,placeholder:pe,disabled:z||ue,role:"combobox","aria-expanded":se&&!ue,"aria-haspopup":"dialog","aria-controls":Z,"aria-required":le,"aria-invalid":oe,"aria-busy":ue,"aria-disabled":z||ue,"aria-describedby":P||I?te:void 0,"aria-errormessage":I?te:void 0,className:Xe}),(0,mt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ue&&ie&&(0,mt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:at((0,mt.jsx)(De,{}))}),!ue&&Q&&!z&&!H&&(0,mt.jsx)("button",{type:"button",onClick:ze,"aria-label":"X\xF3a kho\u1EA3ng th\u1EDDi gian",tabIndex:Oe?0:-1,"aria-hidden":!Oe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${Pe.icon} ${Oe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,mt.jsx)(Ve,{className:"size-full"})}),(0,mt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${se?"rotate-180":"rotate-0"}`,children:at((0,mt.jsx)(yt,{className:"size-full"}))})]})]}),$e&&(0,mt.jsx)(Mt.FloatingPortal,{children:(0,mt.jsx)(Mt.FloatingFocusManager,{context:de,modal:!1,returnFocus:!0,children:(0,mt.jsxs)("div",{ref:xe,id:Z,style:{...re,...Ee,zIndex:lt.PICKER},...Ce(),className:`flex flex-row bg-neutral-white border-2 border-neutral-200 shadow-xl divide-x divide-neutral-200 overflow-hidden select-none ${We} ${X}`,children:[(0,mt.jsxs)("div",{className:"flex flex-col",children:[(0,mt.jsx)("div",{className:"px-3 py-1.5 bg-neutral-50 text-xs font-semibold text-neutral-600 border-b border-neutral-200 text-center",children:s}),(0,mt.jsx)(Pr,{value:O[0],onChange:Ze,ariaLabel:s,use12Hours:f,showSeconds:c,hourStep:w,minuteStep:p,secondStep:m,minTime:v,maxTime:O[1]||x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:u,radius:g,className:"border-none shadow-none"})]}),(0,mt.jsxs)("div",{className:"flex flex-col",children:[(0,mt.jsx)("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}),(0,mt.jsx)(Pr,{value:O[1],onChange:K,ariaLabel:l,use12Hours:f,showSeconds:c,hourStep:w,minuteStep:p,secondStep:m,minTime:O[0]||v,maxTime:x,disabledHours:h,disabledMinutes:k,disabledSeconds:T,size:y,color:u,radius:g,className:"border-none shadow-none"})]})]})})}),(0,mt.jsx)(Le,{id:te,helperText:P,errorMessage:I,sizeClassName:Pe.helper,className:B})]})]})}function Qu(e,t,r){if(!e||!t||!r)return!1;let n=e.getHours()*3600+e.getMinutes()*60+e.getSeconds(),o=t.getHours()*3600+t.getMinutes()*60+t.getSeconds(),i=r.getHours()*3600+r.getMinutes()*60+r.getSeconds();return n>=o&&n<=i}var va=require("react"),Ft=require("@floating-ui/react");function no(e=!1,t=!0){return e?t?"DD/MM/YYYY hh:mm:ss A":"DD/MM/YYYY hh:mm A":t?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"}function zr(e,t){if(!e&&!t)return null;let r=e?new Date(e):new Date;return t&&(r.setHours(t.getHours()),r.setMinutes(t.getMinutes()),r.setSeconds(t.getSeconds()),r.setMilliseconds(t.getMilliseconds())),r}function Ir(e,t="DD/MM/YYYY HH:mm:ss"){if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:new Date(e.getTime());if(typeof e=="string"||typeof e=="number"){if(typeof e=="string"){let o=xa(e,t);if(o)return o}let n=new Date(e);return isNaN(n.getTime())?null:n}let r=e;return typeof r.toDate=="function"?r.toDate():typeof r.epochMilliseconds=="number"?new Date(r.epochMilliseconds):null}function gr(e,t="DD/MM/YYYY HH:mm:ss",r){return!e||isNaN(e.getTime())?"":dr(e,t,r)}function xa(e,t="DD/MM/YYYY HH:mm:ss"){if(!e||typeof e!="string")return null;let r=e.trim();if(!r)return null;let n=new Date().getFullYear(),o=1,i=1,a=0,s=0,l=0,f=!1,c=!1,w=t.match(/YYYY|YY|MM|M|DD|D|HH|H|hh|h|mm|m|ss|s|A|a/g);if(!w){let x=new Date(r);return isNaN(x.getTime())?null:x}let p="^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");for(let x of w)x==="YYYY"?p=p.replace("YYYY","(\\d{4})"):x==="YY"?p=p.replace("YY","(\\d{2})"):x==="MM"||x==="M"||x==="DD"||x==="D"||x==="HH"||x==="H"||x==="hh"||x==="h"||x==="mm"||x==="m"||x==="ss"||x==="s"?p=p.replace(x,"(\\d{1,2})"):(x==="A"||x==="a")&&(p=p.replace(x,"(AM|PM|am|pm)"));p+="$";let m=new RegExp(p,"i").exec(r);if(!m){let x=new Date(r);return isNaN(x.getTime())?null:x}w.forEach((x,h)=>{let k=m[h+1];if(!k)return;if(x==="A"||x==="a"){f=!0,k.toUpperCase()==="PM"&&(c=!0);return}let T=parseInt(k,10);isNaN(T)||(x==="YYYY"?n=T:x==="YY"?n=2e3+T:x==="MM"||x==="M"?o=T:x==="DD"||x==="D"?i=T:x==="HH"||x==="H"?a=T:x==="hh"||x==="h"?(f=!0,a=T):x==="mm"||x==="m"?s=T:(x==="ss"||x==="s")&&(l=T))}),f&&(c?a<12&&(a+=12):a===12&&(a=0));let v=new Date(n,o-1,i,a,s,l);return isNaN(v.getTime())?null:v}var lf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},cf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},uf={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 df={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"}};var wt=require("react/jsx-runtime");function cc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,layout:a="side-by-side",locale:s="vi",defaultView:l="days",firstDayOfWeek:f=1,minDate:c,maxDate:w,isDateDisabled:p,viewTabs:m,use12Hours:v=!1,showSeconds:x=!0,hourStep:h=1,minuteStep:k=1,secondStep:T=1,minTime:y,maxTime:d,disabledHours:u,disabledMinutes:g,disabledSeconds:b,size:S="md",variant:R="outline",color:D="primary",radius:P,label:I,labelPlacement:E="top",placeholder:N,helperText:M,errorMessage:z,name:H,id:V,autoComplete:Y,disabled:$=!1,readOnly:F=!1,config:G,onClear:A,placement:j="bottom-start",className:B="",wrapperClassName:X="",inputWrapperClassName:le="",labelClassName:ne="",helperClassName:ue="",popoverClassName:ie=""}){let{isRequired:Q=!1,isInvalid:q=!1,isLoading:ge=!1,showSpinner:ke=!1,isClearable:L=!0,isFullWidth:te=!1,closeOnSelect:Z=!1,showWeekNumbers:he=!1,showViewTabs:ae=!1}=G??{},ve=(0,va.useId)(),Se=V||ve,ye=`${Se}-error-helper`,J=`${Se}-popover`,O=no(v,x),W=o||O,we=i||W,fe=t!==void 0,[se,me]=(0,va.useState)(()=>Ir(r,W)),Re=fe?Ir(t,W):se,xe=Re?gr(Re,we,s):"",[re,de]=(0,va.useState)(l),[ce,ee]=(0,va.useState)(!1),{refs:{setReference:U,setFloating:Ce},floatingStyles:$e,context:Ee}=(0,Ft.useFloating)({placement:j,open:ce&&!$&&!F&&!ge,onOpenChange:ee,whileElementsMounted:Ft.autoUpdate,transform:!1,middleware:[(0,Ft.offset)(6),(0,Ft.flip)(),(0,Ft.shift)({padding:8})]}),oe=(0,Ft.useDismiss)(Ee,{escapeKey:!0,outsidePress:!0}),Te=(0,Ft.useRole)(Ee,{role:"dialog"}),{getReferenceProps:Pe,getFloatingProps:Qe}=(0,Ft.useInteractions)([oe,Te]),{isMounted:We,styles:Be}=rt(Ee),Oe=!!(q||z),Ze=Oe?"error":D,K=C(S,uf,"md"),_=C(P,lf,"lg"),ze=C(P,cf,"lg"),pe=R==="other"?"":C(Ze,C(R,df,"outline"),"primary"),Fe=!!Re,et=ht=>{let nr=zr(ht,Re||new Date);fe||me(nr);let Yo=nr?gr(nr,W,s):"";n?.(Yo),Z&&ee(!1)},Ge=ht=>{if(!ht)return;let nr=zr(Re||new Date,ht);fe||me(nr);let Yo=nr?gr(nr,W,s):"";n?.(Yo),Z&&ee(!1)},at=ht=>{$||F||ge||(ht.key==="ArrowDown"||ht.key==="Enter"||ht.key===" "?(ht.preventDefault(),ce||ee(!0)):ht.key==="Escape"&&ce&&(ht.preventDefault(),ee(!1)))},tt=ht=>{ht.stopPropagation(),fe||me(null),n?.(null),A?.()},Ne=N||we,Xe=E==="floating",be=E==="left",je=()=>(0,wt.jsx)(vt,{htmlFor:Se,label:I,isRequired:Q,isFloating:Xe,size:S,color:Ze,hasError:Oe,cursor:"pointer",className:ne}),pt=ht=>(0,wt.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${K.icon}`,"aria-hidden":"true",children:ht}),st=["group/field group/datetimepicker relative flex",be?"flex-row items-center gap-3":"flex-col",Xe?"pt-2":"",te?"w-full":"inline-flex",X].filter(Boolean).join(" "),rr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",K.inputHeight,_,pe,$?"opacity-50":"",te?"w-full":"w-auto",le].filter(Boolean).join(" "),br=["w-full h-full bg-transparent outline-none border-none text-neutral-800 placeholder-neutral-400 cursor-pointer select-none caret-transparent focus:outline-none",K.inputText,K.inputPadding,B].filter(Boolean).join(" ");return(0,wt.jsxs)("div",{className:st,children:[!Xe&&je(),(0,wt.jsxs)("div",{className:`flex flex-col ${te?"w-full":""}`,children:[(0,wt.jsxs)("div",{ref:U,...Pe(),className:rr,children:[Xe&&je(),(0,wt.jsx)("input",{ref:e,id:Se,name:H,type:"text",value:xe,onClick:()=>!$&&!F&&!ge&&ee(ht=>!ht),onKeyDown:at,readOnly:!0,autoComplete:Y,placeholder:Ne,disabled:$||ge,role:"combobox","aria-expanded":ce&&!ge,"aria-haspopup":"dialog","aria-controls":J,"aria-required":Q,"aria-invalid":Oe,"aria-busy":ge,"aria-disabled":$||ge,"aria-describedby":M||z?ye:void 0,"aria-errormessage":z?ye:void 0,className:br}),(0,wt.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[ge&&ke&&(0,wt.jsx)("div",{className:"flex items-center justify-center shrink-0",children:pt((0,wt.jsx)(De,{}))}),!ge&&L&&!$&&!F&&(0,wt.jsx)("button",{type:"button",onClick:tt,"aria-label":"X\xF3a ng\xE0y gi\u1EDD",tabIndex:Fe?0:-1,"aria-hidden":!Fe,className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-600 active:scale-95 transition-opacity duration-150 cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-current rounded-full ${K.icon} ${Fe?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,wt.jsx)(Ve,{className:"size-full"})}),(0,wt.jsx)("div",{"aria-hidden":"true",className:`inline-flex items-center justify-center text-neutral-400 hover:text-neutral-600 transition-transform duration-200 ease-in-out cursor-pointer ${ce?"rotate-180":"rotate-0"}`,children:pt((0,wt.jsx)(yt,{className:"size-full"}))})]})]}),We&&(0,wt.jsx)(Ft.FloatingPortal,{children:(0,wt.jsx)(Ft.FloatingFocusManager,{context:Ee,modal:!1,returnFocus:!0,children:(0,wt.jsxs)("div",{ref:Ce,id:J,style:{...$e,...Be,zIndex:lt.PICKER},...Qe(),className:`flex bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${ze} ${a==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"} ${ie}`,children:[(0,wt.jsx)("div",{className:"flex flex-col",children:(0,wt.jsx)(on,{value:Re,onChange:et,view:re,onViewChange:de,minDate:c,maxDate:w,isDateDisabled:p,locale:s,firstDayOfWeek:f,showWeekNumbers:he,size:S,color:D,radius:P,showViewTabs:ae,viewTabs:m,className:"border-none shadow-none rounded-none"})}),(0,wt.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,wt.jsx)(Pr,{value:Re,onChange:Ge,ariaLabel:typeof I=="string"?`${I} time`:"Time selector",use12Hours:v,showSeconds:x,hourStep:h,minuteStep:k,secondStep:T,minTime:y,maxTime:d,disabledHours:u,disabledMinutes:g,disabledSeconds:b,size:S,color:D,radius:P,className:"border-none shadow-none bg-transparent"})})]})})}),(0,wt.jsx)(Le,{id:ye,helperText:M,errorMessage:z,sizeClassName:K.helper,className:ue})]})]})}var oo=require("react"),Et=require("@floating-ui/react");var ff={xs:{inputHeight:"h-6",inputText:"text-[11px]",inputPadding:"px-2",minWidth:"min-w-72",icon:"size-3",iconSize:12,calendarPadding:"p-2",cellSize:"w-7 h-7",cellText:"text-[11px]",headerText:"text-xs font-semibold",headerButtonSize:"h-6 w-6",label:"text-[11px] mb-1",floatingLabel:"text-[10px]",helper:"text-[9px] mt-0.5"},sm:{inputHeight:"h-8",inputText:"text-xs",inputPadding:"px-2.5",minWidth:"min-w-80",icon:"size-3.5",iconSize:14,calendarPadding:"p-2.5",cellSize:"w-8 h-8",cellText:"text-xs",headerText:"text-xs font-semibold",headerButtonSize:"h-7 w-7",label:"text-xs mb-1",floatingLabel:"text-[10px]",helper:"text-[10px] mt-0.5"},md:{inputHeight:"h-10",inputText:"text-sm",inputPadding:"px-3",minWidth:"min-w-96",icon:"size-[18px]",iconSize:16,calendarPadding:"p-3",cellSize:"w-9 h-9",cellText:"text-sm",headerText:"text-sm font-semibold",headerButtonSize:"h-8 w-8",label:"text-sm mb-1.5",floatingLabel:"text-[11px]",helper:"text-[11px] mt-1"},lg:{inputHeight:"h-12",inputText:"text-base",inputPadding:"px-3.5",minWidth:"min-w-105",icon:"size-5",iconSize:18,calendarPadding:"p-4",cellSize:"w-10 h-10",cellText:"text-base",headerText:"text-base font-semibold",headerButtonSize:"h-9 w-9",label:"text-base mb-1.5",floatingLabel:"text-xs",helper:"text-xs mt-1"},xl:{inputHeight:"h-14",inputText:"text-lg",inputPadding:"px-4",minWidth:"min-w-120",icon:"size-6",iconSize:20,calendarPadding:"p-4",cellSize:"w-12 h-12",cellText:"text-lg",headerText:"text-lg font-semibold",headerButtonSize:"h-10 w-10",label:"text-lg mb-2",floatingLabel:"text-sm",helper:"text-sm mt-1.5"}};var pf={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"}};var Je=require("react/jsx-runtime");function uc({ref:e,value:t,defaultValue:r,onChange:n,format:o,displayFormat:i,separator:a=" - ",startLabel:s="Th\u1EDDi gian b\u1EAFt \u0111\u1EA7u",endLabel:l="Th\u1EDDi gian k\u1EBFt th\xFAc",layout:f="side-by-side",locale:c="vi",defaultView:w="days",firstDayOfWeek:p=1,minDate:m,maxDate:v,isDateDisabled:x,viewTabs:h,use12Hours:k=!1,showSeconds:T=!0,hourStep:y=1,minuteStep:d=1,secondStep:u=1,minTime:g,maxTime:b,disabledHours:S,disabledMinutes:R,disabledSeconds:D,size:P="md",variant:I="outline",color:E="primary",radius:N,label:M,labelPlacement:z="top",placeholder:H,placeholders:V,helperText:Y,errorMessage:$,name:F,id:G,autoComplete:A,disabled:j=!1,readOnly:B=!1,config:X,onClear:le,placement:ne="bottom-start",className:ue="",wrapperClassName:ie="",inputWrapperClassName:Q="",labelClassName:q="",helperClassName:ge="",popoverClassName:ke=""}){let{isRequired:L=!1,isInvalid:te=!1,isLoading:Z=!1,showSpinner:he=!1,isClearable:ae=!0,isFullWidth:ve=!1,closeOnSelect:Se=!1,showWeekNumbers:ye=!1,showViewTabs:J=!1}=X??{},O=(0,oo.useId)(),W=G||O,we=`${W}-error-helper`,fe=`${W}-popover`,se=no(k,T),me=o||se,Re=i||me,xe=t!==void 0,[re,de]=(0,oo.useState)(()=>{let _e=r;return _e&&Array.isArray(_e)?[Ir(_e[0],me),Ir(_e[1],me)]:[null,null]}),ce=xe?t&&Array.isArray(t)?[Ir(t[0],me),Ir(t[1],me)]:[null,null]:re,[ee,U]=(0,oo.useState)("start"),[Ce,$e]=(0,oo.useState)(w),[Ee,oe]=(0,oo.useState)(!1),Te=ce[0]?gr(ce[0],Re,c):"",Pe=ce[1]?gr(ce[1],Re,c):"",Qe=(0,oo.useMemo)(()=>Te&&Pe?`${Te}${a}${Pe}`:Te?`${Te}${a}`:"",[Te,Pe,a]),{refs:{setReference:We,setFloating:Be},floatingStyles:Oe,context:Ze}=(0,Et.useFloating)({placement:ne,open:Ee&&!j&&!B&&!Z,onOpenChange:oe,whileElementsMounted:Et.autoUpdate,transform:!1,middleware:[(0,Et.offset)(6),(0,Et.flip)(),(0,Et.shift)({padding:8})]}),K=(0,Et.useDismiss)(Ze,{escapeKey:!0,outsidePress:!0}),_=(0,Et.useRole)(Ze,{role:"dialog"}),{getReferenceProps:ze,getFloatingProps:pe}=(0,Et.useInteractions)([K,_]),{isMounted:Fe,styles:et}=rt(Ze),Ge=!!(te||$),at=Ge?"error":E,tt=C(P,ff,"md"),Ne=C(N,Cn,"lg"),Xe=C(N,Ql,"lg"),be=C(at,pf,"primary"),je=I==="other"?"":C(at,C(I,ec,"outline"),"primary"),pt=!!(ce[0]||ce[1]),st=_e=>{xe||de(_e);let or=_e[0]?gr(_e[0],me,c):"",Lr=_e[1]?gr(_e[1],me,c):"";n?.(or||Lr?[or,Lr]:null),Se&&_e[0]&&_e[1]&&oe(!1)},rr=_e=>{if(ee==="start"){let or=zr(_e,ce[0]||new Date),Lr=ce[1];Lr&&or&&or.getTime()>Lr.getTime()&&(Lr=null),st([or,Lr])}else{let or=zr(_e,ce[1]||ce[0]||new Date);st([ce[0],or])}},br=_e=>{if(_e)if(ee==="start"){let or=zr(ce[0]||new Date,_e),Lr=ce[1];Lr&&or&&or.getTime()>Lr.getTime()&&(Lr=null),st([or,Lr])}else{let or=zr(ce[1]||ce[0]||new Date,_e);st([ce[0],or])}},ht=_e=>{j||B||Z||(_e.key==="ArrowDown"||_e.key==="Enter"||_e.key===" "?(_e.preventDefault(),Ee||oe(!0)):_e.key==="Escape"&&Ee&&(_e.preventDefault(),oe(!1)))},nr=_e=>{_e.stopPropagation(),xe||de([null,null]),n?.(null),le?.()},Yo=H||(V?`${V[0]}${a}${V[1]}`:`${Re}${a}${Re}`),Me=z==="floating",Ue=z==="left",Bt=()=>(0,Je.jsx)(vt,{htmlFor:W,label:M,isRequired:L,isFloating:Me,size:P,color:at,hasError:Ge,cursor:"pointer",className:q}),Gt=_e=>(0,Je.jsx)("span",{className:`inline-flex items-center justify-center shrink-0 text-neutral-400 leading-none select-none ${tt.icon}`,"aria-hidden":"true",children:_e}),Bn=["group/field group/datetimerangepicker relative flex",Ue?"flex-row items-center gap-3":"flex-col",Me?"pt-2":"",ve?"w-full":"inline-flex",ie].filter(Boolean).join(" "),hr=["group/input relative flex items-center transition-all duration-150 ease-in-out border-2 select-none cursor-pointer",tt.inputHeight,Ne,je,j?"opacity-50":"",ve?"w-full":tt.minWidth||"min-w-80",Q].filter(Boolean).join(" "),Mi=["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",tt.inputText,tt.inputPadding,ue].filter(Boolean).join(" "),Sd=ee==="start"?ce[0]:ce[1];return(0,Je.jsxs)("div",{className:Bn,children:[!Me&&Bt(),(0,Je.jsxs)("div",{className:`flex flex-col ${ve?"w-full":""}`,children:[(0,Je.jsxs)("div",{ref:We,...ze(),className:hr,children:[Me&&Bt(),(0,Je.jsx)("input",{ref:e,id:W,name:F,type:"text",value:Qe,onClick:()=>!j&&!B&&!Z&&oe(_e=>!_e),onKeyDown:ht,readOnly:!0,autoComplete:A,placeholder:Yo,disabled:j||Z,role:"combobox","aria-expanded":Ee&&!Z,"aria-haspopup":"dialog","aria-controls":fe,"aria-required":L,"aria-invalid":Ge,"aria-busy":Z,"aria-disabled":j||Z,"aria-describedby":Y||$?we:void 0,"aria-errormessage":$?we:void 0,className:Mi}),(0,Je.jsxs)("div",{className:"flex items-center space-x-1.5 pr-2.5 shrink-0",children:[Z&&he&&(0,Je.jsx)("div",{className:"flex items-center justify-center shrink-0",children:Gt((0,Je.jsx)(De,{}))}),!Z&&ae&&!j&&!B&&(0,Je.jsx)("button",{type:"button",onClick:nr,"aria-label":"X\xF3a kho\u1EA3ng ng\xE0y gi\u1EDD",tabIndex:pt?0:-1,"aria-hidden":!pt,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 ${tt.icon} ${pt?"opacity-100 visible":"opacity-0 invisible pointer-events-none"}`,children:(0,Je.jsx)(Ve,{className:"size-full"})}),(0,Je.jsx)("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 ${Ee?"rotate-180":"rotate-0"}`,children:Gt((0,Je.jsx)(yt,{className:"size-full"}))})]})]}),Fe&&(0,Je.jsx)(Et.FloatingPortal,{children:(0,Je.jsx)(Et.FloatingFocusManager,{context:Ze,modal:!1,returnFocus:!0,children:(0,Je.jsxs)("div",{ref:Be,id:fe,style:{...Oe,...et,zIndex:lt.PICKER},...pe(),className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden select-none ${Xe} ${ke}`,children:[(0,Je.jsxs)("div",{className:`flex ${f==="stacked"?"flex-col divide-y-2 divide-neutral-200":"flex-row divide-x-2 divide-neutral-200"}`,children:[(0,Je.jsx)("div",{className:"flex flex-col",children:(0,Je.jsx)(on,{value:Sd,onChange:rr,view:Ce,onViewChange:$e,minDate:ee==="end"&&ce[0]||m,maxDate:ee==="start"&&ce[1]||v,isDateDisabled:x,locale:c,firstDayOfWeek:p,showWeekNumbers:ye,size:P,color:E,radius:N,showViewTabs:J,viewTabs:h,className:"border-none shadow-none rounded-none"},`calendar-step-${ee}`)}),(0,Je.jsx)("div",{className:"flex flex-col justify-center items-center p-1 bg-neutral-50/50",children:(0,Je.jsx)(Pr,{value:Sd||ce[0],onChange:br,ariaLabel:ee==="start"?`${s} time`:`${l} time`,use12Hours:k,showSeconds:T,hourStep:y,minuteStep:d,secondStep:u,minTime:ee==="end"&&ce[0]||g,maxTime:ee==="start"&&ce[1]||b,disabledHours:S,disabledMinutes:R,disabledSeconds:D,size:P,color:E,radius:N,className:"border-none shadow-none bg-transparent"},`timeview-step-${ee}`)})]}),(0,Je.jsxs)("div",{className:"flex items-center justify-between border-t border-neutral-200 bg-neutral-50 px-3 py-2",children:[(0,Je.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Je.jsxs)("button",{type:"button",onClick:()=>U("start"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="start"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:["\u2190 ",s]}),(0,Je.jsxs)("button",{type:"button",onClick:()=>U("end"),className:`px-3 py-1.5 text-xs font-semibold rounded-md border transition-all cursor-pointer ${ee==="end"?be.activeStep:"bg-neutral-white border-neutral-300 hover:bg-neutral-100 text-neutral-700"}`,children:[l," \u2192"]})]}),(0,Je.jsx)("button",{type:"button",onClick:()=>oe(!1),className:`px-3.5 py-1.5 text-xs font-semibold rounded-md transition-colors cursor-pointer ${be.applyButton}`,children:"\xC1p d\u1EE5ng"})]})]})})}),(0,Je.jsx)(Le,{id:we,helperText:Y,errorMessage:$,sizeClassName:tt.helper,className:ge})]})]})}var hf=require("react"),xf=Hn(require("next/image"),1);var gf={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"}},mf={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"}};var ya=require("react/jsx-runtime");function yi({preset:e="default",...t}){switch(e){case"search":return(0,ya.jsx)(hl,{...t});case"error":return(0,ya.jsx)(xl,{...t});case"folder":return(0,ya.jsx)(vl,{...t});case"simple":return(0,ya.jsx)(yl,{...t});default:return(0,ya.jsx)(bl,{...t})}}var bf=["default","search","error","folder","simple"];function ed(e){return typeof e=="string"&&bf.includes(e)}function td(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 rd(e){if(!e)return{};let t=typeof e=="number"?`${e}px`:e;return{width:t,height:t}}var Yr=require("react/jsx-runtime");function Mo({size:e="md",layout:t="vertical",image:r="default",imageSize:n,imageClassName:o="",imageAlt:i="Tr\u1ED1ng",title:a,titleClassName:s="",description:l="Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",descriptionClassName:f="",actions:c,actionsClassName:w="",children:p,className:m="",role:v="status",ref:x,...h}){let k=C(e,gf,"md"),T=C(t,mf,"vertical"),y=rd(n),d=()=>{if(!r)return null;if(ed(r))return(0,Yr.jsx)(yi,{preset:r});if(td(r)){let P=typeof n=="number"?n:k.defaultImageSize;return(0,Yr.jsx)(xf.default,{src:r,alt:i,width:P,height:P,className:"size-full object-contain pointer-events-none select-none",unoptimized:r.startsWith("data:")||r.endsWith(".svg")})}return(0,hf.isValidElement)(r)?r:(0,Yr.jsx)(yi,{preset:"default"})},u=["flex items-center justify-center shrink-0",n?"":k.imageWrapper,o].filter(Boolean).join(" "),g=["w-full transition-all",T.container,k.container,k.gap,m].filter(Boolean).join(" "),b=[T.content,k.contentGap].filter(Boolean).join(" "),S=[k.title,s].filter(Boolean).join(" "),R=[k.description,f].filter(Boolean).join(" "),D=["flex flex-wrap items-center gap-2",k.actionsGap,t==="vertical"?"justify-center":"justify-start",w].filter(Boolean).join(" ");return(0,Yr.jsxs)("div",{ref:x,role:v,"aria-live":"polite",className:g,...h,children:[r&&(0,Yr.jsx)("div",{className:u,style:y,"aria-hidden":"true",children:d()}),(a||l||c||p)&&(0,Yr.jsxs)("div",{className:b,children:[a&&(0,Yr.jsx)("div",{className:S,children:a}),l&&(0,Yr.jsx)("div",{className:R,children:l}),c&&(0,Yr.jsx)("div",{className:D,children:c}),p&&(0,Yr.jsx)("div",{className:"mt-2 w-full",children:p})]})]})}var Wr=require("react");var Cf=require("react");var wa={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"}},Ca={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Cs={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},vf={none:"none",sm:"sm",md:"md",lg:"lg",xl:"xl",full:"full"},ka={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"}},yf={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"},wf={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"};var Sn=require("react/jsx-runtime");function Jp({id:e,isOpen:t,disabled:r=!1,isLoading:n=!1,showClear:o=!1,onClear:i,startContent:a,endContent:s,triggerRef:l,getReferenceProps:f,onClick:c,roundedClass:w,currentSize:p,variantStyle:m,className:v="",children:x}){let h=r?"opacity-60 cursor-not-allowed bg-neutral-100 pointer-events-none":"cursor-pointer";return(0,Sn.jsxs)("div",{ref:l,role:"combobox","aria-expanded":t,"aria-haspopup":"listbox","aria-controls":e?`${e}-listbox`:void 0,tabIndex:r?-1:0,onClick:c,"aria-busy":n,"aria-disabled":r||n,...f({id:e,className:`group relative flex items-center justify-between transition-all duration-150 ease-in-out border-2 select-none ${w} ${p.trigger} ${p.gap} ${m} ${h} ${v}`,"aria-expanded":t,"aria-haspopup":"listbox"}),children:[a&&(0,Sn.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:a}),x,(0,Sn.jsxs)("div",{className:"shrink-0 flex items-center gap-1.5 ml-1 text-neutral-400",children:[n&&(0,Sn.jsx)(De,{className:`${p.icon} animate-spin text-current`}),o&&!n&&(0,Sn.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:k=>{k.stopPropagation(),i?.(k)},className:"hover:text-neutral-600 transition-colors p-0.5 rounded-full hover:bg-neutral-100",children:(0,Sn.jsx)(Ve,{className:"size-3.5"})}),s,(0,Sn.jsx)("span",{className:`transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":"true",children:(0,Sn.jsx)(yt,{className:p.icon})})]})]})}var dc=Jp;var Fo=require("react/jsx-runtime");function Qp({id:e,selectedOption:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:c=!1,searchable:w=!1,searchPlacement:p="trigger",searchValue:m="",onSearchChange:v,onClear:x,clearable:h=!1,isLoading:k=!1,startContent:T,endContent:y,renderValue:d,triggerRef:u,getReferenceProps:g,onKeyDown:b,className:S=""}){let R=(0,Cf.useRef)(null),D=C(n,wa,"md"),P=C(a,Ca,"md"),E=!!c?"error":i,N=o==="other"?"":ka[o]?.[E]||ka.outline.primary,M=w&&(p==="trigger"||p==="both"),z=t!=null,H=h&&(z||m.length>0)&&!l&&!f;return(0,Fo.jsx)(dc,{id:e,isOpen:r,disabled:l,isLoading:k,showClear:H,onClear:x,startContent:T,endContent:y,triggerRef:u,getReferenceProps:g,onClick:()=>{!l&&!f&&!k&&M&&R.current?.focus()},roundedClass:P,currentSize:D,variantStyle:N,className:S,children:d&&z&&t?(0,Fo.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:d(t)}):M&&!l&&!f&&!k?(0,Fo.jsx)("div",{className:"relative flex-1 min-w-0 flex items-center",children:(0,Fo.jsx)("input",{ref:R,type:"text","aria-label":"Search",value:m,placeholder:t?t.label:s,onChange:$=>v?.($.target.value),onKeyDown:b,className:`w-full bg-transparent outline-none border-none p-0 text-neutral-900 ${!m&&t?"placeholder:text-neutral-900 placeholder:font-normal":"placeholder:text-neutral-400"} ${D.input}`})}):(0,Fo.jsx)("div",{className:"flex-1 min-w-0 truncate",children:t?(0,Fo.jsx)("span",{className:"text-neutral-900",children:t.label}):(0,Fo.jsx)("span",{className:"text-neutral-400",children:s})})})}var wi=Qp;var kf=require("@floating-ui/react");var ln=require("react/jsx-runtime");function eg({option:e,isSelected:t,isActive:r,size:n="md",color:o="primary",radius:i="md",disabled:a=!1,renderOption:s,onClick:l,onMouseEnter:f,ref:c}){let w=C(n,wa,"md"),p=C(i,Ca,"md"),m=a||e.disabled;if(s)return(0,ln.jsx)("div",{ref:c,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`cursor-pointer select-none transition-colors duration-100 ${m?"opacity-50 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:s(e,{selected:t,active:r})});let v=t?C(o,yf,"primary"):"text-neutral-800 hover:bg-neutral-100",x=r&&!t?C(o,wf,"primary"):"";return(0,ln.jsxs)("div",{ref:c,role:"option",tabIndex:-1,"aria-selected":t,"aria-disabled":m,"data-active":r,"data-selected":t,"data-value":e.value,className:`group flex items-center justify-between gap-2 select-none cursor-pointer transition-colors duration-100 ${p} ${w.option} ${v} ${x} ${m?"opacity-40 cursor-not-allowed pointer-events-none":""}`,onClick:m?void 0:l,onMouseEnter:m?void 0:f,children:[(0,ln.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.icon&&(0,ln.jsx)("span",{className:"shrink-0 inline-flex items-center text-neutral-400",children:e.icon}),(0,ln.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,ln.jsx)("span",{className:"truncate leading-normal font-normal",children:e.label}),e.description&&(0,ln.jsx)("span",{className:"text-[11px] text-neutral-500 truncate font-normal",children:e.description})]})]}),t&&(0,ln.jsx)("span",{className:"shrink-0 flex items-center justify-center text-current","aria-hidden":"true",children:(0,ln.jsx)(Gn,{className:"size-3.5"})})]})}var ks=eg;var Tn=require("react"),ct=require("@floating-ui/react");function Ss(e){let t=new Map;return e.forEach(r=>{t.set(r.value,r)}),t}function nd(e,t,r){return e==null?null:t.find(n=>n.value===e)||r?.get(e)||{value:e,label:String(e)}}function fc(e,t,r){return e.map(n=>t.find(o=>o.value===n)||r?.get(n)||{value:n,label:String(n)})}function od(e,t){let r=t&&t>0?e.slice(0,t):e,n=t&&t>0?Math.max(0,e.length-t):0;return{visibleTags:r,hiddenTagCount:n}}function id(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>s?s instanceof Date?s.toLocaleDateString("vi-VN"):String(s):"",i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}return String(t)}var He=require("react/jsx-runtime");function tg({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i,color:a,radius:s}){let{refs:{setFloating:l,setReference:f},floatingStyles:c,context:w}=(0,ct.useFloating)({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[(0,ct.offset)(6),(0,ct.flip)(),(0,ct.shift)({padding:8})],whileElementsMounted:ct.autoUpdate}),{isMounted:p,styles:m}=rt(w),v=C(s,Cs,"md"),x=(0,ct.useClick)(w),h=(0,ct.useDismiss)(w,{outsidePress:b=>!b.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:k,getFloatingProps:T}=(0,ct.useInteractions)([x,h]),y=(0,Tn.useRef)(null);(0,Tn.useEffect)(()=>{r&&y.current?.focus({preventScroll:!0})},[r]);let d=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0),u=id(e,t),g=()=>{if(e.type==="custom")return e.render?.({value:t,onChange:b=>i(e.name,b)})??null;switch(e.type){case"string":case"text":return(0,He.jsx)(Yt,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:b=>i(e.name,b.target.value),...e.props||{}});case"number":return(0,He.jsx)(fo,{ref:y,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:b=>{let S=b.target.value;if(S==="")i(e.name,"");else{let R=On(S);i(e.name,R!==void 0?R:S)}},onClear:()=>i(e.name,""),...e.props||{}});case"date":return(0,He.jsx)(To,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:b=>i(e.name,b),...e.props||{}});case"date-range":return(0,He.jsx)(No,{portal:!1,size:"sm",color:a,radius:s,placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:b=>i(e.name,b),...e.props||{}});case"checkbox-group":return(0,He.jsx)(bo,{size:"sm",color:a,value:t||[],onChange:b=>i(e.name,b),options:(e.options||[]).map(b=>({value:String(b.value),label:b.label,disabled:b.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}});default:return null}};return(0,He.jsxs)(He.Fragment,{children:[(0,He.jsx)("div",{ref:f,...k({className:"inline-flex items-center"}),children:(0,He.jsxs)(ir,{size:"sm",variant:"soft",color:d||r?a:"neutral",radius:"full",className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,He.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,He.jsx)("span",{className:d?"font-medium":"opacity-70 italic",children:u})]})}),p&&(0,He.jsx)(ct.FloatingPortal,{children:(0,He.jsxs)("div",{ref:l,"data-select-filter-popover":"true",style:{...c,...m,zIndex:lt.SELECT_FILTER},...T({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${v} p-3 shadow-2xl ${e.type==="date"||e.type==="date-range"?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,He.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[(0,He.jsx)("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),(0,He.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors",title:"\u0110\xF3ng",children:(0,He.jsx)(Ve,{className:"size-3.5"})})]}),(0,He.jsx)("div",{className:"mt-1",children:g()}),(0,He.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[(0,He.jsx)("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,He.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-3 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function rg({filters:e,values:t,onChange:r,onReset:n,showReset:o=!0,resetText:i="\u0110\u1EB7t l\u1EA1i b\u1ED9 l\u1ECDc",color:a="primary",radius:s="full"}){let[l,f]=(0,Tn.useState)(()=>{let N=[];return e?.forEach(M=>{let z=t?.[M.name]??M.defaultValue;z!=null&&z!==""&&(!Array.isArray(z)||z.length>0)&&N.push(M.name)}),N}),[c,w]=(0,Tn.useState)(null),[p,m]=(0,Tn.useState)(!1),{refs:{setFloating:v,setReference:x},floatingStyles:h,context:k}=(0,ct.useFloating)({open:p,onOpenChange:m,placement:"bottom-start",transform:!1,middleware:[(0,ct.offset)(6),(0,ct.flip)(),(0,ct.shift)({padding:8})],whileElementsMounted:ct.autoUpdate}),{isMounted:T,styles:y}=rt(k,{duration:120}),d=(0,ct.useClick)(k),u=(0,ct.useDismiss)(k,{outsidePress:N=>!N.target?.closest?.("[data-select-filter-popover]")}),{getReferenceProps:g,getFloatingProps:b}=(0,ct.useInteractions)([d,u]),S=N=>{l.includes(N.name)||f(M=>[...M,N.name]),m(!1),w(N.name)},R=N=>{f(M=>M.filter(z=>z!==N)),c===N&&w(null),r(N,void 0)},D=N=>{N.stopPropagation(),f([]),w(null),n?.()},P=(0,Tn.useMemo)(()=>new Set(l),[l]),I=l.length>0,E=C(s,Cs,"md");return!e||e.length===0?null:(0,He.jsx)("div",{onClick:N=>N.stopPropagation(),onMouseDown:N=>N.stopPropagation(),className:"p-2.5 border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50/90 dark:bg-neutral-900/80 rounded-t-lg select-text",children:(0,He.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 min-h-7",children:[(0,He.jsxs)("div",{className:"inline-flex",children:[(0,He.jsxs)("button",{ref:x,type:"button",...g({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,He.jsx)(Zr,{className:"size-3.5 text-neutral-500"}),(0,He.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,He.jsx)(yt,{className:`size-3 text-neutral-400 transition-transform ${p?"rotate-180":""}`})]}),T&&(0,He.jsx)(ct.FloatingPortal,{children:(0,He.jsxs)("div",{ref:v,"data-select-filter-popover":"true",style:{...h,...y,zIndex:lt.SELECT_FILTER},...b({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 ${E} p-1 shadow-2xl min-w-44`}),children:[(0,He.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,He.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(N=>{let M=P.has(N.name);return(0,He.jsxs)("button",{type:"button",onMouseDown:z=>z.preventDefault(),onClick:z=>{z.preventDefault(),z.stopPropagation(),S(N)},className:`w-full flex items-center justify-between px-2 py-1.5 text-xs rounded text-left transition-colors ${M?"text-primary font-medium bg-primary/5 hover:bg-primary/10":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[(0,He.jsx)("span",{children:N.label}),M&&(0,He.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},N.name)})})]})})]}),l.map(N=>{let M=e.find(H=>H.name===N);if(!M)return null;let z=t[N]??M.defaultValue;return(0,He.jsx)(tg,{field:M,currentValue:z,isOpen:c===N,onOpenChange:H=>w(H?N:null),onRemove:()=>R(N),onChange:r,color:a,radius:s},N)}),o&&n&&I&&(0,He.jsxs)("button",{type:"button",onClick:D,className:"inline-flex items-center gap-1 text-[11px] text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200 px-2.5 py-1 rounded-full border border-neutral-200 dark:border-neutral-700 hover:bg-neutral-100 dark:hover:bg-neutral-800 transition-colors ml-auto cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,He.jsx)(cr,{className:"size-3"}),(0,He.jsx)("span",{children:i})]})]})})}var Ts=rg;var er=require("react/jsx-runtime"),ng={};function og({isOpen:e,isMounted:t,animated:r=!0,transitionStyles:n,options:o,selectedValues:i,activeIndex:a,size:s="md",color:l="primary",radius:f="md",isLoading:c=!1,portal:w=!0,maxMenuHeight:p=280,emptyText:m,emptyProps:v,menuHeader:x,menuFooter:h,listFooter:k,menuFilters:T,menuFilterValues:y=ng,menuFilterLayout:d="vertical",menuFilterGridCols:u=2,showResetFilters:g=!0,resetFiltersText:b,onMenuFilterChange:S,onResetFilters:R,renderOption:D,onSelectOption:P,onOptionMouseEnter:I,floatingStyles:E,floatingRef:N,getFloatingProps:M,listElementsRef:z,className:H=""}){if(!(t!==void 0?t:e))return null;let Y=C(f,Cs,"md"),$=(0,er.jsxs)("div",{ref:N,"data-state":e?"open":"closed",style:{...E,...r?n:{},zIndex:lt.SELECT},...M({className:`flex flex-col bg-neutral-white border-2 border-neutral-200 shadow-xl overflow-hidden focus:outline-none min-w-[200px] ${Y} ${H}`}),children:[x,T&&T.length>0&&S&&(0,er.jsx)(Ts,{filters:T,values:y,onChange:S,onReset:R,layout:d,gridCols:u,showReset:g,resetText:b,color:l,radius:f}),(0,er.jsx)("div",{role:"listbox",tabIndex:-1,style:{maxHeight:typeof p=="number"?`${p}px`:p},className:`p-1 overflow-y-auto overflow-x-hidden space-y-0.5 transition-opacity duration-150 ui-scrollbar ${c?"opacity-75":"opacity-100"}`,children:o.length===0?c?(0,er.jsxs)("div",{className:"flex items-center justify-center py-6 gap-2 text-zinc-500 dark:text-zinc-400 text-sm",children:[(0,er.jsx)(De,{className:"size-4 animate-spin text-current"}),(0,er.jsx)("span",{children:"Loading..."})]}):(0,er.jsx)("div",{className:"py-4 px-2",children:(0,er.jsx)(Mo,{size:"sm",image:"search",description:m||"No data found",className:"py-2",...v})}):(0,er.jsxs)(er.Fragment,{children:[(()=>{let F=new Set(i);return o.map((G,A)=>{let j=F.has(G.value);return(0,er.jsx)(ks,{ref:X=>{z.current[A]=X},option:G,isSelected:j,isActive:a===A,size:s,color:l,radius:f,disabled:G.disabled,renderOption:D,onClick:()=>P(G),onMouseEnter:()=>I(A)},String(G.value))})})(),k]})}),h]});return w?(0,er.jsx)(kf.FloatingPortal,{children:$}):$}var Ci=og;var Sf=require("react"),$t=require("@floating-ui/react");function Rs({placement:e="bottom-start",isOpen:t,onOpenChange:r,disabled:n=!1,readOnly:o=!1,isLoading:i=!1,animated:a=!0,animationDuration:s=150,activeIndex:l,onNavigate:f}){let c=(0,Sf.useRef)([]),w=!n&&!o,{refs:p,floatingStyles:m,context:v}=(0,$t.useFloating)({placement:e,open:t&&w,onOpenChange:b=>{w&&(!i||t||!b)&&r(b)},whileElementsMounted:$t.autoUpdate,transform:!1,middleware:[(0,$t.offset)(4),(0,$t.flip)(),(0,$t.shift)({padding:8})]}),x=(0,$t.useClick)(v,{enabled:w&&(!i||t)}),h=(0,$t.useDismiss)(v,{outsidePress:b=>!b.target?.closest?.("[data-select-filter-popover]")}),k=(0,$t.useRole)(v,{role:"listbox"}),T=(0,$t.useListNavigation)(v,{listRef:c,activeIndex:l,onNavigate:f,loop:!0}),{getReferenceProps:y,getFloatingProps:d}=(0,$t.useInteractions)([x,h,k,T]),{isMounted:u,styles:g}=rt(v,{duration:s,animated:a});return{refs:p,floatingStyles:m,transitionStyles:g,isMounted:u,context:v,getReferenceProps:y,getFloatingProps:d,elementsRef:c}}var Ds=require("react");var ig=[];function Ns({options:e,searchMode:t="client",controlledSearchValue:r,onSearchChange:n,searchField:o=["label","value"],menuFilters:i,controlledFilterValues:a,onMenuFilterChange:s,onSearch:l,debounceMs:f=300,filterFn:c,isOpen:w,setIsOpen:p,preserveSelected:m=!1,selectedValues:v=ig,historicalOptions:x}){let[h,k]=(0,Ds.useState)(""),T=r!==void 0,y=T?r:h,[d,u]=(0,Ds.useState)(()=>{let N={};return i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),N}),g=a??d,{debounced:b,cancel:S}=go((N,M)=>{t==="server"&&l?.(N,M)},f),R=N=>{T||k(N),n?.(N),w||p(!0),b(N,g)},D=()=>{S(),T||k(""),n?.(""),t==="server"&&l?.("",g)},P=(N,M)=>{let z={...g,[N]:M};a||u(z),s?.(z),b(y,z)},I=()=>{let N={};i?.forEach(M=>{M.defaultValue!==void 0&&(N[M.name]=M.defaultValue)}),a||u(N),s?.(N),b(y,N)},E=(0,Ds.useMemo)(()=>{if(t==="server")return e;let N=e,M=y.trim();if(M?c?N=N.filter(z=>c(z,y,g)):N=co(N,M,o):c&&(N=N.filter(z=>c(z,y,g))),m&&M&&v.length>0&&x){let z=new Set(N.map(V=>V.value)),H=[];for(let V of v)if(!z.has(V)){let Y=x.get(V);Y&&H.push(Y)}H.length>0&&(N=[...H,...N])}return N},[e,t,y,c,g,o,m,v,x]);return{searchInput:y,handleSearchChange:R,resetSearch:D,currentFilters:g,handleFilterChange:P,handleResetFilters:I,filteredOptions:E}}var io=require("react/jsx-runtime"),ag=[];function Sa({ref:e,options:t=ag,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:c,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:v,isInvalid:x,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,searchable:d=!1,searchMode:u="client",searchPlacement:g="trigger",searchPlaceholder:b,searchField:S=["label","value"],searchValue:R,onSearchChange:D,menuFilters:P,menuFilterValues:I,menuFilterLayout:E="vertical",menuFilterGridCols:N=2,showResetFilters:M=!0,resetFiltersText:z,onMenuFilterChange:H,menuHeader:V,menuFooter:Y,listFooter:$,onSearch:F,debounceMs:G=300,filterFn:A,isLoading:j=!1,emptyText:B,emptyProps:X,clearable:le=!1,portal:ne=!0,placement:ue="bottom-start",maxMenuHeight:ie=280,animated:Q=!0,animationDuration:q=150,startContent:ge,endContent:ke,renderValue:L,renderOption:te,className:Z="",triggerClassName:he="",menuClassName:ae="",labelClassName:ve="",...Se}){let ye=!!(x??!!v),J=r!==void 0,[O,W]=(0,Wr.useState)(n??null),we=J?r??null:O,[fe,se]=(0,Wr.useState)(()=>Ss(t)),me=(0,Wr.useMemo)(()=>nd(we,t,fe),[we,t,fe]),[Re,xe]=(0,Wr.useState)(!1),[re,de]=(0,Wr.useState)(null),{searchInput:ce,handleSearchChange:ee,resetSearch:U,currentFilters:Ce,handleFilterChange:$e,handleResetFilters:Ee,filteredOptions:oe}=Ns({options:t,searchMode:u,controlledSearchValue:R,onSearchChange:D,searchField:S,menuFilters:P,controlledFilterValues:I,onMenuFilterChange:H,onSearch:F,debounceMs:G,filterFn:A,isOpen:Re,setIsOpen:xe}),{refs:Te,floatingStyles:Pe,transitionStyles:Qe,isMounted:We,getReferenceProps:Be,getFloatingProps:Oe,elementsRef:Ze}=Rs({placement:ue,isOpen:Re,onOpenChange:Ne=>{xe(Ne),Ne||(de(null),U())},disabled:h,readOnly:k,isLoading:j,animated:Q,animationDuration:q,activeIndex:re,onNavigate:de}),K=(0,Wr.useCallback)(Ne=>{Ne.disabled||h||k||(se(Xe=>{if(Xe.has(Ne.value))return Xe;let be=new Map(Xe);return be.set(Ne.value,Ne),be}),J||W(Ne.value),o?.(Ne.value,Ne),xe(!1),U())},[h,k,J,o,U]),_=(0,Wr.useCallback)(Ne=>{Ne.stopPropagation(),!(h||k)&&(J||W(null),o?.(null,null),U())},[h,k,J,o,U]),ze=Ne=>{if(Ne.key==="Enter"&&Re&&re!==null){Ne.preventDefault();let Xe=oe[re];Xe&&K(Xe)}else Ne.key==="ArrowDown"&&!Re&&xe(!0)},pe=w==="floating",Fe=w==="left",et=(0,Wr.useId)(),Ge=f||et,at=`${Ge}-trigger`,tt=()=>(0,io.jsx)(vt,{htmlFor:at,label:c,isRequired:T,isFloating:pe,size:i,color:s,hasError:ye,cursor:"pointer",className:ve});return(0,io.jsxs)("div",{ref:e,id:f,className:`group/field flex ${Fe?"flex-row items-center gap-3":"flex-col"} ${pe?"pt-2":""} ${Z}`,"data-disabled":h,"data-invalid":ye,...Se,children:[!pe&&tt(),(0,io.jsxs)("div",{className:"relative flex-1 min-w-0",children:[pe&&tt(),(0,io.jsx)(wi,{id:at,triggerRef:Te.setReference,getReferenceProps:Be,selectedOption:me,isOpen:Re,size:i,variant:a,color:s,radius:l,placeholder:b||p,disabled:h,readOnly:k,isInvalid:ye,searchable:d,searchPlacement:g,searchValue:ce,onSearchChange:ee,onClear:_,clearable:le,isLoading:j,startContent:ge,endContent:ke,renderValue:L,onKeyDown:ze,className:he}),(0,io.jsx)(Ci,{isOpen:Re,isMounted:We,animated:Q,transitionStyles:Qe,options:oe,selectedValues:we!=null?[we]:[],activeIndex:re,size:i,color:s,radius:l,isLoading:j,portal:ne,maxMenuHeight:ie,emptyText:B,emptyProps:X,menuHeader:V,menuFooter:Y,listFooter:$,menuFilters:P,menuFilterValues:Ce,menuFilterLayout:E,menuFilterGridCols:N,showResetFilters:M,resetFiltersText:z,onMenuFilterChange:$e,onResetFilters:Ee,renderOption:te,onSelectOption:K,onOptionMouseEnter:de,floatingRef:Te.setFloating,floatingStyles:Pe,getFloatingProps:Oe,listElementsRef:Ze,className:ae})]}),y&&we!==null&&we!==void 0&&(0,io.jsx)("input",{type:"hidden",name:y,value:String(we)}),(0,io.jsx)(Le,{id:`${Ge}-helper`,errorMessage:v,helperText:m})]})}var ad=Sa;var Mr=require("react");var Tf=require("react");var Rn=require("react/jsx-runtime");function sg({id:e,selectedOptions:t,isOpen:r,size:n="md",variant:o="outline",color:i="primary",radius:a="md",placeholder:s="Ch\u1ECDn...",disabled:l=!1,readOnly:f=!1,isInvalid:c=!1,maxTagCount:w,searchable:p=!1,searchPlacement:m="trigger",searchValue:v="",onSearchChange:x,onRemoveTag:h,onClear:k,clearable:T=!1,isLoading:y=!1,startContent:d,endContent:u,renderValue:g,triggerRef:b,getReferenceProps:S,onKeyDown:R,className:D=""}){let P=(0,Tf.useRef)(null),I=C(n,wa,"md"),E=C(a,Ca,"md"),N=C(a,vf,"md"),z=!!c?"error":i,H=o==="other"?"":ka[o]?.[z]||ka.outline.primary,V=p&&(m==="trigger"||m==="both"),Y=t.length>0,$=T&&(Y||v.length>0)&&!l&&!f,{visibleTags:F,hiddenTagCount:G}=od(t,w);return(0,Rn.jsx)(dc,{id:e,isOpen:r,disabled:l,isLoading:y,showClear:$,onClear:k,startContent:d,endContent:u,triggerRef:b,getReferenceProps:S,onClick:()=>{!l&&!f&&!y&&V&&P.current?.focus()},roundedClass:E,currentSize:I,variantStyle:H,className:D,children:g&&Y?(0,Rn.jsx)("div",{className:"flex-1 min-w-0 truncate text-neutral-900",children:g(t)}):(0,Rn.jsxs)("div",{className:"flex flex-wrap items-center gap-1 flex-1 min-w-0",children:[F.map(B=>(0,Rn.jsx)(ir,{size:I.badgeSize,variant:"soft",color:i,radius:N,onDelete:!l&&!f&&!y&&h?()=>h(B):void 0,className:"max-w-full truncate",children:(0,Rn.jsx)("span",{className:"truncate",children:B.label})},String(B.value))),G>0&&(0,Rn.jsxs)(ir,{size:I.badgeSize,variant:"soft",color:"neutral",radius:N,children:["+",G]}),V&&!l&&!f&&!y?(0,Rn.jsx)("input",{ref:P,type:"text","aria-label":"Search",value:v,placeholder:Y?"":s,onChange:B=>x?.(B.target.value),onKeyDown:R,className:`bg-transparent outline-none border-none p-0 flex-1 min-w-15 text-neutral-900 placeholder:text-neutral-400 ${I.input}`}):Y?null:(0,Rn.jsx)("span",{className:"text-neutral-400 truncate",children:s})]})})}var Ps=sg;var ao=require("react/jsx-runtime"),lg=[],Rf=[];function cg({ref:e,options:t=lg,value:r,defaultValue:n,onChange:o,size:i="md",variant:a="outline",color:s="primary",radius:l="md",id:f,label:c,labelPlacement:w="top",placeholder:p="Ch\u1ECDn...",helperText:m,errorMessage:v,isInvalid:x,isDisabled:h=!1,readOnly:k=!1,isRequired:T=!1,name:y,maxTagCount:d,searchable:u=!1,searchMode:g="client",searchPlacement:b="trigger",searchPlaceholder:S,searchField:R=["label","value"],preserveSelected:D=!0,searchValue:P,onSearchChange:I,menuFilters:E,menuFilterValues:N,menuFilterLayout:M="vertical",menuFilterGridCols:z=2,showResetFilters:H=!0,resetFiltersText:V,onMenuFilterChange:Y,menuHeader:$,menuFooter:F,listFooter:G,onSearch:A,debounceMs:j=300,filterFn:B,isLoading:X=!1,emptyText:le,emptyProps:ne,clearable:ue=!1,portal:ie=!0,placement:Q="bottom-start",maxMenuHeight:q=280,animated:ge=!0,animationDuration:ke=150,startContent:L,endContent:te,renderValue:Z,renderOption:he,className:ae="",triggerClassName:ve="",menuClassName:Se="",labelClassName:ye="",...J}){let O=!!(x??!!v),W=r!==void 0,[we,fe]=(0,Mr.useState)(n??Rf),se=W?r??Rf:we,[me,Re]=(0,Mr.useState)(()=>Ss(t)),xe=(0,Mr.useMemo)(()=>fc(se,t,me),[se,t,me]),[re,de]=(0,Mr.useState)(!1),[ce,ee]=(0,Mr.useState)(null),{searchInput:U,handleSearchChange:Ce,resetSearch:$e,currentFilters:Ee,handleFilterChange:oe,handleResetFilters:Te,filteredOptions:Pe}=Ns({options:t,searchMode:g,controlledSearchValue:P,onSearchChange:I,searchField:R,menuFilters:E,controlledFilterValues:N,onMenuFilterChange:Y,onSearch:A,debounceMs:j,filterFn:B,isOpen:re,setIsOpen:de,preserveSelected:D,selectedValues:se,historicalOptions:me}),{refs:Qe,floatingStyles:We,transitionStyles:Be,isMounted:Oe,getReferenceProps:Ze,getFloatingProps:K,elementsRef:_}=Rs({placement:Q,isOpen:re,onOpenChange:je=>{de(je),je||ee(null)},disabled:h,readOnly:k,isLoading:X,animated:ge,animationDuration:ke,activeIndex:ce,onNavigate:ee}),ze=(0,Mr.useCallback)(je=>{if(je.disabled||h||k)return;Re(br=>{if(br.has(je.value))return br;let ht=new Map(br);return ht.set(je.value,je),ht});let st=se.includes(je.value)?se.filter(br=>br!==je.value):[...se,je.value];W||fe(st);let rr=fc(st,t,me);o?.(st,rr),$e()},[h,k,se,W,t,o,$e,me]),pe=(0,Mr.useCallback)(je=>{if(h||k)return;let pt=se.filter(rr=>rr!==je.value);W||fe(pt);let st=pt.map(rr=>t.find(br=>br.value===rr)||me.get(rr)||{value:rr,label:String(rr)});o?.(pt,st)},[h,k,se,W,t,o,me]),Fe=(0,Mr.useCallback)(je=>{je.stopPropagation(),!(h||k)&&(W||fe([]),o?.([],[]),$e())},[h,k,W,o,$e]),et=je=>{let pt=je.currentTarget?.value??U;if(je.key==="Backspace"&&(!pt||pt.length===0)&&xe.length>0){je.preventDefault();let st=xe[xe.length-1];st&&pe(st)}else if(je.key==="Enter"&&re&&ce!==null){je.preventDefault();let st=Pe[ce];st&&ze(st)}else je.key==="ArrowDown"&&!re&&de(!0)},Ge=w==="floating",at=w==="left",tt=(0,Mr.useId)(),Ne=f||tt,Xe=`${Ne}-trigger`,be=()=>(0,ao.jsx)(vt,{htmlFor:Xe,label:c,isRequired:T,isFloating:Ge,size:i,color:s,hasError:O,cursor:"pointer",className:ye});return(0,ao.jsxs)("div",{ref:e,id:f,className:`group/field flex ${at?"flex-row items-center gap-3":"flex-col"} ${Ge?"pt-2":""} ${ae}`,"data-disabled":h,"data-invalid":O,...J,children:[!Ge&&be(),(0,ao.jsxs)("div",{className:"relative flex-1 min-w-0",children:[Ge&&be(),(0,ao.jsx)(Ps,{id:Xe,triggerRef:Qe.setReference,getReferenceProps:Ze,selectedOptions:xe,isOpen:re,size:i,variant:a,color:s,radius:l,placeholder:S||p,disabled:h,readOnly:k,isInvalid:O,maxTagCount:d,searchable:u,searchPlacement:b,searchValue:U,onSearchChange:Ce,onRemoveTag:pe,onClear:Fe,clearable:ue,isLoading:X,startContent:L,endContent:te,renderValue:Z,onKeyDown:et,className:ve}),(0,ao.jsx)(Ci,{isOpen:re,isMounted:Oe,animated:ge,transitionStyles:Be,options:Pe,selectedValues:se,activeIndex:ce,size:i,color:s,radius:l,isLoading:X,portal:ie,maxMenuHeight:q,emptyText:le,emptyProps:ne,menuHeader:$,menuFooter:F,listFooter:G,menuFilters:E,menuFilterValues:Ee,menuFilterLayout:M,menuFilterGridCols:z,showResetFilters:H,resetFiltersText:V,onMenuFilterChange:oe,onResetFilters:Te,renderOption:he,onSelectOption:ze,onOptionMouseEnter:ee,floatingRef:Qe.setFloating,floatingStyles:We,getFloatingProps:K,listElementsRef:_,className:Se})]}),y&&se.map((je,pt)=>(0,ao.jsx)("input",{type:"hidden",name:`${y}[]`,value:String(je)},`${y}-${je}-${pt}`)),(0,ao.jsx)(Le,{id:`${Ne}-helper`,errorMessage:v,helperText:m})]})}var sd=cg;var pc=require("react");function Df(e,t=300){let[r,n]=(0,pc.useState)(e);return(0,pc.useEffect)(()=>{let o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}var cn=require("react");function Nf({onLoadMore:e,hasMore:t=!0,isLoading:r=!1,disabled:n=!1,rootMargin:o="100px",threshold:i=0,root:a=null}){let[s,l]=(0,cn.useState)(!1),[f,c]=(0,cn.useState)(null),w=(0,cn.useRef)(!1),p=t&&!r&&!n,m=(0,cn.useCallback)(()=>{if(!(!p||w.current)){w.current=!0;try{let x=e();x&&typeof x.then=="function"?x.finally(()=>{w.current=!1}):w.current=!1}catch{w.current=!1}}},[p,e]),v=(0,cn.useCallback)(x=>{c(x)},[]);return(0,cn.useEffect)(()=>{if(!f||n||!t||typeof window>"u"||!("IntersectionObserver"in window))return;let x=a&&typeof a=="object"&&"current"in a?a.current:a,h=new IntersectionObserver(k=>{let[T]=k;if(!T)return;let y=T.isIntersecting;l(y),y&&m()},{root:x,rootMargin:o,threshold:i});return h.observe(f),()=>{h.disconnect(),l(!1)}},[f,a,o,i,n,t,m]),(0,cn.useEffect)(()=>{p&&s&&m()},[p,s,m]),{sentinelRef:v,isIntersecting:s}}var Mn=require("react"),_f=require("react-dropzone");var gc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Pf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},zf={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Ta={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"}},If={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 un(e,t=1){if(!e||!+e)return"0 B";let r=1024,n=t<0?0:t,o=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(r));return`${parseFloat((e/Math.pow(r,i)).toFixed(n))} ${o[i]}`}function ki(e){return e?Array.isArray(e)?e.filter(t=>!!t):[e]:[]}var mc={none:"rounded-none",sm:"rounded-md",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},Mf={primary:"text-primary-500 group-focus-within/field:text-primary-600",secondary:"text-secondary-500 group-focus-within/field:text-secondary-600",neutral:"text-neutral-600 group-focus-within/field:text-neutral-800",error:"text-error-500 group-focus-within/field:text-error-600",success:"text-success-500 group-focus-within/field:text-success-600",warning:"text-warning-500 group-focus-within/field:text-warning-600",info:"text-info-500 group-focus-within/field:text-info-600"},Ff={xs:"h-28",sm:"h-36",md:"h-48",lg:"h-60",xl:"h-72"},Dn={xs:{dropzoneHeight:"min-h-[80px]",dropzoneMinHeight:"min-h-[80px]",dropzonePadding:"p-3",compactMinHeight:"min-h-[40px]",compactPadding:"px-3 py-2",thumbnailSize:"w-28 h-20",iconSize:24,fileIconSize:28,titleSize:"text-[11px]",descSize:"text-[10px]",fileNameSize:"text-xs",fileMetaSize:"text-[10px]",labelSize:"text-[11px] mb-1",helperSize:"text-[9px] mt-0.5",buttonSize:"xs",actionButtonPadding:"p-1",gap:"gap-1.5",itemPadding:"px-2.5 py-1.5"},sm:{dropzoneHeight:"min-h-[100px]",dropzoneMinHeight:"min-h-[100px]",dropzonePadding:"p-4",compactMinHeight:"min-h-[48px]",compactPadding:"px-3.5 py-2.5",thumbnailSize:"w-32 h-24",iconSize:32,fileIconSize:34,titleSize:"text-xs",descSize:"text-[11px]",fileNameSize:"text-xs font-medium",fileMetaSize:"text-[11px]",labelSize:"text-xs mb-1",helperSize:"text-[10px] mt-0.5",buttonSize:"sm",actionButtonPadding:"p-1.5",gap:"gap-2",itemPadding:"px-3 py-2"},md:{dropzoneHeight:"min-h-[130px]",dropzoneMinHeight:"min-h-[130px]",dropzonePadding:"p-5",compactMinHeight:"min-h-[56px]",compactPadding:"px-4 py-3",thumbnailSize:"w-40 h-28",iconSize:42,fileIconSize:40,titleSize:"text-sm",descSize:"text-xs",fileNameSize:"text-sm font-medium",fileMetaSize:"text-xs",labelSize:"text-sm mb-1.5",helperSize:"text-[11px] mt-1",buttonSize:"md",actionButtonPadding:"p-1.5",gap:"gap-2.5",itemPadding:"px-3.5 py-2.5"},lg:{dropzoneHeight:"min-h-[160px]",dropzoneMinHeight:"min-h-[160px]",dropzonePadding:"p-6",compactMinHeight:"min-h-[64px]",compactPadding:"px-5 py-3.5",thumbnailSize:"w-48 h-32",iconSize:52,fileIconSize:48,titleSize:"text-base",descSize:"text-xs",fileNameSize:"text-base font-medium",fileMetaSize:"text-xs",labelSize:"text-base mb-1.5",helperSize:"text-xs mt-1",buttonSize:"lg",actionButtonPadding:"p-2",gap:"gap-3",itemPadding:"px-4 py-3"},xl:{dropzoneHeight:"min-h-[200px]",dropzoneMinHeight:"min-h-[200px]",dropzonePadding:"p-8",compactMinHeight:"min-h-[72px]",compactPadding:"px-6 py-4",thumbnailSize:"w-56 h-36",iconSize:64,fileIconSize:56,titleSize:"text-lg",descSize:"text-sm",fileNameSize:"text-lg font-medium",fileMetaSize:"text-sm",labelSize:"text-lg mb-2",helperSize:"text-sm mt-1",buttonSize:"xl",actionButtonPadding:"p-2.5",gap:"gap-3.5",itemPadding:"px-5 py-3.5"}},Ef={outline:{primary:{idle:"bg-neutral-white border-primary-400 hover:border-primary-500 text-neutral-700",active:"bg-primary-50/50 border-primary-500 ring-2 ring-primary-500/20 text-primary-900",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-primary-300"},secondary:{idle:"bg-neutral-white border-secondary-400 hover:border-secondary-500 text-neutral-700",active:"bg-secondary-50/50 border-secondary-500 ring-2 ring-secondary-500/20 text-secondary-900",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-secondary-300"},neutral:{idle:"bg-neutral-white border-neutral-300 hover:border-neutral-400 text-neutral-700",active:"bg-neutral-100/70 border-neutral-500 ring-2 ring-neutral-500/20 text-neutral-900",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-900",itemBg:"bg-white hover:bg-neutral-50/80",itemBorder:"border-neutral-200 hover:border-neutral-400"},error:{idle:"bg-neutral-white border-error-500 hover:border-error-600 text-neutral-700",active:"bg-error-50/50 border-error-500 ring-2 ring-error-500/20 text-error-900",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-white hover:bg-error-50/30",itemBorder:"border-error-200 hover:border-error-300"},success:{idle:"bg-neutral-white border-success-400 hover:border-success-500 text-neutral-700",active:"bg-success-50/50 border-success-500 ring-2 ring-success-500/20 text-success-900",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-white hover:bg-success-50/30",itemBorder:"border-success-200 hover:border-success-300"},warning:{idle:"bg-neutral-white border-warning-400 hover:border-warning-500 text-neutral-700",active:"bg-warning-50/50 border-warning-500 ring-2 ring-warning-500/20 text-warning-900",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-white hover:bg-warning-50/30",itemBorder:"border-warning-200 hover:border-warning-300"},info:{idle:"bg-neutral-white border-info-400 hover:border-info-500 text-neutral-700",active:"bg-info-50/50 border-info-500 ring-2 ring-info-500/20 text-info-900",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-white hover:bg-info-50/30",itemBorder:"border-info-200 hover:border-info-300"}},filled:{primary:{idle:"border-transparent bg-primary-50/60 hover:bg-primary-100/60",active:"border-primary-500 bg-primary-100 ring-2 ring-primary-500/20",iconColor:"text-primary-600",titleHover:"group-hover:text-primary-700",itemBg:"bg-primary-50/40 hover:bg-primary-50/80",itemBorder:"border-primary-100 hover:border-primary-200"},secondary:{idle:"border-transparent bg-secondary-50/60 hover:bg-secondary-100/60",active:"border-secondary-500 bg-secondary-100 ring-2 ring-secondary-500/20",iconColor:"text-secondary-600",titleHover:"group-hover:text-secondary-700",itemBg:"bg-secondary-50/40 hover:bg-secondary-50/80",itemBorder:"border-secondary-100 hover:border-secondary-200"},neutral:{idle:"border-transparent bg-neutral-100/70 hover:bg-neutral-200/50",active:"border-neutral-400 bg-neutral-200 ring-2 ring-neutral-400/20",iconColor:"text-neutral-600",titleHover:"group-hover:text-neutral-800",itemBg:"bg-neutral-100/50 hover:bg-neutral-100",itemBorder:"border-neutral-200 hover:border-neutral-300"},error:{idle:"border-transparent bg-error-50/70 hover:bg-error-100/70",active:"border-error-500 bg-error-100 ring-2 ring-error-500/20",iconColor:"text-error-600",titleHover:"group-hover:text-error-700",itemBg:"bg-error-50/40 hover:bg-error-50/80",itemBorder:"border-error-100 hover:border-error-200"},success:{idle:"border-transparent bg-success-50/70 hover:bg-success-100/70",active:"border-success-500 bg-success-100 ring-2 ring-success-500/20",iconColor:"text-success-600",titleHover:"group-hover:text-success-700",itemBg:"bg-success-50/40 hover:bg-success-50/80",itemBorder:"border-success-100 hover:border-success-200"},warning:{idle:"border-transparent bg-warning-50/70 hover:bg-warning-100/70",active:"border-warning-500 bg-warning-100 ring-2 ring-warning-500/20",iconColor:"text-warning-600",titleHover:"group-hover:text-warning-700",itemBg:"bg-warning-50/40 hover:bg-warning-50/80",itemBorder:"border-warning-100 hover:border-warning-200"},info:{idle:"border-transparent bg-info-50/70 hover:bg-info-100/70",active:"border-info-500 bg-info-100 ring-2 ring-info-500/20",iconColor:"text-info-600",titleHover:"group-hover:text-info-700",itemBg:"bg-info-50/40 hover:bg-info-50/80",itemBorder:"border-info-100 hover:border-info-200"}},ghost:{primary:{idle:"border-transparent bg-transparent hover:bg-primary-50/30",active:"border-primary-400 bg-primary-50/40 ring-2 ring-primary-400/20",iconColor:"text-primary-500",titleHover:"group-hover:text-primary-600",itemBg:"bg-transparent hover:bg-primary-50/20",itemBorder:"border-transparent hover:border-primary-200"},secondary:{idle:"border-transparent bg-transparent hover:bg-secondary-50/30",active:"border-secondary-400 bg-secondary-50/40 ring-2 ring-secondary-400/20",iconColor:"text-secondary-500",titleHover:"group-hover:text-secondary-600",itemBg:"bg-transparent hover:bg-secondary-50/20",itemBorder:"border-transparent hover:border-secondary-200"},neutral:{idle:"border-transparent bg-transparent hover:bg-neutral-100/40",active:"border-neutral-400 bg-neutral-100/50 ring-2 ring-neutral-400/20",iconColor:"text-neutral-500",titleHover:"group-hover:text-neutral-800",itemBg:"bg-transparent hover:bg-neutral-100/40",itemBorder:"border-transparent hover:border-neutral-300"},error:{idle:"border-transparent bg-transparent hover:bg-error-50/30",active:"border-error-400 bg-error-50/40 ring-2 ring-error-400/20",iconColor:"text-error-500",titleHover:"group-hover:text-error-600",itemBg:"bg-transparent hover:bg-error-50/20",itemBorder:"border-transparent hover:border-error-200"},success:{idle:"border-transparent bg-transparent hover:bg-success-50/30",active:"border-success-400 bg-success-50/40 ring-2 ring-success-400/20",iconColor:"text-success-500",titleHover:"group-hover:text-success-600",itemBg:"bg-transparent hover:bg-success-50/20",itemBorder:"border-transparent hover:border-success-200"},warning:{idle:"border-transparent bg-transparent hover:bg-warning-50/30",active:"border-warning-400 bg-warning-50/40 ring-2 ring-warning-400/20",iconColor:"text-warning-500",titleHover:"group-hover:text-warning-600",itemBg:"bg-transparent hover:bg-warning-50/20",itemBorder:"border-transparent hover:border-warning-200"},info:{idle:"border-transparent bg-transparent hover:bg-info-50/30",active:"border-info-400 bg-info-50/40 ring-2 ring-info-400/20",iconColor:"text-info-500",titleHover:"group-hover:text-info-600",itemBg:"bg-transparent hover:bg-info-50/20",itemBorder:"border-transparent hover:border-info-200"}}},$f={pdf:["pdf"],word:["doc","docx","dot","dotx","odt","rtf"],excel:["xls","xlsx","xlsm","xlsb","csv","ods"],powerpoint:["ppt","pptx","pot","potx","pps","ppsx","odp"],archive:["zip","rar","7z","tar","gz","bz2","xz","iso"],text:["txt","md","markdown","log"],image:["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],audio:["mp3","wav","ogg","aac","flac","m4a","wma"],video:["mp4","webm","mov","avi","mkv","wmv","flv"],code:["js","jsx","ts","tsx","html","css","scss","json","py","java","c","cpp","cs","go","rs","php","sql","sh","yaml","yml","xml"],other:[]},Lf={pdf:{label:"PDF",bg:"bg-error-50",text:"text-error-700",border:"border-error-200"},word:{label:"DOC",bg:"bg-primary-50",text:"text-primary-700",border:"border-primary-200"},excel:{label:"XLS",bg:"bg-success-50",text:"text-success-700",border:"border-success-200"},powerpoint:{label:"PPT",bg:"bg-secondary-50",text:"text-secondary-700",border:"border-secondary-200"},archive:{label:"ZIP",bg:"bg-warning-50",text:"text-warning-800",border:"border-warning-200"},text:{label:"TXT",bg:"bg-neutral-100",text:"text-neutral-700",border:"border-neutral-200"},image:{label:"IMG",bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-200"},audio:{label:"AUD",bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200"},video:{label:"VID",bg:"bg-cyan-50",text:"text-cyan-700",border:"border-cyan-200"},code:{label:"DEV",bg:"bg-slate-100",text:"text-slate-700",border:"border-slate-200"},other:{label:"FILE",bg:"bg-neutral-100",text:"text-neutral-600",border:"border-neutral-200"}};var zs=["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"],Is=["pdf"],Ms=["mp4","webm","ogg","mov","avi","mkv"],Fs=["mp3","wav","ogg","aac","flac","m4a"],Es=["doc","docx","xls","xlsx","ppt","pptx","txt","csv"];function Tt(e){if(!e)return"";if(typeof e=="object"&&!(e instanceof Blob))return e.name?e.name:e.src?Tt(e.src):"";if(e instanceof File)return e.name||"";if(typeof e=="string"){let t=e.split("?")[0]?.split("#")[0]||"",r=t.split("/").pop()||t.split("\\").pop()||"",n=r.lastIndexOf(".");return n<=0?r:r.slice(0,n)}return""}function Ra(e=""){let t=e.split("?")[0]?.split("#")[0]||"",r=t.lastIndexOf(".");return r===-1?"":t.slice(r+1).toLowerCase()}function Si(e=""){let t=Ra(e);return zs.includes(t)?"image":Is.includes(t)?"pdf":Ms.includes(t)?"video":Fs.includes(t)?"audio":Es.includes(t)?"document":"other"}function ld(e){return!e||typeof e!="object"||e instanceof Blob||"height"in e&&"width"in e&&typeof e.height=="number"?!1:"src"in e||"name"in e||"id"in e}function Nn(e){if(!e)return{name:"file",type:"other",file:void 0,serverFile:void 0};if(typeof e=="string"){let n=Tt(e)||"file";return{name:n,type:Si(e),file:void 0,serverFile:{src:e,name:n}}}if(e instanceof File)return{name:Tt(e.name),type:Si(e.name),file:e,serverFile:void 0};let t=e.name??Tt(e?.src),r="other";return e?.src?.startsWith("data:image/")?r="image":e?.src?.startsWith("data:video/")?r="video":e?.src?.startsWith("data:audio/")?r="audio":e?.src?.startsWith("data:application/pdf")?r="pdf":e?.name&&(r=Si(e.name)),r==="other"&&e?.src&&(r=Si(e.src)),{name:t,type:r,file:void 0,serverFile:e}}function dn(e,t){if(!e)return;let r=document.createElement("a");r.href=e;let n=e.split("?")[0]?.split("#")[0]||"",o=n.split("/").pop()||n.split("\\").pop()||"download";r.download=t||o,r.style.display="none",document.body.appendChild(r),r.click(),setTimeout(()=>{try{document.body.removeChild(r)}catch{}},100)}function cd(e){if(e){if(e instanceof File)return e.size;if(typeof e=="object"&&e!==null&&"size"in e){let t=e.size;if(typeof t=="number")return t}}}function ud(e){if(!e||typeof e!="object"||e instanceof File)return{status:"idle"};let t=e,r=typeof t.status=="string"?t.status:void 0,n=typeof t.progress=="number"?t.progress:void 0,o=typeof t.error=="string"?t.error:void 0,i="idle";return r==="uploading"||n!==void 0&&n>=0&&n<100?i="uploading":r==="error"||o?i="error":(r==="success"||r==="done"||n!==void 0&&n>=100)&&(i="success"),{status:i,progress:n,error:o}}function $s(e){if(!e)return"other";let t="",r="";typeof e=="string"?t=e:e instanceof File?(t=e.name,r=e.type):typeof e=="object"&&(t=e.name||(typeof e.src=="string"?e.src:""),typeof e.type=="string"&&(r=e.type));let n=Ra(t);if(n){for(let[o,i]of Object.entries($f))if(i.includes(n))return o}if(r){if(r==="application/pdf")return"pdf";if(r.startsWith("image/"))return"image";if(r.startsWith("audio/"))return"audio";if(r.startsWith("video/"))return"video";if(r.includes("word")||r.includes("document")||r==="application/msword")return"word";if(r.includes("excel")||r.includes("spreadsheet")||r==="text/csv")return"excel";if(r.includes("presentation")||r.includes("powerpoint"))return"powerpoint";if(r.includes("zip")||r.includes("compressed")||r.includes("archive")||r==="application/x-tar")return"archive";if(r.startsWith("text/"))return"text"}return"other"}function Bf(e,t){return typeof e=="object"&&e&&"id"in e&&e.id!=null?String(e.id):e instanceof File?`${e.name}-${e.size}-${e.lastModified}-${t}`:typeof e=="string"?`${e}-${t}`:`${Tt(e)}-${t}`}function Ls(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(o=>o.trim()).filter(Boolean),n={".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".csv":"text/csv",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".zip":"application/zip",".rar":"application/vnd.rar",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".txt":"text/plain",".json":"application/json",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".gif":"image/gif",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".mp4":"video/mp4"};for(let o of r)if(o.startsWith(".")){let i=o.toLowerCase(),a=n[i]||"application/octet-stream";t[a]=[...t[a]||[],i]}else t[o]||(t[o]=[]);return t}var hc=require("react");var bc=require("react"),dd=(0,bc.createContext)(null),Bs=()=>(0,bc.useContext)(dd);var Hs=require("react"),Hf=Hn(require("react-easy-crop"),1);var Ht=require("react/jsx-runtime");function Da({zoom:e=1,minZoom:t=.2,maxZoom:r=5,step:n=.05,onZoomChange:o,sliderProps:i,onZoomIn:a,onZoomOut:s,onRotateCw:l,onRotateCcw:f,onFlipHorizontal:c,onReset:w,currentImage:p,tools:m,className:v=""}){let{zoomIn:x=!0,zoomOut:h=!0,zoomSlider:k=!0,reset:T=!0,rotate:y=!0,flip:d=!0,download:u=!0}=m??{},g=Math.round(e*100),b=()=>{p?.src&&dn(p.src,p.name)},S=D=>{if(typeof D=="number"){let P=Math.round(D*100)/100;o?.(P)}},R="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(0,Ht.jsxs)("div",{"data-testid":"image-preview-toolbar",className:`inline-flex items-center gap-1 bg-neutral-white border border-neutral-200 rounded-full px-3 py-1.5 shadow-sm text-neutral-700 select-none pointer-events-auto ${v}`,children:[h&&(0,Ht.jsx)("button",{type:"button","aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",disabled:e<=t,onClick:s,className:R,children:(0,Ht.jsx)(Qo,{width:18,height:18})}),k&&(0,Ht.jsx)("div",{className:"flex items-center px-1","data-testid":"image-preview-zoom-slider",children:(0,Ht.jsx)(Ji,{value:e,min:t,max:r,step:n,size:"sm",color:"primary",config:{isFullWidth:!1},className:"w-20 sm:w-28",disabled:!o&&!i?.onChange,onChange:S,"aria-label":"Thanh tr\u01B0\u1EE3t thu ph\xF3ng",...i})}),x&&(0,Ht.jsx)("button",{type:"button","aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",disabled:e>=r,onClick:a,className:R,children:(0,Ht.jsx)(Jo,{width:18,height:18})}),T&&(0,Ht.jsxs)("button",{type:"button","aria-label":"\u0110\u1EB7t l\u1EA1i k\xEDch th\u01B0\u1EDBc v\xE0 g\xF3c xoay",title:"\u0110\u1EB7t l\u1EA1i (1:1)",onClick:w,className:"px-2 py-1 text-xs font-semibold text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 rounded-full transition-colors cursor-pointer",children:[g,"%"]}),(y||d||u)&&(0,Ht.jsx)("div",{className:"w-px h-4 bg-neutral-200 my-auto mx-1"}),y&&(0,Ht.jsx)("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:f,className:R,children:(0,Ht.jsx)(ei,{width:18,height:18})}),y&&(0,Ht.jsx)("button",{type:"button","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3 (r)",onClick:l,className:R,children:(0,Ht.jsx)(Kn,{width:18,height:18})}),d&&(0,Ht.jsx)("button",{type:"button","aria-label":"L\u1EADt ngang",title:"L\u1EADt ngang",onClick:c,className:R,children:(0,Ht.jsx)(ti,{width:18,height:18})}),u&&(0,Ht.jsx)("button",{type:"button","aria-label":"T\u1EA3i \u1EA3nh xu\u1ED1ng",title:"T\u1EA3i \u1EA3nh xu\u1ED1ng",onClick:b,className:R,children:(0,Ht.jsx)(Qr,{width:18,height:18})})]})}var Ti=require("react/jsx-runtime");function Na({src:e,name:t,minZoom:r=.2,maxZoom:n=5,showToolbar:o=!0,toolbarProps:i,children:a}){let[s,l]=(0,Hs.useState)({x:0,y:0}),[f,c]=(0,Hs.useState)(1),[w,p]=(0,Hs.useState)(0),[m,v]=(0,Hs.useState)(!1),x=()=>c(g=>Math.min(n,Math.round((g+.25)*100)/100)),h=()=>c(g=>Math.max(r,Math.round((g-.25)*100)/100)),k=()=>p(g=>(g+90)%360),T=()=>p(g=>(g-90+360)%360),y=()=>v(g=>!g),d=()=>{l({x:0,y:0}),c(1),p(0),v(!1)},u={src:e,name:t};return e?(0,Ti.jsxs)("div",{className:"flex flex-col w-full select-none overflow-hidden",children:[(0,Ti.jsx)("div",{className:"relative w-full h-90 sm:h-105 md:h-115 overflow-hidden bg-neutral-50/70 select-none",children:(0,Ti.jsx)(Hf.default,{image:e,crop:s,zoom:f,rotation:w,minZoom:r,maxZoom:n,zoomSpeed:.5,restrictPosition:!1,showGrid:!1,objectFit:"contain",onCropChange:l,onZoomChange:c,onRotationChange:p,classes:{mediaClassName:m?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"},cropAreaStyle:{display:"none"},mediaStyle:{cursor:"grab"}}})}),o&&(0,Ti.jsx)("div",{className:"w-full flex items-center justify-center py-2.5 sm:py-3 border-t border-neutral-200 bg-neutral-white z-20 overflow-x-auto ui-scrollbar px-2 shrink-0",children:(0,Ti.jsx)(Da,{zoom:f,minZoom:r,maxZoom:n,onZoomChange:c,rotation:w,isFlipped:m,onZoomIn:x,onZoomOut:h,onRotateCw:k,onRotateCcw:T,onFlipHorizontal:y,onReset:d,currentImage:u,...i})}),a]}):null}var fn=require("react/jsx-runtime");function Pn({onDownload:e,imageProps:t,className:r=""}){let n=Bs(),o=n?.file,i=n?.headerTitle,[a,s]=(0,hc.useState)("");(0,hc.useEffect)(()=>{if(!o){s("");return}if(!(o instanceof File)){let p=Nn(o);s(p.serverFile?.src||"");return}let w=URL.createObjectURL(o);return s(w),()=>{URL.revokeObjectURL(w)}},[o]);let l=Nn(o),f=(typeof i=="string"?i:"")||l.name||"file",c=()=>{e&&o&&e(o),a&&dn(a,f)};return l.type==="image"?(0,fn.jsx)(Na,{src:a,name:f,...t}):(0,fn.jsxs)("div",{className:`p-6 text-center ${r}`,children:[(0,fn.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-neutral-100 flex items-center justify-center mx-auto mb-4 text-primary-600",children:(0,fn.jsx)(Qr,{width:32,height:32})}),(0,fn.jsx)("h3",{className:"text-lg font-semibold text-neutral-900 truncate mb-1",title:f,children:i??f}),(0,fn.jsx)("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."}),(0,fn.jsxs)("button",{type:"button",onClick:c,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:[(0,fn.jsx)(Qr,{width:18,height:18}),(0,fn.jsx)("span",{children:"T\u1EA3i xu\u1ED1ng file"})]})]})}var jf=require("react");var Vf=250,Eo={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"}},Af={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"};var xc=require("react"),fd=(0,xc.createContext)(null),Fr=()=>(0,xc.useContext)(fd);var Of=require("react/jsx-runtime");function $o({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=Fr(),s=C(e??a?.size,Eo,"md"),l=C(t,Af,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,Of.jsx)("div",{ref:o,tabIndex:-1,className:f,...i,children:n})}var Wt=require("react");var Pa=require("react/jsx-runtime");function Lo({open:e=!1,id:t,size:r,isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:f,onClose:c,...w}){let p=(0,Wt.useRef)(null),[m,v]=(0,Wt.useState)(!1),x=(0,Wt.useRef)(null),h=(0,Wt.useCallback)(()=>{m||n||(v(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(!1),c?.()},Vf))},[m,n,c]),k=(0,Wt.useMemo)(()=>({onClose:h,isLoading:n,size:r}),[h,n,r]);(0,Wt.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,Wt.useEffect)(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),(0,Wt.useEffect)(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=(0,Wt.useEffectEvent)(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h())});if((0,Wt.useEffect)(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{o&&h()},d=m?"animate-modal-backdrop-out pointer-events-none":"animate-modal-backdrop-in",u=m?"animate-modal-out pointer-events-none":"animate-modal-in";return(0,Pa.jsx)(fd.Provider,{value:k,children:(0,Pa.jsxs)("dialog",{id:t,ref:p,"aria-labelledby":"modal-dialog-title","aria-describedby":"modal-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&h()},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 ${d} ${s}`,...w,children:[(0,Pa.jsx)("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),(0,Pa.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${u} ${l}`,children:f})]})})}var Bo=require("react/jsx-runtime");function Ho({size:e,title:t,description:r,titleClassName:n="",descriptionClassName:o="",showCloseButton:i=!0,onClose:a,closeButtonClassName:s="",className:l="",children:f,...c}){let w=Fr(),p=C(e??w?.size,Eo,"md"),m=w?.isLoading,v=()=>{a?.(),w?.onClose?.()},x=!!(a||w?.onClose);return(0,Bo.jsxs)("div",{className:`flex items-start justify-between w-full border-b border-neutral-100 pb-2 ${p.header} ${l}`,...c,children:[(0,Bo.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col justify-center",children:[t&&(0,Bo.jsx)("h3",{id:"modal-dialog-title",className:`${p.title} truncate ${n}`,children:t}),r&&(0,Bo.jsx)("p",{id:"modal-dialog-description",className:`${p.description} mt-0.5 ${o}`,children:r}),f]}),i&&x&&(0,Bo.jsx)("button",{type:"button",onClick:v,disabled:m,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i","data-testid":"modal-close-button",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${p.closeButton} ${s}`,children:(0,Bo.jsx)(Ve,{className:p.closeIcon})})]})}var Gf=require("react/jsx-runtime");function Vo({size:e,className:t="",children:r,...n}){let o=Fr(),i=C(e??o?.size,Eo,"md");return(0,Gf.jsx)("div",{className:`w-full max-h-[calc(100vh-8rem)] overflow-y-auto ui-scrollbar ${i.body} ${t}`,...n,children:r})}var Ao=require("react/jsx-runtime");function Kr({open:e=!1,onClose:t,file:r,title:n,description:o,size:i="lg",radius:a="xl",showCloseButton:s=!0,closeOnOverlayClick:l=!0,closeOnEsc:f=!0,lockScroll:c=!0,className:w="",overlayClassName:p="",children:m}){let v=Nn(r),x=n??v?.name,h=(0,jf.useMemo)(()=>({file:r,headerTitle:x}),[r,x]);return(0,Ao.jsx)(Lo,{open:e,onClose:t,size:i,closeOnOverlayClick:l,closeOnEsc:f,lockScroll:c,overlayClassName:p,children:(0,Ao.jsxs)($o,{size:i,radius:a,"data-testid":"image-preview-modal",className:`bg-neutral-white border border-neutral-200 text-neutral-900 shadow-2xl overflow-hidden p-0 ${w}`,children:[(x||s)&&(0,Ao.jsx)(Ho,{title:x,description:o,showCloseButton:s,className:"px-5 py-3.5 border-b border-neutral-200 shrink-0"}),(0,Ao.jsx)(Vo,{className:"p-0 overflow-hidden flex flex-col flex-1 min-h-0",children:(0,Ao.jsx)(dd.Provider,{value:h,children:m||(0,Ao.jsx)(Pn,{})})})]})})}var zn=require("react"),Kf=Hn(require("next/image"),1);var Uf={pulse:"animate-pulse",wave:"skeleton-wave",none:""},vc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},Yf={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"};var Ri=e=>e,Wf=e=>e?typeof e=="string"?e:typeof File<"u"&&e instanceof File?`${e.name}-${e.size}-${e.lastModified}`:typeof Blob<"u"&&e instanceof Blob?`${e.size}-${e.type}`:typeof e=="object"&&"src"in e&&typeof e.src=="string"?e.src:e:"";var yc=require("react/jsx-runtime");function Oo({ref:e,variant:t="pulse",shape:r="rectangle",radius:n="md",width:o,height:i="1rem",lines:a=1,gap:s="0.5rem",className:l="",style:f,...c}){let w=C(t,Uf,"pulse"),p=r==="circle"?"rounded-full":C(n,vc,"md"),m={width:Ri(o),height:Ri(i),...f},v=["bg-neutral-200",w,p].filter(Boolean).join(" ");return a>1?(0,yc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:["flex flex-col",l].filter(Boolean).join(" "),style:{gap:Ri(s),...f},...c,children:Array.from({length:a}).map((x,h)=>{let k=h===a-1;return(0,yc.jsx)("div",{className:v,style:{width:k?"60%":Ri(o)??"100%",height:Ri(i)}},h)})}):(0,yc.jsx)("div",{ref:e,role:"status","aria-label":"Loading...",className:[v,l].filter(Boolean).join(" "),style:m,...c})}var _r=require("react/jsx-runtime");function In({src:e,alt:t="",width:r,height:n,fill:o,skeletonVariant:i="pulse",radius:a="md",objectFit:s="cover",preview:l=!0,className:f="",wrapperClassName:c="",style:w,wrapperStyle:p,onLoad:m,onError:v,onClick:x,ref:h,...k}){let[T,y]=(0,zn.useState)(!1),[d,u]=(0,zn.useState)(!1),[g,b]=(0,zn.useState)(null),[S,R]=(0,zn.useState)(!1),D=Wf(e),[P,I]=(0,zn.useState)(D),E=typeof Blob<"u"&&(e instanceof File||e instanceof Blob),N=ld(e)?e:void 0,M=N?.src,z=E?g:N?M:e,H=E||!!N||typeof z=="string"&&(/^(?:https?:)?\/\//.test(z)||z.startsWith("data:")||z.startsWith("blob:")),V=t||N?.name||"";D!==P&&(I(D),y(!1),u(!1)),(0,zn.useEffect)(()=>{if(!(e instanceof File||e instanceof Blob)){b(null);return}let ne=URL.createObjectURL(e);return b(ne),()=>URL.revokeObjectURL(ne)},[e]);let Y=(0,zn.useMemo)(()=>{if(z)return e instanceof File?e:N?{...N,src:N.src,name:V||"image",type:"image"}:{src:typeof z=="string"?z:z?.src,name:V||"image",type:"image"}},[e,z,N,V]),$=C(a,vc,"md"),F=C(s,Yf,"cover"),G=ne=>{y(!0),m?.(ne)},A=ne=>{u(!0),y(!1),v?.(ne)},j=ne=>{x?.(ne),!ne.defaultPrevented&&l&&T&&!d&&Y&&R(!0)},B=!!(l&&T&&!d||x),X=ne=>{(ne.key==="Enter"||ne.key===" ")&&(ne.preventDefault(),j(ne))},le={...o?{}:{width:r,height:n},...p};return(0,_r.jsxs)(_r.Fragment,{children:[(0,_r.jsxs)("div",{ref:h,role:B?"button":void 0,tabIndex:B?0:void 0,onClick:j,onKeyDown:X,className:["relative overflow-hidden inline-block",$,B?"cursor-pointer":"",c].filter(Boolean).join(" "),style:le,children:[!T&&!d&&(0,_r.jsx)(Oo,{variant:i,radius:a,width:"100%",height:"100%",style:{position:"absolute",inset:0}}),z?(0,_r.jsx)(Kf.default,{src:z,alt:V,width:o?void 0:r,height:o?void 0:n,fill:o,unoptimized:H?!0:k.unoptimized,className:["block w-full h-full transition-opacity duration-200",F,$,T?"opacity-100":"opacity-0",f].filter(Boolean).join(" "),style:w,onLoad:G,onError:A,...k}):null,d&&(0,_r.jsx)("div",{role:"img","aria-label":"Image failed to load",className:["absolute inset-0 flex items-center justify-center","bg-neutral-100 text-neutral-400"].join(" "),children:(0,_r.jsx)(Qa,{width:24,height:24,"aria-hidden":"true"})})]}),S&&Y&&(0,_r.jsx)(Kr,{open:S,onClose:()=>R(!1),file:Y,title:V||"Xem \u1EA3nh",children:(0,_r.jsx)(Pn,{})})]})}var ft=require("react/jsx-runtime");function za({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",objectFit:i="contain",disabled:a,readOnly:s,isLoading:l,dragStatus:f="idle",isInvalid:c,dropzoneTitle:w,dropzoneDescription:p,icon:m,item:v,onRemove:x,onPreview:h,onTriggerUpload:k,getRootProps:T,className:y="",describedById:d}){let u=C(e,Ta,"md"),g=C(n,gc,"md"),b=o==="square"?"aspect-square w-full":C(e,zf,"md"),S=c?"error":t,R=r!=="other"?C(r,If,"outline"):null,D=R?C(S,R,"primary"):null,P="K\xE9o th\u1EA3 h\xECnh \u1EA3nh v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",I="H\u1ED7 tr\u1EE3 \u0111\u1ECBnh d\u1EA1ng PNG, JPG, WEBP, GIF",E=f==="active",N=f==="reject",M=E,z=N?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":M?D?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":D?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",H=v?`group relative w-full ${b} ${g} overflow-hidden border-2 transition-colors duration-150 ease-in-out cursor-pointer select-none ${M?"border-dashed "+z:"border-solid border-neutral-200 hover:border-primary-400"} ${a?"opacity-50 cursor-not-allowed pointer-events-none":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${y}`:`group relative w-full ${o==="square"?"aspect-square w-full":u.dropzoneHeight} ${u.dropzonePadding} ${g} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer ${z} ${a?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${y}`,V=Tt(v),Y={role:"button",tabIndex:a?-1:0,"aria-label":v?`H\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn: ${V}. Nh\u1EA5n \u0111\u1EC3 xem tr\u01B0\u1EDBc, ho\u1EB7c d\xF9ng n\xFAt \u1EDF g\xF3c ph\u1EA3i \u0111\u1EC3 thay \u0111\u1ED5i ho\u1EB7c x\xF3a \u1EA3nh.`:"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i \u1EA3nh l\xEAn","aria-disabled":a,"aria-invalid":c,"aria-describedby":d,"aria-busy":l,className:H,onClick:()=>{a||l||v&&h?.()},onKeyDown:F=>{a||l||(F.key==="Enter"||F.key===" ")&&v&&(F.preventDefault(),h?.())}},$=T?T(Y):Y;return(0,ft.jsx)("div",{...$,children:v?(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(In,{src:v,alt:V,fill:!0,radius:n??"md",objectFit:i,preview:!1,wrapperClassName:"w-full h-full"}),!l&&!a&&(0,ft.jsxs)("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1.5 z-10",children:[!s&&(0,ft.jsx)("button",{type:"button",onClick:F=>{F.stopPropagation(),k?.()},"aria-label":"Thay \u0111\u1ED5i \u1EA3nh",title:"Thay \u0111\u1ED5i \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-neutral-900/80 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden","data-testid":"dropzone-replace-button",children:(0,ft.jsx)(cr,{width:16,height:16})}),!s&&(0,ft.jsx)("button",{type:"button",onClick:F=>{F.stopPropagation(),x?.()},"aria-label":"X\xF3a \u1EA3nh",title:"X\xF3a \u1EA3nh",className:"p-1.5 rounded-lg bg-neutral-900/60 hover:bg-error-600 text-neutral-white backdrop-blur-xs transition-colors shadow-xs cursor-pointer focus-visible:ring-2 focus-visible:ring-error-500 focus-visible:outline-hidden","data-testid":"dropzone-remove-button",children:(0,ft.jsx)(Br,{width:16,height:16})})]}),l&&(0,ft.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/60 flex flex-col items-center justify-center text-neutral-white z-20",children:[(0,ft.jsx)(De,{width:u.iconSize*.8,height:u.iconSize*.8,className:"animate-spin"}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium mt-1`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}),M&&(0,ft.jsxs)("div",{className:"absolute inset-0 bg-primary-950/50 backdrop-blur-xs flex flex-col items-center justify-center text-neutral-white z-20 transition-opacity",children:[(0,ft.jsx)(Zt,{width:u.iconSize,height:u.iconSize,className:"animate-bounce"}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium mt-1`,children:"Th\u1EA3 h\xECnh \u1EA3nh \u0111\u1EC3 thay th\u1EBF"})]})]}):l?(0,ft.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${D?.iconColor||"text-primary-600"}`,children:[(0,ft.jsx)(De,{width:u.iconSize*.8,height:u.iconSize*.8}),(0,ft.jsx)("span",{className:`${u.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD h\xECnh \u1EA3nh..."})]}):(0,ft.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,ft.jsx)("div",{className:`transition-colors ${D?.iconColor||"text-primary-500"}`,children:m||(0,ft.jsx)(Zt,{width:u.iconSize,height:u.iconSize})}),(0,ft.jsx)("div",{className:`${u.titleSize} font-medium text-neutral-800 ${D?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:w??P}),(0,ft.jsx)("div",{id:d,className:`${u.descSize} text-neutral-500`,children:p??I})]})})}var mr=require("react/jsx-runtime");function Go({items:e,size:t,radius:r,objectFit:n="cover",disabled:o,readOnly:i,maxCount:a,onRemove:s,onPreview:l,onTriggerUpload:f,renderItem:c,showAddButton:w=!0,className:p=""}){let m=C(t,Ta,"md"),v=C(r,gc,"md"),x=!a||e.length<a;return(0,mr.jsxs)("ul",{"aria-label":"Danh s\xE1ch h\xECnh \u1EA3nh \u0111\xE3 t\u1EA3i l\xEAn",className:`flex flex-wrap items-center list-none p-0 m-0 ${m.gap} ${p}`,children:[e.map((h,k)=>{let T=Tt(h),y=typeof h=="object"&&h&&"id"in h&&h.id?String(h.id):h instanceof File?`${h.name}-${h.size}-${h.lastModified}`:typeof h=="string"?h:h?.src||T;return c?(0,mr.jsx)("li",{"data-testid":"upload-image-item",className:"list-none",children:c(h,k,{remove:()=>s(h,k),preview:()=>l(h)})},y):(0,mr.jsxs)("li",{"data-testid":"upload-image-item",tabIndex:o?-1:0,"aria-label":`H\xECnh \u1EA3nh ${T}`,onKeyDown:d=>{o||i||(d.key==="Delete"||d.key==="Backspace")&&(d.preventDefault(),s(h,k))},className:`group relative list-none ${m.thumbnailSize} ${v} border-2 overflow-hidden flex items-center justify-center bg-neutral-100 border-neutral-200 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:[(0,mr.jsx)(In,{src:h,alt:T,width:80,height:80,radius:r,objectFit:n,unoptimized:!0,preview:!1,className:"w-full h-full",wrapperClassName:"w-full h-full"}),!o&&(0,mr.jsxs)("div",{className:"absolute inset-0 bg-neutral-900/40 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150 flex items-center justify-center gap-1.5 p-1",children:[l&&(0,mr.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),l(h)},"aria-label":`Preview image ${T}`,title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-md text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-primary-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,mr.jsx)(Vn,{width:16,height:16})}),!i&&(0,mr.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),s(h,k)},"aria-label":`Remove image ${T}`,title:"X\xF3a \u1EA3nh",className:"p-1 rounded-md text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden transition-colors cursor-pointer",children:(0,mr.jsx)(Br,{width:16,height:16})})]})]},y)}),w&&x&&!i&&(0,mr.jsx)("li",{className:"list-none",children:(0,mr.jsx)("button",{type:"button",disabled:o,onClick:f,"aria-label":"Add image",title:"Th\xEAm h\xECnh \u1EA3nh",className:`${m.thumbnailSize} ${v} border-2 border-dashed border-neutral-300 hover:border-primary-500 hover:bg-primary-50/40 text-neutral-400 hover:text-primary-600 flex flex-col items-center justify-center transition-colors duration-150 ease-in-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden`,children:(0,mr.jsx)(Zr,{width:m.iconSize*.5,height:m.iconSize*.5})})})]})}var Rt=require("react/jsx-runtime");function wc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,multiple:i=!1,maxCount:a,maxSize:s,accept:l="image/*",beforeUpload:f,viewMode:c="dropzone",shape:w="rectangle",objectFit:p,size:m="md",color:v="primary",variant:x="outline",radius:h,label:k,isRequired:T=!1,labelClassName:y="",helperText:d,errorMessage:u,isInvalid:g,disabled:b=!1,readOnly:S=!1,isLoading:R=!1,dropzoneTitle:D,dropzoneDescription:P,icon:I,buttonText:E="T\u1EA3i \u1EA3nh l\xEAn",renderItem:N,className:M="",dropzoneClassName:z="",previewClassName:H="",helperClassName:V=""}){let Y=(0,Mn.useId)(),$=`${Y}-input`,F=`${Y}-error-helper`,G=e!==void 0,[A,j]=(0,Mn.useState)(()=>ki(t)),B=(0,Mn.useMemo)(()=>G?ki(e):A,[G,e,A]),[X,le]=(0,Mn.useState)(null),[ne,ue]=(0,Mn.useState)(null),[ie,Q]=(0,Mn.useState)(""),q=C(m,Ta,"md"),ge=h??"md",ke=!!(g||u||X),L=u||X,Z=ke?"text-error-600":C(ke?"error":v,Pf,"primary"),he=a??(i?void 0:1),ae=!i||he===1,ve=ae&&B.length===1?B[0]:null,Se=xe=>{G||j(xe),r?.(xe)},ye=(0,Mn.useMemo)(()=>Ls(l),[l]),J=c==="dropzone"&&!!ve,{getRootProps:O,getInputProps:W,isDragActive:we,isDragReject:fe,open:se}=(0,_f.useDropzone)({multiple:i,maxSize:s,accept:ye,disabled:b||S||R,noClick:c!=="dropzone"||J,noKeyboard:c!=="dropzone"||J,onDropAccepted:async xe=>{if(b||S||(le(null),xe.length===0))return;let re=xe,de=B.length;if(he!==void 0)if(i){let U=he-de;if(U<=0){let Ce=`Maximum allowed image count reached (${he} images)`;le(Ce),Q(Ce);return}re=xe.slice(0,U)}else{let U=xe[0];if(!U)return;re=[U]}let ce=await Promise.all(re.map(async U=>{if(f)try{let Ce=await f(U);if(Ce===!1||typeof Ce=="string")return{file:null,error:typeof Ce=="string"?Ce:`File ${U.name} was rejected`}}catch(Ce){return{file:null,error:Ce instanceof Error?Ce.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${U.name}`}}return{file:U,error:null}})),ee=[];for(let U of ce)U.error?(le(U.error),Q(`L\u1ED7i: ${U.error}`)):U.file&&ee.push(U.file);if(ee.length>0){let U=i?[...B,...ee]:ee;Se(U),Q(`T\u1EA3i l\xEAn th\xE0nh c\xF4ng ${ee.length} h\xECnh \u1EA3nh. T\u1ED5ng c\u1ED9ng: ${U.length}.`)}},onDropRejected:xe=>{let re=xe[0]?.errors[0];if(!re)return;let de=re.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";re.code==="file-too-large"?de=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n t\u1ED1i \u0111a (${un(s||0)})`:re.code==="file-invalid-type"?de=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7. C\xE1c \u0111\u1ECBnh d\u1EA1ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3: ${typeof l=="string"?l:Object.keys(l||{}).join(", ")}`:re.code==="too-many-files"&&(de=`S\u1ED1 l\u01B0\u1EE3ng h\xECnh \u1EA3nh v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${he} h\xECnh \u1EA3nh)`),le(de),Q(`L\u1ED7i t\u1EC7p: ${de}`)}}),me=(xe,re)=>{if(b||S)return;let de=B.filter((ce,ee)=>ee!==re);Se(de),n?.(xe,re),Q(`\u0110\xE3 x\xF3a h\xECnh \u1EA3nh ${Tt(xe)}`)},Re=xe=>{ue(xe),o?.(xe)};return(0,Rt.jsxs)("div",{className:`group/field relative flex flex-col w-full ${M}`,children:[(0,Rt.jsx)("input",{...W({id:$,disabled:b||R,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,Rt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ie}),k&&(0,Rt.jsxs)("label",{htmlFor:$,className:`block font-medium transition-colors duration-150 ${q.labelSize} ${Z} ${y}`,children:[k,T&&(0,Rt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Rt.jsxs)("div",{className:"flex flex-col gap-3",children:[c==="dropzone"&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(za,{size:m,color:v,variant:x,radius:ge,shape:w,objectFit:p,disabled:b,readOnly:S,isLoading:R,dragStatus:fe?"reject":we?"active":"idle",isInvalid:ke,dropzoneTitle:D,dropzoneDescription:P,icon:I,item:ve,onRemove:()=>ve&&me(ve,0),onPreview:()=>ve&&Re(ve),getRootProps:O,onTriggerUpload:se,className:z,describedById:L||d?F:void 0}),!ae&&B.length>0&&(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]}),c==="card-grid"&&(0,Rt.jsx)("div",{...O({className:"w-full focus-visible:outline-hidden"}),children:(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!0,className:H})}),c==="button"&&(0,Rt.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,Rt.jsx)("div",{className:"flex items-center gap-3",children:(0,Rt.jsx)(xr,{type:"button",size:m,color:ke?"error":v==="neutral"?"secondary":v,variant:x==="other"?"filled":x,radius:h,disabled:b||S||he!==void 0&&B.length>=he,onClick:se,leftIcon:(0,Rt.jsx)(Zt,{width:q.iconSize*.5,height:q.iconSize*.5}),"aria-label":"T\u1EA3i \u1EA3nh l\xEAn",children:E})}),B.length>0&&(0,Rt.jsx)(Go,{items:B,size:m,color:v,variant:x,radius:ge,objectFit:p,disabled:b,readOnly:S,maxCount:he,onRemove:me,onPreview:Re,onTriggerUpload:se,renderItem:N,showAddButton:!1,className:H})]})]}),(0,Rt.jsx)(Le,{id:F,helperText:d,errorMessage:ke?L:void 0,sizeClassName:q.helperSize,className:V}),ne&&(0,Rt.jsx)(Kr,{open:!!ne,onClose:()=>ue(null),file:ne})]})}var Fn=require("react"),ap=require("react-dropzone"),sp=require("@floating-ui/react");var Xf={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},qf={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"}},Zf={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"}},Jf={primary:"text-primary-500 group-hover/avatar:text-primary-600",secondary:"text-secondary-500 group-hover/avatar:text-secondary-600",neutral:"text-neutral-400 group-hover/avatar:text-neutral-600",error:"text-error-500 group-hover/avatar:text-error-600",success:"text-success-500 group-hover/avatar:text-success-600",warning:"text-warning-500 group-hover/avatar:text-warning-600",info:"text-info-500 group-hover/avatar:text-info-600"},Qf={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"},ep={primary:"ring-2 ring-primary-500/40 border-primary-500 bg-primary-50/80",secondary:"ring-2 ring-secondary-500/40 border-secondary-500 bg-secondary-50/80",neutral:"ring-2 ring-neutral-500/40 border-neutral-500 bg-neutral-50/80",error:"ring-2 ring-error-500/40 border-error-500 bg-error-50/80",success:"ring-2 ring-success-500/40 border-success-500 bg-success-50/80",warning:"ring-2 ring-warning-500/40 border-warning-500 bg-warning-50/80",info:"ring-2 ring-info-500/40 border-info-500 bg-info-50/80"};function tp(e){if(!e)return;if(typeof e=="object")return e;let t={},r=e.split(",").map(n=>n.trim()).filter(Boolean);for(let n of r)if(n.startsWith(".")){let o=n.toLowerCase();o===".jpg"||o===".jpeg"?t["image/jpeg"]=[...t["image/jpeg"]||[],o]:o===".png"?t["image/png"]=[...t["image/png"]||[],o]:o===".webp"?t["image/webp"]=[...t["image/webp"]||[],o]:o===".gif"?t["image/gif"]=[...t["image/gif"]||[],o]:o===".svg"?t["image/svg+xml"]=[...t["image/svg+xml"]||[],o]:t["application/octet-stream"]=[...t["application/octet-stream"]||[],o]}else t[n]||(t[n]=[]);return t}var tr=require("react"),ip=Hn(require("react-easy-crop"),1);function rp(e){return new Promise((t,r)=>{let n=new Image;n.addEventListener("load",()=>t(n)),n.addEventListener("error",o=>r(o)),n.setAttribute("crossOrigin","anonymous"),n.src=e})}function np(e){return e*Math.PI/180}function op(e,t,r){let n=np(r);return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}async function pd(e,t,r=0,n=!1,o="avatar-cropped.png",i="image/png"){let a=await rp(e),s=document.createElement("canvas"),l=s.getContext("2d");if(!l)throw new Error("No 2d context available on canvas");let f=np(r),c=a.naturalWidth||a.width,w=a.naturalHeight||a.height,{width:p,height:m}=op(c,w,r);s.width=p,s.height=m,l.translate(p/2,m/2),l.rotate(f),l.scale(n?-1:1,1),l.translate(-c/2,-w/2),l.drawImage(a,0,0);let v=document.createElement("canvas"),x=v.getContext("2d");if(!x)throw new Error("No 2d context for cropped canvas");return v.width=t.width,v.height=t.height,x.drawImage(s,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((h,k)=>{v.toBlob(T=>{if(!T){k(new Error("Canvas is empty or failed to generate blob"));return}let y=new File([T],o,{type:i||"image/png"});h(y)},i||"image/png",.95)})}var Ye=require("react/jsx-runtime");function Cc({imageSrc:e="",file:t,fileName:r="avatar-cropped.png",fileType:n="image/png",aspectRatio:o=1,cropShape:i="round",showGrid:a=!0,minZoom:s=1,maxZoom:l=4,onApply:f,onCancel:c}){let w=(0,tr.useRef)(null),[p,m]=(0,tr.useState)(t??null),[v,x]=(0,tr.useState)(e),h=(0,tr.useRef)(t?.name||r),k=(0,tr.useRef)(t?.type||n),[T,y]=(0,tr.useState)({x:0,y:0}),[d,u]=(0,tr.useState)(1),[g,b]=(0,tr.useState)(0),[S,R]=(0,tr.useState)(!1),D=(0,tr.useRef)(null),[P,I]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{if(!p)return;let B=URL.createObjectURL(p);return x(B),()=>{URL.revokeObjectURL(B)}},[p]);let E=()=>u(B=>Math.min(l,Math.round((B+.2)*10)/10)),N=()=>u(B=>Math.max(s,Math.round((B-.2)*10)/10)),M=()=>b(B=>(B+90)%360),z=()=>b(B=>(B-90+360)%360),H=()=>R(B=>!B),V=()=>{y({x:0,y:0}),u(1),b(0),R(!1)},Y=()=>{w.current&&(w.current.value="",w.current.click())},$=B=>{if(B.target.files&&B.target.files[0]){let X=B.target.files[0];h.current=X.name,k.current=X.type||"image/png",m(X),V()}},F=(B,X)=>{D.current=X},G=async()=>{if(D.current)try{I(!0);let B=await pd(v,D.current,g,S,h.current,k.current);f(B)}catch(B){console.error("Error cropping avatar:",B)}finally{I(!1)}},A=()=>{c?.()},j="p-1.5 rounded-full text-neutral-600 hover:text-neutral-900 hover:bg-neutral-200/70 transition-colors focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0";return(0,Ye.jsxs)("div",{className:"flex flex-col w-full select-none","data-testid":"upload-avatar-crop-modal",children:[(0,Ye.jsx)("input",{ref:w,type:"file",accept:"image/*","aria-hidden":"true",tabIndex:-1,className:"hidden",onChange:$}),(0,Ye.jsx)("div",{className:"relative w-full h-80 md:h-95 bg-neutral-950 overflow-hidden select-none",children:(0,Ye.jsx)(ip.default,{image:v,crop:T,zoom:d,rotation:g,aspect:o,cropShape:i,showGrid:a,minZoom:s,maxZoom:l,onCropChange:y,onZoomChange:u,onRotationChange:b,onCropComplete:F,classes:{mediaClassName:S?"scale-x-[-1]":""},style:{containerStyle:{position:"relative",width:"100%",height:"100%"}}})}),(0,Ye.jsx)("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:(0,Ye.jsxs)("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:[(0,Ye.jsx)("button",{type:"button",onClick:Y,"aria-label":"Ch\u1ECDn \u1EA3nh kh\xE1c",title:"Ch\u1ECDn \u1EA3nh kh\xE1c",className:`${j} text-neutral-700 hover:text-primary-600`,"data-testid":"avatar-crop-change-image-button",children:(0,Ye.jsx)(Zt,{width:16,height:16})}),(0,Ye.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ye.jsx)("button",{type:"button",onClick:N,disabled:d<=s,"aria-label":"Thu nh\u1ECF",title:"Thu nh\u1ECF (-)",className:j,children:(0,Ye.jsx)(Qo,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:E,disabled:d>=l,"aria-label":"Ph\xF3ng to",title:"Ph\xF3ng to (+)",className:j,children:(0,Ye.jsx)(Jo,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:z,title:"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay ng\u01B0\u1EE3c chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:j,children:(0,Ye.jsx)(ei,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:M,title:"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3","aria-label":"Xoay theo chi\u1EC1u kim \u0111\u1ED3ng h\u1ED3",className:j,children:(0,Ye.jsx)(Kn,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:H,title:"L\u1EADt ngang","aria-label":"L\u1EADt ngang",className:j,children:(0,Ye.jsx)(ti,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:V,title:"\u0110\u1EB7t l\u1EA1i","aria-label":"\u0110\u1EB7t l\u1EA1i",className:j,children:(0,Ye.jsx)(cr,{width:16,height:16})}),(0,Ye.jsx)("div",{className:"w-px h-3.5 bg-neutral-300 my-auto mx-0.5 shrink-0"}),(0,Ye.jsx)("button",{type:"button",onClick:A,"aria-label":"H\u1EE7y c\u1EAFt \u1EA3nh",title:"H\u1EE7y (Esc)",className:`${j} text-neutral-500 hover:text-error-600`,"data-testid":"avatar-crop-cancel-button",children:(0,Ye.jsx)(Ve,{width:16,height:16})}),(0,Ye.jsx)("button",{type:"button",onClick:G,disabled:P,"aria-label":"\xC1p d\u1EE5ng v\xE0 l\u01B0u \u1EA3nh \u0111\xE3 c\u1EAFt",title:"\xC1p d\u1EE5ng",className:"p-1.5 rounded-full bg-primary-600 hover:bg-primary-500 text-white shadow-xs transition-colors active:scale-95 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden shrink-0","data-testid":"avatar-crop-apply-button",children:P?(0,Ye.jsx)(De,{width:16,height:16}):(0,Ye.jsx)(Gn,{width:16,height:16})})]})})]})}function Vs({open:e=!0,modalTitle:t="C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:r,onCancel:n,onApply:o,...i}){let a=()=>{n?.(),r?.()};return(0,Ye.jsx)(Lo,{open:e,closeOnOverlayClick:!0,closeOnEsc:!0,onClose:a,children:(0,Ye.jsxs)($o,{size:"lg",radius:"xl",className:"bg-neutral-white border border-neutral-200 shadow-2xl overflow-hidden p-0",children:[(0,Ye.jsx)(Ho,{title:(0,Ye.jsx)("span",{className:"font-semibold text-neutral-900","data-testid":"avatar-crop-modal-title",children:t}),className:"px-5 py-3.5 border-b border-neutral-200",showCloseButton:!0}),(0,Ye.jsx)(Vo,{className:"p-0 overflow-hidden",children:(0,Ye.jsx)(Cc,{...i,onApply:l=>{o(l),r?.()},onCancel:a})})]})})}var bt=require("react/jsx-runtime");function kc({size:e="md",variant:t="outline",color:r="primary",shape:n="circle",radius:o,value:i,defaultValue:a,onChange:s,onRemove:l,onPreview:f,onClear:c,maxSize:w,accept:p="image/*",crop:m=!0,label:v,labelPlacement:x="top",config:h,helperText:k,errorMessage:T,disabled:y=!1,readOnly:d=!1,icon:u,name:g,id:b,className:S="",wrapperClassName:R="",avatarClassName:D="",avatarWrapperClassName:P="",labelClassName:I="",helperClassName:E="",ref:N}){let{isRequired:M=!1,isInvalid:z=!1,isLoading:H=!1,showSpinner:V=!1,isClearable:Y=!1,isFullWidth:$=!1}=h??{},F=(0,Fn.useId)(),G=b||F,A=`${G}-error-helper`,j=i!==void 0,[B,X]=(0,Fn.useState)(a??null),le=j?i??null:B,ne=Nn(le),ue=ne.name,[ie,Q]=(0,Fn.useState)(null),[q,ge]=(0,Fn.useState)(!1),[ke,L]=(0,Fn.useState)(null),[te,Z]=(0,Fn.useState)(""),he=T||ke,ae=!!(z||he),ve=ae?"error":r,Se=C(e,qf,"md"),ye=n==="circle"?"rounded-full":C(o,Xf,"md"),J=t==="other"?"":C(ve,C(t,Zf,"outline"),"primary"),O=C(ve,Jf,"primary"),W=ae?"text-error-600 font-bold":C(ve,Qf,"primary"),we=C(ve,ep,"primary"),fe=K=>{j||X(K),s?.(K)},se=m!==!1,me=typeof m=="object"?m:{},Re=K=>{Q({file:K.file,imageSrc:K.imageSrc,fileName:ue||"avatar.png",fileType:ne.type||"image/png"})},xe=K=>{if(K?.stopPropagation(),!(y||d||H)&&le){let _=le;fe(null),l?.(_),c?.(),Z("\u0110\xE3 x\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n.")}},re=K=>{K?.stopPropagation(),le&&(ge(!0),f?.(le))},de=K=>{K?.stopPropagation(),le&&(ne.file?Re({file:ne.file}):ne.serverFile?.src&&Re({imageSrc:ne.serverFile.src}))},{getRootProps:ce,getInputProps:ee,isDragActive:U,isDragReject:Ce,inputRef:$e}=(0,ap.useDropzone)({multiple:!1,maxSize:w,accept:(0,Fn.useMemo)(()=>tp(p),[p]),disabled:y||d||H,onDropAccepted:([K])=>{K&&(L(null),se?Re({file:K}):(fe(K),Z("T\u1EA3i \u1EA3nh \u0111\u1EA1i di\u1EC7n th\xE0nh c\xF4ng.")))},onDropRejected:K=>{let _=K[0]?.errors[0],ze=_?.code==="file-too-large"?`Dung l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n${w?` ${(w/(1024*1024)).toFixed(1)}MB`:""}.`:_?.code==="file-invalid-type"?"\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3.":_?.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7.";L(ze),Z(`L\u1ED7i t\u1EC7p: ${ze}`)}}),Ee=(0,sp.useMergeRefs)([$e,N]),oe=K=>{y||d||H||le&&(K.key==="Delete"||K.key==="Backspace")&&(K.preventDefault(),K.stopPropagation(),xe())},Te=()=>v?(0,bt.jsxs)("label",{htmlFor:G,className:`inline-flex items-center font-bold transition-colors duration-150 ${Se.label} ${W} ${I}`,children:[v,M&&(0,bt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}):null,Pe="group/avatar relative flex items-center justify-center transition-colors duration-150 ease-in-out border-2 overflow-hidden select-none",Qe=y?"opacity-50":"cursor-pointer",We=Ce?"ring-2 ring-error-500/40 border-error-500 bg-error-50/80":U?we:"",Be=[Pe,Se.avatarSize,ye,J,Qe,We,D||P].filter(Boolean).join(" ");return(0,bt.jsxs)("div",{className:`group/field flex ${x==="left"?"flex-row items-center gap-3":"flex-col"} ${$?"w-full":"inline-flex"} ${R||S}`,children:[(0,bt.jsx)("input",{...ee({id:G,name:g,disabled:y||H,"aria-hidden":!0,tabIndex:-1,className:"hidden"}),ref:Ee}),(0,bt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:te}),Te(),(0,bt.jsxs)("div",{className:`flex flex-col ${$?"w-full":""}`,children:[(0,bt.jsxs)("div",{...ce({role:"button",tabIndex:y||H?-1:0,"aria-label":"T\u1EA3i l\xEAn \u1EA3nh \u0111\u1EA1i di\u1EC7n","aria-disabled":y||H,"aria-invalid":ae,"aria-required":M,"aria-describedby":T||k||ke?A:void 0,"aria-busy":H,onKeyDown:oe,className:Be}),children:[le?(0,bt.jsx)(In,{src:le,alt:ue||"Avatar",fill:!0,radius:n==="circle"?"full":o,preview:!1,className:"object-cover",wrapperClassName:"w-full h-full"}):(0,bt.jsx)("div",{className:`flex flex-col items-center justify-center transition-colors ${O} ${Se.iconClass}`,children:u||(0,bt.jsx)(rs,{width:Se.iconSize,height:Se.iconSize})}),H&&V&&(0,bt.jsx)("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:(0,bt.jsx)(De,{width:Se.iconSize,height:Se.iconSize,className:"animate-spin"})}),!H&&!y&&le&&(0,bt.jsxs)("div",{className:"absolute inset-0 bg-neutral-950/20 opacity-0 group-hover/avatar:opacity-100 group-focus-visible/avatar:opacity-100 transition-opacity flex items-center justify-center gap-1.5 text-neutral-white z-10",children:[(0,bt.jsx)("button",{type:"button",onClick:re,"aria-label":"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"Xem tr\u01B0\u1EDBc",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-preview-button",children:(0,bt.jsx)(Vn,{width:14,height:14})}),se&&!d&&(0,bt.jsx)("button",{type:"button",onClick:de,"aria-label":"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"C\u1EAFt \u1EA3nh",className:"p-1 rounded-full text-neutral-white hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-neutral-white focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-crop-button",children:(0,bt.jsx)(ts,{width:14,height:14})}),(!d||Y)&&(0,bt.jsx)("button",{type:"button",onClick:xe,"aria-label":"X\xF3a \u1EA3nh \u0111\u1EA1i di\u1EC7n",title:"X\xF3a \u1EA3nh",className:"p-1 rounded-full text-error-300 hover:text-error-200 hover:bg-neutral-white/20 focus-visible:ring-2 focus-visible:ring-error-400 focus-visible:outline-hidden cursor-pointer","data-testid":"avatar-remove-button",children:(0,bt.jsx)(Br,{width:14,height:14})})]})]}),(0,bt.jsx)(Le,{id:A,helperText:k,errorMessage:he,sizeClassName:Se.helper,className:E}),se&&ie&&(0,bt.jsx)(Vs,{open:!!ie,file:ie.file,imageSrc:ie.imageSrc,fileName:ie.fileName,fileType:ie.fileType,aspectRatio:me.aspectRatio??1,cropShape:me.cropShape??(n==="circle"?"round":"rect"),showGrid:me.showGrid??!0,minZoom:me.minZoom??1,maxZoom:me.maxZoom??4,modalTitle:me.modalTitle||"C\u1EAFt \u1EA3nh \u0111\u1EA1i di\u1EC7n",onClose:()=>Q(null),onApply:K=>{fe(K),Z("\u1EA2nh \u0111\u1EA1i di\u1EC7n \u0111\xE3 \u0111\u01B0\u1EE3c c\u1EADp nh\u1EADt th\xE0nh c\xF4ng."),Q(null)}}),q&&le&&(0,bt.jsx)(Kr,{open:q,onClose:()=>ge(!1),file:le,title:ue||"Xem tr\u01B0\u1EDBc \u1EA3nh \u0111\u1EA1i di\u1EC7n",children:(0,bt.jsx)(Pn,{imageProps:{minZoom:.5,maxZoom:4,toolbarProps:{tools:{rotate:!0,flip:!0,download:!0}}}})})]})]})}var En=require("react"),cp=require("react-dropzone");var Ot=require("react/jsx-runtime");function Di({size:e="md",color:t="primary",variant:r="outline",radius:n,shape:o="rectangle",compact:i=!1,disabled:a=!1,readOnly:s=!1,isLoading:l=!1,showSpinner:f=!1,dragStatus:c="idle",isInvalid:w=!1,dropzoneTitle:p,dropzoneDescription:m,icon:v,onTriggerUpload:x,getRootProps:h,className:k="",describedById:T}){let y=C(e,Dn,"md"),d=C(n,mc,"md"),u=w?"error":t,g=r!=="other"?C(r,Ef,"outline"):null,b=g?C(u,g,"primary"):null,S="K\xE9o th\u1EA3 t\u1EC7p tin v\xE0o \u0111\xE2y, ho\u1EB7c nh\u1EA5n \u0111\u1EC3 duy\u1EC7t file",R="H\u1ED7 tr\u1EE3 t\xE0i li\u1EC7u PDF, Office, t\u1EC7p n\xE9n ZIP, media...",I=c==="reject"?"border-error-500 bg-error-50/50 ring-2 ring-error-500/20 text-error-900":c==="active"?b?.active||"border-primary-500 bg-primary-50 ring-2 ring-primary-500/20":b?.idle||"border-neutral-300 bg-neutral-50/50 hover:border-primary-500 hover:bg-primary-50/30",E=H=>{a||l||s||(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),x?.())};if(i){let H=`group relative w-full ${y.compactMinHeight} ${y.compactPadding} ${d} border-2 border-dashed flex items-center justify-between gap-3 text-left transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,V={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c t\u1EA3i t\u1EC7p l\xEAn thu g\u1ECDn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:H,onKeyDown:E},Y=h?h(V):V;return(0,Ot.jsxs)("div",{...Y,children:[(0,Ot.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[(0,Ot.jsx)("div",{className:`transition-colors shrink-0 ${b?.iconColor||"text-primary-500"}`,children:l&&f?(0,Ot.jsx)(De,{width:18,height:18,className:"animate-spin text-primary-600"}):v||(0,Ot.jsx)(Zt,{width:18,height:18})}),(0,Ot.jsx)("span",{className:`truncate text-neutral-700 font-medium ${y.descSize}`,children:p||"K\xE9o th\u1EA3 ho\u1EB7c nh\u1EA5n \u0111\u1EC3 t\u1EA3i t\u1EC7p l\xEAn"})]}),(0,Ot.jsx)("span",{className:`shrink-0 text-primary-600 group-hover:text-primary-700 font-semibold ${y.descSize}`,children:"Ch\u1ECDn file"})]})}let N=`group relative w-full ${o==="square"?"aspect-square w-full":C(e,Ff,"md")} ${y.dropzonePadding} ${d} border-2 border-dashed flex flex-col items-center justify-center text-center transition-colors duration-150 ease-in-out cursor-pointer select-none ${I} ${a||s?"opacity-50 cursor-not-allowed pointer-events-none bg-neutral-100":""} focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${k}`,M={role:"button",tabIndex:a||s?-1:0,"aria-label":"Khu v\u1EF1c k\xE9o th\u1EA3 v\xE0 t\u1EA3i t\u1EC7p tin l\xEAn","aria-disabled":a||s,"aria-invalid":w,"aria-describedby":T,"aria-busy":l,className:N,onKeyDown:E},z=h?h(M):M;return(0,Ot.jsx)("div",{...z,children:l&&f?(0,Ot.jsxs)("div",{className:`flex flex-col items-center justify-center gap-2 ${b?.iconColor||"text-primary-600"}`,children:[(0,Ot.jsx)(De,{width:y.iconSize*.8,height:y.iconSize*.8}),(0,Ot.jsx)("span",{className:`${y.titleSize} font-medium`,children:"\u0110ang x\u1EED l\xFD t\u1EC7p tin..."})]}):(0,Ot.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2",children:[(0,Ot.jsx)("div",{className:`transition-colors ${b?.iconColor||"text-primary-500"}`,children:v||(0,Ot.jsx)(Zt,{width:y.iconSize,height:y.iconSize})}),(0,Ot.jsx)("div",{className:`${y.titleSize} font-medium text-neutral-800 ${b?.titleHover||"group-hover:text-primary-600"} transition-colors`,children:l?"\u0110ang x\u1EED l\xFD t\u1EC7p tin...":p??S}),(0,Ot.jsx)("div",{id:T,className:`${y.descSize} text-neutral-500`,children:m??R})]})})}var lp=require("react");var so=require("react/jsx-runtime");function Ni({file:e,fileName:t,category:r,size:n="md",className:o=""}){let i=(0,lp.useMemo)(()=>{if(r)return r;let f=t||(e?Tt(e):"");return $s(e||f)},[r,e,t]),a=C(i,Lf,"other"),s=typeof n=="number"?n:C(n,Dn,"md").fileIconSize,l=Math.max(8,Math.round(s*.22));return(0,so.jsxs)("div",{role:"img","aria-label":`Bi\u1EC3u t\u01B0\u1EE3ng \u0111\u1ECBnh d\u1EA1ng t\u1EC7p ${a.label}`,style:{width:s,height:s},className:`relative inline-flex items-center justify-center shrink-0 select-none ${o}`,children:[(0,so.jsxs)("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-full drop-shadow-xs transition-transform",children:[(0,so.jsx)("path",{d:"M8 5C8 3.9 8.9 3 10 3H26L34 11V35C34 36.1 33.1 37 32 37H10C8.9 37 8 36.1 8 35V5Z",className:"fill-neutral-50 stroke-neutral-300 transition-colors",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,so.jsx)("path",{d:"M26 3V10C26 10.55 26.45 11 27 11H34",className:"fill-neutral-200 stroke-neutral-300",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,so.jsx)("line",{x1:"13",y1:"15",x2:"23",y2:"15",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"}),(0,so.jsx)("line",{x1:"13",y1:"19",x2:"27",y2:"19",className:"stroke-neutral-300",strokeWidth:"1.5",strokeLinecap:"round"})]}),(0,so.jsx)("div",{style:{fontSize:`${l}px`},className:`absolute bottom-1 right-0.5 px-1 py-0.2 rounded font-bold tracking-tight border shadow-2xs leading-none uppercase ${a.bg} ${a.text} ${a.border}`,children:a.label})]})}var Ie=require("react/jsx-runtime");function Ia({item:e,index:t,listType:r="list",size:n="md",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v,className:x=""}){let h=C(n,Dn,"md"),k=C(o,mc,"md"),T=Tt(e),y=cd(e),{status:d,progress:u,error:g}=ud(e),b=d==="uploading",S=d==="error",R=()=>{i||a||c?.(e,t)},D=()=>{i||w?.(e)},P=()=>{i||p?.(e)},I=()=>{i||a||m?.(e,t)};if(v)return(0,Ie.jsx)("li",{"data-testid":"upload-file-item",className:"list-none w-full",children:v(e,t,{remove:R,preview:D,download:P})});let E=N=>{i||(N.key==="Delete"||N.key==="Backspace")&&!a&&(N.preventDefault(),R())};return r==="grid"?(0,Ie.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col justify-between p-3 ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:shadow-xs transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${x}`,children:[(0,Ie.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,Ie.jsx)(Ni,{file:e,size:n}),(0,Ie.jsxs)("div",{className:"flex-1 min-w-0",children:[w&&!i?(0,Ie.jsx)("button",{type:"button",title:T,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${h.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs block w-full`,children:T}):(0,Ie.jsx)("p",{title:T,className:`truncate font-medium text-neutral-800 ${h.fileNameSize}`,children:T}),(0,Ie.jsx)("p",{className:`text-neutral-500 ${h.fileMetaSize}`,children:S?(0,Ie.jsx)("span",{className:"text-error-600 font-medium truncate block",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):b?(0,Ie.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Ie.jsx)(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i... ",u!==void 0?`${u}%`:""]}):y!==void 0?un(y):null})]})]}),b&&u!==void 0&&(0,Ie.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1.5 mt-2 overflow-hidden",children:(0,Ie.jsx)("div",{className:"bg-primary-500 h-1.5 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})}),(0,Ie.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-2.5 pt-2 border-t border-neutral-100",children:[S&&m&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(cr,{width:14,height:14})}),s&&w&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Vn,{width:14,height:14})}),l&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Qr,{width:14,height:14})}),f&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Br,{width:14,height:14})})]})]}):(0,Ie.jsxs)("li",{"data-testid":"upload-file-item",tabIndex:i?-1:0,onKeyDown:E,"aria-label":`T\u1EC7p tin ${T}`,className:`group relative list-none flex flex-col w-full ${h.itemPadding} ${k} border border-neutral-200 bg-white hover:border-primary-300 hover:bg-neutral-50/50 transition-colors duration-150 ease-in-out focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:outline-hidden ${i?"opacity-50 pointer-events-none bg-neutral-50":""} ${S?"border-error-300 bg-error-50/20":""} ${x}`,children:[(0,Ie.jsxs)("div",{className:"flex items-center justify-between gap-3 w-full",children:[(0,Ie.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,Ie.jsx)(Ni,{file:e,size:n}),(0,Ie.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,Ie.jsx)("div",{className:"flex items-center gap-2",children:w&&!i?(0,Ie.jsx)("button",{type:"button",title:T,onClick:D,className:`truncate text-left font-medium text-neutral-800 ${h.fileNameSize} hover:text-primary-600 hover:underline cursor-pointer focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary-500 rounded-xs`,children:T}):(0,Ie.jsx)("span",{title:T,className:`truncate font-medium text-neutral-800 ${h.fileNameSize}`,children:T})}),(0,Ie.jsx)("div",{className:`flex items-center gap-2 text-neutral-500 ${h.fileMetaSize}`,children:S?(0,Ie.jsx)("span",{className:"text-error-600 font-medium truncate",children:g||"L\u1ED7i t\u1EA3i l\xEAn"}):b?(0,Ie.jsxs)("span",{className:"text-primary-600 flex items-center gap-1 font-medium",children:[(0,Ie.jsx)(De,{width:12,height:12,className:"animate-spin inline"}),"\u0110ang t\u1EA3i l\xEAn... ",u!==void 0?`${u}%`:""]}):y!==void 0?(0,Ie.jsx)("span",{children:un(y)}):null})]})]}),(0,Ie.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[S&&m&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:I,"aria-label":`Th\u1EED l\u1EA1i t\u1EA3i l\xEAn ${T}`,title:"Th\u1EED l\u1EA1i",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(cr,{width:15,height:15})}),s&&w&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:D,"aria-label":`Xem tr\u01B0\u1EDBc t\u1EC7p ${T}`,title:"Xem tr\u01B0\u1EDBc",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Vn,{width:15,height:15})}),l&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:P,"aria-label":`T\u1EA3i xu\u1ED1ng t\u1EC7p ${T}`,title:"T\u1EA3i xu\u1ED1ng",className:`text-neutral-500 hover:text-primary-600 hover:bg-primary-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Qr,{width:15,height:15})}),f&&!a&&(0,Ie.jsx)("button",{type:"button",disabled:i,onClick:R,"aria-label":`X\xF3a t\u1EC7p ${T}`,title:"X\xF3a t\u1EC7p",className:`text-neutral-400 hover:text-error-600 hover:bg-error-50 ${h.actionButtonPadding} rounded-md transition-colors cursor-pointer`,children:(0,Ie.jsx)(Br,{width:15,height:15})})]})]}),b&&u!==void 0&&(0,Ie.jsx)("div",{className:"w-full bg-neutral-100 rounded-full h-1 mt-2 overflow-hidden",children:(0,Ie.jsx)("div",{className:"bg-primary-500 h-1 rounded-full transition-[width] duration-300 ease-out",style:{width:`${Math.min(100,Math.max(0,u))}%`}})})]})}var gd=require("react/jsx-runtime");function Ma({items:e,listType:t="list",size:r="md",color:n="primary",radius:o,disabled:i=!1,readOnly:a=!1,showPreviewButton:s=!0,showDownloadButton:l=!0,showRemoveButton:f=!0,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v,className:x=""}){let h=C(r,Dn,"md"),k=t==="grid"?`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 ${h.gap} list-none p-0 m-0 ${x}`:`flex flex-col ${h.gap} list-none p-0 m-0 ${x}`;return!e||e.length===0?null:(0,gd.jsx)("ul",{"aria-label":"Danh s\xE1ch t\u1EC7p tin \u0111\xE3 t\u1EA3i l\xEAn",className:k,children:e.map((T,y)=>{let d=Bf(T,y);return(0,gd.jsx)(Ia,{item:T,index:y,listType:t,size:r,radius:o,color:n,disabled:i,readOnly:a,showPreviewButton:s,showDownloadButton:l,showRemoveButton:f,onRemove:c,onPreview:w,onDownload:p,onRetry:m,renderItem:v},d)})})}var Kt=require("react/jsx-runtime");function Sc({value:e,defaultValue:t,onChange:r,onRemove:n,onPreview:o,onDownload:i,onRetry:a,maxCount:s,maxSize:l,minSize:f,accept:c,beforeUpload:w,viewMode:p="dropzone",listType:m="list",shape:v="rectangle",size:x="md",color:h="primary",variant:k="outline",radius:T,label:y,labelClassName:d="",helperText:u,errorMessage:g,disabled:b=!1,readOnly:S=!1,dropzoneTitle:R,dropzoneDescription:D,buttonText:P="T\u1EA3i t\u1EC7p l\xEAn",icon:I,renderItem:E,className:N="",dropzoneClassName:M="",listClassName:z="",previewClassName:H="",helperClassName:V="",config:Y}){let{isRequired:$=!1,isInvalid:F=!1,isLoading:G=!1,showSpinner:A=!1,multiple:j=!1,showFileList:B=!0,showPreviewButton:X=!0,showDownloadButton:le=!0,showRemoveButton:ne=!0}=Y??{},ue=(0,En.useId)(),ie=`${ue}-input`,Q=`${ue}-error-helper`,q=e!==void 0,[ge,ke]=(0,En.useState)(()=>ki(t)),L=(0,En.useMemo)(()=>q?ki(e):ge,[q,e,ge]),[te,Z]=(0,En.useState)(null),[he,ae]=(0,En.useState)(null),[ve,Se]=(0,En.useState)(""),ye=C(x,Dn,"md"),J=T??"md",O=!!(F||g||te),W=g||te,fe=O?"text-error-600":C(O?"error":h,Mf,"primary"),se=s??(j?void 0:1),me=oe=>{q||ke(oe),r?.(oe)},Re=(0,En.useMemo)(()=>Ls(c),[c]),{getRootProps:xe,getInputProps:re,isDragActive:de,isDragReject:ce,open:ee}=(0,cp.useDropzone)({multiple:j,maxSize:l,minSize:f,accept:Re,disabled:b||S||G,noClick:p==="button",noKeyboard:p==="button",onDropAccepted:async oe=>{if(b||S||(Z(null),oe.length===0))return;let Te=oe,Pe=L.length;if(se!==void 0)if(j){let Be=se-Pe;if(Be<=0){let Oe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p \u0111\xE3 \u0111\u1EA1t t\u1ED1i \u0111a (${se} t\u1EC7p)`;Z(Oe),Se(Oe);return}Te=oe.slice(0,Be)}else{let Be=oe[0];if(!Be)return;Te=[Be]}let Qe=await Promise.all(Te.map(async Be=>{if(w)try{let Oe=await w(Be);if(Oe===!1||typeof Oe=="string")return{file:null,error:typeof Oe=="string"?Oe:`T\u1EC7p ${Be.name} \u0111\xE3 b\u1ECB t\u1EEB ch\u1ED1i`}}catch(Oe){return{file:null,error:Oe instanceof Error?Oe.message:`Kh\xF4ng th\u1EC3 x\u1EED l\xFD t\u1EC7p ${Be.name}`}}return{file:Be,error:null}})),We=[];for(let Be of Qe)Be.error?(Z(Be.error),Se(`L\u1ED7i: ${Be.error}`)):Be.file&&We.push(Be.file);if(We.length>0){let Be=j?[...L,...We]:We;me(Be),Se(`\u0110\xE3 th\xEAm ${We.length} t\u1EC7p tin. T\u1ED5ng c\u1ED9ng: ${Be.length} t\u1EC7p.`)}},onDropRejected:oe=>{let Te=oe[0]?.errors[0];if(!Te)return;let Pe=Te.message||"T\u1EC7p kh\xF4ng h\u1EE3p l\u1EC7";Te.code==="file-too-large"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${un(l||0)})`:Te.code==="file-too-small"?Pe=`K\xEDch th\u01B0\u1EDBc t\u1EC7p nh\u1ECF h\u01A1n gi\u1EDBi h\u1EA1n t\u1ED1i thi\u1EC3u (${un(f||0)})`:Te.code==="file-invalid-type"?Pe=`\u0110\u1ECBnh d\u1EA1ng t\u1EC7p kh\xF4ng \u0111\u01B0\u1EE3c h\u1ED7 tr\u1EE3. C\xE1c \u0111\u1ECBnh d\u1EA1ng cho ph\xE9p: ${typeof c=="string"?c:Object.keys(c||{}).join(", ")}`:Te.code==="too-many-files"&&(Pe=`S\u1ED1 l\u01B0\u1EE3ng t\u1EC7p v\u01B0\u1EE3t qu\xE1 gi\u1EDBi h\u1EA1n cho ph\xE9p (${se} t\u1EC7p)`),Z(Pe),Se(`L\u1ED7i t\u1EC7p: ${Pe}`)}}),U=(oe,Te)=>{if(b||S)return;let Pe=L.filter((Qe,We)=>We!==Te);me(Pe),n?.(oe,Te),Se(`\u0110\xE3 x\xF3a t\u1EC7p tin ${Tt(oe)}`)},Ce=oe=>{ae(oe),o?.(oe)},$e=oe=>{i?.(oe);let Te=Tt(oe);if(oe instanceof File){let Pe=URL.createObjectURL(oe);dn(Pe,oe.name),setTimeout(()=>URL.revokeObjectURL(Pe),1e3);return}if(typeof oe=="string"){dn(oe,Te);return}typeof oe=="object"&&oe&&typeof oe.src=="string"&&dn(oe.src,oe.name||Te)},Ee=H||z;return(0,Kt.jsxs)("div",{className:`group/field relative flex flex-col w-full ${N}`,children:[(0,Kt.jsx)("input",{...re({id:ie,disabled:b||G,"aria-hidden":!0,tabIndex:-1,className:"hidden"})}),(0,Kt.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:ve}),y&&(0,Kt.jsxs)("label",{htmlFor:ie,className:`block font-medium transition-colors duration-150 ${ye.labelSize} ${fe} ${d}`,children:[y,$&&(0,Kt.jsx)("span",{className:"text-error-500 ml-0.5","aria-hidden":"true",children:"*"})]}),(0,Kt.jsxs)("div",{className:"flex flex-col gap-3",children:[p==="dropzone"&&(0,Kt.jsx)(Di,{size:x,color:h,variant:k,radius:J,shape:v,disabled:b,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||u?Q:void 0}),p==="compact"&&(0,Kt.jsx)(Di,{size:x,color:h,variant:k,radius:J,compact:!0,disabled:b,readOnly:S,isLoading:G,showSpinner:A,dragStatus:ce?"reject":de?"active":"idle",isInvalid:O,dropzoneTitle:R,dropzoneDescription:D,icon:I,onTriggerUpload:ee,getRootProps:xe,className:M,describedById:W||u?Q:void 0}),p==="button"&&(0,Kt.jsx)("div",{className:"flex items-center gap-3",children:(0,Kt.jsx)(xr,{type:"button",size:ye.buttonSize,color:O?"error":h==="neutral"?"secondary":h,variant:k==="other"?"filled":k,radius:T,disabled:b||S||G||se!==void 0&&L.length>=se,isLoading:G,showSpinner:A,onClick:ee,leftIcon:(0,Kt.jsx)(Zt,{width:ye.iconSize*.5,height:ye.iconSize*.5}),"aria-label":"T\u1EA3i t\u1EC7p l\xEAn",children:P})}),B&&L.length>0&&(0,Kt.jsx)(Ma,{items:L,listType:m,size:x,color:h,variant:k,radius:J,disabled:b,readOnly:S,maxCount:se,showPreviewButton:X,showDownloadButton:le,showRemoveButton:ne,onRemove:U,onPreview:Ce,onDownload:$e,onRetry:a,renderItem:E,className:Ee})]}),(0,Kt.jsx)(Le,{id:Q,helperText:u,errorMessage:O?W:void 0,sizeClassName:ye.helperSize,className:V}),he&&(0,Kt.jsx)(Kr,{open:!!he,onClose:()=>ae(null),file:he})]})}var up=300,jo={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"}},dp={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-2xl"},fp={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"},pp={warning:Xo,error:qo,success:_o,info:Dr,primary:Dr,secondary:Dr,neutral:Dr};var Tc=require("react"),md=(0,Tc.createContext)(null),Er=()=>(0,Tc.useContext)(md);var gp=require("react/jsx-runtime");function Rc({size:e,radius:t,className:r="",children:n,ref:o,...i}){let a=Er(),s=C(e??a?.size,jo,"md"),l=C(t,dp,"lg"),f=["relative flex flex-col w-full bg-neutral-white shadow-2xl border-2 border-neutral-200 outline-none text-neutral-900 pointer-events-auto",s.dialog,l,r].filter(Boolean).join(" ");return(0,gp.jsx)("div",{ref:o,tabIndex:-1,className:f,...i,children:n})}var _t=require("react");var Fa=require("react/jsx-runtime");function Dc({open:e=!1,size:t="md",color:r="warning",isLoading:n=!1,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,lockScroll:a=!0,overlayClassName:s="",className:l="",children:f,onClose:c,...w}){let p=(0,_t.useRef)(null),[m,v]=(0,_t.useState)(!1),x=(0,_t.useRef)(null),h=(0,_t.useCallback)(()=>{m||n||(v(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v(!1),c?.()},up))},[m,n,c]),k=(0,_t.useMemo)(()=>({onClose:h,isLoading:n,size:t,color:r}),[h,n,t,r]);(0,_t.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]),(0,_t.useEffect)(()=>{let g=p.current;if(g)if(e||m){if(!g.open)try{g.showModal()}catch{}}else g.open&&g.close()},[e,m]),(0,_t.useEffect)(()=>{if(!a)return;let g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=g}},[a]);let T=(0,_t.useEffectEvent)(g=>{!e||i===!1||g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),h())});if((0,_t.useEffect)(()=>(window.addEventListener("keydown",T),()=>{window.removeEventListener("keydown",T)}),[]),!e&&!m)return null;let y=()=>{o&&h()},d=m?"animate-confirm-backdrop-out pointer-events-none":"animate-confirm-backdrop-in",u=m?"animate-confirm-out pointer-events-none":"animate-confirm-in";return(0,Fa.jsx)(md.Provider,{value:k,children:(0,Fa.jsxs)("dialog",{ref:p,"aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-description",onCancel:g=>{g.preventDefault(),i!==!1&&h()},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 ${d} ${s}`,...w,children:[(0,Fa.jsx)("div",{"aria-hidden":"true",onClick:y,className:"fixed inset-0 -z-10"}),(0,Fa.jsx)("div",{className:`w-full flex items-center justify-center pointer-events-none ${u} ${l}`,children:f})]})})}var $n=require("react/jsx-runtime");function Nc({size:e,color:t,icon:r=!0,title:n,iconClassName:o="",titleClassName:i="",showCloseButton:a=!1,onClose:s,closeButtonClassName:l="",className:f="",children:c,...w}){let p=Er(),m=C(e??p?.size,jo,"md"),v=C(t??p?.color,fp,"warning"),x=p?.isLoading,h=()=>{s?.(),p?.onClose?.()},k=!!(s||p?.onClose),T=()=>{if(r===!1)return null;if(r!==void 0&&r!==!0)return(0,$n.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${v} ${o}`,"aria-hidden":"true",children:r});let y=C(t??p?.color,pp,"warning");return(0,$n.jsx)("div",{className:`inline-flex items-center justify-center shrink-0 ${m.iconWrapper} ${v} ${o}`,"aria-hidden":"true",children:(0,$n.jsx)(y,{className:m.icon})})};return(0,$n.jsxs)("div",{className:`flex items-start justify-between w-full ${m.header} ${f}`,...w,children:[(0,$n.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[T(),n&&(0,$n.jsx)("h3",{className:`${m.title} truncate ${i}`,id:"confirm-dialog-title",children:n}),c]}),a&&k&&(0,$n.jsx)("button",{type:"button",onClick:h,disabled:x,"aria-label":"\u0110\xF3ng h\u1ED9p tho\u1EA1i",className:`inline-flex items-center justify-center shrink-0 text-neutral-400 hover:text-neutral-700 hover:bg-neutral-100 rounded-md transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-neutral-400 ${m.closeButton} ${l}`,children:(0,$n.jsx)(Ve,{className:m.closeIcon})})]})}var zc=require("react/jsx-runtime");function Pc({size:e,description:t,descriptionClassName:r="",className:n="",children:o,...i}){let a=Er(),s=C(e??a?.size,jo,"md");return(0,zc.jsxs)("div",{className:`w-full ${s.body} ${n}`,id:"confirm-dialog-description",...i,children:[t?(0,zc.jsx)("p",{className:`${s.description} ${r}`,children:t}):null,o]})}var Ea=require("react/jsx-runtime");function Ic({size:e,confirmText:t="X\xE1c nh\u1EADn",cancelText:r="H\u1EE7y",confirmVariant:n="filled",cancelVariant:o="outline",confirmColor:i,cancelColor:a="secondary",onConfirm:s,onCancel:l,onClose:f,confirmButtonProps:c,cancelButtonProps:w,className:p="",children:m,...v}){let x=Er(),h=C(e??x?.size,jo,"md"),k=i??x?.color??"warning",T=()=>{f?.(),x?.onClose?.()},y=async()=>{try{let u=s?.();u&&"then"in u&&await u,T()}catch{}},d=()=>{l?.(),T()};return m?(0,Ea.jsx)("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${p}`,...v,children:m}):(0,Ea.jsxs)("div",{className:`flex items-center justify-end w-full ${h.footer} ${h.buttonGap} ${p}`,...v,children:[r!==!1&&(0,Ea.jsx)(xr,{size:h.buttonSize,variant:o,color:a,onClick:d,disabled:w?.disabled||x?.isLoading,...w,children:r}),(0,Ea.jsx)(xr,{size:h.buttonSize,variant:n,color:k,isLoading:x?.isLoading||c?.isLoading,disabled:c?.disabled,onClick:y,...c,children:t})]})}var Mc=require("react");var mp=require("react/jsx-runtime");function Fc({children:e,asChild:t=!0,onClick:r,...n}){let o=Er(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&(0,Mc.isValidElement)(e)){let s=e;return(0,Mc.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return(0,mp.jsx)("button",{type:"button",onClick:a,disabled:i,...n,children:e})}var bp=require("react/jsx-runtime");function Ec({size:e,className:t="",children:r,...n}){let o=Fr(),i=C(e??o?.size,Eo,"md");return(0,bp.jsx)("div",{className:`flex items-center justify-end w-full border-t border-neutral-100 pt-2 ${i.footer} ${i.buttonGap} ${t}`,...n,children:r})}var $c=require("react");var hp=require("react/jsx-runtime");function Lc({children:e,asChild:t=!0,onClick:r,...n}){let o=Fr(),i=o?.isLoading,a=s=>{r?.(s),s.defaultPrevented||o?.onClose?.()};if(t&&(0,$c.isValidElement)(e)){let s=e;return(0,$c.cloneElement)(s,{disabled:s.props.disabled||i,onClick:l=>{s.props.onClick?.(l),a(l)},...n})}return(0,hp.jsx)("button",{type:"button",onClick:a,disabled:i,...n,children:e})}var $a=require("react");var Bc={sm:{head:"px-3 py-2 text-xs font-semibold",cell:"px-3 py-2 text-xs",text:"text-xs",icon:"w-3.5 h-3.5"},md:{head:"px-4 py-3 text-sm font-semibold",cell:"px-4 py-3 text-sm",text:"text-sm",icon:"w-4 h-4"},lg:{head:"px-5 py-4 text-base font-semibold",cell:"px-5 py-4 text-base",text:"text-base",icon:"w-5 h-5"}},Hc={default:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-50/80 border-b border-neutral-200 text-neutral-600",row:"border-b border-neutral-200/80 hover:bg-neutral-50/50 transition-colors",cell:"text-neutral-700"},striped:{container:"border border-neutral-200 shadow-xs",table:"border-collapse",head:"bg-neutral-100/80 border-b border-neutral-200 text-neutral-700",row:"border-b border-neutral-200/80 even:bg-neutral-50/60 hover:bg-neutral-100/40 transition-colors",cell:"text-neutral-700"},bordered:{container:"border border-neutral-200 shadow-xs",table:"border-collapse border border-neutral-200",head:"bg-neutral-50 border border-neutral-200 text-neutral-700",row:"border-b border-neutral-200 hover:bg-neutral-50/50 transition-colors",cell:"border border-neutral-200 text-neutral-700"}},Vc={left:"text-left justify-start",center:"text-center justify-center",right:"text-right justify-end"},As=[10,20,50,100],Os=10;var pn=require("react/jsx-runtime"),xp=(0,$a.createContext)({size:"md",variantStyles:Hc.default}),Pi=()=>(0,$a.useContext)(xp);function Gs({variant:e="default",size:t="md",className:r="",containerClassName:n="",wrapperProps:o,children:i,ref:a,...s}){let l=C(e,Hc,"default"),f=(0,$a.useMemo)(()=>({size:t,variantStyles:l}),[t,l]);return(0,pn.jsx)(xp.Provider,{value:f,children:(0,pn.jsx)("div",{className:`w-full overflow-x-auto rounded-lg ${l.container} ${n}`.trim(),...o,children:(0,pn.jsx)("table",{ref:a,className:`w-full text-left caption-bottom ${l.table} ${r}`.trim(),...s,children:i})})})}function js({className:e="",children:t,ref:r,...n}){let{variantStyles:o}=Pi();return(0,pn.jsx)("thead",{ref:r,className:`${o.head} ${e}`.trim(),...n,children:t})}function Us({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("tbody",{ref:r,className:`divide-y divide-neutral-200/70 ${e}`.trim(),...n,children:t})}function bd({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("tfoot",{ref:r,className:`border-t border-neutral-200 bg-neutral-50/60 font-medium text-neutral-600 ${e}`.trim(),...n,children:t})}function Uo({isSelected:e=!1,isHoverable:t=!0,className:r="",children:n,ref:o,...i}){let{variantStyles:a}=Pi(),s=e?"bg-primary-50/70 hover:bg-primary-50 text-primary-950 font-medium":"",l=t&&!e?a.row:"";return(0,pn.jsx)("tr",{ref:o,"data-state":e?"selected":void 0,"aria-selected":e,className:`${l} ${s} ${r}`.trim(),...i,children:n})}function lo({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i}=Pi(),a=C(i,Bc,"md"),s=C(e,Vc,"left");return(0,pn.jsx)("th",{ref:n,className:`tracking-wider ${a.head} ${s} ${t}`.trim(),...o,children:r})}function zi({align:e="left",className:t="",children:r,ref:n,...o}){let{size:i,variantStyles:a}=Pi(),s=C(i,Bc,"md"),l=C(e,Vc,"left");return(0,pn.jsx)("td",{ref:n,className:`align-middle ${s.cell} ${a.cell} ${l} ${t}`.trim(),...o,children:r})}function hd({className:e="",children:t,ref:r,...n}){return(0,pn.jsx)("caption",{ref:r,className:`mt-3 text-xs text-neutral-500 ${e}`.trim(),...n,children:t})}var Ln=require("react/jsx-runtime");function Ii({column:e,title:t,className:r="",...n}){if(!e.getCanSort())return(0,Ln.jsx)("div",{className:`font-semibold ${r}`.trim(),...n,children:t});let o=e.getIsSorted(),i=a=>{a.preventDefault();let s=e.getToggleSortingHandler();s&&s(a)};return(0,Ln.jsx)("div",{className:`flex items-center space-x-1.5 ${r}`.trim(),...n,children:(0,Ln.jsxs)("button",{type:"button",onClick:i,className:"group inline-flex items-center gap-1.5 font-semibold text-inherit hover:text-neutral-900 transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 rounded px-1 py-0.5 -mx-1",children:[(0,Ln.jsx)("span",{children:t}),(0,Ln.jsx)("span",{className:"shrink-0 inline-flex items-center justify-center","aria-hidden":"true",children:o==="asc"?(0,Ln.jsx)(as,{className:"w-3.5 h-3.5 text-primary-600"}):o==="desc"?(0,Ln.jsx)(ls,{className:"w-3.5 h-3.5 text-primary-600"}):(0,Ln.jsx)(os,{className:"w-3.5 h-3.5 text-neutral-400 opacity-60 group-hover:opacity-100 transition-opacity"})})]})})}var vp=require("@dnd-kit/sortable"),yp=require("@dnd-kit/utilities");var xd=require("react/jsx-runtime");function vd({header:e,canSort:t=!1,headerContent:r,ariaSort:n,disabled:o=!1,className:i=""}){let a=e.column.id==="_select",s=o||a,{attributes:l,listeners:f,setNodeRef:c,transform:w,transition:p,isDragging:m}=(0,vp.useSortable)({id:e.column.id,disabled:s}),v={transform:yp.CSS.Translate.toString(w),transition:p,opacity:m?.75:1,position:m?"relative":void 0,zIndex:m?20:void 0,whiteSpace:"nowrap"},x=t&&typeof e.column.columnDef.header=="string"?(0,xd.jsx)(Ii,{column:e.column,title:e.column.columnDef.header}):r;return(0,xd.jsx)(lo,{ref:c,style:v,"aria-sort":n,"data-column-id":e.column.id,...s?{}:l,...s?{}:f,className:`
|
|
3
|
+
${s?"":"select-none cursor-grab active:cursor-grabbing transition-colors"}
|
|
4
|
+
${m?"bg-neutral-100 shadow-md ring-1 ring-primary-500/30":""}
|
|
5
|
+
${i}
|
|
6
|
+
`.trim(),children:x})}var yd=require("react");var Lt=require("react/jsx-runtime");function ug(e,t){return t<=7?Array.from({length:t},(r,n)=>n+1):e<=4?[1,2,3,4,5,"...",t]:e>=t-3?[1,"...",t-4,t-3,t-2,t-1,t]:[1,"...",e-1,e,e+1,"...",t]}function Ys({table:e,pageSizeOptions:t=As,showPageSizeSelector:r=!0,className:n=""}){let o=e.state.pagination,i=o?.pageIndex??0,a=o?.pageSize??10,s=e.getPageCount(),l=Math.max(s,1),f=i+1,c=e.getCanPreviousPage(),w=e.getCanNextPage(),p=(0,yd.useMemo)(()=>t.map(v=>({label:`${v}`,value:v})),[t]),m=(0,yd.useMemo)(()=>ug(f,l),[f,l]);return(0,Lt.jsxs)("div",{className:`flex flex-col sm:flex-row items-center justify-between gap-4 px-2 py-3 text-xs text-neutral-600 ${n}`.trim(),children:[r?(0,Lt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Lt.jsx)("span",{className:"whitespace-nowrap",children:"S\u1ED1 d\xF2ng/trang:"}),(0,Lt.jsx)("div",{className:"w-20","data-testid":"table-page-size-selector",children:(0,Lt.jsx)(Sa,{size:"sm",options:p,value:a,onChange:v=>{v!=null&&e.setPageSize(Number(v))},searchable:!1,clearable:!1,"aria-label":"S\u1ED1 d\xF2ng m\u1ED7i trang"})})]}):(0,Lt.jsx)("div",{}),(0,Lt.jsxs)("div",{className:"flex items-center gap-1 ml-auto sm:ml-0",children:[(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Un,{className:"w-3.5 h-3.5"}),"aria-label":"Trang \u0111\u1EA7u",size:"sm",variant:"outline",color:"neutral",disabled:!c,onClick:()=>e.firstPage()}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Sr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang tr\u01B0\u1EDBc",size:"sm",variant:"outline",color:"neutral",disabled:!c,onClick:()=>e.previousPage()}),(0,Lt.jsx)("div",{className:"flex items-center gap-1 px-1",children:m.map((v,x)=>{if(v==="...")return(0,Lt.jsx)("span",{className:"w-8 h-8 flex items-center justify-center text-xs text-neutral-400 select-none",children:"..."},`ellipsis-${x}`);let h=Number(v),k=h===f;return(0,Lt.jsx)("button",{type:"button",onClick:()=>e.setPageIndex(h-1),"aria-label":`Trang ${h}`,"aria-current":k?"page":void 0,className:`w-8 h-8 rounded-full flex items-center justify-center text-xs transition-colors cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 ${k?"border-2 border-primary-600 text-primary-600 font-semibold bg-primary-50/50":"text-neutral-700 hover:text-neutral-900 hover:bg-neutral-100 font-medium"}`,children:h},h)})}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Tr,{className:"w-3.5 h-3.5"}),"aria-label":"Trang sau",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.nextPage()}),(0,Lt.jsx)(qr,{icon:(0,Lt.jsx)(Yn,{className:"w-3.5 h-3.5"}),"aria-label":"Trang cu\u1ED1i",size:"sm",variant:"outline",color:"neutral",disabled:!w,onClick:()=>e.lastPage()})]})]})}var gn=require("react"),ut=require("@floating-ui/react");var Ae=require("react/jsx-runtime");function wp(e,t){if(t==null||t==="")return"Ch\u01B0a nh\u1EADp";if(t instanceof Date)return t.toLocaleDateString("vi-VN");if(Array.isArray(t)){if(t.length===0)return"Ch\u01B0a ch\u1ECDn";if(e.type==="date-range"||t[0]instanceof Date||t[1]instanceof Date){let o=s=>{if(!s)return"";if(s instanceof Date)return s.toLocaleDateString("vi-VN");let l=new Date(s);return isNaN(l.getTime())?String(s):l.toLocaleDateString("vi-VN")},i=o(t[0]),a=o(t[1]);return i&&a?`${i} - ${a}`:i||a||"Ch\u01B0a ch\u1ECDn"}let r=o=>{if(e.options&&e.options.length>0){let i=e.options.find(a=>String(a.value)===String(o));if(i)return String(i.label)}return String(o)};return t.length===1?r(t[0]):`${r(t[0])}, +${t.length-1}`}if(e.options&&e.options.length>0){let r=e.options.find(n=>String(n.value)===String(t));if(r)return String(r.label)}return String(t)}function dg({field:e,currentValue:t,isOpen:r,onOpenChange:n,onRemove:o,onChange:i}){let a=e.name,{refs:{setFloating:s,setReference:l},floatingStyles:f,context:c}=(0,ut.useFloating)({open:r,onOpenChange:n,placement:"bottom-start",transform:!1,middleware:[(0,ut.offset)(6),(0,ut.flip)(),(0,ut.shift)({padding:8})],whileElementsMounted:ut.autoUpdate}),{isMounted:w,styles:p}=rt(c),m=(0,ut.useClick)(c),v=(0,ut.useDismiss)(c,{outsidePress:g=>!g.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:x,getFloatingProps:h}=(0,ut.useInteractions)([m,v]),k=(0,gn.useRef)(null);(0,gn.useEffect)(()=>{r&&k.current?.focus({preventScroll:!0})},[r]);let T=t!=null&&t!==""&&(!Array.isArray(t)||t.length>0&&(t[0]!=null||t[1]!=null)),y=wp(e,t),d=e.type==="date"||e.type==="date-range",u=()=>e.type==="custom"?e.render?.({value:t,onChange:g=>i(a,g)})??null:e.type==="date-range"?(0,Ae.jsx)(No,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn kho\u1EA3ng ng\xE0y",value:t||[null,null],onChange:g=>i(a,g),...e.props||{}}):e.type==="date"?(0,Ae.jsx)(To,{portal:!1,size:"sm",radius:"md",placeholder:e.placeholder||"Ch\u1ECDn ng\xE0y",value:t,onChange:g=>i(a,g),...e.props||{}}):e.type==="number"?(0,Ae.jsx)(fo,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp s\u1ED1...",value:t??"",onChange:g=>{let b=g.target.value;if(b==="")i(a,"");else{let S=On(b);i(a,S!==void 0?S:b)}},onClear:()=>i(a,""),...e.props||{}}):e.type==="select"||e.type==="checkbox-group"?(0,Ae.jsx)(bo,{size:"sm",value:t||[],onChange:g=>i(a,g),options:(e.options||[]).map(g=>({value:String(g.value),label:g.label,disabled:g.disabled})),className:"max-h-48 overflow-y-auto py-1 gap-2",...e.props||{}}):(0,Ae.jsx)(Yt,{ref:k,size:"sm",radius:"full",placeholder:e.placeholder||"Nh\u1EADp t\u1EEB kh\xF3a...",value:t||"",onChange:g=>i(a,g.target.value),...e.props||{}});return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("div",{ref:l,...x({className:"inline-flex items-center"}),children:(0,Ae.jsxs)(ir,{size:"sm",variant:"soft",color:T||r?"primary":"neutral",radius:"full","data-testid":`filter-chip-${a}`,className:`cursor-pointer select-none transition-all duration-150 gap-1 px-3 py-1 rounded-full ${r?"ring-2 ring-primary-500/30":"hover:opacity-90"}`,onDelete:o,deleteAriaLabel:`X\xF3a b\u1ED9 l\u1ECDc ${e.label}`,children:[(0,Ae.jsxs)("span",{className:"font-semibold",children:[e.label,":"]}),(0,Ae.jsx)("span",{"data-testid":`filter-chip-val-${a}`,className:T?"font-medium":"opacity-70 italic",children:y})]})}),w&&(0,Ae.jsx)(ut.FloatingPortal,{children:(0,Ae.jsxs)("div",{ref:s,"data-table-filter-popover":"true","data-testid":`filter-popover-${a}`,style:{...f,...p,zIndex:lt.SELECT_FILTER},...h({className:`bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-3 shadow-2xl ${d?"w-auto min-w-[280px]":"min-w-64 max-w-xs"}`}),children:[(0,Ae.jsxs)("div",{className:"flex items-center justify-between pb-2 mb-2 border-b border-neutral-100 dark:border-neutral-800",children:[(0,Ae.jsx)("span",{className:"text-xs font-bold text-neutral-800 dark:text-neutral-200",children:e.label}),(0,Ae.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 p-0.5 rounded transition-colors cursor-pointer",title:"\u0110\xF3ng",children:(0,Ae.jsx)(Ve,{className:"w-3.5 h-3.5"})})]}),(0,Ae.jsx)("div",{className:"mt-1",children:u()}),(0,Ae.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-neutral-100 dark:border-neutral-800",children:[(0,Ae.jsx)("button",{type:"button",onClick:o,className:"text-[11px] text-red-500 hover:text-red-700 transition-colors cursor-pointer font-medium",children:"X\xF3a b\u1ED9 l\u1ECDc"}),(0,Ae.jsx)("button",{type:"button",onClick:()=>n(!1),className:"text-[11px] font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 px-2 py-0.5 rounded border border-neutral-200 dark:border-neutral-700 transition-colors cursor-pointer",children:"Xong"})]})]})})]})}function wd({filters:e,values:t,onChange:r,onReset:n,className:o=""}){let[i,a]=(0,gn.useState)([]),s=(0,gn.useMemo)(()=>{let P=[],I=new Set;return e?.forEach(E=>{let N=t?.[E.name];N!=null&&N!==""&&(!Array.isArray(N)||N.length>0&&(N[0]!=null||N[1]!=null))&&(P.push(E.name),I.add(E.name))}),i.forEach(E=>{I.has(E)||(P.push(E),I.add(E))}),P},[e,t,i]),l=(0,gn.useMemo)(()=>new Set(s),[s]),[f,c]=(0,gn.useState)(null),[w,p]=(0,gn.useState)(!1),{refs:{setFloating:m,setReference:v},floatingStyles:x,context:h}=(0,ut.useFloating)({open:w,onOpenChange:p,placement:"bottom-start",transform:!1,middleware:[(0,ut.offset)(6),(0,ut.flip)(),(0,ut.shift)({padding:8})],whileElementsMounted:ut.autoUpdate}),{isMounted:k,styles:T}=rt(h,{duration:120}),y=(0,ut.useClick)(h),d=(0,ut.useDismiss)(h,{outsidePress:P=>!P.target?.closest?.("[data-table-filter-popover]")}),{getReferenceProps:u,getFloatingProps:g}=(0,ut.useInteractions)([y,d]),b=P=>{l.has(P.name)||a(I=>[...I,P.name]),p(!1),c(P.name)},S=P=>{a(I=>I.filter(E=>E!==P)),f===P&&c(null),r(P,void 0)},R=P=>{P.stopPropagation(),a([]),c(null),n?.()},D=s.length>0;return!e||e.length===0?null:(0,Ae.jsxs)("div",{onClick:P=>P.stopPropagation(),onMouseDown:P=>P.stopPropagation(),className:`inline-flex flex-wrap items-center gap-2 ${o}`.trim(),children:[(0,Ae.jsxs)("div",{className:"inline-flex",children:[(0,Ae.jsxs)("button",{ref:v,type:"button","data-testid":"table-add-filter-button",...u({className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300 hover:text-neutral-900 dark:hover:text-neutral-100 bg-white dark:bg-neutral-800 border border-neutral-300 dark:border-neutral-700 hover:border-neutral-400 dark:hover:border-neutral-600 rounded-full transition-all shadow-xs hover:shadow-sm cursor-pointer active:scale-95"}),children:[(0,Ae.jsx)(Zr,{className:"w-3.5 h-3.5 text-neutral-500"}),(0,Ae.jsx)("span",{children:"B\u1ED9 l\u1ECDc"}),(0,Ae.jsx)(yt,{className:`w-3 h-3 text-neutral-400 transition-transform ${w?"rotate-180":""}`})]}),k&&(0,Ae.jsx)(ut.FloatingPortal,{children:(0,Ae.jsxs)("div",{ref:m,"data-table-filter-popover":"true","data-testid":"table-add-filter-menu",style:{...x,...T,zIndex:lt.SELECT_FILTER},...g({className:"bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-lg p-1.5 shadow-xl min-w-48"}),children:[(0,Ae.jsx)("div",{className:"px-2 py-1 text-[11px] font-semibold text-neutral-400 uppercase tracking-wider",children:"Ch\u1ECDn tr\u01B0\u1EDDng c\u1EA7n l\u1ECDc"}),(0,Ae.jsx)("div",{className:"space-y-0.5 mt-0.5",children:e.map(P=>{let I=l.has(P.name);return(0,Ae.jsxs)("button",{type:"button","data-testid":`filter-option-${P.name}`,onClick:E=>{E.preventDefault(),E.stopPropagation(),b(P)},className:`w-full flex items-center justify-between px-2.5 py-1.5 text-xs rounded-md text-left transition-colors cursor-pointer ${I?"text-primary-600 font-medium bg-primary-50 dark:bg-primary-950/40":"text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[(0,Ae.jsx)("span",{children:P.label}),I&&(0,Ae.jsx)("span",{className:"text-[10px] text-neutral-400",children:"\u0110ang l\u1ECDc"})]},P.name)})})]})})]}),e.map(P=>{if(!l.has(P.name))return null;let I=t?.[P.name],E=f===P.name;return(0,Ae.jsx)(dg,{field:P,currentValue:I,isOpen:E,onOpenChange:N=>{c(N?P.name:null)},onRemove:()=>S(P.name),onChange:r},P.name)}),D&&(0,Ae.jsxs)("button",{type:"button","data-testid":"table-filter-reset-button",onClick:R,className:"inline-flex items-center gap-1 px-2 py-1 text-xs font-medium text-neutral-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",title:"\u0110\u1EB7t l\u1EA1i to\xE0n b\u1ED9 b\u1ED9 l\u1ECDc",children:[(0,Ae.jsx)(cr,{className:"w-3.5 h-3.5"}),(0,Ae.jsx)("span",{children:"\u0110\u1EB7t l\u1EA1i"})]})]})}var xt=require("react/jsx-runtime"),fg={};function Ws({table:e,searchPlaceholder:t="T\xECm ki\u1EBFm trong b\u1EA3ng...",enableGlobalFilter:r=!0,enableColumnVisibility:n=!0,isRefresh:o=!1,onRefresh:i,actions:a,selectedActions:s,filters:l,filterValues:f=fg,onFilterChange:c,onFilterReset:w,className:p=""}){let m=e.state.globalFilter??"",v=e.getAllLeafColumns().filter(y=>y.getCanHide()),x=e.getSelectedRowModel?.()?.rows??[],h=x.length,k=y=>{e.setGlobalFilter(y.target.value)},T=()=>{e.setGlobalFilter("")};return(0,xt.jsxs)("div",{className:`flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pb-3 ${p}`.trim(),children:[(0,xt.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-3",children:[r&&(0,xt.jsxs)("div",{className:"relative w-full sm:w-64 max-w-xs",children:[(0,xt.jsx)("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none text-neutral-400",children:(0,xt.jsx)(mo,{className:"w-4 h-4"})}),(0,xt.jsx)("input",{type:"text",value:m,onChange:k,placeholder:t,"data-testid":"table-search-input",className:"w-full h-9 pl-8 pr-8 rounded-full border border-neutral-300 bg-white text-xs sm:text-sm text-neutral-800 placeholder:text-neutral-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 shadow-xs transition-colors"}),m&&(0,xt.jsx)("button",{type:"button",onClick:T,"aria-label":"X\xF3a t\xECm ki\u1EBFm","data-testid":"table-clear-search-button",className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-neutral-400 hover:text-neutral-600 cursor-pointer",children:(0,xt.jsx)(Ve,{className:"w-3.5 h-3.5"})})]}),l&&l.length>0&&c&&(0,xt.jsx)(wd,{filters:l,values:f,onChange:c,onReset:w}),h>0&&s&&(0,xt.jsx)("div",{className:"flex items-center gap-2 animate-in fade-in-50 duration-200",children:s(x)})]}),(0,xt.jsxs)("div",{className:"flex items-center gap-2 self-end sm:self-auto",children:[(o||!!i)&&(0,xt.jsx)(qr,{icon:(0,xt.jsx)(Kn,{className:"w-3.5 h-3.5"}),"aria-label":"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",title:"L\xE0m m\u1EDBi d\u1EEF li\u1EC7u",size:"sm",variant:"outline",color:"neutral",onClick:i,"data-testid":"table-refresh-button"}),n&&v.length>0&&(0,xt.jsxs)(ia,{size:"sm",placement:"bottom-end",children:[(0,xt.jsx)(hs,{asChild:!0,children:(0,xt.jsx)(xr,{variant:"outline",size:"sm",color:"neutral",leftIcon:(0,xt.jsx)(cs,{className:"w-3.5 h-3.5"}),children:"C\u1ED9t"})}),(0,xt.jsxs)(Lu,{className:"w-56 p-0 shadow-lg border border-neutral-200",children:[(0,xt.jsx)(Hu,{className:"px-3 py-2 text-xs font-semibold text-neutral-700 border-b border-neutral-100",children:"Hi\u1EC3n th\u1ECB c\u1ED9t"}),(0,xt.jsx)(Au,{className:"max-h-60 overflow-y-auto p-1.5 flex flex-col gap-0.5",children:v.map(y=>{let d=typeof y.columnDef.header=="string"?y.columnDef.header:y.id;return(0,xt.jsx)("div",{className:"w-full",children:(0,xt.jsx)(Jr,{size:"sm",label:d,checked:y.getIsVisible(),onChange:y.getToggleVisibilityHandler(),className:"w-full",wrapperClassName:"w-full flex items-center px-2 py-1.5 rounded-md hover:bg-neutral-100/80 cursor-pointer select-none",labelClassName:"text-xs text-neutral-700 font-medium truncate"})},y.id)})})]})]}),a]})]})}var Xr=require("react"),Oc=require("@tanstack/react-table"),$r=require("@dnd-kit/core"),kp=require("@dnd-kit/modifiers"),La=require("@dnd-kit/sortable");var ot=require("@tanstack/react-table");var Cp=require("@tanstack/match-sorter-utils"),Ks=(e,t,r,n)=>{let o=(0,Cp.rankItem)(e.getValue(t),String(r??""));return n?.({itemRank:o}),o.passed};var Ac=(0,ot.tableFeatures)({rowSortingFeature:ot.rowSortingFeature,rowPaginationFeature:ot.rowPaginationFeature,rowSelectionFeature:ot.rowSelectionFeature,columnFilteringFeature:ot.columnFilteringFeature,globalFilteringFeature:ot.globalFilteringFeature,columnVisibilityFeature:ot.columnVisibilityFeature,columnPinningFeature:ot.columnPinningFeature,columnOrderingFeature:ot.columnOrderingFeature,sortedRowModel:(0,ot.createSortedRowModel)(),paginatedRowModel:(0,ot.createPaginatedRowModel)(),filteredRowModel:(0,ot.createFilteredRowModel)(),filterFns:{fuzzy:Ks}});function Cd(){return(0,ot.createColumnHelper)()}function _s(e){let{features:t=Ac,columns:r,...n}=e;return(0,ot.useTable)({features:t,columns:r,...n})}var it=require("react/jsx-runtime");function kd({columns:e,data:t,variant:r="default",size:n="md",isLoading:o=!1,isRefresh:i=!1,onRefresh:a,loadingRowsCount:s=5,emptyText:l,emptyIllustration:f,enableSorting:c=!0,enableFiltering:w=!0,enablePagination:p=!0,enableRowSelection:m=!1,enableColumnVisibility:v=!0,enableColumnOrdering:x=!1,filters:h,searchPlaceholder:k,toolbarActions:T,renderBulkActions:y,pageSizeOptions:d,initialPageSize:u=Os,manualPagination:g=!1,manualSorting:b=!1,manualFiltering:S=!1,pageCount:R,rowCount:D,pagination:P,onPaginationChange:I,sorting:E,onSortingChange:N,rowSelection:M,onRowSelectionChange:z,columnVisibility:H,onColumnVisibilityChange:V,columnOrder:Y,onColumnOrderChange:$,globalFilter:F,onGlobalFilterChange:G,globalFilterFn:A,columnFilters:j,onColumnFiltersChange:B,onRowClick:X,className:le="",containerClassName:ne=""}){let[ue,ie]=(0,Xr.useState)([]),[Q,q]=(0,Xr.useState)({pageIndex:0,pageSize:u}),[ge,ke]=(0,Xr.useState)({}),[L,te]=(0,Xr.useState)({}),[Z,he]=(0,Xr.useState)([]),[ae,ve]=(0,Xr.useState)(""),[Se,ye]=(0,Xr.useState)(()=>{if(!h)return[];let K=[];return h.forEach(_=>{_.defaultValue!==void 0&&_.defaultValue!==null&&_.defaultValue!==""&&(!Array.isArray(_.defaultValue)||_.defaultValue.length>0)&&K.push({id:_.name,value:_.defaultValue})}),K}),J=E??ue,O=K=>{let _=typeof K=="function"?K(J):K;N?N(_):ie(_)},W=P??Q,we=K=>{let _=typeof K=="function"?K(W):K;I?I(_):q(_)},fe=M??ge,se=K=>{let _=typeof K=="function"?K(fe):K;z?z(_):ke(_)},me=H??L,Re=K=>{let _=typeof K=="function"?K(me):K;V?V(_):te(_)},xe=Y??Z,re=K=>{let _=typeof K=="function"?K(xe):K;$?$(_):he(_)},de=F??ae,ce=K=>{let _=typeof K=="function"?K(de):K;G?G(String(_??"")):ve(String(_??""))},ee=j??Se,U=(0,Xr.useMemo)(()=>{let K={};return ee.forEach(_=>{K[_.id]=_.value}),K},[ee]),Ce=(K,_)=>{let ze=ee.filter(Fe=>Fe.id!==K);_!=null&&_!==""&&(!Array.isArray(_)||_.length>0)&&ze.push({id:K,value:_}),B?B(ze):ye(ze)},$e=()=>{B?B([]):ye([])},Ee=(0,Xr.useMemo)(()=>{let K=e;return!S&&h&&h.length>0&&(K=K.map(_=>{let ze=_.id??_.accessorKey,pe=h.find(Fe=>Fe.name===ze);return!pe||_.filterFn?_:pe.type==="select"||pe.type==="checkbox-group"?{..._,filterFn:(Fe,et,Ge)=>{if(!Ge||Array.isArray(Ge)&&Ge.length===0)return!0;let at=Fe.getValue(et);return Array.isArray(Ge)?Ge.some(tt=>String(tt).toLowerCase()===String(at).toLowerCase()):String(at).toLowerCase()===String(Ge).toLowerCase()}}:pe.type==="date-range"?{..._,filterFn:(Fe,et,Ge)=>{if(!Ge||!Array.isArray(Ge))return!0;let[at,tt]=Ge;if(!at&&!tt)return!0;let Ne=Fe.getValue(et);if(!Ne)return!1;let Xe=Ne instanceof Date?Ne:new Date(Ne);if(isNaN(Xe.getTime()))return!1;if(at){let be=new Date(at);if(be.setHours(0,0,0,0),Xe<be)return!1}if(tt){let be=new Date(tt);if(be.setHours(23,59,59,999),Xe>be)return!1}return!0}}:_})),m&&!e.some(ze=>ze.id==="_select")?[{id:"_select",header:({table:pe})=>(0,it.jsx)("div",{className:"flex items-center justify-center",children:(0,it.jsx)(Jr,{size:"sm",checked:pe.getIsAllPageRowsSelected(),config:{indeterminate:pe.getIsSomePageRowsSelected()},onChange:pe.getToggleAllPageRowsSelectedHandler(),"aria-label":"Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng tr\xEAn trang n\xE0y"})}),cell:({row:pe})=>(0,it.jsx)("div",{className:"flex items-center justify-center",children:(0,it.jsx)(Jr,{size:"sm",checked:pe.getIsSelected(),disabled:!pe.getCanSelect(),onChange:pe.getToggleSelectedHandler(),"aria-label":`Ch\u1ECDn d\xF2ng ${pe.id}`})}),enableSorting:!1,enableHiding:!1},...K]:K},[e,m,S,h]),oe=_s({data:t,columns:Ee,state:{sorting:J,pagination:W,rowSelection:fe,columnVisibility:me,columnOrder:xe,globalFilter:de,columnFilters:S?[]:ee},enableSorting:c,enableRowSelection:m,manualPagination:g,manualSorting:b,manualFiltering:!1,globalFilterFn:A??"fuzzy",pageCount:R,rowCount:D,onSortingChange:O,onPaginationChange:we,onRowSelectionChange:se,onColumnVisibilityChange:Re,onColumnOrderChange:re,onGlobalFilterChange:ce}),Te=oe.getVisibleLeafColumns().length,Pe=p?oe.getRowModel().rows:oe.getPrePaginatedRowModel?.()?.rows??oe.getRowModel().rows,Qe=w||v||!!(h&&h.length>0)||!!(i||a)||!!T||!!y,We=(0,$r.useSensors)((0,$r.useSensor)($r.PointerSensor,{activationConstraint:{distance:8}}),(0,$r.useSensor)($r.KeyboardSensor)),Be=(0,Xr.useMemo)(()=>oe.getVisibleLeafColumns().map(K=>K.id),[oe]),Oe=K=>{let{active:_,over:ze}=K;if(_&&ze&&_.id!==ze.id){if(_.id==="_select"||ze.id==="_select")return;let pe=oe.getVisibleLeafColumns().map(Ge=>Ge.id),Fe=pe.indexOf(_.id),et=pe.indexOf(ze.id);if(Fe!==-1&&et!==-1){let Ge=(0,La.arrayMove)(pe,Fe,et);re(Ge)}}},Ze=(0,it.jsxs)(Gs,{variant:r,size:n,containerClassName:ne,children:[(0,it.jsx)(js,{children:oe.getHeaderGroups().map(K=>(0,it.jsx)(Uo,{isHoverable:!1,children:x?(0,it.jsx)(La.SortableContext,{items:Be,strategy:La.horizontalListSortingStrategy,children:K.headers.map(_=>{if(_.isPlaceholder)return(0,it.jsx)(lo,{},_.id);let ze=_.column.getCanSort()&&c,pe=_.column.getIsSorted(),Fe=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,et=(0,Oc.flexRender)(_.column.columnDef.header,_.getContext());return(0,it.jsx)(vd,{header:_,canSort:ze,ariaSort:Fe,headerContent:et},_.id)})}):K.headers.map(_=>{if(_.isPlaceholder)return(0,it.jsx)(lo,{},_.id);let ze=_.column.getCanSort()&&c,pe=_.column.getIsSorted(),Fe=ze?pe==="asc"?"ascending":pe==="desc"?"descending":"none":void 0,et=(0,Oc.flexRender)(_.column.columnDef.header,_.getContext());return(0,it.jsx)(lo,{"aria-sort":Fe,"data-column-id":_.column.id,children:ze&&typeof _.column.columnDef.header=="string"?(0,it.jsx)(Ii,{column:_.column,title:_.column.columnDef.header}):et},_.id)})},K.id))}),(0,it.jsx)(Us,{children:o||i?Array.from({length:s}).map((K,_)=>(0,it.jsx)(Uo,{isHoverable:!1,children:Array.from({length:Te}).map((ze,pe)=>(0,it.jsx)(zi,{children:(0,it.jsx)(Oo,{className:"h-4 w-full rounded"})},`skeleton-cell-${_}-${pe}`))},`skeleton-row-${_}`)):Pe.length===0?(0,it.jsx)(Uo,{isHoverable:!1,children:(0,it.jsx)(zi,{colSpan:Te,className:"py-12 text-center",children:f??(0,it.jsx)(Mo,{size:"sm",image:de?"search":"default",description:l||(de?"Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3 ph\xF9 h\u1EE3p v\u1EDBi t\u1EEB kh\xF3a":"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u hi\u1EC3n th\u1ECB")})})}):Pe.map(K=>{let _=K.getIsSelected();return(0,it.jsx)(Uo,{isSelected:_,isHoverable:!0,onClick:()=>X?.(K),className:X?"cursor-pointer":void 0,children:K.getVisibleCells().map(ze=>(0,it.jsx)(zi,{children:(0,Oc.flexRender)(ze.column.columnDef.cell,ze.getContext())},ze.id))},K.id)})})]});return(0,it.jsxs)("div",{className:`w-full space-y-2 ${le}`.trim(),children:[Qe&&(0,it.jsx)(Ws,{table:oe,searchPlaceholder:k,enableGlobalFilter:w,enableColumnVisibility:v,isRefresh:i,onRefresh:a,actions:T,selectedActions:y,filters:h,filterValues:U,onFilterChange:Ce,onFilterReset:$e}),x?(0,it.jsx)($r.DndContext,{collisionDetection:$r.closestCenter,modifiers:[kp.restrictToHorizontalAxis],onDragEnd:Oe,sensors:We,children:Ze}):Ze,p&&!o&&Pe.length>0&&(0,it.jsx)(Ys,{table:oe,pageSizeOptions:d})]})}0&&(module.exports={AUDIO_EXTENSIONS,Alert,AlertCircleIcon,AlertTriangleIcon,ArrowDownIcon,ArrowUpDownIcon,ArrowUpIcon,AvatarIcon,Badge,Button,Calendar,CalendarHeader,CalendarIcon,Carousel,CarouselContent,CarouselNext,CarouselPagination,CarouselPrevious,CarouselSlide,CheckCircleIcon,CheckIcon,Checkbox,CheckboxGroup,ChevronDownIcon,ChevronLeftIcon,ChevronRightIcon,ClockIcon,CloseIcon,Collapse,CollapseContent,CollapseHeader,CollapsePanel,Collapsible,Confirm,ConfirmBody,ConfirmClose,ConfirmContainer,ConfirmFooter,ConfirmHeader,CropIcon,DEFAULT_PAGE_SIZE,DEFAULT_PAGE_SIZE_OPTIONS,DEFAULT_TOAST_DURATION,DOCUMENT_EXTENSIONS,DataTable,DatePicker,DateRangeCalendar,DateRangeDayGrid,DateRangeHeader,DateRangeMonthGrid,DateRangePicker,DateRangeYearGrid,DateTimePicker,DateTimeRangePicker,DayGrid,DoubleChevronLeftIcon,DoubleChevronRightIcon,DownloadIcon,Dropdown,DropdownGroup,DropdownHeader,DropdownItem,DropdownMenu,DropdownSeparator,DropdownTrigger,Empty,EmptyDefaultIcon,EmptyErrorIcon,EmptyFolderIcon,EmptyIllustration,EmptySearchIcon,EmptySimpleIcon,EyeIcon,FileContainer,FileIcon,FilePreview,FlipHorizontalIcon,IMAGE_EXTENSIONS,IconButton,ImageIcon,ImagePreview,ImagePreviewToolbar,InfoCircleIcon,Input,LoadingImage,MinusIcon,Modal,ModalBody,ModalClose,ModalContainer,ModalFooter,ModalHeader,MonthGrid,MultiInput,MultiSelect,MultiSelectTrigger,NumberInput,OtpInput,PDF_EXTENSIONS,PasswordInput,PlusIcon,Popover,PopoverBody,PopoverClose,PopoverContent,PopoverFooter,PopoverHeader,PopoverTrigger,Radio,RadioDotIcon,RadioGroup,ResetIcon,RotateCcwIcon,RotateCwIcon,SearchIcon,Select,SelectComponent,SelectMenu,SelectMenuFilter,SelectOption,SelectTrigger,SingleSelectTrigger,Skeleton,Slider,SliderMarks,SliderStepDots,SliderThumb,SlidersHorizontalIcon,Spinner,Tab,TabList,TabPanel,TabPanels,Table,TableBody,TableCaption,TableCell,TableColumnHeader,TableFooter,TableHead,TableHeader,TablePagination,TableRow,TableToolbar,Tabs,TextArea,TimeColumn,TimePicker,TimeRangePicker,TimeView,Toaster,Toggle,Tooltip,TrashIcon,UploadAvatar,UploadAvatarCropContent,UploadAvatarCropModal,UploadFile,UploadFileDropzone,UploadFileItemRow,UploadFileList,UploadIcon,UploadImage,UploadImageDropzone,UploadImageList,VIDEO_EXTENSIONS,YearGrid,ZoomInIcon,ZoomOutIcon,checkIsDisabled,clamp,combineDateTime,createDateWithTime,createTableColumnHelper,defaultTableFeatures,downloadFile,formatBytes,formatDate,formatDateTime,formatNumberString,formatTime,fuzzyFilter,generateCalendarGrid,generateRangeCalendarGrid,getDefaultDateTimeFormat,getDefaultFormat,getFileCategory,getFileExtension,getFileName,getFileType,getISOWeekNumber,getPercentage,getSafeConfig,isDateAfter,isDateBefore,isSameDay,isSameMonth,isSameTime,isTimeAfter,isTimeBefore,isTimeInRange,isValidOtpChar,normalizePreviewFile,padZero,parseDate,parseDateTime,parseNumber,parseRawNumberString,parseTimeToDate,rankAndFilterItems,resolveLocale,sanitizeOtpString,splitTagsFromText,toDate,toDateTime,toTimeObject,toast,useAnimatedError,useCarousel,useCarouselContext,useCollapseContext,useCollapsePanelContext,useConfirmContext,useDataTable,useDebounce,useDebouncedCallback,useDropdownContext,useFileContext,useFloatingTransition,useInfiniteScroll,useModalContext,usePopoverContext,useTableStyles,useTabsContext});
|
|
3
7
|
//# sourceMappingURL=index.cjs.map
|