@mvr-ui/components 1.0.105 → 1.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/page.d.mts CHANGED
@@ -155,7 +155,7 @@ interface AvatarProps {
155
155
  size?: "sm" | "md" | "lg" | "xl";
156
156
  className?: string;
157
157
  }
158
- declare const Avatar: React__default.FC<AvatarProps>;
158
+ declare const AvatarPrimitive: React__default.FC<AvatarProps>;
159
159
 
160
160
  interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
161
161
  label?: string;
@@ -550,4 +550,4 @@ interface ValidateFieldProps {
550
550
  }
551
551
  declare const ValidateFieldPrimitive: React$1.FunctionComponent<ValidateFieldProps>;
552
552
 
553
- export { AccordionItemData, AccordionPrimitive, AccordionProps, AlertDescriptionPrimitive, AlertDescriptionProps, AlertPrimitive, AlertProps, AlertTitlePrimitive, AlertTitleProps, Avatar, BadgePrimitive, BadgeProps, BreadcrumbPrimitive, BreadcrumbProps, ButtonPrimitive, ButtonProps, ButtonSpinnerPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ColorPicker, ColorPickerPrimitive, ColorPickerProps, ComboBoxPrimitive, ContentLoaderPrimitive, DatePickerPrimitive, DatePickerProps, DialogContentPrimitive, DialogFooterPrimitive, DialogHeaderPrimitive, DialogPrimitive, DialogProps, DialogSectionProps, DialogTitlePrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, FieldFeedbackPrimitive, FieldFeedbackProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, LoadingOverlayPrimitive, LoadingSpinnerPrimitive, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, RangePrimitive, RangeProps, RangeSliderPrimitive, RangeSliderProps, SelectPrimitive, SelectProps, SkeletonPrimitive, SpinnerPrimitive, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, Toast, ToastProvider, TooltipPrimitive, TooltipProps, UploadFilePrimitive, UploadFileProps, ValidateFieldPrimitive, ValidateFieldProps, useToast };
553
+ export { AccordionItemData, AccordionPrimitive, AccordionProps, AlertDescriptionPrimitive, AlertDescriptionProps, AlertPrimitive, AlertProps, AlertTitlePrimitive, AlertTitleProps, AvatarPrimitive, AvatarProps, BadgePrimitive, BadgeProps, BreadcrumbPrimitive, BreadcrumbProps, ButtonPrimitive, ButtonProps, ButtonSpinnerPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ColorPicker, ColorPickerPrimitive, ColorPickerProps, ComboBoxPrimitive, ContentLoaderPrimitive, DatePickerPrimitive, DatePickerProps, DialogContentPrimitive, DialogFooterPrimitive, DialogHeaderPrimitive, DialogPrimitive, DialogProps, DialogSectionProps, DialogTitlePrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, FieldFeedbackPrimitive, FieldFeedbackProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, LoadingOverlayPrimitive, LoadingSpinnerPrimitive, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, RangePrimitive, RangeProps, RangeSliderPrimitive, RangeSliderProps, SelectPrimitive, SelectProps, SkeletonPrimitive, SpinnerPrimitive, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, Toast, ToastProvider, TooltipPrimitive, TooltipProps, UploadFilePrimitive, UploadFileProps, ValidateFieldPrimitive, ValidateFieldProps, useToast };
package/dist/page.d.ts CHANGED
@@ -155,7 +155,7 @@ interface AvatarProps {
155
155
  size?: "sm" | "md" | "lg" | "xl";
156
156
  className?: string;
157
157
  }
158
- declare const Avatar: React__default.FC<AvatarProps>;
158
+ declare const AvatarPrimitive: React__default.FC<AvatarProps>;
159
159
 
160
160
  interface CheckBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
161
161
  label?: string;
@@ -550,4 +550,4 @@ interface ValidateFieldProps {
550
550
  }
551
551
  declare const ValidateFieldPrimitive: React$1.FunctionComponent<ValidateFieldProps>;
552
552
 
553
- export { AccordionItemData, AccordionPrimitive, AccordionProps, AlertDescriptionPrimitive, AlertDescriptionProps, AlertPrimitive, AlertProps, AlertTitlePrimitive, AlertTitleProps, Avatar, BadgePrimitive, BadgeProps, BreadcrumbPrimitive, BreadcrumbProps, ButtonPrimitive, ButtonProps, ButtonSpinnerPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ColorPicker, ColorPickerPrimitive, ColorPickerProps, ComboBoxPrimitive, ContentLoaderPrimitive, DatePickerPrimitive, DatePickerProps, DialogContentPrimitive, DialogFooterPrimitive, DialogHeaderPrimitive, DialogPrimitive, DialogProps, DialogSectionProps, DialogTitlePrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, FieldFeedbackPrimitive, FieldFeedbackProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, LoadingOverlayPrimitive, LoadingSpinnerPrimitive, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, RangePrimitive, RangeProps, RangeSliderPrimitive, RangeSliderProps, SelectPrimitive, SelectProps, SkeletonPrimitive, SpinnerPrimitive, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, Toast, ToastProvider, TooltipPrimitive, TooltipProps, UploadFilePrimitive, UploadFileProps, ValidateFieldPrimitive, ValidateFieldProps, useToast };
553
+ export { AccordionItemData, AccordionPrimitive, AccordionProps, AlertDescriptionPrimitive, AlertDescriptionProps, AlertPrimitive, AlertProps, AlertTitlePrimitive, AlertTitleProps, AvatarPrimitive, AvatarProps, BadgePrimitive, BadgeProps, BreadcrumbPrimitive, BreadcrumbProps, ButtonPrimitive, ButtonProps, ButtonSpinnerPrimitive, CardContentPrimitive, CardContentProps, CardDescriptionPrimitive, CardDescriptionProps, CardFooterPrimitive, CardFooterProps, CardHeaderPrimitive, CardHeaderProps, CardPrimitive, CardProps, CardTitlePrimitive, CardTitleProps, CheckBoxGroupPrimitive, CheckBoxPrimitive, CheckBoxProps, ColorPicker, ColorPickerPrimitive, ColorPickerProps, ComboBoxPrimitive, ContentLoaderPrimitive, DatePickerPrimitive, DatePickerProps, DialogContentPrimitive, DialogFooterPrimitive, DialogHeaderPrimitive, DialogPrimitive, DialogProps, DialogSectionProps, DialogTitlePrimitive, DropdownMenuContentPrimitive, DropdownMenuContentProps, DropdownMenuItemPrimitive, DropdownMenuItemProps, DropdownMenuLabelPrimitive, DropdownMenuLabelProps, DropdownMenuPrimitive, DropdownMenuProps, DropdownMenuSeparatorPrimitive, DropdownMenuSeparatorProps, DropdownMenuTriggerPrimitive, DropdownMenuTriggerProps, FieldFeedbackPrimitive, FieldFeedbackProps, HelperFieldPrimitive, HelperFieldProps, InputPrimitive, InputProps, LabelPrimitive, LabelProps, LicenseProvider, LoadingOverlayPrimitive, LoadingSpinnerPrimitive, OtpInputPrimitive, OtpInputProps, RadioGroupPrimitive, RadioPrimitive, RadioProps, RangePrimitive, RangeProps, RangeSliderPrimitive, RangeSliderProps, SelectPrimitive, SelectProps, SkeletonPrimitive, SpinnerPrimitive, SwitchPrimitive, SwitchProps, TextAreaPrimitive, TextAreaProps, Toast, ToastProvider, TooltipPrimitive, TooltipProps, UploadFilePrimitive, UploadFileProps, ValidateFieldPrimitive, ValidateFieldProps, useToast };
package/dist/page.js CHANGED
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var Wn = require('react');
5
- var Go = require('clsx');
4
+ var qn = require('react');
5
+ var zo = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
 
8
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
 
10
- var Wn__default = /*#__PURE__*/_interopDefault(Wn);
11
- var Go__default = /*#__PURE__*/_interopDefault(Go);
10
+ var qn__default = /*#__PURE__*/_interopDefault(qn);
11
+ var zo__default = /*#__PURE__*/_interopDefault(zo);
12
12
 
13
13
  var kt=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsxRuntime.jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxRuntime.jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsxRuntime.jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsxRuntime.jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxRuntime.jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M12 9v4"}),jsxRuntime.jsx("path",{d:"M12 17h.01"}),jsxRuntime.jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsxRuntime.jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsxRuntime.jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsxRuntime.jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsxRuntime.jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsxRuntime.jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var Nt=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
14
14
  Ol\xE1,
@@ -26,88 +26,88 @@ Erro:
26
26
  ${t??"Licen\xE7a inv\xE1lida"}
27
27
 
28
28
  Pode me ajudar?
29
- `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Lt=Wn.createContext(void 0),Sn=({children:e,licenseKey:t})=>{let[r,n]=Wn.useState(!1),[o,i]=Wn.useState(null),[a,l]=Wn.useState(!0),s=m=>{if(i(null),!m)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let u="chave-secreta-123";if(m!==u)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return Wn.useEffect(()=>{if(t){l(!0);try{s(t);}catch(m){i(m instanceof Error?m.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsxRuntime.jsx(Lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(kt,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Pt("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>Nt("marcos.vinicius.engsof@gmail.com",o)}]})})},Rt=()=>{let e=Wn.useContext(Lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Mt=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var f=({children:e})=>{let{isLicenseValid:t}=Rt();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(Mt,{})};var St=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=u=>u===void 0?[]:Array.isArray(u)?u:[u],[l,s]=Wn.useState(a(n??r));Wn.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let m=Wn.useCallback(u=>{s(c=>{let d;return t==="single"?d=c.includes(u)?[]:[u]:d=c.includes(u)?c.filter(p=>p!==u):[...c,u],o?.(t==="single"?d[0]??"":d),d});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(u=>jsxRuntime.jsx(Bn,{...u,isOpen:l.includes(u.id),onToggle:()=>m(u.id)},u.id))})},Bn=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
29
+ `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Lt=qn.createContext(void 0),Vn=({children:e,licenseKey:t})=>{let[r,n]=qn.useState(!1),[o,i]=qn.useState(null),[a,l]=qn.useState(!0),s=m=>{if(i(null),!m)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let u="chave-secreta-123";if(m!==u)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return qn.useEffect(()=>{if(t){l(!0);try{s(t);}catch(m){i(m instanceof Error?m.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsxRuntime.jsx(Lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsxRuntime.jsx(kt,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Pt("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>Nt("marcos.vinicius.engsof@gmail.com",o)}]})})},Rt=()=>{let e=qn.useContext(Lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Mt=({message:e="Component locked - Please validate your license"})=>jsxRuntime.jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsxRuntime.jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsxRuntime.jsx("span",{children:e})]});var f=({children:e})=>{let{isLicenseValid:t}=Rt();return t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:e}):jsxRuntime.jsx(Mt,{})};var St=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=u=>u===void 0?[]:Array.isArray(u)?u:[u],[l,s]=qn.useState(a(n??r));qn.useEffect(()=>{n!==void 0&&s(a(n));},[n]);let m=qn.useCallback(u=>{s(c=>{let d;return t==="single"?d=c.includes(u)?[]:[u]:d=c.includes(u)?c.filter(p=>p!==u):[...c,u],o?.(t==="single"?d[0]??"":d),d});},[t,o]);return jsxRuntime.jsx("div",{className:`space-y-2 ${i}`,children:e.map(u=>jsxRuntime.jsx(On,{...u,isOpen:l.includes(u.id),onToggle:()=>m(u.id)},u.id))})},On=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsxRuntime.jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
30
30
  ${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
31
31
  ${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
32
- `,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});St.displayName="Accordion";var mi=St;function g(...e){return tailwindMerge.twMerge(Go.clsx(e))}var Vt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h5",{ref:o,className:t?e:g("mb-1 font-medium leading-none tracking-tight",e),...n,children:r})}));Vt.displayName="AlertTitle";var It=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("text-sm [&_p]:leading-relaxed",e),...n,children:r})}));It.displayName="AlertDescription";var Ht=Wn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,role:"alert",className:t?e:g("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:-translate-y-0.75 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{default:"bg-background text-foreground border-border",destructive:"border-red-500/50 text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-950/50 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/50 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",success:"border-green-500/50 text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 [&>svg]:text-green-600 dark:[&>svg]:text-green-400"}[r],e),...o,children:n})}));Ht.displayName="Alert";var Ci=Ht,ki=Vt,Ni=It;var At=Wn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,className:t?e:g("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));At.displayName="Badge";var Ei=At;var Bt=({items:e,separator:t="/",overrideClassName:r,className:n})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("nav",{"aria-label":"Breadcrumb",className:r?n:g("flex",n),children:jsxRuntime.jsx("ol",{className:"flex items-center space-x-2",children:e.map((o,i)=>jsxRuntime.jsxs("li",{className:"flex items-center",children:[i>0&&jsxRuntime.jsx("span",{className:"mx-2 text-muted-foreground",children:t}),o.href&&!o.current?jsxRuntime.jsx("a",{href:o.href,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o.label}):jsxRuntime.jsx("span",{className:g("text-sm font-medium",o.current?"text-foreground":"text-muted-foreground"),"aria-current":o.current?"page":void 0,children:o.label})]},i))})})});Bt.displayName="Breadcrumb";var Hi=Bt;var Ot=Wn__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},m)=>{let u="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",c={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},d={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},p=t?e:g(u,c[r],d[n],e);return o?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("a",{href:o,className:p,ref:m,children:a&&l?l:i})}):jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{className:p,ref:m,...s,children:a&&l?l:i})})});Ot.displayName="Button";var zi=Ot;var Gt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));Gt.displayName="Card";var zt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));zt.displayName="CardHeader";var Ut=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:g("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Ut.displayName="CardTitle";var Wt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:g("text-sm text-muted-foreground",e),...n,children:r})}));Wt.displayName="CardDescription";var qt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("p-6 pt-0",e),...n,children:r})}));qt.displayName="CardContent";var Yt=Wn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex items-center p-6 pt-0",e),...n,children:r})}));Yt.displayName="CardFooter";var Xi=Gt,Ji=zt,ji=Ut,Zi=Wt,Qi=qt,es=Yt;var _t=Wn.forwardRef(({children:e,isOpen:t,onClose:r,size:n="md",className:o,overrideClassName:i=!1,...a},l)=>(Wn.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[t]),Wn.useEffect(()=>{let m=u=>{u.key==="Escape"&&r();};return t&&document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),t?jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:l,className:"fixed inset-0 z-50 flex items-center justify-center",...a,children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),jsxRuntime.jsx("div",{className:i?o:g("relative bg-background border border-border rounded-lg shadow-lg w-full mx-4",{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[n],o),children:e})]})}):null));_t.displayName="Dialog";var Xt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-b border-border",t),...n,children:e})}));Xt.displayName="DialogHeader";var Jt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h2",{ref:o,className:r?t:g("text-lg font-semibold text-foreground",t),...n,children:e})}));Jt.displayName="DialogTitle";var jt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4",t),...n,children:e})}));jt.displayName="DialogContent";var Zt=Wn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-t border-border flex justify-end space-x-2",t),...n,children:e})}));Zt.displayName="DialogFooter";var ss=_t,ls=Xt,cs=Jt,ds=jt,us=Zt;var Ae=Wn.createContext(void 0),er=Wn.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=Wn.useState(!1);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:g("relative inline-block",t),...r,children:e})})})});er.displayName="DropdownMenu";var tr=({children:e,asChild:t})=>{let r=Wn.useContext(Ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return Wn.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};tr.displayName="DropdownMenuTrigger";var rr=Wn.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=Wn.useContext(Ae),a=Wn.useRef(null);return Wn.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),Wn.useEffect(()=>{let s=m=>{a.current&&!a.current.contains(m.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:a,className:g("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});rr.displayName="DropdownMenuContent";var nr=Wn.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=Wn.useContext(Ae);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:g("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});nr.displayName="DropdownMenuItem";var or=Wn.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:r,className:g("-mx-1 my-1 h-px bg-border",e),...t})}));or.displayName="DropdownMenuSeparator";var ar=Wn.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:n,className:g("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));ar.displayName="DropdownMenuLabel";var xs=er,hs=tr,ys=rr,ws=nr,Cs=or,ks=ar;var Ms=({src:e,alt:t="",fallback:r,size:n="md",className:o})=>{let[i,a]=Wn.useState(!1),l={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},s=m=>m.split(" ").map(u=>u.charAt(0)).join("").toUpperCase().slice(0,2);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:g("relative flex shrink-0 overflow-hidden rounded-full bg-muted",l[n],o),children:e&&!i?jsxRuntime.jsx("img",{src:e||"/placeholder.svg",alt:t,className:"aspect-square h-full w-full object-cover",onError:()=>a(!0)}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted font-medium text-muted-foreground",children:r?s(r):"?"})})})};var jn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-muted-foreground",t),children:e})})},O=jn;var Zn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:g("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),F=Zn;var eo=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-red-600 dark:text-red-400",t),children:e})})},G=eo;var lr=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:m,...u},c)=>{let d=Wn.useId(),p=g("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive",a);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:d,type:"checkbox",className:l?a:p,ref:c,...u}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(F,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&s&&jsxRuntime.jsx(O,{children:s})]})})});lr.displayName="CheckBox";var js=lr;function ao(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:m="vertical",className:u,overrideClassName:c=!1,helperText:d,error:p,label:w,name:y,required:b,...v}=e,E=Wn.useId(),D=Wn.useMemo(()=>new Map(s.map(k=>[String(k[l]),k])),[s,l]),V=Wn.useMemo(()=>o==null?[]:r==="field"?n?o.map(k=>String(k)):[String(o)]:n?o.map(k=>String(k[l])):[String(o[l])],[o,r,n,l]),P=(k,N)=>{if(!i)return;let x;if(r==="field")if(n)x=k.map(M=>{let H=D.get(M);return H?H[l]:M});else {let h=k[0];if(!h)x=void 0;else {let M=D.get(h);x=M?M[l]:h;}}else n?x=k.map(M=>D.get(M)).filter(M=>M!==void 0):x=D.get(k[0]??"")??void 0;i({target:{name:y,value:x,type:"checkboxgroup",checked:N}});},$=k=>{let N;n?N=V.includes(k)?V.filter(x=>x!==k):[...V,k]:N=V[0]===k?[]:[k],P(N,N.includes(k));},I=m==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",S=g("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",u),children:[w&&jsxRuntime.jsx(F,{required:b,children:w}),jsxRuntime.jsx("div",{className:I,children:s.map((k,N)=>{let x=String(k[l]),h=V.includes(x),M=`${E}-${x}-${N}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:M,ref:t,type:"checkbox",name:y,checked:h,onChange:()=>$(x),className:c?u:S}),jsxRuntime.jsx(F,{htmlFor:M,children:String(k[a])})]},M)})}),!!p&&jsxRuntime.jsx(G,{children:String(p)}),!p&&d&&jsxRuntime.jsx(O,{children:d})]})})}function io(){let e=Wn.forwardRef(ao);return e.displayName="CheckBoxGroup",e}var so=io(),ll=so;var mo=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],mr=Wn__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=mo,showPresets:i=!0,className:a,error:l,helperText:s,name:m},u)=>{let c=Wn.useId(),d=Wn.useRef(null),[p,w]=Wn.useState(!1),[y,b]=Wn.useState("COLOR"),[v,E]=Wn.useState("HEX"),[D,V]=Wn.useState("#000000"),[P,$]=Wn.useState(0),[I,S]=Wn.useState(0),[k,N]=Wn.useState(0),[x,h]=Wn.useState(1),[M,H]=Wn.useState("#000000"),[A,j]=Wn.useState("#ffffff"),[re,Ce]=Wn.useState(90),[R,T]=Wn.useState("linear-gradient(90deg, #000000, #ffffff)"),z=(L,U,De)=>Math.min(De,Math.max(U,L)),_=L=>{let U=L.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},W=L=>{r?.({target:{value:L,name:m}});};Wn.useEffect(()=>{let L=U=>{d.current&&!d.current.contains(U.target)&&w(!1);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]),Wn.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(D)){let L=_(D);$(L.r),S(L.g),N(L.b);}},[D]),Wn.useEffect(()=>{let L=`linear-gradient(${re}deg, ${M}, ${A})`;T(L),y==="GRADIENT"&&W(L);},[M,A,re]);let q=()=>{if(x>=1){if(v==="HEX")return D;if(v==="RGB")return `rgb(${P}, ${I}, ${k})`}return `rgba(${P}, ${I}, ${k}, ${Number(x.toFixed(2))})`},Z=y==="GRADIENT"?R:q();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&w(!p),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),p&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>b(L),className:`px-2 py-1 text-xs rounded ${y===L?"bg-primary text-white":"border"}`,children:L==="COLOR"?"Cor":"Gradiente"},L))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),y==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:u,type:"color",value:D,onChange:L=>{V(L.target.value.toUpperCase()),W(q());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:v,onChange:L=>E(L.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),v==="HEX"&&jsxRuntime.jsx("input",{value:D,onChange:L=>{let U=L.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),V(U),/^#[0-9A-F]{6}$/.test(U)&&W(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(v==="RGB"||v==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:P,s:$},{l:"G",v:I,s:S},{l:"B",v:k,s:N}].map(({l:L,v:U,s:De})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:L}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:U,onChange:Dn=>{De(z(+Dn.target.value,0,255)),W(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},L))})]}),v==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:x,onChange:L=>{h(+L.target.value),W(q());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(x*100),"%"]})]}),i&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{V(L),h(1),W(L);},className:"w-8 h-8 rounded border",style:{background:L}},L))})]}),y==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:M,onChange:L=>H(L.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:A,onChange:L=>j(L.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:re,onChange:L=>Ce(+L.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[re,"\xB0"]})]})]})]})]}),l&&jsxRuntime.jsx(G,{children:l}),!l&&s&&jsxRuntime.jsx(O,{children:s})]})})});mr.displayName="ColorPicker";var bl=mr;var po=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Ge=po;var go=(e,t)=>{Wn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},fr=go;function tt({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,m]=Wn.useState([]),u=Wn.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=Wn.useCallback(()=>s.map(b=>u.get(b)).filter(b=>!!b),[s,u]),d=Wn.useCallback(b=>{if(!o)return;let v;if(a==="field"?n?v=b:v=b[0]??void 0:n?v=b.map(D=>u.get(D)).filter(D=>D!==void 0):v=u.get(b[0]??"")??void 0,i&&!n){let E=u.get(b[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:v,type:"combobox"}});},[n,o,u,l,a,i,t]),p=Wn.useCallback(b=>{let v=String(b[r]),E=n?s.includes(v)?s.filter(D=>D!==v):[...s,v]:[v];m(E),d(E);},[n,s,d,r]),w=Wn.useCallback(b=>{let v=s.filter(E=>E!==b);m(v),d(v);},[s,d]),y=Wn.useCallback(()=>{m([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:p,handleRemove:w,handleClear:y,getSelectedOptions:c}}function rt(e,t,r){return Wn.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var br=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:m,handleRemove:u})=>{let c=Wn.useCallback(p=>{if(a.length===0){s(-1);return}s(w=>w<0?p>0?0:a.length-1:(w+p+a.length)%a.length);},[a,s]);return Wn.useCallback(p=>{if(!e){if(p.key==="Enter"||p.key==="ArrowDown"){t(!0),s(0),p.preventDefault();return}r&&p.key==="Backspace"&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));return}switch(p.key){case"ArrowDown":p.preventDefault(),c(1);break;case"ArrowUp":p.preventDefault(),c(-1);break;case"Enter":p.preventDefault();let w=l>=0?l:0,y=a[w];y&&m(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":p.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":p.preventDefault(),a.length>0&&s(0);break;case"End":p.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,m,u,c])};function vr({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function No(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:m,onChange:u,mode:c="single",typeSet:d="field",disabled:p=!1,ClearEnabled:w=!0,helperText:y,error:b=!1,className:v="",...E}=e,D=c==="multiple",[V,P]=Wn.useState(!1),[$,I]=Wn.useState(""),S=Wn.useRef(null),k=Wn.useRef(null),N=Wn.useRef(null);Wn.useImperativeHandle(t,()=>N.current),fr(k,()=>P(!1));let x=rt(s,a,$),[h,M]=Wn.useState(-1),{selectedValues:H,handleSelect:A,handleRemove:j,handleClear:re,getSelectedOptions:Ce}=tt({options:s,labelKey:a,valueKey:l,value:m,multiple:D,onChange:u,typeSet:d,name:o,setSearchTerm:I}),R=br({isOpen:V,setIsOpen:P,multiple:D,searchTerm:$,setSearchTerm:I,selectedValues:H,filteredOptions:x,highlightedIndex:h,setHighlightedIndex:M,handleSelect:A,handleRemove:j}),T=Wn.useId(),z="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",_=g("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",p?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${v}`,children:[r&&jsxRuntime.jsx(F,{htmlFor:T,required:n,children:r}),jsxRuntime.jsxs("div",{ref:S,className:"relative",children:[jsxRuntime.jsxs("div",{className:_,children:[D&&Ce().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ce().map((W,q)=>jsxRuntime.jsx(vr,{option:W,labelKey:a,valueKey:l,onRemove:j},String(W[l]??q)))}),jsxRuntime.jsx("input",{ref:N,...E,name:o,type:"text",placeholder:i,value:$,onChange:W=>{let q=W.target.value;I(q),!V&&q.trim()!==""&&P(!0);},onKeyDown:R,onMouseDown:W=>{document.activeElement===N.current&&(W.preventDefault(),P(q=>{let Z=!q;return Z&&M(0),Z}));},onFocus:()=>{P(!0),M(0);},disabled:p,className:z,role:"combobox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":h>=0?`${T}-opt-${h}`:void 0}),w&&!!H.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:W=>W.preventDefault(),onClick:re,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(Ge,{width:12,height:12})})]}),V&&jsxRuntime.jsx("div",{ref:k,id:T,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":D||void 0,children:x.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):x.map((W,q)=>{let Z=String(W[l]),L=H.includes(Z),U=q===h;return jsxRuntime.jsx("button",{id:`${T}-opt-${q}`,"data-index":q,role:"option","aria-selected":L,type:"button",onMouseDown:De=>De.preventDefault(),onClick:()=>A(W),className:g("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&L&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!L&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(W[a])})},Z)})})]}),b&&jsxRuntime.jsx(G,{children:b}),!b&&y&&jsxRuntime.jsx(O,{children:y})]})})}function Po(){let e=Wn.forwardRef(No);return e.displayName="ComboBox",e}var To=Po(),ql=To;var Lo=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),hr=Lo;var Ro=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),de=Ro;var Do=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),ue=Do;var be=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var Cr=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var st=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let m=s.getFullYear(),u=s.getMonth(),c=new Date(m,u,1),p=new Date(m,u+1,0).getDate(),w=c.getDay(),y=[];for(let b=w-1;b>=0;b--)y.push({date:new Date(m,u,-b),isCurrentMonth:!1});for(let b=1;b<=p;b++)y.push({date:new Date(m,u,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(m,u+1,y.length-p+1),isCurrentMonth:!1});return y};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsxs("div",{className:"font-medium flex gap-1",children:[jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:be[t.getMonth()]}),jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:Cr.map(s=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,m)=>{let c=r&&s.date.toDateString()===r.toDateString(),d=s.date.toDateString()===new Date().toDateString();return jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let p=r??new Date,w=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),p.getHours(),p.getMinutes(),p.getSeconds());n(w);}else n(s.date);},className:`
32
+ `,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{children:e}),jsxRuntime.jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsxRuntime.jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});St.displayName="Accordion";var pi=St;function g(...e){return tailwindMerge.twMerge(zo.clsx(e))}var Vt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h5",{ref:o,className:t?e:g("mb-1 font-medium leading-none tracking-tight",e),...n,children:r})}));Vt.displayName="AlertTitle";var It=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("text-sm [&_p]:leading-relaxed",e),...n,children:r})}));It.displayName="AlertDescription";var Ht=qn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,role:"alert",className:t?e:g("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:-translate-y-0.75 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{default:"bg-background text-foreground border-border",destructive:"border-red-500/50 text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-950/50 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/50 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",success:"border-green-500/50 text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 [&>svg]:text-green-600 dark:[&>svg]:text-green-400"}[r],e),...o,children:n})}));Ht.displayName="Alert";var ki=Ht,Ni=Vt,Pi=It;var At=qn.forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:i,className:t?e:g("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));At.displayName="Badge";var Fi=At;var Bt=({items:e,separator:t="/",overrideClassName:r,className:n})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("nav",{"aria-label":"Breadcrumb",className:r?n:g("flex",n),children:jsxRuntime.jsx("ol",{className:"flex items-center space-x-2",children:e.map((o,i)=>jsxRuntime.jsxs("li",{className:"flex items-center",children:[i>0&&jsxRuntime.jsx("span",{className:"mx-2 text-muted-foreground",children:t}),o.href&&!o.current?jsxRuntime.jsx("a",{href:o.href,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o.label}):jsxRuntime.jsx("span",{className:g("text-sm font-medium",o.current?"text-foreground":"text-muted-foreground"),"aria-current":o.current?"page":void 0,children:o.label})]},i))})})});Bt.displayName="Breadcrumb";var $i=Bt;var Ot=qn__default.default.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},m)=>{let u="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",c={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},d={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},p=t?e:g(u,c[r],d[n],e);return o?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("a",{href:o,className:p,ref:m,children:a&&l?l:i})}):jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{className:p,ref:m,...s,children:a&&l?l:i})})});Ot.displayName="Button";var Ui=Ot;var Gt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));Gt.displayName="Card";var zt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));zt.displayName="CardHeader";var Ut=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h3",{ref:o,className:t?e:g("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Ut.displayName="CardTitle";var Wt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{ref:o,className:t?e:g("text-sm text-muted-foreground",e),...n,children:r})}));Wt.displayName="CardDescription";var qt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("p-6 pt-0",e),...n,children:r})}));qt.displayName="CardContent";var Yt=qn.forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:t?e:g("flex items-center p-6 pt-0",e),...n,children:r})}));Yt.displayName="CardFooter";var Ji=Gt,ji=zt,Zi=Ut,Qi=Wt,es=qt,ts=Yt;var _t=qn.forwardRef(({children:e,isOpen:t,onClose:r,size:n="md",className:o,overrideClassName:i=!1,...a},l)=>(qn.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[t]),qn.useEffect(()=>{let m=u=>{u.key==="Escape"&&r();};return t&&document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),t?jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:l,className:"fixed inset-0 z-50 flex items-center justify-center",...a,children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),jsxRuntime.jsx("div",{className:i?o:g("relative bg-background border border-border rounded-lg shadow-lg w-full mx-4",{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[n],o),children:e})]})}):null));_t.displayName="Dialog";var Xt=qn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-b border-border",t),...n,children:e})}));Xt.displayName="DialogHeader";var Jt=qn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("h2",{ref:o,className:r?t:g("text-lg font-semibold text-foreground",t),...n,children:e})}));Jt.displayName="DialogTitle";var jt=qn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4",t),...n,children:e})}));jt.displayName="DialogContent";var Zt=qn.forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-t border-border flex justify-end space-x-2",t),...n,children:e})}));Zt.displayName="DialogFooter";var ls=_t,cs=Xt,ds=Jt,us=jt,ms=Zt;var Ae=qn.createContext(void 0),er=qn.forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=qn.useState(!1);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsxRuntime.jsx("div",{ref:n,className:g("relative inline-block",t),...r,children:e})})})});er.displayName="DropdownMenu";var tr=({children:e,asChild:t})=>{let r=qn.useContext(Ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return qn.cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{onClick:n,children:e})})};tr.displayName="DropdownMenuTrigger";var rr=qn.forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=qn.useContext(Ae),a=qn.useRef(null);return qn.useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),qn.useEffect(()=>{let s=m=>{a.current&&!a.current.contains(m.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:a,className:g("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});rr.displayName="DropdownMenuContent";var nr=qn.forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=qn.useContext(Ae);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:g("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});nr.displayName="DropdownMenuItem";var or=qn.forwardRef(({className:e,...t},r)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:r,className:g("-mx-1 my-1 h-px bg-border",e),...t})}));or.displayName="DropdownMenuSeparator";var ar=qn.forwardRef(({children:e,className:t,...r},n)=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{ref:n,className:g("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));ar.displayName="DropdownMenuLabel";var hs=er,ys=tr,ws=rr,Cs=nr,ks=or,Ns=ar;var ir=({src:e,alt:t="",fallback:r,size:n="md",className:o})=>{let[i,a]=qn.useState(!1),l={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},s=m=>m.split(" ").map(u=>u.charAt(0)).join("").toUpperCase().slice(0,2);return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:g("relative flex shrink-0 overflow-hidden rounded-full bg-muted",l[n],o),children:e&&!i?jsxRuntime.jsx("img",{src:e||"/placeholder.svg",alt:t,className:"aspect-square h-full w-full object-cover",onError:()=>a(!0)}):jsxRuntime.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted font-medium text-muted-foreground",children:r?s(r):"?"})})})};ir.displayName="Avatar";var Es=ir;var Zn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-muted-foreground",t),children:e})})},O=Zn;var Qn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("label",{...o,className:n?r:g("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsxRuntime.jsx("span",{className:"text-red-600",children:"*"})]})}),F=Qn;var to=({children:e,className:t,overrideClassName:r})=>{if(e)return jsxRuntime.jsx(f,{children:jsxRuntime.jsx("p",{className:r?t:g("text-sm text-red-600 dark:text-red-400",t),children:e})})},G=to;var cr=qn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:m,...u},c)=>{let d=qn.useId(),p=g("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive",a);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsxRuntime.jsx("input",{id:d,type:"checkbox",className:l?a:p,ref:c,...u}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(F,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&s&&jsxRuntime.jsx(O,{children:s})]})})});cr.displayName="CheckBox";var Zs=cr;function io(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:m="vertical",className:u,overrideClassName:c=!1,helperText:d,error:p,label:w,name:y,required:b,...v}=e,E=qn.useId(),D=qn.useMemo(()=>new Map(s.map(k=>[String(k[l]),k])),[s,l]),V=qn.useMemo(()=>o==null?[]:r==="field"?n?o.map(k=>String(k)):[String(o)]:n?o.map(k=>String(k[l])):[String(o[l])],[o,r,n,l]),P=(k,N)=>{if(!i)return;let x;if(r==="field")if(n)x=k.map(M=>{let H=D.get(M);return H?H[l]:M});else {let h=k[0];if(!h)x=void 0;else {let M=D.get(h);x=M?M[l]:h;}}else n?x=k.map(M=>D.get(M)).filter(M=>M!==void 0):x=D.get(k[0]??"")??void 0;i({target:{name:y,value:x,type:"checkboxgroup",checked:N}});},$=k=>{let N;n?N=V.includes(k)?V.filter(x=>x!==k):[...V,k]:N=V[0]===k?[]:[k],P(N,N.includes(k));},I=m==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",S=g("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",u),children:[w&&jsxRuntime.jsx(F,{required:b,children:w}),jsxRuntime.jsx("div",{className:I,children:s.map((k,N)=>{let x=String(k[l]),h=V.includes(x),M=`${E}-${x}-${N}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...v,id:M,ref:t,type:"checkbox",name:y,checked:h,onChange:()=>$(x),className:c?u:S}),jsxRuntime.jsx(F,{htmlFor:M,children:String(k[a])})]},M)})}),!!p&&jsxRuntime.jsx(G,{children:String(p)}),!p&&d&&jsxRuntime.jsx(O,{children:d})]})})}function so(){let e=qn.forwardRef(io);return e.displayName="CheckBoxGroup",e}var lo=so(),cl=lo;var po=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],pr=qn__default.default.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=po,showPresets:i=!0,className:a,error:l,helperText:s,name:m},u)=>{let c=qn.useId(),d=qn.useRef(null),[p,w]=qn.useState(!1),[y,b]=qn.useState("COLOR"),[v,E]=qn.useState("HEX"),[D,V]=qn.useState("#000000"),[P,$]=qn.useState(0),[I,S]=qn.useState(0),[k,N]=qn.useState(0),[x,h]=qn.useState(1),[M,H]=qn.useState("#000000"),[A,j]=qn.useState("#ffffff"),[re,Ce]=qn.useState(90),[R,T]=qn.useState("linear-gradient(90deg, #000000, #ffffff)"),z=(L,U,De)=>Math.min(De,Math.max(U,L)),_=L=>{let U=L.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},W=L=>{r?.({target:{value:L,name:m}});};qn.useEffect(()=>{let L=U=>{d.current&&!d.current.contains(U.target)&&w(!1);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]),qn.useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(D)){let L=_(D);$(L.r),S(L.g),N(L.b);}},[D]),qn.useEffect(()=>{let L=`linear-gradient(${re}deg, ${M}, ${A})`;T(L),y==="GRADIENT"&&W(L);},[M,A,re]);let q=()=>{if(x>=1){if(v==="HEX")return D;if(v==="RGB")return `rgb(${P}, ${I}, ${k})`}return `rgba(${P}, ${I}, ${k}, ${Number(x.toFixed(2))})`},Z=y==="GRADIENT"?R:q();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!n&&w(!p),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsxRuntime.jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),p&&jsxRuntime.jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsxRuntime.jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>b(L),className:`px-2 py-1 text-xs rounded ${y===L?"bg-primary text-white":"border"}`,children:L==="COLOR"?"Cor":"Gradiente"},L))}),jsxRuntime.jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),y==="COLOR"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{ref:u,type:"color",value:D,onChange:L=>{V(L.target.value.toUpperCase()),W(q());},className:"w-full h-10 rounded"}),jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsxs("select",{value:v,onChange:L=>E(L.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsxRuntime.jsx("option",{value:"HEX",children:"HEX"}),jsxRuntime.jsx("option",{value:"RGB",children:"RGB"}),jsxRuntime.jsx("option",{value:"RGBA",children:"RGBA"})]}),v==="HEX"&&jsxRuntime.jsx("input",{value:D,onChange:L=>{let U=L.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),V(U),/^#[0-9A-F]{6}$/.test(U)&&W(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(v==="RGB"||v==="RGBA")&&jsxRuntime.jsx("div",{className:"flex gap-2",children:[{l:"R",v:P,s:$},{l:"G",v:I,s:S},{l:"B",v:k,s:N}].map(({l:L,v:U,s:De})=>jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:L}),jsxRuntime.jsx("input",{type:"number",min:0,max:255,value:U,onChange:Mn=>{De(z(+Mn.target.value,0,255)),W(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},L))})]}),v==="RGBA"&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs font-semibold",children:"A"}),jsxRuntime.jsx("input",{type:"range",min:0,max:1,step:.01,value:x,onChange:L=>{h(+L.target.value),W(q());},className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(x*100),"%"]})]}),i&&jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(L=>jsxRuntime.jsx("button",{type:"button",onClick:()=>{V(L),h(1),W(L);},className:"w-8 h-8 rounded border",style:{background:L}},L))})]}),y==="GRADIENT"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex gap-2 items-center",children:[jsxRuntime.jsx("input",{type:"color",value:M,onChange:L=>H(L.target.value)}),jsxRuntime.jsx("span",{className:"text-xs",children:"\u2192"}),jsxRuntime.jsx("input",{type:"color",value:A,onChange:L=>j(L.target.value)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsxRuntime.jsx("input",{type:"range",min:0,max:360,value:re,onChange:L=>Ce(+L.target.value),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-xs w-10 text-right",children:[re,"\xB0"]})]})]})]})]}),l&&jsxRuntime.jsx(G,{children:l}),!l&&s&&jsxRuntime.jsx(O,{children:s})]})})});pr.displayName="ColorPicker";var vl=pr;var fo=({...e})=>jsxRuntime.jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Ge=fo;var bo=(e,t)=>{qn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},gr=bo;function tt({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,m]=qn.useState([]),u=qn.useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=qn.useCallback(()=>s.map(b=>u.get(b)).filter(b=>!!b),[s,u]),d=qn.useCallback(b=>{if(!o)return;let v;if(a==="field"?n?v=b:v=b[0]??void 0:n?v=b.map(D=>u.get(D)).filter(D=>D!==void 0):v=u.get(b[0]??"")??void 0,i&&!n){let E=u.get(b[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:v,type:"combobox"}});},[n,o,u,l,a,i,t]),p=qn.useCallback(b=>{let v=String(b[r]),E=n?s.includes(v)?s.filter(D=>D!==v):[...s,v]:[v];m(E),d(E);},[n,s,d,r]),w=qn.useCallback(b=>{let v=s.filter(E=>E!==b);m(v),d(v);},[s,d]),y=qn.useCallback(()=>{m([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:p,handleRemove:w,handleClear:y,getSelectedOptions:c}}function rt(e,t,r){return qn.useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var vr=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:m,handleRemove:u})=>{let c=qn.useCallback(p=>{if(a.length===0){s(-1);return}s(w=>w<0?p>0?0:a.length-1:(w+p+a.length)%a.length);},[a,s]);return qn.useCallback(p=>{if(!e){if(p.key==="Enter"||p.key==="ArrowDown"){t(!0),s(0),p.preventDefault();return}r&&p.key==="Backspace"&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));return}switch(p.key){case"ArrowDown":p.preventDefault(),c(1);break;case"ArrowUp":p.preventDefault(),c(-1);break;case"Enter":p.preventDefault();let w=l>=0?l:0,y=a[w];y&&m(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":p.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":p.preventDefault(),a.length>0&&s(0);break;case"End":p.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,m,u,c])};function xr({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxRuntime.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsxRuntime.jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Po(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:m,onChange:u,mode:c="single",typeSet:d="field",disabled:p=!1,ClearEnabled:w=!0,helperText:y,error:b=!1,className:v="",...E}=e,D=c==="multiple",[V,P]=qn.useState(!1),[$,I]=qn.useState(""),S=qn.useRef(null),k=qn.useRef(null),N=qn.useRef(null);qn.useImperativeHandle(t,()=>N.current),gr(k,()=>P(!1));let x=rt(s,a,$),[h,M]=qn.useState(-1),{selectedValues:H,handleSelect:A,handleRemove:j,handleClear:re,getSelectedOptions:Ce}=tt({options:s,labelKey:a,valueKey:l,value:m,multiple:D,onChange:u,typeSet:d,name:o,setSearchTerm:I}),R=vr({isOpen:V,setIsOpen:P,multiple:D,searchTerm:$,setSearchTerm:I,selectedValues:H,filteredOptions:x,highlightedIndex:h,setHighlightedIndex:M,handleSelect:A,handleRemove:j}),T=qn.useId(),z="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",_=g("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",p?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${v}`,children:[r&&jsxRuntime.jsx(F,{htmlFor:T,required:n,children:r}),jsxRuntime.jsxs("div",{ref:S,className:"relative",children:[jsxRuntime.jsxs("div",{className:_,children:[D&&Ce().length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ce().map((W,q)=>jsxRuntime.jsx(xr,{option:W,labelKey:a,valueKey:l,onRemove:j},String(W[l]??q)))}),jsxRuntime.jsx("input",{ref:N,...E,name:o,type:"text",placeholder:i,value:$,onChange:W=>{let q=W.target.value;I(q),!V&&q.trim()!==""&&P(!0);},onKeyDown:R,onMouseDown:W=>{document.activeElement===N.current&&(W.preventDefault(),P(q=>{let Z=!q;return Z&&M(0),Z}));},onFocus:()=>{P(!0),M(0);},disabled:p,className:z,role:"combobox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":h>=0?`${T}-opt-${h}`:void 0}),w&&!!H.length&&jsxRuntime.jsx("button",{type:"button",onMouseDown:W=>W.preventDefault(),onClick:re,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsxRuntime.jsx(Ge,{width:12,height:12})})]}),V&&jsxRuntime.jsx("div",{ref:k,id:T,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":D||void 0,children:x.length===0?jsxRuntime.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):x.map((W,q)=>{let Z=String(W[l]),L=H.includes(Z),U=q===h;return jsxRuntime.jsx("button",{id:`${T}-opt-${q}`,"data-index":q,role:"option","aria-selected":L,type:"button",onMouseDown:De=>De.preventDefault(),onClick:()=>A(W),className:g("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&L&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!L&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsxRuntime.jsx("span",{children:String(W[a])})},Z)})})]}),b&&jsxRuntime.jsx(G,{children:b}),!b&&y&&jsxRuntime.jsx(O,{children:y})]})})}function To(){let e=qn.forwardRef(Po);return e.displayName="ComboBox",e}var Lo=To(),Yl=Lo;var Ro=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),yr=Ro;var Do=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),de=Do;var Mo=({...e})=>jsxRuntime.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),ue=Mo;var be=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var kr=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var st=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let m=s.getFullYear(),u=s.getMonth(),c=new Date(m,u,1),p=new Date(m,u+1,0).getDate(),w=c.getDay(),y=[];for(let b=w-1;b>=0;b--)y.push({date:new Date(m,u,-b),isCurrentMonth:!1});for(let b=1;b<=p;b++)y.push({date:new Date(m,u,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(m,u+1,y.length-p+1),isCurrentMonth:!1});return y};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsxs("div",{className:"font-medium flex gap-1",children:[jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:be[t.getMonth()]}),jsxRuntime.jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:kr.map(s=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,m)=>{let c=r&&s.date.toDateString()===r.toDateString(),d=s.date.toDateString()===new Date().toDateString();return jsxRuntime.jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let p=r??new Date,w=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),p.getHours(),p.getMinutes(),p.getSeconds());n(w);}else n(s.date);},className:`
33
33
  p-2 cursor-pointer text-sm rounded hover:bg-accent
34
34
  ${s.isCurrentMonth?"text-foreground":"text-muted-foreground"}
35
35
  ${c?"bg-primary text-primary-foreground hover:bg-primary":""}
36
36
  ${d&&!c?"bg-accent font-medium":""}
37
- `,children:s.date.getDate()},m)})})]})};var kr=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let m=new Date(s.getFullYear(),0,4),u=1+Math.round(((s.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(u).padStart(2,"0")}`}}};var lt=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return be?`${be[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var Fo=(e,t)=>{Wn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Nr=Fo;var Tr=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:be.map((s,m)=>{let u=r,c=u&&u.getFullYear()===l&&u.getMonth()===m;return jsxRuntime.jsx("button",{type:"button",onClick:()=>{e(new Date(l,m,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Lr=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
37
+ `,children:s.date.getDate()},m)})})]})};var Nr=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let m=new Date(s.getFullYear(),0,4),u=1+Math.round(((s.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(u).padStart(2,"0")}`}}};var lt=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return be?`${be[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var So=(e,t)=>{qn.useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Pr=So;var Lr=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsxRuntime.jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:be.map((s,m)=>{let u=r,c=u&&u.getFullYear()===l&&u.getMonth()===m;return jsxRuntime.jsx("button",{type:"button",onClick:()=>{e(new Date(l,m,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Rr=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
38
38
  ${String(n).padStart(2,"0")}:
39
39
  ${String(o).padStart(2,"0")}:
40
40
  ${String(i).padStart(2,"0")}
41
- `,l=Array.from({length:24},(c,d)=>d),s=Array.from({length:60},(c,d)=>d),m=Array.from({length:60},(c,d)=>d),u=(c,d,p)=>{let w=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,d,p);t(w);};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(F,{className:"flex items-center gap-2",children:["Hora",jsxRuntime.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxRuntime.jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:m.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Rr=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,d)=>d+1),s=e,m=c=>{let d=new Date(a,0,1+(c-1)*7);r(d),i(!1);},u=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let d=new Date(c.getFullYear(),0,4),p=1+Math.round(((c.getTime()-d.getTime())/864e5-3+(d.getDay()+6)%7)/7);return {year:c.getFullYear(),week:p}})();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let d=u&&u.year===a&&u.week===c;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>m(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${d?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var Mr=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsxRuntime.jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var Fr=Wn.forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:m=!1,helperText:u,className:c,...d},p)=>{let w=Wn.useId(),y=Wn.useRef(null),b=Wn.useRef(null),[v,E]=Wn.useState(!1),[D,V]=Wn.useState(0),[P,$]=Wn.useState(r),[I,S]=Wn.useState(()=>r?lt(r,a,l):""),[k,N]=Wn.useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Nr(y,()=>E(!1));let x=P??new Date,h=new Date(x.getFullYear(),x.getMonth()+D,1),M=R=>{b.current=R,typeof p=="function"?p(R):p&&(p.current=R);},H=R=>{$(R);let T=kr(R,a),z=lt(R,a,l);S(z),b.current&&(b.current.value=T,o?.({target:{name:b.current.name,value:T},type:"change"}),V(0));},A=(R,T,z)=>{let _=new Date(R,T+1,0).getDate();return Math.min(z,_)},j=R=>{let T=R.replace(/\D/g,"").slice(0,8),z=[];return T.length>=2&&z.push(T.slice(0,2)),T.length>=4&&z.push(T.slice(2,4)),T.length>4&&z.push(T.slice(4)),z.join("/")},re=R=>{let T=R.target.value,z=j(T);if(S(z),z.length===10){let[_,W,q]=z.split("/").map(Number),Z=new Date(q,W-1,_);isNaN(Z.getTime())||H(Z);}},Ce=()=>{switch(k){case"year":return jsxRuntime.jsx(Mr,{currentYear:h.getFullYear(),selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onPick:R=>{let T=P??new Date,z=A(R,T.getMonth(),T.getDate()),_=new Date(R,T.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="year"?(H(_),E(!1)):N(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsxRuntime.jsx(Tr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),closeOnSelect:a==="month",onChange:R=>{let T=P??new Date,z=A(R.getFullYear(),R.getMonth(),T.getDate()),_=new Date(R.getFullYear(),R.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="month"?(H(_),E(!1)):N("day");}});case"week":return jsxRuntime.jsx(Rr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),onChange:R=>{H(R),E(!1);}});case"day":default:return a==="datetime-local"?jsxRuntime.jsxs("div",{className:"flex h-fit gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{let T=P??new Date,z=new Date(R.getFullYear(),R.getMonth(),R.getDate(),T.getHours(),T.getMinutes(),T.getSeconds());H(z);}})}),jsxRuntime.jsx("div",{className:"w-fit",children:jsxRuntime.jsx(Lr,{selectedDate:P,onChange:R=>H(R)})})]}):jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{H(R),E(!1);}})}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:w,required:t,children:e}),jsxRuntime.jsx("input",{ref:M,id:w,name:n,type:"text",className:"sr-only",disabled:s,...d}),jsxRuntime.jsxs("div",{ref:y,className:"relative",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",value:I,onChange:re,onFocus:()=>!s&&E(!0),placeholder:i,disabled:s,className:`
41
+ `,l=Array.from({length:24},(c,d)=>d),s=Array.from({length:60},(c,d)=>d),m=Array.from({length:60},(c,d)=>d),u=(c,d,p)=>{let w=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,d,p);t(w);};return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(F,{className:"flex items-center gap-2",children:["Hora",jsxRuntime.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxRuntime.jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsxRuntime.jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:m.map(c=>jsxRuntime.jsx("button",{type:"button",onClick:()=>u(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Dr=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,d)=>d+1),s=e,m=c=>{let d=new Date(a,0,1+(c-1)*7);r(d),i(!1);},u=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let d=new Date(c.getFullYear(),0,4),p=1+Math.round(((c.getTime()-d.getTime())/864e5-3+(d.getDay()+6)%7)/7);return {year:c.getFullYear(),week:p}})();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let d=u&&u.year===a&&u.week===c;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>m(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${d?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var Er=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(de,{width:16,height:16})}),jsxRuntime.jsx("h3",{className:"font-medium",children:e}),jsxRuntime.jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsxRuntime.jsx(ue,{width:16,height:16})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsxRuntime.jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var Sr=qn.forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:m=!1,helperText:u,className:c,...d},p)=>{let w=qn.useId(),y=qn.useRef(null),b=qn.useRef(null),[v,E]=qn.useState(!1),[D,V]=qn.useState(0),[P,$]=qn.useState(r),[I,S]=qn.useState(()=>r?lt(r,a,l):""),[k,N]=qn.useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Pr(y,()=>E(!1));let x=P??new Date,h=new Date(x.getFullYear(),x.getMonth()+D,1),M=R=>{b.current=R,typeof p=="function"?p(R):p&&(p.current=R);},H=R=>{$(R);let T=Nr(R,a),z=lt(R,a,l);S(z),b.current&&(b.current.value=T,o?.({target:{name:b.current.name,value:T},type:"change"}),V(0));},A=(R,T,z)=>{let _=new Date(R,T+1,0).getDate();return Math.min(z,_)},j=R=>{let T=R.replace(/\D/g,"").slice(0,8),z=[];return T.length>=2&&z.push(T.slice(0,2)),T.length>=4&&z.push(T.slice(2,4)),T.length>4&&z.push(T.slice(4)),z.join("/")},re=R=>{let T=R.target.value,z=j(T);if(S(z),z.length===10){let[_,W,q]=z.split("/").map(Number),Z=new Date(q,W-1,_);isNaN(Z.getTime())||H(Z);}},Ce=()=>{switch(k){case"year":return jsxRuntime.jsx(Er,{currentYear:h.getFullYear(),selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onPick:R=>{let T=P??new Date,z=A(R,T.getMonth(),T.getDate()),_=new Date(R,T.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="year"?(H(_),E(!1)):N(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsxRuntime.jsx(Lr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),closeOnSelect:a==="month",onChange:R=>{let T=P??new Date,z=A(R.getFullYear(),R.getMonth(),T.getDate()),_=new Date(R.getFullYear(),R.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="month"?(H(_),E(!1)):N("day");}});case"week":return jsxRuntime.jsx(Dr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),onChange:R=>{H(R),E(!1);}});case"day":default:return a==="datetime-local"?jsxRuntime.jsxs("div",{className:"flex h-fit gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{let T=P??new Date,z=new Date(R.getFullYear(),R.getMonth(),R.getDate(),T.getHours(),T.getMinutes(),T.getSeconds());H(z);}})}),jsxRuntime.jsx("div",{className:"w-fit",children:jsxRuntime.jsx(Rr,{selectedDate:P,onChange:R=>H(R)})})]}):jsxRuntime.jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{H(R),E(!1);}})}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:w,required:t,children:e}),jsxRuntime.jsx("input",{ref:M,id:w,name:n,type:"text",className:"sr-only",disabled:s,...d}),jsxRuntime.jsxs("div",{ref:y,className:"relative",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",value:I,onChange:re,onFocus:()=>!s&&E(!0),placeholder:i,disabled:s,className:`
42
42
  w-full px-3 py-2 pr-9 border rounded-md bg-background
43
43
  ${m?"border-red-500":"border-input"}
44
44
  ${s?"opacity-50 cursor-not-allowed":"hover:border-ring"}
45
45
  focus:ring-2 focus:ring-ring focus:ring-offset-2
46
- `}),jsxRuntime.jsx(hr,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),v&&jsxRuntime.jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:Ce()})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&u&&jsxRuntime.jsx(O,{children:u})]})})});Fr.displayName="DatePicker";var Wc=Fr;var Ue=({size:e="md",variant:t="default",color:r="primary",className:n="",speed:o="normal",text:i,textPosition:a="bottom",overlay:l=!1,progress:s})=>{let[m,u]=Wn.useState(s||0);Wn.useEffect(()=>{s!==void 0&&u(Math.min(Math.max(s,0),100));},[s]);let c=()=>{switch(e){case"xs":return "w-3 h-3";case"sm":return "w-4 h-4";case"lg":return "w-8 h-8";case"xl":return "w-12 h-12";case"xxl":return "w-16 h-16";default:return "w-6 h-6"}},d=()=>{switch(r){case"secondary":return "text-gray-500 dark:text-gray-400";case"muted":return "text-gray-400 dark:text-gray-500";case"success":return "text-green-600 dark:text-green-400";case"danger":return "text-red-600 dark:text-red-400";case"warning":return "text-yellow-600 dark:text-yellow-400";case"info":return "text-blue-400 dark:text-blue-300";case"white":return "text-white dark:text-gray-200";default:return "text-blue-600 dark:text-blue-400"}},p=()=>{switch(o){case"slow":return "animate-[spin_2s_linear_infinite]";case"fast":return "animate-[spin_0.5s_linear_infinite]";default:return "animate-spin"}},w=()=>{switch(o){case"slow":return "animate-pulseSlow";case"fast":return "animate-pulseFast";default:return "animate-pulse"}},y=()=>{switch(o){case"slow":return "animate-bounceSlow";case"fast":return "animate-bounceFast";default:return "animate-bounce"}},b=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-3 h-3";case"xl":return "w-4 h-4";case"xxl":return "w-5 h-5";default:return "w-2 h-2"}},v=()=>{switch(e){case"xs":return "w-0.5 h-3";case"sm":return "w-0.5 h-4";case"lg":return "w-1 h-8";case"xl":return "w-1.5 h-12";case"xxl":return "w-2 h-16";default:return "w-1 h-6"}},E=()=>{switch(e){case"xs":return "w-0.5";case"sm":return "w-1";case"lg":return "w-1.5";case"xl":return "w-2";case"xxl":return "w-2.5";default:return "w-1"}},D=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-2 h-2";case"xl":return "w-3 h-3";case"xxl":return "w-4 h-4";default:return "w-1.5 h-1.5"}},V=()=>t==="dots"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${w()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="bars"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3].map(S=>jsxRuntime.jsx("div",{className:`${v()} ${d()} bg-current ${w()}`,style:{animationDelay:`${S*.15}s`}},S))}):t==="ring"?jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 border-t-current rounded-full ${p()} ${d()}`})}):t==="pulse"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsx("div",{className:`w-full h-full bg-current rounded-full ${w()}`})}):t==="wave"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3,4].map(S=>jsxRuntime.jsx("div",{className:`${E()} ${d()} bg-current rounded animate-wave`,style:{animationDelay:`${S*.15}s`,height:e==="xs"?"8px":e==="sm"?"10px":e==="lg"?"16px":e==="xl"?"20px":e==="xxl"?"24px":"12px"}},S))}):t==="bounce"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${y()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="grid"?jsxRuntime.jsx("div",{className:`${c()} ${d()} grid grid-cols-3 gap-0.5`,children:[...Array(9)].map((S,k)=>jsxRuntime.jsx("div",{className:`${D()} bg-current rounded-full ${w()}`,style:{animationDelay:`${k*.1}s`}},k))}):t==="clock"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsx("div",{className:"w-full h-full border-2 border-current rounded-full"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-2/5 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock",style:{animationDelay:"-4s"}})]}):t==="orbit"?jsxRuntime.jsxs("div",{className:`${c()} relative`,children:[jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 rounded-full ${d()}`}),jsxRuntime.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2",children:jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full animate-orbit`})})]}):t==="cube"?jsxRuntime.jsxs("div",{className:`${c()} ${d()} relative transform-style-3d animate-rotateCube`,children:[jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateY(90deg)"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateX(90deg)"})]}):t==="circle-dots"?jsxRuntime.jsx("div",{className:`${c()} relative ${d()}`,children:[...Array(8)].map((S,k)=>jsxRuntime.jsx("div",{className:"absolute w-full h-full animate-circleDots",style:{transform:`rotate(${k*45}deg)`},children:jsxRuntime.jsx("div",{className:`${b()} bg-current rounded-full absolute top-0 left-1/2 -translate-x-1/2 animate-fadePulse`,style:{animationDelay:`${k*.1}s`}})},k))}):t==="infinity"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsxs("svg",{viewBox:"0 0 120 30",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"15",cy:"15",r:"12",className:"animate-infinity1"}),jsxRuntime.jsx("circle",{cx:"60",cy:"15",r:"12",className:"animate-infinity2"}),jsxRuntime.jsx("circle",{cx:"105",cy:"15",r:"12",className:"animate-infinity3"})]})}):t==="progress"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[jsxRuntime.jsx("path",{className:"text-gray-200 dark:text-gray-700",stroke:"currentColor",strokeWidth:"3",fill:"transparent",d:`M18 2.0845\r
46
+ `}),jsxRuntime.jsx(yr,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),v&&jsxRuntime.jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:Ce()})]}),m&&jsxRuntime.jsx(G,{children:m}),!m&&u&&jsxRuntime.jsx(O,{children:u})]})})});Sr.displayName="DatePicker";var qc=Sr;var Ue=({size:e="md",variant:t="default",color:r="primary",className:n="",speed:o="normal",text:i,textPosition:a="bottom",overlay:l=!1,progress:s})=>{let[m,u]=qn.useState(s||0);qn.useEffect(()=>{s!==void 0&&u(Math.min(Math.max(s,0),100));},[s]);let c=()=>{switch(e){case"xs":return "w-3 h-3";case"sm":return "w-4 h-4";case"lg":return "w-8 h-8";case"xl":return "w-12 h-12";case"xxl":return "w-16 h-16";default:return "w-6 h-6"}},d=()=>{switch(r){case"secondary":return "text-gray-500 dark:text-gray-400";case"muted":return "text-gray-400 dark:text-gray-500";case"success":return "text-green-600 dark:text-green-400";case"danger":return "text-red-600 dark:text-red-400";case"warning":return "text-yellow-600 dark:text-yellow-400";case"info":return "text-blue-400 dark:text-blue-300";case"white":return "text-white dark:text-gray-200";default:return "text-blue-600 dark:text-blue-400"}},p=()=>{switch(o){case"slow":return "animate-[spin_2s_linear_infinite]";case"fast":return "animate-[spin_0.5s_linear_infinite]";default:return "animate-spin"}},w=()=>{switch(o){case"slow":return "animate-pulseSlow";case"fast":return "animate-pulseFast";default:return "animate-pulse"}},y=()=>{switch(o){case"slow":return "animate-bounceSlow";case"fast":return "animate-bounceFast";default:return "animate-bounce"}},b=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-3 h-3";case"xl":return "w-4 h-4";case"xxl":return "w-5 h-5";default:return "w-2 h-2"}},v=()=>{switch(e){case"xs":return "w-0.5 h-3";case"sm":return "w-0.5 h-4";case"lg":return "w-1 h-8";case"xl":return "w-1.5 h-12";case"xxl":return "w-2 h-16";default:return "w-1 h-6"}},E=()=>{switch(e){case"xs":return "w-0.5";case"sm":return "w-1";case"lg":return "w-1.5";case"xl":return "w-2";case"xxl":return "w-2.5";default:return "w-1"}},D=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-2 h-2";case"xl":return "w-3 h-3";case"xxl":return "w-4 h-4";default:return "w-1.5 h-1.5"}},V=()=>t==="dots"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${w()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="bars"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3].map(S=>jsxRuntime.jsx("div",{className:`${v()} ${d()} bg-current ${w()}`,style:{animationDelay:`${S*.15}s`}},S))}):t==="ring"?jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 border-t-current rounded-full ${p()} ${d()}`})}):t==="pulse"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsx("div",{className:`w-full h-full bg-current rounded-full ${w()}`})}):t==="wave"?jsxRuntime.jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3,4].map(S=>jsxRuntime.jsx("div",{className:`${E()} ${d()} bg-current rounded animate-wave`,style:{animationDelay:`${S*.15}s`,height:e==="xs"?"8px":e==="sm"?"10px":e==="lg"?"16px":e==="xl"?"20px":e==="xxl"?"24px":"12px"}},S))}):t==="bounce"?jsxRuntime.jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${y()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="grid"?jsxRuntime.jsx("div",{className:`${c()} ${d()} grid grid-cols-3 gap-0.5`,children:[...Array(9)].map((S,k)=>jsxRuntime.jsx("div",{className:`${D()} bg-current rounded-full ${w()}`,style:{animationDelay:`${k*.1}s`}},k))}):t==="clock"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsx("div",{className:"w-full h-full border-2 border-current rounded-full"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock"}),jsxRuntime.jsx("div",{className:"absolute top-1/2 left-1/2 w-2/5 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock",style:{animationDelay:"-4s"}})]}):t==="orbit"?jsxRuntime.jsxs("div",{className:`${c()} relative`,children:[jsxRuntime.jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 rounded-full ${d()}`}),jsxRuntime.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2",children:jsxRuntime.jsx("div",{className:`${b()} ${d()} bg-current rounded-full animate-orbit`})})]}):t==="cube"?jsxRuntime.jsxs("div",{className:`${c()} ${d()} relative transform-style-3d animate-rotateCube`,children:[jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateY(90deg)"}),jsxRuntime.jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateX(90deg)"})]}):t==="circle-dots"?jsxRuntime.jsx("div",{className:`${c()} relative ${d()}`,children:[...Array(8)].map((S,k)=>jsxRuntime.jsx("div",{className:"absolute w-full h-full animate-circleDots",style:{transform:`rotate(${k*45}deg)`},children:jsxRuntime.jsx("div",{className:`${b()} bg-current rounded-full absolute top-0 left-1/2 -translate-x-1/2 animate-fadePulse`,style:{animationDelay:`${k*.1}s`}})},k))}):t==="infinity"?jsxRuntime.jsx("div",{className:`${c()} ${d()}`,children:jsxRuntime.jsxs("svg",{viewBox:"0 0 120 30",className:"w-full h-full",children:[jsxRuntime.jsx("circle",{cx:"15",cy:"15",r:"12",className:"animate-infinity1"}),jsxRuntime.jsx("circle",{cx:"60",cy:"15",r:"12",className:"animate-infinity2"}),jsxRuntime.jsx("circle",{cx:"105",cy:"15",r:"12",className:"animate-infinity3"})]})}):t==="progress"?jsxRuntime.jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxRuntime.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[jsxRuntime.jsx("path",{className:"text-gray-200 dark:text-gray-700",stroke:"currentColor",strokeWidth:"3",fill:"transparent",d:`M18 2.0845\r
47
47
  a 15.9155 15.9155 0 0 1 0 31.831\r
48
48
  a 15.9155 15.9155 0 0 1 0 -31.831`}),jsxRuntime.jsx("path",{className:"transition-all duration-300",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"transparent",strokeDasharray:"100, 100",strokeDashoffset:100-m,d:`M18 2.0845\r
49
49
  a 15.9155 15.9155 0 0 1 0 31.831\r
50
- a 15.9155 15.9155 0 0 1 0 -31.831`})]}),e!=="xs"&&e!=="sm"&&jsxRuntime.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium",children:[m,"%"]})]}):jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsxs("svg",{className:`${p()} ${d()}`,fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),P=()=>{switch(a){case"top":return "flex-col-reverse";case"left":return "flex-row-reverse";case"right":return "flex-row";default:return "flex-col"}},$=()=>{switch(e){case"xs":case"sm":return "text-xs";case"lg":return "text-base";case"xl":case"xxl":return "text-lg";default:return "text-sm"}},I=jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`inline-flex ${i?`items-center ${P()} space-y-1 space-x-0 ${a==="left"||a==="right"?"space-y-0 space-x-2":""}`:""}`,children:[V(),i&&jsxRuntime.jsx("span",{className:`${$()} text-gray-500 dark:text-gray-400`,children:i})]})});return l?jsxRuntime.jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50",children:I}):jsxRuntime.jsx("div",{className:n,children:I})};Ue.displayName="Spinner";var Sr=Ue,Vr=({text:e="Carregando...",size:t="md",variant:r="default",color:n="primary",className:o="",textPosition:i="right"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:o,children:jsxRuntime.jsx(Ue,{size:t,variant:r,color:n,text:e,textPosition:i})})});Vr.displayName="LoadingSpinner";var Xc=Vr,Ir=({isVisible:e,text:t="Carregando...",variant:r="default",size:n="lg",className:o=""})=>e?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50 ${o}`,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntime.jsx(Ue,{size:n,variant:r}),jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:t})]})})}):null;Ir.displayName="LoadingOverlay";var Jc=Ir,Hr=({size:e="sm",color:t="primary"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`${(()=>{switch(e){case"xs":return "w-3 h-3";case"md":return "w-5 h-5";default:return "w-4 h-4"}})()} ${t==="white"?"text-white":"text-current"}`,children:jsxRuntime.jsxs("svg",{className:"animate-spin",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})});Hr.displayName="ButtonSpinner";var jc=Hr,$r=({lines:e=3,className:t=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`space-y-3 ${t}`,children:[...Array(e)].map((r,n)=>jsxRuntime.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",style:{width:n===e-1?"60%":"100%"}},n))})});$r.displayName="ContentLoader";var Zc=$r,Ar=({width:e="100%",height:t="1rem",circle:r=!1,className:n=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`bg-gray-200 dark:bg-gray-700 animate-pulse ${r?"rounded-full":"rounded"} ${n}`,style:{width:e,height:t}})});Ar.displayName="Skeleton";var Qc=Ar;var Br=({children:e,type:t,className:r,overrideClassName:n=!1})=>{if(e)switch(t){case"loading":return jsxRuntime.jsxs("p",{className:n?r:g("text-sm text-muted-foreground flex items-center gap-2",r),children:[jsxRuntime.jsx(Sr,{size:"xs"}),e]});case"error":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-red-600 dark:text-red-400",r),children:e});case"warning":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-yellow-600 dark:text-yellow-400",r),children:e});case"success":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-green-600 dark:text-green-400",r),children:e});case"info":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-blue-600 dark:text-blue-400",r),children:e});case"helper":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-muted-foreground",r),children:e});default:return null}};Br.displayName="FieldFeedback";var We=Br;var zo=({children:e,before:t,after:r,className:n})=>{let i=Go__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},ut=zo;var Uo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),zr=Uo;var Wo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),Wr=Wo;function qr(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Yr(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function Kr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function _r(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Xr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Jr(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function jr(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function Zr(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var qo=({e,mask:t})=>{switch(t){case"money":return Yr(e);case"mobile":return _r(e);case"phone":return Xr(e);case"cpfCnpj":return Jr(e);case"cpf":return Kr(e);case"rg":return jr(e);case"cnpj":return Zr(e);case"cep":return qr(e);default:return e}},Qr=qo;var _o=({mask:e,initialValue:t=""})=>{let[r,n]=Wn.useState(t);Wn.useEffect(()=>{t!==r&&n(t);},[t]);let o=Wn.useCallback(a=>{let s=Qr({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=Wn.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},tn=_o;var rn=Wn.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:m,ClearEnabled:u=!0,className:c,overrideClassName:d=!1,error:p,helperText:w,value:y=void 0,onChange:b,...v},E)=>{let D=Wn.useId(),{handleChange:V,handleClear:P,setValue:$}=tn({mask:r,initialValue:y}),I=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",p&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",c),S=N=>{V(N),b?.(N);},k=()=>{P(),$(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:D,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ut,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(zr,{children:o}),jsxRuntime.jsx("input",{id:D,ref:E,name:n,onChange:S,className:d?c:I,...v}),u&&y&&jsxRuntime.jsx(Ge,{onClick:k,width:12,height:12,className:g("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(Wr,{children:i})]}),s&&jsxRuntime.jsx(ut,{after:!0,className:m,children:s})]}),p&&jsxRuntime.jsx(G,{children:p}),!p&&w&&jsxRuntime.jsx(O,{children:w})]})})});rn.displayName="Input";var Md=rn;var on=Wn.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:m,className:u,charType:c="numeric",customPattern:d,caseMode:p="none",...w},y)=>{let b=Wn.useId(),v=Wn.useRef([]),E=x=>{switch(p){case"upper":return x.toUpperCase();case"lower":case"visual-upper":return x.toLowerCase();case"visual-lower":return x.toUpperCase();default:return x}},D=x=>{if(!x)return "";let h=x.slice(0,1);switch(h=E(h),c){case"numeric":return /\d/.test(h)?h:"";case"alpha":return /[A-Za-z]/.test(h)?h:"";case"alphanumeric":return /[A-Za-z0-9]/.test(h)?h:"";case"custom":return d?.test(h)?h:"";default:return h}},V=()=>(r!=null?String(r):"").split("").map(D).slice(0,e),P=V().concat(Array(e).fill(" ")).slice(0,e),$=x=>{let h=x.split("").map(D).join("").slice(0,e),M=h===""?void 0:typeof r=="number"?Number(h):h;s?.({target:{name:n,value:M}});},I=(x,h)=>{let M=D(h),H=V();if(M===""){H[x]="",$(H.join(""));return}if(h.length>1){let A=h.split("").map(D).join("").slice(0,e);$(A),v.current[Math.min(A.length-1,e-1)]?.focus();return}M&&(H[x]=M,$(H.join("")),x<e-1&&v.current[x+1]?.focus());},S=x=>{let h=V();!h[x]&&x>0?h[x-1]="":h[x]="",$(h.join("")),x>0&&v.current[x-1]?.focus();},k=x=>{x.preventDefault();let M=x.clipboardData.getData("text").split("").map(D).join("").slice(0,e);M&&($(M),v.current[Math.min(M.length-1,e-1)]?.focus());},N=x=>{switch(p){case"upper":case"visual-upper":return x.toUpperCase();case"lower":case"visual-lower":return x.toLowerCase();default:return x}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(F,{htmlFor:b,required:i,children:o}),jsxRuntime.jsx("div",{className:g("flex gap-3 items-center",l&&"text-red-500",u),...w,children:P.map((x,h)=>{let M=t&&h>0&&h%t===0;return jsxRuntime.jsxs(Wn__default.default.Fragment,{children:[M&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:N(x).trim(),ref:H=>{v.current[h]=H,h===0&&y&&(typeof y=="function"?y(H):typeof y=="object"&&(y.current=H));},onPaste:k,onChange:H=>I(h,H.target.value),onKeyDown:H=>H.key==="Backspace"&&S(h),onBlur:m,className:g("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},h)})}),l&&jsxRuntime.jsx(G,{children:l}),!l&&a&&jsxRuntime.jsx(O,{children:a})]})})});on.displayName="OtpInput";var Bd=on;var an=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...m},u)=>{let c=Wn.useId(),d=g("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:c,type:"radio",className:a?i:d,ref:u,...m}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(F,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(G,{children:s}),!s&&l&&jsxRuntime.jsx(O,{children:l})]})})});an.displayName="Radio";var _d=an;function aa(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:m,overrideClassName:u=!1,helperText:c,error:d,typeSet:p="field",value:w,onChange:y,...b}=e,v=Wn.useId(),E=Wn.useMemo(()=>new Map(l.map(I=>[String(I[a]),I])),[l,a]),D=Wn.useMemo(()=>w==null?"":String(p==="field"?w:w[a]),[w,p,a]),V=I=>{if(!y)return;let S;if(p==="field"){let k=E.get(I);if(k)S=k[a];else {let N=Number(I);S=Number.isNaN(N)?I:N;}}else S=E.get(I)??void 0;y({target:{name:o,value:S,type:"radiogroup",checked:!0}});},P=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=g("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",m),children:[r&&jsxRuntime.jsx(F,{required:n,children:r}),jsxRuntime.jsx("div",{className:P,children:l.map((I,S)=>{let k=String(I[a]),N=`${v}-${k}-${S}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:N,ref:t,name:o,type:"radio",checked:D===k,onChange:()=>V(k),className:u?m:$}),jsxRuntime.jsx(F,{htmlFor:N,children:String(I[i])})]},N)})}),d&&jsxRuntime.jsx(G,{children:String(d)}),!d&&c&&jsxRuntime.jsx(O,{children:c})]})})}function ia(){let e=Wn.forwardRef(aa);return e.displayName="RadioGroup",e}var sa=ia(),au=sa;var la=["loading","error","warning","success","info","helper"],Ye=e=>{if(!e)return null;let t=la.find(r=>e[r]);return t?{type:t,message:e[t]}:null};var cn=Wn.forwardRef(({label:e,required:t,className:r,showValue:n=!1,min:o=0,max:i=100,step:a=1,value:l,overrideClassName:s,feedback:m,...u},c)=>{let d=Wn.useId(),p=(Number(l)-Number(o))/(Number(i)-Number(o))*100,w=Ye(m),y=g("w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer slider","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[(e||n)&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[e&&jsxRuntime.jsx(F,{htmlFor:d,required:t,children:e}),n&&jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"range",id:d,ref:c,min:o,max:i,step:a,value:l,className:s?r:y,style:{background:`linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${p}%, hsl(var(--secondary)) ${p}%, hsl(var(--secondary)) 100%)`},...u}),w&&jsxRuntime.jsx(We,{type:w.type,children:w.message})]})]})})});cn.displayName="Range";var bu=cn;var ma=({value:e,defaultValue:t,onChange:r})=>{let[n,o]=Wn.useState(t),i=e!==void 0;return [i?e:n??t,s=>{i||o(s),r?.(s);}]},dn=ma;var mn=Wn.forwardRef(({min:e=0,max:t=100,step:r=1,value:n,defaultValue:o=[e,t],onChange:i,disabled:a,label:l,showValues:s=!0,className:m="",feedback:u,required:c},d)=>{let p=Wn.useId(),w=Wn.useRef(null),y=Wn.useRef(null),b=Ye(u),[v,E]=dn({value:n,defaultValue:o,onChange:P=>i?.({target:{value:P}})}),D=P=>(P-e)/(t-e)*100,V=Wn.useCallback(P=>{if(!w.current||!y.current||a)return;let $=w.current.getBoundingClientRect(),I=Math.min(100,Math.max(0,(P-$.left)/$.width*100)),S=e+I/100*(t-e),k=Math.round(S/r)*r,N=[...v];y.current==="min"?N[0]=Math.min(k,v[1]):N[1]=Math.max(k,v[0]),E(N);},[v,e,t,r,E,a]);return Wn.useEffect(()=>{let P=I=>V(I.clientX),$=()=>y.current=null;return document.addEventListener("mousemove",P),document.addEventListener("mouseup",$),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$);}},[V]),jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:d,className:`space-y-2 ${m}`,children:[l&&jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx(F,{htmlFor:p,required:c,children:l}),s&&jsxRuntime.jsxs("span",{className:"text-sm text-muted-foreground",children:[v[0]," \u2013 ",v[1]]})]}),jsxRuntime.jsxs("div",{ref:w,className:"relative h-2 bg-secondary rounded-full",children:[jsxRuntime.jsx("div",{className:"absolute h-2 bg-primary rounded-full",style:{left:`${D(v[0])}%`,width:`${D(v[1])-D(v[0])}%`}}),["min","max"].map(P=>jsxRuntime.jsx("div",{onMouseDown:()=>y.current=P,className:`absolute w-5 h-5 bg-background border-2 border-primary rounded-full\r
51
- top-1/2 -translate-y-1/2 -translate-x-1/2 cursor-pointer`,style:{left:`${D(P==="min"?v[0]:v[1])}%`}},P))]}),b&&jsxRuntime.jsx(We,{type:b.type,children:b.message})]})})});mn.displayName="RangeSlider";var Lu=mn;function ha({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...m},u){let c=Wn.useId(),d=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("select",{id:c,ref:u,className:d,...m,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((p,w)=>jsxRuntime.jsx("option",{value:String(p[o]),children:String(p[n])},w))]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})}function ya(){let e=Wn.forwardRef(ha);return e.displayName="Select",e}var wa=ya(),Au=wa;var fn=Wn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:m,...u},c)=>{let d=Wn.useId();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,name:m,checked:i,className:"peer sr-only",ref:c,...u}),jsxRuntime.jsx("label",{htmlFor:d,className:g("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsxRuntime.jsx("span",{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(F,{id:`${d}-label`,htmlFor:d,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]})})});fn.displayName="Switch";var Yu=fn;var gn=Wn__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},m)=>{let u=Wn.useId(),[c,d]=Wn.useState(0),p=g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:u,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:u,className:i?o:p,maxLength:n,onInput:w=>d(w.currentTarget.textLength),ref:m,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})});gn.displayName="TextArea";var tm=gn;var vn=Wn.createContext(void 0),sm=()=>{let e=Wn.useContext(vn);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},lm=({children:e})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Ea,{children:e})}),Ea=({children:e})=>{let[t,r]=Wn.useState([]),n=Wn.useCallback(a=>{r(l=>l.filter(s=>s.id!==a));},[]),o=Wn.useCallback(a=>{let l=crypto.randomUUID(),s={...a,id:l};r(m=>[...m,s]),a.duration!==0&&setTimeout(()=>{n(l);},a.duration??5e3);},[n]),i=Wn.useMemo(()=>({toasts:t,addToast:o,removeToast:n}),[t,o,n]);return jsxRuntime.jsxs(vn.Provider,{value:i,children:[e,jsxRuntime.jsx(Fa,{toasts:t,onRemove:n})]})},Fa=({toasts:e,onRemove:t})=>jsxRuntime.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(r=>jsxRuntime.jsx(xn,{toast:r,onRemove:t},r.id))}),xn=({toast:e,onRemove:t})=>jsxRuntime.jsx("div",{className:`min-w-80 max-w-md p-4 border rounded-md shadow-lg animate-in slide-in-from-right-full ${{default:"bg-white border-gray-200 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100",success:"bg-green-50 border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200",warning:"bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900/20 dark:border-yellow-800 dark:text-yellow-200",destructive:"bg-red-50 border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}[e.variant??"default"]}`,children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[e.title&&jsxRuntime.jsx("h4",{className:"font-medium mb-1",children:e.title}),jsxRuntime.jsx("p",{className:"text-sm",children:e.description})]}),jsxRuntime.jsx("button",{onClick:()=>t(e.id),className:"ml-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});xn.displayName="ToastItem";var yn=({children:e,content:t,position:r="top",className:n,overrideClassName:o=!1})=>{let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},a={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-gray-900",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-gray-900",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-gray-900",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-gray-900"};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"relative inline-block group",children:[jsxRuntime.jsx("div",{children:e}),jsxRuntime.jsxs("div",{className:o?n:g("absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap","opacity-0 scale-95 pointer-events-none transition-all duration-150","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto",i[r],n),children:[t,jsxRuntime.jsx("div",{className:g("absolute w-0 h-0 border-4",a[r])})]})]})})};yn.displayName="Tooltip";var pm=yn;var Sa=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),wn=Sa;var Va=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Cn=Va;var kn=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=Wn.useRef(null),[a,l]=Wn.useState(!1),s=Wn.useCallback(d=>{d.preventDefault(),!n&&l(!0);},[n]),m=Wn.useCallback(()=>{l(!1);},[]),u=Wn.useCallback(d=>{if(d.preventDefault(),n||!i.current)return;l(!1);let p=Array.from(d.dataTransfer.files);if(!r&&!e||!r&&p.length>1)return;let w=o(p),y=r?w:w.slice(0,1);t(y);let b=new DataTransfer;y.forEach(v=>b.items.add(v)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=Wn.useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:u,handleDragOver:s,handleDragLeave:m}};var Nn=({files:e,setFiles:t,inputRef:r})=>({removeFile:Wn.useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Ba=({previews:e,onRemove:t})=>{let[r,n]=Wn.useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Tn=Ba;var Rn=Wn.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:m,className:u,name:c,onChange:d,onBlur:p,...w},y)=>{let b=Wn.useId(),[v,E]=Wn.useState([]),D=1024*1024,V=A=>A.filter(j=>(!a||j.size<=a*D)&&(!r||j.type.match(r))),{inputRef:P,isDragOver:$,handleDrop:I,handleDragOver:S,handleDragLeave:k}=kn({files:v,setFiles:E,multiple:i,filterFiles:V}),{removeFile:N}=Nn({files:v,setFiles:E,inputRef:P}),x=A=>{P.current=A,typeof y=="function"?y(A):y&&(y.current=A);},h=A=>{let j=Array.from(A.target.files??[]);if(!j.length)return;let re=V(j);E(i?re:re.slice(0,1)),d?.(A);},M=Wn.useMemo(()=>!o||!v||!v.length?[]:v.filter(A=>A.type.startsWith("image/")).map(A=>({file:A,url:URL.createObjectURL(A)})),[v,o]);Wn.useEffect(()=>()=>M.forEach(A=>URL.revokeObjectURL(A.url)),[M]);let H=o&&M.length>0;return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${u}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:b,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:I,onDragOver:S,onDragLeave:k,onClick:()=>{!l&&!H&&P.current?.click();},className:`
50
+ a 15.9155 15.9155 0 0 1 0 -31.831`})]}),e!=="xs"&&e!=="sm"&&jsxRuntime.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium",children:[m,"%"]})]}):jsxRuntime.jsx("div",{className:c(),children:jsxRuntime.jsxs("svg",{className:`${p()} ${d()}`,fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),P=()=>{switch(a){case"top":return "flex-col-reverse";case"left":return "flex-row-reverse";case"right":return "flex-row";default:return "flex-col"}},$=()=>{switch(e){case"xs":case"sm":return "text-xs";case"lg":return "text-base";case"xl":case"xxl":return "text-lg";default:return "text-sm"}},I=jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`inline-flex ${i?`items-center ${P()} space-y-1 space-x-0 ${a==="left"||a==="right"?"space-y-0 space-x-2":""}`:""}`,children:[V(),i&&jsxRuntime.jsx("span",{className:`${$()} text-gray-500 dark:text-gray-400`,children:i})]})});return l?jsxRuntime.jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50",children:I}):jsxRuntime.jsx("div",{className:n,children:I})};Ue.displayName="Spinner";var Vr=Ue,Ir=({text:e="Carregando...",size:t="md",variant:r="default",color:n="primary",className:o="",textPosition:i="right"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:o,children:jsxRuntime.jsx(Ue,{size:t,variant:r,color:n,text:e,textPosition:i})})});Ir.displayName="LoadingSpinner";var Jc=Ir,Hr=({isVisible:e,text:t="Carregando...",variant:r="default",size:n="lg",className:o=""})=>e?jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50 ${o}`,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntime.jsx(Ue,{size:n,variant:r}),jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:t})]})})}):null;Hr.displayName="LoadingOverlay";var jc=Hr,$r=({size:e="sm",color:t="primary"})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`${(()=>{switch(e){case"xs":return "w-3 h-3";case"md":return "w-5 h-5";default:return "w-4 h-4"}})()} ${t==="white"?"text-white":"text-current"}`,children:jsxRuntime.jsxs("svg",{className:"animate-spin",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})});$r.displayName="ButtonSpinner";var Zc=$r,Ar=({lines:e=3,className:t=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`space-y-3 ${t}`,children:[...Array(e)].map((r,n)=>jsxRuntime.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",style:{width:n===e-1?"60%":"100%"}},n))})});Ar.displayName="ContentLoader";var Qc=Ar,Br=({width:e="100%",height:t="1rem",circle:r=!1,className:n=""})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx("div",{className:`bg-gray-200 dark:bg-gray-700 animate-pulse ${r?"rounded-full":"rounded"} ${n}`,style:{width:e,height:t}})});Br.displayName="Skeleton";var ed=Br;var Or=({children:e,type:t,className:r,overrideClassName:n=!1})=>{if(e)switch(t){case"loading":return jsxRuntime.jsxs("p",{className:n?r:g("text-sm text-muted-foreground flex items-center gap-2",r),children:[jsxRuntime.jsx(Vr,{size:"xs"}),e]});case"error":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-red-600 dark:text-red-400",r),children:e});case"warning":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-yellow-600 dark:text-yellow-400",r),children:e});case"success":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-green-600 dark:text-green-400",r),children:e});case"info":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-blue-600 dark:text-blue-400",r),children:e});case"helper":return jsxRuntime.jsx("p",{className:n?r:g("text-sm text-muted-foreground",r),children:e});default:return null}};Or.displayName="FieldFeedback";var We=Or;var Uo=({children:e,before:t,after:r,className:n})=>{let i=zo__default.default("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsxRuntime.jsx("div",{className:i,children:jsxRuntime.jsx("span",{children:e})})},ut=Uo;var Wo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute px-2",children:jsxRuntime.jsx("span",{children:e})}),Ur=Wo;var qo=({children:e})=>jsxRuntime.jsx("div",{className:"absolute right-0 px-2",children:jsxRuntime.jsx("span",{children:e})}),qr=qo;function Yr(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Kr(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function _r(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Xr(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Jr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function jr(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function Zr(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function Qr(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Yo=({e,mask:t})=>{switch(t){case"money":return Kr(e);case"mobile":return Xr(e);case"phone":return Jr(e);case"cpfCnpj":return jr(e);case"cpf":return _r(e);case"rg":return Zr(e);case"cnpj":return Qr(e);case"cep":return Yr(e);default:return e}},en=Yo;var Xo=({mask:e,initialValue:t=""})=>{let[r,n]=qn.useState(t);qn.useEffect(()=>{t!==r&&n(t);},[t]);let o=qn.useCallback(a=>{let s=en({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=qn.useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},rn=Xo;var nn=qn.forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:m,ClearEnabled:u=!0,className:c,overrideClassName:d=!1,error:p,helperText:w,value:y=void 0,onChange:b,...v},E)=>{let D=qn.useId(),{handleChange:V,handleClear:P,setValue:$}=rn({mask:r,initialValue:y}),I=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",p&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",c),S=N=>{V(N),b?.(N);},k=()=>{P(),$(""),b?.({target:{name:n||"",value:""}});};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:D,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative flex",children:[a&&jsxRuntime.jsx(ut,{before:!0,className:l,children:a}),jsxRuntime.jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsxRuntime.jsx(Ur,{children:o}),jsxRuntime.jsx("input",{id:D,ref:E,name:n,onChange:S,className:d?c:I,...v}),u&&y&&jsxRuntime.jsx(Ge,{onClick:k,width:12,height:12,className:g("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsxRuntime.jsx(qr,{children:i})]}),s&&jsxRuntime.jsx(ut,{after:!0,className:m,children:s})]}),p&&jsxRuntime.jsx(G,{children:p}),!p&&w&&jsxRuntime.jsx(O,{children:w})]})})});nn.displayName="Input";var Ed=nn;var an=qn.forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:m,className:u,charType:c="numeric",customPattern:d,caseMode:p="none",...w},y)=>{let b=qn.useId(),v=qn.useRef([]),E=x=>{switch(p){case"upper":return x.toUpperCase();case"lower":case"visual-upper":return x.toLowerCase();case"visual-lower":return x.toUpperCase();default:return x}},D=x=>{if(!x)return "";let h=x.slice(0,1);switch(h=E(h),c){case"numeric":return /\d/.test(h)?h:"";case"alpha":return /[A-Za-z]/.test(h)?h:"";case"alphanumeric":return /[A-Za-z0-9]/.test(h)?h:"";case"custom":return d?.test(h)?h:"";default:return h}},V=()=>(r!=null?String(r):"").split("").map(D).slice(0,e),P=V().concat(Array(e).fill(" ")).slice(0,e),$=x=>{let h=x.split("").map(D).join("").slice(0,e),M=h===""?void 0:typeof r=="number"?Number(h):h;s?.({target:{name:n,value:M}});},I=(x,h)=>{let M=D(h),H=V();if(M===""){H[x]="",$(H.join(""));return}if(h.length>1){let A=h.split("").map(D).join("").slice(0,e);$(A),v.current[Math.min(A.length-1,e-1)]?.focus();return}M&&(H[x]=M,$(H.join("")),x<e-1&&v.current[x+1]?.focus());},S=x=>{let h=V();!h[x]&&x>0?h[x-1]="":h[x]="",$(h.join("")),x>0&&v.current[x-1]?.focus();},k=x=>{x.preventDefault();let M=x.clipboardData.getData("text").split("").map(D).join("").slice(0,e);M&&($(M),v.current[Math.min(M.length-1,e-1)]?.focus());},N=x=>{switch(p){case"upper":case"visual-upper":return x.toUpperCase();case"lower":case"visual-lower":return x.toLowerCase();default:return x}};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsxRuntime.jsx(F,{htmlFor:b,required:i,children:o}),jsxRuntime.jsx("div",{className:g("flex gap-3 items-center",l&&"text-red-500",u),...w,children:P.map((x,h)=>{let M=t&&h>0&&h%t===0;return jsxRuntime.jsxs(qn__default.default.Fragment,{children:[M&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsxRuntime.jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:N(x).trim(),ref:H=>{v.current[h]=H,h===0&&y&&(typeof y=="function"?y(H):typeof y=="object"&&(y.current=H));},onPaste:k,onChange:H=>I(h,H.target.value),onKeyDown:H=>H.key==="Backspace"&&S(h),onBlur:m,className:g("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},h)})}),l&&jsxRuntime.jsx(G,{children:l}),!l&&a&&jsxRuntime.jsx(O,{children:a})]})})});an.displayName="OtpInput";var Od=an;var sn=qn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...m},u)=>{let c=qn.useId(),d=g("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{id:c,type:"radio",className:a?i:d,ref:u,...m}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:o&&o}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsxRuntime.jsx(F,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsxRuntime.jsx(F,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsxRuntime.jsx(G,{children:s}),!s&&l&&jsxRuntime.jsx(O,{children:l})]})})});sn.displayName="Radio";var Xd=sn;function ia(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:m,overrideClassName:u=!1,helperText:c,error:d,typeSet:p="field",value:w,onChange:y,...b}=e,v=qn.useId(),E=qn.useMemo(()=>new Map(l.map(I=>[String(I[a]),I])),[l,a]),D=qn.useMemo(()=>w==null?"":String(p==="field"?w:w[a]),[w,p,a]),V=I=>{if(!y)return;let S;if(p==="field"){let k=E.get(I);if(k)S=k[a];else {let N=Number(I);S=Number.isNaN(N)?I:N;}}else S=E.get(I)??void 0;y({target:{name:o,value:S,type:"radiogroup",checked:!0}});},P=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=g("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:g("flex flex-col gap-3",m),children:[r&&jsxRuntime.jsx(F,{required:n,children:r}),jsxRuntime.jsx("div",{className:P,children:l.map((I,S)=>{let k=String(I[a]),N=`${v}-${k}-${S}`;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{...b,id:N,ref:t,name:o,type:"radio",checked:D===k,onChange:()=>V(k),className:u?m:$}),jsxRuntime.jsx(F,{htmlFor:N,children:String(I[i])})]},N)})}),d&&jsxRuntime.jsx(G,{children:String(d)}),!d&&c&&jsxRuntime.jsx(O,{children:c})]})})}function sa(){let e=qn.forwardRef(ia);return e.displayName="RadioGroup",e}var la=sa(),iu=la;var ca=["loading","error","warning","success","info","helper"],Ye=e=>{if(!e)return null;let t=ca.find(r=>e[r]);return t?{type:t,message:e[t]}:null};var dn=qn.forwardRef(({label:e,required:t,className:r,showValue:n=!1,min:o=0,max:i=100,step:a=1,value:l,overrideClassName:s,feedback:m,...u},c)=>{let d=qn.useId(),p=(Number(l)-Number(o))/(Number(i)-Number(o))*100,w=Ye(m),y=g("w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer slider","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[(e||n)&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[e&&jsxRuntime.jsx(F,{htmlFor:d,required:t,children:e}),n&&jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"range",id:d,ref:c,min:o,max:i,step:a,value:l,className:s?r:y,style:{background:`linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${p}%, hsl(var(--secondary)) ${p}%, hsl(var(--secondary)) 100%)`},...u}),w&&jsxRuntime.jsx(We,{type:w.type,children:w.message})]})]})})});dn.displayName="Range";var vu=dn;var pa=({value:e,defaultValue:t,onChange:r})=>{let[n,o]=qn.useState(t),i=e!==void 0;return [i?e:n??t,s=>{i||o(s),r?.(s);}]},un=pa;var pn=qn.forwardRef(({min:e=0,max:t=100,step:r=1,value:n,defaultValue:o=[e,t],onChange:i,disabled:a,label:l,showValues:s=!0,className:m="",feedback:u,required:c},d)=>{let p=qn.useId(),w=qn.useRef(null),y=qn.useRef(null),b=Ye(u),[v,E]=un({value:n,defaultValue:o,onChange:P=>i?.({target:{value:P}})}),D=P=>(P-e)/(t-e)*100,V=qn.useCallback(P=>{if(!w.current||!y.current||a)return;let $=w.current.getBoundingClientRect(),I=Math.min(100,Math.max(0,(P-$.left)/$.width*100)),S=e+I/100*(t-e),k=Math.round(S/r)*r,N=[...v];y.current==="min"?N[0]=Math.min(k,v[1]):N[1]=Math.max(k,v[0]),E(N);},[v,e,t,r,E,a]);return qn.useEffect(()=>{let P=I=>V(I.clientX),$=()=>y.current=null;return document.addEventListener("mousemove",P),document.addEventListener("mouseup",$),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$);}},[V]),jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{ref:d,className:`space-y-2 ${m}`,children:[l&&jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx(F,{htmlFor:p,required:c,children:l}),s&&jsxRuntime.jsxs("span",{className:"text-sm text-muted-foreground",children:[v[0]," \u2013 ",v[1]]})]}),jsxRuntime.jsxs("div",{ref:w,className:"relative h-2 bg-secondary rounded-full",children:[jsxRuntime.jsx("div",{className:"absolute h-2 bg-primary rounded-full",style:{left:`${D(v[0])}%`,width:`${D(v[1])-D(v[0])}%`}}),["min","max"].map(P=>jsxRuntime.jsx("div",{onMouseDown:()=>y.current=P,className:`absolute w-5 h-5 bg-background border-2 border-primary rounded-full\r
51
+ top-1/2 -translate-y-1/2 -translate-x-1/2 cursor-pointer`,style:{left:`${D(P==="min"?v[0]:v[1])}%`}},P))]}),b&&jsxRuntime.jsx(We,{type:b.type,children:b.message})]})})});pn.displayName="RangeSlider";var Ru=pn;function ya({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...m},u){let c=qn.useId(),d=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:c,required:t,children:e}),jsxRuntime.jsxs("select",{id:c,ref:u,className:d,...m,children:[i&&jsxRuntime.jsx("option",{value:"",disabled:!0,children:i}),r.map((p,w)=>jsxRuntime.jsx("option",{value:String(p[o]),children:String(p[n])},w))]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})}function wa(){let e=qn.forwardRef(ya);return e.displayName="Select",e}var Ca=wa(),Bu=Ca;var gn=qn.forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:m,...u},c)=>{let d=qn.useId();return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsxRuntime.jsx(F,{required:t,children:e}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:d,name:m,checked:i,className:"peer sr-only",ref:c,...u}),jsxRuntime.jsx("label",{htmlFor:d,className:g("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsxRuntime.jsx("span",{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsxRuntime.jsx("span",{children:o&&o}),(r||n)&&jsxRuntime.jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsxRuntime.jsx(F,{id:`${d}-label`,htmlFor:d,className:"text-sm font-medium leading-none",children:r}),n&&jsxRuntime.jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]})})});gn.displayName="Switch";var Ku=gn;var bn=qn__default.default.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},m)=>{let u=qn.useId(),[c,d]=qn.useState(0),p=g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsx(F,{htmlFor:u,required:t,children:e}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("textarea",{id:u,className:i?o:p,maxLength:n,onInput:w=>d(w.currentTarget.textLength),ref:m,...s}),r&&jsxRuntime.jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsxRuntime.jsx(G,{children:a}),!a&&l&&jsxRuntime.jsx(O,{children:l})]})})});bn.displayName="TextArea";var rm=bn;var xn=qn.createContext(void 0),lm=()=>{let e=qn.useContext(xn);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},cm=({children:e})=>jsxRuntime.jsx(f,{children:jsxRuntime.jsx(Fa,{children:e})}),Fa=({children:e})=>{let[t,r]=qn.useState([]),n=qn.useCallback(a=>{r(l=>l.filter(s=>s.id!==a));},[]),o=qn.useCallback(a=>{let l=crypto.randomUUID(),s={...a,id:l};r(m=>[...m,s]),a.duration!==0&&setTimeout(()=>{n(l);},a.duration??5e3);},[n]),i=qn.useMemo(()=>({toasts:t,addToast:o,removeToast:n}),[t,o,n]);return jsxRuntime.jsxs(xn.Provider,{value:i,children:[e,jsxRuntime.jsx(Sa,{toasts:t,onRemove:n})]})},Sa=({toasts:e,onRemove:t})=>jsxRuntime.jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(r=>jsxRuntime.jsx(hn,{toast:r,onRemove:t},r.id))}),hn=({toast:e,onRemove:t})=>jsxRuntime.jsx("div",{className:`min-w-80 max-w-md p-4 border rounded-md shadow-lg animate-in slide-in-from-right-full ${{default:"bg-white border-gray-200 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100",success:"bg-green-50 border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200",warning:"bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900/20 dark:border-yellow-800 dark:text-yellow-200",destructive:"bg-red-50 border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}[e.variant??"default"]}`,children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[e.title&&jsxRuntime.jsx("h4",{className:"font-medium mb-1",children:e.title}),jsxRuntime.jsx("p",{className:"text-sm",children:e.description})]}),jsxRuntime.jsx("button",{onClick:()=>t(e.id),className:"ml-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});hn.displayName="ToastItem";var wn=({children:e,content:t,position:r="top",className:n,overrideClassName:o=!1})=>{let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},a={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-gray-900",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-gray-900",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-gray-900",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-gray-900"};return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:"relative inline-block group",children:[jsxRuntime.jsx("div",{children:e}),jsxRuntime.jsxs("div",{className:o?n:g("absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap","opacity-0 scale-95 pointer-events-none transition-all duration-150","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto",i[r],n),children:[t,jsxRuntime.jsx("div",{className:g("absolute w-0 h-0 border-4",a[r])})]})]})})};wn.displayName="Tooltip";var fm=wn;var Va=({files:e,removeFile:t})=>jsxRuntime.jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm truncate",children:r.name}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),Cn=Va;var Ia=({accept:e,maxSize:t})=>jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),kn=Ia;var Nn=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=qn.useRef(null),[a,l]=qn.useState(!1),s=qn.useCallback(d=>{d.preventDefault(),!n&&l(!0);},[n]),m=qn.useCallback(()=>{l(!1);},[]),u=qn.useCallback(d=>{if(d.preventDefault(),n||!i.current)return;l(!1);let p=Array.from(d.dataTransfer.files);if(!r&&!e||!r&&p.length>1)return;let w=o(p),y=r?w:w.slice(0,1);t(y);let b=new DataTransfer;y.forEach(v=>b.items.add(v)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=qn.useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:u,handleDragOver:s,handleDragLeave:m}};var Pn=({files:e,setFiles:t,inputRef:r})=>({removeFile:qn.useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Oa=({previews:e,onRemove:t})=>{let[r,n]=qn.useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxRuntime.jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsxRuntime.jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsxRuntime.jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Ln=Oa;var Dn=qn.forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:m,className:u,name:c,onChange:d,onBlur:p,...w},y)=>{let b=qn.useId(),[v,E]=qn.useState([]),D=1024*1024,V=A=>A.filter(j=>(!a||j.size<=a*D)&&(!r||j.type.match(r))),{inputRef:P,isDragOver:$,handleDrop:I,handleDragOver:S,handleDragLeave:k}=Nn({files:v,setFiles:E,multiple:i,filterFiles:V}),{removeFile:N}=Pn({files:v,setFiles:E,inputRef:P}),x=A=>{P.current=A,typeof y=="function"?y(A):y&&(y.current=A);},h=A=>{let j=Array.from(A.target.files??[]);if(!j.length)return;let re=V(j);E(i?re:re.slice(0,1)),d?.(A);},M=qn.useMemo(()=>!o||!v||!v.length?[]:v.filter(A=>A.type.startsWith("image/")).map(A=>({file:A,url:URL.createObjectURL(A)})),[v,o]);qn.useEffect(()=>()=>M.forEach(A=>URL.revokeObjectURL(A.url)),[M]);let H=o&&M.length>0;return jsxRuntime.jsx(f,{children:jsxRuntime.jsxs("div",{className:`space-y-2 ${u}`,children:[e&&jsxRuntime.jsx(F,{htmlFor:b,required:t,children:e}),jsxRuntime.jsxs("div",{onDrop:I,onDragOver:S,onDragLeave:k,onClick:()=>{!l&&!H&&P.current?.click();},className:`
52
52
  border-2 border-dashed rounded-lg p-6 text-center cursor-pointer
53
53
  transition-colors
54
54
  ${$?"border-primary bg-primary/5":"border-border"}
55
55
  ${s?"border-red-500":""}
56
56
  ${l?"opacity-50 cursor-not-allowed":"hover:border-primary"}
57
- `,children:[jsxRuntime.jsx("input",{ref:x,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:h,onBlur:p,className:"hidden",...w}),o&&M.length>0?jsxRuntime.jsx(Tn,{previews:M,onRemove:N}):jsxRuntime.jsx(Cn,{accept:r,maxSize:a})]}),n?n({files:v,removeFile:N}):v&&v.length>0&&jsxRuntime.jsx(wn,{files:v,removeFile:N}),s&&jsxRuntime.jsx(G,{children:s}),!s&&m&&jsxRuntime.jsx(O,{children:m})]})})});Rn.displayName="UploadFile";var Bm=Rn;
57
+ `,children:[jsxRuntime.jsx("input",{ref:x,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:h,onBlur:p,className:"hidden",...w}),o&&M.length>0?jsxRuntime.jsx(Ln,{previews:M,onRemove:N}):jsxRuntime.jsx(kn,{accept:r,maxSize:a})]}),n?n({files:v,removeFile:N}):v&&v.length>0&&jsxRuntime.jsx(Cn,{files:v,removeFile:N}),s&&jsxRuntime.jsx(G,{children:s}),!s&&m&&jsxRuntime.jsx(O,{children:m})]})})});Dn.displayName="UploadFile";var Om=Dn;
58
58
 
59
- exports.AccordionPrimitive = mi;
60
- exports.AlertDescriptionPrimitive = Ni;
61
- exports.AlertPrimitive = Ci;
62
- exports.AlertTitlePrimitive = ki;
63
- exports.Avatar = Ms;
64
- exports.BadgePrimitive = Ei;
65
- exports.BreadcrumbPrimitive = Hi;
66
- exports.ButtonPrimitive = zi;
67
- exports.ButtonSpinnerPrimitive = jc;
68
- exports.CardContentPrimitive = Qi;
69
- exports.CardDescriptionPrimitive = Zi;
70
- exports.CardFooterPrimitive = es;
71
- exports.CardHeaderPrimitive = Ji;
72
- exports.CardPrimitive = Xi;
73
- exports.CardTitlePrimitive = ji;
74
- exports.CheckBoxGroupPrimitive = ll;
75
- exports.CheckBoxPrimitive = js;
76
- exports.ColorPicker = mr;
77
- exports.ColorPickerPrimitive = bl;
78
- exports.ComboBoxPrimitive = ql;
79
- exports.ContentLoaderPrimitive = Zc;
80
- exports.DatePickerPrimitive = Wc;
81
- exports.DialogContentPrimitive = ds;
82
- exports.DialogFooterPrimitive = us;
83
- exports.DialogHeaderPrimitive = ls;
84
- exports.DialogPrimitive = ss;
85
- exports.DialogTitlePrimitive = cs;
86
- exports.DropdownMenuContentPrimitive = ys;
87
- exports.DropdownMenuItemPrimitive = ws;
88
- exports.DropdownMenuLabelPrimitive = ks;
89
- exports.DropdownMenuPrimitive = xs;
90
- exports.DropdownMenuSeparatorPrimitive = Cs;
91
- exports.DropdownMenuTriggerPrimitive = hs;
59
+ exports.AccordionPrimitive = pi;
60
+ exports.AlertDescriptionPrimitive = Pi;
61
+ exports.AlertPrimitive = ki;
62
+ exports.AlertTitlePrimitive = Ni;
63
+ exports.AvatarPrimitive = Es;
64
+ exports.BadgePrimitive = Fi;
65
+ exports.BreadcrumbPrimitive = $i;
66
+ exports.ButtonPrimitive = Ui;
67
+ exports.ButtonSpinnerPrimitive = Zc;
68
+ exports.CardContentPrimitive = es;
69
+ exports.CardDescriptionPrimitive = Qi;
70
+ exports.CardFooterPrimitive = ts;
71
+ exports.CardHeaderPrimitive = ji;
72
+ exports.CardPrimitive = Ji;
73
+ exports.CardTitlePrimitive = Zi;
74
+ exports.CheckBoxGroupPrimitive = cl;
75
+ exports.CheckBoxPrimitive = Zs;
76
+ exports.ColorPicker = pr;
77
+ exports.ColorPickerPrimitive = vl;
78
+ exports.ComboBoxPrimitive = Yl;
79
+ exports.ContentLoaderPrimitive = Qc;
80
+ exports.DatePickerPrimitive = qc;
81
+ exports.DialogContentPrimitive = us;
82
+ exports.DialogFooterPrimitive = ms;
83
+ exports.DialogHeaderPrimitive = cs;
84
+ exports.DialogPrimitive = ls;
85
+ exports.DialogTitlePrimitive = ds;
86
+ exports.DropdownMenuContentPrimitive = ws;
87
+ exports.DropdownMenuItemPrimitive = Cs;
88
+ exports.DropdownMenuLabelPrimitive = Ns;
89
+ exports.DropdownMenuPrimitive = hs;
90
+ exports.DropdownMenuSeparatorPrimitive = ks;
91
+ exports.DropdownMenuTriggerPrimitive = ys;
92
92
  exports.FieldFeedbackPrimitive = We;
93
93
  exports.HelperFieldPrimitive = O;
94
- exports.InputPrimitive = Md;
94
+ exports.InputPrimitive = Ed;
95
95
  exports.LabelPrimitive = F;
96
- exports.LicenseProvider = Sn;
97
- exports.LoadingOverlayPrimitive = Jc;
98
- exports.LoadingSpinnerPrimitive = Xc;
99
- exports.OtpInputPrimitive = Bd;
100
- exports.RadioGroupPrimitive = au;
101
- exports.RadioPrimitive = _d;
102
- exports.RangePrimitive = bu;
103
- exports.RangeSliderPrimitive = Lu;
104
- exports.SelectPrimitive = Au;
105
- exports.SkeletonPrimitive = Qc;
106
- exports.SpinnerPrimitive = Sr;
107
- exports.SwitchPrimitive = Yu;
108
- exports.TextAreaPrimitive = tm;
109
- exports.ToastProvider = lm;
110
- exports.TooltipPrimitive = pm;
111
- exports.UploadFilePrimitive = Bm;
96
+ exports.LicenseProvider = Vn;
97
+ exports.LoadingOverlayPrimitive = jc;
98
+ exports.LoadingSpinnerPrimitive = Jc;
99
+ exports.OtpInputPrimitive = Od;
100
+ exports.RadioGroupPrimitive = iu;
101
+ exports.RadioPrimitive = Xd;
102
+ exports.RangePrimitive = vu;
103
+ exports.RangeSliderPrimitive = Ru;
104
+ exports.SelectPrimitive = Bu;
105
+ exports.SkeletonPrimitive = ed;
106
+ exports.SpinnerPrimitive = Vr;
107
+ exports.SwitchPrimitive = Ku;
108
+ exports.TextAreaPrimitive = rm;
109
+ exports.ToastProvider = cm;
110
+ exports.TooltipPrimitive = fm;
111
+ exports.UploadFilePrimitive = Om;
112
112
  exports.ValidateFieldPrimitive = G;
113
- exports.useToast = sm;
113
+ exports.useToast = lm;
package/dist/page.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import Wn, { createContext, forwardRef, useEffect, useState, useContext, useRef, useId, useCallback, useMemo, cloneElement, useImperativeHandle } from 'react';
3
- import Go, { clsx } from 'clsx';
2
+ import qn, { createContext, forwardRef, useEffect, useState, useContext, useRef, useId, useCallback, useMemo, cloneElement, useImperativeHandle } from 'react';
3
+ import zo, { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
 
6
6
  var kt=({title:e="Ocorreu um erro",message:t,description:r="Algo deu errado ao carregar esta p\xE1gina.",badge:n="Erro",actions:o})=>jsx("div",{className:"flex min-h-screen w-full items-center justify-center bg-linear-to-br from-red-50 via-rose-50 to-red-100 px-4 dark:from-red-950 dark:via-zinc-950 dark:to-red-900/30",children:jsxs("div",{className:"relative w-full max-w-md rounded-2xl bg-white/90 p-8 text-center shadow-2xl backdrop-blur animate-in fade-in zoom-in-95 dark:bg-zinc-900/90",children:[jsx("div",{className:"pointer-events-none absolute inset-0 rounded-2xl ring-1 ring-red-200 dark:ring-red-800"}),n&&jsx("span",{className:"mb-6 inline-block rounded-full bg-red-100 px-4 py-1 text-xs font-semibold text-red-700 dark:bg-red-900/40 dark:text-red-300",children:n}),jsx("div",{className:"mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-linear-to-tr from-red-200 to-red-100 text-red-600 shadow-inner dark:from-red-900/40 dark:to-red-800/40 dark:text-red-400",children:jsxs("svg",{className:"h-9 w-9 animate-pulse",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M12 9v4"}),jsx("path",{d:"M12 17h.01"}),jsx("path",{d:"M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z"})]})}),jsx("h1",{className:"mb-2 text-2xl font-extrabold text-zinc-900 dark:text-zinc-100",children:e}),jsx("p",{className:"mb-2 text-sm font-medium text-red-600 dark:text-red-400",children:t}),r&&jsx("p",{className:"mb-6 text-sm text-zinc-600 dark:text-zinc-400",children:r}),o&&o.length>0&&jsx("div",{className:"flex flex-col gap-3",children:o.map((i,a)=>{let l=i.variant!=="secondary";return jsx("button",{onClick:i.onClick,className:l?"rounded-xl bg-linear-to-r from-red-600 to-red-700 px-5 py-2.5 text-sm font-semibold text-white shadow-lg transition hover:scale-[1.02] hover:shadow-red-600/40 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-zinc-900":"rounded-xl border border-zinc-200 px-5 py-2.5 text-sm font-semibold text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",children:i.label},a)})})]})});var Nt=(e,t)=>{let r="Problema com licen\xE7a da aplica\xE7\xE3o",n=`
@@ -19,34 +19,34 @@ Erro:
19
19
  ${t??"Licen\xE7a inv\xE1lida"}
20
20
 
21
21
  Pode me ajudar?
22
- `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Lt=createContext(void 0),Sn=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,l]=useState(!0),s=m=>{if(i(null),!m)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let u="chave-secreta-123";if(m!==u)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(m){i(m instanceof Error?m.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsx(Lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsx(kt,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Pt("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>Nt("marcos.vinicius.engsof@gmail.com",o)}]})})},Rt=()=>{let e=useContext(Lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Mt=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var f=({children:e})=>{let{isLicenseValid:t}=Rt();return t?jsx(Fragment,{children:e}):jsx(Mt,{})};var St=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=u=>u===void 0?[]:Array.isArray(u)?u:[u],[l,s]=useState(a(n??r));useEffect(()=>{n!==void 0&&s(a(n));},[n]);let m=useCallback(u=>{s(c=>{let d;return t==="single"?d=c.includes(u)?[]:[u]:d=c.includes(u)?c.filter(p=>p!==u):[...c,u],o?.(t==="single"?d[0]??"":d),d});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(u=>jsx(Bn,{...u,isOpen:l.includes(u.id),onToggle:()=>m(u.id)},u.id))})},Bn=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsx(f,{children:jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
22
+ `,n=`https://wa.me/${e}?text=${encodeURIComponent(r)}`;window.open(n,"_blank");};var Lt=createContext(void 0),Vn=({children:e,licenseKey:t})=>{let[r,n]=useState(!1),[o,i]=useState(null),[a,l]=useState(!0),s=m=>{if(i(null),!m)throw new Error("\u{1F512} Chave de licen\xE7a \xE9 obrigat\xF3ria");let u="chave-secreta-123";if(m!==u)throw new Error("\u274C Chave de licen\xE7a inv\xE1lida");n(!0);};return useEffect(()=>{if(t){l(!0);try{s(t);}catch(m){i(m instanceof Error?m.message:"Erro desconhecido na valida\xE7\xE3o da licen\xE7a");}finally{l(!1);}}else i("\u{1F512} Licen\xE7a n\xE3o informada"),l(!1);},[t]),a?null:jsx(Lt.Provider,{value:{isLicenseValid:r,validateLicense:s,licenseError:o},children:r?e:jsx(kt,{badge:"Licen\xE7a necess\xE1ria",title:"Erro de Licen\xE7a",message:o||"Licen\xE7a inv\xE1lida",description:"Sua aplica\xE7\xE3o precisa de uma licen\xE7a v\xE1lida para continuar.",actions:[{label:"Tentar novamente",onClick:()=>window.location.reload()},{label:"Falar no WhatsApp",variant:"secondary",onClick:()=>Pt("5544998204407",o)},{label:"Enviar e-mail",variant:"secondary",onClick:()=>Nt("marcos.vinicius.engsof@gmail.com",o)}]})})},Rt=()=>{let e=useContext(Lt);if(!e)throw new Error("useLicense deve ser usado dentro de um LicenseProvider");return e};var Mt=({message:e="Component locked - Please validate your license"})=>jsxs("div",{className:"flex items-start p-4 bg-red-50 border border-red-500 text-red-700 rounded-md gap-2",children:[jsx("span",{children:" \u274C Component locked - Please validate your license"}),jsx("span",{children:e})]});var f=({children:e})=>{let{isLicenseValid:t}=Rt();return t?jsx(Fragment,{children:e}):jsx(Mt,{})};var St=({items:e,type:t="single",defaultValue:r,value:n,onValueChange:o,className:i=""})=>{let a=u=>u===void 0?[]:Array.isArray(u)?u:[u],[l,s]=useState(a(n??r));useEffect(()=>{n!==void 0&&s(a(n));},[n]);let m=useCallback(u=>{s(c=>{let d;return t==="single"?d=c.includes(u)?[]:[u]:d=c.includes(u)?c.filter(p=>p!==u):[...c,u],o?.(t==="single"?d[0]??"":d),d});},[t,o]);return jsx("div",{className:`space-y-2 ${i}`,children:e.map(u=>jsx(On,{...u,isOpen:l.includes(u.id),onToggle:()=>m(u.id)},u.id))})},On=({title:e,content:t,disabled:r=!1,isOpen:n,onToggle:o})=>jsx(f,{children:jsxs("div",{className:"border border-border rounded-md overflow-hidden",children:[jsx("button",{onClick:o,disabled:r,className:`w-full px-4 py-3 text-left font-medium transition-colors
23
23
  ${r?"opacity-50 cursor-not-allowed":"hover:bg-accent hover:text-accent-foreground"}
24
24
  ${n?"bg-accent text-accent-foreground":"bg-background text-foreground"}
25
- `,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});St.displayName="Accordion";var mi=St;function g(...e){return twMerge(clsx(e))}var Vt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("h5",{ref:o,className:t?e:g("mb-1 font-medium leading-none tracking-tight",e),...n,children:r})}));Vt.displayName="AlertTitle";var It=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("text-sm [&_p]:leading-relaxed",e),...n,children:r})}));It.displayName="AlertDescription";var Ht=forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsx(f,{children:jsx("div",{ref:i,role:"alert",className:t?e:g("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:-translate-y-0.75 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{default:"bg-background text-foreground border-border",destructive:"border-red-500/50 text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-950/50 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/50 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",success:"border-green-500/50 text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 [&>svg]:text-green-600 dark:[&>svg]:text-green-400"}[r],e),...o,children:n})}));Ht.displayName="Alert";var Ci=Ht,ki=Vt,Ni=It;var At=forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsx(f,{children:jsx("div",{ref:i,className:t?e:g("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));At.displayName="Badge";var Ei=At;var Bt=({items:e,separator:t="/",overrideClassName:r,className:n})=>jsx(f,{children:jsx("nav",{"aria-label":"Breadcrumb",className:r?n:g("flex",n),children:jsx("ol",{className:"flex items-center space-x-2",children:e.map((o,i)=>jsxs("li",{className:"flex items-center",children:[i>0&&jsx("span",{className:"mx-2 text-muted-foreground",children:t}),o.href&&!o.current?jsx("a",{href:o.href,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o.label}):jsx("span",{className:g("text-sm font-medium",o.current?"text-foreground":"text-muted-foreground"),"aria-current":o.current?"page":void 0,children:o.label})]},i))})})});Bt.displayName="Breadcrumb";var Hi=Bt;var Ot=Wn.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},m)=>{let u="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",c={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},d={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},p=t?e:g(u,c[r],d[n],e);return o?jsx(f,{children:jsx("a",{href:o,className:p,ref:m,children:a&&l?l:i})}):jsx(f,{children:jsx("button",{className:p,ref:m,...s,children:a&&l?l:i})})});Ot.displayName="Button";var zi=Ot;var Gt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));Gt.displayName="Card";var zt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));zt.displayName="CardHeader";var Ut=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("h3",{ref:o,className:t?e:g("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Ut.displayName="CardTitle";var Wt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("p",{ref:o,className:t?e:g("text-sm text-muted-foreground",e),...n,children:r})}));Wt.displayName="CardDescription";var qt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("p-6 pt-0",e),...n,children:r})}));qt.displayName="CardContent";var Yt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("flex items-center p-6 pt-0",e),...n,children:r})}));Yt.displayName="CardFooter";var Xi=Gt,Ji=zt,ji=Ut,Zi=Wt,Qi=qt,es=Yt;var _t=forwardRef(({children:e,isOpen:t,onClose:r,size:n="md",className:o,overrideClassName:i=!1,...a},l)=>(useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[t]),useEffect(()=>{let m=u=>{u.key==="Escape"&&r();};return t&&document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),t?jsx(f,{children:jsxs("div",{ref:l,className:"fixed inset-0 z-50 flex items-center justify-center",...a,children:[jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),jsx("div",{className:i?o:g("relative bg-background border border-border rounded-lg shadow-lg w-full mx-4",{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[n],o),children:e})]})}):null));_t.displayName="Dialog";var Xt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-b border-border",t),...n,children:e})}));Xt.displayName="DialogHeader";var Jt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("h2",{ref:o,className:r?t:g("text-lg font-semibold text-foreground",t),...n,children:e})}));Jt.displayName="DialogTitle";var jt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4",t),...n,children:e})}));jt.displayName="DialogContent";var Zt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-t border-border flex justify-end space-x-2",t),...n,children:e})}));Zt.displayName="DialogFooter";var ss=_t,ls=Xt,cs=Jt,ds=jt,us=Zt;var Ae=createContext(void 0),er=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(f,{children:jsx(Ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:g("relative inline-block",t),...r,children:e})})})});er.displayName="DropdownMenu";var tr=({children:e,asChild:t})=>{let r=useContext(Ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx(f,{children:jsx("button",{onClick:n,children:e})})};tr.displayName="DropdownMenuTrigger";var rr=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(Ae),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let s=m=>{a.current&&!a.current.contains(m.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsx(f,{children:jsx("div",{ref:a,className:g("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});rr.displayName="DropdownMenuContent";var nr=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(Ae);return jsx(f,{children:jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:g("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});nr.displayName="DropdownMenuItem";var or=forwardRef(({className:e,...t},r)=>jsx(f,{children:jsx("div",{ref:r,className:g("-mx-1 my-1 h-px bg-border",e),...t})}));or.displayName="DropdownMenuSeparator";var ar=forwardRef(({children:e,className:t,...r},n)=>jsx(f,{children:jsx("div",{ref:n,className:g("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));ar.displayName="DropdownMenuLabel";var xs=er,hs=tr,ys=rr,ws=nr,Cs=or,ks=ar;var Ms=({src:e,alt:t="",fallback:r,size:n="md",className:o})=>{let[i,a]=useState(!1),l={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},s=m=>m.split(" ").map(u=>u.charAt(0)).join("").toUpperCase().slice(0,2);return jsx(f,{children:jsx("div",{className:g("relative flex shrink-0 overflow-hidden rounded-full bg-muted",l[n],o),children:e&&!i?jsx("img",{src:e||"/placeholder.svg",alt:t,className:"aspect-square h-full w-full object-cover",onError:()=>a(!0)}):jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted font-medium text-muted-foreground",children:r?s(r):"?"})})})};var jn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(f,{children:jsx("p",{className:r?t:g("text-sm text-muted-foreground",t),children:e})})},O=jn;var Zn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(f,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:g("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),F=Zn;var eo=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(f,{children:jsx("p",{className:r?t:g("text-sm text-red-600 dark:text-red-400",t),children:e})})},G=eo;var lr=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:m,...u},c)=>{let d=useId(),p=g("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive",a);return jsx(f,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:d,type:"checkbox",className:l?a:p,ref:c,...u}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(F,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]}),m&&jsx(G,{children:m}),!m&&s&&jsx(O,{children:s})]})})});lr.displayName="CheckBox";var js=lr;function ao(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:m="vertical",className:u,overrideClassName:c=!1,helperText:d,error:p,label:w,name:y,required:b,...v}=e,E=useId(),D=useMemo(()=>new Map(s.map(k=>[String(k[l]),k])),[s,l]),V=useMemo(()=>o==null?[]:r==="field"?n?o.map(k=>String(k)):[String(o)]:n?o.map(k=>String(k[l])):[String(o[l])],[o,r,n,l]),P=(k,N)=>{if(!i)return;let x;if(r==="field")if(n)x=k.map(M=>{let H=D.get(M);return H?H[l]:M});else {let h=k[0];if(!h)x=void 0;else {let M=D.get(h);x=M?M[l]:h;}}else n?x=k.map(M=>D.get(M)).filter(M=>M!==void 0):x=D.get(k[0]??"")??void 0;i({target:{name:y,value:x,type:"checkboxgroup",checked:N}});},$=k=>{let N;n?N=V.includes(k)?V.filter(x=>x!==k):[...V,k]:N=V[0]===k?[]:[k],P(N,N.includes(k));},I=m==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",S=g("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsx(f,{children:jsxs("div",{className:g("flex flex-col gap-3",u),children:[w&&jsx(F,{required:b,children:w}),jsx("div",{className:I,children:s.map((k,N)=>{let x=String(k[l]),h=V.includes(x),M=`${E}-${x}-${N}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...v,id:M,ref:t,type:"checkbox",name:y,checked:h,onChange:()=>$(x),className:c?u:S}),jsx(F,{htmlFor:M,children:String(k[a])})]},M)})}),!!p&&jsx(G,{children:String(p)}),!p&&d&&jsx(O,{children:d})]})})}function io(){let e=forwardRef(ao);return e.displayName="CheckBoxGroup",e}var so=io(),ll=so;var mo=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],mr=Wn.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=mo,showPresets:i=!0,className:a,error:l,helperText:s,name:m},u)=>{let c=useId(),d=useRef(null),[p,w]=useState(!1),[y,b]=useState("COLOR"),[v,E]=useState("HEX"),[D,V]=useState("#000000"),[P,$]=useState(0),[I,S]=useState(0),[k,N]=useState(0),[x,h]=useState(1),[M,H]=useState("#000000"),[A,j]=useState("#ffffff"),[re,Ce]=useState(90),[R,T]=useState("linear-gradient(90deg, #000000, #ffffff)"),z=(L,U,De)=>Math.min(De,Math.max(U,L)),_=L=>{let U=L.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},W=L=>{r?.({target:{value:L,name:m}});};useEffect(()=>{let L=U=>{d.current&&!d.current.contains(U.target)&&w(!1);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]),useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(D)){let L=_(D);$(L.r),S(L.g),N(L.b);}},[D]),useEffect(()=>{let L=`linear-gradient(${re}deg, ${M}, ${A})`;T(L),y==="GRADIENT"&&W(L);},[M,A,re]);let q=()=>{if(x>=1){if(v==="HEX")return D;if(v==="RGB")return `rgb(${P}, ${I}, ${k})`}return `rgba(${P}, ${I}, ${k}, ${Number(x.toFixed(2))})`},Z=y==="GRADIENT"?R:q();return jsx(f,{children:jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsx(F,{htmlFor:c,required:t,children:e}),jsxs("div",{ref:d,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>!n&&w(!p),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),p&&jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(L=>jsx("button",{type:"button",onClick:()=>b(L),className:`px-2 py-1 text-xs rounded ${y===L?"bg-primary text-white":"border"}`,children:L==="COLOR"?"Cor":"Gradiente"},L))}),jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),y==="COLOR"&&jsxs(Fragment,{children:[jsx("input",{ref:u,type:"color",value:D,onChange:L=>{V(L.target.value.toUpperCase()),W(q());},className:"w-full h-10 rounded"}),jsxs("div",{className:"flex gap-2 items-center",children:[jsxs("select",{value:v,onChange:L=>E(L.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsx("option",{value:"HEX",children:"HEX"}),jsx("option",{value:"RGB",children:"RGB"}),jsx("option",{value:"RGBA",children:"RGBA"})]}),v==="HEX"&&jsx("input",{value:D,onChange:L=>{let U=L.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),V(U),/^#[0-9A-F]{6}$/.test(U)&&W(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(v==="RGB"||v==="RGBA")&&jsx("div",{className:"flex gap-2",children:[{l:"R",v:P,s:$},{l:"G",v:I,s:S},{l:"B",v:k,s:N}].map(({l:L,v:U,s:De})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-xs font-semibold",children:L}),jsx("input",{type:"number",min:0,max:255,value:U,onChange:Dn=>{De(z(+Dn.target.value,0,255)),W(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},L))})]}),v==="RGBA"&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs font-semibold",children:"A"}),jsx("input",{type:"range",min:0,max:1,step:.01,value:x,onChange:L=>{h(+L.target.value),W(q());},className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(x*100),"%"]})]}),i&&jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(L=>jsx("button",{type:"button",onClick:()=>{V(L),h(1),W(L);},className:"w-8 h-8 rounded border",style:{background:L}},L))})]}),y==="GRADIENT"&&jsxs(Fragment,{children:[jsxs("div",{className:"flex gap-2 items-center",children:[jsx("input",{type:"color",value:M,onChange:L=>H(L.target.value)}),jsx("span",{className:"text-xs",children:"\u2192"}),jsx("input",{type:"color",value:A,onChange:L=>j(L.target.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsx("input",{type:"range",min:0,max:360,value:re,onChange:L=>Ce(+L.target.value),className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[re,"\xB0"]})]})]})]})]}),l&&jsx(G,{children:l}),!l&&s&&jsx(O,{children:s})]})})});mr.displayName="ColorPicker";var bl=mr;var po=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Ge=po;var go=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},fr=go;function tt({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,m]=useState([]),u=useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=useCallback(()=>s.map(b=>u.get(b)).filter(b=>!!b),[s,u]),d=useCallback(b=>{if(!o)return;let v;if(a==="field"?n?v=b:v=b[0]??void 0:n?v=b.map(D=>u.get(D)).filter(D=>D!==void 0):v=u.get(b[0]??"")??void 0,i&&!n){let E=u.get(b[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:v,type:"combobox"}});},[n,o,u,l,a,i,t]),p=useCallback(b=>{let v=String(b[r]),E=n?s.includes(v)?s.filter(D=>D!==v):[...s,v]:[v];m(E),d(E);},[n,s,d,r]),w=useCallback(b=>{let v=s.filter(E=>E!==b);m(v),d(v);},[s,d]),y=useCallback(()=>{m([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:p,handleRemove:w,handleClear:y,getSelectedOptions:c}}function rt(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var br=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:m,handleRemove:u})=>{let c=useCallback(p=>{if(a.length===0){s(-1);return}s(w=>w<0?p>0?0:a.length-1:(w+p+a.length)%a.length);},[a,s]);return useCallback(p=>{if(!e){if(p.key==="Enter"||p.key==="ArrowDown"){t(!0),s(0),p.preventDefault();return}r&&p.key==="Backspace"&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));return}switch(p.key){case"ArrowDown":p.preventDefault(),c(1);break;case"ArrowUp":p.preventDefault(),c(-1);break;case"Enter":p.preventDefault();let w=l>=0?l:0,y=a[w];y&&m(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":p.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":p.preventDefault(),a.length>0&&s(0);break;case"End":p.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,m,u,c])};function vr({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function No(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:m,onChange:u,mode:c="single",typeSet:d="field",disabled:p=!1,ClearEnabled:w=!0,helperText:y,error:b=!1,className:v="",...E}=e,D=c==="multiple",[V,P]=useState(!1),[$,I]=useState(""),S=useRef(null),k=useRef(null),N=useRef(null);useImperativeHandle(t,()=>N.current),fr(k,()=>P(!1));let x=rt(s,a,$),[h,M]=useState(-1),{selectedValues:H,handleSelect:A,handleRemove:j,handleClear:re,getSelectedOptions:Ce}=tt({options:s,labelKey:a,valueKey:l,value:m,multiple:D,onChange:u,typeSet:d,name:o,setSearchTerm:I}),R=br({isOpen:V,setIsOpen:P,multiple:D,searchTerm:$,setSearchTerm:I,selectedValues:H,filteredOptions:x,highlightedIndex:h,setHighlightedIndex:M,handleSelect:A,handleRemove:j}),T=useId(),z="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",_=g("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",p?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(f,{children:jsxs("div",{className:`space-y-2 ${v}`,children:[r&&jsx(F,{htmlFor:T,required:n,children:r}),jsxs("div",{ref:S,className:"relative",children:[jsxs("div",{className:_,children:[D&&Ce().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ce().map((W,q)=>jsx(vr,{option:W,labelKey:a,valueKey:l,onRemove:j},String(W[l]??q)))}),jsx("input",{ref:N,...E,name:o,type:"text",placeholder:i,value:$,onChange:W=>{let q=W.target.value;I(q),!V&&q.trim()!==""&&P(!0);},onKeyDown:R,onMouseDown:W=>{document.activeElement===N.current&&(W.preventDefault(),P(q=>{let Z=!q;return Z&&M(0),Z}));},onFocus:()=>{P(!0),M(0);},disabled:p,className:z,role:"combobox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":h>=0?`${T}-opt-${h}`:void 0}),w&&!!H.length&&jsx("button",{type:"button",onMouseDown:W=>W.preventDefault(),onClick:re,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(Ge,{width:12,height:12})})]}),V&&jsx("div",{ref:k,id:T,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":D||void 0,children:x.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):x.map((W,q)=>{let Z=String(W[l]),L=H.includes(Z),U=q===h;return jsx("button",{id:`${T}-opt-${q}`,"data-index":q,role:"option","aria-selected":L,type:"button",onMouseDown:De=>De.preventDefault(),onClick:()=>A(W),className:g("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&L&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!L&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(W[a])})},Z)})})]}),b&&jsx(G,{children:b}),!b&&y&&jsx(O,{children:y})]})})}function Po(){let e=forwardRef(No);return e.displayName="ComboBox",e}var To=Po(),ql=To;var Lo=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),hr=Lo;var Ro=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),de=Ro;var Do=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),ue=Do;var be=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var Cr=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var st=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let m=s.getFullYear(),u=s.getMonth(),c=new Date(m,u,1),p=new Date(m,u+1,0).getDate(),w=c.getDay(),y=[];for(let b=w-1;b>=0;b--)y.push({date:new Date(m,u,-b),isCurrentMonth:!1});for(let b=1;b<=p;b++)y.push({date:new Date(m,u,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(m,u+1,y.length-p+1),isCurrentMonth:!1});return y};return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsxs("div",{className:"font-medium flex gap-1",children:[jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:be[t.getMonth()]}),jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:Cr.map(s=>jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,m)=>{let c=r&&s.date.toDateString()===r.toDateString(),d=s.date.toDateString()===new Date().toDateString();return jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let p=r??new Date,w=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),p.getHours(),p.getMinutes(),p.getSeconds());n(w);}else n(s.date);},className:`
25
+ `,children:jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{children:e}),jsx("svg",{className:`w-5 h-5 transition-transform ${n?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&jsx("div",{className:"px-4 py-3 bg-background border-t border-border",children:t})]})});St.displayName="Accordion";var pi=St;function g(...e){return twMerge(clsx(e))}var Vt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("h5",{ref:o,className:t?e:g("mb-1 font-medium leading-none tracking-tight",e),...n,children:r})}));Vt.displayName="AlertTitle";var It=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("text-sm [&_p]:leading-relaxed",e),...n,children:r})}));It.displayName="AlertDescription";var Ht=forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsx(f,{children:jsx("div",{ref:i,role:"alert",className:t?e:g("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:-translate-y-0.75 [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{default:"bg-background text-foreground border-border",destructive:"border-red-500/50 text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-950/50 [&>svg]:text-red-600 dark:[&>svg]:text-red-400",warning:"border-yellow-500/50 text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/50 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-400",success:"border-green-500/50 text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 [&>svg]:text-green-600 dark:[&>svg]:text-green-400"}[r],e),...o,children:n})}));Ht.displayName="Alert";var ki=Ht,Ni=Vt,Pi=It;var At=forwardRef(({className:e,overrideClassName:t=!1,variant:r="default",children:n,...o},i)=>jsx(f,{children:jsx("div",{ref:i,className:t?e:g("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-red-500 text-white hover:bg-red-600",outline:"text-foreground border border-input",ghost:"bg-transparent text-foreground hover:bg-muted",link:"text-primary underline-offset-4 hover:underline",success:"bg-green-500 text-white hover:bg-green-600",warning:"bg-yellow-500 text-black hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",subtle:"bg-muted text-muted-foreground hover:bg-muted/80",dark:"bg-zinc-900 text-white hover:bg-zinc-800",light:"bg-zinc-100 text-zinc-900 hover:bg-zinc-200"}[r],e),...o,children:n})}));At.displayName="Badge";var Fi=At;var Bt=({items:e,separator:t="/",overrideClassName:r,className:n})=>jsx(f,{children:jsx("nav",{"aria-label":"Breadcrumb",className:r?n:g("flex",n),children:jsx("ol",{className:"flex items-center space-x-2",children:e.map((o,i)=>jsxs("li",{className:"flex items-center",children:[i>0&&jsx("span",{className:"mx-2 text-muted-foreground",children:t}),o.href&&!o.current?jsx("a",{href:o.href,className:"text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o.label}):jsx("span",{className:g("text-sm font-medium",o.current?"text-foreground":"text-muted-foreground"),"aria-current":o.current?"page":void 0,children:o.label})]},i))})})});Bt.displayName="Breadcrumb";var $i=Bt;var Ot=qn.forwardRef(({className:e,overrideClassName:t,variant:r="primary",size:n="md",href:o,children:i,loading:a=!1,loadingContent:l,...s},m)=>{let u="inline-flex items-center justify-center rounded-lg font-medium cursor-pointer active:translate-y-1 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",c={primary:"bg-blue-600 text-white hover:bg-blue-700 shadow-md focus-visible:ring-blue-500",secondary:"bg-gray-600 text-white hover:bg-gray-700 shadow-sm focus-visible:ring-gray-500",tertiary:"bg-purple-600 text-white hover:bg-purple-700 shadow-sm focus-visible:ring-purple-500",destructive:"bg-red-600 text-white hover:bg-red-700 shadow-sm focus-visible:ring-red-500",success:"bg-green-600 text-white hover:bg-green-700 shadow-sm focus-visible:ring-green-500",warning:"bg-amber-500 text-white hover:bg-amber-600 shadow-sm focus-visible:ring-amber-500",info:"bg-cyan-600 text-white hover:bg-cyan-700 shadow-sm focus-visible:ring-cyan-500",accent:"bg-violet-600 text-white hover:bg-violet-700 shadow-sm focus-visible:ring-violet-500",outline:"border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 shadow-sm focus-visible:ring-gray-500",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus-visible:ring-gray-500",link:"text-blue-600 underline-offset-4 hover:underline bg-transparent p-0 h-auto shadow-none",gradient:"bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:from-blue-700 hover:to-purple-700 shadow-md focus-visible:ring-blue-500",glass:"bg-white/10 backdrop-blur-md border border-white/20 text-black hover:bg-white/20 shadow-sm focus-visible:ring-white/50",soft:"bg-blue-100 text-blue-700 hover:bg-blue-200 shadow-sm focus-visible:ring-blue-500",dark:"bg-gray-900 text-white hover:bg-gray-800 shadow-md focus-visible:ring-gray-500",light:"bg-gray-100 text-gray-900 hover:bg-gray-200 shadow-sm focus-visible:ring-gray-500",obsidian:"bg-black text-white hover:bg-gray-900 shadow-md border border-gray-800 focus-visible:ring-gray-700",polar:"bg-white text-gray-900 hover:bg-gray-50 shadow-md border border-gray-300 focus-visible:ring-gray-400"},d={xs:"h-7 px-2 text-xs min-w-16",sm:"h-9 px-3 text-sm min-w-20",md:"h-10 px-4 py-2 text-base min-w-24",lg:"h-11 px-6 text-lg min-w-28",xl:"h-12 px-8 text-xl min-w-32"},p=t?e:g(u,c[r],d[n],e);return o?jsx(f,{children:jsx("a",{href:o,className:p,ref:m,children:a&&l?l:i})}):jsx(f,{children:jsx("button",{className:p,ref:m,...s,children:a&&l?l:i})})});Ot.displayName="Button";var Ui=Ot;var Gt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("rounded-lg border bg-card text-card-foreground shadow-sm",e),...n,children:r})}));Gt.displayName="Card";var zt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("flex flex-col space-y-1.5 p-6",e),...n,children:r})}));zt.displayName="CardHeader";var Ut=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("h3",{ref:o,className:t?e:g("text-2xl font-semibold leading-none tracking-tight",e),...n,children:r})}));Ut.displayName="CardTitle";var Wt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("p",{ref:o,className:t?e:g("text-sm text-muted-foreground",e),...n,children:r})}));Wt.displayName="CardDescription";var qt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("p-6 pt-0",e),...n,children:r})}));qt.displayName="CardContent";var Yt=forwardRef(({className:e,overrideClassName:t=!1,children:r,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:t?e:g("flex items-center p-6 pt-0",e),...n,children:r})}));Yt.displayName="CardFooter";var Ji=Gt,ji=zt,Zi=Ut,Qi=Wt,es=qt,ts=Yt;var _t=forwardRef(({children:e,isOpen:t,onClose:r,size:n="md",className:o,overrideClassName:i=!1,...a},l)=>(useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[t]),useEffect(()=>{let m=u=>{u.key==="Escape"&&r();};return t&&document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,r]),t?jsx(f,{children:jsxs("div",{ref:l,className:"fixed inset-0 z-50 flex items-center justify-center",...a,children:[jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:r}),jsx("div",{className:i?o:g("relative bg-background border border-border rounded-lg shadow-lg w-full mx-4",{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[n],o),children:e})]})}):null));_t.displayName="Dialog";var Xt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-b border-border",t),...n,children:e})}));Xt.displayName="DialogHeader";var Jt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("h2",{ref:o,className:r?t:g("text-lg font-semibold text-foreground",t),...n,children:e})}));Jt.displayName="DialogTitle";var jt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4",t),...n,children:e})}));jt.displayName="DialogContent";var Zt=forwardRef(({children:e,className:t,overrideClassName:r=!1,...n},o)=>jsx(f,{children:jsx("div",{ref:o,className:r?t:g("px-6 py-4 border-t border-border flex justify-end space-x-2",t),...n,children:e})}));Zt.displayName="DialogFooter";var ls=_t,cs=Xt,ds=Jt,us=jt,ms=Zt;var Ae=createContext(void 0),er=forwardRef(({children:e,className:t,...r},n)=>{let[o,i]=useState(!1);return jsx(f,{children:jsx(Ae.Provider,{value:{isOpen:o,setIsOpen:i},children:jsx("div",{ref:n,className:g("relative inline-block",t),...r,children:e})})})});er.displayName="DropdownMenu";var tr=({children:e,asChild:t})=>{let r=useContext(Ae);if(!r)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");let n=()=>r.setIsOpen(!r.isOpen);if(t){let o=e;return cloneElement(o,{onClick:i=>{o.props.onClick?.(i),n();}})}return jsx(f,{children:jsx("button",{onClick:n,children:e})})};tr.displayName="DropdownMenuTrigger";var rr=forwardRef(({children:e,align:t="end",className:r,...n},o)=>{let i=useContext(Ae),a=useRef(null);return useEffect(()=>{o&&(typeof o=="function"?o(a.current):o.current=a.current);},[o]),useEffect(()=>{let s=m=>{a.current&&!a.current.contains(m.target)&&i?.setIsOpen(!1);};return i?.isOpen&&document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s);}},[i?.isOpen]),i?.isOpen?jsx(f,{children:jsx("div",{ref:a,className:g("absolute z-50 mt-2 min-w-32 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-md",{start:"left-0",center:"left-1/2 -translate-x-1/2",end:"right-0"}[t],r),...n,children:e})}):null});rr.displayName="DropdownMenuContent";var nr=forwardRef(({children:e,onClick:t,destructive:r,className:n,...o},i)=>{let a=useContext(Ae);return jsx(f,{children:jsx("button",{ref:i,onClick:s=>{t?.(s),a?.setIsOpen(!1);},className:g("w-full text-left px-4 py-2 text-sm hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none",r&&"text-red-600 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700",n),...o,children:e})})});nr.displayName="DropdownMenuItem";var or=forwardRef(({className:e,...t},r)=>jsx(f,{children:jsx("div",{ref:r,className:g("-mx-1 my-1 h-px bg-border",e),...t})}));or.displayName="DropdownMenuSeparator";var ar=forwardRef(({children:e,className:t,...r},n)=>jsx(f,{children:jsx("div",{ref:n,className:g("px-2 py-1.5 text-sm font-semibold",t),...r,children:e})}));ar.displayName="DropdownMenuLabel";var hs=er,ys=tr,ws=rr,Cs=nr,ks=or,Ns=ar;var ir=({src:e,alt:t="",fallback:r,size:n="md",className:o})=>{let[i,a]=useState(!1),l={sm:"h-8 w-8 text-xs",md:"h-10 w-10 text-sm",lg:"h-12 w-12 text-base",xl:"h-16 w-16 text-lg"},s=m=>m.split(" ").map(u=>u.charAt(0)).join("").toUpperCase().slice(0,2);return jsx(f,{children:jsx("div",{className:g("relative flex shrink-0 overflow-hidden rounded-full bg-muted",l[n],o),children:e&&!i?jsx("img",{src:e||"/placeholder.svg",alt:t,className:"aspect-square h-full w-full object-cover",onError:()=>a(!0)}):jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted font-medium text-muted-foreground",children:r?s(r):"?"})})})};ir.displayName="Avatar";var Es=ir;var Zn=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(f,{children:jsx("p",{className:r?t:g("text-sm text-muted-foreground",t),children:e})})},O=Zn;var Qn=({children:e,required:t,className:r,overrideClassName:n=!1,...o})=>jsx(f,{children:jsxs("div",{className:"flex items-center gap-1",children:[jsx("label",{...o,className:n?r:g("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),children:e}),t&&jsx("span",{className:"text-red-600",children:"*"})]})}),F=Qn;var to=({children:e,className:t,overrideClassName:r})=>{if(e)return jsx(f,{children:jsx("p",{className:r?t:g("text-sm text-red-600 dark:text-red-400",t),children:e})})},G=to;var cr=forwardRef(({label:e,required:t,option:r,description:n,icon:o,orientation:i="left",className:a,overrideClassName:l=!1,helperText:s,error:m,...u},c)=>{let d=useId(),p=g("h-4 w-4 rounded border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",m&&"border-destructive",a);return jsx(f,{children:jsxs("div",{className:"space-y-2 w-fit",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:`flex items-center ${i=="left"?"flex-row":"flex-row-reverse"} w-fit gap-2`,children:[jsx("input",{id:d,type:"checkbox",className:l?a:p,ref:c,...u}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(F,{htmlFor:d,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]}),m&&jsx(G,{children:m}),!m&&s&&jsx(O,{children:s})]})})});cr.displayName="CheckBox";var Zs=cr;function io(e,t){let{typeSet:r="field",multiCheck:n=!1,value:o,onChange:i,labelKey:a,valueKey:l,options:s,alignment:m="vertical",className:u,overrideClassName:c=!1,helperText:d,error:p,label:w,name:y,required:b,...v}=e,E=useId(),D=useMemo(()=>new Map(s.map(k=>[String(k[l]),k])),[s,l]),V=useMemo(()=>o==null?[]:r==="field"?n?o.map(k=>String(k)):[String(o)]:n?o.map(k=>String(k[l])):[String(o[l])],[o,r,n,l]),P=(k,N)=>{if(!i)return;let x;if(r==="field")if(n)x=k.map(M=>{let H=D.get(M);return H?H[l]:M});else {let h=k[0];if(!h)x=void 0;else {let M=D.get(h);x=M?M[l]:h;}}else n?x=k.map(M=>D.get(M)).filter(M=>M!==void 0):x=D.get(k[0]??"")??void 0;i({target:{name:y,value:x,type:"checkboxgroup",checked:N}});},$=k=>{let N;n?N=V.includes(k)?V.filter(x=>x!==k):[...V,k]:N=V[0]===k?[]:[k],P(N,N.includes(k));},I=m==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",S=g("h-4 w-4 rounded border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",p&&"border-destructive");return jsx(f,{children:jsxs("div",{className:g("flex flex-col gap-3",u),children:[w&&jsx(F,{required:b,children:w}),jsx("div",{className:I,children:s.map((k,N)=>{let x=String(k[l]),h=V.includes(x),M=`${E}-${x}-${N}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...v,id:M,ref:t,type:"checkbox",name:y,checked:h,onChange:()=>$(x),className:c?u:S}),jsx(F,{htmlFor:M,children:String(k[a])})]},M)})}),!!p&&jsx(G,{children:String(p)}),!p&&d&&jsx(O,{children:d})]})})}function so(){let e=forwardRef(io);return e.displayName="CheckBoxGroup",e}var lo=so(),cl=lo;var po=["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ffa500","#800080","#ffc0cb","#a52a2a","#808080","#000080","#008000"],pr=qn.forwardRef(({label:e,required:t,onChange:r,disabled:n=!1,presetColors:o=po,showPresets:i=!0,className:a,error:l,helperText:s,name:m},u)=>{let c=useId(),d=useRef(null),[p,w]=useState(!1),[y,b]=useState("COLOR"),[v,E]=useState("HEX"),[D,V]=useState("#000000"),[P,$]=useState(0),[I,S]=useState(0),[k,N]=useState(0),[x,h]=useState(1),[M,H]=useState("#000000"),[A,j]=useState("#ffffff"),[re,Ce]=useState(90),[R,T]=useState("linear-gradient(90deg, #000000, #ffffff)"),z=(L,U,De)=>Math.min(De,Math.max(U,L)),_=L=>{let U=L.replace("#","");return {r:parseInt(U.slice(0,2),16),g:parseInt(U.slice(2,4),16),b:parseInt(U.slice(4,6),16)}},W=L=>{r?.({target:{value:L,name:m}});};useEffect(()=>{let L=U=>{d.current&&!d.current.contains(U.target)&&w(!1);};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[]),useEffect(()=>{if(/^#[0-9A-F]{6}$/i.test(D)){let L=_(D);$(L.r),S(L.g),N(L.b);}},[D]),useEffect(()=>{let L=`linear-gradient(${re}deg, ${M}, ${A})`;T(L),y==="GRADIENT"&&W(L);},[M,A,re]);let q=()=>{if(x>=1){if(v==="HEX")return D;if(v==="RGB")return `rgb(${P}, ${I}, ${k})`}return `rgba(${P}, ${I}, ${k}, ${Number(x.toFixed(2))})`},Z=y==="GRADIENT"?R:q();return jsx(f,{children:jsxs("div",{className:`space-y-2 ${a??""}`,children:[e&&jsx(F,{htmlFor:c,required:t,children:e}),jsxs("div",{ref:d,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>!n&&w(!p),className:"flex items-center gap-2 px-3 py-2 border rounded-md bg-background w-full",children:[jsx("div",{className:"w-6 h-6 rounded border",style:{background:Z}}),jsx("span",{className:"text-xs font-mono truncate",children:Z})]}),p&&jsxs("div",{className:"absolute z-50 mt-1 w-85 bg-popover border rounded-md p-4 space-y-3 shadow-lg",children:[jsx("div",{className:"flex gap-2",children:["COLOR","GRADIENT"].map(L=>jsx("button",{type:"button",onClick:()=>b(L),className:`px-2 py-1 text-xs rounded ${y===L?"bg-primary text-white":"border"}`,children:L==="COLOR"?"Cor":"Gradiente"},L))}),jsx("div",{className:"w-full h-10 rounded border",style:{background:Z}}),y==="COLOR"&&jsxs(Fragment,{children:[jsx("input",{ref:u,type:"color",value:D,onChange:L=>{V(L.target.value.toUpperCase()),W(q());},className:"w-full h-10 rounded"}),jsxs("div",{className:"flex gap-2 items-center",children:[jsxs("select",{value:v,onChange:L=>E(L.target.value),className:"px-2 py-1 text-xs border rounded",children:[jsx("option",{value:"HEX",children:"HEX"}),jsx("option",{value:"RGB",children:"RGB"}),jsx("option",{value:"RGBA",children:"RGBA"})]}),v==="HEX"&&jsx("input",{value:D,onChange:L=>{let U=L.target.value.toUpperCase().replace(/[^0-9A-F#]/g,"");U.startsWith("#")||(U="#"+U),U="#"+U.slice(1,7),V(U),/^#[0-9A-F]{6}$/.test(U)&&W(U);},className:"flex-1 px-2 py-1 text-xs font-mono border rounded",placeholder:"#000000"}),(v==="RGB"||v==="RGBA")&&jsx("div",{className:"flex gap-2",children:[{l:"R",v:P,s:$},{l:"G",v:I,s:S},{l:"B",v:k,s:N}].map(({l:L,v:U,s:De})=>jsxs("div",{className:"flex items-center gap-1",children:[jsx("span",{className:"text-xs font-semibold",children:L}),jsx("input",{type:"number",min:0,max:255,value:U,onChange:Mn=>{De(z(+Mn.target.value,0,255)),W(q());},className:"w-14 px-1 py-1 text-xs border rounded"})]},L))})]}),v==="RGBA"&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs font-semibold",children:"A"}),jsx("input",{type:"range",min:0,max:1,step:.01,value:x,onChange:L=>{h(+L.target.value),W(q());},className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[Math.round(x*100),"%"]})]}),i&&jsx("div",{className:"grid grid-cols-5 gap-1",children:o.map(L=>jsx("button",{type:"button",onClick:()=>{V(L),h(1),W(L);},className:"w-8 h-8 rounded border",style:{background:L}},L))})]}),y==="GRADIENT"&&jsxs(Fragment,{children:[jsxs("div",{className:"flex gap-2 items-center",children:[jsx("input",{type:"color",value:M,onChange:L=>H(L.target.value)}),jsx("span",{className:"text-xs",children:"\u2192"}),jsx("input",{type:"color",value:A,onChange:L=>j(L.target.value)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-xs",children:"\xC2ngulo"}),jsx("input",{type:"range",min:0,max:360,value:re,onChange:L=>Ce(+L.target.value),className:"flex-1"}),jsxs("span",{className:"text-xs w-10 text-right",children:[re,"\xB0"]})]})]})]})]}),l&&jsx(G,{children:l}),!l&&s&&jsx(O,{children:s})]})})});pr.displayName="ColorPicker";var vl=pr;var fo=({...e})=>jsx("svg",{...e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Ge=fo;var bo=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},gr=bo;function tt({options:e,labelKey:t,valueKey:r,multiple:n,onChange:o,setSearchTerm:i,typeSet:a,name:l}){let[s,m]=useState([]),u=useMemo(()=>new Map(e.map(b=>[String(b[r]),b])),[e,r]),c=useCallback(()=>s.map(b=>u.get(b)).filter(b=>!!b),[s,u]),d=useCallback(b=>{if(!o)return;let v;if(a==="field"?n?v=b:v=b[0]??void 0:n?v=b.map(D=>u.get(D)).filter(D=>D!==void 0):v=u.get(b[0]??"")??void 0,i&&!n){let E=u.get(b[0]??"");E&&i(String(E[t]));}o({target:{name:l,value:v,type:"combobox"}});},[n,o,u,l,a,i,t]),p=useCallback(b=>{let v=String(b[r]),E=n?s.includes(v)?s.filter(D=>D!==v):[...s,v]:[v];m(E),d(E);},[n,s,d,r]),w=useCallback(b=>{let v=s.filter(E=>E!==b);m(v),d(v);},[s,d]),y=useCallback(()=>{m([]),i?.("");let b;a==="field"?b=n?[]:"":b=n?[]:void 0,o?.({target:{name:l,value:b,type:"combobox"}});},[n,o,l,i,a]);return {selectedValues:s,handleSelect:p,handleRemove:w,handleClear:y,getSelectedOptions:c}}function rt(e,t,r){return useMemo(()=>r?e.filter(o=>String(o[t]).toLowerCase().includes(r.toLowerCase())):e,[e,r,t])}var vr=({isOpen:e,setIsOpen:t,multiple:r,searchTerm:n,setSearchTerm:o,selectedValues:i,filteredOptions:a,highlightedIndex:l,setHighlightedIndex:s,handleSelect:m,handleRemove:u})=>{let c=useCallback(p=>{if(a.length===0){s(-1);return}s(w=>w<0?p>0?0:a.length-1:(w+p+a.length)%a.length);},[a,s]);return useCallback(p=>{if(!e){if(p.key==="Enter"||p.key==="ArrowDown"){t(!0),s(0),p.preventDefault();return}r&&p.key==="Backspace"&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));return}switch(p.key){case"ArrowDown":p.preventDefault(),c(1);break;case"ArrowUp":p.preventDefault(),c(-1);break;case"Enter":p.preventDefault();let w=l>=0?l:0,y=a[w];y&&m(y),r&&o&&o(""),r||(t(!1),s(-1));break;case"Escape":p.preventDefault(),t(!1),s(-1),r||o("");break;case"Tab":t(!1),s(-1);break;case"Home":p.preventDefault(),a.length>0&&s(0);break;case"End":p.preventDefault(),a.length>0&&s(a.length-1);break;case"Backspace":r&&n===""&&i.length>0&&(p.preventDefault(),u(i[i.length-1]));break}},[e,r,n,i,a,l,t,o,s,m,u,c])};function xr({option:e,labelKey:t,valueKey:r,onRemove:n}){let o=String(e[t]),i=String(e[r]);return jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded",children:[o,jsx("button",{type:"button",onMouseDown:a=>a.preventDefault(),onClick:()=>n(i),className:"hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full p-0.5 transition-colors","aria-label":`Remover ${o}`,children:"\u2715"})]},i)}function Po(e,t){let{label:r,required:n=!1,name:o,placeholder:i="Buscar...",labelKey:a,valueKey:l,options:s,value:m,onChange:u,mode:c="single",typeSet:d="field",disabled:p=!1,ClearEnabled:w=!0,helperText:y,error:b=!1,className:v="",...E}=e,D=c==="multiple",[V,P]=useState(!1),[$,I]=useState(""),S=useRef(null),k=useRef(null),N=useRef(null);useImperativeHandle(t,()=>N.current),gr(k,()=>P(!1));let x=rt(s,a,$),[h,M]=useState(-1),{selectedValues:H,handleSelect:A,handleRemove:j,handleClear:re,getSelectedOptions:Ce}=tt({options:s,labelKey:a,valueKey:l,value:m,multiple:D,onChange:u,typeSet:d,name:o,setSearchTerm:I}),R=vr({isOpen:V,setIsOpen:P,multiple:D,searchTerm:$,setSearchTerm:I,selectedValues:H,filteredOptions:x,highlightedIndex:h,setHighlightedIndex:M,handleSelect:A,handleRemove:j}),T=useId(),z="w-full bg-transparent outline-none placeholder:text-gray-500 dark:placeholder:text-gray-400 text-gray-900 dark:text-gray-100",_=g("relative w-full min-h-[40px] px-3 py-2 border rounded-md bg-white dark:bg-gray-800",b?"border-red-500":"border-gray-300 dark:border-gray-600",p?"opacity-50 cursor-not-allowed":"cursor-text","focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500");return jsx(f,{children:jsxs("div",{className:`space-y-2 ${v}`,children:[r&&jsx(F,{htmlFor:T,required:n,children:r}),jsxs("div",{ref:S,className:"relative",children:[jsxs("div",{className:_,children:[D&&Ce().length>0&&jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ce().map((W,q)=>jsx(xr,{option:W,labelKey:a,valueKey:l,onRemove:j},String(W[l]??q)))}),jsx("input",{ref:N,...E,name:o,type:"text",placeholder:i,value:$,onChange:W=>{let q=W.target.value;I(q),!V&&q.trim()!==""&&P(!0);},onKeyDown:R,onMouseDown:W=>{document.activeElement===N.current&&(W.preventDefault(),P(q=>{let Z=!q;return Z&&M(0),Z}));},onFocus:()=>{P(!0),M(0);},disabled:p,className:z,role:"combobox","aria-expanded":V,"aria-controls":T,"aria-activedescendant":h>=0?`${T}-opt-${h}`:void 0}),w&&!!H.length&&jsx("button",{type:"button",onMouseDown:W=>W.preventDefault(),onClick:re,className:"absolute right-2 top-2 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700",title:"Limpar sele\xE7\xE3o",children:jsx(Ge,{width:12,height:12})})]}),V&&jsx("div",{ref:k,id:T,className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",role:"listbox","aria-multiselectable":D||void 0,children:x.length===0?jsx("div",{className:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400",children:"Nenhum resultado encontrado"}):x.map((W,q)=>{let Z=String(W[l]),L=H.includes(Z),U=q===h;return jsx("button",{id:`${T}-opt-${q}`,"data-index":q,role:"option","aria-selected":L,type:"button",onMouseDown:De=>De.preventDefault(),onClick:()=>A(W),className:g("w-full px-3 py-2 text-left text-sm transition-colors",U&&"bg-blue-100 dark:bg-blue-800 text-blue-900 dark:text-white",!U&&L&&"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300",!L&&!U&&"text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),children:jsx("span",{children:String(W[a])})},Z)})})]}),b&&jsx(G,{children:b}),!b&&y&&jsx(O,{children:y})]})})}function To(){let e=forwardRef(Po);return e.displayName="ComboBox",e}var Lo=To(),Yl=Lo;var Ro=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),yr=Ro;var Do=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),de=Do;var Mo=({...e})=>jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),ue=Mo;var be=["Janeiro","Fevereiro","Mar\xE7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var kr=["Dom","Seg","Ter","Qua","Qui","Sex","S\xE1b"];var st=({type:e,currentMonth:t,selectedDate:r,onChange:n,onNavigate:o,onMonthClick:i,onYearClick:a})=>{let l=s=>{let m=s.getFullYear(),u=s.getMonth(),c=new Date(m,u,1),p=new Date(m,u+1,0).getDate(),w=c.getDay(),y=[];for(let b=w-1;b>=0;b--)y.push({date:new Date(m,u,-b),isCurrentMonth:!1});for(let b=1;b<=p;b++)y.push({date:new Date(m,u,b),isCurrentMonth:!0});for(;y.length<42;)y.push({date:new Date(m,u+1,y.length-p+1),isCurrentMonth:!1});return y};return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsxs("div",{className:"font-medium flex gap-1",children:[jsx("span",{className:"cursor-pointer hover:underline",onClick:i,children:be[t.getMonth()]}),jsx("span",{className:"cursor-pointer hover:underline",onClick:a,children:t.getFullYear()})]}),jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:kr.map(s=>jsx("div",{className:"text-center text-xs font-medium text-muted-foreground p-2",children:s},s))}),jsx("div",{className:"grid grid-cols-7 gap-1",children:l(t).map((s,m)=>{let c=r&&s.date.toDateString()===r.toDateString(),d=s.date.toDateString()===new Date().toDateString();return jsx("button",{type:"button",onClick:()=>{if(e==="datetime-local"){let p=r??new Date,w=new Date(s.date.getFullYear(),s.date.getMonth(),s.date.getDate(),p.getHours(),p.getMinutes(),p.getSeconds());n(w);}else n(s.date);},className:`
26
26
  p-2 cursor-pointer text-sm rounded hover:bg-accent
27
27
  ${s.isCurrentMonth?"text-foreground":"text-muted-foreground"}
28
28
  ${c?"bg-primary text-primary-foreground hover:bg-primary":""}
29
29
  ${d&&!c?"bg-accent font-medium":""}
30
- `,children:s.date.getDate()},m)})})]})};var kr=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let m=new Date(s.getFullYear(),0,4),u=1+Math.round(((s.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(u).padStart(2,"0")}`}}};var lt=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return be?`${be[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var Fo=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Nr=Fo;var Tr=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-3 gap-2",children:be.map((s,m)=>{let u=r,c=u&&u.getFullYear()===l&&u.getMonth()===m;return jsx("button",{type:"button",onClick:()=>{e(new Date(l,m,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Lr=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
30
+ `,children:s.date.getDate()},m)})})]})};var Nr=(e,t)=>{let r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0"),l=String(e.getSeconds()).padStart(2,"0");switch(t){case"date":return `${r}-${n}-${o}`;case"datetime-local":return `${r}-${n}-${o}T${i}:${a}:${l}`;case"year":return `${r}`;case"month":return `${r}-${n}`;case"week":{let s=new Date(e);s.setHours(0,0,0,0),s.setDate(s.getDate()+3-(s.getDay()+6)%7);let m=new Date(s.getFullYear(),0,4),u=1+Math.round(((s.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7);return `${s.getFullYear()}-W${String(u).padStart(2,"0")}`}}};var lt=(e,t,r="pt-BR")=>{switch(t){case"date":return e.toLocaleDateString(r);case"datetime-local":return e.toLocaleString(r);case"year":return `${e.getFullYear()}`;case"month":return be?`${be[e.getMonth()]} ${e.getFullYear()}`:e.toLocaleDateString(r,{month:"long",year:"numeric"});case"week":{let n=new Date(e);n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);let o=new Date(n.getFullYear(),0,4);return `Semana ${1+Math.round(((n.getTime()-o.getTime())/864e5-3+(o.getDay()+6)%7)/7)} \u2022 ${n.getFullYear()}`}}};var So=(e,t)=>{useEffect(()=>{let r=n=>{e.current&&!e.current.contains(n.target)&&t(!1);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}},[e,t]);},Pr=So;var Lr=({onChange:e,currentMonth:t,selectedDate:r,setIsOpen:n,onNavigate:o,onHeaderClick:i,closeOnSelect:a})=>{let l=t.getFullYear();return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>o("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:i,children:l}),jsx("button",{type:"button",onClick:()=>o("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-3 gap-2",children:be.map((s,m)=>{let u=r,c=u&&u.getFullYear()===l&&u.getMonth()===m;return jsx("button",{type:"button",onClick:()=>{e(new Date(l,m,1)),a&&n(!1);},className:`p-2 cursor-pointer text-sm rounded hover:bg-accent ${c?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:s},s)})})]})};var Rr=({selectedDate:e,onChange:t})=>{let r=e??new Date,n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),a=`
31
31
  ${String(n).padStart(2,"0")}:
32
32
  ${String(o).padStart(2,"0")}:
33
33
  ${String(i).padStart(2,"0")}
34
- `,l=Array.from({length:24},(c,d)=>d),s=Array.from({length:60},(c,d)=>d),m=Array.from({length:60},(c,d)=>d),u=(c,d,p)=>{let w=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,d,p);t(w);};return jsxs("div",{className:"space-y-2",children:[jsxs(F,{className:"flex items-center gap-2",children:["Hora",jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsx("button",{type:"button",onClick:()=>u(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsx("button",{type:"button",onClick:()=>u(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:m.map(c=>jsx("button",{type:"button",onClick:()=>u(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Rr=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,d)=>d+1),s=e,m=c=>{let d=new Date(a,0,1+(c-1)*7);r(d),i(!1);},u=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let d=new Date(c.getFullYear(),0,4),p=1+Math.round(((c.getTime()-d.getTime())/864e5-3+(d.getDay()+6)%7)/7);return {year:c.getFullYear(),week:p}})();return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let d=u&&u.year===a&&u.week===c;return jsxs("button",{type:"button",onClick:()=>m(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${d?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var Mr=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium",children:e}),jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var Fr=forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:m=!1,helperText:u,className:c,...d},p)=>{let w=useId(),y=useRef(null),b=useRef(null),[v,E]=useState(!1),[D,V]=useState(0),[P,$]=useState(r),[I,S]=useState(()=>r?lt(r,a,l):""),[k,N]=useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Nr(y,()=>E(!1));let x=P??new Date,h=new Date(x.getFullYear(),x.getMonth()+D,1),M=R=>{b.current=R,typeof p=="function"?p(R):p&&(p.current=R);},H=R=>{$(R);let T=kr(R,a),z=lt(R,a,l);S(z),b.current&&(b.current.value=T,o?.({target:{name:b.current.name,value:T},type:"change"}),V(0));},A=(R,T,z)=>{let _=new Date(R,T+1,0).getDate();return Math.min(z,_)},j=R=>{let T=R.replace(/\D/g,"").slice(0,8),z=[];return T.length>=2&&z.push(T.slice(0,2)),T.length>=4&&z.push(T.slice(2,4)),T.length>4&&z.push(T.slice(4)),z.join("/")},re=R=>{let T=R.target.value,z=j(T);if(S(z),z.length===10){let[_,W,q]=z.split("/").map(Number),Z=new Date(q,W-1,_);isNaN(Z.getTime())||H(Z);}},Ce=()=>{switch(k){case"year":return jsx(Mr,{currentYear:h.getFullYear(),selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onPick:R=>{let T=P??new Date,z=A(R,T.getMonth(),T.getDate()),_=new Date(R,T.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="year"?(H(_),E(!1)):N(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsx(Tr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),closeOnSelect:a==="month",onChange:R=>{let T=P??new Date,z=A(R.getFullYear(),R.getMonth(),T.getDate()),_=new Date(R.getFullYear(),R.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="month"?(H(_),E(!1)):N("day");}});case"week":return jsx(Rr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),onChange:R=>{H(R),E(!1);}});case"day":default:return a==="datetime-local"?jsxs("div",{className:"flex h-fit gap-4",children:[jsx("div",{className:"flex-1",children:jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{let T=P??new Date,z=new Date(R.getFullYear(),R.getMonth(),R.getDate(),T.getHours(),T.getMinutes(),T.getSeconds());H(z);}})}),jsx("div",{className:"w-fit",children:jsx(Lr,{selectedDate:P,onChange:R=>H(R)})})]}):jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{H(R),E(!1);}})}};return jsx(f,{children:jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsx(F,{htmlFor:w,required:t,children:e}),jsx("input",{ref:M,id:w,name:n,type:"text",className:"sr-only",disabled:s,...d}),jsxs("div",{ref:y,className:"relative",children:[jsxs("div",{className:"relative",children:[jsx("input",{type:"text",value:I,onChange:re,onFocus:()=>!s&&E(!0),placeholder:i,disabled:s,className:`
34
+ `,l=Array.from({length:24},(c,d)=>d),s=Array.from({length:60},(c,d)=>d),m=Array.from({length:60},(c,d)=>d),u=(c,d,p)=>{let w=new Date(r.getFullYear(),r.getMonth(),r.getDate(),c,d,p);t(w);};return jsxs("div",{className:"space-y-2",children:[jsxs(F,{className:"flex items-center gap-2",children:["Hora",jsx("span",{className:"text-sm font-normal text-muted-foreground",children:a})]}),jsxs("div",{className:"flex h-full max-h-72 gap-2",children:[jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:l.map(c=>jsx("button",{type:"button",onClick:()=>u(c,o,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===n?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:s.map(c=>jsx("button",{type:"button",onClick:()=>u(n,c,i),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===o?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))}),jsx("div",{className:"w-16 overflow-y-auto border rounded-md scrollbar-thin",children:m.map(c=>jsx("button",{type:"button",onClick:()=>u(n,o,c),className:`w-full px-2 py-1 text-sm text-center cursor-pointer hover:bg-accent ${c===i?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:String(c).padStart(2,"0")},c))})]})]})};var Dr=({selectedDate:e,currentMonth:t,onChange:r,onNavigate:n,onHeaderClick:o,setIsOpen:i})=>{let a=t.getFullYear(),l=Array.from({length:52},(c,d)=>d+1),s=e,m=c=>{let d=new Date(a,0,1+(c-1)*7);r(d),i(!1);},u=(()=>{if(!s)return null;let c=new Date(s);c.setHours(0,0,0,0),c.setDate(c.getDate()+3-(c.getDay()+6)%7);let d=new Date(c.getFullYear(),0,4),p=1+Math.round(((c.getTime()-d.getTime())/864e5-3+(d.getDay()+6)%7)/7);return {year:c.getFullYear(),week:p}})();return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium cursor-pointer hover:underline",onClick:o,children:a}),jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(c=>{let d=u&&u.year===a&&u.week===c;return jsxs("button",{type:"button",onClick:()=>m(c),className:`p-2 text-sm rounded cursor-pointer hover:bg-accent ${d?"bg-primary text-primary-foreground hover:bg-primary":""}`,children:["Semana ",c]},c)})})]})};var Er=({currentYear:e,selectedDate:t,onPick:r,onNavigate:n})=>{let o=e-6,i=Array.from({length:12},(a,l)=>o+l);return jsxs(Fragment,{children:[jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsx("button",{type:"button",onClick:()=>n("prev"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(de,{width:16,height:16})}),jsx("h3",{className:"font-medium",children:e}),jsx("button",{type:"button",onClick:()=>n("next"),className:"p-1 cursor-pointer hover:bg-accent rounded",children:jsx(ue,{width:16,height:16})})]}),jsx("div",{className:"grid grid-cols-3 gap-2",children:i.map(a=>{let l=t?.getFullYear()===a;return jsx("button",{type:"button",onClick:()=>r(a),className:`p-2 text-sm rounded hover:bg-accent ${l?"bg-primary text-primary-foreground":""}`,children:a},a)})})]})};var Sr=forwardRef(({label:e,required:t,value:r,name:n,onChange:o,placeholder:i="Selecione uma data",type:a="date",locale:l="pt-BR",disabled:s=!1,error:m=!1,helperText:u,className:c,...d},p)=>{let w=useId(),y=useRef(null),b=useRef(null),[v,E]=useState(!1),[D,V]=useState(0),[P,$]=useState(r),[I,S]=useState(()=>r?lt(r,a,l):""),[k,N]=useState(()=>a==="month"?"month":a==="week"?"week":a==="year"?"year":"day");Pr(y,()=>E(!1));let x=P??new Date,h=new Date(x.getFullYear(),x.getMonth()+D,1),M=R=>{b.current=R,typeof p=="function"?p(R):p&&(p.current=R);},H=R=>{$(R);let T=Nr(R,a),z=lt(R,a,l);S(z),b.current&&(b.current.value=T,o?.({target:{name:b.current.name,value:T},type:"change"}),V(0));},A=(R,T,z)=>{let _=new Date(R,T+1,0).getDate();return Math.min(z,_)},j=R=>{let T=R.replace(/\D/g,"").slice(0,8),z=[];return T.length>=2&&z.push(T.slice(0,2)),T.length>=4&&z.push(T.slice(2,4)),T.length>4&&z.push(T.slice(4)),z.join("/")},re=R=>{let T=R.target.value,z=j(T);if(S(z),z.length===10){let[_,W,q]=z.split("/").map(Number),Z=new Date(q,W-1,_);isNaN(Z.getTime())||H(Z);}},Ce=()=>{switch(k){case"year":return jsx(Er,{currentYear:h.getFullYear(),selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onPick:R=>{let T=P??new Date,z=A(R,T.getMonth(),T.getDate()),_=new Date(R,T.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="year"?(H(_),E(!1)):N(a==="month"?"month":a==="week"?"week":"month");}});case"month":return jsx(Lr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),closeOnSelect:a==="month",onChange:R=>{let T=P??new Date,z=A(R.getFullYear(),R.getMonth(),T.getDate()),_=new Date(R.getFullYear(),R.getMonth(),z,T.getHours(),T.getMinutes(),T.getSeconds());$(_),a==="month"?(H(_),E(!1)):N("day");}});case"week":return jsx(Dr,{currentMonth:h,selectedDate:P,setIsOpen:E,onNavigate:R=>V(T=>T+(R==="next"?12:-12)),onHeaderClick:()=>N("year"),onChange:R=>{H(R),E(!1);}});case"day":default:return a==="datetime-local"?jsxs("div",{className:"flex h-fit gap-4",children:[jsx("div",{className:"flex-1",children:jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{let T=P??new Date,z=new Date(R.getFullYear(),R.getMonth(),R.getDate(),T.getHours(),T.getMinutes(),T.getSeconds());H(z);}})}),jsx("div",{className:"w-fit",children:jsx(Rr,{selectedDate:P,onChange:R=>H(R)})})]}):jsx(st,{type:a,currentMonth:h,selectedDate:P,onNavigate:R=>V(T=>T+(R==="next"?1:-1)),onMonthClick:()=>N("month"),onYearClick:()=>N("year"),onChange:R=>{H(R),E(!1);}})}};return jsx(f,{children:jsxs("div",{className:`space-y-2 ${c}`,children:[e&&jsx(F,{htmlFor:w,required:t,children:e}),jsx("input",{ref:M,id:w,name:n,type:"text",className:"sr-only",disabled:s,...d}),jsxs("div",{ref:y,className:"relative",children:[jsxs("div",{className:"relative",children:[jsx("input",{type:"text",value:I,onChange:re,onFocus:()=>!s&&E(!0),placeholder:i,disabled:s,className:`
35
35
  w-full px-3 py-2 pr-9 border rounded-md bg-background
36
36
  ${m?"border-red-500":"border-input"}
37
37
  ${s?"opacity-50 cursor-not-allowed":"hover:border-ring"}
38
38
  focus:ring-2 focus:ring-ring focus:ring-offset-2
39
- `}),jsx(hr,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),v&&jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:Ce()})]}),m&&jsx(G,{children:m}),!m&&u&&jsx(O,{children:u})]})})});Fr.displayName="DatePicker";var Wc=Fr;var Ue=({size:e="md",variant:t="default",color:r="primary",className:n="",speed:o="normal",text:i,textPosition:a="bottom",overlay:l=!1,progress:s})=>{let[m,u]=useState(s||0);useEffect(()=>{s!==void 0&&u(Math.min(Math.max(s,0),100));},[s]);let c=()=>{switch(e){case"xs":return "w-3 h-3";case"sm":return "w-4 h-4";case"lg":return "w-8 h-8";case"xl":return "w-12 h-12";case"xxl":return "w-16 h-16";default:return "w-6 h-6"}},d=()=>{switch(r){case"secondary":return "text-gray-500 dark:text-gray-400";case"muted":return "text-gray-400 dark:text-gray-500";case"success":return "text-green-600 dark:text-green-400";case"danger":return "text-red-600 dark:text-red-400";case"warning":return "text-yellow-600 dark:text-yellow-400";case"info":return "text-blue-400 dark:text-blue-300";case"white":return "text-white dark:text-gray-200";default:return "text-blue-600 dark:text-blue-400"}},p=()=>{switch(o){case"slow":return "animate-[spin_2s_linear_infinite]";case"fast":return "animate-[spin_0.5s_linear_infinite]";default:return "animate-spin"}},w=()=>{switch(o){case"slow":return "animate-pulseSlow";case"fast":return "animate-pulseFast";default:return "animate-pulse"}},y=()=>{switch(o){case"slow":return "animate-bounceSlow";case"fast":return "animate-bounceFast";default:return "animate-bounce"}},b=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-3 h-3";case"xl":return "w-4 h-4";case"xxl":return "w-5 h-5";default:return "w-2 h-2"}},v=()=>{switch(e){case"xs":return "w-0.5 h-3";case"sm":return "w-0.5 h-4";case"lg":return "w-1 h-8";case"xl":return "w-1.5 h-12";case"xxl":return "w-2 h-16";default:return "w-1 h-6"}},E=()=>{switch(e){case"xs":return "w-0.5";case"sm":return "w-1";case"lg":return "w-1.5";case"xl":return "w-2";case"xxl":return "w-2.5";default:return "w-1"}},D=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-2 h-2";case"xl":return "w-3 h-3";case"xxl":return "w-4 h-4";default:return "w-1.5 h-1.5"}},V=()=>t==="dots"?jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${w()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="bars"?jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3].map(S=>jsx("div",{className:`${v()} ${d()} bg-current ${w()}`,style:{animationDelay:`${S*.15}s`}},S))}):t==="ring"?jsx("div",{className:c(),children:jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 border-t-current rounded-full ${p()} ${d()}`})}):t==="pulse"?jsx("div",{className:`${c()} ${d()}`,children:jsx("div",{className:`w-full h-full bg-current rounded-full ${w()}`})}):t==="wave"?jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3,4].map(S=>jsx("div",{className:`${E()} ${d()} bg-current rounded animate-wave`,style:{animationDelay:`${S*.15}s`,height:e==="xs"?"8px":e==="sm"?"10px":e==="lg"?"16px":e==="xl"?"20px":e==="xxl"?"24px":"12px"}},S))}):t==="bounce"?jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${y()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="grid"?jsx("div",{className:`${c()} ${d()} grid grid-cols-3 gap-0.5`,children:[...Array(9)].map((S,k)=>jsx("div",{className:`${D()} bg-current rounded-full ${w()}`,style:{animationDelay:`${k*.1}s`}},k))}):t==="clock"?jsxs("div",{className:`${c()} relative ${d()}`,children:[jsx("div",{className:"w-full h-full border-2 border-current rounded-full"}),jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock"}),jsx("div",{className:"absolute top-1/2 left-1/2 w-2/5 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock",style:{animationDelay:"-4s"}})]}):t==="orbit"?jsxs("div",{className:`${c()} relative`,children:[jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 rounded-full ${d()}`}),jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2",children:jsx("div",{className:`${b()} ${d()} bg-current rounded-full animate-orbit`})})]}):t==="cube"?jsxs("div",{className:`${c()} ${d()} relative transform-style-3d animate-rotateCube`,children:[jsx("div",{className:"absolute w-full h-full bg-current opacity-25"}),jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateY(90deg)"}),jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateX(90deg)"})]}):t==="circle-dots"?jsx("div",{className:`${c()} relative ${d()}`,children:[...Array(8)].map((S,k)=>jsx("div",{className:"absolute w-full h-full animate-circleDots",style:{transform:`rotate(${k*45}deg)`},children:jsx("div",{className:`${b()} bg-current rounded-full absolute top-0 left-1/2 -translate-x-1/2 animate-fadePulse`,style:{animationDelay:`${k*.1}s`}})},k))}):t==="infinity"?jsx("div",{className:`${c()} ${d()}`,children:jsxs("svg",{viewBox:"0 0 120 30",className:"w-full h-full",children:[jsx("circle",{cx:"15",cy:"15",r:"12",className:"animate-infinity1"}),jsx("circle",{cx:"60",cy:"15",r:"12",className:"animate-infinity2"}),jsx("circle",{cx:"105",cy:"15",r:"12",className:"animate-infinity3"})]})}):t==="progress"?jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[jsx("path",{className:"text-gray-200 dark:text-gray-700",stroke:"currentColor",strokeWidth:"3",fill:"transparent",d:`M18 2.0845\r
39
+ `}),jsx(yr,{width:16,height:16,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"})]}),v&&jsx("div",{className:"absolute z-50 mt-1 bg-popover border border-border rounded-md shadow-lg p-4 min-w-70",children:Ce()})]}),m&&jsx(G,{children:m}),!m&&u&&jsx(O,{children:u})]})})});Sr.displayName="DatePicker";var qc=Sr;var Ue=({size:e="md",variant:t="default",color:r="primary",className:n="",speed:o="normal",text:i,textPosition:a="bottom",overlay:l=!1,progress:s})=>{let[m,u]=useState(s||0);useEffect(()=>{s!==void 0&&u(Math.min(Math.max(s,0),100));},[s]);let c=()=>{switch(e){case"xs":return "w-3 h-3";case"sm":return "w-4 h-4";case"lg":return "w-8 h-8";case"xl":return "w-12 h-12";case"xxl":return "w-16 h-16";default:return "w-6 h-6"}},d=()=>{switch(r){case"secondary":return "text-gray-500 dark:text-gray-400";case"muted":return "text-gray-400 dark:text-gray-500";case"success":return "text-green-600 dark:text-green-400";case"danger":return "text-red-600 dark:text-red-400";case"warning":return "text-yellow-600 dark:text-yellow-400";case"info":return "text-blue-400 dark:text-blue-300";case"white":return "text-white dark:text-gray-200";default:return "text-blue-600 dark:text-blue-400"}},p=()=>{switch(o){case"slow":return "animate-[spin_2s_linear_infinite]";case"fast":return "animate-[spin_0.5s_linear_infinite]";default:return "animate-spin"}},w=()=>{switch(o){case"slow":return "animate-pulseSlow";case"fast":return "animate-pulseFast";default:return "animate-pulse"}},y=()=>{switch(o){case"slow":return "animate-bounceSlow";case"fast":return "animate-bounceFast";default:return "animate-bounce"}},b=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-3 h-3";case"xl":return "w-4 h-4";case"xxl":return "w-5 h-5";default:return "w-2 h-2"}},v=()=>{switch(e){case"xs":return "w-0.5 h-3";case"sm":return "w-0.5 h-4";case"lg":return "w-1 h-8";case"xl":return "w-1.5 h-12";case"xxl":return "w-2 h-16";default:return "w-1 h-6"}},E=()=>{switch(e){case"xs":return "w-0.5";case"sm":return "w-1";case"lg":return "w-1.5";case"xl":return "w-2";case"xxl":return "w-2.5";default:return "w-1"}},D=()=>{switch(e){case"xs":return "w-1 h-1";case"sm":return "w-1.5 h-1.5";case"lg":return "w-2 h-2";case"xl":return "w-3 h-3";case"xxl":return "w-4 h-4";default:return "w-1.5 h-1.5"}},V=()=>t==="dots"?jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${w()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="bars"?jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3].map(S=>jsx("div",{className:`${v()} ${d()} bg-current ${w()}`,style:{animationDelay:`${S*.15}s`}},S))}):t==="ring"?jsx("div",{className:c(),children:jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 border-t-current rounded-full ${p()} ${d()}`})}):t==="pulse"?jsx("div",{className:`${c()} ${d()}`,children:jsx("div",{className:`w-full h-full bg-current rounded-full ${w()}`})}):t==="wave"?jsx("div",{className:"flex items-end space-x-1",children:[0,1,2,3,4].map(S=>jsx("div",{className:`${E()} ${d()} bg-current rounded animate-wave`,style:{animationDelay:`${S*.15}s`,height:e==="xs"?"8px":e==="sm"?"10px":e==="lg"?"16px":e==="xl"?"20px":e==="xxl"?"24px":"12px"}},S))}):t==="bounce"?jsx("div",{className:"flex space-x-1",children:[0,1,2].map(S=>jsx("div",{className:`${b()} ${d()} bg-current rounded-full ${y()}`,style:{animationDelay:`${S*.2}s`}},S))}):t==="grid"?jsx("div",{className:`${c()} ${d()} grid grid-cols-3 gap-0.5`,children:[...Array(9)].map((S,k)=>jsx("div",{className:`${D()} bg-current rounded-full ${w()}`,style:{animationDelay:`${k*.1}s`}},k))}):t==="clock"?jsxs("div",{className:`${c()} relative ${d()}`,children:[jsx("div",{className:"w-full h-full border-2 border-current rounded-full"}),jsx("div",{className:"absolute top-1/2 left-1/2 w-1/2 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock"}),jsx("div",{className:"absolute top-1/2 left-1/2 w-2/5 h-0.5 bg-current origin-left -translate-y-1/2 animate-clock",style:{animationDelay:"-4s"}})]}):t==="orbit"?jsxs("div",{className:`${c()} relative`,children:[jsx("div",{className:`w-full h-full border-2 border-gray-200 dark:border-gray-700 rounded-full ${d()}`}),jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2",children:jsx("div",{className:`${b()} ${d()} bg-current rounded-full animate-orbit`})})]}):t==="cube"?jsxs("div",{className:`${c()} ${d()} relative transform-style-3d animate-rotateCube`,children:[jsx("div",{className:"absolute w-full h-full bg-current opacity-25"}),jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateY(90deg)"}),jsx("div",{className:"absolute w-full h-full bg-current opacity-25 transform-rotateX(90deg)"})]}):t==="circle-dots"?jsx("div",{className:`${c()} relative ${d()}`,children:[...Array(8)].map((S,k)=>jsx("div",{className:"absolute w-full h-full animate-circleDots",style:{transform:`rotate(${k*45}deg)`},children:jsx("div",{className:`${b()} bg-current rounded-full absolute top-0 left-1/2 -translate-x-1/2 animate-fadePulse`,style:{animationDelay:`${k*.1}s`}})},k))}):t==="infinity"?jsx("div",{className:`${c()} ${d()}`,children:jsxs("svg",{viewBox:"0 0 120 30",className:"w-full h-full",children:[jsx("circle",{cx:"15",cy:"15",r:"12",className:"animate-infinity1"}),jsx("circle",{cx:"60",cy:"15",r:"12",className:"animate-infinity2"}),jsx("circle",{cx:"105",cy:"15",r:"12",className:"animate-infinity3"})]})}):t==="progress"?jsxs("div",{className:`${c()} relative ${d()}`,children:[jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[jsx("path",{className:"text-gray-200 dark:text-gray-700",stroke:"currentColor",strokeWidth:"3",fill:"transparent",d:`M18 2.0845\r
40
40
  a 15.9155 15.9155 0 0 1 0 31.831\r
41
41
  a 15.9155 15.9155 0 0 1 0 -31.831`}),jsx("path",{className:"transition-all duration-300",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"transparent",strokeDasharray:"100, 100",strokeDashoffset:100-m,d:`M18 2.0845\r
42
42
  a 15.9155 15.9155 0 0 1 0 31.831\r
43
- a 15.9155 15.9155 0 0 1 0 -31.831`})]}),e!=="xs"&&e!=="sm"&&jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium",children:[m,"%"]})]}):jsx("div",{className:c(),children:jsxs("svg",{className:`${p()} ${d()}`,fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),P=()=>{switch(a){case"top":return "flex-col-reverse";case"left":return "flex-row-reverse";case"right":return "flex-row";default:return "flex-col"}},$=()=>{switch(e){case"xs":case"sm":return "text-xs";case"lg":return "text-base";case"xl":case"xxl":return "text-lg";default:return "text-sm"}},I=jsx(f,{children:jsxs("div",{className:`inline-flex ${i?`items-center ${P()} space-y-1 space-x-0 ${a==="left"||a==="right"?"space-y-0 space-x-2":""}`:""}`,children:[V(),i&&jsx("span",{className:`${$()} text-gray-500 dark:text-gray-400`,children:i})]})});return l?jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50",children:I}):jsx("div",{className:n,children:I})};Ue.displayName="Spinner";var Sr=Ue,Vr=({text:e="Carregando...",size:t="md",variant:r="default",color:n="primary",className:o="",textPosition:i="right"})=>jsx(f,{children:jsx("div",{className:o,children:jsx(Ue,{size:t,variant:r,color:n,text:e,textPosition:i})})});Vr.displayName="LoadingSpinner";var Xc=Vr,Ir=({isVisible:e,text:t="Carregando...",variant:r="default",size:n="lg",className:o=""})=>e?jsx(f,{children:jsx("div",{className:`fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50 ${o}`,children:jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsx(Ue,{size:n,variant:r}),jsx("p",{className:"text-gray-500 dark:text-gray-400",children:t})]})})}):null;Ir.displayName="LoadingOverlay";var Jc=Ir,Hr=({size:e="sm",color:t="primary"})=>jsx(f,{children:jsx("div",{className:`${(()=>{switch(e){case"xs":return "w-3 h-3";case"md":return "w-5 h-5";default:return "w-4 h-4"}})()} ${t==="white"?"text-white":"text-current"}`,children:jsxs("svg",{className:"animate-spin",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})});Hr.displayName="ButtonSpinner";var jc=Hr,$r=({lines:e=3,className:t=""})=>jsx(f,{children:jsx("div",{className:`space-y-3 ${t}`,children:[...Array(e)].map((r,n)=>jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",style:{width:n===e-1?"60%":"100%"}},n))})});$r.displayName="ContentLoader";var Zc=$r,Ar=({width:e="100%",height:t="1rem",circle:r=!1,className:n=""})=>jsx(f,{children:jsx("div",{className:`bg-gray-200 dark:bg-gray-700 animate-pulse ${r?"rounded-full":"rounded"} ${n}`,style:{width:e,height:t}})});Ar.displayName="Skeleton";var Qc=Ar;var Br=({children:e,type:t,className:r,overrideClassName:n=!1})=>{if(e)switch(t){case"loading":return jsxs("p",{className:n?r:g("text-sm text-muted-foreground flex items-center gap-2",r),children:[jsx(Sr,{size:"xs"}),e]});case"error":return jsx("p",{className:n?r:g("text-sm text-red-600 dark:text-red-400",r),children:e});case"warning":return jsx("p",{className:n?r:g("text-sm text-yellow-600 dark:text-yellow-400",r),children:e});case"success":return jsx("p",{className:n?r:g("text-sm text-green-600 dark:text-green-400",r),children:e});case"info":return jsx("p",{className:n?r:g("text-sm text-blue-600 dark:text-blue-400",r),children:e});case"helper":return jsx("p",{className:n?r:g("text-sm text-muted-foreground",r),children:e});default:return null}};Br.displayName="FieldFeedback";var We=Br;var zo=({children:e,before:t,after:r,className:n})=>{let i=Go("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},ut=zo;var Uo=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),zr=Uo;var Wo=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),Wr=Wo;function qr(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Yr(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function Kr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function _r(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Xr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Jr(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function jr(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function Zr(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var qo=({e,mask:t})=>{switch(t){case"money":return Yr(e);case"mobile":return _r(e);case"phone":return Xr(e);case"cpfCnpj":return Jr(e);case"cpf":return Kr(e);case"rg":return jr(e);case"cnpj":return Zr(e);case"cep":return qr(e);default:return e}},Qr=qo;var _o=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let s=Qr({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},tn=_o;var rn=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:m,ClearEnabled:u=!0,className:c,overrideClassName:d=!1,error:p,helperText:w,value:y=void 0,onChange:b,...v},E)=>{let D=useId(),{handleChange:V,handleClear:P,setValue:$}=tn({mask:r,initialValue:y}),I=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",p&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",c),S=N=>{V(N),b?.(N);},k=()=>{P(),$(""),b?.({target:{name:n||"",value:""}});};return jsx(f,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(F,{htmlFor:D,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(ut,{before:!0,className:l,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(zr,{children:o}),jsx("input",{id:D,ref:E,name:n,onChange:S,className:d?c:I,...v}),u&&y&&jsx(Ge,{onClick:k,width:12,height:12,className:g("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(Wr,{children:i})]}),s&&jsx(ut,{after:!0,className:m,children:s})]}),p&&jsx(G,{children:p}),!p&&w&&jsx(O,{children:w})]})})});rn.displayName="Input";var Md=rn;var on=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:m,className:u,charType:c="numeric",customPattern:d,caseMode:p="none",...w},y)=>{let b=useId(),v=useRef([]),E=x=>{switch(p){case"upper":return x.toUpperCase();case"lower":case"visual-upper":return x.toLowerCase();case"visual-lower":return x.toUpperCase();default:return x}},D=x=>{if(!x)return "";let h=x.slice(0,1);switch(h=E(h),c){case"numeric":return /\d/.test(h)?h:"";case"alpha":return /[A-Za-z]/.test(h)?h:"";case"alphanumeric":return /[A-Za-z0-9]/.test(h)?h:"";case"custom":return d?.test(h)?h:"";default:return h}},V=()=>(r!=null?String(r):"").split("").map(D).slice(0,e),P=V().concat(Array(e).fill(" ")).slice(0,e),$=x=>{let h=x.split("").map(D).join("").slice(0,e),M=h===""?void 0:typeof r=="number"?Number(h):h;s?.({target:{name:n,value:M}});},I=(x,h)=>{let M=D(h),H=V();if(M===""){H[x]="",$(H.join(""));return}if(h.length>1){let A=h.split("").map(D).join("").slice(0,e);$(A),v.current[Math.min(A.length-1,e-1)]?.focus();return}M&&(H[x]=M,$(H.join("")),x<e-1&&v.current[x+1]?.focus());},S=x=>{let h=V();!h[x]&&x>0?h[x-1]="":h[x]="",$(h.join("")),x>0&&v.current[x-1]?.focus();},k=x=>{x.preventDefault();let M=x.clipboardData.getData("text").split("").map(D).join("").slice(0,e);M&&($(M),v.current[Math.min(M.length-1,e-1)]?.focus());},N=x=>{switch(p){case"upper":case"visual-upper":return x.toUpperCase();case"lower":case"visual-lower":return x.toLowerCase();default:return x}};return jsx(f,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(F,{htmlFor:b,required:i,children:o}),jsx("div",{className:g("flex gap-3 items-center",l&&"text-red-500",u),...w,children:P.map((x,h)=>{let M=t&&h>0&&h%t===0;return jsxs(Wn.Fragment,{children:[M&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:N(x).trim(),ref:H=>{v.current[h]=H,h===0&&y&&(typeof y=="function"?y(H):typeof y=="object"&&(y.current=H));},onPaste:k,onChange:H=>I(h,H.target.value),onKeyDown:H=>H.key==="Backspace"&&S(h),onBlur:m,className:g("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},h)})}),l&&jsx(G,{children:l}),!l&&a&&jsx(O,{children:a})]})})});on.displayName="OtpInput";var Bd=on;var an=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...m},u)=>{let c=useId(),d=g("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsx(f,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:c,type:"radio",className:a?i:d,ref:u,...m}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(F,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(F,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsx(G,{children:s}),!s&&l&&jsx(O,{children:l})]})})});an.displayName="Radio";var _d=an;function aa(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:m,overrideClassName:u=!1,helperText:c,error:d,typeSet:p="field",value:w,onChange:y,...b}=e,v=useId(),E=useMemo(()=>new Map(l.map(I=>[String(I[a]),I])),[l,a]),D=useMemo(()=>w==null?"":String(p==="field"?w:w[a]),[w,p,a]),V=I=>{if(!y)return;let S;if(p==="field"){let k=E.get(I);if(k)S=k[a];else {let N=Number(I);S=Number.isNaN(N)?I:N;}}else S=E.get(I)??void 0;y({target:{name:o,value:S,type:"radiogroup",checked:!0}});},P=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=g("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(f,{children:jsxs("div",{className:g("flex flex-col gap-3",m),children:[r&&jsx(F,{required:n,children:r}),jsx("div",{className:P,children:l.map((I,S)=>{let k=String(I[a]),N=`${v}-${k}-${S}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:N,ref:t,name:o,type:"radio",checked:D===k,onChange:()=>V(k),className:u?m:$}),jsx(F,{htmlFor:N,children:String(I[i])})]},N)})}),d&&jsx(G,{children:String(d)}),!d&&c&&jsx(O,{children:c})]})})}function ia(){let e=forwardRef(aa);return e.displayName="RadioGroup",e}var sa=ia(),au=sa;var la=["loading","error","warning","success","info","helper"],Ye=e=>{if(!e)return null;let t=la.find(r=>e[r]);return t?{type:t,message:e[t]}:null};var cn=forwardRef(({label:e,required:t,className:r,showValue:n=!1,min:o=0,max:i=100,step:a=1,value:l,overrideClassName:s,feedback:m,...u},c)=>{let d=useId(),p=(Number(l)-Number(o))/(Number(i)-Number(o))*100,w=Ye(m),y=g("w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer slider","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[(e||n)&&jsxs("div",{className:"flex justify-between items-center",children:[e&&jsx(F,{htmlFor:d,required:t,children:e}),n&&jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),jsxs("div",{className:"relative",children:[jsx("input",{type:"range",id:d,ref:c,min:o,max:i,step:a,value:l,className:s?r:y,style:{background:`linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${p}%, hsl(var(--secondary)) ${p}%, hsl(var(--secondary)) 100%)`},...u}),w&&jsx(We,{type:w.type,children:w.message})]})]})})});cn.displayName="Range";var bu=cn;var ma=({value:e,defaultValue:t,onChange:r})=>{let[n,o]=useState(t),i=e!==void 0;return [i?e:n??t,s=>{i||o(s),r?.(s);}]},dn=ma;var mn=forwardRef(({min:e=0,max:t=100,step:r=1,value:n,defaultValue:o=[e,t],onChange:i,disabled:a,label:l,showValues:s=!0,className:m="",feedback:u,required:c},d)=>{let p=useId(),w=useRef(null),y=useRef(null),b=Ye(u),[v,E]=dn({value:n,defaultValue:o,onChange:P=>i?.({target:{value:P}})}),D=P=>(P-e)/(t-e)*100,V=useCallback(P=>{if(!w.current||!y.current||a)return;let $=w.current.getBoundingClientRect(),I=Math.min(100,Math.max(0,(P-$.left)/$.width*100)),S=e+I/100*(t-e),k=Math.round(S/r)*r,N=[...v];y.current==="min"?N[0]=Math.min(k,v[1]):N[1]=Math.max(k,v[0]),E(N);},[v,e,t,r,E,a]);return useEffect(()=>{let P=I=>V(I.clientX),$=()=>y.current=null;return document.addEventListener("mousemove",P),document.addEventListener("mouseup",$),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$);}},[V]),jsx(f,{children:jsxs("div",{ref:d,className:`space-y-2 ${m}`,children:[l&&jsxs("div",{className:"flex justify-between",children:[jsx(F,{htmlFor:p,required:c,children:l}),s&&jsxs("span",{className:"text-sm text-muted-foreground",children:[v[0]," \u2013 ",v[1]]})]}),jsxs("div",{ref:w,className:"relative h-2 bg-secondary rounded-full",children:[jsx("div",{className:"absolute h-2 bg-primary rounded-full",style:{left:`${D(v[0])}%`,width:`${D(v[1])-D(v[0])}%`}}),["min","max"].map(P=>jsx("div",{onMouseDown:()=>y.current=P,className:`absolute w-5 h-5 bg-background border-2 border-primary rounded-full\r
44
- top-1/2 -translate-y-1/2 -translate-x-1/2 cursor-pointer`,style:{left:`${D(P==="min"?v[0]:v[1])}%`}},P))]}),b&&jsx(We,{type:b.type,children:b.message})]})})});mn.displayName="RangeSlider";var Lu=mn;function ha({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...m},u){let c=useId(),d=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(F,{htmlFor:c,required:t,children:e}),jsxs("select",{id:c,ref:u,className:d,...m,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((p,w)=>jsx("option",{value:String(p[o]),children:String(p[n])},w))]}),a&&jsx(G,{children:a}),!a&&l&&jsx(O,{children:l})]})})}function ya(){let e=forwardRef(ha);return e.displayName="Select",e}var wa=ya(),Au=wa;var fn=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:m,...u},c)=>{let d=useId();return jsx(f,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:d,name:m,checked:i,className:"peer sr-only",ref:c,...u}),jsx("label",{htmlFor:d,className:g("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsx("span",{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(F,{id:`${d}-label`,htmlFor:d,className:"text-sm font-medium leading-none",children:r}),n&&jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]})})});fn.displayName="Switch";var Yu=fn;var gn=Wn.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},m)=>{let u=useId(),[c,d]=useState(0),p=g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(F,{htmlFor:u,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:u,className:i?o:p,maxLength:n,onInput:w=>d(w.currentTarget.textLength),ref:m,...s}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsx(G,{children:a}),!a&&l&&jsx(O,{children:l})]})})});gn.displayName="TextArea";var tm=gn;var vn=createContext(void 0),sm=()=>{let e=useContext(vn);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},lm=({children:e})=>jsx(f,{children:jsx(Ea,{children:e})}),Ea=({children:e})=>{let[t,r]=useState([]),n=useCallback(a=>{r(l=>l.filter(s=>s.id!==a));},[]),o=useCallback(a=>{let l=crypto.randomUUID(),s={...a,id:l};r(m=>[...m,s]),a.duration!==0&&setTimeout(()=>{n(l);},a.duration??5e3);},[n]),i=useMemo(()=>({toasts:t,addToast:o,removeToast:n}),[t,o,n]);return jsxs(vn.Provider,{value:i,children:[e,jsx(Fa,{toasts:t,onRemove:n})]})},Fa=({toasts:e,onRemove:t})=>jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(r=>jsx(xn,{toast:r,onRemove:t},r.id))}),xn=({toast:e,onRemove:t})=>jsx("div",{className:`min-w-80 max-w-md p-4 border rounded-md shadow-lg animate-in slide-in-from-right-full ${{default:"bg-white border-gray-200 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100",success:"bg-green-50 border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200",warning:"bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900/20 dark:border-yellow-800 dark:text-yellow-200",destructive:"bg-red-50 border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}[e.variant??"default"]}`,children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{className:"flex-1",children:[e.title&&jsx("h4",{className:"font-medium mb-1",children:e.title}),jsx("p",{className:"text-sm",children:e.description})]}),jsx("button",{onClick:()=>t(e.id),className:"ml-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});xn.displayName="ToastItem";var yn=({children:e,content:t,position:r="top",className:n,overrideClassName:o=!1})=>{let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},a={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-gray-900",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-gray-900",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-gray-900",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-gray-900"};return jsx(f,{children:jsxs("div",{className:"relative inline-block group",children:[jsx("div",{children:e}),jsxs("div",{className:o?n:g("absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap","opacity-0 scale-95 pointer-events-none transition-all duration-150","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto",i[r],n),children:[t,jsx("div",{className:g("absolute w-0 h-0 border-4",a[r])})]})]})})};yn.displayName="Tooltip";var pm=yn;var Sa=({files:e,removeFile:t})=>jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxs("div",{children:[jsx("p",{className:"text-sm truncate",children:r.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),wn=Sa;var Va=({accept:e,maxSize:t})=>jsxs("div",{className:"space-y-2",children:[jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxs("div",{children:[jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),Cn=Va;var kn=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=useRef(null),[a,l]=useState(!1),s=useCallback(d=>{d.preventDefault(),!n&&l(!0);},[n]),m=useCallback(()=>{l(!1);},[]),u=useCallback(d=>{if(d.preventDefault(),n||!i.current)return;l(!1);let p=Array.from(d.dataTransfer.files);if(!r&&!e||!r&&p.length>1)return;let w=o(p),y=r?w:w.slice(0,1);t(y);let b=new DataTransfer;y.forEach(v=>b.items.add(v)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:u,handleDragOver:s,handleDragLeave:m}};var Nn=({files:e,setFiles:t,inputRef:r})=>({removeFile:useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Ba=({previews:e,onRemove:t})=>{let[r,n]=useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Tn=Ba;var Rn=forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:m,className:u,name:c,onChange:d,onBlur:p,...w},y)=>{let b=useId(),[v,E]=useState([]),D=1024*1024,V=A=>A.filter(j=>(!a||j.size<=a*D)&&(!r||j.type.match(r))),{inputRef:P,isDragOver:$,handleDrop:I,handleDragOver:S,handleDragLeave:k}=kn({files:v,setFiles:E,multiple:i,filterFiles:V}),{removeFile:N}=Nn({files:v,setFiles:E,inputRef:P}),x=A=>{P.current=A,typeof y=="function"?y(A):y&&(y.current=A);},h=A=>{let j=Array.from(A.target.files??[]);if(!j.length)return;let re=V(j);E(i?re:re.slice(0,1)),d?.(A);},M=useMemo(()=>!o||!v||!v.length?[]:v.filter(A=>A.type.startsWith("image/")).map(A=>({file:A,url:URL.createObjectURL(A)})),[v,o]);useEffect(()=>()=>M.forEach(A=>URL.revokeObjectURL(A.url)),[M]);let H=o&&M.length>0;return jsx(f,{children:jsxs("div",{className:`space-y-2 ${u}`,children:[e&&jsx(F,{htmlFor:b,required:t,children:e}),jsxs("div",{onDrop:I,onDragOver:S,onDragLeave:k,onClick:()=>{!l&&!H&&P.current?.click();},className:`
43
+ a 15.9155 15.9155 0 0 1 0 -31.831`})]}),e!=="xs"&&e!=="sm"&&jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium",children:[m,"%"]})]}):jsx("div",{className:c(),children:jsxs("svg",{className:`${p()} ${d()}`,fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),P=()=>{switch(a){case"top":return "flex-col-reverse";case"left":return "flex-row-reverse";case"right":return "flex-row";default:return "flex-col"}},$=()=>{switch(e){case"xs":case"sm":return "text-xs";case"lg":return "text-base";case"xl":case"xxl":return "text-lg";default:return "text-sm"}},I=jsx(f,{children:jsxs("div",{className:`inline-flex ${i?`items-center ${P()} space-y-1 space-x-0 ${a==="left"||a==="right"?"space-y-0 space-x-2":""}`:""}`,children:[V(),i&&jsx("span",{className:`${$()} text-gray-500 dark:text-gray-400`,children:i})]})});return l?jsx("div",{className:"fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50",children:I}):jsx("div",{className:n,children:I})};Ue.displayName="Spinner";var Vr=Ue,Ir=({text:e="Carregando...",size:t="md",variant:r="default",color:n="primary",className:o="",textPosition:i="right"})=>jsx(f,{children:jsx("div",{className:o,children:jsx(Ue,{size:t,variant:r,color:n,text:e,textPosition:i})})});Ir.displayName="LoadingSpinner";var Jc=Ir,Hr=({isVisible:e,text:t="Carregando...",variant:r="default",size:n="lg",className:o=""})=>e?jsx(f,{children:jsx("div",{className:`fixed inset-0 bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm flex items-center justify-center z-50 ${o}`,children:jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsx(Ue,{size:n,variant:r}),jsx("p",{className:"text-gray-500 dark:text-gray-400",children:t})]})})}):null;Hr.displayName="LoadingOverlay";var jc=Hr,$r=({size:e="sm",color:t="primary"})=>jsx(f,{children:jsx("div",{className:`${(()=>{switch(e){case"xs":return "w-3 h-3";case"md":return "w-5 h-5";default:return "w-4 h-4"}})()} ${t==="white"?"text-white":"text-current"}`,children:jsxs("svg",{className:"animate-spin",fill:"none",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})});$r.displayName="ButtonSpinner";var Zc=$r,Ar=({lines:e=3,className:t=""})=>jsx(f,{children:jsx("div",{className:`space-y-3 ${t}`,children:[...Array(e)].map((r,n)=>jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded animate-pulse",style:{width:n===e-1?"60%":"100%"}},n))})});Ar.displayName="ContentLoader";var Qc=Ar,Br=({width:e="100%",height:t="1rem",circle:r=!1,className:n=""})=>jsx(f,{children:jsx("div",{className:`bg-gray-200 dark:bg-gray-700 animate-pulse ${r?"rounded-full":"rounded"} ${n}`,style:{width:e,height:t}})});Br.displayName="Skeleton";var ed=Br;var Or=({children:e,type:t,className:r,overrideClassName:n=!1})=>{if(e)switch(t){case"loading":return jsxs("p",{className:n?r:g("text-sm text-muted-foreground flex items-center gap-2",r),children:[jsx(Vr,{size:"xs"}),e]});case"error":return jsx("p",{className:n?r:g("text-sm text-red-600 dark:text-red-400",r),children:e});case"warning":return jsx("p",{className:n?r:g("text-sm text-yellow-600 dark:text-yellow-400",r),children:e});case"success":return jsx("p",{className:n?r:g("text-sm text-green-600 dark:text-green-400",r),children:e});case"info":return jsx("p",{className:n?r:g("text-sm text-blue-600 dark:text-blue-400",r),children:e});case"helper":return jsx("p",{className:n?r:g("text-sm text-muted-foreground",r),children:e});default:return null}};Or.displayName="FieldFeedback";var We=Or;var Uo=({children:e,before:t,after:r,className:n})=>{let i=zo("flex justify-center items-center",{"rounded-l-lg":t,"rounded-r-lg":r},n);return jsx("div",{className:i,children:jsx("span",{children:e})})},ut=Uo;var Wo=({children:e})=>jsx("div",{className:"absolute px-2",children:jsx("span",{children:e})}),Ur=Wo;var qo=({children:e})=>jsx("div",{className:"absolute right-0 px-2",children:jsx("span",{children:e})}),qr=qo;function Yr(e){e.currentTarget.maxLength=9;let t=e.currentTarget.value;return t=t.replace(/\D/g,""),t=t.replace(/^(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Kr(e){let t=e.currentTarget.value;t=t.replace(/\D/g,""),t=t.padStart(3,"0");let r=t.slice(0,-2),n=t.slice(-2),a=`${(r.replace(/^0+/,"")||"0").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},${n}`;return e.currentTarget.value=a,e}function _r(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value;return t.match(/^(\d{3}).(\d{3}).(\d{3})-(\d{2})$/)||(t=t.replace(/\D/g,""),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2"),e.currentTarget.value=t),e}function Xr(e){e.currentTarget.maxLength=15;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{5})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function Jr(e){e.currentTarget.maxLength=14;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"($1) $2"),t=t.replace(/(\d{4})(\d)/,"$1-$2"),e.currentTarget.value=t,e}function jr(e){let t=e.currentTarget.value.replace(/\D/g,"");return t.length<=11?(e.currentTarget.maxLength=14,t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{2})$/,"$1-$2")):(e.currentTarget.maxLength=18,t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2")),e.currentTarget.value=t,e}function Zr(e){e.currentTarget.maxLength=12;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d{1})$/,"$1-$2"),e.currentTarget.value=t,e}function Qr(e){e.currentTarget.maxLength=18;let t=e.currentTarget.value.replace(/\D/g,"");return t=t.replace(/(\d{2})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1.$2"),t=t.replace(/(\d{3})(\d)/,"$1/$2"),t=t.replace(/(\d{4})(\d{2})$/,"$1-$2"),e.currentTarget.value=t,e}var Yo=({e,mask:t})=>{switch(t){case"money":return Kr(e);case"mobile":return Xr(e);case"phone":return Jr(e);case"cpfCnpj":return jr(e);case"cpf":return _r(e);case"rg":return Zr(e);case"cnpj":return Qr(e);case"cep":return Yr(e);default:return e}},en=Yo;var Xo=({mask:e,initialValue:t=""})=>{let[r,n]=useState(t);useEffect(()=>{t!==r&&n(t);},[t]);let o=useCallback(a=>{let s=en({e:a,mask:e})?.currentTarget?.value??a.currentTarget.value;n(s);},[e]),i=useCallback(()=>n(""),[]);return {value:r,setValue:n,handleChange:o,handleClear:i}},rn=Xo;var nn=forwardRef(({label:e,required:t=!1,mask:r,name:n,prefix:o,suffix:i,addonBefore:a,addonBeforeClassName:l,addonAfter:s,addonAfterClassName:m,ClearEnabled:u=!0,className:c,overrideClassName:d=!1,error:p,helperText:w,value:y=void 0,onChange:b,...v},E)=>{let D=useId(),{handleChange:V,handleClear:P,setValue:$}=rn({mask:r,initialValue:y}),I=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",p&&"border-destructive focus-visible:ring-destructive",!o&&!i&&"px-3",o&&!i&&"pl-10 pr-3",i&&!o&&"pl-3 pr-10",o&&i&&"pl-10 pr-10",a&&"rounded-l-none border-l-0",s&&"rounded-r-none border-r-0",c),S=N=>{V(N),b?.(N);},k=()=>{P(),$(""),b?.({target:{name:n||"",value:""}});};return jsx(f,{children:jsxs("div",{className:"flex flex-col w-full gap-2",children:[e&&jsx(F,{htmlFor:D,required:t,children:e}),jsxs("div",{className:"relative flex",children:[a&&jsx(ut,{before:!0,className:l,children:a}),jsxs("div",{className:"relative flex items-center w-full",children:[o&&jsx(Ur,{children:o}),jsx("input",{id:D,ref:E,name:n,onChange:S,className:d?c:I,...v}),u&&y&&jsx(Ge,{onClick:k,width:12,height:12,className:g("absolute right-2 cursor-pointer",i&&"right-8")}),i&&jsx(qr,{children:i})]}),s&&jsx(ut,{after:!0,className:m,children:s})]}),p&&jsx(G,{children:p}),!p&&w&&jsx(O,{children:w})]})})});nn.displayName="Input";var Ed=nn;var an=forwardRef(({length:e=6,groupBy:t,value:r,name:n,label:o,required:i=!1,helperText:a,error:l,onChange:s,onBlur:m,className:u,charType:c="numeric",customPattern:d,caseMode:p="none",...w},y)=>{let b=useId(),v=useRef([]),E=x=>{switch(p){case"upper":return x.toUpperCase();case"lower":case"visual-upper":return x.toLowerCase();case"visual-lower":return x.toUpperCase();default:return x}},D=x=>{if(!x)return "";let h=x.slice(0,1);switch(h=E(h),c){case"numeric":return /\d/.test(h)?h:"";case"alpha":return /[A-Za-z]/.test(h)?h:"";case"alphanumeric":return /[A-Za-z0-9]/.test(h)?h:"";case"custom":return d?.test(h)?h:"";default:return h}},V=()=>(r!=null?String(r):"").split("").map(D).slice(0,e),P=V().concat(Array(e).fill(" ")).slice(0,e),$=x=>{let h=x.split("").map(D).join("").slice(0,e),M=h===""?void 0:typeof r=="number"?Number(h):h;s?.({target:{name:n,value:M}});},I=(x,h)=>{let M=D(h),H=V();if(M===""){H[x]="",$(H.join(""));return}if(h.length>1){let A=h.split("").map(D).join("").slice(0,e);$(A),v.current[Math.min(A.length-1,e-1)]?.focus();return}M&&(H[x]=M,$(H.join("")),x<e-1&&v.current[x+1]?.focus());},S=x=>{let h=V();!h[x]&&x>0?h[x-1]="":h[x]="",$(h.join("")),x>0&&v.current[x-1]?.focus();},k=x=>{x.preventDefault();let M=x.clipboardData.getData("text").split("").map(D).join("").slice(0,e);M&&($(M),v.current[Math.min(M.length-1,e-1)]?.focus());},N=x=>{switch(p){case"upper":case"visual-upper":return x.toUpperCase();case"lower":case"visual-lower":return x.toLowerCase();default:return x}};return jsx(f,{children:jsxs("div",{className:"flex flex-col gap-2 w-full",children:[o&&jsx(F,{htmlFor:b,required:i,children:o}),jsx("div",{className:g("flex gap-3 items-center",l&&"text-red-500",u),...w,children:P.map((x,h)=>{let M=t&&h>0&&h%t===0;return jsxs(qn.Fragment,{children:[M&&jsx("span",{className:"flex items-center justify-center text-xl font-bold select-none",children:"-"}),jsx("input",{id:b,type:"text",maxLength:1,inputMode:c==="numeric"?"numeric":"text",value:N(x).trim(),ref:H=>{v.current[h]=H,h===0&&y&&(typeof y=="function"?y(H):typeof y=="object"&&(y.current=H));},onPaste:k,onChange:H=>I(h,H.target.value),onKeyDown:H=>H.key==="Backspace"&&S(h),onBlur:m,className:g("h-14 w-12 text-center text-2xl rounded-md border border-input bg-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l&&"border-red-500")})]},h)})}),l&&jsx(G,{children:l}),!l&&a&&jsx(O,{children:a})]})})});an.displayName="OtpInput";var Od=an;var sn=forwardRef(({label:e,required:t,option:r,description:n,icon:o,className:i,overrideClassName:a,helperText:l,error:s,...m},u)=>{let c=useId(),d=g("h-4 w-4 border border-input bg-background text-primary focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s&&"border-destructive",i);return jsx(f,{children:jsxs("div",{className:"space-y-3",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{id:c,type:"radio",className:a?i:d,ref:u,...m}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{children:o&&o}),jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[r&&jsx(F,{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",overrideClassName:!0,children:r}),n&&jsx(F,{id:`${c}-description`,htmlFor:c,className:"text-xs text-muted-foreground",children:n})]})]})]}),s&&jsx(G,{children:s}),!s&&l&&jsx(O,{children:l})]})})});sn.displayName="Radio";var Xd=sn;function ia(e,t){let{label:r,required:n,name:o,labelKey:i,valueKey:a,options:l,alignment:s="vertical",className:m,overrideClassName:u=!1,helperText:c,error:d,typeSet:p="field",value:w,onChange:y,...b}=e,v=useId(),E=useMemo(()=>new Map(l.map(I=>[String(I[a]),I])),[l,a]),D=useMemo(()=>w==null?"":String(p==="field"?w:w[a]),[w,p,a]),V=I=>{if(!y)return;let S;if(p==="field"){let k=E.get(I);if(k)S=k[a];else {let N=Number(I);S=Number.isNaN(N)?I:N;}}else S=E.get(I)??void 0;y({target:{name:o,value:S,type:"radiogroup",checked:!0}});},P=s==="horizontal"?"flex flex-wrap items-center gap-3":"flex flex-col gap-3",$=g("h-4 w-4 rounded-full border border-input bg-background text-primary","focus:ring-2 focus:ring-ring focus:ring-offset-2",d&&"border-destructive");return jsx(f,{children:jsxs("div",{className:g("flex flex-col gap-3",m),children:[r&&jsx(F,{required:n,children:r}),jsx("div",{className:P,children:l.map((I,S)=>{let k=String(I[a]),N=`${v}-${k}-${S}`;return jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{...b,id:N,ref:t,name:o,type:"radio",checked:D===k,onChange:()=>V(k),className:u?m:$}),jsx(F,{htmlFor:N,children:String(I[i])})]},N)})}),d&&jsx(G,{children:String(d)}),!d&&c&&jsx(O,{children:c})]})})}function sa(){let e=forwardRef(ia);return e.displayName="RadioGroup",e}var la=sa(),iu=la;var ca=["loading","error","warning","success","info","helper"],Ye=e=>{if(!e)return null;let t=ca.find(r=>e[r]);return t?{type:t,message:e[t]}:null};var dn=forwardRef(({label:e,required:t,className:r,showValue:n=!1,min:o=0,max:i=100,step:a=1,value:l,overrideClassName:s,feedback:m,...u},c)=>{let d=useId(),p=(Number(l)-Number(o))/(Number(i)-Number(o))*100,w=Ye(m),y=g("w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer slider","focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",r);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[(e||n)&&jsxs("div",{className:"flex justify-between items-center",children:[e&&jsx(F,{htmlFor:d,required:t,children:e}),n&&jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),jsxs("div",{className:"relative",children:[jsx("input",{type:"range",id:d,ref:c,min:o,max:i,step:a,value:l,className:s?r:y,style:{background:`linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${p}%, hsl(var(--secondary)) ${p}%, hsl(var(--secondary)) 100%)`},...u}),w&&jsx(We,{type:w.type,children:w.message})]})]})})});dn.displayName="Range";var vu=dn;var pa=({value:e,defaultValue:t,onChange:r})=>{let[n,o]=useState(t),i=e!==void 0;return [i?e:n??t,s=>{i||o(s),r?.(s);}]},un=pa;var pn=forwardRef(({min:e=0,max:t=100,step:r=1,value:n,defaultValue:o=[e,t],onChange:i,disabled:a,label:l,showValues:s=!0,className:m="",feedback:u,required:c},d)=>{let p=useId(),w=useRef(null),y=useRef(null),b=Ye(u),[v,E]=un({value:n,defaultValue:o,onChange:P=>i?.({target:{value:P}})}),D=P=>(P-e)/(t-e)*100,V=useCallback(P=>{if(!w.current||!y.current||a)return;let $=w.current.getBoundingClientRect(),I=Math.min(100,Math.max(0,(P-$.left)/$.width*100)),S=e+I/100*(t-e),k=Math.round(S/r)*r,N=[...v];y.current==="min"?N[0]=Math.min(k,v[1]):N[1]=Math.max(k,v[0]),E(N);},[v,e,t,r,E,a]);return useEffect(()=>{let P=I=>V(I.clientX),$=()=>y.current=null;return document.addEventListener("mousemove",P),document.addEventListener("mouseup",$),()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",$);}},[V]),jsx(f,{children:jsxs("div",{ref:d,className:`space-y-2 ${m}`,children:[l&&jsxs("div",{className:"flex justify-between",children:[jsx(F,{htmlFor:p,required:c,children:l}),s&&jsxs("span",{className:"text-sm text-muted-foreground",children:[v[0]," \u2013 ",v[1]]})]}),jsxs("div",{ref:w,className:"relative h-2 bg-secondary rounded-full",children:[jsx("div",{className:"absolute h-2 bg-primary rounded-full",style:{left:`${D(v[0])}%`,width:`${D(v[1])-D(v[0])}%`}}),["min","max"].map(P=>jsx("div",{onMouseDown:()=>y.current=P,className:`absolute w-5 h-5 bg-background border-2 border-primary rounded-full\r
44
+ top-1/2 -translate-y-1/2 -translate-x-1/2 cursor-pointer`,style:{left:`${D(P==="min"?v[0]:v[1])}%`}},P))]}),b&&jsx(We,{type:b.type,children:b.message})]})})});pn.displayName="RangeSlider";var Ru=pn;function ya({label:e,required:t=!1,options:r,labelKey:n,valueKey:o,placeholder:i,error:a,helperText:l,className:s,...m},u){let c=useId(),d=g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",s);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(F,{htmlFor:c,required:t,children:e}),jsxs("select",{id:c,ref:u,className:d,...m,children:[i&&jsx("option",{value:"",disabled:!0,children:i}),r.map((p,w)=>jsx("option",{value:String(p[o]),children:String(p[n])},w))]}),a&&jsx(G,{children:a}),!a&&l&&jsx(O,{children:l})]})})}function wa(){let e=forwardRef(ya);return e.displayName="Select",e}var Ca=wa(),Bu=Ca;var gn=forwardRef(({label:e,required:t,option:r,description:n,icon:o,checked:i=!1,className:a,overrideClassName:l,error:s,name:m,...u},c)=>{let d=useId();return jsx(f,{children:jsxs("div",{className:"flex flex-col gap-2",children:[e&&jsx(F,{required:t,children:e}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:d,name:m,checked:i,className:"peer sr-only",ref:c,...u}),jsx("label",{htmlFor:d,className:g("relative flex items-center h-6 w-11 cursor-pointer rounded-full bg-input transition-colors duration-200","peer-checked:bg-primary peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background","disabled:cursor-not-allowed disabled:opacity-50",a),children:jsx("span",{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",i?"translate-x-5":"translate-x-1")})}),jsx("span",{children:o&&o}),(r||n)&&jsxs("div",{className:"grid gap-1.5 leading-none select-none",children:[e&&jsx(F,{id:`${d}-label`,htmlFor:d,className:"text-sm font-medium leading-none",children:r}),n&&jsx(F,{id:`${d}-description`,htmlFor:d,className:"text-xs text-muted-foreground",children:n})]})]})]})})});gn.displayName="Switch";var Ku=gn;var bn=qn.forwardRef(({label:e,required:t,showCount:r,maxLength:n,className:o,overrideClassName:i=!1,error:a,helperText:l,...s},m)=>{let u=useId(),[c,d]=useState(0),p=g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a&&"border-red-500 focus-visible:ring-red-500",o);return jsx(f,{children:jsxs("div",{className:"space-y-2",children:[e&&jsx(F,{htmlFor:u,required:t,children:e}),jsxs("div",{className:"relative",children:[jsx("textarea",{id:u,className:i?o:p,maxLength:n,onInput:w=>d(w.currentTarget.textLength),ref:m,...s}),r&&jsxs("span",{className:"absolute bottom-2 right-3 text-xs text-muted-foreground",children:[c,n?` / ${n}`:""]})]}),a&&jsx(G,{children:a}),!a&&l&&jsx(O,{children:l})]})})});bn.displayName="TextArea";var rm=bn;var xn=createContext(void 0),lm=()=>{let e=useContext(xn);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},cm=({children:e})=>jsx(f,{children:jsx(Fa,{children:e})}),Fa=({children:e})=>{let[t,r]=useState([]),n=useCallback(a=>{r(l=>l.filter(s=>s.id!==a));},[]),o=useCallback(a=>{let l=crypto.randomUUID(),s={...a,id:l};r(m=>[...m,s]),a.duration!==0&&setTimeout(()=>{n(l);},a.duration??5e3);},[n]),i=useMemo(()=>({toasts:t,addToast:o,removeToast:n}),[t,o,n]);return jsxs(xn.Provider,{value:i,children:[e,jsx(Sa,{toasts:t,onRemove:n})]})},Sa=({toasts:e,onRemove:t})=>jsx("div",{className:"fixed top-4 right-4 z-50 flex flex-col gap-2",children:e.map(r=>jsx(hn,{toast:r,onRemove:t},r.id))}),hn=({toast:e,onRemove:t})=>jsx("div",{className:`min-w-80 max-w-md p-4 border rounded-md shadow-lg animate-in slide-in-from-right-full ${{default:"bg-white border-gray-200 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100",success:"bg-green-50 border-green-200 text-green-800 dark:bg-green-900/20 dark:border-green-800 dark:text-green-200",warning:"bg-yellow-50 border-yellow-200 text-yellow-800 dark:bg-yellow-900/20 dark:border-yellow-800 dark:text-yellow-200",destructive:"bg-red-50 border-red-200 text-red-800 dark:bg-red-900/20 dark:border-red-800 dark:text-red-200"}[e.variant??"default"]}`,children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{className:"flex-1",children:[e.title&&jsx("h4",{className:"font-medium mb-1",children:e.title}),jsx("p",{className:"text-sm",children:e.description})]}),jsx("button",{onClick:()=>t(e.id),className:"ml-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});hn.displayName="ToastItem";var wn=({children:e,content:t,position:r="top",className:n,overrideClassName:o=!1})=>{let i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},a={top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent border-t-gray-900",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent border-b-gray-900",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-gray-900",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-gray-900"};return jsx(f,{children:jsxs("div",{className:"relative inline-block group",children:[jsx("div",{children:e}),jsxs("div",{className:o?n:g("absolute z-50 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg whitespace-nowrap","opacity-0 scale-95 pointer-events-none transition-all duration-150","group-hover:opacity-100 group-hover:scale-100 group-hover:pointer-events-auto","group-focus-within:opacity-100 group-focus-within:scale-100 group-focus-within:pointer-events-auto",i[r],n),children:[t,jsx("div",{className:g("absolute w-0 h-0 border-4",a[r])})]})]})})};wn.displayName="Tooltip";var fm=wn;var Va=({files:e,removeFile:t})=>jsx("div",{className:"space-y-2",children:e?.length>0&&e?.map((r,n)=>jsxs("div",{className:"flex items-center justify-between p-2 bg-secondary rounded",children:[jsxs("div",{children:[jsx("p",{className:"text-sm truncate",children:r.name}),jsxs("p",{className:"text-xs text-muted-foreground",children:[(r?.size/1024).toFixed(1)," KB"]})]}),jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t(n);},className:"ml-2 p-1 hover:bg-destructive/20 rounded",children:"\u2715"})]},`${r?.name}-${n}`))}),Cn=Va;var Ia=({accept:e,maxSize:t})=>jsxs("div",{className:"space-y-2",children:[jsx("svg",{className:"w-8 h-8 mx-auto text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),jsxs("div",{children:[jsx("p",{className:"text-sm text-foreground",children:"Clique para selecionar ou arraste arquivos aqui"}),jsxs("p",{className:"text-xs text-muted-foreground",children:[e&&`Tipos aceitos: ${e}`,t&&` \u2022 Tamanho m\xE1ximo: ${t}MB`]})]})]}),kn=Ia;var Nn=({files:e,setFiles:t,multiple:r=!1,disabled:n=!1,filterFiles:o=i=>i})=>{let i=useRef(null),[a,l]=useState(!1),s=useCallback(d=>{d.preventDefault(),!n&&l(!0);},[n]),m=useCallback(()=>{l(!1);},[]),u=useCallback(d=>{if(d.preventDefault(),n||!i.current)return;l(!1);let p=Array.from(d.dataTransfer.files);if(!r&&!e||!r&&p.length>1)return;let w=o(p),y=r?w:w.slice(0,1);t(y);let b=new DataTransfer;y.forEach(v=>b.items.add(v)),i.current.files=b.files,i.current.dispatchEvent(new Event("change",{bubbles:!0}));},[n,r,e,o]),c=useCallback(()=>{t([]),i.current&&(i.current.value="");},[]);return {files:e,setFiles:t,clearFiles:c,inputRef:i,isDragOver:a,setIsDragOver:l,handleDrop:u,handleDragOver:s,handleDragLeave:m}};var Pn=({files:e,setFiles:t,inputRef:r})=>({removeFile:useCallback(o=>{if(!r.current)return;let i=e?.filter((l,s)=>s!==o);t(i);let a=new DataTransfer;i?.forEach(l=>a.items.add(l)),r.current.files=a.files,r.current.dispatchEvent(new Event("change",{bubbles:!0}));},[e,t,r])});var Oa=({previews:e,onRemove:t})=>{let[r,n]=useState(0),o=()=>n(a=>a===0?e?.length-1:a-1),i=()=>n(a=>a===e?.length-1?0:a+1);return jsxs("div",{className:"relative w-full h-56 rounded-lg overflow-hidden bg-black/5",children:[jsx("img",{src:e[r]?.url,alt:e[r]?.file?.name,className:"w-full h-full object-cover"}),e.length>1&&jsxs(Fragment,{children:[jsx("button",{type:"button",onClick:o,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u2039"}),jsx("button",{type:"button",onClick:i,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white px-2 py-1 rounded",children:"\u203A"})]}),jsx("button",{type:"button",onClick:()=>t(r),className:"absolute top-2 right-2 bg-red-500 text-white rounded px-2 py-1",children:"\u2715"})]})},Ln=Oa;var Dn=forwardRef(({label:e,required:t,accept:r,renderFiles:n,preview:o=!1,multiple:i=!1,maxSize:a=10,disabled:l=!1,error:s=!1,helperText:m,className:u,name:c,onChange:d,onBlur:p,...w},y)=>{let b=useId(),[v,E]=useState([]),D=1024*1024,V=A=>A.filter(j=>(!a||j.size<=a*D)&&(!r||j.type.match(r))),{inputRef:P,isDragOver:$,handleDrop:I,handleDragOver:S,handleDragLeave:k}=Nn({files:v,setFiles:E,multiple:i,filterFiles:V}),{removeFile:N}=Pn({files:v,setFiles:E,inputRef:P}),x=A=>{P.current=A,typeof y=="function"?y(A):y&&(y.current=A);},h=A=>{let j=Array.from(A.target.files??[]);if(!j.length)return;let re=V(j);E(i?re:re.slice(0,1)),d?.(A);},M=useMemo(()=>!o||!v||!v.length?[]:v.filter(A=>A.type.startsWith("image/")).map(A=>({file:A,url:URL.createObjectURL(A)})),[v,o]);useEffect(()=>()=>M.forEach(A=>URL.revokeObjectURL(A.url)),[M]);let H=o&&M.length>0;return jsx(f,{children:jsxs("div",{className:`space-y-2 ${u}`,children:[e&&jsx(F,{htmlFor:b,required:t,children:e}),jsxs("div",{onDrop:I,onDragOver:S,onDragLeave:k,onClick:()=>{!l&&!H&&P.current?.click();},className:`
45
45
  border-2 border-dashed rounded-lg p-6 text-center cursor-pointer
46
46
  transition-colors
47
47
  ${$?"border-primary bg-primary/5":"border-border"}
48
48
  ${s?"border-red-500":""}
49
49
  ${l?"opacity-50 cursor-not-allowed":"hover:border-primary"}
50
- `,children:[jsx("input",{ref:x,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:h,onBlur:p,className:"hidden",...w}),o&&M.length>0?jsx(Tn,{previews:M,onRemove:N}):jsx(Cn,{accept:r,maxSize:a})]}),n?n({files:v,removeFile:N}):v&&v.length>0&&jsx(wn,{files:v,removeFile:N}),s&&jsx(G,{children:s}),!s&&m&&jsx(O,{children:m})]})})});Rn.displayName="UploadFile";var Bm=Rn;
50
+ `,children:[jsx("input",{ref:x,id:b,name:c,type:"file",accept:r,multiple:i,disabled:l,onChange:h,onBlur:p,className:"hidden",...w}),o&&M.length>0?jsx(Ln,{previews:M,onRemove:N}):jsx(kn,{accept:r,maxSize:a})]}),n?n({files:v,removeFile:N}):v&&v.length>0&&jsx(Cn,{files:v,removeFile:N}),s&&jsx(G,{children:s}),!s&&m&&jsx(O,{children:m})]})})});Dn.displayName="UploadFile";var Om=Dn;
51
51
 
52
- export { mi as AccordionPrimitive, Ni as AlertDescriptionPrimitive, Ci as AlertPrimitive, ki as AlertTitlePrimitive, Ms as Avatar, Ei as BadgePrimitive, Hi as BreadcrumbPrimitive, zi as ButtonPrimitive, jc as ButtonSpinnerPrimitive, Qi as CardContentPrimitive, Zi as CardDescriptionPrimitive, es as CardFooterPrimitive, Ji as CardHeaderPrimitive, Xi as CardPrimitive, ji as CardTitlePrimitive, ll as CheckBoxGroupPrimitive, js as CheckBoxPrimitive, mr as ColorPicker, bl as ColorPickerPrimitive, ql as ComboBoxPrimitive, Zc as ContentLoaderPrimitive, Wc as DatePickerPrimitive, ds as DialogContentPrimitive, us as DialogFooterPrimitive, ls as DialogHeaderPrimitive, ss as DialogPrimitive, cs as DialogTitlePrimitive, ys as DropdownMenuContentPrimitive, ws as DropdownMenuItemPrimitive, ks as DropdownMenuLabelPrimitive, xs as DropdownMenuPrimitive, Cs as DropdownMenuSeparatorPrimitive, hs as DropdownMenuTriggerPrimitive, We as FieldFeedbackPrimitive, O as HelperFieldPrimitive, Md as InputPrimitive, F as LabelPrimitive, Sn as LicenseProvider, Jc as LoadingOverlayPrimitive, Xc as LoadingSpinnerPrimitive, Bd as OtpInputPrimitive, au as RadioGroupPrimitive, _d as RadioPrimitive, bu as RangePrimitive, Lu as RangeSliderPrimitive, Au as SelectPrimitive, Qc as SkeletonPrimitive, Sr as SpinnerPrimitive, Yu as SwitchPrimitive, tm as TextAreaPrimitive, lm as ToastProvider, pm as TooltipPrimitive, Bm as UploadFilePrimitive, G as ValidateFieldPrimitive, sm as useToast };
52
+ export { pi as AccordionPrimitive, Pi as AlertDescriptionPrimitive, ki as AlertPrimitive, Ni as AlertTitlePrimitive, Es as AvatarPrimitive, Fi as BadgePrimitive, $i as BreadcrumbPrimitive, Ui as ButtonPrimitive, Zc as ButtonSpinnerPrimitive, es as CardContentPrimitive, Qi as CardDescriptionPrimitive, ts as CardFooterPrimitive, ji as CardHeaderPrimitive, Ji as CardPrimitive, Zi as CardTitlePrimitive, cl as CheckBoxGroupPrimitive, Zs as CheckBoxPrimitive, pr as ColorPicker, vl as ColorPickerPrimitive, Yl as ComboBoxPrimitive, Qc as ContentLoaderPrimitive, qc as DatePickerPrimitive, us as DialogContentPrimitive, ms as DialogFooterPrimitive, cs as DialogHeaderPrimitive, ls as DialogPrimitive, ds as DialogTitlePrimitive, ws as DropdownMenuContentPrimitive, Cs as DropdownMenuItemPrimitive, Ns as DropdownMenuLabelPrimitive, hs as DropdownMenuPrimitive, ks as DropdownMenuSeparatorPrimitive, ys as DropdownMenuTriggerPrimitive, We as FieldFeedbackPrimitive, O as HelperFieldPrimitive, Ed as InputPrimitive, F as LabelPrimitive, Vn as LicenseProvider, jc as LoadingOverlayPrimitive, Jc as LoadingSpinnerPrimitive, Od as OtpInputPrimitive, iu as RadioGroupPrimitive, Xd as RadioPrimitive, vu as RangePrimitive, Ru as RangeSliderPrimitive, Bu as SelectPrimitive, ed as SkeletonPrimitive, Vr as SpinnerPrimitive, Ku as SwitchPrimitive, rm as TextAreaPrimitive, cm as ToastProvider, fm as TooltipPrimitive, Om as UploadFilePrimitive, G as ValidateFieldPrimitive, lm as useToast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvr-ui/components",
3
- "version": "1.0.105",
3
+ "version": "1.0.106",
4
4
  "sideEffects": false,
5
5
  "main": "dist/page.cjs",
6
6
  "module": "dist/page.js",