@iclips/ui 1.2.21 → 1.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Z4=require("@radix-ui/react-accordion"),k=require("lucide-react"),q4=require("clsx"),K4=require("tailwind-merge"),M=require("react"),kn=require("@radix-ui/react-slot"),$t=require("class-variance-authority"),X4=require("@radix-ui/react-select"),ex=require("@radix-ui/react-popover"),tx=require("@radix-ui/react-checkbox"),nx=require("@radix-ui/react-label"),H=require("date-fns"),rx=require("react-day-picker"),ax=require("@radix-ui/react-alert-dialog"),ix=require("@radix-ui/react-scroll-area"),sx=require("@radix-ui/react-dropdown-menu"),ox=require("@radix-ui/react-avatar"),lx=require("@radix-ui/react-aspect-ratio"),fx=require("embla-carousel-react"),cx=require("recharts"),dx=require("@radix-ui/react-collapsible"),ux=require("react-colorful"),Dr=require("cmdk"),hx=require("@radix-ui/react-dialog"),px=require("@radix-ui/react-tooltip"),mx=require("@radix-ui/react-separator"),c0=require("react-dom"),d0=require("use-sync-external-store/shim/index.js"),gx=require("use-sync-external-store/shim/with-selector.js"),bx=require("@radix-ui/react-context-menu"),xx=require("@radix-ui/react-toggle"),Kn=require("vaul"),yx=require("@radix-ui/react-tabs"),Vs=require("react-hook-form"),vx=require("@radix-ui/react-hover-card"),u0=require("input-otp"),wx=require("@radix-ui/react-progress"),Mx=require("@radix-ui/react-menubar"),jx=require("@radix-ui/react-navigation-menu"),Cx=require("@radix-ui/react-radio-group"),Lx=require("react-resizable-panels"),Nx=require("@radix-ui/react-slider"),kx=require("@radix-ui/react-switch"),Sx=require("next-themes"),h0=require("sonner"),Tx=require("@radix-ui/react-toggle-group");function ge(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const pi=ge(Z4),I=ge(M),ot=ge(X4),Wn=ge(ex),mu=ge(tx),Ix=ge(nx),dn=ge(ax),Za=ge(ix),Ge=ge(sx),Ca=ge(ox),Dx=ge(lx),Cc=ge(cx),Lc=ge(dx),Ae=ge(hx),aa=ge(px),Ex=ge(mx),Ye=ge(bx),Ax=ge(xx),Yo=ge(yx),Gs=ge(vx),gu=ge(wx),Qe=ge(Mx),Er=ge(jx),Nf=ge(Cx),Nc=ge(Lx),hs=ge(Nx),bu=ge(kx),p0=ge(Tx);function w(...t){return K4.twMerge(q4.clsx(t))}function zx({...t}){return l.jsx(pi.Root,{"data-slot":"accordion",...t})}function Ox({className:t,...e}){return l.jsx(pi.Item,{"data-slot":"accordion-item",className:w("border-b last:border-b-0",t),...e})}function Px({className:t,children:e,...n}){return l.jsx(pi.Header,{className:"flex",children:l.jsxs(pi.Trigger,{"data-slot":"accordion-trigger",className:w("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-semibold transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,l.jsx(k.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Rx({className:t,children:e,...n}){return l.jsx(pi.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:l.jsx("div",{className:w("pt-0 pb-4",t),children:e})})}function jr({className:t,...e}){return l.jsx("div",{"data-slot":"card",className:w("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",t),...e})}function la({className:t,...e}){return l.jsx("div",{"data-slot":"card-header",className:w("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...e})}function fa({className:t,...e}){return l.jsx("h4",{"data-slot":"card-title",className:w("font-semibold leading-[1.2]",t),...e})}function m0({className:t,...e}){return l.jsx("p",{"data-slot":"card-description",className:w("text-muted-foreground leading-relaxed",t),...e})}function Bx({className:t,...e}){return l.jsx("div",{"data-slot":"card-action",className:w("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...e})}function ca({className:t,...e}){return l.jsx("div",{"data-slot":"card-content",className:w("px-6 [&:last-child]:pb-6",t),...e})}function g0({className:t,...e}){return l.jsx("div",{"data-slot":"card-footer",className:w("flex items-center px-6 pb-6 [.border-t]:pt-6",t),...e})}const kc=I.forwardRef(({className:t,...e},n)=>l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:l.jsx("table",{ref:n,"data-slot":"table",className:w("w-full caption-bottom text-sm",t),...e})}));kc.displayName="Table";const Sc=I.forwardRef(({className:t,...e},n)=>l.jsx("thead",{ref:n,"data-slot":"table-header",className:w("[&_tr]:border-b",t),...e}));Sc.displayName="TableHeader";const Tc=I.forwardRef(({className:t,...e},n)=>l.jsx("tbody",{ref:n,"data-slot":"table-body",className:w("[&_tr:last-child]:border-0",t),...e}));Tc.displayName="TableBody";const b0=I.forwardRef(({className:t,...e},n)=>l.jsx("tfoot",{ref:n,"data-slot":"table-footer",className:w("bg-muted/50 border-t font-semibold [&>tr]:last:border-b-0",t),...e}));b0.displayName="TableFooter";const na=I.forwardRef(({className:t,...e},n)=>l.jsx("tr",{ref:n,"data-slot":"table-row",className:w("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e}));na.displayName="TableRow";const Ic=I.forwardRef(({className:t,...e},n)=>l.jsx("th",{ref:n,"data-slot":"table-head",className:w("text-foreground h-10 px-2 text-left align-middle font-semibold","[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Ic.displayName="TableHead";const qa=I.forwardRef(({className:t,...e},n)=>l.jsx("td",{ref:n,"data-slot":"table-cell",className:w("p-2 align-middle","[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));qa.displayName="TableCell";const x0=I.forwardRef(({className:t,...e},n)=>l.jsx("caption",{ref:n,"data-slot":"table-caption",className:w("text-muted-foreground mt-4 text-sm leading-relaxed",t),...e}));x0.displayName="TableCaption";const Jn=$t.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive active:scale-[0.97]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-white hover:bg-destructive/90 active:bg-destructive/80 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground active:bg-accent/70 dark:bg-input/30 dark:border-input dark:hover:bg-input/50 dark:active:bg-input/70",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/70 dark:hover:bg-accent/50 dark:active:bg-accent/40",link:"text-primary underline-offset-4 hover:underline active:opacity-70",success:"bg-green-600 text-white hover:bg-green-700 active:bg-green-800 focus-visible:ring-green-600/20 dark:bg-green-700 dark:hover:bg-green-600 dark:active:bg-green-500"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),F=I.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,isLoading:a=!1,children:i,disabled:s,...o},f)=>{const c=r?kn.Slot:"button";return l.jsx(c,{"data-slot":"button",className:w(Jn({variant:e,size:n,className:t})),ref:f,disabled:s||a,"aria-busy":a||void 0,...o,children:r?i:l.jsxs(l.Fragment,{children:[a&&l.jsx(k.Loader2,{className:"animate-spin","aria-hidden":"true"}),i]})})});F.displayName="Button";function en({...t}){return l.jsx(ot.Root,{"data-slot":"select",...t})}function Hx({...t}){return l.jsx(ot.Group,{"data-slot":"select-group",...t})}function tn({...t}){return l.jsx(ot.Value,{"data-slot":"select-value",...t})}function nn({className:t,size:e="default",children:n,...r}){return l.jsxs(ot.Trigger,{"data-slot":"select-trigger","data-size":e,className:w("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[n,l.jsx(ot.Icon,{asChild:!0,children:l.jsx(k.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function rn({className:t,children:e,position:n="popper",...r}){return l.jsx(ot.Portal,{children:l.jsxs(ot.Content,{"data-slot":"select-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[l.jsx(_x,{}),l.jsx(ot.Viewport,{className:w("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),l.jsx(Jx,{})]})})}function Fx({className:t,...e}){return l.jsx(ot.Label,{"data-slot":"select-label",className:w("text-muted-foreground px-2 py-1.5 text-xs font-semibold",t),...e})}function Dt({className:t,children:e,...n}){return l.jsxs(ot.Item,{"data-slot":"select-item",className:w("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(ot.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),l.jsx(ot.ItemText,{children:e})]})}function Ux({className:t,...e}){return l.jsx(ot.Separator,{"data-slot":"select-separator",className:w("bg-border pointer-events-none -mx-1 my-1 h-px",t),...e})}function _x({className:t,...e}){return l.jsx(ot.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:w("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(k.ChevronUpIcon,{className:"size-4"})})}function Jx({className:t,...e}){return l.jsx(ot.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:w("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(k.ChevronDownIcon,{className:"size-4"})})}const Vx={previous:"Anterior",next:"Próxima",first:"Primeira",last:"Última",showing:"Mostrando",of:"de",results:"resultados",itemsPerPage:"Itens por página",page:"Página"},Gx=[10,20,30,50,100];function y0(t,e,n=5){if(e<=n)return Array.from({length:e},(o,f)=>f+1);const r=[],a=Math.floor(n/2);r.push(1);let i=Math.max(2,t-a),s=Math.min(e-1,t+a);t<=a+1?s=n-1:t>=e-a&&(i=e-n+2),i>2&&r.push("ellipsis");for(let o=i;o<=s;o++)r.push(o);return s<e-1&&r.push("ellipsis"),e>1&&r.push(e),r}function Dc({currentPage:t,totalPages:e,pageSize:n,totalItems:r,onPageChange:a,onPageSizeChange:i,pageSizeOptions:s=Gx,maxVisiblePages:o=5,showInfo:f=!0,showPageNumbers:c=!0,showPageSizeSelector:d=!0,showFirstLastButtons:u=!0,labels:p,className:h}){const m={...Vx,...p},g=y0(t,e,o),b=(t-1)*n+1,x=Math.min(t*n,r),v=t>1,j=t<e;return e===0?null:l.jsxs("div",{className:w("flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",h),role:"navigation","aria-label":"Paginação da tabela",children:[f&&l.jsxs("p",{className:"text-sm text-muted-foreground order-2 sm:order-1",children:[m.showing," ",l.jsx("span",{className:"font-medium text-foreground",children:b})," - ",l.jsx("span",{className:"font-medium text-foreground",children:x})," ",m.of," ",l.jsx("span",{className:"font-medium text-foreground",children:r})," ",m.results]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4 order-1 sm:order-2",children:[d&&i&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:m.itemsPerPage}),l.jsxs(en,{value:String(n),onValueChange:y=>i(Number(y)),children:[l.jsx(nn,{className:"h-8 w-[70px]",children:l.jsx(tn,{placeholder:n})}),l.jsx(rn,{children:s.map(y=>l.jsx(Dt,{value:String(y),children:y},y))})]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground sm:hidden",children:[m.page," ",t," ",m.of," ",e]}),l.jsxs("div",{className:"flex items-center gap-1",children:[u&&l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(1),disabled:!v,"aria-label":m.first,children:l.jsx(k.ChevronsLeft,{className:"h-4 w-4"})}),l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(t-1),disabled:!v,"aria-label":m.previous,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),c&&l.jsx("div",{className:"hidden sm:flex items-center gap-1",children:g.map((y,L)=>y==="ellipsis"?l.jsx("span",{className:"flex items-center justify-center w-8 h-8 text-muted-foreground","aria-hidden":!0,children:"..."},`ellipsis-${L}`):l.jsx(F,{variant:t===y?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(y),"aria-label":`${m.page} ${y}`,"aria-current":t===y?"page":void 0,children:y},y))}),l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(t+1),disabled:!j,"aria-label":m.next,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})}),u&&l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(e),disabled:!j,"aria-label":m.last,children:l.jsx(k.ChevronsRight,{className:"h-4 w-4"})})]})]})]})}Dc.displayName="TablePagination";function Ht({className:t,type:e,...n}){return l.jsx("input",{type:e,"data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow,border-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function Bn({className:t,variant:e="pulse",...n}){return l.jsx("div",{"data-slot":"skeleton",className:w("rounded-md",e==="shimmer"?"skeleton-shimmer":"bg-accent animate-pulse",t),...n})}const Yx={"first-use":"bg-primary/8 text-primary",cleared:"bg-success/10 text-success","no-results":"bg-muted text-muted-foreground",error:"bg-destructive/10 text-destructive"};function kf({icon:t,illustration:e,title:n,description:r,variant:a="first-use",primaryAction:i,secondaryAction:s,className:o}){return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-4 py-12 px-6 text-center",o),role:"status","aria-live":"polite",children:[e?l.jsx("img",{src:e,alt:"",className:"w-32 h-32 object-contain","aria-hidden":"true"}):t?l.jsx("div",{className:w("flex size-16 items-center justify-center rounded-2xl",Yx[a]),"aria-hidden":"true",children:l.jsx(t,{className:"size-8"})}):null,l.jsxs("div",{className:"max-w-sm space-y-1.5",children:[l.jsx("h3",{className:"text-base font-semibold leading-snug text-foreground",children:n}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r})]}),(i||s)&&l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 pt-1",children:[i&&l.jsx(F,{variant:i.variant??"default",onClick:i.onClick,children:i.label}),s&&l.jsx(F,{variant:s.variant??"outline",onClick:s.onClick,children:s.label})]})]})}function v0(t){const{currentPage:e,pageSize:n,totalItems:r}=t,a=Math.ceil(r/n),i=(e-1)*n,s=Math.min(i+n,r);return{totalPages:a,startIndex:i,endIndex:s,hasNextPage:e<a,hasPreviousPage:e>1}}function Qx({data:t,initialPageSize:e=10,resetOnDataChange:n=!0,serverSideTotalItems:r}){const[a,i]=M.useState(1),[s,o]=M.useState(e),f=r!==void 0,c=f?r:t.length;M.useMemo(()=>{n&&i(1)},[t.length,n]);const d=Math.ceil(c/s),u=Math.min(Math.max(1,a),Math.max(1,d)),p=(u-1)*s,h=Math.min(p+s,c),m=M.useMemo(()=>f?t:t.slice(p,h),[t,p,h,f]),g=L=>{const C=Math.max(1,Math.min(L,d));i(C)},b=()=>{a<d&&i(L=>L+1)},x=()=>{a>1&&i(L=>L-1)},v=L=>{o(L),i(1)},j={currentPage:u,pageSize:s,totalItems:c,onPageChange:g,onPageSizeChange:v},y=v0(j);return{currentPage:u,pageSize:s,totalItems:c,totalPages:d,paginatedData:m,goToPage:g,nextPage:b,prevPage:x,setPageSize:v,paginationConfig:j,metadata:y}}function Wx({data:t,initialSort:e={column:null,direction:null},initialPageSize:n=10,enablePagination:r=!0,serverMode:a=!1,totalItems:i,serverCurrentPage:s,serverCurrentPageSize:o}){const[f,c]=M.useState(e),[d,u]=M.useState([]),p=M.useMemo(()=>a||d.length===0?t:t.filter(C=>d.every(N=>{const S=C[N.column];switch(N.operator){case"equals":return S==N.value;case"contains":return String(S).toLowerCase().includes(String(N.value).toLowerCase());case"startsWith":return String(S).toLowerCase().startsWith(String(N.value).toLowerCase());case"greaterThan":return S>N.value;case"greaterThanOrEqual":return S>=N.value;case"lessThan":return S<N.value;case"lessThanOrEqual":return S<=N.value;default:return!0}})),[t,d,a]),h=M.useMemo(()=>a||!f.column||!f.direction?p:[...p].sort((C,N)=>{const S=C[f.column],T=N[f.column];return S<T?f.direction==="asc"?-1:1:S>T?f.direction==="asc"?1:-1:0}),[p,f,a]),m=a?i??t.length:h.length,g=Qx({data:a?t:h,initialPageSize:n,resetOnDataChange:!0,serverSideTotalItems:a?m:void 0});M.useEffect(()=>{a&&(s!==void 0&&s!==g.currentPage&&g.goToPage(s),o!==void 0&&o!==g.pageSize&&g.setPageSize(o))},[a,s,o,g]);const b=C=>{c(N=>{if(N.column===C){if(N.direction==="asc")return{column:C,direction:"desc"};if(N.direction==="desc")return{column:null,direction:null}}return{column:C,direction:"asc"}})},x=(C,N,S="contains")=>{u(T=>{const z=T.filter(P=>P.column!==C);return N===""||N===null||N===void 0?z:[...z,{column:C,operator:S,value:N}]})},v=C=>{u(N=>N.filter(S=>S.column!==C))},j=C=>f.column===C?f.direction:null,y=a?t:r?g.paginatedData:h,L=a&&(s!==void 0||o!==void 0)?{...g.paginationConfig,currentPage:s??g.paginationConfig.currentPage,pageSize:o??g.paginationConfig.pageSize}:g.paginationConfig;return{data:y,state:{sort:f,filters:d,pagination:L},handlers:{onSort:b,setFilter:x,removeFilter:v,clearFilters:()=>u([])},getSortDirection:j}}const w0=$t.cva("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),pe=I.forwardRef(({className:t,variant:e,asChild:n=!1,...r},a)=>{const i=n?kn.Slot:"span";return l.jsx(i,{ref:a,"data-slot":"badge",className:w(w0({variant:e}),t),...r})});pe.displayName="Badge";function M0({label:t,value:e,onRemove:n,className:r}){return l.jsxs(pe,{variant:"secondary",className:w("gap-1 pr-1 pl-2 h-7",n&&"pr-1",r),children:[l.jsxs("span",{className:"text-sm",children:[t,e&&l.jsxs(l.Fragment,{children:[": ",l.jsx("span",{className:"font-semibold",children:e})]})]}),n&&l.jsx("button",{type:"button",onClick:n,className:"ml-1 rounded-sm hover:bg-muted p-0.5 transition-colors","aria-label":`Remove ${t} filter`,children:l.jsx(k.X,{className:"h-3 w-3"})})]})}function j0({activeFilters:t=[],onClearAll:e,onOpenFilters:n,className:r,children:a}){const i=t.length>0;return l.jsxs("div",{className:w("flex items-center gap-2 flex-wrap",r),children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:n,className:"gap-2",children:[l.jsx(k.Filter,{className:"h-4 w-4"}),"Filtros",i&&l.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground w-5 h-5 text-xs flex items-center justify-center",children:t.length})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-4 w-px bg-border"}),t.map(s=>l.jsx(M0,{label:s.label,value:s.value,onRemove:s.onRemove},s.id)),l.jsxs(F,{variant:"ghost",size:"sm",onClick:e,className:"gap-1 h-7 px-2",children:[l.jsx(k.X,{className:"h-3 w-3"}),"Limpar tudo"]})]}),a]})}function st({...t}){return l.jsx(Wn.Root,{"data-slot":"popover",...t})}const $e=I.forwardRef((t,e)=>l.jsx(Wn.Trigger,{ref:e,"data-slot":"popover-trigger",...t}));$e.displayName=Wn.Trigger.displayName;const Ze=I.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},a)=>l.jsx(Wn.Portal,{children:l.jsx(Wn.Content,{ref:a,"data-slot":"popover-content",align:e,sideOffset:n,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...r})}));Ze.displayName=Wn.Content.displayName;const $x=I.forwardRef((t,e)=>l.jsx(Wn.Anchor,{ref:e,"data-slot":"popover-anchor",...t}));$x.displayName=Wn.Anchor.displayName;function C0({className:t,...e}){return l.jsx(mu.Root,{"data-slot":"checkbox",className:w("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(mu.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:l.jsx(k.Check,{className:"size-3.5"})})})}function Ue({className:t,...e}){return l.jsx(Ix.Root,{"data-slot":"label",className:w("flex items-center gap-2 text-sm leading-none font-semibold select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function Pl(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Oa(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):s;a=t.formattingValues[o]||t.formattingValues[s]}else{const s=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[o]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}function Pa(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const s=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],f=Array.isArray(o)?qx(o,u=>u.test(s)):Zx(o,u=>u.test(s));let c;c=t.valueCallback?t.valueCallback(f):f,c=n.valueCallback?n.valueCallback(c):c;const d=e.slice(s.length);return{value:c,rest:d}}}function Zx(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function qx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Kx(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const o=e.slice(a.length);return{value:s,rest:o}}}const Xx={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ey=(t,e,n)=>{let r;const a=Xx[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",String(e)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"em "+r:"há "+r:r},ty={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},ny={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ry={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ay={date:Pl({formats:ty,defaultWidth:"full"}),time:Pl({formats:ny,defaultWidth:"full"}),dateTime:Pl({formats:ry,defaultWidth:"full"})},iy={lastWeek:t=>{const e=t.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},sy=(t,e,n,r)=>{const a=iy[t];return typeof a=="function"?a(e):a},oy={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},ly={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},fy={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},cy={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},dy={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},uy={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},hy=(t,e)=>{const n=Number(t);return(e==null?void 0:e.unit)==="week"?n+"ª":n+"º"},py={ordinalNumber:hy,era:Oa({values:oy,defaultWidth:"wide"}),quarter:Oa({values:ly,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Oa({values:fy,defaultWidth:"wide"}),day:Oa({values:cy,defaultWidth:"wide"}),dayPeriod:Oa({values:dy,defaultWidth:"wide",formattingValues:uy,defaultFormattingWidth:"wide"})},my=/^(\d+)[ºªo]?/i,gy=/\d+/i,by={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},xy={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},yy={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},vy={any:[/1/i,/2/i,/3/i,/4/i]},wy={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},My={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},jy={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Cy={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Ly={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Ny={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},ky={ordinalNumber:Kx({matchPattern:my,parsePattern:gy,valueCallback:t=>parseInt(t,10)}),era:Pa({matchPatterns:by,defaultMatchWidth:"wide",parsePatterns:xy,defaultParseWidth:"any"}),quarter:Pa({matchPatterns:yy,defaultMatchWidth:"wide",parsePatterns:vy,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Pa({matchPatterns:wy,defaultMatchWidth:"wide",parsePatterns:My,defaultParseWidth:"any"}),day:Pa({matchPatterns:jy,defaultMatchWidth:"wide",parsePatterns:Cy,defaultParseWidth:"any"}),dayPeriod:Pa({matchPatterns:Ly,defaultMatchWidth:"any",parsePatterns:Ny,defaultParseWidth:"any"})},yt={code:"pt-BR",formatDistance:ey,formatLong:ay,formatRelative:sy,localize:py,match:ky,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qo({className:t,classNames:e,showOutsideDays:n=!0,locale:r=yt,...a}){return l.jsx(rx.DayPicker,{showOutsideDays:n,locale:r,className:w("p-3",t),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-4",month_caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",button_previous:w(Jn({variant:"outline"}),"absolute left-1 top-0 size-7 bg-background p-0 hover:bg-accent hover:text-accent-foreground rounded-md border-border z-10"),button_next:w(Jn({variant:"outline"}),"absolute right-1 top-0 size-7 bg-background p-0 hover:bg-accent hover:text-accent-foreground rounded-md border-border z-10"),month_grid:"w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 rounded-md",day_button:w(Jn({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md"),range_end:"range-end",range_start:"range-start",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground rounded-md",today:"bg-accent text-accent-foreground rounded-md",outside:"outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...e},components:{Chevron:({orientation:i,...s})=>i==="left"?l.jsx(k.ChevronLeft,{className:"h-4 w-4",...s}):l.jsx(k.ChevronRight,{className:"h-4 w-4",...s})},...a})}Qo.displayName="Calendar";const xu=t=>{const e=[],n=t==="24h"?24:12,r=t==="24h"?0:1;for(let a=r;a<n+r;a++)e.push(a.toString().padStart(2,"0"));return e},yu=t=>{const e=[];for(let n=0;n<60;n+=t)e.push(n.toString().padStart(2,"0"));return e},Sy=t=>{const e=t>=12?"PM":"AM";return{hour:t%12||12,period:e}},Ty=(t,e)=>e==="AM"?t===12?0:t:t===12?12:t+12,vu=(t,e,n)=>{if(!e&&!n)return!0;const[r,a]=t.split(":").map(Number),i=r*60+a;if(e){const[s,o]=e.split(":").map(Number);if(i<s*60+o)return!1}if(n){const[s,o]=n.split(":").map(Number);if(i>s*60+o)return!1}return!0};function mi({value:t,onChange:e,format:n="24h",minuteStep:r=5,minTime:a,maxTime:i,disabled:s=!1,placeholder:o="HH:MM",className:f,showIcon:c=!0,variant:d="input"}){const[u,p]=I.useMemo(()=>{if(!t)return["",""];const[x,v]=t.split(":");return[x||"",v||""]},[t]),[h,m]=I.useState(()=>u&&parseInt(u)>=12?"PM":"AM"),g=(x,v,j)=>{if(!x||!v)return;let y=parseInt(x);const L=parseInt(v);n==="12h"&&j&&(y=Ty(y,j));const C=`${y.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;vu(C,a,i)&&(e==null||e(C))},b=x=>{const j=x.target.value.replace(/[^\d:]/g,"");if(j.length===2&&!j.includes(":")){const y=j+":";e==null||e(y);return}if(j.match(/^\d{2}:\d{2}$/)){const[y,L]=j.split(":").map(Number);y>=0&&y<=23&&L>=0&&L<=59&&vu(j,a,i)&&(e==null||e(j))}else e==null||e(j)};if(d==="input")return l.jsxs("div",{className:w("relative",f),children:[c&&l.jsx(k.Clock,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"}),l.jsx(Ht,{type:"text",value:t||"",onChange:b,placeholder:o,disabled:s,className:w(c&&"pl-9"),maxLength:5})]});if(d==="select"){const x=xu(n),v=yu(r),j=n==="12h"&&u?Sy(parseInt(u)).hour.toString().padStart(2,"0"):u;return l.jsxs("div",{className:w("flex items-center gap-2",f),children:[c&&l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsxs(en,{value:j,onValueChange:y=>{g(y,p||"00",n==="12h"?h:void 0)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{placeholder:"HH"})}),l.jsx(rn,{children:x.map(y=>l.jsx(Dt,{value:y,children:y},y))})]}),l.jsx("span",{className:"text-muted-foreground font-medium",children:":"}),l.jsxs(en,{value:p,onValueChange:y=>{g(u||"00",y,n==="12h"?h:void 0)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{placeholder:"MM"})}),l.jsx(rn,{children:v.map(y=>l.jsx(Dt,{value:y,children:y},y))})]}),n==="12h"&&l.jsxs(en,{value:h,onValueChange:y=>{m(y),u&&p&&g(u,p,y)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{})}),l.jsxs(rn,{children:[l.jsx(Dt,{value:"AM",children:"AM"}),l.jsx(Dt,{value:"PM",children:"PM"})]})]})]})}if(d==="inline"){const x=xu(n),v=yu(r);return l.jsxs("div",{className:w("flex items-center gap-2",f),children:[c&&l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsx(Ue,{className:"text-sm text-muted-foreground",children:"Horário:"}),l.jsxs(en,{value:u,onValueChange:j=>g(j,p||"00",n==="12h"?h:void 0),disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{placeholder:"HH"})}),l.jsx(rn,{children:x.map(j=>l.jsx(Dt,{value:j,children:j},j))})]}),l.jsx("span",{className:"text-muted-foreground",children:":"}),l.jsxs(en,{value:p,onValueChange:j=>g(u||"00",j,n==="12h"?h:void 0),disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{placeholder:"MM"})}),l.jsx(rn,{children:v.map(j=>l.jsx(Dt,{value:j,children:j},j))})]}),n==="12h"&&l.jsxs(en,{value:h,onValueChange:j=>{m(j),u&&p&&g(u,p,j)},disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{})}),l.jsxs(rn,{children:[l.jsx(Dt,{value:"AM",children:"AM"}),l.jsx(Dt,{value:"PM",children:"PM"})]})]})]})}return null}mi.displayName="TimePicker";function Ec({value:t,onChange:e,placeholder:n="Selecione uma data",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s,locale:o=yt,className:f,error:c=!1,showTime:d=!1,timeFormat:u="24h",minuteStep:p=5,defaultTime:h="09:00",id:m,name:g}){const[b,x]=I.useState(!1),[v,j]=I.useState(""),[y,L]=I.useState(!1),C=s||(d?"dd/MM/yyyy HH:mm":"dd/MM/yyyy"),N=I.useMemo(()=>d?["dd/MM/yyyy HH:mm","dd/MM/yyyy HH:mm:ss","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy","ddMMyyyy","ddMMyy"],[d]);I.useEffect(()=>{t?(j(H.format(t,C,{locale:o})),L(!1)):(j(""),L(!1))},[t,C,o]);const S=I.useMemo(()=>{if(!t)return h;const E=t.getHours().toString().padStart(2,"0"),Y=t.getMinutes().toString().padStart(2,"0");return`${E}:${Y}`},[t,h]),T=E=>{if(!E){e==null||e(void 0);return}if(d){const[Y,Z]=S.split(":").map(Number);E.setHours(Y,Z,0,0)}else E.setHours(0,0,0,0);e==null||e(E),d||x(!1)},z=E=>{if(t){const Y=new Date(t),[Z,le]=E.split(":").map(Number);Y.setHours(Z,le,0,0),e==null||e(Y)}else{const Y=new Date,[Z,le]=E.split(":").map(Number);Y.setHours(Z,le,0,0),e==null||e(Y)}},P=E=>{const Y=E.trim();if(!Y)return null;for(const Z of N)try{const le=H.parse(Y,Z,new Date);if(H.isValid(le)){if(a&&le<a||i&&le>i)continue;return le}}catch{continue}return null},U=E=>{const Y=E.target.value;j(Y),L(!1)},J=()=>{if(!v.trim()){e==null||e(void 0),L(!1);return}const E=P(v);E?(e==null||e(E),L(!1)):L(!0)},G=E=>{E.key==="Enter"?(E.preventDefault(),J(),y||x(!0)):E.key==="Escape"&&(E.preventDefault(),j(t?H.format(t,C,{locale:o}):""),L(!1))},K=E=>{E.stopPropagation(),e==null||e(void 0),j(""),L(!1)};return l.jsxs(st,{open:b,onOpenChange:x,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:m,name:g,value:v,onChange:U,onBlur:J,onKeyDown:G,placeholder:n,disabled:r,"aria-invalid":c||y,className:w("pr-20",(c||y)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[v&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:K,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>x(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsxs(Ze,{className:"w-auto p-0",align:"start",children:[l.jsx(Qo,{mode:"single",selected:t,onSelect:T,disabled:E=>!!(a&&E<a||i&&E>i),locale:o,autoFocus:!0,defaultMonth:t||void 0}),d&&l.jsx("div",{className:"border-t p-3",children:l.jsx(mi,{value:S,onChange:z,format:u,minuteStep:p,variant:"inline",showIcon:!0})}),d&&l.jsx("div",{className:"border-t p-3 flex justify-end",children:l.jsx(F,{size:"sm",onClick:()=>x(!1),children:"Confirmar"})})]})]})}Ec.displayName="DatePicker";const wu=[{value:"is",label:"é",multiSelect:!1},{value:"is_not",label:"não é",multiSelect:!1},{value:"is_any_of",label:"é qualquer um de",multiSelect:!0},{value:"is_none_of",label:"não é nenhum de",multiSelect:!0},{value:"contains",label:"contém",multiSelect:!1},{value:"does_not_contain",label:"não contém",multiSelect:!1},{value:"greater_than",label:"maior que",multiSelect:!1},{value:"greater_than_or_equal",label:"maior ou igual a",multiSelect:!1},{value:"less_than",label:"menor que",multiSelect:!1},{value:"less_than_or_equal",label:"menor ou igual a",multiSelect:!1},{value:"is_empty",label:"está vazio",multiSelect:!1},{value:"is_not_empty",label:"não está vazio",multiSelect:!1}];function L0({conditions:t,onConditionsChange:e,fields:n,className:r}){const a=()=>{var f;const o={id:Math.random().toString(36).substr(2,9),field:((f=n[0])==null?void 0:f.value)||"",operator:"is",value:""};e([...t,o])},i=o=>{e(t.filter(f=>f.id!==o))},s=(o,f)=>{e(t.map(c=>c.id===o?{...c,...f}:c))};return l.jsxs("div",{className:w("space-y-3",r),children:[t.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm",children:'Nenhuma condição de filtro. Clique em "Adicionar condição" para começar.'}):t.map((o,f)=>l.jsx(Iy,{condition:o,fields:n,index:f,onUpdate:c=>s(o.id,c),onRemove:()=>i(o.id)},o.id)),l.jsxs(F,{type:"button",variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[l.jsx(k.Plus,{className:"h-4 w-4"}),"Adicionar condição"]})]})}function Iy({condition:t,fields:e,index:n,onUpdate:r,onRemove:a}){var m;const i=e.find(g=>g.value===t.field),s=wu.find(g=>g.value===t.operator),o=(i==null?void 0:i.multiSelect)||(s==null?void 0:s.multiSelect)||!1,f=!["is_empty","is_not_empty"].includes(t.operator),[c,d]=M.useState(""),u=Array.isArray(t.value)?t.value:t.value?[t.value]:[],p=g=>{if(!o){r({value:g});return}const b=Array.isArray(t.value)?t.value:[],x=b.includes(g)?b.filter(v=>v!==g):[...b,g];r({value:x})},h=g=>{if(!o)return;const b=Array.isArray(t.value)?t.value:[];r({value:b.filter(x=>x!==g)})};return l.jsxs("div",{className:"flex items-start gap-2 group",children:[l.jsx("div",{className:"flex items-center h-9 px-2 text-sm text-muted-foreground",children:n===0?"Onde":"E"}),l.jsxs("div",{className:"flex-1 flex items-center gap-2 flex-wrap p-2 border rounded-lg bg-background",children:[l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted",children:(i==null?void 0:i.label)||"Selecionar campo"})}),l.jsx(Ze,{className:"w-[200px] p-2",align:"start",children:l.jsx("div",{className:"space-y-1",children:e.map(g=>l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",t.field===g.value&&"bg-muted"),onClick:()=>r({field:g.value,value:g.multiSelect?[]:""}),children:g.label},g.value))})})]}),l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted text-muted-foreground",children:(s==null?void 0:s.label)||"is"})}),l.jsx(Ze,{className:"w-[200px] p-2",align:"start",children:l.jsx("div",{className:"space-y-1",children:wu.map(g=>l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",t.operator===g.value&&"bg-muted"),onClick:()=>r({operator:g.value,value:g.multiSelect?[]:""}),children:g.label},g.value))})})]}),f&&l.jsxs(l.Fragment,{children:[i!=null&&i.options?l.jsxs(st,{onOpenChange:g=>!g&&d(""),children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted",children:o&&u.length>0?l.jsxs("span",{className:"flex items-center gap-1",children:[u.length," selecionado",u.length>1?"s":""]}):!o&&t.value&&((m=i.options.find(g=>g.value===t.value))==null?void 0:m.label)||"Selecionar valor"})}),l.jsx(Ze,{className:"w-[240px] p-3",align:"start",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{className:"text-xs text-muted-foreground",children:o?"Selecionar valores":"Selecionar valor"}),l.jsxs("div",{className:"relative",children:[l.jsx(k.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Ht,{type:"text",placeholder:"Buscar...",value:c,onChange:g=>d(g.target.value),className:"h-9 pl-8",autoFocus:!0})]}),l.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:(()=>{const g=i.options.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())||b.value.toLowerCase().includes(c.toLowerCase()));return g.length===0?l.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"Nenhum resultado encontrado"}):g.map(b=>{const x=o?u.includes(b.value):t.value===b.value;return l.jsx("div",{className:"flex items-center space-x-2",children:o?l.jsxs(l.Fragment,{children:[l.jsx(C0,{id:`${t.id}-${b.value}`,checked:x,onCheckedChange:()=>p(b.value)}),l.jsx("label",{htmlFor:`${t.id}-${b.value}`,className:"text-sm cursor-pointer flex-1",children:b.label})]}):l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",x&&"bg-muted"),onClick:()=>r({value:b.value}),children:b.label})},b.value)})})()})]})})]}):(i==null?void 0:i.type)==="date"?l.jsx(Ec,{value:t.value?new Date(t.value+"T00:00:00"):void 0,onChange:g=>{if(g){const b=g.toISOString().split("T")[0];r({value:b})}else r({value:""})},placeholder:"Selecionar data",className:"h-7 text-sm"}):l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted max-w-[200px] truncate",children:t.value||"Inserir valor"})}),l.jsx(Ze,{className:"w-[240px] p-3",align:"start",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{className:"text-xs text-muted-foreground",children:"Inserir valor"}),l.jsx(Ht,{type:(i==null?void 0:i.type)==="number"?"number":"text",value:Array.isArray(t.value)?"":t.value,onChange:g=>r({value:g.target.value}),placeholder:"Digite o valor...",autoFocus:!0})]})})]}),o&&u.length>0&&l.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:u.map(g=>{var x,v;const b=((v=(x=i==null?void 0:i.options)==null?void 0:x.find(j=>j.value===g))==null?void 0:v.label)||g;return l.jsxs(pe,{variant:"secondary",className:"gap-1 h-6 text-xs",children:[b,l.jsx("button",{type:"button",onClick:()=>h(g),className:"ml-1 rounded-sm hover:bg-muted p-0.5 transition-colors","aria-label":`Remover ${b}`,children:l.jsx(k.X,{className:"h-3 w-3"})})]},g)})})]})]}),l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:a,className:"h-9 w-9 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remover condição",children:l.jsx(k.X,{className:"h-4 w-4"})})]})}function N0({data:t,columns:e,searchPlaceholder:n="Buscar...",searchableColumns:r,enableSearch:a=!0,filterFields:i=[],enableFilters:s=!1,initialFilters:o=[],pageSizeOptions:f=[5,10,20,50],initialPageSize:c=10,toolbarActions:d,serverConfig:u,isLoading:p=!1,emptyState:h,emptyMessage:m,className:g}){var q,re;const b=!!u,{data:x,state:v,handlers:j,getSortDirection:y}=Wx({data:t,initialPageSize:c,initialSort:{column:null,direction:null},serverMode:b,totalItems:u==null?void 0:u.totalItems,serverCurrentPage:u==null?void 0:u.currentPage,serverCurrentPageSize:u==null?void 0:u.currentPageSize}),[L,C]=M.useState(""),[N,S]=M.useState(!1),[T,z]=M.useState(o),P=r?r[0]:((q=e.find(A=>A.key==="nome"||A.key==="name"||A.key==="title"||A.key==="titulo"))==null?void 0:q.key)||((re=e[0])==null?void 0:re.key),U=A=>{switch(A){case"is":return"equals";case"equals":return"equals";case"contains":return"contains";case"contem":return"contains";case"starts_with":return"startsWith";case"greater_than":return"greaterThan";case"greater_than_or_equal":return"greaterThanOrEqual";case"less_than":return"lessThan";case"less_than_or_equal":return"lessThanOrEqual";case"entre":return"equals";default:return"contains"}},J=M.useCallback(async A=>{b&&(u!=null&&u.onFilterChange)?await u.onFilterChange(A,L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"),A.forEach(B=>{const ee=U(B.operator);j.setFilter(B.field,B.value,ee)}))},[b,u,L,j,P]);M.useEffect(()=>{o&&(z(o),o.length>0&&(b&&(u!=null&&u.onFilterChange)?u.onFilterChange(o,L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"),o.forEach(A=>{const B=U(A.operator);j.setFilter(A.field,A.value,B)}))))},[JSON.stringify(o)]);const G=M.useCallback(async A=>{C(A),b&&(u!=null&&u.onFilterChange)?await u.onFilterChange(T,A):j.setFilter(P,A,"contains")},[b,u,T,j,P]),K=A=>{if(/^\d{4}-\d{2}-\d{2}/.test(A)){const B=new Date(A+"T00:00:00");if(!isNaN(B.getTime()))return B.toLocaleDateString("pt-BR")}return A},E=A=>({is:"é",is_not:"não é",is_any_of:"é qualquer um de",is_none_of:"não é nenhum de",equals:"igual a",not_equals:"diferente de",contains:"contém",contem:"contém",does_not_contain:"não contém",starts_with:"começa com",ends_with:"termina com",greater_than:"maior que",greater_than_or_equal:"maior ou igual a",less_than:"menor que",less_than_or_equal:"menor ou igual a",is_empty:"está vazio",is_not_empty:"não está vazio",entre:"entre"})[A]||A,Y=T.map(A=>{var Oe,un;const B=i.find(dt=>dt.value===A.field),ee=E(A.operator);let he;return Array.isArray(A.value)?he=A.value.map(dt=>{var Zt,ir;return((ir=(Zt=B==null?void 0:B.options)==null?void 0:Zt.find(Vr=>Vr.value===dt))==null?void 0:ir.label)||dt}).join(", "):(B==null?void 0:B.type)==="date"?he=K(A.value):he=((un=(Oe=B==null?void 0:B.options)==null?void 0:Oe.find(dt=>dt.value===A.value))==null?void 0:un.label)||A.value,{id:A.id,label:(B==null?void 0:B.label)||A.field,value:ee?`${ee} ${he}`:he,onRemove:()=>{const dt=T.filter(Zt=>Zt.id!==A.id);z(dt),J(dt)}}}),Z=()=>{J(T),S(!1)},le=()=>{z([]),b&&(u!=null&&u.onFilterChange)?u.onFilterChange([],L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"))},we=M.useCallback(async A=>{if(b&&(u!=null&&u.onSortChange)){const B=v.sort;let ee="asc";B.column===A&&(ee=B.direction==="asc"?"desc":B.direction==="desc"?null:"asc");const he={column:ee?A:null,direction:ee};j.onSort(A),await u.onSortChange(he)}else j.onSort(A)},[b,u,v.sort,j]),Ie=M.useCallback(async A=>{b&&(u!=null&&u.onPageChange)?await u.onPageChange(A,v.pagination.pageSize):v.pagination.onPageChange&&v.pagination.onPageChange(A)},[b,u,v.pagination]),Le=M.useCallback(async A=>{b&&(u!=null&&u.onPageChange)?await u.onPageChange(1,A):v.pagination.onPageSizeChange&&v.pagination.onPageSizeChange(A)},[b,u,v.pagination]),V=()=>{const A=T.length>0,B=L.trim().length>0;if(typeof h=="string"||m){const ee=A||B?"Nenhum resultado encontrado para os filtros aplicados.":typeof h=="string"?h:m||"Nenhum dado disponível.";return l.jsx("div",{className:"text-sm text-muted-foreground",children:ee})}return h&&typeof h=="object"?A||B?l.jsx(kf,{icon:k.Search,title:"Nenhum resultado encontrado",description:"Tente ajustar os filtros ou termos de busca para encontrar o que procura.",variant:"no-results",primaryAction:{label:"Limpar Filtros",onClick:()=>{C(""),le()},variant:"outline"}}):l.jsx(kf,{icon:h.icon,illustration:h.illustration,title:h.title,description:h.description,variant:h.variant||"first-use",primaryAction:h.primaryAction,secondaryAction:h.secondaryAction}):l.jsx("div",{className:"text-sm text-muted-foreground",children:A||B?"Nenhum resultado encontrado para os filtros aplicados.":"Nenhum dado disponível."})};return l.jsxs("div",{className:w("space-y-4",g),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a&&l.jsxs("div",{className:"relative max-w-sm flex-1",children:[l.jsx(k.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),l.jsx(Ht,{placeholder:n,value:L,onChange:A=>G(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.preventDefault()},className:"pl-9"})]}),s&&i.length>0&&l.jsxs(st,{open:N,onOpenChange:S,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",size:"sm",className:"gap-2",children:[l.jsx(k.Filter,{className:"h-4 w-4"}),"Filtros",T.length>0&&l.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground w-5 h-5 text-xs flex items-center justify-center",children:T.length})]})}),l.jsxs(Ze,{className:"w-[700px] p-0",align:"start",sideOffset:8,children:[l.jsxs("div",{className:"p-6 border-b",children:[l.jsx("h3",{className:"font-semibold",children:"Filtros Avançados"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Adicione condições de filtro para refinar os resultados."})]}),l.jsx("div",{className:"p-6",children:l.jsx(L0,{conditions:T,onConditionsChange:z,fields:i})}),l.jsxs("div",{className:"flex items-center justify-end gap-2 p-4 border-t bg-muted/50",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>S(!1),children:"Cancelar"}),l.jsx(F,{size:"sm",onClick:Z,children:"Aplicar Filtros"})]})]})]})]}),d&&l.jsx("div",{className:"flex items-center gap-2",children:d})]}),T.length>0&&l.jsx(j0,{activeFilters:Y,onClearAll:le}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(kc,{children:[l.jsx(Sc,{children:l.jsx(na,{children:e.map(A=>l.jsxs(Ic,{className:w(A.headerClassName,A.sortable&&"cursor-pointer select-none hover:bg-muted/50 transition-colors",A.sortable&&y(A.key)&&"text-primary"),style:{width:A.width},onClick:()=>A.sortable&&we(A.key),"aria-sort":A.sortable?y(A.key)==="asc"?"ascending":y(A.key)==="desc"?"descending":"none":void 0,children:[A.header,A.sortable&&y(A.key)&&l.jsx(k.ArrowUpDown,{className:"ml-2 h-4 w-4 inline"})]},String(A.key)))})}),l.jsx(Tc,{children:p?Array.from({length:Math.min(v.pagination.pageSize,15)}).map((A,B)=>l.jsx(na,{children:e.map((ee,he)=>l.jsx(qa,{className:ee.className,children:l.jsx(Bn,{className:"h-4 w-full"})},he))},`skeleton-${B}`)):x.length>0?x.map((A,B)=>l.jsx(na,{children:e.map(ee=>l.jsx(qa,{className:w(ee.className,ee.align?`text-${ee.align}`:"text-left"),children:ee.render?ee.render(A[ee.key],A,B):A[ee.key]},String(ee.key)))},B)):l.jsx(na,{children:l.jsx(qa,{colSpan:e.length,className:"h-64",children:V()})})})]})}),l.jsx(Dc,{currentPage:v.pagination.currentPage,totalPages:Math.ceil(v.pagination.totalItems/v.pagination.pageSize),pageSize:v.pagination.pageSize,totalItems:v.pagination.totalItems,onPageChange:Ie,onPageSizeChange:Le,pageSizeOptions:f})]})}function Dy({data:t,columns:e,title:n,description:r,searchPlaceholder:a="Buscar...",searchableColumns:i,filterFields:s=[],initialFilters:o,enableSearch:f=!0,enableFilters:c=s.length>0,pageSizeOptions:d=[5,10,20,50],initialPageSize:u=10,showCard:p=!0,cardPadding:h="p-6",toolbarActions:m,isLoading:g=!1,emptyState:b,emptyMessage:x,className:v,serverConfig:j},y){const L=l.jsx(N0,{data:t,columns:e,searchPlaceholder:a,searchableColumns:i,enableSearch:f,enableFilters:c,filterFields:s,initialFilters:o,initialPageSize:u,pageSizeOptions:d,toolbarActions:m,serverConfig:j,isLoading:g,emptyState:b,emptyMessage:x});return p?l.jsxs(jr,{ref:y,className:w(h,v),children:[(n||r)&&l.jsxs("div",{className:"mb-6",children:[n&&l.jsx("h2",{className:"text-lg font-semibold",children:n}),r&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r})]}),L]}):l.jsxs("div",{ref:y,className:v,children:[(n||r)&&l.jsxs("div",{className:"mb-6",children:[n&&l.jsx("h2",{className:"text-lg font-semibold",children:n}),r&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r})]}),L]})}const k0=I.forwardRef(Dy);k0.displayName="AdvancedDataTable";const Ey=$t.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",info:"text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800 [&>svg]:text-current *:data-[slot=alert-description]:text-blue-700/90 dark:*:data-[slot=alert-description]:text-blue-400/90",success:"text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 border-green-200 dark:border-green-800 [&>svg]:text-current *:data-[slot=alert-description]:text-green-700/90 dark:*:data-[slot=alert-description]:text-green-400/90",warning:"text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/30 border-yellow-200 dark:border-yellow-800 [&>svg]:text-current *:data-[slot=alert-description]:text-yellow-700/90 dark:*:data-[slot=alert-description]:text-yellow-400/90"}},defaultVariants:{variant:"default"}});function Ay({className:t,variant:e,...n}){return l.jsx("div",{"data-slot":"alert",role:"alert",className:w(Ey({variant:e}),t),...n})}function zy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-title",className:w("col-start-2 line-clamp-1 min-h-4 font-semibold leading-[1.2] tracking-tight",t),...e})}function Oy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-description",className:w("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function Py({...t}){return l.jsx(dn.Root,{"data-slot":"alert-dialog",...t})}function Ry({...t}){return l.jsx(dn.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function By({...t}){return l.jsx(dn.Portal,{"data-slot":"alert-dialog-portal",...t})}const S0=I.forwardRef(({className:t,...e},n)=>l.jsx(dn.Overlay,{ref:n,"data-slot":"alert-dialog-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));S0.displayName=dn.Overlay.displayName;function Hy({className:t,...e}){return l.jsxs(By,{children:[l.jsx(S0,{}),l.jsx(dn.Content,{"data-slot":"alert-dialog-content",className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...e})]})}function Fy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-dialog-header",className:w("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Uy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-dialog-footer",className:w("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function _y({className:t,...e}){return l.jsx(dn.Title,{"data-slot":"alert-dialog-title",className:w("text-lg font-semibold leading-[1.2]",t),...e})}function Jy({className:t,...e}){return l.jsx(dn.Description,{"data-slot":"alert-dialog-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e})}function Vy({className:t,...e}){return l.jsx(dn.Action,{className:w(Jn(),t),...e})}function Gy({className:t,...e}){return l.jsx(dn.Cancel,{className:w(Jn({variant:"outline"}),t),...e})}function Wo({className:t,children:e,...n}){return l.jsxs(Za.Root,{"data-slot":"scroll-area",className:w("relative",t),...n,children:[l.jsx(Za.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),l.jsx(T0,{}),l.jsx(Za.Corner,{})]})}function T0({className:t,orientation:e="vertical",...n}){return l.jsx(Za.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:e,className:w("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...n,children:l.jsx(Za.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Mu={p395de780:"M0 1.88343C0 0.870644 0.847464 0 1.86025 0C2.89622 0 3.74369 0.871417 3.74369 1.88343C3.74369 2.89622 2.89622 3.74446 1.86025 3.74446C0.847464 3.74446 0 2.89622 0 1.88343Z",p9466600:"M14.366 0.0315111C9.86678 -0.373296 6.07442 3.17572 6.07442 7.59306V25.1303C6.07442 27.4664 7.74695 29.567 10.0661 29.8474C12.8287 30.1811 15.1857 28.0234 15.1857 25.3258V15.2102V14.0661C15.1857 13.1908 14.4757 12.4809 13.6004 12.4809H12.1488V15.2102V25.2161C12.1488 25.9847 11.5355 26.7689 10.7699 26.8384C9.86987 26.9195 9.11125 26.2095 9.11125 25.3258V7.78928C9.11125 5.45314 10.783 3.35263 13.1021 3.07142C15.8647 2.73692 18.2225 4.8946 18.2225 7.59306V21.0459C18.2225 21.0459 18.2225 21.0931 18.2225 21.1595C18.2225 21.9483 18.2225 25.3428 18.2225 25.3605C18.2024 29.7655 14.4124 33.2967 9.91931 32.8858C5.96936 32.525 3.03682 29.0355 3.03682 25.0693V15.1291V12.4816H1.58524C0.709959 12.4816 0 13.1916 0 14.0669V25.0152C0 30.6014 4.18017 35.4676 9.74781 35.9195C15.6461 36.3977 20.6529 32.029 21.2083 26.3725C21.2145 26.3053 21.2408 23.8325 21.2531 21.8216L21.2593 21.8231V7.85031C21.2601 3.87872 18.3206 0.386876 14.366 0.0315111Z"},pn={p1cdcfe80:"M21.9603 17.085C21.9556 16.3915 22.1577 15.7123 22.5408 15.1339C22.9239 14.5555 23.4707 14.104 24.1116 13.837C24.7525 13.57 25.4585 13.4995 26.1397 13.6345C26.8208 13.7696 27.4463 14.104 27.9365 14.5952C28.4267 15.0864 28.7594 15.7122 28.8923 16.3929C29.0251 17.0736 28.9521 17.7784 28.6825 18.4175C28.4129 19.0566 27.959 19.6011 27.3784 19.9817C26.7979 20.3623 26.1171 20.5618 25.4227 20.5547C24.5062 20.5422 23.631 20.1723 22.984 19.5239C22.337 18.8756 21.9696 18.0003 21.9603 17.085V17.085Z",p2cb5a300:"M98.983 25.9984C101.074 28.2086 102.206 31.1541 102.134 34.1939C102.207 37.2482 101.076 40.2089 98.983 42.4373C98.0369 43.5032 96.8719 44.353 95.5674 44.929C94.2629 45.505 92.8495 45.7937 91.4233 45.7754C90.0666 45.8501 88.7117 45.5978 87.4731 45.0398C86.2345 44.4817 85.1486 43.6343 84.3069 42.5689V54.8204H81.5394C80.7736 54.8204 80.0392 54.5166 79.4978 53.9758C78.9563 53.4351 78.6521 52.7017 78.6521 51.937V23.2227H81.9947C82.2987 23.2211 82.6001 23.2797 82.8814 23.3952C83.1626 23.5107 83.4182 23.6807 83.6332 23.8955C83.8482 24.1102 84.0185 24.3654 84.1341 24.6462C84.2498 24.9271 84.3085 25.2281 84.3069 25.5318V25.807C85.1512 24.7453 86.2379 23.9013 87.4761 23.3455C88.7143 22.7897 90.0678 22.5383 91.4233 22.6125C92.8528 22.6025 94.2678 22.8997 95.5721 23.4839C96.8765 24.0681 98.0398 24.9257 98.983 25.9984V25.9984ZM90.369 40.3555C91.1724 40.3816 91.9727 40.2432 92.7206 39.949C93.4685 39.6548 94.1482 39.2109 94.718 38.6446C95.302 38.0584 95.7595 37.359 96.0624 36.5894C96.3653 35.8198 96.5071 34.9964 96.4791 34.17C96.5113 33.3502 96.3713 32.5328 96.068 31.7703C95.7646 31.0079 95.3048 30.3174 94.718 29.7432C93.5516 28.6161 91.9921 27.9859 90.369 27.9859C88.746 27.9859 87.1865 28.6161 86.0201 29.7432C85.4473 30.3253 84.9997 31.0184 84.7051 31.7797C84.4105 32.541 84.275 33.3544 84.3069 34.17C84.2815 34.992 84.4199 35.8108 84.714 36.579C85.0081 37.3471 85.4521 38.0492 86.0201 38.6446C86.5912 39.2107 87.2706 39.656 88.0178 39.954C88.765 40.2521 89.5646 40.3968 90.369 40.3795V40.3555Z",p2d489f00:"M67.1509 17.085C67.1485 16.3949 67.3516 15.7197 67.7343 15.145C68.117 14.5704 68.6621 14.1223 69.3003 13.8577C69.9385 13.593 70.6411 13.5238 71.3188 13.6587C71.9966 13.7937 72.6188 14.1267 73.1066 14.6155C73.5944 15.1044 73.9258 15.7269 74.0585 16.4042C74.1913 17.0815 74.1196 17.7828 73.8524 18.4193C73.5852 19.0557 73.1346 19.5985 72.5579 19.9787C71.9811 20.3589 71.3043 20.5594 70.6132 20.5547C69.6968 20.5422 68.8215 20.1723 68.1746 19.5239C67.5276 18.8756 67.1602 18.0003 67.1509 17.085V17.085Z",p344a5f80:"M114.869 31.8729C118.068 32.5309 122.249 34.0623 122.201 38.7523C122.254 39.7667 122.048 40.7778 121.602 41.6904C121.155 42.603 120.483 43.3871 119.649 43.9688C117.799 45.2158 115.603 45.8481 113.372 45.7754C108.855 45.7754 105.776 44.0166 104.159 40.5589L107.118 38.8839C107.569 38.6258 108.095 38.5289 108.609 38.6094C109.123 38.6899 109.595 38.9428 109.945 39.3266C110.382 39.7887 110.916 40.1492 111.508 40.3828C112.1 40.6165 112.736 40.7174 113.372 40.6786C115.396 40.6786 116.403 40.0684 116.403 38.7882C116.403 37.508 114.654 36.9457 112.413 36.3954C109.155 35.5579 105.081 34.1939 105.081 29.6356C105.046 28.6587 105.245 27.6876 105.662 26.8032C106.079 25.9187 106.701 25.1465 107.477 24.5507C108.587 23.7568 109.846 23.1971 111.179 22.9057C112.513 22.6144 113.891 22.5975 115.231 22.8562C116.571 23.1148 117.844 23.6436 118.972 24.4101C120.101 25.1767 121.061 26.1649 121.794 27.3145L118.727 28.9895C118.302 29.2175 117.816 29.3077 117.338 29.2477C116.859 29.1877 116.411 28.9803 116.055 28.6545C115.346 28.0113 114.413 27.6719 113.456 27.7093C112.006 27.7093 110.904 28.4152 110.904 29.5039C110.904 30.5927 112.617 31.2986 114.869 31.8729Z",p35662200:"M22.6552 23.2346V34.0025V47.2828C22.6619 47.9663 22.4243 48.6297 21.9851 49.1538C21.5459 49.6779 20.9339 50.0284 20.2591 50.1423C19.8565 50.2006 19.4462 50.1718 19.0557 50.0579C18.6653 49.9441 18.3039 49.7477 17.9961 49.4823C17.6882 49.2168 17.441 48.8884 17.2713 48.5193C17.1016 48.1501 17.0133 47.7489 17.0124 47.3427V14.1777C16.9965 11.9279 17.8761 9.76402 19.4579 8.16199C21.0396 6.55996 23.1938 5.65104 25.4466 5.63517C27.6994 5.61931 29.8663 6.4978 31.4705 8.07739C33.0747 9.65698 33.9848 11.8083 34.0007 14.058V20.5546H36.7802C37.546 20.5546 38.2804 20.2508 38.8218 19.7101C39.3633 19.1694 39.6675 18.436 39.6675 17.6712V14.2255C39.6898 10.4749 38.2191 6.86905 35.5792 4.20125C32.9392 1.53344 29.3461 0.0222044 25.5904 -7.4932e-06C21.8347 -0.0222194 18.2239 1.44641 15.5525 4.08281C12.8811 6.7192 11.3678 10.3074 11.3456 14.058V47.1632C11.3377 48.2772 11.5496 49.3818 11.9692 50.4139C12.3888 51.4461 13.0079 52.3856 13.7911 53.1789C15.3728 54.7809 17.5271 55.6898 19.7799 55.7057C22.0327 55.7216 24.1995 54.8431 25.8037 53.2635C27.4079 51.6839 28.3181 49.5326 28.3339 47.2828V33.9427V26.118C28.3339 25.3533 28.0297 24.6199 27.4883 24.0792C26.9468 23.5384 26.2124 23.2346 25.4466 23.2346H22.6552Z",p3838afa0:"M67.8097 42.2698V23.2347H70.5773C70.9564 23.2347 71.3319 23.3092 71.6822 23.4541C72.0325 23.599 72.3508 23.8114 72.6189 24.0792C72.887 24.3469 73.0997 24.6648 73.2448 25.0146C73.3899 25.3644 73.4646 25.7394 73.4646 26.118V45.1532H70.6851C69.9214 45.15 69.1901 44.8449 68.6512 44.3045C68.1123 43.7641 67.8097 43.0325 67.8097 42.2698V42.2698Z",p38a74f0:"M33.9767 47.929C33.4376 55.3229 27.2676 61.4247 20.0554 61.4247C16.2424 61.4247 12.5857 59.9121 9.88955 57.2196C7.19341 54.5271 5.67874 50.8753 5.67874 47.0675V23.2466H2.89926C2.13239 23.2466 1.39675 23.55 0.853375 24.0904C0.309997 24.6308 0.00313895 25.3642 -2.99221e-05 26.13V47.1154C-0.0224375 52.3706 2.03925 57.421 5.73442 61.1627C9.4296 64.9045 14.4577 67.0333 19.7199 67.0838C24.2797 67.0831 28.704 65.5352 32.2674 62.694C35.8307 59.8529 38.3217 55.8869 39.332 51.4465C39.4399 51.0198 39.4486 50.574 39.3573 50.1435C39.2661 49.7129 39.0773 49.3089 38.8056 48.9625C38.5338 48.616 38.1862 48.3363 37.7895 48.1447C37.3927 47.9531 36.9573 47.8547 36.5166 47.8572H33.9767V47.929Z",pe814d80:"M56.9674 42.2698V16.4628C56.9673 16.0801 57.0436 15.7012 57.1916 15.3482C57.3397 14.9953 57.5567 14.6752 57.8299 14.4069C58.1031 14.1385 58.4271 13.9271 58.783 13.785C59.1388 13.643 59.5194 13.5731 59.9026 13.5794H62.6701V45.1532H59.9026C59.5194 45.1596 59.1388 45.0897 58.783 44.9476C58.4271 44.8056 58.1031 44.5942 57.8299 44.3258C57.5567 44.0574 57.3397 43.7374 57.1916 43.3844C57.0436 43.0314 56.9673 42.6525 56.9674 42.2698V42.2698Z",pf48a00:"M35.7618 42.4373C34.6809 41.3588 33.8312 40.0716 33.2648 38.6543C32.6983 37.2371 32.427 35.7194 32.4672 34.1939C32.4311 32.6648 32.7061 31.1442 33.2755 29.7242C33.845 28.3043 34.697 27.0144 35.7801 25.9329C36.8631 24.8513 38.1547 24.0004 39.5766 23.4317C40.9985 22.8631 42.5211 22.5884 44.0524 22.6245C46.0565 22.5718 48.0365 23.0708 49.7756 24.0669C51.5147 25.0629 52.9458 26.5176 53.9123 28.2716L50.8334 30.0782C50.399 30.3371 49.8912 30.4457 49.3888 30.3873C48.8863 30.3289 48.4171 30.1067 48.0539 29.7552C46.9749 28.7253 45.5327 28.1621 44.0404 28.1879C43.2541 28.1709 42.4726 28.3149 41.7441 28.6109C41.0156 28.907 40.3555 29.3488 39.8044 29.9092C39.2533 30.4696 38.823 31.1367 38.5398 31.8695C38.2567 32.6023 38.1267 33.3852 38.1579 34.17C38.1376 34.9603 38.2742 35.7468 38.5601 36.4841C38.8459 37.2213 39.2752 37.8947 39.8232 38.4652C40.936 39.5183 42.404 40.1161 43.9369 40.1405C45.4697 40.1648 46.956 39.614 48.1018 38.5968C48.4741 38.2608 48.9427 38.05 49.4414 37.9942C49.9401 37.9384 50.4437 38.0404 50.8813 38.2857L53.9842 40.0564C53.0823 41.5777 51.8458 42.8744 50.3684 43.8484C48.8909 44.8224 47.2111 45.4483 45.4558 45.6788C43.7006 45.9093 41.9158 45.7384 40.2364 45.1789C38.557 44.6194 37.027 43.686 35.7618 42.4493V42.4373Z"},mn={p12652a00:"M12.7929 15.2014C12.4062 14.8151 12.1022 14.354 11.8996 13.8463C11.697 13.3386 11.5999 12.795 11.6143 12.2486C11.6014 11.7008 11.6997 11.1561 11.9034 10.6475C12.1071 10.1388 12.4119 9.67682 12.7994 9.28938C13.1868 8.90195 13.6488 8.59716 14.1575 8.39346C14.6661 8.18975 15.2108 8.09138 15.7586 8.10429C16.4755 8.08543 17.1838 8.26417 17.8059 8.62096C18.428 8.97775 18.94 9.49883 19.2857 10.1271L18.1843 10.7743C18.0289 10.867 17.8473 10.9059 17.6675 10.885C17.4878 10.8641 17.3199 10.7845 17.19 10.6586C16.804 10.2897 16.2881 10.0879 15.7543 10.0971C15.473 10.0911 15.1934 10.1426 14.9328 10.2487C14.6722 10.3547 14.4361 10.513 14.239 10.7137C14.0418 10.9145 13.8879 11.1535 13.7866 11.4159C13.6853 11.6784 13.6388 11.9589 13.65 12.24C13.6427 12.5231 13.6916 12.8048 13.7938 13.0689C13.8961 13.333 14.0497 13.5742 14.2457 13.7786C14.6438 14.1558 15.1689 14.3699 15.7172 14.3787C16.2656 14.3874 16.7973 14.1901 17.2071 13.8257C17.3403 13.7054 17.5079 13.6299 17.6863 13.6099C17.8647 13.5899 18.0449 13.6264 18.2014 13.7143L19.3114 14.3486C18.9888 14.8935 18.5465 15.358 18.0179 15.7069C17.4894 16.0558 16.8885 16.28 16.2606 16.3626C15.6327 16.4451 14.9943 16.3839 14.3935 16.1835C13.7928 15.9831 13.2454 15.6487 12.7929 15.2057V15.2014Z",p128e2c00:"M7.85574 6.12C7.85405 5.87159 7.92633 5.62829 8.06338 5.4211C8.20043 5.21391 8.39604 5.05219 8.62531 4.95654C8.85457 4.86089 9.10712 4.83565 9.35078 4.88401C9.59445 4.93238 9.8182 5.05217 9.99356 5.22813C10.1689 5.40409 10.2879 5.62826 10.3355 5.87209C10.383 6.11592 10.3569 6.36838 10.2604 6.59731C10.164 6.82625 10.0016 7.0213 9.79392 7.15763C9.58626 7.29396 9.34271 7.36541 9.09431 7.36286C8.76647 7.3584 8.45337 7.22589 8.22193 6.99365C7.99049 6.76141 7.85906 6.44786 7.85574 6.12V6.12Z",p15ebc880:"M24.0214 6.12001C24.0206 5.8728 24.0932 5.63092 24.2301 5.42508C24.3671 5.21925 24.562 5.05874 24.7903 4.96394C25.0187 4.86915 25.27 4.84434 25.5124 4.89268C25.7549 4.94101 25.9775 5.06031 26.152 5.23541C26.3265 5.41051 26.445 5.63353 26.4925 5.87613C26.54 6.11873 26.5143 6.36998 26.4187 6.59796C26.3231 6.82594 26.162 7.02037 25.9557 7.15656C25.7493 7.29275 25.5072 7.36456 25.26 7.36286C24.9322 7.3584 24.6191 7.22589 24.3876 6.99365C24.1562 6.76141 24.0248 6.44786 24.0214 6.12001V6.12001Z",p2b03ee00:"M8.10429 8.32285V12.18V16.9371C8.10669 17.1819 8.0217 17.4196 7.86458 17.6073C7.70747 17.7951 7.48854 17.9206 7.24715 17.9614C7.10315 17.9823 6.95635 17.972 6.81668 17.9312C6.67701 17.8904 6.54774 17.8201 6.43761 17.725C6.32748 17.6299 6.23907 17.5123 6.17836 17.38C6.11765 17.2478 6.08605 17.1041 6.08572 16.9586V5.07857C6.08003 4.27269 6.39472 3.49756 6.96054 2.9237C7.52637 2.34984 8.29698 2.02425 9.10286 2.01857C9.90874 2.01289 10.6839 2.32757 11.2577 2.89339C11.8316 3.45922 12.1572 4.22983 12.1629 5.03571V7.36285H13.1571C13.4311 7.36285 13.6938 7.25404 13.8875 7.06034C14.0812 6.86664 14.19 6.60393 14.19 6.33V5.09571C14.198 3.7522 13.6719 2.46056 12.7275 1.50492C11.7831 0.549292 10.4978 0.00795366 9.15429 -2.83887e-06C7.81078 -0.00795933 6.51913 0.518118 5.5635 1.4625C4.60787 2.40688 4.06653 3.6922 4.05857 5.03571V16.8943C4.05576 17.2933 4.13157 17.689 4.28167 18.0587C4.43177 18.4285 4.65323 18.765 4.9334 19.0492C5.49922 19.623 6.26984 19.9486 7.07572 19.9543C7.8816 19.96 8.65673 19.6453 9.23059 19.0795C9.80445 18.5136 10.13 17.743 10.1357 16.9371V12.1586V9.35571C10.1357 9.08178 10.0269 8.81907 9.8332 8.62537C9.6395 8.43167 9.37679 8.32285 9.10286 8.32285H8.10429Z",p3000fb00:"M41.0914 11.4171C42.2357 11.6529 43.7314 12.2014 43.7143 13.8814C43.7333 14.2448 43.6594 14.607 43.4997 14.9339C43.34 15.2608 43.0997 15.5417 42.8014 15.75C42.1396 16.1967 41.3537 16.4232 40.5557 16.3971C38.94 16.3971 37.8386 15.7671 37.26 14.5286L38.3186 13.9286C38.4801 13.8361 38.6683 13.8014 38.8521 13.8302C39.036 13.8591 39.2046 13.9497 39.33 14.0871C39.4864 14.2527 39.6773 14.3818 39.889 14.4655C40.1008 14.5492 40.3284 14.5853 40.5557 14.5714C41.28 14.5714 41.64 14.3529 41.64 13.8943C41.64 13.4357 41.0143 13.2343 40.2129 13.0371C39.0472 12.7371 37.59 12.2486 37.59 10.6157C37.5775 10.2658 37.6488 9.91796 37.7979 9.60114C37.947 9.28433 38.1696 9.0077 38.4472 8.79429C38.844 8.5099 39.2946 8.3094 39.7715 8.20504C40.2484 8.10067 40.7416 8.09463 41.2209 8.18729C41.7002 8.27994 42.1556 8.46935 42.5593 8.74393C42.9629 9.01851 43.3063 9.37251 43.5686 9.78429L42.4714 10.3843C42.3194 10.466 42.1457 10.4983 41.9744 10.4768C41.8032 10.4553 41.6429 10.381 41.5157 10.2643C41.2621 10.0339 40.9281 9.91232 40.5857 9.92572C40.0671 9.92572 39.6729 10.1786 39.6729 10.5686C39.6729 10.9586 40.2857 11.2114 41.0914 11.4171Z",p3405fff0:"M12.1543 17.1686C11.9614 19.8172 9.75428 22.0029 7.17428 22.0029C5.81031 22.0029 4.5022 21.461 3.53773 20.4966C2.57325 19.5321 2.03142 18.224 2.03142 16.86V8.32715H1.03713C0.762807 8.32715 0.499653 8.43583 0.305274 8.62941C0.110895 8.82298 0.00112454 9.08569 -9.03731e-06 9.36001V16.8772C-0.00802475 18.7596 0.729489 20.5687 2.05134 21.909C3.37319 23.2494 5.17188 24.0119 7.05428 24.03C8.68543 24.0298 10.2681 23.4753 11.5428 22.4576C12.8175 21.4398 13.7086 20.0192 14.07 18.4286C14.1086 18.2757 14.1117 18.1161 14.079 17.9618C14.0464 17.8076 13.9789 17.6629 13.8817 17.5388C13.7844 17.4147 13.6601 17.3145 13.5182 17.2459C13.3763 17.1772 13.2205 17.142 13.0628 17.1429H12.1543V17.1686Z",p36679780:"M24.2571 15.1414V8.32286H25.2471C25.3828 8.32286 25.5171 8.34958 25.6424 8.40148C25.7677 8.45339 25.8816 8.52947 25.9775 8.62538C26.0734 8.72129 26.1495 8.83515 26.2014 8.96046C26.2533 9.08577 26.28 9.22008 26.28 9.35572V16.1743H25.2857C25.0125 16.1732 24.7509 16.0638 24.5581 15.8703C24.3654 15.6767 24.2571 15.4146 24.2571 15.1414V15.1414Z",p75f2980:"M20.3786 15.1414V5.89714C20.3786 5.76004 20.4058 5.62432 20.4588 5.49788C20.5118 5.37144 20.5894 5.2568 20.6871 5.16067C20.7849 5.06453 20.9008 4.98881 21.0281 4.93792C21.1553 4.88704 21.2915 4.862 21.4286 4.86428H22.4186V16.1743H21.4286C21.2915 16.1766 21.1553 16.1515 21.0281 16.1006C20.9008 16.0498 20.7849 15.974 20.6871 15.8779C20.5894 15.7818 20.5118 15.6671 20.4588 15.5407C20.4058 15.4142 20.3786 15.2785 20.3786 15.1414V15.1414Z",pb292700:"M35.4086 9.31285C36.1566 10.1046 36.5616 11.1597 36.5357 12.2486C36.562 13.3426 36.1572 14.4032 35.4086 15.2014C35.0701 15.5832 34.6534 15.8876 34.1867 16.094C33.7201 16.3003 33.2144 16.4037 32.7043 16.3971C32.2189 16.4239 31.7343 16.3336 31.2912 16.1337C30.8481 15.9337 30.4596 15.6302 30.1586 15.2486V19.6371H29.1686C28.8946 19.6371 28.6319 19.5283 28.4382 19.3346C28.2445 19.1409 28.1357 18.8782 28.1357 18.6043V8.31857H29.3314C29.4402 8.318 29.548 8.33901 29.6486 8.38037C29.7492 8.42174 29.8406 8.48264 29.9176 8.55957C29.9945 8.63649 30.0554 8.7279 30.0967 8.82851C30.1381 8.92912 30.1591 9.03693 30.1586 9.14571V9.24428C30.4606 8.864 30.8493 8.56165 31.2923 8.36255C31.7352 8.16346 32.2194 8.07343 32.7043 8.1C33.2156 8.09642 33.7218 8.20287 34.1884 8.41214C34.655 8.62141 35.0711 8.92859 35.4086 9.31285V9.31285ZM32.3271 14.4557C32.6145 14.465 32.9008 14.4155 33.1683 14.3101C33.4359 14.2047 33.679 14.0457 33.8828 13.8429C34.0917 13.6329 34.2554 13.3823 34.3638 13.1067C34.4721 12.831 34.5229 12.536 34.5128 12.24C34.5244 11.9463 34.4743 11.6535 34.3658 11.3804C34.2573 11.1073 34.0928 10.86 33.8828 10.6543C33.4656 10.2505 32.9077 10.0248 32.3271 10.0248C31.7465 10.0248 31.1887 10.2505 30.7714 10.6543C30.5665 10.8628 30.4064 11.1111 30.301 11.3838C30.1956 11.6565 30.1471 11.9479 30.1586 12.24C30.1495 12.5344 30.199 12.8278 30.3042 13.1029C30.4094 13.3781 30.5682 13.6296 30.7714 13.8429C30.9757 14.0456 31.2187 14.2051 31.486 14.3119C31.7533 14.4187 32.0394 14.4705 32.3271 14.4643V14.4557Z"};function Ys({variant:t="full",mode:e="positive",className:n,...r}){return t==="symbol"?l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo Símbolo",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 22 36",preserveAspectRatio:"xMidYMid meet",children:[l.jsx("path",{d:Mu.p9466600,fill:"#E62EA8",transform:"translate(0.37, 0.02)"}),l.jsx("path",{d:Mu.p395de780,fill:"#E62EA8",transform:"translate(11.65, 7.32)"})]})}):e==="positive"?l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 123 67",preserveAspectRatio:"xMidYMid meet",children:[l.jsxs("g",{clipPath:"url(#clip0_positive)",children:[l.jsxs("g",{id:"Group_Positive",children:[l.jsx("path",{d:pn.p38a74f0,fill:"#E52EA8"}),l.jsx("path",{d:pn.p35662200,fill:"#E52EA8"}),l.jsx("path",{d:pn.p1cdcfe80,fill:"#E52EA8"})]}),l.jsx("path",{d:pn.pf48a00,fill:"#5B158C"}),l.jsx("path",{d:pn.pe814d80,fill:"#5B158C"}),l.jsx("path",{d:pn.p3838afa0,fill:"#5B158C"}),l.jsx("path",{d:pn.p2d489f00,fill:"#5B158C"}),l.jsx("path",{d:pn.p2cb5a300,fill:"#5B158C"}),l.jsx("path",{d:pn.p344a5f80,fill:"#5B158C"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_positive",children:l.jsx("rect",{width:"122.201",height:"67",fill:"white"})})})]})}):l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo Negative",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 44 24",preserveAspectRatio:"xMidYMid meet",children:[l.jsxs("g",{clipPath:"url(#clip0_negative)",children:[l.jsxs("g",{id:"Group_Negative",children:[l.jsx("path",{d:mn.p3405fff0,fill:"#E52EA8"}),l.jsx("path",{d:mn.p2b03ee00,fill:"#E52EA8"}),l.jsx("path",{d:mn.p128e2c00,fill:"#E52EA8"})]}),l.jsx("path",{d:mn.p12652a00,fill:"white"}),l.jsx("path",{d:mn.p75f2980,fill:"white"}),l.jsx("path",{d:mn.p36679780,fill:"white"}),l.jsx("path",{d:mn.p15ebc880,fill:"white"}),l.jsx("path",{d:mn.pb292700,fill:"white"}),l.jsx("path",{d:mn.p3000fb00,fill:"white"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_negative",children:l.jsx("rect",{width:"43.7143",height:"24",fill:"white"})})})]})})}function Hi({...t}){return l.jsx(Ge.Root,{"data-slot":"dropdown-menu",...t})}function Yy({...t}){return l.jsx(Ge.Portal,{"data-slot":"dropdown-menu-portal",...t})}function Fi({...t}){return l.jsx(Ge.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Ui({className:t,sideOffset:e=4,...n}){return l.jsx(Ge.Portal,{children:l.jsx(Ge.Content,{"data-slot":"dropdown-menu-content",sideOffset:e,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function I0({...t}){return l.jsx(Ge.Group,{"data-slot":"dropdown-menu-group",...t})}function gr({className:t,inset:e,variant:n="default",...r}){return l.jsx(Ge.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:w("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function Qy({className:t,children:e,checked:n,...r}){return l.jsxs(Ge.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Ge.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function Wy({...t}){return l.jsx(Ge.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function $y({className:t,children:e,...n}){return l.jsxs(Ge.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Ge.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function D0({className:t,inset:e,...n}){return l.jsx(Ge.Label,{"data-slot":"dropdown-menu-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8",t),...n})}function Qs({className:t,...e}){return l.jsx(Ge.Separator,{"data-slot":"dropdown-menu-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function Zy({className:t,...e}){return l.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:w("text-muted-foreground ml-auto text-xs tracking-widest",t),...e})}function qy({...t}){return l.jsx(Ge.Sub,{"data-slot":"dropdown-menu-sub",...t})}function Ky({className:t,inset:e,children:n,...r}){return l.jsxs(Ge.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",t),...r,children:[n,l.jsx(k.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Xy({className:t,...e}){return l.jsx(Ge.SubContent,{"data-slot":"dropdown-menu-sub-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...e})}const ev=$t.cva("flex size-full items-center justify-center rounded-full text-base font-semibold bg-muted",{variants:{colorVariant:{gray:"bg-gray-100 text-gray-500",pink:"bg-pink-100 text-pink-500",purple:"bg-purple-100 text-purple-500",blue:"bg-blue-100 text-blue-500",cyan:"bg-cyan-100 text-cyan-500",teal:"bg-teal-100 text-teal-500",green:"bg-green-100 text-green-500",yellow:"bg-yellow-100 text-yellow-600",orange:"bg-orange-100 text-orange-500",red:"bg-red-100 text-red-500"}}}),Ft=I.forwardRef(({className:t,...e},n)=>l.jsx(Ca.Root,{ref:n,"data-slot":"avatar",className:w("relative flex size-10 shrink-0 overflow-hidden rounded-full",t),...e}));Ft.displayName=Ca.Root.displayName;const Ln=I.forwardRef(({className:t,...e},n)=>l.jsx(Ca.Image,{ref:n,"data-slot":"avatar-image",className:w("aspect-square size-full",t),...e}));Ln.displayName=Ca.Image.displayName;const Ut=I.forwardRef(({className:t,colorVariant:e,...n},r)=>l.jsx(Ca.Fallback,{ref:r,"data-slot":"avatar-fallback",className:w(ev({colorVariant:e}),t),...n}));Ut.displayName=Ca.Fallback.displayName;const tv=[{label:"Perfil",icon:k.User,onClick:()=>console.log("Perfil clicked")},{label:"Configurações",icon:k.Settings,onClick:()=>console.log("Configurações clicked")},{label:"Ajuda",icon:k.HelpCircle,onClick:()=>console.log("Ajuda clicked")}],ju={label:"Sair",onClick:()=>console.log("Logout clicked")};function E0({user:t,menuItems:e=tv,onLogout:n,expanded:r=!0,className:a}){const i=t.initials||t.name.split(" ").map(s=>s[0]).slice(0,2).join("").toUpperCase();return l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsxs("button",{className:w("flex w-full items-center gap-3 rounded-lg p-2 transition-colors hover:bg-accent",a),children:[l.jsxs(Ft,{className:"h-8 w-8",children:[l.jsx(Ln,{src:t.avatar,alt:t.name}),l.jsx(Ut,{className:"bg-primary text-primary-foreground text-xs",children:i})]}),r&&l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-start overflow-hidden",children:[l.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.email&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.email})]})]})}),l.jsxs(Ui,{className:"w-56",align:"end",side:"right",children:[l.jsx(D0,{children:l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsx("p",{className:"text-sm font-medium leading-none",children:t.name}),t.email&&l.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t.email})]})}),l.jsx(Qs,{}),l.jsx(I0,{children:e.map((s,o)=>{const f=s.icon;return l.jsxs(gr,{onClick:s.onClick,className:w(s.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[l.jsx(f,{className:"mr-2 h-4 w-4"}),l.jsx("span",{children:s.label})]},o)})}),l.jsx(Qs,{}),l.jsxs(gr,{onClick:n??ju.onClick,className:"text-destructive focus:text-destructive",children:[l.jsx(k.LogOut,{className:"mr-2 h-4 w-4"}),l.jsx("span",{children:ju.label})]})]})]})}function nv({items:t,activeItem:e,onItemClick:n,logoComponent:r,user:a,userMenuItems:i,onLogout:s,defaultPinned:o=!1,className:f}){const[c,d]=I.useState(o),[u,p]=I.useState(!1),[h,m]=I.useState([]),g=c||u,b=v=>{m(j=>j.includes(v)?j.filter(y=>y!==v):[...j,v])},x=(v,j)=>{j?b(v):n==null||n(v)};return l.jsxs("div",{className:w("relative flex h-screen flex-col transition-all duration-200",g?"w-56":"w-16",f),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[l.jsx("div",{className:"flex h-16 min-h-16 items-center px-2",children:g?l.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between overflow-hidden",children:[r||l.jsx(Ys,{variant:"full",className:"h-8 w-auto"}),l.jsx("button",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-accent",onClick:()=>d(!c),children:l.jsx(k.Pin,{className:w("h-3.5 w-3.5",c?"fill-primary text-primary":"text-muted-foreground")})})]}):l.jsx("div",{className:"flex w-full justify-center",children:r||l.jsx(Ys,{variant:"symbol",className:"h-8 w-8"})})}),l.jsx(Wo,{className:"flex-1",children:l.jsx("nav",{className:"space-y-1 py-3 px-2",children:t.map(v=>{var N;const j=v.icon,y=v.children&&v.children.length>0,L=h.includes(v.id),C=e===v.id||((N=v.children)==null?void 0:N.some(S=>S.id===e));return l.jsxs("div",{className:w(!g&&"flex justify-center"),children:[l.jsxs("button",{onClick:()=>x(v.id,!!y),className:w("flex items-center rounded-lg text-sm transition-colors",g?"w-full gap-3 px-3 py-2":"w-10 h-10 justify-center shrink-0",C?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(j,{className:"h-4 w-4 shrink-0"}),g&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"flex-1 text-left",children:v.label}),y&&l.jsx(k.ChevronDown,{className:w("h-4 w-4 transition-transform",L&&"rotate-180")})]})]}),y&&L&&g&&l.jsx("div",{className:"ml-4 mt-1 space-y-1 border-l pl-2",children:v.children.map(S=>{const T=S.icon,z=e===S.id;return l.jsxs("button",{onClick:()=>n==null?void 0:n(S.id),className:w("flex w-full items-center gap-2 rounded px-3 py-1.5 text-sm transition-colors",z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[T&&l.jsx(T,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:S.label})]},S.id)})})]},v.id)})})}),a&&l.jsx("div",{className:"py-3 px-2",children:l.jsx(E0,{user:a,menuItems:i,onLogout:s,expanded:g})})]})}function rv({title:t="Menu",groups:e,activeItemLabel:n,items:r,onAddClick:a,footerContent:i,className:s,collapsed:o,onCollapsedChange:f,collapsible:c=!1,defaultCollapsed:d=!1}){const[u,p]=I.useState([]),[h,m]=I.useState(d),g=o!==void 0?o:h,b=()=>{const j=!g;m(j),f==null||f(j)},x=j=>{p(y=>y.includes(j)?y.filter(L=>L!==j):[...y,j])},v=j=>j.map((y,L)=>{const C=y.icon,N=y.active||n&&y.label===n;return l.jsxs("button",{onClick:y.onClick,className:w("flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all relative",N?"bg-accent text-foreground font-semibold border-l-2 border-l-primary":y.highlighted?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[l.jsx(C,{className:w("h-4 w-4 shrink-0 transition-colors",N&&"text-primary")}),l.jsx("span",{className:w("flex-1 text-left"),children:y.label}),y.badge&&l.jsx(pe,{variant:"secondary",className:w("min-w-5 px-1.5 text-xs",N&&"bg-primary/10 text-primary font-medium"),children:y.badge}),y.chevron&&l.jsx(k.ChevronRight,{className:"h-3 w-3"})]},L)});return l.jsxs("div",{className:w("flex flex-col bg-background transition-all duration-300 rounded-lg my-2 ml-2",g?"w-0 overflow-hidden border-0":"w-64 border",s),style:{height:"calc(100% - 1rem)"},children:[l.jsxs("div",{className:"flex h-16 min-h-16 items-center justify-between px-4",children:[l.jsx("h2",{className:"text-sm font-semibold truncate",children:t}),l.jsxs("div",{className:"flex items-center gap-1",children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0",onClick:a,children:l.jsx(k.Plus,{className:"h-4 w-4"})}),c&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0",onClick:b,title:g?"Expandir menu":"Recolher menu",children:l.jsx(k.ChevronRight,{className:w("h-4 w-4 transition-transform",!g&&"rotate-180")})})]})]}),l.jsx(Wo,{className:"flex-1",children:l.jsxs("div",{className:"p-3 space-y-4",children:[e&&e.map(j=>{const y=u.includes(j.title);return l.jsxs("div",{className:"space-y-1",children:[j.collapsible?l.jsxs("button",{onClick:()=>x(j.title),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(k.ChevronDown,{className:w("h-3 w-3 transition-transform",y&&"-rotate-90")}),j.title]}):l.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:j.title}),!y&&l.jsx("div",{className:"space-y-0.5",children:v(j.items)})]},j.title)}),r&&!e&&l.jsx("div",{className:"space-y-0.5",children:v(r)})]})}),i&&l.jsx("div",{className:"p-4",children:i})]})}function av({...t}){return l.jsx(Dx.Root,{"data-slot":"aspect-ratio",...t})}const Cu=$t.cva("min-h-screen w-full",{variants:{variant:{centered:"flex items-center justify-center bg-background p-4",split:"grid lg:grid-cols-2"}},defaultVariants:{variant:"centered"}}),A0=I.forwardRef(({variant:t="centered",children:e,logo:n,title:r,description:a,image:i,imageAlt:s="Authentication",footerLinks:o,formClassName:f},c)=>{const d=t==="split",u=()=>l.jsxs("div",{className:w("flex flex-col gap-6",d?"min-h-screen justify-center px-8 py-12 lg:px-16":"w-full max-w-md"),children:[l.jsx("div",{className:w("flex justify-center",d&&"lg:justify-start"),children:n||l.jsx(Ys,{className:"w-32 h-auto"})}),(r||a)&&l.jsxs("div",{className:"space-y-2 text-center lg:text-left",children:[r&&l.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r}),a&&l.jsx("p",{className:"text-sm text-muted-foreground",children:a})]}),l.jsx("div",{className:w("space-y-6",f),children:e}),o&&o.length>0&&l.jsx("div",{className:"flex flex-wrap items-center justify-center gap-4 text-sm text-muted-foreground lg:justify-start",children:o.map((h,m)=>l.jsxs(I.Fragment,{children:[l.jsx("a",{href:h.href,className:"hover:text-foreground transition-colors",children:h.label}),m<o.length-1&&l.jsx("span",{className:"text-muted-foreground/50",children:"•"})]},h.href))})]}),p=()=>!d||!i?null:l.jsxs("div",{className:"relative hidden lg:block bg-muted",children:[typeof i=="string"?l.jsx("img",{src:i,alt:s,className:"absolute inset-0 h-full w-full object-cover"}):l.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-12",children:i}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/10 via-transparent to-transparent"})]});return t==="split"?l.jsxs("div",{ref:c,className:w(Cu({variant:t})),children:[l.jsx(u,{}),l.jsx(p,{})]}):l.jsx("div",{ref:c,className:w(Cu({variant:t})),children:l.jsx(u,{})})});A0.displayName="AuthLayout";function z0({...t}){return l.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function O0({className:t,...e}){return l.jsx("ol",{"data-slot":"breadcrumb-list",className:w("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...e})}function P0({className:t,...e}){return l.jsx("li",{"data-slot":"breadcrumb-item",className:w("inline-flex items-center gap-1.5",t),...e})}function R0({asChild:t,className:e,...n}){const r=t?kn.Slot:"a";return l.jsx(r,{"data-slot":"breadcrumb-link",className:w("hover:text-foreground transition-colors",e),...n})}function B0({className:t,...e}){return l.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:w("text-foreground font-normal",t),...e})}function H0({children:t,className:e,...n}){return l.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:w("[&>svg]:size-3.5",e),...n,children:t??l.jsx(k.ChevronRight,{})})}function iv({className:t,...e}){return l.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:w("flex size-9 items-center justify-center",t),...e,children:[l.jsx(k.MoreHorizontal,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"More"})]})}const F0=I.createContext(null);function $o(){const t=I.useContext(F0);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function sv({orientation:t="horizontal",opts:e,setApi:n,plugins:r,className:a,children:i,...s}){const[o,f]=fx({...e,axis:t==="horizontal"?"x":"y"},r),[c,d]=I.useState(!1),[u,p]=I.useState(!1),h=I.useCallback(x=>{x&&(d(x.canScrollPrev()),p(x.canScrollNext()))},[]),m=I.useCallback(()=>{f==null||f.scrollPrev()},[f]),g=I.useCallback(()=>{f==null||f.scrollNext()},[f]),b=I.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),m()):x.key==="ArrowRight"&&(x.preventDefault(),g())},[m,g]);return I.useEffect(()=>{!f||!n||n(f)},[f,n]),I.useEffect(()=>{if(f)return h(f),f.on("reInit",h),f.on("select",h),()=>{f==null||f.off("select",h)}},[f,h]),l.jsx(F0.Provider,{value:{carouselRef:o,api:f,opts:e,orientation:t||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:g,canScrollPrev:c,canScrollNext:u},children:l.jsx("div",{onKeyDownCapture:b,className:w("relative",a),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...s,children:i})})}function ov({className:t,...e}){const{carouselRef:n,orientation:r}=$o();return l.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:l.jsx("div",{className:w("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...e})})}function lv({className:t,...e}){const{orientation:n}=$o();return l.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:w("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",t),...e})}function fv({className:t,variant:e="outline",size:n="icon",...r}){const{orientation:a,scrollPrev:i,canScrollPrev:s}=$o();return l.jsxs(F,{"data-slot":"carousel-previous",variant:e,size:n,className:w("absolute size-8 rounded-full",a==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!s,onClick:i,...r,children:[l.jsx(k.ArrowLeft,{}),l.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function cv({className:t,variant:e="outline",size:n="icon",...r}){const{orientation:a,scrollNext:i,canScrollNext:s}=$o();return l.jsxs(F,{"data-slot":"carousel-next",variant:e,size:n,className:w("absolute size-8 rounded-full",a==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!s,onClick:i,...r,children:[l.jsx(k.ArrowRight,{}),l.jsx("span",{className:"sr-only",children:"Next slide"})]})}const dv={light:"",dark:".dark"},U0=I.createContext(null);function _0(){const t=I.useContext(U0);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}function uv({id:t,className:e,children:n,config:r,...a}){const i=I.useId(),s=`chart-${t||i.replace(/:/g,"")}`;return l.jsx(U0.Provider,{value:{config:r},children:l.jsxs("div",{"data-slot":"chart","data-chart":s,className:w("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",e),...a,children:[l.jsx(hv,{id:s,config:r}),l.jsx(Cc.ResponsiveContainer,{children:n})]})})}const hv=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?l.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(dv).map(([r,a])=>`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Z4=require("@radix-ui/react-accordion"),k=require("lucide-react"),q4=require("clsx"),K4=require("tailwind-merge"),M=require("react"),kn=require("@radix-ui/react-slot"),$t=require("class-variance-authority"),X4=require("@radix-ui/react-select"),ex=require("@radix-ui/react-popover"),tx=require("@radix-ui/react-checkbox"),nx=require("@radix-ui/react-label"),H=require("date-fns"),rx=require("react-day-picker"),ax=require("@radix-ui/react-alert-dialog"),ix=require("@radix-ui/react-scroll-area"),sx=require("@radix-ui/react-dropdown-menu"),ox=require("@radix-ui/react-avatar"),lx=require("@radix-ui/react-aspect-ratio"),fx=require("embla-carousel-react"),cx=require("recharts"),dx=require("@radix-ui/react-collapsible"),ux=require("react-colorful"),Dr=require("cmdk"),hx=require("@radix-ui/react-dialog"),px=require("@radix-ui/react-tooltip"),mx=require("@radix-ui/react-separator"),c0=require("react-dom"),d0=require("use-sync-external-store/shim/index.js"),gx=require("use-sync-external-store/shim/with-selector.js"),bx=require("@radix-ui/react-context-menu"),xx=require("@radix-ui/react-toggle"),Kn=require("vaul"),yx=require("@radix-ui/react-tabs"),Vs=require("react-hook-form"),vx=require("@radix-ui/react-hover-card"),u0=require("input-otp"),wx=require("@radix-ui/react-progress"),Mx=require("@radix-ui/react-menubar"),jx=require("@radix-ui/react-navigation-menu"),Cx=require("@radix-ui/react-radio-group"),Lx=require("react-resizable-panels"),Nx=require("@radix-ui/react-slider"),kx=require("@radix-ui/react-switch"),Sx=require("next-themes"),h0=require("sonner"),Tx=require("@radix-ui/react-toggle-group");function ge(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const pi=ge(Z4),I=ge(M),ot=ge(X4),Wn=ge(ex),mu=ge(tx),Ix=ge(nx),dn=ge(ax),Za=ge(ix),Ge=ge(sx),Ca=ge(ox),Dx=ge(lx),Cc=ge(cx),Lc=ge(dx),Ae=ge(hx),aa=ge(px),Ex=ge(mx),Ye=ge(bx),Ax=ge(xx),Yo=ge(yx),Gs=ge(vx),gu=ge(wx),Qe=ge(Mx),Er=ge(jx),Nf=ge(Cx),Nc=ge(Lx),hs=ge(Nx),bu=ge(kx),p0=ge(Tx);function w(...t){return K4.twMerge(q4.clsx(t))}function zx({...t}){return l.jsx(pi.Root,{"data-slot":"accordion",...t})}function Ox({className:t,...e}){return l.jsx(pi.Item,{"data-slot":"accordion-item",className:w("border-b last:border-b-0",t),...e})}function Px({className:t,children:e,...n}){return l.jsx(pi.Header,{className:"flex",children:l.jsxs(pi.Trigger,{"data-slot":"accordion-trigger",className:w("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-semibold transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,l.jsx(k.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Rx({className:t,children:e,...n}){return l.jsx(pi.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:l.jsx("div",{className:w("pt-0 pb-4",t),children:e})})}function jr({className:t,...e}){return l.jsx("div",{"data-slot":"card",className:w("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",t),...e})}function la({className:t,...e}){return l.jsx("div",{"data-slot":"card-header",className:w("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...e})}function fa({className:t,...e}){return l.jsx("h4",{"data-slot":"card-title",className:w("font-semibold leading-[1.2]",t),...e})}function m0({className:t,...e}){return l.jsx("p",{"data-slot":"card-description",className:w("text-muted-foreground leading-relaxed",t),...e})}function Bx({className:t,...e}){return l.jsx("div",{"data-slot":"card-action",className:w("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...e})}function ca({className:t,...e}){return l.jsx("div",{"data-slot":"card-content",className:w("px-6 [&:last-child]:pb-6",t),...e})}function g0({className:t,...e}){return l.jsx("div",{"data-slot":"card-footer",className:w("flex items-center px-6 pb-6 [.border-t]:pt-6",t),...e})}const kc=I.forwardRef(({className:t,...e},n)=>l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:l.jsx("table",{ref:n,"data-slot":"table",className:w("w-full caption-bottom text-sm",t),...e})}));kc.displayName="Table";const Sc=I.forwardRef(({className:t,...e},n)=>l.jsx("thead",{ref:n,"data-slot":"table-header",className:w("[&_tr]:border-b",t),...e}));Sc.displayName="TableHeader";const Tc=I.forwardRef(({className:t,...e},n)=>l.jsx("tbody",{ref:n,"data-slot":"table-body",className:w("[&_tr:last-child]:border-0",t),...e}));Tc.displayName="TableBody";const b0=I.forwardRef(({className:t,...e},n)=>l.jsx("tfoot",{ref:n,"data-slot":"table-footer",className:w("bg-muted/50 border-t font-semibold [&>tr]:last:border-b-0",t),...e}));b0.displayName="TableFooter";const na=I.forwardRef(({className:t,...e},n)=>l.jsx("tr",{ref:n,"data-slot":"table-row",className:w("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...e}));na.displayName="TableRow";const Ic=I.forwardRef(({className:t,...e},n)=>l.jsx("th",{ref:n,"data-slot":"table-head",className:w("text-foreground h-10 px-2 text-left align-middle font-semibold","[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Ic.displayName="TableHead";const qa=I.forwardRef(({className:t,...e},n)=>l.jsx("td",{ref:n,"data-slot":"table-cell",className:w("p-2 align-middle","[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));qa.displayName="TableCell";const x0=I.forwardRef(({className:t,...e},n)=>l.jsx("caption",{ref:n,"data-slot":"table-caption",className:w("text-muted-foreground mt-4 text-sm leading-relaxed",t),...e}));x0.displayName="TableCaption";const Jn=$t.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive active:scale-[0.97]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",destructive:"bg-destructive text-white hover:bg-destructive/90 active:bg-destructive/80 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground active:bg-accent/70 dark:bg-input/30 dark:border-input dark:hover:bg-input/50 dark:active:bg-input/70",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 active:bg-secondary/70",ghost:"hover:bg-accent hover:text-accent-foreground active:bg-accent/70 dark:hover:bg-accent/50 dark:active:bg-accent/40",link:"text-primary underline-offset-4 hover:underline active:opacity-70",success:"bg-green-600 text-white hover:bg-green-700 active:bg-green-800 focus-visible:ring-green-600/20 dark:bg-green-700 dark:hover:bg-green-600 dark:active:bg-green-500"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),F=I.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,isLoading:a=!1,children:i,disabled:s,...o},f)=>{const c=r?kn.Slot:"button";return l.jsx(c,{"data-slot":"button",className:w(Jn({variant:e,size:n,className:t})),ref:f,disabled:s||a,"aria-busy":a||void 0,...o,children:r?i:l.jsxs(l.Fragment,{children:[a&&l.jsx(k.Loader2,{className:"animate-spin","aria-hidden":"true"}),i]})})});F.displayName="Button";function en({...t}){return l.jsx(ot.Root,{"data-slot":"select",...t})}function Hx({...t}){return l.jsx(ot.Group,{"data-slot":"select-group",...t})}function tn({...t}){return l.jsx(ot.Value,{"data-slot":"select-value",...t})}function nn({className:t,size:e="default",children:n,...r}){return l.jsxs(ot.Trigger,{"data-slot":"select-trigger","data-size":e,className:w("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[n,l.jsx(ot.Icon,{asChild:!0,children:l.jsx(k.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function rn({className:t,children:e,position:n="popper",...r}){return l.jsx(ot.Portal,{children:l.jsxs(ot.Content,{"data-slot":"select-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[l.jsx(_x,{}),l.jsx(ot.Viewport,{className:w("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:e}),l.jsx(Jx,{})]})})}function Fx({className:t,...e}){return l.jsx(ot.Label,{"data-slot":"select-label",className:w("text-muted-foreground px-2 py-1.5 text-xs font-semibold",t),...e})}function Dt({className:t,children:e,...n}){return l.jsxs(ot.Item,{"data-slot":"select-item",className:w("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(ot.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),l.jsx(ot.ItemText,{children:e})]})}function Ux({className:t,...e}){return l.jsx(ot.Separator,{"data-slot":"select-separator",className:w("bg-border pointer-events-none -mx-1 my-1 h-px",t),...e})}function _x({className:t,...e}){return l.jsx(ot.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:w("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(k.ChevronUpIcon,{className:"size-4"})})}function Jx({className:t,...e}){return l.jsx(ot.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:w("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(k.ChevronDownIcon,{className:"size-4"})})}const Vx={previous:"Anterior",next:"Próxima",first:"Primeira",last:"Última",showing:"Mostrando",of:"de",results:"resultados",itemsPerPage:"Itens por página",page:"Página"},Gx=[10,20,30,50,100];function y0(t,e,n=5){if(e<=n)return Array.from({length:e},(o,f)=>f+1);const r=[],a=Math.floor(n/2);r.push(1);let i=Math.max(2,t-a),s=Math.min(e-1,t+a);t<=a+1?s=n-1:t>=e-a&&(i=e-n+2),i>2&&r.push("ellipsis");for(let o=i;o<=s;o++)r.push(o);return s<e-1&&r.push("ellipsis"),e>1&&r.push(e),r}function Dc({currentPage:t,totalPages:e,pageSize:n,totalItems:r,onPageChange:a,onPageSizeChange:i,pageSizeOptions:s=Gx,maxVisiblePages:o=5,showInfo:f=!0,showPageNumbers:c=!0,showPageSizeSelector:d=!0,showFirstLastButtons:u=!0,labels:p,className:h}){const m={...Vx,...p},g=y0(t,e,o),b=(t-1)*n+1,x=Math.min(t*n,r),v=t>1,j=t<e;return e===0?null:l.jsxs("div",{className:w("flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",h),role:"navigation","aria-label":"Paginação da tabela",children:[f&&l.jsxs("p",{className:"text-sm text-muted-foreground order-2 sm:order-1",children:[m.showing," ",l.jsx("span",{className:"font-medium text-foreground",children:b})," - ",l.jsx("span",{className:"font-medium text-foreground",children:x})," ",m.of," ",l.jsx("span",{className:"font-medium text-foreground",children:r})," ",m.results]}),l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4 order-1 sm:order-2",children:[d&&i&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:m.itemsPerPage}),l.jsxs(en,{value:String(n),onValueChange:y=>i(Number(y)),children:[l.jsx(nn,{className:"h-8 w-[70px]",children:l.jsx(tn,{placeholder:n})}),l.jsx(rn,{children:s.map(y=>l.jsx(Dt,{value:String(y),children:y},y))})]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground sm:hidden",children:[m.page," ",t," ",m.of," ",e]}),l.jsxs("div",{className:"flex items-center gap-1",children:[u&&l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(1),disabled:!v,"aria-label":m.first,children:l.jsx(k.ChevronsLeft,{className:"h-4 w-4"})}),l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(t-1),disabled:!v,"aria-label":m.previous,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),c&&l.jsx("div",{className:"hidden sm:flex items-center gap-1",children:g.map((y,L)=>y==="ellipsis"?l.jsx("span",{className:"flex items-center justify-center w-8 h-8 text-muted-foreground","aria-hidden":!0,children:"..."},`ellipsis-${L}`):l.jsx(F,{variant:t===y?"default":"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(y),"aria-label":`${m.page} ${y}`,"aria-current":t===y?"page":void 0,children:y},y))}),l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(t+1),disabled:!j,"aria-label":m.next,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})}),u&&l.jsx(F,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>a(e),disabled:!j,"aria-label":m.last,children:l.jsx(k.ChevronsRight,{className:"h-4 w-4"})})]})]})]})}Dc.displayName="TablePagination";function Ht({className:t,type:e,...n}){return l.jsx("input",{type:e,"data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow,border-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function Bn({className:t,variant:e="pulse",...n}){return l.jsx("div",{"data-slot":"skeleton",className:w("rounded-md",e==="shimmer"?"skeleton-shimmer":"bg-accent animate-pulse",t),...n})}const Yx={"first-use":"bg-primary/8 text-primary",cleared:"bg-success/10 text-success","no-results":"bg-muted text-muted-foreground",error:"bg-destructive/10 text-destructive"};function kf({icon:t,illustration:e,title:n,description:r,variant:a="first-use",primaryAction:i,secondaryAction:s,className:o}){return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-4 py-12 px-6 text-center",o),role:"status","aria-live":"polite",children:[e?l.jsx("img",{src:e,alt:"",className:"w-32 h-32 object-contain","aria-hidden":"true"}):t?l.jsx("div",{className:w("flex size-16 items-center justify-center rounded-2xl",Yx[a]),"aria-hidden":"true",children:l.jsx(t,{className:"size-8"})}):null,l.jsxs("div",{className:"max-w-sm space-y-1.5",children:[l.jsx("h3",{className:"text-base font-semibold leading-snug text-foreground",children:n}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:r})]}),(i||s)&&l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 pt-1",children:[i&&l.jsx(F,{variant:i.variant??"default",onClick:i.onClick,children:i.label}),s&&l.jsx(F,{variant:s.variant??"outline",onClick:s.onClick,children:s.label})]})]})}function v0(t){const{currentPage:e,pageSize:n,totalItems:r}=t,a=Math.ceil(r/n),i=(e-1)*n,s=Math.min(i+n,r);return{totalPages:a,startIndex:i,endIndex:s,hasNextPage:e<a,hasPreviousPage:e>1}}function Qx({data:t,initialPageSize:e=10,resetOnDataChange:n=!0,serverSideTotalItems:r}){const[a,i]=M.useState(1),[s,o]=M.useState(e),f=r!==void 0,c=f?r:t.length;M.useMemo(()=>{n&&i(1)},[t.length,n]);const d=Math.ceil(c/s),u=Math.min(Math.max(1,a),Math.max(1,d)),p=(u-1)*s,h=Math.min(p+s,c),m=M.useMemo(()=>f?t:t.slice(p,h),[t,p,h,f]),g=L=>{const C=Math.max(1,Math.min(L,d));i(C)},b=()=>{a<d&&i(L=>L+1)},x=()=>{a>1&&i(L=>L-1)},v=L=>{o(L),i(1)},j={currentPage:u,pageSize:s,totalItems:c,onPageChange:g,onPageSizeChange:v},y=v0(j);return{currentPage:u,pageSize:s,totalItems:c,totalPages:d,paginatedData:m,goToPage:g,nextPage:b,prevPage:x,setPageSize:v,paginationConfig:j,metadata:y}}function Wx({data:t,initialSort:e={column:null,direction:null},initialPageSize:n=10,enablePagination:r=!0,serverMode:a=!1,totalItems:i,serverCurrentPage:s,serverCurrentPageSize:o}){const[f,c]=M.useState(e),[d,u]=M.useState([]),p=M.useMemo(()=>a||d.length===0?t:t.filter(C=>d.every(N=>{const S=C[N.column];switch(N.operator){case"equals":return S==N.value;case"contains":return String(S).toLowerCase().includes(String(N.value).toLowerCase());case"startsWith":return String(S).toLowerCase().startsWith(String(N.value).toLowerCase());case"greaterThan":return S>N.value;case"greaterThanOrEqual":return S>=N.value;case"lessThan":return S<N.value;case"lessThanOrEqual":return S<=N.value;default:return!0}})),[t,d,a]),h=M.useMemo(()=>a||!f.column||!f.direction?p:[...p].sort((C,N)=>{const S=C[f.column],T=N[f.column];return S<T?f.direction==="asc"?-1:1:S>T?f.direction==="asc"?1:-1:0}),[p,f,a]),m=a?i??t.length:h.length,g=Qx({data:a?t:h,initialPageSize:n,resetOnDataChange:!0,serverSideTotalItems:a?m:void 0});M.useEffect(()=>{a&&(s!==void 0&&s!==g.currentPage&&g.goToPage(s),o!==void 0&&o!==g.pageSize&&g.setPageSize(o))},[a,s,o,g]);const b=C=>{c(N=>{if(N.column===C){if(N.direction==="asc")return{column:C,direction:"desc"};if(N.direction==="desc")return{column:null,direction:null}}return{column:C,direction:"asc"}})},x=(C,N,S="contains")=>{u(T=>{const z=T.filter(P=>P.column!==C);return N===""||N===null||N===void 0?z:[...z,{column:C,operator:S,value:N}]})},v=C=>{u(N=>N.filter(S=>S.column!==C))},j=C=>f.column===C?f.direction:null,y=a?t:r?g.paginatedData:h,L=a&&(s!==void 0||o!==void 0)?{...g.paginationConfig,currentPage:s??g.paginationConfig.currentPage,pageSize:o??g.paginationConfig.pageSize}:g.paginationConfig;return{data:y,state:{sort:f,filters:d,pagination:L},handlers:{onSort:b,setFilter:x,removeFilter:v,clearFilters:()=>u([])},getSortDirection:j}}const w0=$t.cva("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),pe=I.forwardRef(({className:t,variant:e,asChild:n=!1,...r},a)=>{const i=n?kn.Slot:"span";return l.jsx(i,{ref:a,"data-slot":"badge",className:w(w0({variant:e}),t),...r})});pe.displayName="Badge";function M0({label:t,value:e,onRemove:n,className:r}){return l.jsxs(pe,{variant:"secondary",className:w("gap-1 pr-1 pl-2 h-7",n&&"pr-1",r),children:[l.jsxs("span",{className:"text-sm",children:[t,e&&l.jsxs(l.Fragment,{children:[": ",l.jsx("span",{className:"font-semibold",children:e})]})]}),n&&l.jsx("button",{type:"button",onClick:n,className:"ml-1 rounded-sm hover:bg-muted p-0.5 transition-colors","aria-label":`Remove ${t} filter`,children:l.jsx(k.X,{className:"h-3 w-3"})})]})}function j0({activeFilters:t=[],onClearAll:e,onOpenFilters:n,className:r,children:a}){const i=t.length>0;return l.jsxs("div",{className:w("flex items-center gap-2 flex-wrap",r),children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:n,className:"gap-2",children:[l.jsx(k.Filter,{className:"h-4 w-4"}),"Filtros",i&&l.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground w-5 h-5 text-xs flex items-center justify-center",children:t.length})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-4 w-px bg-border"}),t.map(s=>l.jsx(M0,{label:s.label,value:s.value,onRemove:s.onRemove},s.id)),l.jsxs(F,{variant:"ghost",size:"sm",onClick:e,className:"gap-1 h-7 px-2",children:[l.jsx(k.X,{className:"h-3 w-3"}),"Limpar tudo"]})]}),a]})}function st({...t}){return l.jsx(Wn.Root,{"data-slot":"popover",...t})}const $e=I.forwardRef((t,e)=>l.jsx(Wn.Trigger,{ref:e,"data-slot":"popover-trigger",...t}));$e.displayName=Wn.Trigger.displayName;const Ze=I.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},a)=>l.jsx(Wn.Portal,{children:l.jsx(Wn.Content,{ref:a,"data-slot":"popover-content",align:e,sideOffset:n,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...r})}));Ze.displayName=Wn.Content.displayName;const $x=I.forwardRef((t,e)=>l.jsx(Wn.Anchor,{ref:e,"data-slot":"popover-anchor",...t}));$x.displayName=Wn.Anchor.displayName;function C0({className:t,...e}){return l.jsx(mu.Root,{"data-slot":"checkbox",className:w("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(mu.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:l.jsx(k.Check,{className:"size-3.5"})})})}function Ue({className:t,...e}){return l.jsx(Ix.Root,{"data-slot":"label",className:w("flex items-center gap-2 text-sm leading-none font-semibold select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function Pl(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Oa(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):s;a=t.formattingValues[o]||t.formattingValues[s]}else{const s=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;a=t.values[o]||t.values[s]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}function Pa(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const s=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],f=Array.isArray(o)?qx(o,u=>u.test(s)):Zx(o,u=>u.test(s));let c;c=t.valueCallback?t.valueCallback(f):f,c=n.valueCallback?n.valueCallback(c):c;const d=e.slice(s.length);return{value:c,rest:d}}}function Zx(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function qx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Kx(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const a=r[0],i=e.match(t.parsePattern);if(!i)return null;let s=t.valueCallback?t.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const o=e.slice(a.length);return{value:s,rest:o}}}const Xx={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ey=(t,e,n)=>{let r;const a=Xx[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",String(e)),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"em "+r:"há "+r:r},ty={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},ny={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ry={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ay={date:Pl({formats:ty,defaultWidth:"full"}),time:Pl({formats:ny,defaultWidth:"full"}),dateTime:Pl({formats:ry,defaultWidth:"full"})},iy={lastWeek:t=>{const e=t.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},sy=(t,e,n,r)=>{const a=iy[t];return typeof a=="function"?a(e):a},oy={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},ly={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},fy={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},cy={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},dy={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},uy={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},hy=(t,e)=>{const n=Number(t);return(e==null?void 0:e.unit)==="week"?n+"ª":n+"º"},py={ordinalNumber:hy,era:Oa({values:oy,defaultWidth:"wide"}),quarter:Oa({values:ly,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Oa({values:fy,defaultWidth:"wide"}),day:Oa({values:cy,defaultWidth:"wide"}),dayPeriod:Oa({values:dy,defaultWidth:"wide",formattingValues:uy,defaultFormattingWidth:"wide"})},my=/^(\d+)[ºªo]?/i,gy=/\d+/i,by={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},xy={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},yy={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},vy={any:[/1/i,/2/i,/3/i,/4/i]},wy={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},My={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},jy={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},Cy={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},Ly={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Ny={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},ky={ordinalNumber:Kx({matchPattern:my,parsePattern:gy,valueCallback:t=>parseInt(t,10)}),era:Pa({matchPatterns:by,defaultMatchWidth:"wide",parsePatterns:xy,defaultParseWidth:"any"}),quarter:Pa({matchPatterns:yy,defaultMatchWidth:"wide",parsePatterns:vy,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Pa({matchPatterns:wy,defaultMatchWidth:"wide",parsePatterns:My,defaultParseWidth:"any"}),day:Pa({matchPatterns:jy,defaultMatchWidth:"wide",parsePatterns:Cy,defaultParseWidth:"any"}),dayPeriod:Pa({matchPatterns:Ly,defaultMatchWidth:"any",parsePatterns:Ny,defaultParseWidth:"any"})},yt={code:"pt-BR",formatDistance:ey,formatLong:ay,formatRelative:sy,localize:py,match:ky,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Qo({className:t,classNames:e,showOutsideDays:n=!0,locale:r=yt,...a}){return l.jsx(rx.DayPicker,{showOutsideDays:n,locale:r,className:w("p-3",t),classNames:{months:"flex flex-col sm:flex-row gap-4",month:"flex flex-col gap-4",month_caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",button_previous:w(Jn({variant:"outline"}),"absolute left-1 top-0 size-7 bg-background p-0 hover:bg-accent hover:text-accent-foreground rounded-md border-border z-10"),button_next:w(Jn({variant:"outline"}),"absolute right-1 top-0 size-7 bg-background p-0 hover:bg-accent hover:text-accent-foreground rounded-md border-border z-10"),month_grid:"w-full border-collapse space-y-1",weekdays:"flex",weekday:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",week:"flex w-full mt-2",day:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 rounded-md",day_button:w(Jn({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md"),range_end:"range-end",range_start:"range-start",selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground rounded-md",today:"bg-accent text-accent-foreground rounded-md",outside:"outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",hidden:"invisible",...e},components:{Chevron:({orientation:i,...s})=>i==="left"?l.jsx(k.ChevronLeft,{className:"h-4 w-4",...s}):l.jsx(k.ChevronRight,{className:"h-4 w-4",...s})},...a})}Qo.displayName="Calendar";const xu=t=>{const e=[],n=t==="24h"?24:12,r=t==="24h"?0:1;for(let a=r;a<n+r;a++)e.push(a.toString().padStart(2,"0"));return e},yu=t=>{const e=[];for(let n=0;n<60;n+=t)e.push(n.toString().padStart(2,"0"));return e},Sy=t=>{const e=t>=12?"PM":"AM";return{hour:t%12||12,period:e}},Ty=(t,e)=>e==="AM"?t===12?0:t:t===12?12:t+12,vu=(t,e,n)=>{if(!e&&!n)return!0;const[r,a]=t.split(":").map(Number),i=r*60+a;if(e){const[s,o]=e.split(":").map(Number);if(i<s*60+o)return!1}if(n){const[s,o]=n.split(":").map(Number);if(i>s*60+o)return!1}return!0};function mi({value:t,onChange:e,format:n="24h",minuteStep:r=5,minTime:a,maxTime:i,disabled:s=!1,placeholder:o="HH:MM",className:f,showIcon:c=!0,variant:d="input"}){const[u,p]=I.useMemo(()=>{if(!t)return["",""];const[x,v]=t.split(":");return[x||"",v||""]},[t]),[h,m]=I.useState(()=>u&&parseInt(u)>=12?"PM":"AM"),g=(x,v,j)=>{if(!x||!v)return;let y=parseInt(x);const L=parseInt(v);n==="12h"&&j&&(y=Ty(y,j));const C=`${y.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;vu(C,a,i)&&(e==null||e(C))},b=x=>{const j=x.target.value.replace(/[^\d:]/g,"");if(j.length===2&&!j.includes(":")){const y=j+":";e==null||e(y);return}if(j.match(/^\d{2}:\d{2}$/)){const[y,L]=j.split(":").map(Number);y>=0&&y<=23&&L>=0&&L<=59&&vu(j,a,i)&&(e==null||e(j))}else e==null||e(j)};if(d==="input")return l.jsxs("div",{className:w("relative",f),children:[c&&l.jsx(k.Clock,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"}),l.jsx(Ht,{type:"text",value:t||"",onChange:b,placeholder:o,disabled:s,className:w(c&&"pl-9"),maxLength:5})]});if(d==="select"){const x=xu(n),v=yu(r),j=n==="12h"&&u?Sy(parseInt(u)).hour.toString().padStart(2,"0"):u;return l.jsxs("div",{className:w("flex items-center gap-2",f),children:[c&&l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsxs(en,{value:j,onValueChange:y=>{g(y,p||"00",n==="12h"?h:void 0)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{placeholder:"HH"})}),l.jsx(rn,{children:x.map(y=>l.jsx(Dt,{value:y,children:y},y))})]}),l.jsx("span",{className:"text-muted-foreground font-medium",children:":"}),l.jsxs(en,{value:p,onValueChange:y=>{g(u||"00",y,n==="12h"?h:void 0)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{placeholder:"MM"})}),l.jsx(rn,{children:v.map(y=>l.jsx(Dt,{value:y,children:y},y))})]}),n==="12h"&&l.jsxs(en,{value:h,onValueChange:y=>{m(y),u&&p&&g(u,p,y)},disabled:s,children:[l.jsx(nn,{className:"w-[70px]",children:l.jsx(tn,{})}),l.jsxs(rn,{children:[l.jsx(Dt,{value:"AM",children:"AM"}),l.jsx(Dt,{value:"PM",children:"PM"})]})]})]})}if(d==="inline"){const x=xu(n),v=yu(r);return l.jsxs("div",{className:w("flex items-center gap-2",f),children:[c&&l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsx(Ue,{className:"text-sm text-muted-foreground",children:"Horário:"}),l.jsxs(en,{value:u,onValueChange:j=>g(j,p||"00",n==="12h"?h:void 0),disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{placeholder:"HH"})}),l.jsx(rn,{children:x.map(j=>l.jsx(Dt,{value:j,children:j},j))})]}),l.jsx("span",{className:"text-muted-foreground",children:":"}),l.jsxs(en,{value:p,onValueChange:j=>g(u||"00",j,n==="12h"?h:void 0),disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{placeholder:"MM"})}),l.jsx(rn,{children:v.map(j=>l.jsx(Dt,{value:j,children:j},j))})]}),n==="12h"&&l.jsxs(en,{value:h,onValueChange:j=>{m(j),u&&p&&g(u,p,j)},disabled:s,children:[l.jsx(nn,{className:"w-[65px] h-8 text-sm",children:l.jsx(tn,{})}),l.jsxs(rn,{children:[l.jsx(Dt,{value:"AM",children:"AM"}),l.jsx(Dt,{value:"PM",children:"PM"})]})]})]})}return null}mi.displayName="TimePicker";function Ec({value:t,onChange:e,placeholder:n="Selecione uma data",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s,locale:o=yt,className:f,error:c=!1,showTime:d=!1,timeFormat:u="24h",minuteStep:p=5,defaultTime:h="09:00",id:m,name:g}){const[b,x]=I.useState(!1),[v,j]=I.useState(""),[y,L]=I.useState(!1),C=s||(d?"dd/MM/yyyy HH:mm":"dd/MM/yyyy"),N=I.useMemo(()=>d?["dd/MM/yyyy HH:mm","dd/MM/yyyy HH:mm:ss","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy","ddMMyyyy","ddMMyy"],[d]);I.useEffect(()=>{t?(j(H.format(t,C,{locale:o})),L(!1)):(j(""),L(!1))},[t,C,o]);const S=I.useMemo(()=>{if(!t)return h;const E=t.getHours().toString().padStart(2,"0"),G=t.getMinutes().toString().padStart(2,"0");return`${E}:${G}`},[t,h]),T=E=>{if(!E){e==null||e(void 0);return}if(d){const[G,Z]=S.split(":").map(Number);E.setHours(G,Z,0,0)}else E.setHours(0,0,0,0);e==null||e(E),d||x(!1)},z=E=>{if(t){const G=new Date(t),[Z,le]=E.split(":").map(Number);G.setHours(Z,le,0,0),e==null||e(G)}else{const G=new Date,[Z,le]=E.split(":").map(Number);G.setHours(Z,le,0,0),e==null||e(G)}},P=E=>{const G=E.trim();if(!G)return null;for(const Z of N)try{const le=H.parse(G,Z,new Date);if(H.isValid(le)){if(a&&le<a||i&&le>i)continue;return le}}catch{continue}return null},U=E=>{const G=E.target.value;j(G),L(!1)},J=()=>{if(!v.trim()){e==null||e(void 0),L(!1);return}const E=P(v);E?(e==null||e(E),L(!1)):L(!0)},Y=E=>{E.key==="Enter"?(E.preventDefault(),J(),y||x(!0)):E.key==="Escape"&&(E.preventDefault(),j(t?H.format(t,C,{locale:o}):""),L(!1))},K=E=>{E.stopPropagation(),e==null||e(void 0),j(""),L(!1)};return l.jsxs(st,{open:b,onOpenChange:x,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:m,name:g,value:v,onChange:U,onBlur:J,onKeyDown:Y,placeholder:n,disabled:r,"aria-invalid":c||y,className:w("pr-20",(c||y)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[v&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:K,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>x(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsxs(Ze,{className:"w-auto p-0",align:"start",children:[l.jsx(Qo,{mode:"single",selected:t,onSelect:T,disabled:E=>!!(a&&E<a||i&&E>i),locale:o,autoFocus:!0,defaultMonth:t||void 0}),d&&l.jsx("div",{className:"border-t p-3",children:l.jsx(mi,{value:S,onChange:z,format:u,minuteStep:p,variant:"inline",showIcon:!0})}),d&&l.jsx("div",{className:"border-t p-3 flex justify-end",children:l.jsx(F,{size:"sm",onClick:()=>x(!1),children:"Confirmar"})})]})]})}Ec.displayName="DatePicker";const wu=[{value:"is",label:"é",multiSelect:!1},{value:"is_not",label:"não é",multiSelect:!1},{value:"is_any_of",label:"é qualquer um de",multiSelect:!0},{value:"is_none_of",label:"não é nenhum de",multiSelect:!0},{value:"contains",label:"contém",multiSelect:!1},{value:"does_not_contain",label:"não contém",multiSelect:!1},{value:"greater_than",label:"maior que",multiSelect:!1},{value:"greater_than_or_equal",label:"maior ou igual a",multiSelect:!1},{value:"less_than",label:"menor que",multiSelect:!1},{value:"less_than_or_equal",label:"menor ou igual a",multiSelect:!1},{value:"is_empty",label:"está vazio",multiSelect:!1},{value:"is_not_empty",label:"não está vazio",multiSelect:!1}];function L0({conditions:t,onConditionsChange:e,fields:n,className:r}){const a=()=>{var f;const o={id:Math.random().toString(36).substr(2,9),field:((f=n[0])==null?void 0:f.value)||"",operator:"is",value:""};e([...t,o])},i=o=>{e(t.filter(f=>f.id!==o))},s=(o,f)=>{e(t.map(c=>c.id===o?{...c,...f}:c))};return l.jsxs("div",{className:w("space-y-3",r),children:[t.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm",children:'Nenhuma condição de filtro. Clique em "Adicionar condição" para começar.'}):t.map((o,f)=>l.jsx(Iy,{condition:o,fields:n,index:f,onUpdate:c=>s(o.id,c),onRemove:()=>i(o.id)},o.id)),l.jsxs(F,{type:"button",variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[l.jsx(k.Plus,{className:"h-4 w-4"}),"Adicionar condição"]})]})}function Iy({condition:t,fields:e,index:n,onUpdate:r,onRemove:a}){var m;const i=e.find(g=>g.value===t.field),s=wu.find(g=>g.value===t.operator),o=(i==null?void 0:i.multiSelect)||(s==null?void 0:s.multiSelect)||!1,f=!["is_empty","is_not_empty"].includes(t.operator),[c,d]=M.useState(""),u=Array.isArray(t.value)?t.value:t.value?[t.value]:[],p=g=>{if(!o){r({value:g});return}const b=Array.isArray(t.value)?t.value:[],x=b.includes(g)?b.filter(v=>v!==g):[...b,g];r({value:x})},h=g=>{if(!o)return;const b=Array.isArray(t.value)?t.value:[];r({value:b.filter(x=>x!==g)})};return l.jsxs("div",{className:"flex items-start gap-2 group",children:[l.jsx("div",{className:"flex items-center h-9 px-2 text-sm text-muted-foreground",children:n===0?"Onde":"E"}),l.jsxs("div",{className:"flex-1 flex items-center gap-2 flex-wrap p-2 border rounded-lg bg-background",children:[l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted",children:(i==null?void 0:i.label)||"Selecionar campo"})}),l.jsx(Ze,{className:"w-[200px] p-2",align:"start",children:l.jsx("div",{className:"space-y-1",children:e.map(g=>l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",t.field===g.value&&"bg-muted"),onClick:()=>r({field:g.value,value:g.multiSelect?[]:""}),children:g.label},g.value))})})]}),l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted text-muted-foreground",children:(s==null?void 0:s.label)||"is"})}),l.jsx(Ze,{className:"w-[200px] p-2",align:"start",children:l.jsx("div",{className:"space-y-1",children:wu.map(g=>l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",t.operator===g.value&&"bg-muted"),onClick:()=>r({operator:g.value,value:g.multiSelect?[]:""}),children:g.label},g.value))})})]}),f&&l.jsxs(l.Fragment,{children:[i!=null&&i.options?l.jsxs(st,{onOpenChange:g=>!g&&d(""),children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted",children:o&&u.length>0?l.jsxs("span",{className:"flex items-center gap-1",children:[u.length," selecionado",u.length>1?"s":""]}):!o&&t.value&&((m=i.options.find(g=>g.value===t.value))==null?void 0:m.label)||"Selecionar valor"})}),l.jsx(Ze,{className:"w-[240px] p-3",align:"start",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{className:"text-xs text-muted-foreground",children:o?"Selecionar valores":"Selecionar valor"}),l.jsxs("div",{className:"relative",children:[l.jsx(k.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Ht,{type:"text",placeholder:"Buscar...",value:c,onChange:g=>d(g.target.value),className:"h-9 pl-8",autoFocus:!0})]}),l.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:(()=>{const g=i.options.filter(b=>b.label.toLowerCase().includes(c.toLowerCase())||b.value.toLowerCase().includes(c.toLowerCase()));return g.length===0?l.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"Nenhum resultado encontrado"}):g.map(b=>{const x=o?u.includes(b.value):t.value===b.value;return l.jsx("div",{className:"flex items-center space-x-2",children:o?l.jsxs(l.Fragment,{children:[l.jsx(C0,{id:`${t.id}-${b.value}`,checked:x,onCheckedChange:()=>p(b.value)}),l.jsx("label",{htmlFor:`${t.id}-${b.value}`,className:"text-sm cursor-pointer flex-1",children:b.label})]}):l.jsx(F,{variant:"ghost",size:"sm",className:w("w-full justify-start",x&&"bg-muted"),onClick:()=>r({value:b.value}),children:b.label})},b.value)})})()})]})})]}):(i==null?void 0:i.type)==="date"?l.jsx(Ec,{value:t.value?new Date(t.value+"T00:00:00"):void 0,onChange:g=>{if(g){const b=g.toISOString().split("T")[0];r({value:b})}else r({value:""})},placeholder:"Selecionar data",className:"h-7 text-sm"}):l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"sm",className:"h-7 px-2 font-normal hover:bg-muted max-w-[200px] truncate",children:t.value||"Inserir valor"})}),l.jsx(Ze,{className:"w-[240px] p-3",align:"start",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{className:"text-xs text-muted-foreground",children:"Inserir valor"}),l.jsx(Ht,{type:(i==null?void 0:i.type)==="number"?"number":"text",value:Array.isArray(t.value)?"":t.value,onChange:g=>r({value:g.target.value}),placeholder:"Digite o valor...",autoFocus:!0})]})})]}),o&&u.length>0&&l.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:u.map(g=>{var x,v;const b=((v=(x=i==null?void 0:i.options)==null?void 0:x.find(j=>j.value===g))==null?void 0:v.label)||g;return l.jsxs(pe,{variant:"secondary",className:"gap-1 h-6 text-xs",children:[b,l.jsx("button",{type:"button",onClick:()=>h(g),className:"ml-1 rounded-sm hover:bg-muted p-0.5 transition-colors","aria-label":`Remover ${b}`,children:l.jsx(k.X,{className:"h-3 w-3"})})]},g)})})]})]}),l.jsx(F,{type:"button",variant:"ghost",size:"sm",onClick:a,className:"h-9 w-9 p-0 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remover condição",children:l.jsx(k.X,{className:"h-4 w-4"})})]})}function N0({data:t,columns:e,searchPlaceholder:n="Buscar...",searchableColumns:r,enableSearch:a=!0,filterFields:i=[],enableFilters:s=!1,initialFilters:o=[],pageSizeOptions:f=[5,10,20,50],initialPageSize:c=10,toolbarActions:d,serverConfig:u,isLoading:p=!1,emptyState:h,emptyMessage:m,className:g}){var q,re;const b=!!u,{data:x,state:v,handlers:j,getSortDirection:y}=Wx({data:t,initialPageSize:c,initialSort:{column:null,direction:null},serverMode:b,totalItems:u==null?void 0:u.totalItems,serverCurrentPage:u==null?void 0:u.currentPage,serverCurrentPageSize:u==null?void 0:u.currentPageSize}),[L,C]=M.useState(""),[N,S]=M.useState(!1),[T,z]=M.useState(o),P=r?r[0]:((q=e.find(A=>A.key==="nome"||A.key==="name"||A.key==="title"||A.key==="titulo"))==null?void 0:q.key)||((re=e[0])==null?void 0:re.key),U=A=>{switch(A){case"is":return"equals";case"equals":return"equals";case"contains":return"contains";case"contem":return"contains";case"starts_with":return"startsWith";case"greater_than":return"greaterThan";case"greater_than_or_equal":return"greaterThanOrEqual";case"less_than":return"lessThan";case"less_than_or_equal":return"lessThanOrEqual";case"entre":return"equals";default:return"contains"}},J=M.useCallback(async A=>{b&&(u!=null&&u.onFilterChange)?await u.onFilterChange(A,L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"),A.forEach(B=>{const ee=U(B.operator);j.setFilter(B.field,B.value,ee)}))},[b,u,L,j,P]);M.useEffect(()=>{o&&(z(o),o.length>0&&(b&&(u!=null&&u.onFilterChange)?u.onFilterChange(o,L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"),o.forEach(A=>{const B=U(A.operator);j.setFilter(A.field,A.value,B)}))))},[JSON.stringify(o)]);const Y=M.useCallback(async A=>{C(A),b&&(u!=null&&u.onFilterChange)?await u.onFilterChange(T,A):j.setFilter(P,A,"contains")},[b,u,T,j,P]),K=A=>{if(/^\d{4}-\d{2}-\d{2}/.test(A)){const B=new Date(A+"T00:00:00");if(!isNaN(B.getTime()))return B.toLocaleDateString("pt-BR")}return A},E=A=>({is:"é",is_not:"não é",is_any_of:"é qualquer um de",is_none_of:"não é nenhum de",equals:"igual a",not_equals:"diferente de",contains:"contém",contem:"contém",does_not_contain:"não contém",starts_with:"começa com",ends_with:"termina com",greater_than:"maior que",greater_than_or_equal:"maior ou igual a",less_than:"menor que",less_than_or_equal:"menor ou igual a",is_empty:"está vazio",is_not_empty:"não está vazio",entre:"entre"})[A]||A,G=T.map(A=>{var Oe,un;const B=i.find(dt=>dt.value===A.field),ee=E(A.operator);let he;return Array.isArray(A.value)?he=A.value.map(dt=>{var Zt,ir;return((ir=(Zt=B==null?void 0:B.options)==null?void 0:Zt.find(Vr=>Vr.value===dt))==null?void 0:ir.label)||dt}).join(", "):(B==null?void 0:B.type)==="date"?he=K(A.value):he=((un=(Oe=B==null?void 0:B.options)==null?void 0:Oe.find(dt=>dt.value===A.value))==null?void 0:un.label)||A.value,{id:A.id,label:(B==null?void 0:B.label)||A.field,value:ee?`${ee} ${he}`:he,onRemove:()=>{const dt=T.filter(Zt=>Zt.id!==A.id);z(dt),J(dt)}}}),Z=()=>{J(T),S(!1)},le=()=>{z([]),b&&(u!=null&&u.onFilterChange)?u.onFilterChange([],L):(j.clearFilters(),L&&j.setFilter(P,L,"contains"))},we=M.useCallback(async A=>{if(b&&(u!=null&&u.onSortChange)){const B=v.sort;let ee="asc";B.column===A&&(ee=B.direction==="asc"?"desc":B.direction==="desc"?null:"asc");const he={column:ee?A:null,direction:ee};j.onSort(A),await u.onSortChange(he)}else j.onSort(A)},[b,u,v.sort,j]),Ie=M.useCallback(async A=>{b&&(u!=null&&u.onPageChange)?await u.onPageChange(A,v.pagination.pageSize):v.pagination.onPageChange&&v.pagination.onPageChange(A)},[b,u,v.pagination]),Le=M.useCallback(async A=>{b&&(u!=null&&u.onPageChange)?await u.onPageChange(1,A):v.pagination.onPageSizeChange&&v.pagination.onPageSizeChange(A)},[b,u,v.pagination]),V=()=>{const A=T.length>0,B=L.trim().length>0;if(typeof h=="string"||m){const ee=A||B?"Nenhum resultado encontrado para os filtros aplicados.":typeof h=="string"?h:m||"Nenhum dado disponível.";return l.jsx("div",{className:"text-sm text-muted-foreground",children:ee})}return h&&typeof h=="object"?A||B?l.jsx(kf,{icon:k.Search,title:"Nenhum resultado encontrado",description:"Tente ajustar os filtros ou termos de busca para encontrar o que procura.",variant:"no-results",primaryAction:{label:"Limpar Filtros",onClick:()=>{C(""),le()},variant:"outline"}}):l.jsx(kf,{icon:h.icon,illustration:h.illustration,title:h.title,description:h.description,variant:h.variant||"first-use",primaryAction:h.primaryAction,secondaryAction:h.secondaryAction}):l.jsx("div",{className:"text-sm text-muted-foreground",children:A||B?"Nenhum resultado encontrado para os filtros aplicados.":"Nenhum dado disponível."})};return l.jsxs("div",{className:w("space-y-4",g),children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[a&&l.jsxs("div",{className:"relative max-w-sm flex-1",children:[l.jsx(k.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),l.jsx(Ht,{placeholder:n,value:L,onChange:A=>Y(A.target.value),onKeyDown:A=>{A.key==="Enter"&&A.preventDefault()},className:"pl-9"})]}),s&&i.length>0&&l.jsxs(st,{open:N,onOpenChange:S,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",size:"sm",className:"gap-2",children:[l.jsx(k.Filter,{className:"h-4 w-4"}),"Filtros",T.length>0&&l.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground w-5 h-5 text-xs flex items-center justify-center",children:T.length})]})}),l.jsxs(Ze,{className:"w-[700px] p-0",align:"start",sideOffset:8,children:[l.jsxs("div",{className:"p-6 border-b",children:[l.jsx("h3",{className:"font-semibold",children:"Filtros Avançados"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Adicione condições de filtro para refinar os resultados."})]}),l.jsx("div",{className:"p-6",children:l.jsx(L0,{conditions:T,onConditionsChange:z,fields:i})}),l.jsxs("div",{className:"flex items-center justify-end gap-2 p-4 border-t bg-muted/50",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>S(!1),children:"Cancelar"}),l.jsx(F,{size:"sm",onClick:Z,children:"Aplicar Filtros"})]})]})]})]}),d&&l.jsx("div",{className:"flex items-center gap-2",children:d})]}),T.length>0&&l.jsx(j0,{activeFilters:G,onClearAll:le}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(kc,{children:[l.jsx(Sc,{children:l.jsx(na,{children:e.map(A=>l.jsxs(Ic,{className:w(A.headerClassName,A.sortable&&"cursor-pointer select-none hover:bg-muted/50 transition-colors",A.sortable&&y(A.key)&&"text-primary"),style:{width:A.width},onClick:()=>A.sortable&&we(A.key),"aria-sort":A.sortable?y(A.key)==="asc"?"ascending":y(A.key)==="desc"?"descending":"none":void 0,children:[A.header,A.sortable&&y(A.key)&&l.jsx(k.ArrowUpDown,{className:"ml-2 h-4 w-4 inline"})]},String(A.key)))})}),l.jsx(Tc,{children:p?Array.from({length:Math.min(v.pagination.pageSize,15)}).map((A,B)=>l.jsx(na,{children:e.map((ee,he)=>l.jsx(qa,{className:ee.className,children:l.jsx(Bn,{className:"h-4 w-full"})},he))},`skeleton-${B}`)):x.length>0?x.map((A,B)=>l.jsx(na,{children:e.map(ee=>l.jsx(qa,{className:w(ee.className,ee.align?`text-${ee.align}`:"text-left"),children:ee.render?ee.render(A[ee.key],A,B):A[ee.key]},String(ee.key)))},B)):l.jsx(na,{children:l.jsx(qa,{colSpan:e.length,className:"h-64",children:V()})})})]})}),l.jsx(Dc,{currentPage:v.pagination.currentPage,totalPages:Math.ceil(v.pagination.totalItems/v.pagination.pageSize),pageSize:v.pagination.pageSize,totalItems:v.pagination.totalItems,onPageChange:Ie,onPageSizeChange:Le,pageSizeOptions:f})]})}function Dy({data:t,columns:e,title:n,description:r,searchPlaceholder:a="Buscar...",searchableColumns:i,filterFields:s=[],initialFilters:o,enableSearch:f=!0,enableFilters:c=s.length>0,pageSizeOptions:d=[5,10,20,50],initialPageSize:u=10,showCard:p=!0,cardPadding:h="p-6",toolbarActions:m,isLoading:g=!1,emptyState:b,emptyMessage:x,className:v,serverConfig:j},y){const L=l.jsx(N0,{data:t,columns:e,searchPlaceholder:a,searchableColumns:i,enableSearch:f,enableFilters:c,filterFields:s,initialFilters:o,initialPageSize:u,pageSizeOptions:d,toolbarActions:m,serverConfig:j,isLoading:g,emptyState:b,emptyMessage:x});return p?l.jsxs(jr,{ref:y,className:w(h,v),children:[(n||r)&&l.jsxs("div",{className:"mb-6",children:[n&&l.jsx("h2",{className:"text-lg font-semibold",children:n}),r&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r})]}),L]}):l.jsxs("div",{ref:y,className:v,children:[(n||r)&&l.jsxs("div",{className:"mb-6",children:[n&&l.jsx("h2",{className:"text-lg font-semibold",children:n}),r&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r})]}),L]})}const k0=I.forwardRef(Dy);k0.displayName="AdvancedDataTable";const Ey=$t.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",info:"text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800 [&>svg]:text-current *:data-[slot=alert-description]:text-blue-700/90 dark:*:data-[slot=alert-description]:text-blue-400/90",success:"text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 border-green-200 dark:border-green-800 [&>svg]:text-current *:data-[slot=alert-description]:text-green-700/90 dark:*:data-[slot=alert-description]:text-green-400/90",warning:"text-yellow-700 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950/30 border-yellow-200 dark:border-yellow-800 [&>svg]:text-current *:data-[slot=alert-description]:text-yellow-700/90 dark:*:data-[slot=alert-description]:text-yellow-400/90"}},defaultVariants:{variant:"default"}});function Ay({className:t,variant:e,...n}){return l.jsx("div",{"data-slot":"alert",role:"alert",className:w(Ey({variant:e}),t),...n})}function zy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-title",className:w("col-start-2 line-clamp-1 min-h-4 font-semibold leading-[1.2] tracking-tight",t),...e})}function Oy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-description",className:w("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function Py({...t}){return l.jsx(dn.Root,{"data-slot":"alert-dialog",...t})}function Ry({...t}){return l.jsx(dn.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function By({...t}){return l.jsx(dn.Portal,{"data-slot":"alert-dialog-portal",...t})}const S0=I.forwardRef(({className:t,...e},n)=>l.jsx(dn.Overlay,{ref:n,"data-slot":"alert-dialog-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));S0.displayName=dn.Overlay.displayName;function Hy({className:t,...e}){return l.jsxs(By,{children:[l.jsx(S0,{}),l.jsx(dn.Content,{"data-slot":"alert-dialog-content",className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...e})]})}function Fy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-dialog-header",className:w("flex flex-col gap-2 text-center sm:text-left",t),...e})}function Uy({className:t,...e}){return l.jsx("div",{"data-slot":"alert-dialog-footer",className:w("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function _y({className:t,...e}){return l.jsx(dn.Title,{"data-slot":"alert-dialog-title",className:w("text-lg font-semibold leading-[1.2]",t),...e})}function Jy({className:t,...e}){return l.jsx(dn.Description,{"data-slot":"alert-dialog-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e})}function Vy({className:t,...e}){return l.jsx(dn.Action,{className:w(Jn(),t),...e})}function Gy({className:t,...e}){return l.jsx(dn.Cancel,{className:w(Jn({variant:"outline"}),t),...e})}function Wo({className:t,children:e,...n}){return l.jsxs(Za.Root,{"data-slot":"scroll-area",className:w("relative",t),...n,children:[l.jsx(Za.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:e}),l.jsx(T0,{}),l.jsx(Za.Corner,{})]})}function T0({className:t,orientation:e="vertical",...n}){return l.jsx(Za.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:e,className:w("flex touch-none p-px transition-colors select-none",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...n,children:l.jsx(Za.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Mu={p395de780:"M0 1.88343C0 0.870644 0.847464 0 1.86025 0C2.89622 0 3.74369 0.871417 3.74369 1.88343C3.74369 2.89622 2.89622 3.74446 1.86025 3.74446C0.847464 3.74446 0 2.89622 0 1.88343Z",p9466600:"M14.366 0.0315111C9.86678 -0.373296 6.07442 3.17572 6.07442 7.59306V25.1303C6.07442 27.4664 7.74695 29.567 10.0661 29.8474C12.8287 30.1811 15.1857 28.0234 15.1857 25.3258V15.2102V14.0661C15.1857 13.1908 14.4757 12.4809 13.6004 12.4809H12.1488V15.2102V25.2161C12.1488 25.9847 11.5355 26.7689 10.7699 26.8384C9.86987 26.9195 9.11125 26.2095 9.11125 25.3258V7.78928C9.11125 5.45314 10.783 3.35263 13.1021 3.07142C15.8647 2.73692 18.2225 4.8946 18.2225 7.59306V21.0459C18.2225 21.0459 18.2225 21.0931 18.2225 21.1595C18.2225 21.9483 18.2225 25.3428 18.2225 25.3605C18.2024 29.7655 14.4124 33.2967 9.91931 32.8858C5.96936 32.525 3.03682 29.0355 3.03682 25.0693V15.1291V12.4816H1.58524C0.709959 12.4816 0 13.1916 0 14.0669V25.0152C0 30.6014 4.18017 35.4676 9.74781 35.9195C15.6461 36.3977 20.6529 32.029 21.2083 26.3725C21.2145 26.3053 21.2408 23.8325 21.2531 21.8216L21.2593 21.8231V7.85031C21.2601 3.87872 18.3206 0.386876 14.366 0.0315111Z"},pn={p1cdcfe80:"M21.9603 17.085C21.9556 16.3915 22.1577 15.7123 22.5408 15.1339C22.9239 14.5555 23.4707 14.104 24.1116 13.837C24.7525 13.57 25.4585 13.4995 26.1397 13.6345C26.8208 13.7696 27.4463 14.104 27.9365 14.5952C28.4267 15.0864 28.7594 15.7122 28.8923 16.3929C29.0251 17.0736 28.9521 17.7784 28.6825 18.4175C28.4129 19.0566 27.959 19.6011 27.3784 19.9817C26.7979 20.3623 26.1171 20.5618 25.4227 20.5547C24.5062 20.5422 23.631 20.1723 22.984 19.5239C22.337 18.8756 21.9696 18.0003 21.9603 17.085V17.085Z",p2cb5a300:"M98.983 25.9984C101.074 28.2086 102.206 31.1541 102.134 34.1939C102.207 37.2482 101.076 40.2089 98.983 42.4373C98.0369 43.5032 96.8719 44.353 95.5674 44.929C94.2629 45.505 92.8495 45.7937 91.4233 45.7754C90.0666 45.8501 88.7117 45.5978 87.4731 45.0398C86.2345 44.4817 85.1486 43.6343 84.3069 42.5689V54.8204H81.5394C80.7736 54.8204 80.0392 54.5166 79.4978 53.9758C78.9563 53.4351 78.6521 52.7017 78.6521 51.937V23.2227H81.9947C82.2987 23.2211 82.6001 23.2797 82.8814 23.3952C83.1626 23.5107 83.4182 23.6807 83.6332 23.8955C83.8482 24.1102 84.0185 24.3654 84.1341 24.6462C84.2498 24.9271 84.3085 25.2281 84.3069 25.5318V25.807C85.1512 24.7453 86.2379 23.9013 87.4761 23.3455C88.7143 22.7897 90.0678 22.5383 91.4233 22.6125C92.8528 22.6025 94.2678 22.8997 95.5721 23.4839C96.8765 24.0681 98.0398 24.9257 98.983 25.9984V25.9984ZM90.369 40.3555C91.1724 40.3816 91.9727 40.2432 92.7206 39.949C93.4685 39.6548 94.1482 39.2109 94.718 38.6446C95.302 38.0584 95.7595 37.359 96.0624 36.5894C96.3653 35.8198 96.5071 34.9964 96.4791 34.17C96.5113 33.3502 96.3713 32.5328 96.068 31.7703C95.7646 31.0079 95.3048 30.3174 94.718 29.7432C93.5516 28.6161 91.9921 27.9859 90.369 27.9859C88.746 27.9859 87.1865 28.6161 86.0201 29.7432C85.4473 30.3253 84.9997 31.0184 84.7051 31.7797C84.4105 32.541 84.275 33.3544 84.3069 34.17C84.2815 34.992 84.4199 35.8108 84.714 36.579C85.0081 37.3471 85.4521 38.0492 86.0201 38.6446C86.5912 39.2107 87.2706 39.656 88.0178 39.954C88.765 40.2521 89.5646 40.3968 90.369 40.3795V40.3555Z",p2d489f00:"M67.1509 17.085C67.1485 16.3949 67.3516 15.7197 67.7343 15.145C68.117 14.5704 68.6621 14.1223 69.3003 13.8577C69.9385 13.593 70.6411 13.5238 71.3188 13.6587C71.9966 13.7937 72.6188 14.1267 73.1066 14.6155C73.5944 15.1044 73.9258 15.7269 74.0585 16.4042C74.1913 17.0815 74.1196 17.7828 73.8524 18.4193C73.5852 19.0557 73.1346 19.5985 72.5579 19.9787C71.9811 20.3589 71.3043 20.5594 70.6132 20.5547C69.6968 20.5422 68.8215 20.1723 68.1746 19.5239C67.5276 18.8756 67.1602 18.0003 67.1509 17.085V17.085Z",p344a5f80:"M114.869 31.8729C118.068 32.5309 122.249 34.0623 122.201 38.7523C122.254 39.7667 122.048 40.7778 121.602 41.6904C121.155 42.603 120.483 43.3871 119.649 43.9688C117.799 45.2158 115.603 45.8481 113.372 45.7754C108.855 45.7754 105.776 44.0166 104.159 40.5589L107.118 38.8839C107.569 38.6258 108.095 38.5289 108.609 38.6094C109.123 38.6899 109.595 38.9428 109.945 39.3266C110.382 39.7887 110.916 40.1492 111.508 40.3828C112.1 40.6165 112.736 40.7174 113.372 40.6786C115.396 40.6786 116.403 40.0684 116.403 38.7882C116.403 37.508 114.654 36.9457 112.413 36.3954C109.155 35.5579 105.081 34.1939 105.081 29.6356C105.046 28.6587 105.245 27.6876 105.662 26.8032C106.079 25.9187 106.701 25.1465 107.477 24.5507C108.587 23.7568 109.846 23.1971 111.179 22.9057C112.513 22.6144 113.891 22.5975 115.231 22.8562C116.571 23.1148 117.844 23.6436 118.972 24.4101C120.101 25.1767 121.061 26.1649 121.794 27.3145L118.727 28.9895C118.302 29.2175 117.816 29.3077 117.338 29.2477C116.859 29.1877 116.411 28.9803 116.055 28.6545C115.346 28.0113 114.413 27.6719 113.456 27.7093C112.006 27.7093 110.904 28.4152 110.904 29.5039C110.904 30.5927 112.617 31.2986 114.869 31.8729Z",p35662200:"M22.6552 23.2346V34.0025V47.2828C22.6619 47.9663 22.4243 48.6297 21.9851 49.1538C21.5459 49.6779 20.9339 50.0284 20.2591 50.1423C19.8565 50.2006 19.4462 50.1718 19.0557 50.0579C18.6653 49.9441 18.3039 49.7477 17.9961 49.4823C17.6882 49.2168 17.441 48.8884 17.2713 48.5193C17.1016 48.1501 17.0133 47.7489 17.0124 47.3427V14.1777C16.9965 11.9279 17.8761 9.76402 19.4579 8.16199C21.0396 6.55996 23.1938 5.65104 25.4466 5.63517C27.6994 5.61931 29.8663 6.4978 31.4705 8.07739C33.0747 9.65698 33.9848 11.8083 34.0007 14.058V20.5546H36.7802C37.546 20.5546 38.2804 20.2508 38.8218 19.7101C39.3633 19.1694 39.6675 18.436 39.6675 17.6712V14.2255C39.6898 10.4749 38.2191 6.86905 35.5792 4.20125C32.9392 1.53344 29.3461 0.0222044 25.5904 -7.4932e-06C21.8347 -0.0222194 18.2239 1.44641 15.5525 4.08281C12.8811 6.7192 11.3678 10.3074 11.3456 14.058V47.1632C11.3377 48.2772 11.5496 49.3818 11.9692 50.4139C12.3888 51.4461 13.0079 52.3856 13.7911 53.1789C15.3728 54.7809 17.5271 55.6898 19.7799 55.7057C22.0327 55.7216 24.1995 54.8431 25.8037 53.2635C27.4079 51.6839 28.3181 49.5326 28.3339 47.2828V33.9427V26.118C28.3339 25.3533 28.0297 24.6199 27.4883 24.0792C26.9468 23.5384 26.2124 23.2346 25.4466 23.2346H22.6552Z",p3838afa0:"M67.8097 42.2698V23.2347H70.5773C70.9564 23.2347 71.3319 23.3092 71.6822 23.4541C72.0325 23.599 72.3508 23.8114 72.6189 24.0792C72.887 24.3469 73.0997 24.6648 73.2448 25.0146C73.3899 25.3644 73.4646 25.7394 73.4646 26.118V45.1532H70.6851C69.9214 45.15 69.1901 44.8449 68.6512 44.3045C68.1123 43.7641 67.8097 43.0325 67.8097 42.2698V42.2698Z",p38a74f0:"M33.9767 47.929C33.4376 55.3229 27.2676 61.4247 20.0554 61.4247C16.2424 61.4247 12.5857 59.9121 9.88955 57.2196C7.19341 54.5271 5.67874 50.8753 5.67874 47.0675V23.2466H2.89926C2.13239 23.2466 1.39675 23.55 0.853375 24.0904C0.309997 24.6308 0.00313895 25.3642 -2.99221e-05 26.13V47.1154C-0.0224375 52.3706 2.03925 57.421 5.73442 61.1627C9.4296 64.9045 14.4577 67.0333 19.7199 67.0838C24.2797 67.0831 28.704 65.5352 32.2674 62.694C35.8307 59.8529 38.3217 55.8869 39.332 51.4465C39.4399 51.0198 39.4486 50.574 39.3573 50.1435C39.2661 49.7129 39.0773 49.3089 38.8056 48.9625C38.5338 48.616 38.1862 48.3363 37.7895 48.1447C37.3927 47.9531 36.9573 47.8547 36.5166 47.8572H33.9767V47.929Z",pe814d80:"M56.9674 42.2698V16.4628C56.9673 16.0801 57.0436 15.7012 57.1916 15.3482C57.3397 14.9953 57.5567 14.6752 57.8299 14.4069C58.1031 14.1385 58.4271 13.9271 58.783 13.785C59.1388 13.643 59.5194 13.5731 59.9026 13.5794H62.6701V45.1532H59.9026C59.5194 45.1596 59.1388 45.0897 58.783 44.9476C58.4271 44.8056 58.1031 44.5942 57.8299 44.3258C57.5567 44.0574 57.3397 43.7374 57.1916 43.3844C57.0436 43.0314 56.9673 42.6525 56.9674 42.2698V42.2698Z",pf48a00:"M35.7618 42.4373C34.6809 41.3588 33.8312 40.0716 33.2648 38.6543C32.6983 37.2371 32.427 35.7194 32.4672 34.1939C32.4311 32.6648 32.7061 31.1442 33.2755 29.7242C33.845 28.3043 34.697 27.0144 35.7801 25.9329C36.8631 24.8513 38.1547 24.0004 39.5766 23.4317C40.9985 22.8631 42.5211 22.5884 44.0524 22.6245C46.0565 22.5718 48.0365 23.0708 49.7756 24.0669C51.5147 25.0629 52.9458 26.5176 53.9123 28.2716L50.8334 30.0782C50.399 30.3371 49.8912 30.4457 49.3888 30.3873C48.8863 30.3289 48.4171 30.1067 48.0539 29.7552C46.9749 28.7253 45.5327 28.1621 44.0404 28.1879C43.2541 28.1709 42.4726 28.3149 41.7441 28.6109C41.0156 28.907 40.3555 29.3488 39.8044 29.9092C39.2533 30.4696 38.823 31.1367 38.5398 31.8695C38.2567 32.6023 38.1267 33.3852 38.1579 34.17C38.1376 34.9603 38.2742 35.7468 38.5601 36.4841C38.8459 37.2213 39.2752 37.8947 39.8232 38.4652C40.936 39.5183 42.404 40.1161 43.9369 40.1405C45.4697 40.1648 46.956 39.614 48.1018 38.5968C48.4741 38.2608 48.9427 38.05 49.4414 37.9942C49.9401 37.9384 50.4437 38.0404 50.8813 38.2857L53.9842 40.0564C53.0823 41.5777 51.8458 42.8744 50.3684 43.8484C48.8909 44.8224 47.2111 45.4483 45.4558 45.6788C43.7006 45.9093 41.9158 45.7384 40.2364 45.1789C38.557 44.6194 37.027 43.686 35.7618 42.4493V42.4373Z"},mn={p12652a00:"M12.7929 15.2014C12.4062 14.8151 12.1022 14.354 11.8996 13.8463C11.697 13.3386 11.5999 12.795 11.6143 12.2486C11.6014 11.7008 11.6997 11.1561 11.9034 10.6475C12.1071 10.1388 12.4119 9.67682 12.7994 9.28938C13.1868 8.90195 13.6488 8.59716 14.1575 8.39346C14.6661 8.18975 15.2108 8.09138 15.7586 8.10429C16.4755 8.08543 17.1838 8.26417 17.8059 8.62096C18.428 8.97775 18.94 9.49883 19.2857 10.1271L18.1843 10.7743C18.0289 10.867 17.8473 10.9059 17.6675 10.885C17.4878 10.8641 17.3199 10.7845 17.19 10.6586C16.804 10.2897 16.2881 10.0879 15.7543 10.0971C15.473 10.0911 15.1934 10.1426 14.9328 10.2487C14.6722 10.3547 14.4361 10.513 14.239 10.7137C14.0418 10.9145 13.8879 11.1535 13.7866 11.4159C13.6853 11.6784 13.6388 11.9589 13.65 12.24C13.6427 12.5231 13.6916 12.8048 13.7938 13.0689C13.8961 13.333 14.0497 13.5742 14.2457 13.7786C14.6438 14.1558 15.1689 14.3699 15.7172 14.3787C16.2656 14.3874 16.7973 14.1901 17.2071 13.8257C17.3403 13.7054 17.5079 13.6299 17.6863 13.6099C17.8647 13.5899 18.0449 13.6264 18.2014 13.7143L19.3114 14.3486C18.9888 14.8935 18.5465 15.358 18.0179 15.7069C17.4894 16.0558 16.8885 16.28 16.2606 16.3626C15.6327 16.4451 14.9943 16.3839 14.3935 16.1835C13.7928 15.9831 13.2454 15.6487 12.7929 15.2057V15.2014Z",p128e2c00:"M7.85574 6.12C7.85405 5.87159 7.92633 5.62829 8.06338 5.4211C8.20043 5.21391 8.39604 5.05219 8.62531 4.95654C8.85457 4.86089 9.10712 4.83565 9.35078 4.88401C9.59445 4.93238 9.8182 5.05217 9.99356 5.22813C10.1689 5.40409 10.2879 5.62826 10.3355 5.87209C10.383 6.11592 10.3569 6.36838 10.2604 6.59731C10.164 6.82625 10.0016 7.0213 9.79392 7.15763C9.58626 7.29396 9.34271 7.36541 9.09431 7.36286C8.76647 7.3584 8.45337 7.22589 8.22193 6.99365C7.99049 6.76141 7.85906 6.44786 7.85574 6.12V6.12Z",p15ebc880:"M24.0214 6.12001C24.0206 5.8728 24.0932 5.63092 24.2301 5.42508C24.3671 5.21925 24.562 5.05874 24.7903 4.96394C25.0187 4.86915 25.27 4.84434 25.5124 4.89268C25.7549 4.94101 25.9775 5.06031 26.152 5.23541C26.3265 5.41051 26.445 5.63353 26.4925 5.87613C26.54 6.11873 26.5143 6.36998 26.4187 6.59796C26.3231 6.82594 26.162 7.02037 25.9557 7.15656C25.7493 7.29275 25.5072 7.36456 25.26 7.36286C24.9322 7.3584 24.6191 7.22589 24.3876 6.99365C24.1562 6.76141 24.0248 6.44786 24.0214 6.12001V6.12001Z",p2b03ee00:"M8.10429 8.32285V12.18V16.9371C8.10669 17.1819 8.0217 17.4196 7.86458 17.6073C7.70747 17.7951 7.48854 17.9206 7.24715 17.9614C7.10315 17.9823 6.95635 17.972 6.81668 17.9312C6.67701 17.8904 6.54774 17.8201 6.43761 17.725C6.32748 17.6299 6.23907 17.5123 6.17836 17.38C6.11765 17.2478 6.08605 17.1041 6.08572 16.9586V5.07857C6.08003 4.27269 6.39472 3.49756 6.96054 2.9237C7.52637 2.34984 8.29698 2.02425 9.10286 2.01857C9.90874 2.01289 10.6839 2.32757 11.2577 2.89339C11.8316 3.45922 12.1572 4.22983 12.1629 5.03571V7.36285H13.1571C13.4311 7.36285 13.6938 7.25404 13.8875 7.06034C14.0812 6.86664 14.19 6.60393 14.19 6.33V5.09571C14.198 3.7522 13.6719 2.46056 12.7275 1.50492C11.7831 0.549292 10.4978 0.00795366 9.15429 -2.83887e-06C7.81078 -0.00795933 6.51913 0.518118 5.5635 1.4625C4.60787 2.40688 4.06653 3.6922 4.05857 5.03571V16.8943C4.05576 17.2933 4.13157 17.689 4.28167 18.0587C4.43177 18.4285 4.65323 18.765 4.9334 19.0492C5.49922 19.623 6.26984 19.9486 7.07572 19.9543C7.8816 19.96 8.65673 19.6453 9.23059 19.0795C9.80445 18.5136 10.13 17.743 10.1357 16.9371V12.1586V9.35571C10.1357 9.08178 10.0269 8.81907 9.8332 8.62537C9.6395 8.43167 9.37679 8.32285 9.10286 8.32285H8.10429Z",p3000fb00:"M41.0914 11.4171C42.2357 11.6529 43.7314 12.2014 43.7143 13.8814C43.7333 14.2448 43.6594 14.607 43.4997 14.9339C43.34 15.2608 43.0997 15.5417 42.8014 15.75C42.1396 16.1967 41.3537 16.4232 40.5557 16.3971C38.94 16.3971 37.8386 15.7671 37.26 14.5286L38.3186 13.9286C38.4801 13.8361 38.6683 13.8014 38.8521 13.8302C39.036 13.8591 39.2046 13.9497 39.33 14.0871C39.4864 14.2527 39.6773 14.3818 39.889 14.4655C40.1008 14.5492 40.3284 14.5853 40.5557 14.5714C41.28 14.5714 41.64 14.3529 41.64 13.8943C41.64 13.4357 41.0143 13.2343 40.2129 13.0371C39.0472 12.7371 37.59 12.2486 37.59 10.6157C37.5775 10.2658 37.6488 9.91796 37.7979 9.60114C37.947 9.28433 38.1696 9.0077 38.4472 8.79429C38.844 8.5099 39.2946 8.3094 39.7715 8.20504C40.2484 8.10067 40.7416 8.09463 41.2209 8.18729C41.7002 8.27994 42.1556 8.46935 42.5593 8.74393C42.9629 9.01851 43.3063 9.37251 43.5686 9.78429L42.4714 10.3843C42.3194 10.466 42.1457 10.4983 41.9744 10.4768C41.8032 10.4553 41.6429 10.381 41.5157 10.2643C41.2621 10.0339 40.9281 9.91232 40.5857 9.92572C40.0671 9.92572 39.6729 10.1786 39.6729 10.5686C39.6729 10.9586 40.2857 11.2114 41.0914 11.4171Z",p3405fff0:"M12.1543 17.1686C11.9614 19.8172 9.75428 22.0029 7.17428 22.0029C5.81031 22.0029 4.5022 21.461 3.53773 20.4966C2.57325 19.5321 2.03142 18.224 2.03142 16.86V8.32715H1.03713C0.762807 8.32715 0.499653 8.43583 0.305274 8.62941C0.110895 8.82298 0.00112454 9.08569 -9.03731e-06 9.36001V16.8772C-0.00802475 18.7596 0.729489 20.5687 2.05134 21.909C3.37319 23.2494 5.17188 24.0119 7.05428 24.03C8.68543 24.0298 10.2681 23.4753 11.5428 22.4576C12.8175 21.4398 13.7086 20.0192 14.07 18.4286C14.1086 18.2757 14.1117 18.1161 14.079 17.9618C14.0464 17.8076 13.9789 17.6629 13.8817 17.5388C13.7844 17.4147 13.6601 17.3145 13.5182 17.2459C13.3763 17.1772 13.2205 17.142 13.0628 17.1429H12.1543V17.1686Z",p36679780:"M24.2571 15.1414V8.32286H25.2471C25.3828 8.32286 25.5171 8.34958 25.6424 8.40148C25.7677 8.45339 25.8816 8.52947 25.9775 8.62538C26.0734 8.72129 26.1495 8.83515 26.2014 8.96046C26.2533 9.08577 26.28 9.22008 26.28 9.35572V16.1743H25.2857C25.0125 16.1732 24.7509 16.0638 24.5581 15.8703C24.3654 15.6767 24.2571 15.4146 24.2571 15.1414V15.1414Z",p75f2980:"M20.3786 15.1414V5.89714C20.3786 5.76004 20.4058 5.62432 20.4588 5.49788C20.5118 5.37144 20.5894 5.2568 20.6871 5.16067C20.7849 5.06453 20.9008 4.98881 21.0281 4.93792C21.1553 4.88704 21.2915 4.862 21.4286 4.86428H22.4186V16.1743H21.4286C21.2915 16.1766 21.1553 16.1515 21.0281 16.1006C20.9008 16.0498 20.7849 15.974 20.6871 15.8779C20.5894 15.7818 20.5118 15.6671 20.4588 15.5407C20.4058 15.4142 20.3786 15.2785 20.3786 15.1414V15.1414Z",pb292700:"M35.4086 9.31285C36.1566 10.1046 36.5616 11.1597 36.5357 12.2486C36.562 13.3426 36.1572 14.4032 35.4086 15.2014C35.0701 15.5832 34.6534 15.8876 34.1867 16.094C33.7201 16.3003 33.2144 16.4037 32.7043 16.3971C32.2189 16.4239 31.7343 16.3336 31.2912 16.1337C30.8481 15.9337 30.4596 15.6302 30.1586 15.2486V19.6371H29.1686C28.8946 19.6371 28.6319 19.5283 28.4382 19.3346C28.2445 19.1409 28.1357 18.8782 28.1357 18.6043V8.31857H29.3314C29.4402 8.318 29.548 8.33901 29.6486 8.38037C29.7492 8.42174 29.8406 8.48264 29.9176 8.55957C29.9945 8.63649 30.0554 8.7279 30.0967 8.82851C30.1381 8.92912 30.1591 9.03693 30.1586 9.14571V9.24428C30.4606 8.864 30.8493 8.56165 31.2923 8.36255C31.7352 8.16346 32.2194 8.07343 32.7043 8.1C33.2156 8.09642 33.7218 8.20287 34.1884 8.41214C34.655 8.62141 35.0711 8.92859 35.4086 9.31285V9.31285ZM32.3271 14.4557C32.6145 14.465 32.9008 14.4155 33.1683 14.3101C33.4359 14.2047 33.679 14.0457 33.8828 13.8429C34.0917 13.6329 34.2554 13.3823 34.3638 13.1067C34.4721 12.831 34.5229 12.536 34.5128 12.24C34.5244 11.9463 34.4743 11.6535 34.3658 11.3804C34.2573 11.1073 34.0928 10.86 33.8828 10.6543C33.4656 10.2505 32.9077 10.0248 32.3271 10.0248C31.7465 10.0248 31.1887 10.2505 30.7714 10.6543C30.5665 10.8628 30.4064 11.1111 30.301 11.3838C30.1956 11.6565 30.1471 11.9479 30.1586 12.24C30.1495 12.5344 30.199 12.8278 30.3042 13.1029C30.4094 13.3781 30.5682 13.6296 30.7714 13.8429C30.9757 14.0456 31.2187 14.2051 31.486 14.3119C31.7533 14.4187 32.0394 14.4705 32.3271 14.4643V14.4557Z"};function Ys({variant:t="full",mode:e="positive",className:n,...r}){return t==="symbol"?l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo Símbolo",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 22 36",preserveAspectRatio:"xMidYMid meet",children:[l.jsx("path",{d:Mu.p9466600,fill:"#E62EA8",transform:"translate(0.37, 0.02)"}),l.jsx("path",{d:Mu.p395de780,fill:"#E62EA8",transform:"translate(11.65, 7.32)"})]})}):e==="positive"?l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 123 67",preserveAspectRatio:"xMidYMid meet",children:[l.jsxs("g",{clipPath:"url(#clip0_positive)",children:[l.jsxs("g",{id:"Group_Positive",children:[l.jsx("path",{d:pn.p38a74f0,fill:"#E52EA8"}),l.jsx("path",{d:pn.p35662200,fill:"#E52EA8"}),l.jsx("path",{d:pn.p1cdcfe80,fill:"#E52EA8"})]}),l.jsx("path",{d:pn.pf48a00,fill:"#5B158C"}),l.jsx("path",{d:pn.pe814d80,fill:"#5B158C"}),l.jsx("path",{d:pn.p3838afa0,fill:"#5B158C"}),l.jsx("path",{d:pn.p2d489f00,fill:"#5B158C"}),l.jsx("path",{d:pn.p2cb5a300,fill:"#5B158C"}),l.jsx("path",{d:pn.p344a5f80,fill:"#5B158C"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_positive",children:l.jsx("rect",{width:"122.201",height:"67",fill:"white"})})})]})}):l.jsx("div",{className:w("relative inline-block",n),...r,"data-name":"Logo Negative",children:l.jsxs("svg",{className:"block w-full h-full",fill:"none",viewBox:"0 0 44 24",preserveAspectRatio:"xMidYMid meet",children:[l.jsxs("g",{clipPath:"url(#clip0_negative)",children:[l.jsxs("g",{id:"Group_Negative",children:[l.jsx("path",{d:mn.p3405fff0,fill:"#E52EA8"}),l.jsx("path",{d:mn.p2b03ee00,fill:"#E52EA8"}),l.jsx("path",{d:mn.p128e2c00,fill:"#E52EA8"})]}),l.jsx("path",{d:mn.p12652a00,fill:"white"}),l.jsx("path",{d:mn.p75f2980,fill:"white"}),l.jsx("path",{d:mn.p36679780,fill:"white"}),l.jsx("path",{d:mn.p15ebc880,fill:"white"}),l.jsx("path",{d:mn.pb292700,fill:"white"}),l.jsx("path",{d:mn.p3000fb00,fill:"white"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_negative",children:l.jsx("rect",{width:"43.7143",height:"24",fill:"white"})})})]})})}function Hi({...t}){return l.jsx(Ge.Root,{"data-slot":"dropdown-menu",...t})}function Yy({...t}){return l.jsx(Ge.Portal,{"data-slot":"dropdown-menu-portal",...t})}function Fi({...t}){return l.jsx(Ge.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Ui({className:t,sideOffset:e=4,...n}){return l.jsx(Ge.Portal,{children:l.jsx(Ge.Content,{"data-slot":"dropdown-menu-content",sideOffset:e,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function I0({...t}){return l.jsx(Ge.Group,{"data-slot":"dropdown-menu-group",...t})}function gr({className:t,inset:e,variant:n="default",...r}){return l.jsx(Ge.Item,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:w("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function Qy({className:t,children:e,checked:n,...r}){return l.jsxs(Ge.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Ge.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function Wy({...t}){return l.jsx(Ge.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function $y({className:t,children:e,...n}){return l.jsxs(Ge.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Ge.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function D0({className:t,inset:e,...n}){return l.jsx(Ge.Label,{"data-slot":"dropdown-menu-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8",t),...n})}function Qs({className:t,...e}){return l.jsx(Ge.Separator,{"data-slot":"dropdown-menu-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function Zy({className:t,...e}){return l.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:w("text-muted-foreground ml-auto text-xs tracking-widest",t),...e})}function qy({...t}){return l.jsx(Ge.Sub,{"data-slot":"dropdown-menu-sub",...t})}function Ky({className:t,inset:e,children:n,...r}){return l.jsxs(Ge.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",t),...r,children:[n,l.jsx(k.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Xy({className:t,...e}){return l.jsx(Ge.SubContent,{"data-slot":"dropdown-menu-sub-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...e})}const ev=$t.cva("flex size-full items-center justify-center rounded-full text-base font-semibold bg-muted",{variants:{colorVariant:{gray:"bg-gray-100 text-gray-500",pink:"bg-pink-100 text-pink-500",purple:"bg-purple-100 text-purple-500",blue:"bg-blue-100 text-blue-500",cyan:"bg-cyan-100 text-cyan-500",teal:"bg-teal-100 text-teal-500",green:"bg-green-100 text-green-500",yellow:"bg-yellow-100 text-yellow-600",orange:"bg-orange-100 text-orange-500",red:"bg-red-100 text-red-500"}}}),Ft=I.forwardRef(({className:t,...e},n)=>l.jsx(Ca.Root,{ref:n,"data-slot":"avatar",className:w("relative flex size-10 shrink-0 overflow-hidden rounded-full",t),...e}));Ft.displayName=Ca.Root.displayName;const Ln=I.forwardRef(({className:t,...e},n)=>l.jsx(Ca.Image,{ref:n,"data-slot":"avatar-image",className:w("aspect-square size-full",t),...e}));Ln.displayName=Ca.Image.displayName;const Ut=I.forwardRef(({className:t,colorVariant:e,...n},r)=>l.jsx(Ca.Fallback,{ref:r,"data-slot":"avatar-fallback",className:w(ev({colorVariant:e}),t),...n}));Ut.displayName=Ca.Fallback.displayName;const tv=[{label:"Perfil",icon:k.User,onClick:()=>console.log("Perfil clicked")},{label:"Configurações",icon:k.Settings,onClick:()=>console.log("Configurações clicked")},{label:"Ajuda",icon:k.HelpCircle,onClick:()=>console.log("Ajuda clicked")}],ju={label:"Sair",onClick:()=>console.log("Logout clicked")};function E0({user:t,menuItems:e=tv,onLogout:n,expanded:r=!0,className:a}){const i=t.initials||t.name.split(" ").map(s=>s[0]).slice(0,2).join("").toUpperCase();return l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsxs("button",{className:w("flex w-full items-center gap-3 rounded-lg p-2 transition-colors hover:bg-accent",a),children:[l.jsxs(Ft,{className:"h-8 w-8",children:[l.jsx(Ln,{src:t.avatar,alt:t.name}),l.jsx(Ut,{className:"bg-primary text-primary-foreground text-xs",children:i})]}),r&&l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-start overflow-hidden",children:[l.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.email&&l.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.email})]})]})}),l.jsxs(Ui,{className:"w-56",align:"end",side:"right",children:[l.jsx(D0,{children:l.jsxs("div",{className:"flex flex-col space-y-1",children:[l.jsx("p",{className:"text-sm font-medium leading-none",children:t.name}),t.email&&l.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:t.email})]})}),l.jsx(Qs,{}),l.jsx(I0,{children:e.map((s,o)=>{const f=s.icon;return l.jsxs(gr,{onClick:s.onClick,className:w(s.variant==="destructive"&&"text-destructive focus:text-destructive"),children:[l.jsx(f,{className:"mr-2 h-4 w-4"}),l.jsx("span",{children:s.label})]},o)})}),l.jsx(Qs,{}),l.jsxs(gr,{onClick:n??ju.onClick,className:"text-destructive focus:text-destructive",children:[l.jsx(k.LogOut,{className:"mr-2 h-4 w-4"}),l.jsx("span",{children:ju.label})]})]})]})}function nv({items:t,activeItem:e,onItemClick:n,logoComponent:r,user:a,userMenuItems:i,onLogout:s,defaultPinned:o=!1,className:f}){const[c,d]=I.useState(o),[u,p]=I.useState(!1),[h,m]=I.useState([]),g=c||u,b=v=>{m(j=>j.includes(v)?j.filter(y=>y!==v):[...j,v])},x=(v,j)=>{j?b(v):n==null||n(v)};return l.jsxs("div",{className:w("relative flex h-screen flex-col transition-all duration-200",g?"w-56":"w-16",f),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[l.jsx("div",{className:"flex h-16 min-h-16 items-center px-2",children:g?l.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-between overflow-hidden",children:[r||l.jsx(Ys,{variant:"full",className:"h-8 w-auto"}),l.jsx("button",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-accent",onClick:()=>d(!c),children:l.jsx(k.Pin,{className:w("h-3.5 w-3.5",c?"fill-primary text-primary":"text-muted-foreground")})})]}):l.jsx("div",{className:"flex w-full justify-center",children:r||l.jsx(Ys,{variant:"symbol",className:"h-8 w-8"})})}),l.jsx(Wo,{className:"flex-1",children:l.jsx("nav",{className:"space-y-1 py-3 px-2",children:t.map(v=>{var N;const j=v.icon,y=v.children&&v.children.length>0,L=h.includes(v.id),C=e===v.id||((N=v.children)==null?void 0:N.some(S=>S.id===e));return l.jsxs("div",{className:w(!g&&"flex justify-center"),children:[l.jsxs("button",{onClick:()=>x(v.id,!!y),className:w("flex items-center rounded-lg text-sm transition-colors",g?"w-full gap-3 px-3 py-2":"w-10 h-10 justify-center shrink-0",C?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(j,{className:"h-4 w-4 shrink-0"}),g&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"flex-1 text-left",children:v.label}),y&&l.jsx(k.ChevronDown,{className:w("h-4 w-4 transition-transform",L&&"rotate-180")})]})]}),y&&L&&g&&l.jsx("div",{className:"ml-4 mt-1 space-y-1 border-l pl-2",children:v.children.map(S=>{const T=S.icon,z=e===S.id;return l.jsxs("button",{onClick:()=>n==null?void 0:n(S.id),className:w("flex w-full items-center gap-2 rounded px-3 py-1.5 text-sm transition-colors",z?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[T&&l.jsx(T,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:S.label})]},S.id)})})]},v.id)})})}),a&&l.jsx("div",{className:"py-3 px-2",children:l.jsx(E0,{user:a,menuItems:i,onLogout:s,expanded:g})})]})}function rv({title:t="Menu",groups:e,activeItemLabel:n,items:r,onAddClick:a,footerContent:i,className:s,collapsed:o,onCollapsedChange:f,collapsible:c=!1,defaultCollapsed:d=!1}){const[u,p]=I.useState([]),[h,m]=I.useState(d),g=o!==void 0?o:h,b=()=>{const j=!g;m(j),f==null||f(j)},x=j=>{p(y=>y.includes(j)?y.filter(L=>L!==j):[...y,j])},v=j=>j.map((y,L)=>{const C=y.icon,N=y.active||n&&y.label===n;return l.jsxs("button",{onClick:y.onClick,className:w("flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-all relative",N?"bg-accent text-foreground font-semibold border-l-2 border-l-primary":y.highlighted?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[l.jsx(C,{className:w("h-4 w-4 shrink-0 transition-colors",N&&"text-primary")}),l.jsx("span",{className:w("flex-1 text-left"),children:y.label}),y.badge&&l.jsx(pe,{variant:"secondary",className:w("min-w-5 px-1.5 text-xs",N&&"bg-primary/10 text-primary font-medium"),children:y.badge}),y.chevron&&l.jsx(k.ChevronRight,{className:"h-3 w-3"})]},L)});return l.jsxs("div",{className:w("flex flex-col bg-background transition-all duration-300 rounded-lg my-2 ml-2",g?"w-0 overflow-hidden border-0":"w-64 border",s),style:{height:"calc(100% - 1rem)"},children:[l.jsxs("div",{className:"flex h-16 min-h-16 items-center justify-between px-4",children:[l.jsx("h2",{className:"text-sm font-semibold truncate",children:t}),l.jsxs("div",{className:"flex items-center gap-1",children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0",onClick:a,children:l.jsx(k.Plus,{className:"h-4 w-4"})}),c&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0",onClick:b,title:g?"Expandir menu":"Recolher menu",children:l.jsx(k.ChevronRight,{className:w("h-4 w-4 transition-transform",!g&&"rotate-180")})})]})]}),l.jsx(Wo,{className:"flex-1",children:l.jsxs("div",{className:"p-3 space-y-4",children:[e&&e.map(j=>{const y=u.includes(j.title);return l.jsxs("div",{className:"space-y-1",children:[j.collapsible?l.jsxs("button",{onClick:()=>x(j.title),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(k.ChevronDown,{className:w("h-3 w-3 transition-transform",y&&"-rotate-90")}),j.title]}):l.jsx("div",{className:"px-3 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:j.title}),!y&&l.jsx("div",{className:"space-y-0.5",children:v(j.items)})]},j.title)}),r&&!e&&l.jsx("div",{className:"space-y-0.5",children:v(r)})]})}),i&&l.jsx("div",{className:"p-4",children:i})]})}function av({...t}){return l.jsx(Dx.Root,{"data-slot":"aspect-ratio",...t})}const Cu=$t.cva("min-h-screen w-full",{variants:{variant:{centered:"flex items-center justify-center bg-background p-4",split:"grid lg:grid-cols-2"}},defaultVariants:{variant:"centered"}}),A0=I.forwardRef(({variant:t="centered",children:e,logo:n,title:r,description:a,image:i,imageAlt:s="Authentication",footerLinks:o,formClassName:f},c)=>{const d=t==="split",u=()=>l.jsxs("div",{className:w("flex flex-col gap-6",d?"min-h-screen justify-center px-8 py-12 lg:px-16":"w-full max-w-md"),children:[l.jsx("div",{className:w("flex justify-center",d&&"lg:justify-start"),children:n||l.jsx(Ys,{className:"w-32 h-auto"})}),(r||a)&&l.jsxs("div",{className:"space-y-2 text-center lg:text-left",children:[r&&l.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r}),a&&l.jsx("p",{className:"text-sm text-muted-foreground",children:a})]}),l.jsx("div",{className:w("space-y-6",f),children:e}),o&&o.length>0&&l.jsx("div",{className:"flex flex-wrap items-center justify-center gap-4 text-sm text-muted-foreground lg:justify-start",children:o.map((h,m)=>l.jsxs(I.Fragment,{children:[l.jsx("a",{href:h.href,className:"hover:text-foreground transition-colors",children:h.label}),m<o.length-1&&l.jsx("span",{className:"text-muted-foreground/50",children:"•"})]},h.href))})]}),p=()=>!d||!i?null:l.jsxs("div",{className:"relative hidden lg:block bg-muted",children:[typeof i=="string"?l.jsx("img",{src:i,alt:s,className:"absolute inset-0 h-full w-full object-cover"}):l.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-12",children:i}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/10 via-transparent to-transparent"})]});return t==="split"?l.jsxs("div",{ref:c,className:w(Cu({variant:t})),children:[l.jsx(u,{}),l.jsx(p,{})]}):l.jsx("div",{ref:c,className:w(Cu({variant:t})),children:l.jsx(u,{})})});A0.displayName="AuthLayout";function z0({...t}){return l.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function O0({className:t,...e}){return l.jsx("ol",{"data-slot":"breadcrumb-list",className:w("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...e})}function P0({className:t,...e}){return l.jsx("li",{"data-slot":"breadcrumb-item",className:w("inline-flex items-center gap-1.5",t),...e})}function R0({asChild:t,className:e,...n}){const r=t?kn.Slot:"a";return l.jsx(r,{"data-slot":"breadcrumb-link",className:w("hover:text-foreground transition-colors",e),...n})}function B0({className:t,...e}){return l.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:w("text-foreground font-normal",t),...e})}function H0({children:t,className:e,...n}){return l.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:w("[&>svg]:size-3.5",e),...n,children:t??l.jsx(k.ChevronRight,{})})}function iv({className:t,...e}){return l.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:w("flex size-9 items-center justify-center",t),...e,children:[l.jsx(k.MoreHorizontal,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"More"})]})}const F0=I.createContext(null);function $o(){const t=I.useContext(F0);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function sv({orientation:t="horizontal",opts:e,setApi:n,plugins:r,className:a,children:i,...s}){const[o,f]=fx({...e,axis:t==="horizontal"?"x":"y"},r),[c,d]=I.useState(!1),[u,p]=I.useState(!1),h=I.useCallback(x=>{x&&(d(x.canScrollPrev()),p(x.canScrollNext()))},[]),m=I.useCallback(()=>{f==null||f.scrollPrev()},[f]),g=I.useCallback(()=>{f==null||f.scrollNext()},[f]),b=I.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),m()):x.key==="ArrowRight"&&(x.preventDefault(),g())},[m,g]);return I.useEffect(()=>{!f||!n||n(f)},[f,n]),I.useEffect(()=>{if(f)return h(f),f.on("reInit",h),f.on("select",h),()=>{f==null||f.off("select",h)}},[f,h]),l.jsx(F0.Provider,{value:{carouselRef:o,api:f,opts:e,orientation:t||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:g,canScrollPrev:c,canScrollNext:u},children:l.jsx("div",{onKeyDownCapture:b,className:w("relative",a),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...s,children:i})})}function ov({className:t,...e}){const{carouselRef:n,orientation:r}=$o();return l.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:l.jsx("div",{className:w("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...e})})}function lv({className:t,...e}){const{orientation:n}=$o();return l.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:w("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",t),...e})}function fv({className:t,variant:e="outline",size:n="icon",...r}){const{orientation:a,scrollPrev:i,canScrollPrev:s}=$o();return l.jsxs(F,{"data-slot":"carousel-previous",variant:e,size:n,className:w("absolute size-8 rounded-full",a==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!s,onClick:i,...r,children:[l.jsx(k.ArrowLeft,{}),l.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function cv({className:t,variant:e="outline",size:n="icon",...r}){const{orientation:a,scrollNext:i,canScrollNext:s}=$o();return l.jsxs(F,{"data-slot":"carousel-next",variant:e,size:n,className:w("absolute size-8 rounded-full",a==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!s,onClick:i,...r,children:[l.jsx(k.ArrowRight,{}),l.jsx("span",{className:"sr-only",children:"Next slide"})]})}const dv={light:"",dark:".dark"},U0=I.createContext(null);function _0(){const t=I.useContext(U0);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}function uv({id:t,className:e,children:n,config:r,...a}){const i=I.useId(),s=`chart-${t||i.replace(/:/g,"")}`;return l.jsx(U0.Provider,{value:{config:r},children:l.jsxs("div",{"data-slot":"chart","data-chart":s,className:w("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",e),...a,children:[l.jsx(hv,{id:s,config:r}),l.jsx(Cc.ResponsiveContainer,{children:n})]})})}const hv=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?l.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(dv).map(([r,a])=>`
2
2
  ${a} [data-chart=${t}] {
3
3
  ${n.map(([i,s])=>{var f;const o=((f=s.theme)==null?void 0:f[r])||s.color;return o?` --color-${i}: ${o};`:null}).join(`
4
4
  `)}
@@ -88,7 +88,7 @@ img.ProseMirror-separator {
88
88
  display: block;
89
89
  }`;function CC(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.setAttribute("data-tiptap-style",""),a.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(a),a}var LC=class extends dC{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:_j,createMappablePosition:Jj},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:a,moved:i})=>this.options.onDrop(r,a,i)),this.on("paste",({event:r,slice:a})=>this.options.onPaste(r,a)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=Lm(e,this.options.autofocus);this.editorState=ra.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=CC(jC,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=Im(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(a=>{const i=typeof a=="string"?`${a}$`:a.key;n=n.filter(s=>!s.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[Qm,Jm.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Vm,$m,Zm,Km,Ym,qm,Gm,Xm.configure({direction:this.options.textDirection})].filter(a=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[a.name]!==!1:!0):[],...this.options.extensions].filter(a=>["extension","node","mark"].includes(a==null?void 0:a.type));this.extensionManager=new cl(r,this)}createCommandManager(){this.commandManager=new il({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Vf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Vf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),a=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new vm(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:a,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const f=this.view.dom;f.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(c)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),a=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!a)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const s=n.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),o=s==null?void 0:s.getMeta("focus"),f=s==null?void 0:s.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:s}),f&&this.emit("blur",{editor:this,event:f.event,transaction:s}),!(t.getMeta("preventUpdate")||!n.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Om(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return Hj(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return td(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
90
90
 
91
- `,textSerializers:n={}}=t||{};return Aj(this.state.doc,{blockSeparator:e,textSerializers:{...zm(this.schema),...n}})}get isEmpty(){return ll(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new MC(e,this)}get $doc(){return this.$pos(0)}};function ga(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=ue(t.getAttributes,void 0,r);if(a===!1||a===null)return null;const{tr:i}=e,s=r[r.length-1],o=r[0];if(s){const f=o.search(/\S/),c=n.from+o.indexOf(s),d=c+s.length;if(nd(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+f,c);const p=n.from+f+s.length;i.addMark(n.from+f,p,t.type.create(a||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function eg(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=ue(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let o=n.to;const f=t.type.create(a);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=s+c;d>o?d=o:o=d+r[1].length;const u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(d,o,f)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(a)).delete(i.mapping.map(s),i.mapping.map(o))}i.scrollIntoView()},undoable:t.undoable})}function Yf(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=e.doc.resolve(n.from),i=ue(t.getAttributes,void 0,r)||{};if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function ba(t){return new fl({find:t.find,handler:({state:e,range:n,match:r,chain:a})=>{const i=ue(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),f=s.doc.resolve(n.from).blockRange(),c=f&&Oc(f,t.type,i);if(!c)return null;if(s.wrap(f,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,m=p||u.$to.parentOffset&&u.$from.marks();if(m){const g=m.filter(b=>h.includes(b.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";a().updateAttributes(u,i).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Xn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)},undoable:t.undoable})}var NC=t=>"touches"in t,kC=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const f=o.clientX-this.startX,c=o.clientY-this.startY;this.handleResize(f,c)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const f=o.touches[0];if(!f)return;const c=f.clientX-this.startX,d=f.clientY-this.startY;this.handleResize(c,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,f=this.element.offsetHeight;this.onCommit(o,f),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,a,i,s;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(a=t.options)!=null&&a.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(s=t.options)!=null&&s.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),a=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),a&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,NC(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:a}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,a,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,a=this.startHeight;const i=t.includes("right"),s=t.includes("left"),o=t.includes("bottom"),f=t.includes("top");return i?r=this.startWidth+e:s&&(r=this.startWidth-e),o?a=this.startHeight+n:f&&(a=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(a=this.startHeight+(o?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,a,t):{width:r,height:a}}applyConstraints(t,e,n){var r,a,i,s;if(!n){let c=Math.max(this.minSize.width,t),d=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(a=this.maxSize)!=null&&a.height&&(d=Math.min(this.maxSize.height,d)),{width:c,height:d}}let o=t,f=e;return o<this.minSize.width&&(o=this.minSize.width,f=o/this.aspectRatio),f<this.minSize.height&&(f=this.minSize.height,o=f*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&o>this.maxSize.width&&(o=this.maxSize.width,f=o/this.aspectRatio),(s=this.maxSize)!=null&&s.height&&f>this.maxSize.height&&(f=this.maxSize.height,o=f*this.aspectRatio),{width:o,height:f}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",a=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:a?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function SC(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof $){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let a=r.depth;for(;a>=0;){const i=r.index(a);if(r.node(a).contentMatchAt(i).matchType(e))return!0;a-=1}return!1}function TC(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var IC={};qc(IC,{createAtomBlockMarkdownSpec:()=>DC,createBlockMarkdownSpec:()=>EC,createInlineMarkdownSpec:()=>tg,parseAttributes:()=>ad,parseIndentedBlocks:()=>Qf,renderNestedMarkdownContent:()=>sd,serializeAttributes:()=>id});function ad(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),a=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(a){const c=a.map(d=>d.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,c,d])=>{var u;const p=parseInt(((u=d.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),h=n[p];h&&(e[c]=h.slice(1,-1))});const f=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return f&&f.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function id(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function DC(t){const{nodeName:e,name:n,parseAttributes:r=ad,serializeAttributes:a=id,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:o}=t,f=n||e,c=d=>{if(!o)return d;const u={};return o.forEach(p=>{p in d&&(u[p]=d[p])}),u};return{parseMarkdown:(d,u)=>{const p={...i,...d.attributes};return u.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const p=new RegExp(`^:::${f}(?:\\s|$)`,"m"),h=(u=d.match(p))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,p){const h=new RegExp(`^:::${f}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(h);if(!m)return;const g=m[1]||"",b=r(g);if(!s.find(v=>!(v in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:d=>{const u=c(d.attrs||{}),p=a(u),h=p?` {${p}}`:"";return`:::${f}${h} :::`}}}function EC(t){const{nodeName:e,name:n,getContent:r,parseAttributes:a=ad,serializeAttributes:i=id,defaultAttributes:s={},content:o="block",allowedAttributes:f}=t,c=n||e,d=u=>{if(!f)return u;const p={};return f.forEach(h=>{h in u&&(p[h]=u[h])}),p};return{parseMarkdown:(u,p)=>{let h;if(r){const g=r(u);h=typeof g=="string"?[{type:"text",text:g}]:g}else o==="block"?h=p.parseChildren(u.tokens||[]):h=p.parseInline(u.tokens||[]);const m={...s,...u.attributes};return p.createNode(e,m,h)},markdownTokenizer:{name:e,level:"block",start(u){var p;const h=new RegExp(`^:::${c}`,"m"),m=(p=u.match(h))==null?void 0:p.index;return m!==void 0?m:-1},tokenize(u,p,h){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=u.match(g);if(!b)return;const[x,v=""]=b,j=a(v);let y=1;const L=x.length;let C="";const N=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(L);for(N.lastIndex=0;;){const T=N.exec(S);if(T===null)break;const z=T.index,P=T[1];if(!((m=T[2])!=null&&m.endsWith(":::"))){if(P)y+=1;else if(y-=1,y===0){const U=S.slice(0,z);C=U.trim();const J=u.slice(0,L+z+T[0].length);let G=[];if(C)if(o==="block")for(G=h.blockTokens(U),G.forEach(K=>{K.text&&(!K.tokens||K.tokens.length===0)&&(K.tokens=h.inlineTokens(K.text))});G.length>0;){const K=G[G.length-1];if(K.type==="paragraph"&&(!K.text||K.text.trim()===""))G.pop();else break}else G=h.inlineTokens(C);return{type:e,raw:J,attributes:j,content:C,tokens:G}}}}}},renderMarkdown:(u,p)=>{const h=d(u.attrs||{}),m=i(h),g=m?` {${m}}`:"",b=p.renderChildren(u.content||[],`
91
+ `,textSerializers:n={}}=t||{};return Aj(this.state.doc,{blockSeparator:e,textSerializers:{...zm(this.schema),...n}})}get isEmpty(){return ll(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new MC(e,this)}get $doc(){return this.$pos(0)}};function ga(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=ue(t.getAttributes,void 0,r);if(a===!1||a===null)return null;const{tr:i}=e,s=r[r.length-1],o=r[0];if(s){const f=o.search(/\S/),c=n.from+o.indexOf(s),d=c+s.length;if(nd(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+f,c);const p=n.from+f+s.length;i.addMark(n.from+f,p,t.type.create(a||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function eg(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=ue(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let o=n.to;const f=t.type.create(a);if(r[1]){const c=r[0].lastIndexOf(r[1]);let d=s+c;d>o?d=o:o=d+r[1].length;const u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(d,o,f)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(a)).delete(i.mapping.map(s),i.mapping.map(o))}i.scrollIntoView()},undoable:t.undoable})}function Yf(t){return new fl({find:t.find,handler:({state:e,range:n,match:r})=>{const a=e.doc.resolve(n.from),i=ue(t.getAttributes,void 0,r)||{};if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function ba(t){return new fl({find:t.find,handler:({state:e,range:n,match:r,chain:a})=>{const i=ue(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),f=s.doc.resolve(n.from).blockRange(),c=f&&Oc(f,t.type,i);if(!c)return null;if(s.wrap(f,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,m=p||u.$to.parentOffset&&u.$from.marks();if(m){const g=m.filter(b=>h.includes(b.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";a().updateAttributes(u,i).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Xn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)},undoable:t.undoable})}var NC=t=>"touches"in t,kC=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const f=o.clientX-this.startX,c=o.clientY-this.startY;this.handleResize(f,c)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const f=o.touches[0];if(!f)return;const c=f.clientX-this.startX,d=f.clientY-this.startY;this.handleResize(c,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,f=this.element.offsetHeight;this.onCommit(o,f),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,n,r,a,i,s;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(n=t.options)!=null&&n.max&&(this.maxSize=t.options.max),(r=t==null?void 0:t.options)!=null&&r.directions&&(this.directions=t.options.directions),(a=t.options)!=null&&a.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(s=t.options)!=null&&s.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,n){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const n=e.includes("top"),r=e.includes("bottom"),a=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),a&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",n=>this.handleResizeStart(n,t)),e.addEventListener("touchstart",n=>this.handleResizeStart(n,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,NC(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:a}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(r,a,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,n){let r=this.startWidth,a=this.startHeight;const i=t.includes("right"),s=t.includes("left"),o=t.includes("bottom"),f=t.includes("top");return i?r=this.startWidth+e:s&&(r=this.startWidth-e),o?a=this.startHeight+n:f&&(a=this.startHeight-n),(t==="right"||t==="left")&&(r=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(a=this.startHeight+(o?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,a,t):{width:r,height:a}}applyConstraints(t,e,n){var r,a,i,s;if(!n){let c=Math.max(this.minSize.width,t),d=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(a=this.maxSize)!=null&&a.height&&(d=Math.min(this.maxSize.height,d)),{width:c,height:d}}let o=t,f=e;return o<this.minSize.width&&(o=this.minSize.width,f=o/this.aspectRatio),f<this.minSize.height&&(f=this.minSize.height,o=f*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&o>this.maxSize.width&&(o=this.maxSize.width,f=o/this.aspectRatio),(s=this.maxSize)!=null&&s.height&&f>this.maxSize.height&&(f=this.maxSize.height,o=f*this.aspectRatio),{width:o,height:f}}applyAspectRatio(t,e,n){const r=n==="left"||n==="right",a=n==="top"||n==="bottom";return r?{width:t,height:t/this.aspectRatio}:a?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function SC(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof $){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let a=r.depth;for(;a>=0;){const i=r.index(a);if(r.node(a).contentMatchAt(i).matchType(e))return!0;a-=1}return!1}function TC(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var IC={};qc(IC,{createAtomBlockMarkdownSpec:()=>DC,createBlockMarkdownSpec:()=>EC,createInlineMarkdownSpec:()=>tg,parseAttributes:()=>ad,parseIndentedBlocks:()=>Qf,renderNestedMarkdownContent:()=>sd,serializeAttributes:()=>id});function ad(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,c=>(n.push(c),`__QUOTED_${n.length-1}__`)),a=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(a){const c=a.map(d=>d.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,c,d])=>{var u;const p=parseInt(((u=d.match(/__QUOTED_(\d+)__/))==null?void 0:u[1])||"0",10),h=n[p];h&&(e[c]=h.slice(1,-1))});const f=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return f&&f.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function id(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function DC(t){const{nodeName:e,name:n,parseAttributes:r=ad,serializeAttributes:a=id,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:o}=t,f=n||e,c=d=>{if(!o)return d;const u={};return o.forEach(p=>{p in d&&(u[p]=d[p])}),u};return{parseMarkdown:(d,u)=>{const p={...i,...d.attributes};return u.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const p=new RegExp(`^:::${f}(?:\\s|$)`,"m"),h=(u=d.match(p))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,p){const h=new RegExp(`^:::${f}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=d.match(h);if(!m)return;const g=m[1]||"",b=r(g);if(!s.find(v=>!(v in b)))return{type:e,raw:m[0],attributes:b}}},renderMarkdown:d=>{const u=c(d.attrs||{}),p=a(u),h=p?` {${p}}`:"";return`:::${f}${h} :::`}}}function EC(t){const{nodeName:e,name:n,getContent:r,parseAttributes:a=ad,serializeAttributes:i=id,defaultAttributes:s={},content:o="block",allowedAttributes:f}=t,c=n||e,d=u=>{if(!f)return u;const p={};return f.forEach(h=>{h in u&&(p[h]=u[h])}),p};return{parseMarkdown:(u,p)=>{let h;if(r){const g=r(u);h=typeof g=="string"?[{type:"text",text:g}]:g}else o==="block"?h=p.parseChildren(u.tokens||[]):h=p.parseInline(u.tokens||[]);const m={...s,...u.attributes};return p.createNode(e,m,h)},markdownTokenizer:{name:e,level:"block",start(u){var p;const h=new RegExp(`^:::${c}`,"m"),m=(p=u.match(h))==null?void 0:p.index;return m!==void 0?m:-1},tokenize(u,p,h){var m;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),b=u.match(g);if(!b)return;const[x,v=""]=b,j=a(v);let y=1;const L=x.length;let C="";const N=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(L);for(N.lastIndex=0;;){const T=N.exec(S);if(T===null)break;const z=T.index,P=T[1];if(!((m=T[2])!=null&&m.endsWith(":::"))){if(P)y+=1;else if(y-=1,y===0){const U=S.slice(0,z);C=U.trim();const J=u.slice(0,L+z+T[0].length);let Y=[];if(C)if(o==="block")for(Y=h.blockTokens(U),Y.forEach(K=>{K.text&&(!K.tokens||K.tokens.length===0)&&(K.tokens=h.inlineTokens(K.text))});Y.length>0;){const K=Y[Y.length-1];if(K.type==="paragraph"&&(!K.text||K.text.trim()===""))Y.pop();else break}else Y=h.inlineTokens(C);return{type:e,raw:J,attributes:j,content:C,tokens:Y}}}}}},renderMarkdown:(u,p)=>{const h=d(u.attrs||{}),m=i(h),g=m?` {${m}}`:"",b=p.renderChildren(u.content||[],`
92
92
 
93
93
  `);return`:::${c}${g}
94
94
 
@@ -129,7 +129,7 @@ ${n}
129
129
  `):""}),K6=ct.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ye(this.options.HTMLAttributes,t)]},renderText(){return`
130
130
  `},renderMarkdown:()=>`
131
131
  `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:a,storedMarks:i}=n;if(a.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:o}=r.extensionManager,f=i||a.$to.parentOffset&&a.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&f&&s){const u=f.filter(p=>o.includes(p.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),X6=ct.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ye(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,a="#".repeat(r);return t.content?`${a} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Yf({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),eL=ct.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ye(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!SC(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,a=t();return Rm(n)?a.insertContentAt(r.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({state:i,tr:s,dispatch:o})=>{if(o){const{$to:f}=s.selection,c=f.end();if(f.nodeAfter)f.nodeAfter.isTextblock?s.setSelection(te.create(s.doc,f.pos+1)):f.nodeAfter.isBlock?s.setSelection($.create(s.doc,f.pos)):s.setSelection(te.create(s.doc,f.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||f.parent.type.contentMatch.defaultType,u=d==null?void 0:d.create();u&&(s.insert(c,u),s.setSelection(te.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[eg({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),tL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,nL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,rL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,aL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,iL=zr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ye(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ga({find:tL,type:this.type}),ga({find:rL,type:this.type})]},addPasteRules(){return[Sr({find:nL,type:this.type}),Sr({find:aL,type:this.type})]}});const sL="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",oL="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",$f="numeric",Zf="ascii",qf="alpha",ri="asciinumeric",Wa="alphanumeric",Kf="domain",fg="emoji",lL="scheme",fL="slashscheme",nf="whitespace";function cL(t,e){return t in e||(e[t]=[]),e[t]}function pr(t,e,n){e[$f]&&(e[ri]=!0,e[Wa]=!0),e[Zf]&&(e[ri]=!0,e[qf]=!0),e[ri]&&(e[Wa]=!0),e[qf]&&(e[Wa]=!0),e[Wa]&&(e[Kf]=!0),e[fg]&&(e[Kf]=!0);for(const r in e){const a=cL(r,n);a.indexOf(t)<0&&a.push(t)}}function dL(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function ut(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ut.groups={};ut.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const a=e.jr[r][0],i=e.jr[r][1];if(i&&a.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let a=0;a<t.length;a++)this.tt(t[a],e,n,r)},tr(t,e,n,r){r=r||ut.groups;let a;return e&&e.j?a=e:(a=new ut(e),n&&r&&pr(e,n,r)),this.jr.push([t,a]),a},ts(t,e,n,r){let a=this;const i=t.length;if(!i)return a;for(let s=0;s<i-1;s++)a=a.tt(t[s]);return a.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||ut.groups;const a=this;if(e&&e.j)return a.j[t]=e,e;const i=e;let s,o=a.go(t);if(o?(s=new ut,Object.assign(s.j,o.j),s.jr.push.apply(s.jr,o.jr),s.jd=o.jd,s.t=o.t):s=new ut,i){if(r)if(s.t&&typeof s.t=="string"){const f=Object.assign(dL(s.t,r),n);pr(i,f,r)}else n&&pr(i,n,r);s.t=i}return a.j[t]=s,s}};const ae=(t,e,n,r,a)=>t.ta(e,n,r,a),Ne=(t,e,n,r,a)=>t.tr(e,n,r,a),Uh=(t,e,n,r,a)=>t.ts(e,n,r,a),R=(t,e,n,r,a)=>t.tt(e,n,r,a),yn="WORD",Xf="UWORD",cg="ASCIINUMERICAL",dg="ALPHANUMERICAL",Li="LOCALHOST",ec="TLD",tc="UTLD",Os="SCHEME",ea="SLASH_SCHEME",fd="NUM",nc="WS",cd="NL",ai="OPENBRACE",ii="CLOSEBRACE",fo="OPENBRACKET",co="CLOSEBRACKET",uo="OPENPAREN",ho="CLOSEPAREN",po="OPENANGLEBRACKET",mo="CLOSEANGLEBRACKET",go="FULLWIDTHLEFTPAREN",bo="FULLWIDTHRIGHTPAREN",xo="LEFTCORNERBRACKET",yo="RIGHTCORNERBRACKET",vo="LEFTWHITECORNERBRACKET",wo="RIGHTWHITECORNERBRACKET",Mo="FULLWIDTHLESSTHAN",jo="FULLWIDTHGREATERTHAN",Co="AMPERSAND",Lo="APOSTROPHE",No="ASTERISK",zn="AT",ko="BACKSLASH",So="BACKTICK",To="CARET",Rn="COLON",dd="COMMA",Io="DOLLAR",qt="DOT",Do="EQUALS",ud="EXCLAMATION",Tt="HYPHEN",si="PERCENT",Eo="PIPE",Ao="PLUS",zo="POUND",oi="QUERY",hd="QUOTE",ug="FULLWIDTHMIDDLEDOT",pd="SEMI",Kt="SLASH",li="TILDE",Oo="UNDERSCORE",hg="EMOJI",Po="SYM";var pg=Object.freeze({__proto__:null,ALPHANUMERICAL:dg,AMPERSAND:Co,APOSTROPHE:Lo,ASCIINUMERICAL:cg,ASTERISK:No,AT:zn,BACKSLASH:ko,BACKTICK:So,CARET:To,CLOSEANGLEBRACKET:mo,CLOSEBRACE:ii,CLOSEBRACKET:co,CLOSEPAREN:ho,COLON:Rn,COMMA:dd,DOLLAR:Io,DOT:qt,EMOJI:hg,EQUALS:Do,EXCLAMATION:ud,FULLWIDTHGREATERTHAN:jo,FULLWIDTHLEFTPAREN:go,FULLWIDTHLESSTHAN:Mo,FULLWIDTHMIDDLEDOT:ug,FULLWIDTHRIGHTPAREN:bo,HYPHEN:Tt,LEFTCORNERBRACKET:xo,LEFTWHITECORNERBRACKET:vo,LOCALHOST:Li,NL:cd,NUM:fd,OPENANGLEBRACKET:po,OPENBRACE:ai,OPENBRACKET:fo,OPENPAREN:uo,PERCENT:si,PIPE:Eo,PLUS:Ao,POUND:zo,QUERY:oi,QUOTE:hd,RIGHTCORNERBRACKET:yo,RIGHTWHITECORNERBRACKET:wo,SCHEME:Os,SEMI:pd,SLASH:Kt,SLASH_SCHEME:ea,SYM:Po,TILDE:li,TLD:ec,UNDERSCORE:Oo,UTLD:tc,UWORD:Xf,WORD:yn,WS:nc});const bn=/[a-z]/,Fa=new RegExp("\\p{L}","u"),rf=new RegExp("\\p{Emoji}","u"),xn=/\d/,af=/\s/,_h="\r",sf=`
132
- `,uL="️",hL="‍",of="";let Ms=null,js=null;function pL(t=[]){const e={};ut.groups=e;const n=new ut;Ms==null&&(Ms=Jh(sL)),js==null&&(js=Jh(oL)),R(n,"'",Lo),R(n,"{",ai),R(n,"}",ii),R(n,"[",fo),R(n,"]",co),R(n,"(",uo),R(n,")",ho),R(n,"<",po),R(n,">",mo),R(n,"(",go),R(n,")",bo),R(n,"「",xo),R(n,"」",yo),R(n,"『",vo),R(n,"』",wo),R(n,"<",Mo),R(n,">",jo),R(n,"&",Co),R(n,"*",No),R(n,"@",zn),R(n,"`",So),R(n,"^",To),R(n,":",Rn),R(n,",",dd),R(n,"$",Io),R(n,".",qt),R(n,"=",Do),R(n,"!",ud),R(n,"-",Tt),R(n,"%",si),R(n,"|",Eo),R(n,"+",Ao),R(n,"#",zo),R(n,"?",oi),R(n,'"',hd),R(n,"/",Kt),R(n,";",pd),R(n,"~",li),R(n,"_",Oo),R(n,"\\",ko),R(n,"・",ug);const r=Ne(n,xn,fd,{[$f]:!0});Ne(r,xn,r);const a=Ne(r,bn,cg,{[ri]:!0}),i=Ne(r,Fa,dg,{[Wa]:!0}),s=Ne(n,bn,yn,{[Zf]:!0});Ne(s,xn,a),Ne(s,bn,s),Ne(a,xn,a),Ne(a,bn,a);const o=Ne(n,Fa,Xf,{[qf]:!0});Ne(o,bn),Ne(o,xn,i),Ne(o,Fa,o),Ne(i,xn,i),Ne(i,bn),Ne(i,Fa,i);const f=R(n,sf,cd,{[nf]:!0}),c=R(n,_h,nc,{[nf]:!0}),d=Ne(n,af,nc,{[nf]:!0});R(n,of,d),R(c,sf,f),R(c,of,d),Ne(c,af,d),R(d,_h),R(d,sf),Ne(d,af,d),R(d,of,d);const u=Ne(n,rf,hg,{[fg]:!0});R(u,"#"),Ne(u,rf,u),R(u,uL,u);const p=R(u,hL);R(p,"#"),Ne(p,rf,u);const h=[[bn,s],[xn,a]],m=[[bn,null],[Fa,o],[xn,i]];for(let g=0;g<Ms.length;g++)Dn(n,Ms[g],ec,yn,h);for(let g=0;g<js.length;g++)Dn(n,js[g],tc,Xf,m);pr(ec,{tld:!0,ascii:!0},e),pr(tc,{utld:!0,alpha:!0},e),Dn(n,"file",Os,yn,h),Dn(n,"mailto",Os,yn,h),Dn(n,"http",ea,yn,h),Dn(n,"https",ea,yn,h),Dn(n,"ftp",ea,yn,h),Dn(n,"ftps",ea,yn,h),pr(Os,{scheme:!0,ascii:!0},e),pr(ea,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],v=t[g][1]?{[lL]:!0}:{[fL]:!0};b.indexOf("-")>=0?v[Kf]=!0:bn.test(b)?xn.test(b)?v[ri]=!0:v[Zf]=!0:v[$f]=!0,Uh(n,b,b,v)}return Uh(n,"localhost",Li,{ascii:!0}),n.jd=new ut(Po),{start:n,tokens:Object.assign({groups:e},pg)}}function mg(t,e){const n=mL(e.replace(/[A-Z]/g,o=>o.toLowerCase())),r=n.length,a=[];let i=0,s=0;for(;s<r;){let o=t,f=null,c=0,d=null,u=-1,p=-1;for(;s<r&&(f=o.go(n[s]));)o=f,o.accepts()?(u=0,p=0,d=o):u>=0&&(u+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=p,c-=u,a.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return a}function mL(t){const e=[],n=t.length;let r=0;for(;r<n;){let a=t.charCodeAt(r),i,s=a<55296||a>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Dn(t,e,n,r,a){let i;const s=e.length;for(let o=0;o<s-1;o++){const f=e[o];t.j[f]?i=t.j[f]:(i=new ut(r),i.jr=a.slice(),t.j[f]=i),t=i}return i=new ut(n),i.jr=a.slice(),t.j[e[s-1]]=i,i}function Jh(t){const e=[],n=[];let r=0,a="0123456789";for(;r<t.length;){let i=0;for(;a.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ni={defaultProtocol:"http",events:null,format:Vh,formatHref:Vh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function md(t,e=null){let n=Object.assign({},Ni);t&&(n=Object.assign(n,t instanceof md?t.o:t));const r=n.ignoreTags,a=[];for(let i=0;i<r.length;i++)a.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=a}md.prototype={o:Ni,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let a=this.o[t];return a&&(typeof a=="object"?(a=n.t in a?a[n.t]:Ni[t],typeof a=="function"&&r&&(a=a(e,n))):typeof a=="function"&&r&&(a=a(e,n.t,n)),a)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Vh(t){return t}function gg(t,e){this.t="token",this.v=t,this.tk=e}gg.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ni.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),a=t.get("tagName",n,e),i=this.toFormattedString(t),s={},o=t.get("className",n,e),f=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,o&&(s.class=o),f&&(s.target=f),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:a,attributes:s,content:i,eventListeners:u}}};function dl(t,e){class n extends gg{constructor(a,i){super(a,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Gh=dl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Yh=dl("text"),gL=dl("nl"),Cs=dl("url",{isLink:!0,toHref(t=Ni.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Li&&t[1].t===Rn}}),Nt=t=>new ut(t);function bL({groups:t}){const e=t.domain.concat([Co,No,zn,ko,So,To,Io,Do,Tt,fd,si,Eo,Ao,zo,Kt,Po,li,Oo]),n=[Lo,Rn,dd,qt,ud,si,oi,hd,pd,po,mo,ai,ii,co,fo,uo,ho,go,bo,xo,yo,vo,wo,Mo,jo],r=[Co,Lo,No,ko,So,To,Io,Do,Tt,ai,ii,si,Eo,Ao,zo,oi,Kt,Po,li,Oo],a=Nt(),i=R(a,li);ae(i,r,i),ae(i,t.domain,i);const s=Nt(),o=Nt(),f=Nt();ae(a,t.domain,s),ae(a,t.scheme,o),ae(a,t.slashscheme,f),ae(s,r,i),ae(s,t.domain,s);const c=R(s,zn);R(i,zn,c),R(o,zn,c),R(f,zn,c);const d=R(i,qt);ae(d,r,i),ae(d,t.domain,i);const u=Nt();ae(c,t.domain,u),ae(u,t.domain,u);const p=R(u,qt);ae(p,t.domain,u);const h=Nt(Gh);ae(p,t.tld,h),ae(p,t.utld,h),R(c,Li,h);const m=R(u,Tt);R(m,Tt,m),ae(m,t.domain,u),ae(h,t.domain,u),R(h,qt,p),R(h,Tt,m);const g=R(h,Rn);ae(g,t.numeric,Gh);const b=R(s,Tt),x=R(s,qt);R(b,Tt,b),ae(b,t.domain,s),ae(x,r,i),ae(x,t.domain,s);const v=Nt(Cs);ae(x,t.tld,v),ae(x,t.utld,v),ae(v,t.domain,s),ae(v,r,i),R(v,qt,x),R(v,Tt,b),R(v,zn,c);const j=R(v,Rn),y=Nt(Cs);ae(j,t.numeric,y);const L=Nt(Cs),C=Nt();ae(L,e,L),ae(L,n,C),ae(C,e,L),ae(C,n,C),R(v,Kt,L),R(y,Kt,L);const N=R(o,Rn),S=R(f,Rn),T=R(S,Kt),z=R(T,Kt);ae(o,t.domain,s),R(o,qt,x),R(o,Tt,b),ae(f,t.domain,s),R(f,qt,x),R(f,Tt,b),ae(N,t.domain,L),R(N,Kt,L),R(N,oi,L),ae(z,t.domain,L),ae(z,e,L),R(z,Kt,L);const P=[[ai,ii],[fo,co],[uo,ho],[po,mo],[go,bo],[xo,yo],[vo,wo],[Mo,jo]];for(let U=0;U<P.length;U++){const[J,G]=P[U],K=R(L,J);R(C,J,K),R(K,G,L);const E=Nt(Cs);ae(K,e,E);const Y=Nt();ae(K,n),ae(E,e,E),ae(E,n,Y),ae(Y,e,E),ae(Y,n,Y),R(E,G,L),R(Y,G,L)}return R(a,Li,v),R(a,cd,gL),{start:a,tokens:pg}}function xL(t,e,n){let r=n.length,a=0,i=[],s=[];for(;a<r;){let o=t,f=null,c=null,d=0,u=null,p=-1;for(;a<r&&!(f=o.go(n[a].t));)s.push(n[a++]);for(;a<r&&(c=f||o.go(n[a].t));)f=null,o=c,o.accepts()?(p=0,u=o):p>=0&&p++,a++,d++;if(p<0)a-=d,a<r&&(s.push(n[a]),a++);else{s.length>0&&(i.push(lf(Yh,e,s)),s=[]),a-=p,d-=p;const h=u.t,m=n.slice(a-d,a);i.push(lf(h,e,m))}}return s.length>0&&i.push(lf(Yh,e,s)),i}function lf(t,e,n){const r=n[0].s,a=n[n.length-1].e,i=e.slice(r,a);return new t(i,n)}const yL=typeof console<"u"&&console&&console.warn||(()=>{}),vL="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",xe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wL(){return ut.groups={},xe.scanner=null,xe.parser=null,xe.tokenQueue=[],xe.pluginQueue=[],xe.customSchemes=[],xe.initialized=!1,xe}function Qh(t,e=!1){if(xe.initialized&&yL(`linkifyjs: already initialized - will not register custom scheme "${t}" ${vL}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
132
+ `,uL="️",hL="‍",of="";let Ms=null,js=null;function pL(t=[]){const e={};ut.groups=e;const n=new ut;Ms==null&&(Ms=Jh(sL)),js==null&&(js=Jh(oL)),R(n,"'",Lo),R(n,"{",ai),R(n,"}",ii),R(n,"[",fo),R(n,"]",co),R(n,"(",uo),R(n,")",ho),R(n,"<",po),R(n,">",mo),R(n,"(",go),R(n,")",bo),R(n,"「",xo),R(n,"」",yo),R(n,"『",vo),R(n,"』",wo),R(n,"<",Mo),R(n,">",jo),R(n,"&",Co),R(n,"*",No),R(n,"@",zn),R(n,"`",So),R(n,"^",To),R(n,":",Rn),R(n,",",dd),R(n,"$",Io),R(n,".",qt),R(n,"=",Do),R(n,"!",ud),R(n,"-",Tt),R(n,"%",si),R(n,"|",Eo),R(n,"+",Ao),R(n,"#",zo),R(n,"?",oi),R(n,'"',hd),R(n,"/",Kt),R(n,";",pd),R(n,"~",li),R(n,"_",Oo),R(n,"\\",ko),R(n,"・",ug);const r=Ne(n,xn,fd,{[$f]:!0});Ne(r,xn,r);const a=Ne(r,bn,cg,{[ri]:!0}),i=Ne(r,Fa,dg,{[Wa]:!0}),s=Ne(n,bn,yn,{[Zf]:!0});Ne(s,xn,a),Ne(s,bn,s),Ne(a,xn,a),Ne(a,bn,a);const o=Ne(n,Fa,Xf,{[qf]:!0});Ne(o,bn),Ne(o,xn,i),Ne(o,Fa,o),Ne(i,xn,i),Ne(i,bn),Ne(i,Fa,i);const f=R(n,sf,cd,{[nf]:!0}),c=R(n,_h,nc,{[nf]:!0}),d=Ne(n,af,nc,{[nf]:!0});R(n,of,d),R(c,sf,f),R(c,of,d),Ne(c,af,d),R(d,_h),R(d,sf),Ne(d,af,d),R(d,of,d);const u=Ne(n,rf,hg,{[fg]:!0});R(u,"#"),Ne(u,rf,u),R(u,uL,u);const p=R(u,hL);R(p,"#"),Ne(p,rf,u);const h=[[bn,s],[xn,a]],m=[[bn,null],[Fa,o],[xn,i]];for(let g=0;g<Ms.length;g++)Dn(n,Ms[g],ec,yn,h);for(let g=0;g<js.length;g++)Dn(n,js[g],tc,Xf,m);pr(ec,{tld:!0,ascii:!0},e),pr(tc,{utld:!0,alpha:!0},e),Dn(n,"file",Os,yn,h),Dn(n,"mailto",Os,yn,h),Dn(n,"http",ea,yn,h),Dn(n,"https",ea,yn,h),Dn(n,"ftp",ea,yn,h),Dn(n,"ftps",ea,yn,h),pr(Os,{scheme:!0,ascii:!0},e),pr(ea,{slashscheme:!0,ascii:!0},e),t=t.sort((g,b)=>g[0]>b[0]?1:-1);for(let g=0;g<t.length;g++){const b=t[g][0],v=t[g][1]?{[lL]:!0}:{[fL]:!0};b.indexOf("-")>=0?v[Kf]=!0:bn.test(b)?xn.test(b)?v[ri]=!0:v[Zf]=!0:v[$f]=!0,Uh(n,b,b,v)}return Uh(n,"localhost",Li,{ascii:!0}),n.jd=new ut(Po),{start:n,tokens:Object.assign({groups:e},pg)}}function mg(t,e){const n=mL(e.replace(/[A-Z]/g,o=>o.toLowerCase())),r=n.length,a=[];let i=0,s=0;for(;s<r;){let o=t,f=null,c=0,d=null,u=-1,p=-1;for(;s<r&&(f=o.go(n[s]));)o=f,o.accepts()?(u=0,p=0,d=o):u>=0&&(u+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=p,c-=u,a.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return a}function mL(t){const e=[],n=t.length;let r=0;for(;r<n;){let a=t.charCodeAt(r),i,s=a<55296||a>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Dn(t,e,n,r,a){let i;const s=e.length;for(let o=0;o<s-1;o++){const f=e[o];t.j[f]?i=t.j[f]:(i=new ut(r),i.jr=a.slice(),t.j[f]=i),t=i}return i=new ut(n),i.jr=a.slice(),t.j[e[s-1]]=i,i}function Jh(t){const e=[],n=[];let r=0,a="0123456789";for(;r<t.length;){let i=0;for(;a.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ni={defaultProtocol:"http",events:null,format:Vh,formatHref:Vh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function md(t,e=null){let n=Object.assign({},Ni);t&&(n=Object.assign(n,t instanceof md?t.o:t));const r=n.ignoreTags,a=[];for(let i=0;i<r.length;i++)a.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=a}md.prototype={o:Ni,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let a=this.o[t];return a&&(typeof a=="object"?(a=n.t in a?a[n.t]:Ni[t],typeof a=="function"&&r&&(a=a(e,n))):typeof a=="function"&&r&&(a=a(e,n.t,n)),a)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Vh(t){return t}function gg(t,e){this.t="token",this.v=t,this.tk=e}gg.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ni.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),a=t.get("tagName",n,e),i=this.toFormattedString(t),s={},o=t.get("className",n,e),f=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,o&&(s.class=o),f&&(s.target=f),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:a,attributes:s,content:i,eventListeners:u}}};function dl(t,e){class n extends gg{constructor(a,i){super(a,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Gh=dl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Yh=dl("text"),gL=dl("nl"),Cs=dl("url",{isLink:!0,toHref(t=Ni.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Li&&t[1].t===Rn}}),Nt=t=>new ut(t);function bL({groups:t}){const e=t.domain.concat([Co,No,zn,ko,So,To,Io,Do,Tt,fd,si,Eo,Ao,zo,Kt,Po,li,Oo]),n=[Lo,Rn,dd,qt,ud,si,oi,hd,pd,po,mo,ai,ii,co,fo,uo,ho,go,bo,xo,yo,vo,wo,Mo,jo],r=[Co,Lo,No,ko,So,To,Io,Do,Tt,ai,ii,si,Eo,Ao,zo,oi,Kt,Po,li,Oo],a=Nt(),i=R(a,li);ae(i,r,i),ae(i,t.domain,i);const s=Nt(),o=Nt(),f=Nt();ae(a,t.domain,s),ae(a,t.scheme,o),ae(a,t.slashscheme,f),ae(s,r,i),ae(s,t.domain,s);const c=R(s,zn);R(i,zn,c),R(o,zn,c),R(f,zn,c);const d=R(i,qt);ae(d,r,i),ae(d,t.domain,i);const u=Nt();ae(c,t.domain,u),ae(u,t.domain,u);const p=R(u,qt);ae(p,t.domain,u);const h=Nt(Gh);ae(p,t.tld,h),ae(p,t.utld,h),R(c,Li,h);const m=R(u,Tt);R(m,Tt,m),ae(m,t.domain,u),ae(h,t.domain,u),R(h,qt,p),R(h,Tt,m);const g=R(h,Rn);ae(g,t.numeric,Gh);const b=R(s,Tt),x=R(s,qt);R(b,Tt,b),ae(b,t.domain,s),ae(x,r,i),ae(x,t.domain,s);const v=Nt(Cs);ae(x,t.tld,v),ae(x,t.utld,v),ae(v,t.domain,s),ae(v,r,i),R(v,qt,x),R(v,Tt,b),R(v,zn,c);const j=R(v,Rn),y=Nt(Cs);ae(j,t.numeric,y);const L=Nt(Cs),C=Nt();ae(L,e,L),ae(L,n,C),ae(C,e,L),ae(C,n,C),R(v,Kt,L),R(y,Kt,L);const N=R(o,Rn),S=R(f,Rn),T=R(S,Kt),z=R(T,Kt);ae(o,t.domain,s),R(o,qt,x),R(o,Tt,b),ae(f,t.domain,s),R(f,qt,x),R(f,Tt,b),ae(N,t.domain,L),R(N,Kt,L),R(N,oi,L),ae(z,t.domain,L),ae(z,e,L),R(z,Kt,L);const P=[[ai,ii],[fo,co],[uo,ho],[po,mo],[go,bo],[xo,yo],[vo,wo],[Mo,jo]];for(let U=0;U<P.length;U++){const[J,Y]=P[U],K=R(L,J);R(C,J,K),R(K,Y,L);const E=Nt(Cs);ae(K,e,E);const G=Nt();ae(K,n),ae(E,e,E),ae(E,n,G),ae(G,e,E),ae(G,n,G),R(E,Y,L),R(G,Y,L)}return R(a,Li,v),R(a,cd,gL),{start:a,tokens:pg}}function xL(t,e,n){let r=n.length,a=0,i=[],s=[];for(;a<r;){let o=t,f=null,c=null,d=0,u=null,p=-1;for(;a<r&&!(f=o.go(n[a].t));)s.push(n[a++]);for(;a<r&&(c=f||o.go(n[a].t));)f=null,o=c,o.accepts()?(p=0,u=o):p>=0&&p++,a++,d++;if(p<0)a-=d,a<r&&(s.push(n[a]),a++);else{s.length>0&&(i.push(lf(Yh,e,s)),s=[]),a-=p,d-=p;const h=u.t,m=n.slice(a-d,a);i.push(lf(h,e,m))}}return s.length>0&&i.push(lf(Yh,e,s)),i}function lf(t,e,n){const r=n[0].s,a=n[n.length-1].e,i=e.slice(r,a);return new t(i,n)}const yL=typeof console<"u"&&console&&console.warn||(()=>{}),vL="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",xe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wL(){return ut.groups={},xe.scanner=null,xe.parser=null,xe.tokenQueue=[],xe.pluginQueue=[],xe.customSchemes=[],xe.initialized=!1,xe}function Qh(t,e=!1){if(xe.initialized&&yL(`linkifyjs: already initialized - will not register custom scheme "${t}" ${vL}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
133
133
  1. Must only contain digits, lowercase ASCII letters or "-"
134
134
  2. Cannot start or end with "-"
135
135
  3. "-" cannot repeat`);xe.customSchemes.push([t,e])}function ML(){xe.scanner=pL(xe.customSchemes);for(let t=0;t<xe.tokenQueue.length;t++)xe.tokenQueue[t][1]({scanner:xe.scanner});xe.parser=bL(xe.scanner.tokens);for(let t=0;t<xe.pluginQueue.length;t++)xe.pluginQueue[t][1]({scanner:xe.scanner,parser:xe.parser});return xe.initialized=!0,xe}function gd(t){return xe.initialized||ML(),xL(xe.parser.start,t,mg(xe.scanner.start,t))}gd.scan=mg;function bg(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new md(n),a=gd(t),i=[];for(let s=0;s<a.length;s++){const o=a[s];o.isLink&&(!e||o.t===e)&&r.check(o)&&i.push(o.toFormattedObject(r))}return i}var bd="[\0-   ᠎ -\u2029  ]",jL=new RegExp(bd),CL=new RegExp(`${bd}$`),LL=new RegExp(bd,"g");function NL(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function kL(t){return new je({key:new Te("autolink"),appendTransaction:(e,n,r)=>{const a=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!a||i)return;const{tr:s}=r,o=Tm(n.doc,[...e]);if(Pm(o).forEach(({newRange:c})=>{const d=kj(r.doc,c,h=>h.isTextblock);let u,p;if(d.length>1)u=d[0],p=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!CL.test(h))return;u=d[0],p=r.doc.textBetween(u.pos,c.to,void 0," ")}if(u&&p){const h=p.split(jL).filter(Boolean);if(h.length<=0)return!1;const m=h[h.length-1],g=u.pos+p.lastIndexOf(m);if(!m)return!1;const b=gd(m).map(x=>x.toObject(t.defaultProtocol));if(!NL(b))return!1;b.filter(x=>x.isLink).map(x=>({...x,from:g+x.start+1,to:g+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{nd(x.from,x.to,r.doc).some(v=>v.mark.type===t.type)||s.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!s.steps.length)return s}})}function SL(t){return new je({key:new Te("handleClickLink"),props:{handleClick:(e,n,r)=>{var a,i;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const f=r.target;if(!f)return!1;const c=t.editor.view.dom;s=f.closest("a"),s&&!c.contains(s)&&(s=null)}if(!s)return!1;let o=!1;if(t.enableClickSelection&&(o=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const f=Om(e.state,t.type.name),c=(a=s.href)!=null?a:f.href,d=(i=s.target)!=null?i:f.target;c&&(window.open(c,d),o=!0)}return o}}})}function TL(t){return new je({key:new Te("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:a}=t,{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let f="";r.content.forEach(d=>{f+=d.textContent});const c=bg(f,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===f);return!f||!c||a!==void 0&&!a(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function lr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const a=typeof r=="string"?r:r.scheme;a&&n.push(a)}),!t||t.replace(LL,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var xg=zr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Qh(t);return}Qh(t.scheme,t.optionalSlashes)})},onDestroy(){wL()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!lr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const a=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(a)||!/\./.test(a))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!lr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!lr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ye(this.options.HTMLAttributes,t),0]:["a",ye(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,a,i;const s=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",o=(i=(a=t.attrs)==null?void 0:a.title)!=null?i:"",f=e.renderChildren(t);return o?`[${f}](${s} "${o}")`:`[${f}](${s})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!lr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!lr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Sr({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,a=bg(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!lr(s,n),protocols:n,defaultProtocol:r}));a.length&&a.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(kL({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:a=>!!lr(a,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(SL({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(TL({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),IL=xg,DL=Object.defineProperty,EL=(t,e)=>{for(var n in e)DL(t,n,{get:e[n],enumerable:!0})},AL="listItem",Wh="textStyle",$h=/^\s*([-+*])\s$/,yg=ct.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
@@ -143,7 +143,7 @@ ${h.slice(c+2)}`,u+=1;else break}e.push({indent:c,number:parseInt(o,10),content:
143
143
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var r;const a=t.split(`
144
144
  `),[i,s]=RL(a);if(i.length===0)return;const o=kg(i,0,n);return o.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:o,raw:a.slice(0,s).join(`
145
145
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(HL,this.editor.getAttributes(qh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ba({find:Kh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ba({find:Kh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qh)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),FL=/^\s*(\[([( |x])?\])\s$/,UL=ct.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",ye(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const a=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return sd(t,e,a)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const a=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),o=document.createElement("input"),f=document.createElement("div"),c=u=>{var p,h;o.ariaLabel=((h=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:h.call(p,u,o.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};c(t),i.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",u=>u.preventDefault()),o.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:p}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const m=n();if(typeof m!="number")return!1;const g=h.doc.nodeAt(m);return h.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,p])=>{a.setAttribute(u,p)}),a.dataset.checked=t.attrs.checked,o.checked=t.attrs.checked,i.append(o,s),a.append(i,f),Object.entries(e).forEach(([u,p])=>{a.setAttribute(u,p)});let d=new Set(Object.keys(e));return{dom:a,contentDOM:f,update:u=>{if(u.type!==this.type)return!1;a.dataset.checked=u.attrs.checked,o.checked=u.attrs.checked,c(u);const p=r.extensionManager.attributes,h=Ci(u,p),m=new Set(Object.keys(h)),g=this.options.HTMLAttributes;return d.forEach(b=>{m.has(b)||(b in g?a.setAttribute(b,g[b]):a.removeAttribute(b))}),Object.entries(h).forEach(([b,x])=>{x==null?b in g?a.setAttribute(b,g[b]):a.removeAttribute(b):a.setAttribute(b,x)}),d=m,!0}}}},addInputRules(){return[ba({find:FL,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),_L=ct.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ye(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
146
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const s=Qf(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,f)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:f}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(i)},a=Qf(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(a)return{type:"taskList",raw:a.raw,items:a.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Se.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(yg.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(vg.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Ng.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Sg.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(UL.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(_L.configure(this.options.taskList)),t}});var Xh="&nbsp;",JL=" ",VL=ct.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Xh||r[0].text===JL)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];return n.length===0?Xh:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),GL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,YL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,QL=zr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ga({find:GL,type:this.type})]},addPasteRules(){return[Sr({find:YL,type:this.type})]}}),WL=ct.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Tg=zr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const a=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!a)return;const i=a[2].trim();return{type:"underline",raw:a[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),$L=Tg;function ZL(t={}){return new je({view(e){return new qL(e,t)}})}class qL{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(a=>{let i=s=>{this[a](s)};return e.dom.addEventListener(a,i),{name:a,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,a=this.editorView.dom,i=a.getBoundingClientRect(),s=i.width/a.offsetWidth,o=i.height/a.offsetHeight;if(n){let u=e.nodeBefore,p=e.nodeAfter;if(u||p){let h=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(h){let m=h.getBoundingClientRect(),g=u?m.bottom:m.top;u&&p&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*o;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*s;r={left:u.left-p,right:u.left+p,top:u.top,bottom:u.bottom}}let f=this.editorView.dom.offsetParent;this.element||(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!f||f==document.body&&getComputedStyle(f).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=f.getBoundingClientRect(),p=u.width/f.offsetWidth,h=u.height/f.offsetHeight;c=u.left-f.scrollLeft*p,d=u.top-f.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),a=r&&r.type.spec.disableDropCursor,i=typeof a=="function"?a(this.editorView,n,e):a;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=v1(this.editorView.state.doc,s,this.editorView.dragging.slice);o!=null&&(s=o)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ke extends ie{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ke.valid(r)?new ke(r):ie.near(r)}content(){return _.empty}eq(e){return e instanceof ke&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ke(e.resolve(n.pos))}getBookmark(){return new yd(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!KL(e)||!XL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let a=n.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ke.valid(e))return e;let a=e.pos,i=null;for(let s=e.depth;;s--){let o=e.node(s);if(n>0?e.indexAfter(s)<o.childCount:e.index(s)>0){i=o.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;a+=n;let f=e.doc.resolve(a);if(ke.valid(f))return f}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!$.isSelectable(i)){e=e.doc.resolve(a+i.nodeSize*n),r=!1;continue e}break}i=s,a+=n;let o=e.doc.resolve(a);if(ke.valid(o))return o}return null}}}ke.prototype.visible=!1;ke.findFrom=ke.findGapCursorFrom;ie.jsonID("gapcursor",ke);class yd{constructor(e){this.pos=e}map(e){return new yd(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ke.valid(n)?new ke(n):ie.near(n)}}function Ig(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function KL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n-1);;a=a.lastChild){if(a.childCount==0&&!a.inlineContent||Ig(a.type))return!0;if(a.inlineContent)return!1}}return!0}function XL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n);;a=a.firstChild){if(a.childCount==0&&!a.inlineContent||Ig(a.type))return!0;if(a.inlineContent)return!1}}return!0}function eN(){return new je({props:{decorations:aN,createSelectionBetween(t,e,n){return e.pos==n.pos&&ke.valid(n)?new ke(n):null},handleClick:nN,handleKeyDown:tN,handleDOMEvents:{beforeinput:rN}}})}const tN=wm({ArrowLeft:Ls("horiz",-1),ArrowRight:Ls("horiz",1),ArrowUp:Ls("vert",-1),ArrowDown:Ls("vert",1)});function Ls(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,a,i){let s=r.selection,o=e>0?s.$to:s.$from,f=s.empty;if(s instanceof te){if(!i.endOfTextblock(n)||o.depth==0)return!1;f=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=ke.findGapCursorFrom(o,e,f);return c?(a&&a(r.tr.setSelection(new ke(c))),!0):!1}}function nN(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ke.valid(r))return!1;let a=t.posAtCoords({left:n.clientX,top:n.clientY});return a&&a.inside>-1&&$.isSelectable(t.state.doc.nodeAt(a.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ke(r))),!0)}function rN(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ke))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let a=O.empty;for(let s=r.length-1;s>=0;s--)a=O.from(r[s].createAndFill(null,a));let i=t.state.tr.replace(n.pos,n.pos,new _(a,0,0));return i.setSelection(te.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function aN(t){if(!(t.selection instanceof ke))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Me.create(t.doc,[qe.widget(t.selection.head,e,{key:"gapcursor"})])}var Ro=200,He=function(){};He.prototype.append=function(e){return e.length?(e=He.from(e),!this.length&&e||e.length<Ro&&this.leafAppend(e)||this.length<Ro&&e.leafPrepend(this)||this.appendInner(e)):this};He.prototype.prepend=function(e){return e.length?He.from(e).append(this):this};He.prototype.appendInner=function(e){return new iN(this,e)};He.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?He.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};He.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};He.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};He.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var a=[];return this.forEach(function(i,s){return a.push(e(i,s))},n,r),a};He.from=function(e){return e instanceof He?e:e&&e.length?new Dg(e):He.empty};var Dg=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(a,i){return a==0&&i==this.length?this:new e(this.values.slice(a,i))},e.prototype.getInner=function(a){return this.values[a]},e.prototype.forEachInner=function(a,i,s,o){for(var f=i;f<s;f++)if(a(this.values[f],o+f)===!1)return!1},e.prototype.forEachInvertedInner=function(a,i,s,o){for(var f=i-1;f>=s;f--)if(a(this.values[f],o+f)===!1)return!1},e.prototype.leafAppend=function(a){if(this.length+a.length<=Ro)return new e(this.values.concat(a.flatten()))},e.prototype.leafPrepend=function(a){if(this.length+a.length<=Ro)return new e(a.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(He);He.empty=new Dg([]);var iN=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,a,i,s){var o=this.left.length;if(a<o&&this.left.forEachInner(r,a,Math.min(i,o),s)===!1||i>o&&this.right.forEachInner(r,Math.max(a-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,i,s){var o=this.left.length;if(a>o&&this.right.forEachInvertedInner(r,a-o,Math.max(i,o)-o,s+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(a,o),i,s)===!1)return!1},e.prototype.sliceInner=function(r,a){if(r==0&&a==this.length)return this;var i=this.left.length;return a<=i?this.left.slice(r,a):r>=i?this.right.slice(r-i,a-i):this.left.slice(r,i).append(this.right.slice(0,a-i))},e.prototype.leafAppend=function(r){var a=this.right.leafAppend(r);if(a)return new e(this.left,a)},e.prototype.leafPrepend=function(r){var a=this.left.leafPrepend(r);if(a)return new e(a,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(He);const sN=500;class Yt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let a,i;n&&(a=this.remapping(r,this.items.length),i=a.maps.length);let s=e.tr,o,f,c=[],d=[];return this.items.forEach((u,p)=>{if(!u.step){a||(a=this.remapping(r,p+1),i=a.maps.length),i--,d.push(u);return}if(a){d.push(new Xt(u.map));let h=u.step.map(a.slice(i)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Xt(m,void 0,void 0,c.length+d.length))),i--,m&&a.appendMap(m,i)}else s.maybeStep(u.step);if(u.selection)return o=a?u.selection.map(a.slice(i)):u.selection,f=new Yt(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:s,selection:o}}addTransform(e,n,r,a){let i=[],s=this.eventCount,o=this.items,f=!a&&o.length?o.get(o.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),p=new Xt(e.mapping.maps[d],u,n),h;(h=f&&f.merge(p))&&(p=h,d?i.pop():o=o.slice(0,o.length-1)),i.push(p),n&&(s++,n=void 0),a||(f=p)}let c=s-r.depth;return c>lN&&(o=oN(o,c),s-=c),new Yt(o.append(i),s)}remapping(e,n){let r=new xi;return this.items.forEach((a,i)=>{let s=a.mirrorOffset!=null&&i-a.mirrorOffset>=e?r.maps.length-a.mirrorOffset:void 0;r.appendMap(a.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Yt(this.items.append(e.map(n=>new Xt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],a=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(p=>{p.selection&&o--},a);let f=n;this.items.forEach(p=>{let h=i.getMirror(--f);if(h==null)return;s=Math.min(s,h);let m=i.maps[h];if(p.step){let g=e.steps[h].invert(e.docs[h]),b=p.selection&&p.selection.map(i.slice(f+1,h));b&&o++,r.push(new Xt(m,g,b))}else r.push(new Xt(m))},a);let c=[];for(let p=n;p<s;p++)c.push(new Xt(i.maps[p]));let d=this.items.slice(0,a).append(c).append(r),u=new Yt(d,o);return u.emptyItemCount()>sN&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,a=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)a.push(s),s.selection&&i++;else if(s.step){let f=s.step.map(n.slice(r)),c=f&&f.getMap();if(r--,c&&n.appendMap(c,r),f){let d=s.selection&&s.selection.map(n.slice(r));d&&i++;let u=new Xt(c.invert(),f,d),p,h=a.length-1;(p=a.length&&a[h].merge(u))?a[h]=p:a.push(u)}}else s.map&&r--},this.items.length,0),new Yt(He.from(a.reverse()),i)}}Yt.empty=new Yt(He.empty,0);function oN(t,e){let n;return t.forEach((r,a)=>{if(r.selection&&e--==0)return n=a,!1}),t.slice(n)}class Xt{constructor(e,n,r,a){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=a}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Xt(n.getMap().invert(),n,this.selection)}}}class On{constructor(e,n,r,a,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=a,this.prevComposition=i}}const lN=20;function fN(t,e,n,r){let a=n.getMeta(wr),i;if(a)return a.historyState;n.getMeta(uN)&&(t=new On(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(wr))return s.getMeta(wr).redo?new On(t.done.addTransform(n,void 0,r,Ps(e)),t.undone,ep(n.mapping.maps),t.prevTime,t.prevComposition):new On(t.done,t.undone.addTransform(n,void 0,r,Ps(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),f=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!cN(n,t.prevRanges)),c=s?ff(t.prevRanges,n.mapping):ep(n.mapping.maps);return new On(t.done.addTransform(n,f?e.selection.getBookmark():void 0,r,Ps(e)),Yt.empty,c,n.time,o??t.prevComposition)}else return(i=n.getMeta("rebased"))?new On(t.done.rebased(n,i),t.undone.rebased(n,i),ff(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new On(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ff(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function cN(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,a)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&a>=e[i]&&(n=!0)}),n}function ep(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,a,i,s)=>e.push(i,s));return e}function ff(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let a=e.map(t[r],1),i=e.map(t[r+1],-1);a<=i&&n.push(a,i)}return n}function dN(t,e,n){let r=Ps(e),a=wr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),o=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),a,r),f=new On(n?o:i.remaining,n?i.remaining:o,null,0,-1);return i.transform.setSelection(s).setMeta(wr,{redo:n,historyState:f})}let cf=!1,tp=null;function Ps(t){let e=t.plugins;if(tp!=e){cf=!1,tp=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cf=!0;break}}return cf}const wr=new Te("history"),uN=new Te("closeHistory");function hN(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new je({key:wr,state:{init(){return new On(Yt.empty,Yt.empty,null,0,-1)},apply(e,n,r){return fN(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,a=r=="historyUndo"?Ag:r=="historyRedo"?zg:null;return!a||!e.editable?!1:(n.preventDefault(),a(e.state,e.dispatch))}}}})}function Eg(t,e){return(n,r)=>{let a=wr.getState(n);if(!a||(t?a.undone:a.done).eventCount==0)return!1;if(r){let i=dN(a,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Ag=Eg(!1,!0),zg=Eg(!0,!0);Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new je({key:new Te("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const a=this.options.limit;if(a==null||a===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>a){const s=i-a,o=0,f=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${a} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(o,f);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const a=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||a>r&&i>r&&i<=a)return!0;if(a>r&&i>r&&i>a||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,f=i-r,c=o-f,d=o;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var pN=Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ZL(this.options)]}});Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new je({key:new Te("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:a}=e,i=[];if(!n||!r)return Me.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((f,c)=>{if(f.isText)return;if(!(a>=c&&a<=c+f.nodeSize-1))return!1;s+=1});let o=0;return t.descendants((f,c)=>{if(f.isText||!(a>=c&&a<=c+f.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&s-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";i.push(qe.node(c,c+f.nodeSize,{class:this.options.className}))}),Me.create(t,i)}}})]}});var mN=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[eN()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ue(W(t,"allowGapCursor",n)))!=null?e:null}}}),np="placeholder";function gN(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var bN=Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:np,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${gN(this.options.dataAttribute)}`:`data-${np}`;return[new je({key:new Te("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:a}=n,i=[];if(!r)return null;const s=this.editor.isEmpty;return e.descendants((o,f)=>{const c=a>=f&&a<=f+o.nodeSize,d=!o.isLeaf&&ll(o);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=qe.node(f,f+o.nodeSize,{class:u.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:f,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Me.create(e,i)}}})]}});Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new je({key:new Te("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||Rm(n.selection)||t.view.dragging?null:Me.create(n.doc,[qe.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function rp({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var xN=Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Te(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,a])=>a).filter(a=>(this.options.notAfter||[]).concat(n).includes(a.name));return[new je({key:e,appendTransaction:(a,i,s)=>{const{doc:o,tr:f,schema:c}=s,d=e.getState(s),u=o.content.size,p=c.nodes[n];if(d)return f.insert(u,p.create())},state:{init:(a,i)=>{const s=i.tr.doc.lastChild;return!rp({node:s,types:r})},apply:(a,i)=>{if(!a.docChanged||a.getMeta("__uniqueIDTransaction"))return i;const s=a.doc.lastChild;return!rp({node:s,types:r})}}})]}}),yN=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Ag(t,e),redo:()=>({state:t,dispatch:e})=>zg(t,e)}},addProseMirrorPlugins(){return[hN(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vN=Se.create({name:"starterKit",addExtensions(){var t,e,n,r;const a=[];return this.options.bold!==!1&&a.push(V6.configure(this.options.bold)),this.options.blockquote!==!1&&a.push(H6.configure(this.options.blockquote)),this.options.bulletList!==!1&&a.push(yg.configure(this.options.bulletList)),this.options.code!==!1&&a.push(Q6.configure(this.options.code)),this.options.codeBlock!==!1&&a.push(Z6.configure(this.options.codeBlock)),this.options.document!==!1&&a.push(q6.configure(this.options.document)),this.options.dropcursor!==!1&&a.push(pN.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&a.push(mN.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&a.push(K6.configure(this.options.hardBreak)),this.options.heading!==!1&&a.push(X6.configure(this.options.heading)),this.options.undoRedo!==!1&&a.push(yN.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&a.push(eL.configure(this.options.horizontalRule)),this.options.italic!==!1&&a.push(iL.configure(this.options.italic)),this.options.listItem!==!1&&a.push(vg.configure(this.options.listItem)),this.options.listKeymap!==!1&&a.push(Ng.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&a.push(xg.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&a.push(Sg.configure(this.options.orderedList)),this.options.paragraph!==!1&&a.push(VL.configure(this.options.paragraph)),this.options.strike!==!1&&a.push(QL.configure(this.options.strike)),this.options.text!==!1&&a.push(WL.configure(this.options.text)),this.options.underline!==!1&&a.push(Tg.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&a.push(xN.configure((r=this.options)==null?void 0:r.trailingNode)),a}}),Og=vN,wN=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,MN=ct.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ye(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,a,i,s;const o=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",f=(a=(r=t.attrs)==null?void 0:r.alt)!=null?a:"",c=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"";return c?`![${f}](${o} "${c}")`:`![${f}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:a,getPos:i,HTMLAttributes:s,editor:o})=>{const f=document.createElement("img");Object.entries(s).forEach(([u,p])=>{if(p!=null)switch(u){case"width":case"height":break;default:f.setAttribute(u,p);break}}),f.src=s.src;const c=new kC({element:f,editor:o,node:a,getPos:i,onResize:(u,p)=>{f.style.width=`${u}px`,f.style.height=`${p}px`},onCommit:(u,p)=>{const h=i();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:u,height:p}).run()},onUpdate:(u,p,h)=>u.type===a.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",f.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[eg({find:wN,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Pg=MN;function jN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:s,$position:o}=t,f=r&&!a,c=TC(n),d=new RegExp(`\\s${c}$`),u=s?"^":"",p=a?"":c,h=f?new RegExp(`${u}${c}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${p}]*`,"gm"),m=((e=o.nodeBefore)==null?void 0:e.isText)&&o.nodeBefore.text;if(!m)return null;const g=o.pos-m.length,b=Array.from(m.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const x=b.input.slice(Math.max(0,b.index-1),b.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(x);if(i!==null&&!v)return null;const j=g+b.index;let y=j+b[0].length;return f&&d.test(m.slice(y-1,y+1))&&(b[0]+=" ",y+=1),j<o.pos&&y>=o.pos?{range:{from:j,to:y},query:b[0].slice(n.length),text:b[0]}:null}var CN=new Te("suggestion");function LN({pluginKey:t=CN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:a=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:o="span",decorationClass:f="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:p=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=jN,shouldShow:b}){let x;const v=h==null?void 0:h(),j=()=>{const N=e.state.selection.$anchor.pos,S=e.view.coordsAtPos(N),{top:T,right:z,bottom:P,left:U}=S;try{return new DOMRect(U,T,z-U,P-T)}catch{return null}},y=(N,S)=>S?()=>{const T=t.getState(e.state),z=T==null?void 0:T.decorationId,P=N.dom.querySelector(`[data-decoration-id="${z}"]`);return(P==null?void 0:P.getBoundingClientRect())||null}:j;function L(N,S){var T;try{const P=t.getState(N.state),U=P!=null&&P.decorationId?N.dom.querySelector(`[data-decoration-id="${P.decorationId}"]`):null,J={editor:e,range:(P==null?void 0:P.range)||{from:0,to:0},query:(P==null?void 0:P.query)||null,text:(P==null?void 0:P.text)||null,items:[],command:G=>u({editor:e,range:(P==null?void 0:P.range)||{from:0,to:0},props:G}),decorationNode:U,clientRect:y(N,U)};(T=v==null?void 0:v.onExit)==null||T.call(v,J)}catch{}const z=N.state.tr.setMeta(S,{exit:!0});N.dispatch(z)}const C=new je({key:t,view(){return{update:async(N,S)=>{var T,z,P,U,J,G,K;const E=(T=this.key)==null?void 0:T.getState(S),Y=(z=this.key)==null?void 0:z.getState(N.state),Z=E.active&&Y.active&&E.range.from!==Y.range.from,le=!E.active&&Y.active,we=E.active&&!Y.active,Ie=!le&&!we&&E.query!==Y.query,Le=le||Z&&Ie,V=Ie||Z,q=we||Z&&Ie;if(!Le&&!V&&!q)return;const re=q&&!Le?E:Y,A=N.dom.querySelector(`[data-decoration-id="${re.decorationId}"]`);x={editor:e,range:re.range,query:re.query,text:re.text,items:[],command:B=>u({editor:e,range:re.range,props:B}),decorationNode:A,clientRect:y(N,A)},Le&&((P=v==null?void 0:v.onBeforeStart)==null||P.call(v,x)),V&&((U=v==null?void 0:v.onBeforeUpdate)==null||U.call(v,x)),(V||Le)&&(x.items=await p({editor:e,query:re.query})),q&&((J=v==null?void 0:v.onExit)==null||J.call(v,x)),V&&((G=v==null?void 0:v.onUpdate)==null||G.call(v,x)),Le&&((K=v==null?void 0:v.onStart)==null||K.call(v,x))},destroy:()=>{var N;x&&((N=v==null?void 0:v.onExit)==null||N.call(v,x))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(N,S,T,z){const{isEditable:P}=e,{composing:U}=e.view,{selection:J}=N,{empty:G,from:K}=J,E={...S},Y=N.getMeta(t);if(Y&&Y.exit)return E.active=!1,E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null,E;if(E.composing=U,P&&(G||e.view.composing)){(K<S.range.from||K>S.range.to)&&!U&&!S.composing&&(E.active=!1);const Z=g({char:n,allowSpaces:r,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:s,$position:J.$from}),le=`id_${Math.floor(Math.random()*4294967295)}`;Z&&m({editor:e,state:z,range:Z.range,isActive:S.active})&&(!b||b({editor:e,range:Z.range,query:Z.query,text:Z.text,transaction:N}))?(E.active=!0,E.decorationId=S.decorationId?S.decorationId:le,E.range=Z.range,E.query=Z.query,E.text=Z.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(N,S){var T,z,P,U;const{active:J,range:G}=C.getState(N.state);if(!J)return!1;if(S.key==="Escape"||S.key==="Esc"){const E=C.getState(N.state),Y=(T=x==null?void 0:x.decorationNode)!=null?T:null,Z=Y??(E!=null&&E.decorationId?N.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`):null);if(((z=v==null?void 0:v.onKeyDown)==null?void 0:z.call(v,{view:N,event:S,range:E.range}))||!1)return!0;const we={editor:e,range:E.range,query:E.query,text:E.text,items:[],command:Ie=>u({editor:e,range:E.range,props:Ie}),decorationNode:Z,clientRect:Z?()=>Z.getBoundingClientRect()||null:null};return(P=v==null?void 0:v.onExit)==null||P.call(v,we),L(N,t),!0}return((U=v==null?void 0:v.onKeyDown)==null?void 0:U.call(v,{view:N,event:S,range:G}))||!1},decorations(N){const{active:S,range:T,decorationId:z,query:P}=C.getState(N);if(!S)return null;const U=!(P!=null&&P.length),J=[f];return U&&J.push(d),Me.create(N.doc,[qe.inline(T.from,T.to,{nodeName:o,class:J.join(" "),"data-decoration-id":z,"data-decoration-content":c})])}}});return C}function NN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const a=new Te;return{editor:t,char:r,pluginKey:a,command:({editor:i,range:s,props:o})=>{var f,c,d;const u=i.view.state.selection.$to.nodeAfter;((f=u==null?void 0:u.text)==null?void 0:f.startsWith(" "))&&(s.to+=1),i.chain().focus().insertContentAt(s,[{type:n,attrs:{...o,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(d=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||d.collapseToEnd()},allow:({state:i,range:s})=>{const o=i.doc.resolve(s.from),f=i.schema.nodes[n];return!!o.parent.type.contentMatch.matchType(f)},...e}}function Rg(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>NN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function ap(t,e){const n=Rg(t),r=n.find(a=>a.char===e);return r||(n.length?n[0]:null)}var kN=ct.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,a;return["span",ye(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(a=e.attrs.label)!=null?a:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=ap(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ye({"data-type":this.name},this.options.HTMLAttributes,e);const a=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof a=="string"?["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),a]:a},...tg({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,a,i,s]=r,o=i??s;e[a==="char"?"mentionSuggestionChar":a]=o,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:ap(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:a,anchor:i}=r;if(!a)return!1;let s=new Ot,o=0;return e.doc.nodesBetween(i-1,i,(f,c)=>{if(f.type.name===this.name)return n=!0,s=f,o=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":s.attrs.mentionSuggestionChar,o,o+s.nodeSize),n})}},addProseMirrorPlugins(){return Rg(this).map(LN)}}),SN=kN,pt="top",_t="bottom",Jt="right",mt="left",vd="auto",qi=[pt,_t,Jt,mt],xa="start",ki="end",TN="clippingParents",Bg="viewport",Ua="popper",IN="reference",ip=qi.reduce(function(t,e){return t.concat([e+"-"+xa,e+"-"+ki])},[]),Hg=[].concat(qi,[vd]).reduce(function(t,e){return t.concat([e,e+"-"+xa,e+"-"+ki])},[]),DN="beforeRead",EN="read",AN="afterRead",zN="beforeMain",ON="main",PN="afterMain",RN="beforeWrite",BN="write",HN="afterWrite",FN=[DN,EN,AN,zN,ON,PN,RN,BN,HN];function cn(t){return t?(t.nodeName||"").toLowerCase():null}function wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Tr(t){var e=wt(t).Element;return t instanceof e||t instanceof Element}function Bt(t){var e=wt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function wd(t){if(typeof ShadowRoot>"u")return!1;var e=wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function UN(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Bt(i)||!cn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var o=a[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function _N(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),o=s.reduce(function(f,c){return f[c]="",f},{});!Bt(a)||!cn(a)||(Object.assign(a.style,o),Object.keys(i).forEach(function(f){a.removeAttribute(f)}))})}}const Fg={name:"applyStyles",enabled:!0,phase:"write",fn:UN,effect:_N,requires:["computeStyles"]};function sn(t){return t.split("-")[0]}var Mr=Math.max,Bo=Math.min,ya=Math.round;function ic(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ug(){return!/^((?!chrome|android).)*safari/i.test(ic())}function va(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),a=1,i=1;e&&Bt(t)&&(a=t.offsetWidth>0&&ya(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&ya(r.height)/t.offsetHeight||1);var s=Tr(t)?wt(t):window,o=s.visualViewport,f=!Ug()&&n,c=(r.left+(f&&o?o.offsetLeft:0))/a,d=(r.top+(f&&o?o.offsetTop:0))/i,u=r.width/a,p=r.height/i;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function Md(t){var e=va(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function _g(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&wd(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Nn(t){return wt(t).getComputedStyle(t)}function JN(t){return["table","td","th"].indexOf(cn(t))>=0}function nr(t){return((Tr(t)?t.ownerDocument:t.document)||window.document).documentElement}function ul(t){return cn(t)==="html"?t:t.assignedSlot||t.parentNode||(wd(t)?t.host:null)||nr(t)}function sp(t){return!Bt(t)||Nn(t).position==="fixed"?null:t.offsetParent}function VN(t){var e=/firefox/i.test(ic()),n=/Trident/i.test(ic());if(n&&Bt(t)){var r=Nn(t);if(r.position==="fixed")return null}var a=ul(t);for(wd(a)&&(a=a.host);Bt(a)&&["html","body"].indexOf(cn(a))<0;){var i=Nn(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ki(t){for(var e=wt(t),n=sp(t);n&&JN(n)&&Nn(n).position==="static";)n=sp(n);return n&&(cn(n)==="html"||cn(n)==="body"&&Nn(n).position==="static")?e:n||VN(t)||e}function jd(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fi(t,e,n){return Mr(t,Bo(e,n))}function GN(t,e,n){var r=fi(t,e,n);return r>n?n:r}function Jg(){return{top:0,right:0,bottom:0,left:0}}function Vg(t){return Object.assign({},Jg(),t)}function Gg(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var YN=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Vg(typeof e!="number"?e:Gg(e,qi))};function QN(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=sn(n.placement),f=jd(o),c=[mt,Jt].indexOf(o)>=0,d=c?"height":"width";if(!(!i||!s)){var u=YN(a.padding,n),p=Md(i),h=f==="y"?pt:mt,m=f==="y"?_t:Jt,g=n.rects.reference[d]+n.rects.reference[f]-s[f]-n.rects.popper[d],b=s[f]-n.rects.reference[f],x=Ki(i),v=x?f==="y"?x.clientHeight||0:x.clientWidth||0:0,j=g/2-b/2,y=u[h],L=v-p[d]-u[m],C=v/2-p[d]/2+j,N=fi(y,C,L),S=f;n.modifiersData[r]=(e={},e[S]=N,e.centerOffset=N-C,e)}}function WN(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||_g(e.elements.popper,a)&&(e.elements.arrow=a))}const $N={name:"arrow",enabled:!0,phase:"main",fn:QN,effect:WN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wa(t){return t.split("-")[1]}var ZN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(t,e){var n=t.x,r=t.y,a=e.devicePixelRatio||1;return{x:ya(n*a)/a||0,y:ya(r*a)/a||0}}function op(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,o=t.position,f=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,p=s.x,h=p===void 0?0:p,m=s.y,g=m===void 0?0:m,b=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var x=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),j=mt,y=pt,L=window;if(c){var C=Ki(n),N="clientHeight",S="clientWidth";if(C===wt(n)&&(C=nr(n),Nn(C).position!=="static"&&o==="absolute"&&(N="scrollHeight",S="scrollWidth")),C=C,a===pt||(a===mt||a===Jt)&&i===ki){y=_t;var T=u&&C===L&&L.visualViewport?L.visualViewport.height:C[N];g-=T-r.height,g*=f?1:-1}if(a===mt||(a===pt||a===_t)&&i===ki){j=Jt;var z=u&&C===L&&L.visualViewport?L.visualViewport.width:C[S];h-=z-r.width,h*=f?1:-1}}var P=Object.assign({position:o},c&&ZN),U=d===!0?qN({x:h,y:g},wt(n)):{x:h,y:g};if(h=U.x,g=U.y,f){var J;return Object.assign({},P,(J={},J[y]=v?"0":"",J[j]=x?"0":"",J.transform=(L.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",J))}return Object.assign({},P,(e={},e[y]=v?g+"px":"",e[j]=x?h+"px":"",e.transform="",e))}function KN(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,f=o===void 0?!0:o,c={placement:sn(e.placement),variation:wa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,op(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,op(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const XN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:KN,data:{}};var Ns={passive:!0};function ek(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,o=s===void 0?!0:s,f=wt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",n.update,Ns)}),o&&f.addEventListener("resize",n.update,Ns),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Ns)}),o&&f.removeEventListener("resize",n.update,Ns)}}const tk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ek,data:{}};var nk={left:"right",right:"left",bottom:"top",top:"bottom"};function Rs(t){return t.replace(/left|right|bottom|top/g,function(e){return nk[e]})}var rk={start:"end",end:"start"};function lp(t){return t.replace(/start|end/g,function(e){return rk[e]})}function Cd(t){var e=wt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ld(t){return va(nr(t)).left+Cd(t).scrollLeft}function ak(t,e){var n=wt(t),r=nr(t),a=n.visualViewport,i=r.clientWidth,s=r.clientHeight,o=0,f=0;if(a){i=a.width,s=a.height;var c=Ug();(c||!c&&e==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}return{width:i,height:s,x:o+Ld(t),y:f}}function ik(t){var e,n=nr(t),r=Cd(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Mr(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Mr(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),o=-r.scrollLeft+Ld(t),f=-r.scrollTop;return Nn(a||n).direction==="rtl"&&(o+=Mr(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:o,y:f}}function Nd(t){var e=Nn(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function Yg(t){return["html","body","#document"].indexOf(cn(t))>=0?t.ownerDocument.body:Bt(t)&&Nd(t)?t:Yg(ul(t))}function ci(t,e){var n;e===void 0&&(e=[]);var r=Yg(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=wt(r),s=a?[i].concat(i.visualViewport||[],Nd(r)?r:[]):r,o=e.concat(s);return a?o:o.concat(ci(ul(s)))}function sc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function sk(t,e){var n=va(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function fp(t,e,n){return e===Bg?sc(ak(t,n)):Tr(e)?sk(e,n):sc(ik(nr(t)))}function ok(t){var e=ci(ul(t)),n=["absolute","fixed"].indexOf(Nn(t).position)>=0,r=n&&Bt(t)?Ki(t):t;return Tr(r)?e.filter(function(a){return Tr(a)&&_g(a,r)&&cn(a)!=="body"}):[]}function lk(t,e,n,r){var a=e==="clippingParents"?ok(t):[].concat(e),i=[].concat(a,[n]),s=i[0],o=i.reduce(function(f,c){var d=fp(t,c,r);return f.top=Mr(d.top,f.top),f.right=Bo(d.right,f.right),f.bottom=Bo(d.bottom,f.bottom),f.left=Mr(d.left,f.left),f},fp(t,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Qg(t){var e=t.reference,n=t.element,r=t.placement,a=r?sn(r):null,i=r?wa(r):null,s=e.x+e.width/2-n.width/2,o=e.y+e.height/2-n.height/2,f;switch(a){case pt:f={x:s,y:e.y-n.height};break;case _t:f={x:s,y:e.y+e.height};break;case Jt:f={x:e.x+e.width,y:o};break;case mt:f={x:e.x-n.width,y:o};break;default:f={x:e.x,y:e.y}}var c=a?jd(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case xa:f[c]=f[c]-(e[d]/2-n[d]/2);break;case ki:f[c]=f[c]+(e[d]/2-n[d]/2);break}}return f}function Si(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,o=n.boundary,f=o===void 0?TN:o,c=n.rootBoundary,d=c===void 0?Bg:c,u=n.elementContext,p=u===void 0?Ua:u,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,b=g===void 0?0:g,x=Vg(typeof b!="number"?b:Gg(b,qi)),v=p===Ua?IN:Ua,j=t.rects.popper,y=t.elements[m?v:p],L=lk(Tr(y)?y:y.contextElement||nr(t.elements.popper),f,d,s),C=va(t.elements.reference),N=Qg({reference:C,element:j,placement:a}),S=sc(Object.assign({},j,N)),T=p===Ua?S:C,z={top:L.top-T.top+x.top,bottom:T.bottom-L.bottom+x.bottom,left:L.left-T.left+x.left,right:T.right-L.right+x.right},P=t.modifiersData.offset;if(p===Ua&&P){var U=P[a];Object.keys(z).forEach(function(J){var G=[Jt,_t].indexOf(J)>=0?1:-1,K=[pt,_t].indexOf(J)>=0?"y":"x";z[J]+=U[K]*G})}return z}function fk(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Hg:f,d=wa(r),u=d?o?ip:ip.filter(function(m){return wa(m)===d}):qi,p=u.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=u);var h=p.reduce(function(m,g){return m[g]=Si(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[sn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function ck(t){if(sn(t)===vd)return[];var e=Rs(t);return[lp(t),e,lp(e)]}function dk(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,o=s===void 0?!0:s,f=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,b=e.options.placement,x=sn(b),v=x===b,j=f||(v||!m?[Rs(b)]:ck(b)),y=[b].concat(j).reduce(function(q,re){return q.concat(sn(re)===vd?fk(e,{placement:re,boundary:d,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:g}):re)},[]),L=e.rects.reference,C=e.rects.popper,N=new Map,S=!0,T=y[0],z=0;z<y.length;z++){var P=y[z],U=sn(P),J=wa(P)===xa,G=[pt,_t].indexOf(U)>=0,K=G?"width":"height",E=Si(e,{placement:P,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),Y=G?J?Jt:mt:J?_t:pt;L[K]>C[K]&&(Y=Rs(Y));var Z=Rs(Y),le=[];if(i&&le.push(E[U]<=0),o&&le.push(E[Y]<=0,E[Z]<=0),le.every(function(q){return q})){T=P,S=!1;break}N.set(P,le)}if(S)for(var we=m?3:1,Ie=function(re){var A=y.find(function(B){var ee=N.get(B);if(ee)return ee.slice(0,re).every(function(he){return he})});if(A)return T=A,"break"},Le=we;Le>0;Le--){var V=Ie(Le);if(V==="break")break}e.placement!==T&&(e.modifiersData[r]._skip=!0,e.placement=T,e.reset=!0)}}const uk={name:"flip",enabled:!0,phase:"main",fn:dk,requiresIfExists:["offset"],data:{_skip:!1}};function cp(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function dp(t){return[pt,Jt,_t,mt].some(function(e){return t[e]>=0})}function hk(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=Si(e,{elementContext:"reference"}),o=Si(e,{altBoundary:!0}),f=cp(s,r),c=cp(o,a,i),d=dp(f),u=dp(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const pk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hk};function mk(t,e,n){var r=sn(t),a=[mt,pt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*a,[mt,Jt].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function gk(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=Hg.reduce(function(d,u){return d[u]=mk(u,e.rects,i),d},{}),o=s[e.placement],f=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const bk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gk};function xk(t){var e=t.state,n=t.name;e.modifiersData[n]=Qg({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const yk={name:"popperOffsets",enabled:!0,phase:"read",fn:xk,data:{}};function vk(t){return t==="x"?"y":"x"}function wk(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,o=s===void 0?!1:s,f=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,p=n.tether,h=p===void 0?!0:p,m=n.tetherOffset,g=m===void 0?0:m,b=Si(e,{boundary:f,rootBoundary:c,padding:u,altBoundary:d}),x=sn(e.placement),v=wa(e.placement),j=!v,y=jd(x),L=vk(y),C=e.modifiersData.popperOffsets,N=e.rects.reference,S=e.rects.popper,T=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,z=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(C){if(i){var J,G=y==="y"?pt:mt,K=y==="y"?_t:Jt,E=y==="y"?"height":"width",Y=C[y],Z=Y+b[G],le=Y-b[K],we=h?-S[E]/2:0,Ie=v===xa?N[E]:S[E],Le=v===xa?-S[E]:-N[E],V=e.elements.arrow,q=h&&V?Md(V):{width:0,height:0},re=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jg(),A=re[G],B=re[K],ee=fi(0,N[E],q[E]),he=j?N[E]/2-we-ee-A-z.mainAxis:Ie-ee-A-z.mainAxis,Oe=j?-N[E]/2+we+ee+B+z.mainAxis:Le+ee+B+z.mainAxis,un=e.elements.arrow&&Ki(e.elements.arrow),dt=un?y==="y"?un.clientTop||0:un.clientLeft||0:0,Zt=(J=P==null?void 0:P[y])!=null?J:0,ir=Y+he-Zt-dt,Vr=Y+Oe-Zt,Da=fi(h?Bo(Z,ir):Z,Y,h?Mr(le,Vr):le);C[y]=Da,U[y]=Da-Y}if(o){var Ea,as=y==="x"?pt:mt,is=y==="x"?_t:Jt,hn=C[L],In=L==="y"?"height":"width",Aa=hn+b[as],sr=hn-b[is],za=[pt,mt].indexOf(x)!==-1,ss=(Ea=P==null?void 0:P[L])!=null?Ea:0,ls=za?Aa:hn-N[In]-S[In]-ss+z.altAxis,fs=za?hn+N[In]+S[In]-ss-z.altAxis:sr,cs=h&&za?GN(ls,hn,fs):fi(h?ls:Aa,hn,h?fs:sr);C[L]=cs,U[L]=cs-hn}e.modifiersData[r]=U}}const Mk={name:"preventOverflow",enabled:!0,phase:"main",fn:wk,requiresIfExists:["offset"]};function jk(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ck(t){return t===wt(t)||!Bt(t)?Cd(t):jk(t)}function Lk(t){var e=t.getBoundingClientRect(),n=ya(e.width)/t.offsetWidth||1,r=ya(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Nk(t,e,n){n===void 0&&(n=!1);var r=Bt(e),a=Bt(e)&&Lk(e),i=nr(e),s=va(t,a,n),o={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((cn(e)!=="body"||Nd(i))&&(o=Ck(e)),Bt(e)?(f=va(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):i&&(f.x=Ld(i))),{x:s.left+o.scrollLeft-f.x,y:s.top+o.scrollTop-f.y,width:s.width,height:s.height}}function kk(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var f=e.get(o);f&&a(f)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Sk(t){var e=kk(t);return FN.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Tk(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Ik(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var up={placement:"bottom",modifiers:[],strategy:"absolute"};function hp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Dk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?up:a;return function(o,f,c){c===void 0&&(c=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},up,i),modifiersData:{},elements:{reference:o,popper:f},attributes:{},styles:{}},u=[],p=!1,h={state:d,setOptions:function(x){var v=typeof x=="function"?x(d.options):x;g(),d.options=Object.assign({},i,d.options,v),d.scrollParents={reference:Tr(o)?ci(o):o.contextElement?ci(o.contextElement):[],popper:ci(f)};var j=Sk(Ik([].concat(r,d.options.modifiers)));return d.orderedModifiers=j.filter(function(y){return y.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var x=d.elements,v=x.reference,j=x.popper;if(hp(v,j)){d.rects={reference:Nk(v,Ki(j),d.options.strategy==="fixed"),popper:Md(j)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(z){return d.modifiersData[z.name]=Object.assign({},z.data)});for(var y=0;y<d.orderedModifiers.length;y++){if(d.reset===!0){d.reset=!1,y=-1;continue}var L=d.orderedModifiers[y],C=L.fn,N=L.options,S=N===void 0?{}:N,T=L.name;typeof C=="function"&&(d=C({state:d,options:S,name:T,instance:h})||d)}}}},update:Tk(function(){return new Promise(function(b){h.forceUpdate(),b(d)})}),destroy:function(){g(),p=!0}};if(!hp(o,f))return h;h.setOptions(c).then(function(b){!p&&c.onFirstUpdate&&c.onFirstUpdate(b)});function m(){d.orderedModifiers.forEach(function(b){var x=b.name,v=b.options,j=v===void 0?{}:v,y=b.effect;if(typeof y=="function"){var L=y({state:d,name:x,instance:h,options:j}),C=function(){};u.push(L||C)}})}function g(){u.forEach(function(b){return b()}),u=[]}return h}}var Ek=[tk,yk,XN,Fg,bk,uk,Mk,$N,pk],Ak=Dk({defaultModifiers:Ek}),zk="tippy-box",Wg="tippy-content",Ok="tippy-backdrop",$g="tippy-arrow",Zg="tippy-svg-arrow",fr={passive:!0,capture:!0},qg=function(){return document.body};function Pk(t,e){return{}.hasOwnProperty.call(t,e)}function df(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function kd(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Kg(t,e){return typeof t=="function"?t.apply(void 0,e):t}function pp(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Rk(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Bk(t){return t.split(/\s+/).filter(Boolean)}function ta(t){return[].concat(t)}function mp(t,e){t.indexOf(e)===-1&&t.push(e)}function Hk(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Fk(t){return t.split("-")[0]}function Ho(t){return[].slice.call(t)}function gp(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function di(){return document.createElement("div")}function Ti(t){return["Element","Fragment"].some(function(e){return kd(t,e)})}function Uk(t){return kd(t,"NodeList")}function _k(t){return kd(t,"MouseEvent")}function Jk(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Vk(t){return Ti(t)?[t]:Uk(t)?Ho(t):Array.isArray(t)?t:Ho(document.querySelectorAll(t))}function uf(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function bp(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Gk(t){var e,n=ta(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Yk(t,e){var n=e.clientX,r=e.clientY;return t.every(function(a){var i=a.popperRect,s=a.popperState,o=a.props,f=o.interactiveBorder,c=Fk(s.placement),d=s.modifiersData.offset;if(!d)return!0;var u=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,m=c==="left"?d.right.x:0,g=i.top-r+u>f,b=r-i.bottom-p>f,x=i.left-n+h>f,v=n-i.right-m>f;return g||b||x||v})}function hf(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){t[r](a,n)})}function xp(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var an={isTouch:!1},yp=0;function Qk(){an.isTouch||(an.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xg))}function Xg(){var t=performance.now();t-yp<20&&(an.isTouch=!1,document.removeEventListener("mousemove",Xg)),yp=t}function Wk(){var t=document.activeElement;if(Jk(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $k(){document.addEventListener("touchstart",Qk,fr),window.addEventListener("blur",Wk)}var Zk=typeof window<"u"&&typeof document<"u",qk=Zk?!!window.msCrypto:!1;function $r(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function vp(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function Kk(t){return vp(`
146
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=i=>{const s=Qf(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,f)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:f}),customNestedParser:r},n);return s?[{type:"taskList",raw:s.raw,items:s.items}]:n.blockTokens(i)},a=Qf(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(a)return{type:"taskList",raw:a.raw,items:a.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Se.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(yg.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(vg.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Ng.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Sg.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(UL.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(_L.configure(this.options.taskList)),t}});var Xh="&nbsp;",JL=" ",VL=ct.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ye(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Xh||r[0].text===JL)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e)=>{if(!t)return"";const n=Array.isArray(t.content)?t.content:[];return n.length===0?Xh:e.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),GL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,YL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,QL=zr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ye(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ga({find:GL,type:this.type})]},addPasteRules(){return[Sr({find:YL,type:this.type})]}}),WL=ct.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Tg=zr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ye(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const a=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!a)return;const i=a[2].trim();return{type:"underline",raw:a[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),$L=Tg;function ZL(t={}){return new je({view(e){return new qL(e,t)}})}class qL{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(a=>{let i=s=>{this[a](s)};return e.dom.addEventListener(a,i),{name:a,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,a=this.editorView.dom,i=a.getBoundingClientRect(),s=i.width/a.offsetWidth,o=i.height/a.offsetHeight;if(n){let u=e.nodeBefore,p=e.nodeAfter;if(u||p){let h=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(h){let m=h.getBoundingClientRect(),g=u?m.bottom:m.top;u&&p&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*o;r={left:m.left,right:m.right,top:g-b,bottom:g+b}}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*s;r={left:u.left-p,right:u.left+p,top:u.top,bottom:u.bottom}}let f=this.editorView.dom.offsetParent;this.element||(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!f||f==document.body&&getComputedStyle(f).position=="static")c=-pageXOffset,d=-pageYOffset;else{let u=f.getBoundingClientRect(),p=u.width/f.offsetWidth,h=u.height/f.offsetHeight;c=u.left-f.scrollLeft*p,d=u.top-f.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),a=r&&r.type.spec.disableDropCursor,i=typeof a=="function"?a(this.editorView,n,e):a;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=v1(this.editorView.state.doc,s,this.editorView.dragging.slice);o!=null&&(s=o)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ke extends ie{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ke.valid(r)?new ke(r):ie.near(r)}content(){return _.empty}eq(e){return e instanceof ke&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ke(e.resolve(n.pos))}getBookmark(){return new yd(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!KL(e)||!XL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let a=n.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ke.valid(e))return e;let a=e.pos,i=null;for(let s=e.depth;;s--){let o=e.node(s);if(n>0?e.indexAfter(s)<o.childCount:e.index(s)>0){i=o.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;a+=n;let f=e.doc.resolve(a);if(ke.valid(f))return f}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!$.isSelectable(i)){e=e.doc.resolve(a+i.nodeSize*n),r=!1;continue e}break}i=s,a+=n;let o=e.doc.resolve(a);if(ke.valid(o))return o}return null}}}ke.prototype.visible=!1;ke.findFrom=ke.findGapCursorFrom;ie.jsonID("gapcursor",ke);class yd{constructor(e){this.pos=e}map(e){return new yd(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ke.valid(n)?new ke(n):ie.near(n)}}function Ig(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function KL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n-1);;a=a.lastChild){if(a.childCount==0&&!a.inlineContent||Ig(a.type))return!0;if(a.inlineContent)return!1}}return!0}function XL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let a=r.child(n);;a=a.firstChild){if(a.childCount==0&&!a.inlineContent||Ig(a.type))return!0;if(a.inlineContent)return!1}}return!0}function eN(){return new je({props:{decorations:aN,createSelectionBetween(t,e,n){return e.pos==n.pos&&ke.valid(n)?new ke(n):null},handleClick:nN,handleKeyDown:tN,handleDOMEvents:{beforeinput:rN}}})}const tN=wm({ArrowLeft:Ls("horiz",-1),ArrowRight:Ls("horiz",1),ArrowUp:Ls("vert",-1),ArrowDown:Ls("vert",1)});function Ls(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,a,i){let s=r.selection,o=e>0?s.$to:s.$from,f=s.empty;if(s instanceof te){if(!i.endOfTextblock(n)||o.depth==0)return!1;f=!1,o=r.doc.resolve(e>0?o.after():o.before())}let c=ke.findGapCursorFrom(o,e,f);return c?(a&&a(r.tr.setSelection(new ke(c))),!0):!1}}function nN(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ke.valid(r))return!1;let a=t.posAtCoords({left:n.clientX,top:n.clientY});return a&&a.inside>-1&&$.isSelectable(t.state.doc.nodeAt(a.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ke(r))),!0)}function rN(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ke))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let a=O.empty;for(let s=r.length-1;s>=0;s--)a=O.from(r[s].createAndFill(null,a));let i=t.state.tr.replace(n.pos,n.pos,new _(a,0,0));return i.setSelection(te.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function aN(t){if(!(t.selection instanceof ke))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Me.create(t.doc,[qe.widget(t.selection.head,e,{key:"gapcursor"})])}var Ro=200,He=function(){};He.prototype.append=function(e){return e.length?(e=He.from(e),!this.length&&e||e.length<Ro&&this.leafAppend(e)||this.length<Ro&&e.leafPrepend(this)||this.appendInner(e)):this};He.prototype.prepend=function(e){return e.length?He.from(e).append(this):this};He.prototype.appendInner=function(e){return new iN(this,e)};He.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?He.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};He.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};He.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};He.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var a=[];return this.forEach(function(i,s){return a.push(e(i,s))},n,r),a};He.from=function(e){return e instanceof He?e:e&&e.length?new Dg(e):He.empty};var Dg=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(a,i){return a==0&&i==this.length?this:new e(this.values.slice(a,i))},e.prototype.getInner=function(a){return this.values[a]},e.prototype.forEachInner=function(a,i,s,o){for(var f=i;f<s;f++)if(a(this.values[f],o+f)===!1)return!1},e.prototype.forEachInvertedInner=function(a,i,s,o){for(var f=i-1;f>=s;f--)if(a(this.values[f],o+f)===!1)return!1},e.prototype.leafAppend=function(a){if(this.length+a.length<=Ro)return new e(this.values.concat(a.flatten()))},e.prototype.leafPrepend=function(a){if(this.length+a.length<=Ro)return new e(a.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(He);He.empty=new Dg([]);var iN=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,a,i,s){var o=this.left.length;if(a<o&&this.left.forEachInner(r,a,Math.min(i,o),s)===!1||i>o&&this.right.forEachInner(r,Math.max(a-o,0),Math.min(this.length,i)-o,s+o)===!1)return!1},e.prototype.forEachInvertedInner=function(r,a,i,s){var o=this.left.length;if(a>o&&this.right.forEachInvertedInner(r,a-o,Math.max(i,o)-o,s+o)===!1||i<o&&this.left.forEachInvertedInner(r,Math.min(a,o),i,s)===!1)return!1},e.prototype.sliceInner=function(r,a){if(r==0&&a==this.length)return this;var i=this.left.length;return a<=i?this.left.slice(r,a):r>=i?this.right.slice(r-i,a-i):this.left.slice(r,i).append(this.right.slice(0,a-i))},e.prototype.leafAppend=function(r){var a=this.right.leafAppend(r);if(a)return new e(this.left,a)},e.prototype.leafPrepend=function(r){var a=this.left.leafPrepend(r);if(a)return new e(a,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(He);const sN=500;class Yt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let a,i;n&&(a=this.remapping(r,this.items.length),i=a.maps.length);let s=e.tr,o,f,c=[],d=[];return this.items.forEach((u,p)=>{if(!u.step){a||(a=this.remapping(r,p+1),i=a.maps.length),i--,d.push(u);return}if(a){d.push(new Xt(u.map));let h=u.step.map(a.slice(i)),m;h&&s.maybeStep(h).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Xt(m,void 0,void 0,c.length+d.length))),i--,m&&a.appendMap(m,i)}else s.maybeStep(u.step);if(u.selection)return o=a?u.selection.map(a.slice(i)):u.selection,f=new Yt(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:s,selection:o}}addTransform(e,n,r,a){let i=[],s=this.eventCount,o=this.items,f=!a&&o.length?o.get(o.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),p=new Xt(e.mapping.maps[d],u,n),h;(h=f&&f.merge(p))&&(p=h,d?i.pop():o=o.slice(0,o.length-1)),i.push(p),n&&(s++,n=void 0),a||(f=p)}let c=s-r.depth;return c>lN&&(o=oN(o,c),s-=c),new Yt(o.append(i),s)}remapping(e,n){let r=new xi;return this.items.forEach((a,i)=>{let s=a.mirrorOffset!=null&&i-a.mirrorOffset>=e?r.maps.length-a.mirrorOffset:void 0;r.appendMap(a.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Yt(this.items.append(e.map(n=>new Xt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],a=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(p=>{p.selection&&o--},a);let f=n;this.items.forEach(p=>{let h=i.getMirror(--f);if(h==null)return;s=Math.min(s,h);let m=i.maps[h];if(p.step){let g=e.steps[h].invert(e.docs[h]),b=p.selection&&p.selection.map(i.slice(f+1,h));b&&o++,r.push(new Xt(m,g,b))}else r.push(new Xt(m))},a);let c=[];for(let p=n;p<s;p++)c.push(new Xt(i.maps[p]));let d=this.items.slice(0,a).append(c).append(r),u=new Yt(d,o);return u.emptyItemCount()>sN&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,a=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)a.push(s),s.selection&&i++;else if(s.step){let f=s.step.map(n.slice(r)),c=f&&f.getMap();if(r--,c&&n.appendMap(c,r),f){let d=s.selection&&s.selection.map(n.slice(r));d&&i++;let u=new Xt(c.invert(),f,d),p,h=a.length-1;(p=a.length&&a[h].merge(u))?a[h]=p:a.push(u)}}else s.map&&r--},this.items.length,0),new Yt(He.from(a.reverse()),i)}}Yt.empty=new Yt(He.empty,0);function oN(t,e){let n;return t.forEach((r,a)=>{if(r.selection&&e--==0)return n=a,!1}),t.slice(n)}class Xt{constructor(e,n,r,a){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=a}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Xt(n.getMap().invert(),n,this.selection)}}}class On{constructor(e,n,r,a,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=a,this.prevComposition=i}}const lN=20;function fN(t,e,n,r){let a=n.getMeta(wr),i;if(a)return a.historyState;n.getMeta(uN)&&(t=new On(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(wr))return s.getMeta(wr).redo?new On(t.done.addTransform(n,void 0,r,Ps(e)),t.undone,ep(n.mapping.maps),t.prevTime,t.prevComposition):new On(t.done,t.undone.addTransform(n,void 0,r,Ps(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),f=t.prevTime==0||!s&&t.prevComposition!=o&&(t.prevTime<(n.time||0)-r.newGroupDelay||!cN(n,t.prevRanges)),c=s?ff(t.prevRanges,n.mapping):ep(n.mapping.maps);return new On(t.done.addTransform(n,f?e.selection.getBookmark():void 0,r,Ps(e)),Yt.empty,c,n.time,o??t.prevComposition)}else return(i=n.getMeta("rebased"))?new On(t.done.rebased(n,i),t.undone.rebased(n,i),ff(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new On(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ff(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function cN(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,a)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&a>=e[i]&&(n=!0)}),n}function ep(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,a,i,s)=>e.push(i,s));return e}function ff(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let a=e.map(t[r],1),i=e.map(t[r+1],-1);a<=i&&n.push(a,i)}return n}function dN(t,e,n){let r=Ps(e),a=wr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),o=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),a,r),f=new On(n?o:i.remaining,n?i.remaining:o,null,0,-1);return i.transform.setSelection(s).setMeta(wr,{redo:n,historyState:f})}let cf=!1,tp=null;function Ps(t){let e=t.plugins;if(tp!=e){cf=!1,tp=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){cf=!0;break}}return cf}const wr=new Te("history"),uN=new Te("closeHistory");function hN(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new je({key:wr,state:{init(){return new On(Yt.empty,Yt.empty,null,0,-1)},apply(e,n,r){return fN(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,a=r=="historyUndo"?Ag:r=="historyRedo"?zg:null;return!a||!e.editable?!1:(n.preventDefault(),a(e.state,e.dispatch))}}}})}function Eg(t,e){return(n,r)=>{let a=wr.getState(n);if(!a||(t?a.undone:a.done).eventCount==0)return!1;if(r){let i=dN(a,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const Ag=Eg(!1,!0),zg=Eg(!0,!0);Se.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new je({key:new Te("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const a=this.options.limit;if(a==null||a===0){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>a){const s=i-a,o=0,f=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${a} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(o,f);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const a=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||a>r&&i>r&&i<=a)return!0;if(a>r&&i>r&&i>a||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,f=i-r,c=o-f,d=o;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var pN=Se.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[ZL(this.options)]}});Se.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new je({key:new Te("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:a}=e,i=[];if(!n||!r)return Me.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((f,c)=>{if(f.isText)return;if(!(a>=c&&a<=c+f.nodeSize-1))return!1;s+=1});let o=0;return t.descendants((f,c)=>{if(f.isText||!(a>=c&&a<=c+f.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&s-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";i.push(qe.node(c,c+f.nodeSize,{class:this.options.className}))}),Me.create(t,i)}}})]}});var mN=Se.create({name:"gapCursor",addProseMirrorPlugins(){return[eN()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ue(W(t,"allowGapCursor",n)))!=null?e:null}}}),np="placeholder";function gN(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var bN=Se.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:np,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${gN(this.options.dataAttribute)}`:`data-${np}`;return[new je({key:new Te("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:a}=n,i=[];if(!r)return null;const s=this.editor.isEmpty;return e.descendants((o,f)=>{const c=a>=f&&a<=f+o.nodeSize,d=!o.isLeaf&&ll(o);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=qe.node(f,f+o.nodeSize,{class:u.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:f,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Me.create(e,i)}}})]}});Se.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new je({key:new Te("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||Rm(n.selection)||t.view.dragging?null:Me.create(n.doc,[qe.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function rp({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var xN=Se.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Te(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,a])=>a).filter(a=>(this.options.notAfter||[]).concat(n).includes(a.name));return[new je({key:e,appendTransaction:(a,i,s)=>{const{doc:o,tr:f,schema:c}=s,d=e.getState(s),u=o.content.size,p=c.nodes[n];if(d)return f.insert(u,p.create())},state:{init:(a,i)=>{const s=i.tr.doc.lastChild;return!rp({node:s,types:r})},apply:(a,i)=>{if(!a.docChanged||a.getMeta("__uniqueIDTransaction"))return i;const s=a.doc.lastChild;return!rp({node:s,types:r})}}})]}}),yN=Se.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Ag(t,e),redo:()=>({state:t,dispatch:e})=>zg(t,e)}},addProseMirrorPlugins(){return[hN(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),vN=Se.create({name:"starterKit",addExtensions(){var t,e,n,r;const a=[];return this.options.bold!==!1&&a.push(V6.configure(this.options.bold)),this.options.blockquote!==!1&&a.push(H6.configure(this.options.blockquote)),this.options.bulletList!==!1&&a.push(yg.configure(this.options.bulletList)),this.options.code!==!1&&a.push(Q6.configure(this.options.code)),this.options.codeBlock!==!1&&a.push(Z6.configure(this.options.codeBlock)),this.options.document!==!1&&a.push(q6.configure(this.options.document)),this.options.dropcursor!==!1&&a.push(pN.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&a.push(mN.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&a.push(K6.configure(this.options.hardBreak)),this.options.heading!==!1&&a.push(X6.configure(this.options.heading)),this.options.undoRedo!==!1&&a.push(yN.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&a.push(eL.configure(this.options.horizontalRule)),this.options.italic!==!1&&a.push(iL.configure(this.options.italic)),this.options.listItem!==!1&&a.push(vg.configure(this.options.listItem)),this.options.listKeymap!==!1&&a.push(Ng.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&a.push(xg.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&a.push(Sg.configure(this.options.orderedList)),this.options.paragraph!==!1&&a.push(VL.configure(this.options.paragraph)),this.options.strike!==!1&&a.push(QL.configure(this.options.strike)),this.options.text!==!1&&a.push(WL.configure(this.options.text)),this.options.underline!==!1&&a.push(Tg.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&a.push(xN.configure((r=this.options)==null?void 0:r.trailingNode)),a}}),Og=vN,wN=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,MN=ct.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ye(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,r,a,i,s;const o=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",f=(a=(r=t.attrs)==null?void 0:r.alt)!=null?a:"",c=(s=(i=t.attrs)==null?void 0:i.title)!=null?s:"";return c?`![${f}](${o} "${c}")`:`![${f}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:a,getPos:i,HTMLAttributes:s,editor:o})=>{const f=document.createElement("img");Object.entries(s).forEach(([u,p])=>{if(p!=null)switch(u){case"width":case"height":break;default:f.setAttribute(u,p);break}}),f.src=s.src;const c=new kC({element:f,editor:o,node:a,getPos:i,onResize:(u,p)=>{f.style.width=`${u}px`,f.style.height=`${p}px`},onCommit:(u,p)=>{const h=i();h!==void 0&&this.editor.chain().setNodeSelection(h).updateAttributes(this.name,{width:u,height:p}).run()},onUpdate:(u,p,h)=>u.type===a.type,options:{directions:t,min:{width:e,height:n},preserveAspectRatio:r===!0}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",f.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[eg({find:wN,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Pg=MN;function jN(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:s,$position:o}=t,f=r&&!a,c=TC(n),d=new RegExp(`\\s${c}$`),u=s?"^":"",p=a?"":c,h=f?new RegExp(`${u}${c}.*?(?=\\s${p}|$)`,"gm"):new RegExp(`${u}(?:^)?${c}[^\\s${p}]*`,"gm"),m=((e=o.nodeBefore)==null?void 0:e.isText)&&o.nodeBefore.text;if(!m)return null;const g=o.pos-m.length,b=Array.from(m.matchAll(h)).pop();if(!b||b.input===void 0||b.index===void 0)return null;const x=b.input.slice(Math.max(0,b.index-1),b.index),v=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(x);if(i!==null&&!v)return null;const j=g+b.index;let y=j+b[0].length;return f&&d.test(m.slice(y-1,y+1))&&(b[0]+=" ",y+=1),j<o.pos&&y>=o.pos?{range:{from:j,to:y},query:b[0].slice(n.length),text:b[0]}:null}var CN=new Te("suggestion");function LN({pluginKey:t=CN,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:a=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:o="span",decorationClass:f="suggestion",decorationContent:c="",decorationEmptyClass:d="is-empty",command:u=()=>null,items:p=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=jN,shouldShow:b}){let x;const v=h==null?void 0:h(),j=()=>{const N=e.state.selection.$anchor.pos,S=e.view.coordsAtPos(N),{top:T,right:z,bottom:P,left:U}=S;try{return new DOMRect(U,T,z-U,P-T)}catch{return null}},y=(N,S)=>S?()=>{const T=t.getState(e.state),z=T==null?void 0:T.decorationId,P=N.dom.querySelector(`[data-decoration-id="${z}"]`);return(P==null?void 0:P.getBoundingClientRect())||null}:j;function L(N,S){var T;try{const P=t.getState(N.state),U=P!=null&&P.decorationId?N.dom.querySelector(`[data-decoration-id="${P.decorationId}"]`):null,J={editor:e,range:(P==null?void 0:P.range)||{from:0,to:0},query:(P==null?void 0:P.query)||null,text:(P==null?void 0:P.text)||null,items:[],command:Y=>u({editor:e,range:(P==null?void 0:P.range)||{from:0,to:0},props:Y}),decorationNode:U,clientRect:y(N,U)};(T=v==null?void 0:v.onExit)==null||T.call(v,J)}catch{}const z=N.state.tr.setMeta(S,{exit:!0});N.dispatch(z)}const C=new je({key:t,view(){return{update:async(N,S)=>{var T,z,P,U,J,Y,K;const E=(T=this.key)==null?void 0:T.getState(S),G=(z=this.key)==null?void 0:z.getState(N.state),Z=E.active&&G.active&&E.range.from!==G.range.from,le=!E.active&&G.active,we=E.active&&!G.active,Ie=!le&&!we&&E.query!==G.query,Le=le||Z&&Ie,V=Ie||Z,q=we||Z&&Ie;if(!Le&&!V&&!q)return;const re=q&&!Le?E:G,A=N.dom.querySelector(`[data-decoration-id="${re.decorationId}"]`);x={editor:e,range:re.range,query:re.query,text:re.text,items:[],command:B=>u({editor:e,range:re.range,props:B}),decorationNode:A,clientRect:y(N,A)},Le&&((P=v==null?void 0:v.onBeforeStart)==null||P.call(v,x)),V&&((U=v==null?void 0:v.onBeforeUpdate)==null||U.call(v,x)),(V||Le)&&(x.items=await p({editor:e,query:re.query})),q&&((J=v==null?void 0:v.onExit)==null||J.call(v,x)),V&&((Y=v==null?void 0:v.onUpdate)==null||Y.call(v,x)),Le&&((K=v==null?void 0:v.onStart)==null||K.call(v,x))},destroy:()=>{var N;x&&((N=v==null?void 0:v.onExit)==null||N.call(v,x))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(N,S,T,z){const{isEditable:P}=e,{composing:U}=e.view,{selection:J}=N,{empty:Y,from:K}=J,E={...S},G=N.getMeta(t);if(G&&G.exit)return E.active=!1,E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null,E;if(E.composing=U,P&&(Y||e.view.composing)){(K<S.range.from||K>S.range.to)&&!U&&!S.composing&&(E.active=!1);const Z=g({char:n,allowSpaces:r,allowToIncludeChar:a,allowedPrefixes:i,startOfLine:s,$position:J.$from}),le=`id_${Math.floor(Math.random()*4294967295)}`;Z&&m({editor:e,state:z,range:Z.range,isActive:S.active})&&(!b||b({editor:e,range:Z.range,query:Z.query,text:Z.text,transaction:N}))?(E.active=!0,E.decorationId=S.decorationId?S.decorationId:le,E.range=Z.range,E.query=Z.query,E.text=Z.text):E.active=!1}else E.active=!1;return E.active||(E.decorationId=null,E.range={from:0,to:0},E.query=null,E.text=null),E}},props:{handleKeyDown(N,S){var T,z,P,U;const{active:J,range:Y}=C.getState(N.state);if(!J)return!1;if(S.key==="Escape"||S.key==="Esc"){const E=C.getState(N.state),G=(T=x==null?void 0:x.decorationNode)!=null?T:null,Z=G??(E!=null&&E.decorationId?N.dom.querySelector(`[data-decoration-id="${E.decorationId}"]`):null);if(((z=v==null?void 0:v.onKeyDown)==null?void 0:z.call(v,{view:N,event:S,range:E.range}))||!1)return!0;const we={editor:e,range:E.range,query:E.query,text:E.text,items:[],command:Ie=>u({editor:e,range:E.range,props:Ie}),decorationNode:Z,clientRect:Z?()=>Z.getBoundingClientRect()||null:null};return(P=v==null?void 0:v.onExit)==null||P.call(v,we),L(N,t),!0}return((U=v==null?void 0:v.onKeyDown)==null?void 0:U.call(v,{view:N,event:S,range:Y}))||!1},decorations(N){const{active:S,range:T,decorationId:z,query:P}=C.getState(N);if(!S)return null;const U=!(P!=null&&P.length),J=[f];return U&&J.push(d),Me.create(N.doc,[qe.inline(T.from,T.to,{nodeName:o,class:J.join(" "),"data-decoration-id":z,"data-decoration-content":c})])}}});return C}function NN({editor:t,overrideSuggestionOptions:e,extensionName:n,char:r="@"}){const a=new Te;return{editor:t,char:r,pluginKey:a,command:({editor:i,range:s,props:o})=>{var f,c,d;const u=i.view.state.selection.$to.nodeAfter;((f=u==null?void 0:u.text)==null?void 0:f.startsWith(" "))&&(s.to+=1),i.chain().focus().insertContentAt(s,[{type:n,attrs:{...o,mentionSuggestionChar:r}},{type:"text",text:" "}]).run(),(d=(c=i.view.dom.ownerDocument.defaultView)==null?void 0:c.getSelection())==null||d.collapseToEnd()},allow:({state:i,range:s})=>{const o=i.doc.resolve(s.from),f=i.schema.nodes[n];return!!o.parent.type.contentMatch.matchType(f)},...e}}function Rg(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>NN({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function ap(t,e){const n=Rg(t),r=n.find(a=>a.char===e);return r||(n.length?n[0]:null)}var kN=ct.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,r;return`${(n=e==null?void 0:e.char)!=null?n:"@"}${(r=t.attrs.label)!=null?r:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var r,a;return["span",ye(this.HTMLAttributes,t.HTMLAttributes),`${(r=n==null?void 0:n.char)!=null?r:"@"}${(a=e.attrs.label)!=null?a:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=ap(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const r={...this.options};r.HTMLAttributes=ye({"data-type":this.name},this.options.HTMLAttributes,e);const a=this.options.renderHTML({options:r,node:t,suggestion:n});return typeof a=="string"?["span",ye({"data-type":this.name},this.options.HTMLAttributes,e),a]:a},...tg({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,a,i,s]=r,o=i??s;e[a==="char"?"mentionSuggestionChar":a]=o,r=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:ap(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:a,anchor:i}=r;if(!a)return!1;let s=new Ot,o=0;return e.doc.nodesBetween(i-1,i,(f,c)=>{if(f.type.name===this.name)return n=!0,s=f,o=c,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":s.attrs.mentionSuggestionChar,o,o+s.nodeSize),n})}},addProseMirrorPlugins(){return Rg(this).map(LN)}}),SN=kN,pt="top",_t="bottom",Jt="right",mt="left",vd="auto",qi=[pt,_t,Jt,mt],xa="start",ki="end",TN="clippingParents",Bg="viewport",Ua="popper",IN="reference",ip=qi.reduce(function(t,e){return t.concat([e+"-"+xa,e+"-"+ki])},[]),Hg=[].concat(qi,[vd]).reduce(function(t,e){return t.concat([e,e+"-"+xa,e+"-"+ki])},[]),DN="beforeRead",EN="read",AN="afterRead",zN="beforeMain",ON="main",PN="afterMain",RN="beforeWrite",BN="write",HN="afterWrite",FN=[DN,EN,AN,zN,ON,PN,RN,BN,HN];function cn(t){return t?(t.nodeName||"").toLowerCase():null}function wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Tr(t){var e=wt(t).Element;return t instanceof e||t instanceof Element}function Bt(t){var e=wt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function wd(t){if(typeof ShadowRoot>"u")return!1;var e=wt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function UN(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Bt(i)||!cn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var o=a[s];o===!1?i.removeAttribute(s):i.setAttribute(s,o===!0?"":o)}))})}function _N(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),o=s.reduce(function(f,c){return f[c]="",f},{});!Bt(a)||!cn(a)||(Object.assign(a.style,o),Object.keys(i).forEach(function(f){a.removeAttribute(f)}))})}}const Fg={name:"applyStyles",enabled:!0,phase:"write",fn:UN,effect:_N,requires:["computeStyles"]};function sn(t){return t.split("-")[0]}var Mr=Math.max,Bo=Math.min,ya=Math.round;function ic(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ug(){return!/^((?!chrome|android).)*safari/i.test(ic())}function va(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),a=1,i=1;e&&Bt(t)&&(a=t.offsetWidth>0&&ya(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&ya(r.height)/t.offsetHeight||1);var s=Tr(t)?wt(t):window,o=s.visualViewport,f=!Ug()&&n,c=(r.left+(f&&o?o.offsetLeft:0))/a,d=(r.top+(f&&o?o.offsetTop:0))/i,u=r.width/a,p=r.height/i;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function Md(t){var e=va(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function _g(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&wd(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Nn(t){return wt(t).getComputedStyle(t)}function JN(t){return["table","td","th"].indexOf(cn(t))>=0}function nr(t){return((Tr(t)?t.ownerDocument:t.document)||window.document).documentElement}function ul(t){return cn(t)==="html"?t:t.assignedSlot||t.parentNode||(wd(t)?t.host:null)||nr(t)}function sp(t){return!Bt(t)||Nn(t).position==="fixed"?null:t.offsetParent}function VN(t){var e=/firefox/i.test(ic()),n=/Trident/i.test(ic());if(n&&Bt(t)){var r=Nn(t);if(r.position==="fixed")return null}var a=ul(t);for(wd(a)&&(a=a.host);Bt(a)&&["html","body"].indexOf(cn(a))<0;){var i=Nn(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ki(t){for(var e=wt(t),n=sp(t);n&&JN(n)&&Nn(n).position==="static";)n=sp(n);return n&&(cn(n)==="html"||cn(n)==="body"&&Nn(n).position==="static")?e:n||VN(t)||e}function jd(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fi(t,e,n){return Mr(t,Bo(e,n))}function GN(t,e,n){var r=fi(t,e,n);return r>n?n:r}function Jg(){return{top:0,right:0,bottom:0,left:0}}function Vg(t){return Object.assign({},Jg(),t)}function Gg(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var YN=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Vg(typeof e!="number"?e:Gg(e,qi))};function QN(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,o=sn(n.placement),f=jd(o),c=[mt,Jt].indexOf(o)>=0,d=c?"height":"width";if(!(!i||!s)){var u=YN(a.padding,n),p=Md(i),h=f==="y"?pt:mt,m=f==="y"?_t:Jt,g=n.rects.reference[d]+n.rects.reference[f]-s[f]-n.rects.popper[d],b=s[f]-n.rects.reference[f],x=Ki(i),v=x?f==="y"?x.clientHeight||0:x.clientWidth||0:0,j=g/2-b/2,y=u[h],L=v-p[d]-u[m],C=v/2-p[d]/2+j,N=fi(y,C,L),S=f;n.modifiersData[r]=(e={},e[S]=N,e.centerOffset=N-C,e)}}function WN(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||_g(e.elements.popper,a)&&(e.elements.arrow=a))}const $N={name:"arrow",enabled:!0,phase:"main",fn:QN,effect:WN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wa(t){return t.split("-")[1]}var ZN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qN(t,e){var n=t.x,r=t.y,a=e.devicePixelRatio||1;return{x:ya(n*a)/a||0,y:ya(r*a)/a||0}}function op(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,o=t.position,f=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,u=t.isFixed,p=s.x,h=p===void 0?0:p,m=s.y,g=m===void 0?0:m,b=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var x=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),j=mt,y=pt,L=window;if(c){var C=Ki(n),N="clientHeight",S="clientWidth";if(C===wt(n)&&(C=nr(n),Nn(C).position!=="static"&&o==="absolute"&&(N="scrollHeight",S="scrollWidth")),C=C,a===pt||(a===mt||a===Jt)&&i===ki){y=_t;var T=u&&C===L&&L.visualViewport?L.visualViewport.height:C[N];g-=T-r.height,g*=f?1:-1}if(a===mt||(a===pt||a===_t)&&i===ki){j=Jt;var z=u&&C===L&&L.visualViewport?L.visualViewport.width:C[S];h-=z-r.width,h*=f?1:-1}}var P=Object.assign({position:o},c&&ZN),U=d===!0?qN({x:h,y:g},wt(n)):{x:h,y:g};if(h=U.x,g=U.y,f){var J;return Object.assign({},P,(J={},J[y]=v?"0":"",J[j]=x?"0":"",J.transform=(L.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",J))}return Object.assign({},P,(e={},e[y]=v?g+"px":"",e[j]=x?h+"px":"",e.transform="",e))}function KN(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,o=n.roundOffsets,f=o===void 0?!0:o,c={placement:sn(e.placement),variation:wa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,op(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,op(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const XN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:KN,data:{}};var Ns={passive:!0};function ek(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,o=s===void 0?!0:s,f=wt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(d){d.addEventListener("scroll",n.update,Ns)}),o&&f.addEventListener("resize",n.update,Ns),function(){i&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Ns)}),o&&f.removeEventListener("resize",n.update,Ns)}}const tk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ek,data:{}};var nk={left:"right",right:"left",bottom:"top",top:"bottom"};function Rs(t){return t.replace(/left|right|bottom|top/g,function(e){return nk[e]})}var rk={start:"end",end:"start"};function lp(t){return t.replace(/start|end/g,function(e){return rk[e]})}function Cd(t){var e=wt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ld(t){return va(nr(t)).left+Cd(t).scrollLeft}function ak(t,e){var n=wt(t),r=nr(t),a=n.visualViewport,i=r.clientWidth,s=r.clientHeight,o=0,f=0;if(a){i=a.width,s=a.height;var c=Ug();(c||!c&&e==="fixed")&&(o=a.offsetLeft,f=a.offsetTop)}return{width:i,height:s,x:o+Ld(t),y:f}}function ik(t){var e,n=nr(t),r=Cd(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Mr(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Mr(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),o=-r.scrollLeft+Ld(t),f=-r.scrollTop;return Nn(a||n).direction==="rtl"&&(o+=Mr(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:o,y:f}}function Nd(t){var e=Nn(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function Yg(t){return["html","body","#document"].indexOf(cn(t))>=0?t.ownerDocument.body:Bt(t)&&Nd(t)?t:Yg(ul(t))}function ci(t,e){var n;e===void 0&&(e=[]);var r=Yg(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=wt(r),s=a?[i].concat(i.visualViewport||[],Nd(r)?r:[]):r,o=e.concat(s);return a?o:o.concat(ci(ul(s)))}function sc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function sk(t,e){var n=va(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function fp(t,e,n){return e===Bg?sc(ak(t,n)):Tr(e)?sk(e,n):sc(ik(nr(t)))}function ok(t){var e=ci(ul(t)),n=["absolute","fixed"].indexOf(Nn(t).position)>=0,r=n&&Bt(t)?Ki(t):t;return Tr(r)?e.filter(function(a){return Tr(a)&&_g(a,r)&&cn(a)!=="body"}):[]}function lk(t,e,n,r){var a=e==="clippingParents"?ok(t):[].concat(e),i=[].concat(a,[n]),s=i[0],o=i.reduce(function(f,c){var d=fp(t,c,r);return f.top=Mr(d.top,f.top),f.right=Bo(d.right,f.right),f.bottom=Bo(d.bottom,f.bottom),f.left=Mr(d.left,f.left),f},fp(t,s,r));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function Qg(t){var e=t.reference,n=t.element,r=t.placement,a=r?sn(r):null,i=r?wa(r):null,s=e.x+e.width/2-n.width/2,o=e.y+e.height/2-n.height/2,f;switch(a){case pt:f={x:s,y:e.y-n.height};break;case _t:f={x:s,y:e.y+e.height};break;case Jt:f={x:e.x+e.width,y:o};break;case mt:f={x:e.x-n.width,y:o};break;default:f={x:e.x,y:e.y}}var c=a?jd(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(i){case xa:f[c]=f[c]-(e[d]/2-n[d]/2);break;case ki:f[c]=f[c]+(e[d]/2-n[d]/2);break}}return f}function Si(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,o=n.boundary,f=o===void 0?TN:o,c=n.rootBoundary,d=c===void 0?Bg:c,u=n.elementContext,p=u===void 0?Ua:u,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,b=g===void 0?0:g,x=Vg(typeof b!="number"?b:Gg(b,qi)),v=p===Ua?IN:Ua,j=t.rects.popper,y=t.elements[m?v:p],L=lk(Tr(y)?y:y.contextElement||nr(t.elements.popper),f,d,s),C=va(t.elements.reference),N=Qg({reference:C,element:j,placement:a}),S=sc(Object.assign({},j,N)),T=p===Ua?S:C,z={top:L.top-T.top+x.top,bottom:T.bottom-L.bottom+x.bottom,left:L.left-T.left+x.left,right:T.right-L.right+x.right},P=t.modifiersData.offset;if(p===Ua&&P){var U=P[a];Object.keys(z).forEach(function(J){var Y=[Jt,_t].indexOf(J)>=0?1:-1,K=[pt,_t].indexOf(J)>=0?"y":"x";z[J]+=U[K]*Y})}return z}function fk(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,o=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Hg:f,d=wa(r),u=d?o?ip:ip.filter(function(m){return wa(m)===d}):qi,p=u.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=u);var h=p.reduce(function(m,g){return m[g]=Si(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[sn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function ck(t){if(sn(t)===vd)return[];var e=Rs(t);return[lp(t),e,lp(e)]}function dk(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,o=s===void 0?!0:s,f=n.fallbackPlacements,c=n.padding,d=n.boundary,u=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,b=e.options.placement,x=sn(b),v=x===b,j=f||(v||!m?[Rs(b)]:ck(b)),y=[b].concat(j).reduce(function(q,re){return q.concat(sn(re)===vd?fk(e,{placement:re,boundary:d,rootBoundary:u,padding:c,flipVariations:m,allowedAutoPlacements:g}):re)},[]),L=e.rects.reference,C=e.rects.popper,N=new Map,S=!0,T=y[0],z=0;z<y.length;z++){var P=y[z],U=sn(P),J=wa(P)===xa,Y=[pt,_t].indexOf(U)>=0,K=Y?"width":"height",E=Si(e,{placement:P,boundary:d,rootBoundary:u,altBoundary:p,padding:c}),G=Y?J?Jt:mt:J?_t:pt;L[K]>C[K]&&(G=Rs(G));var Z=Rs(G),le=[];if(i&&le.push(E[U]<=0),o&&le.push(E[G]<=0,E[Z]<=0),le.every(function(q){return q})){T=P,S=!1;break}N.set(P,le)}if(S)for(var we=m?3:1,Ie=function(re){var A=y.find(function(B){var ee=N.get(B);if(ee)return ee.slice(0,re).every(function(he){return he})});if(A)return T=A,"break"},Le=we;Le>0;Le--){var V=Ie(Le);if(V==="break")break}e.placement!==T&&(e.modifiersData[r]._skip=!0,e.placement=T,e.reset=!0)}}const uk={name:"flip",enabled:!0,phase:"main",fn:dk,requiresIfExists:["offset"],data:{_skip:!1}};function cp(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function dp(t){return[pt,Jt,_t,mt].some(function(e){return t[e]>=0})}function hk(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=Si(e,{elementContext:"reference"}),o=Si(e,{altBoundary:!0}),f=cp(s,r),c=cp(o,a,i),d=dp(f),u=dp(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const pk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hk};function mk(t,e,n){var r=sn(t),a=[mt,pt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],o=i[1];return s=s||0,o=(o||0)*a,[mt,Jt].indexOf(r)>=0?{x:o,y:s}:{x:s,y:o}}function gk(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=Hg.reduce(function(d,u){return d[u]=mk(u,e.rects,i),d},{}),o=s[e.placement],f=o.x,c=o.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const bk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gk};function xk(t){var e=t.state,n=t.name;e.modifiersData[n]=Qg({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const yk={name:"popperOffsets",enabled:!0,phase:"read",fn:xk,data:{}};function vk(t){return t==="x"?"y":"x"}function wk(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,o=s===void 0?!1:s,f=n.boundary,c=n.rootBoundary,d=n.altBoundary,u=n.padding,p=n.tether,h=p===void 0?!0:p,m=n.tetherOffset,g=m===void 0?0:m,b=Si(e,{boundary:f,rootBoundary:c,padding:u,altBoundary:d}),x=sn(e.placement),v=wa(e.placement),j=!v,y=jd(x),L=vk(y),C=e.modifiersData.popperOffsets,N=e.rects.reference,S=e.rects.popper,T=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,z=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(C){if(i){var J,Y=y==="y"?pt:mt,K=y==="y"?_t:Jt,E=y==="y"?"height":"width",G=C[y],Z=G+b[Y],le=G-b[K],we=h?-S[E]/2:0,Ie=v===xa?N[E]:S[E],Le=v===xa?-S[E]:-N[E],V=e.elements.arrow,q=h&&V?Md(V):{width:0,height:0},re=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Jg(),A=re[Y],B=re[K],ee=fi(0,N[E],q[E]),he=j?N[E]/2-we-ee-A-z.mainAxis:Ie-ee-A-z.mainAxis,Oe=j?-N[E]/2+we+ee+B+z.mainAxis:Le+ee+B+z.mainAxis,un=e.elements.arrow&&Ki(e.elements.arrow),dt=un?y==="y"?un.clientTop||0:un.clientLeft||0:0,Zt=(J=P==null?void 0:P[y])!=null?J:0,ir=G+he-Zt-dt,Vr=G+Oe-Zt,Da=fi(h?Bo(Z,ir):Z,G,h?Mr(le,Vr):le);C[y]=Da,U[y]=Da-G}if(o){var Ea,as=y==="x"?pt:mt,is=y==="x"?_t:Jt,hn=C[L],In=L==="y"?"height":"width",Aa=hn+b[as],sr=hn-b[is],za=[pt,mt].indexOf(x)!==-1,ss=(Ea=P==null?void 0:P[L])!=null?Ea:0,ls=za?Aa:hn-N[In]-S[In]-ss+z.altAxis,fs=za?hn+N[In]+S[In]-ss-z.altAxis:sr,cs=h&&za?GN(ls,hn,fs):fi(h?ls:Aa,hn,h?fs:sr);C[L]=cs,U[L]=cs-hn}e.modifiersData[r]=U}}const Mk={name:"preventOverflow",enabled:!0,phase:"main",fn:wk,requiresIfExists:["offset"]};function jk(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ck(t){return t===wt(t)||!Bt(t)?Cd(t):jk(t)}function Lk(t){var e=t.getBoundingClientRect(),n=ya(e.width)/t.offsetWidth||1,r=ya(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Nk(t,e,n){n===void 0&&(n=!1);var r=Bt(e),a=Bt(e)&&Lk(e),i=nr(e),s=va(t,a,n),o={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((cn(e)!=="body"||Nd(i))&&(o=Ck(e)),Bt(e)?(f=va(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):i&&(f.x=Ld(i))),{x:s.left+o.scrollLeft-f.x,y:s.top+o.scrollTop-f.y,width:s.width,height:s.height}}function kk(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(o){if(!n.has(o)){var f=e.get(o);f&&a(f)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Sk(t){var e=kk(t);return FN.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Tk(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Ik(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var up={placement:"bottom",modifiers:[],strategy:"absolute"};function hp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Dk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?up:a;return function(o,f,c){c===void 0&&(c=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},up,i),modifiersData:{},elements:{reference:o,popper:f},attributes:{},styles:{}},u=[],p=!1,h={state:d,setOptions:function(x){var v=typeof x=="function"?x(d.options):x;g(),d.options=Object.assign({},i,d.options,v),d.scrollParents={reference:Tr(o)?ci(o):o.contextElement?ci(o.contextElement):[],popper:ci(f)};var j=Sk(Ik([].concat(r,d.options.modifiers)));return d.orderedModifiers=j.filter(function(y){return y.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var x=d.elements,v=x.reference,j=x.popper;if(hp(v,j)){d.rects={reference:Nk(v,Ki(j),d.options.strategy==="fixed"),popper:Md(j)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(z){return d.modifiersData[z.name]=Object.assign({},z.data)});for(var y=0;y<d.orderedModifiers.length;y++){if(d.reset===!0){d.reset=!1,y=-1;continue}var L=d.orderedModifiers[y],C=L.fn,N=L.options,S=N===void 0?{}:N,T=L.name;typeof C=="function"&&(d=C({state:d,options:S,name:T,instance:h})||d)}}}},update:Tk(function(){return new Promise(function(b){h.forceUpdate(),b(d)})}),destroy:function(){g(),p=!0}};if(!hp(o,f))return h;h.setOptions(c).then(function(b){!p&&c.onFirstUpdate&&c.onFirstUpdate(b)});function m(){d.orderedModifiers.forEach(function(b){var x=b.name,v=b.options,j=v===void 0?{}:v,y=b.effect;if(typeof y=="function"){var L=y({state:d,name:x,instance:h,options:j}),C=function(){};u.push(L||C)}})}function g(){u.forEach(function(b){return b()}),u=[]}return h}}var Ek=[tk,yk,XN,Fg,bk,uk,Mk,$N,pk],Ak=Dk({defaultModifiers:Ek}),zk="tippy-box",Wg="tippy-content",Ok="tippy-backdrop",$g="tippy-arrow",Zg="tippy-svg-arrow",fr={passive:!0,capture:!0},qg=function(){return document.body};function Pk(t,e){return{}.hasOwnProperty.call(t,e)}function df(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function kd(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Kg(t,e){return typeof t=="function"?t.apply(void 0,e):t}function pp(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Rk(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Bk(t){return t.split(/\s+/).filter(Boolean)}function ta(t){return[].concat(t)}function mp(t,e){t.indexOf(e)===-1&&t.push(e)}function Hk(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Fk(t){return t.split("-")[0]}function Ho(t){return[].slice.call(t)}function gp(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function di(){return document.createElement("div")}function Ti(t){return["Element","Fragment"].some(function(e){return kd(t,e)})}function Uk(t){return kd(t,"NodeList")}function _k(t){return kd(t,"MouseEvent")}function Jk(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function Vk(t){return Ti(t)?[t]:Uk(t)?Ho(t):Array.isArray(t)?t:Ho(document.querySelectorAll(t))}function uf(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function bp(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Gk(t){var e,n=ta(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Yk(t,e){var n=e.clientX,r=e.clientY;return t.every(function(a){var i=a.popperRect,s=a.popperState,o=a.props,f=o.interactiveBorder,c=Fk(s.placement),d=s.modifiersData.offset;if(!d)return!0;var u=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,m=c==="left"?d.right.x:0,g=i.top-r+u>f,b=r-i.bottom-p>f,x=i.left-n+h>f,v=n-i.right-m>f;return g||b||x||v})}function hf(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){t[r](a,n)})}function xp(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var an={isTouch:!1},yp=0;function Qk(){an.isTouch||(an.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xg))}function Xg(){var t=performance.now();t-yp<20&&(an.isTouch=!1,document.removeEventListener("mousemove",Xg)),yp=t}function Wk(){var t=document.activeElement;if(Jk(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $k(){document.addEventListener("touchstart",Qk,fr),window.addEventListener("blur",Wk)}var Zk=typeof window<"u"&&typeof document<"u",qk=Zk?!!window.msCrypto:!1;function $r(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function vp(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function Kk(t){return vp(`
147
147
  %ctippy.js
148
148
 
149
149
  %c`+vp(t)+`
@@ -152,13 +152,13 @@ ${h.slice(c+2)}`,u+=1;else break}e.push({indent:c,number:parseInt(o,10),content:
152
152
  `)}function eb(t){return[Kk(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ii;process.env.NODE_ENV!=="production"&&Xk();function Xk(){Ii=new Set}function wn(t,e){if(t&&!Ii.has(e)){var n;Ii.add(e),(n=console).warn.apply(n,eb(e))}}function oc(t,e){if(t&&!Ii.has(e)){var n;Ii.add(e),(n=console).error.apply(n,eb(e))}}function eS(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;oc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),oc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var tb={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},tS={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},bt=Object.assign({appendTo:qg,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},tb,tS),nS=Object.keys(bt),rS=function(e){process.env.NODE_ENV!=="production"&&rb(e,[]);var n=Object.keys(e);n.forEach(function(r){bt[r]=e[r]})};function nb(t){var e=t.plugins||[],n=e.reduce(function(r,a){var i=a.name,s=a.defaultValue;if(i){var o;r[i]=t[i]!==void 0?t[i]:(o=bt[i])!=null?o:s}return r},{});return Object.assign({},t,n)}function aS(t,e){var n=e?Object.keys(nb(Object.assign({},bt,{plugins:e}))):nS,r=n.reduce(function(a,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return a;if(i==="content")a[i]=s;else try{a[i]=JSON.parse(s)}catch{a[i]=s}return a},{});return r}function wp(t,e){var n=Object.assign({},e,{content:Kg(e.content,[t])},e.ignoreAttributes?{}:aS(t,e.plugins));return n.aria=Object.assign({},bt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function rb(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var a=Rk(bt,Object.keys(tb)),i=!Pk(a,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),wn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
153
153
 
154
154
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
155
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var iS=function(){return"innerHTML"};function lc(t,e){t[iS()]=e}function Mp(t){var e=di();return t===!0?e.className=$g:(e.className=Zg,Ti(t)?e.appendChild(t):lc(e,t)),e}function jp(t,e){Ti(e.content)?(lc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?lc(t,e.content):t.textContent=e.content)}function fc(t){var e=t.firstElementChild,n=Ho(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Wg)}),arrow:n.find(function(r){return r.classList.contains($g)||r.classList.contains(Zg)}),backdrop:n.find(function(r){return r.classList.contains(Ok)})}}function ab(t){var e=di(),n=di();n.className=zk,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=di();r.className=Wg,r.setAttribute("data-state","hidden"),jp(r,t.props),e.appendChild(n),n.appendChild(r),a(t.props,t.props);function a(i,s){var o=fc(e),f=o.box,c=o.content,d=o.arrow;s.theme?f.setAttribute("data-theme",s.theme):f.removeAttribute("data-theme"),typeof s.animation=="string"?f.setAttribute("data-animation",s.animation):f.removeAttribute("data-animation"),s.inertia?f.setAttribute("data-inertia",""):f.removeAttribute("data-inertia"),f.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?f.setAttribute("role",s.role):f.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&jp(c,t.props),s.arrow?d?i.arrow!==s.arrow&&(f.removeChild(d),f.appendChild(Mp(s.arrow))):f.appendChild(Mp(s.arrow)):d&&f.removeChild(d)}return{popper:e,onUpdate:a}}ab.$$tippy=!0;var sS=1,ks=[],pf=[];function oS(t,e){var n=wp(t,Object.assign({},bt,nb(gp(e)))),r,a,i,s=!1,o=!1,f=!1,c=!1,d,u,p,h=[],m=pp(ir,n.interactiveDebounce),g,b=sS++,x=null,v=Hk(n.plugins),j={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:b,reference:t,popper:di(),popperInstance:x,props:n,state:j,plugins:v,clearDelayTimeouts:ls,setProps:fs,setContent:cs,show:V4,hide:G4,hideWithInteractivity:Y4,enable:za,disable:ss,unmount:Q4,destroy:W4};if(!n.render)return process.env.NODE_ENV!=="production"&&oc(!0,"render() function has not been supplied."),y;var L=n.render(y),C=L.popper,N=L.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+y.id,y.popper=C,t._tippy=y,C._tippy=y;var S=v.map(function(D){return D.fn(y)}),T=t.hasAttribute("aria-expanded");return un(),we(),Y(),Z("onCreate",[y]),n.showOnCreate&&Aa(),C.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&G().addEventListener("mousemove",m)}),y;function z(){var D=y.props.touch;return Array.isArray(D)?D:[D,0]}function P(){return z()[0]==="hold"}function U(){var D;return!!((D=y.props.render)!=null&&D.$$tippy)}function J(){return g||t}function G(){var D=J().parentNode;return D?Gk(D):document}function K(){return fc(C)}function E(D){return y.state.isMounted&&!y.state.isVisible||an.isTouch||d&&d.type==="focus"?0:df(y.props.delay,D?0:1,bt.delay)}function Y(D){D===void 0&&(D=!1),C.style.pointerEvents=y.props.interactive&&!D?"":"none",C.style.zIndex=""+y.props.zIndex}function Z(D,Q,X){if(X===void 0&&(X=!0),S.forEach(function(ce){ce[D]&&ce[D].apply(ce,Q)}),X){var de;(de=y.props)[D].apply(de,Q)}}function le(){var D=y.props.aria;if(D.content){var Q="aria-"+D.content,X=C.id,de=ta(y.props.triggerTarget||t);de.forEach(function(ce){var et=ce.getAttribute(Q);if(y.state.isVisible)ce.setAttribute(Q,et?et+" "+X:X);else{var Lt=et&&et.replace(X,"").trim();Lt?ce.setAttribute(Q,Lt):ce.removeAttribute(Q)}})}}function we(){if(!(T||!y.props.aria.expanded)){var D=ta(y.props.triggerTarget||t);D.forEach(function(Q){y.props.interactive?Q.setAttribute("aria-expanded",y.state.isVisible&&Q===J()?"true":"false"):Q.removeAttribute("aria-expanded")})}}function Ie(){G().removeEventListener("mousemove",m),ks=ks.filter(function(D){return D!==m})}function Le(D){if(!(an.isTouch&&(f||D.type==="mousedown"))){var Q=D.composedPath&&D.composedPath()[0]||D.target;if(!(y.props.interactive&&xp(C,Q))){if(ta(y.props.triggerTarget||t).some(function(X){return xp(X,Q)})){if(an.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else Z("onClickOutside",[y,D]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),o=!0,setTimeout(function(){o=!1}),y.state.isMounted||A())}}}function V(){f=!0}function q(){f=!1}function re(){var D=G();D.addEventListener("mousedown",Le,!0),D.addEventListener("touchend",Le,fr),D.addEventListener("touchstart",q,fr),D.addEventListener("touchmove",V,fr)}function A(){var D=G();D.removeEventListener("mousedown",Le,!0),D.removeEventListener("touchend",Le,fr),D.removeEventListener("touchstart",q,fr),D.removeEventListener("touchmove",V,fr)}function B(D,Q){he(D,function(){!y.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&Q()})}function ee(D,Q){he(D,Q)}function he(D,Q){var X=K().box;function de(ce){ce.target===X&&(hf(X,"remove",de),Q())}if(D===0)return Q();hf(X,"remove",u),hf(X,"add",de),u=de}function Oe(D,Q,X){X===void 0&&(X=!1);var de=ta(y.props.triggerTarget||t);de.forEach(function(ce){ce.addEventListener(D,Q,X),h.push({node:ce,eventType:D,handler:Q,options:X})})}function un(){P()&&(Oe("touchstart",Zt,{passive:!0}),Oe("touchend",Vr,{passive:!0})),Bk(y.props.trigger).forEach(function(D){if(D!=="manual")switch(Oe(D,Zt),D){case"mouseenter":Oe("mouseleave",Vr);break;case"focus":Oe(qk?"focusout":"blur",Da);break;case"focusin":Oe("focusout",Da);break}})}function dt(){h.forEach(function(D){var Q=D.node,X=D.eventType,de=D.handler,ce=D.options;Q.removeEventListener(X,de,ce)}),h=[]}function Zt(D){var Q,X=!1;if(!(!y.state.isEnabled||Ea(D)||o)){var de=((Q=d)==null?void 0:Q.type)==="focus";d=D,g=D.currentTarget,we(),!y.state.isVisible&&_k(D)&&ks.forEach(function(ce){return ce(D)}),D.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||s)&&y.props.hideOnClick!==!1&&y.state.isVisible?X=!0:Aa(D),D.type==="click"&&(s=!X),X&&!de&&sr(D)}}function ir(D){var Q=D.target,X=J().contains(Q)||C.contains(Q);if(!(D.type==="mousemove"&&X)){var de=In().concat(C).map(function(ce){var et,Lt=ce._tippy,Gr=(et=Lt.popperInstance)==null?void 0:et.state;return Gr?{popperRect:ce.getBoundingClientRect(),popperState:Gr,props:n}:null}).filter(Boolean);Yk(de,D)&&(Ie(),sr(D))}}function Vr(D){var Q=Ea(D)||y.props.trigger.indexOf("click")>=0&&s;if(!Q){if(y.props.interactive){y.hideWithInteractivity(D);return}sr(D)}}function Da(D){y.props.trigger.indexOf("focusin")<0&&D.target!==J()||y.props.interactive&&D.relatedTarget&&C.contains(D.relatedTarget)||sr(D)}function Ea(D){return an.isTouch?P()!==D.type.indexOf("touch")>=0:!1}function as(){is();var D=y.props,Q=D.popperOptions,X=D.placement,de=D.offset,ce=D.getReferenceClientRect,et=D.moveTransition,Lt=U()?fc(C).arrow:null,Gr=ce?{getBoundingClientRect:ce,contextElement:ce.contextElement||J()}:t,pu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ds){var Yr=ds.state;if(U()){var $4=K(),Ol=$4.box;["placement","reference-hidden","escaped"].forEach(function(us){us==="placement"?Ol.setAttribute("data-placement",Yr.placement):Yr.attributes.popper["data-popper-"+us]?Ol.setAttribute("data-"+us,""):Ol.removeAttribute("data-"+us)}),Yr.attributes.popper={}}}},or=[{name:"offset",options:{offset:de}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!et}},pu];U()&&Lt&&or.push({name:"arrow",options:{element:Lt,padding:3}}),or.push.apply(or,(Q==null?void 0:Q.modifiers)||[]),y.popperInstance=Ak(Gr,C,Object.assign({},Q,{placement:X,onFirstUpdate:p,modifiers:or}))}function is(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function hn(){var D=y.props.appendTo,Q,X=J();y.props.interactive&&D===qg||D==="parent"?Q=X.parentNode:Q=Kg(D,[X]),Q.contains(C)||Q.appendChild(C),y.state.isMounted=!0,as(),process.env.NODE_ENV!=="production"&&wn(y.props.interactive&&D===bt.appendTo&&X.nextElementSibling!==C,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
155
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var iS=function(){return"innerHTML"};function lc(t,e){t[iS()]=e}function Mp(t){var e=di();return t===!0?e.className=$g:(e.className=Zg,Ti(t)?e.appendChild(t):lc(e,t)),e}function jp(t,e){Ti(e.content)?(lc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?lc(t,e.content):t.textContent=e.content)}function fc(t){var e=t.firstElementChild,n=Ho(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Wg)}),arrow:n.find(function(r){return r.classList.contains($g)||r.classList.contains(Zg)}),backdrop:n.find(function(r){return r.classList.contains(Ok)})}}function ab(t){var e=di(),n=di();n.className=zk,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=di();r.className=Wg,r.setAttribute("data-state","hidden"),jp(r,t.props),e.appendChild(n),n.appendChild(r),a(t.props,t.props);function a(i,s){var o=fc(e),f=o.box,c=o.content,d=o.arrow;s.theme?f.setAttribute("data-theme",s.theme):f.removeAttribute("data-theme"),typeof s.animation=="string"?f.setAttribute("data-animation",s.animation):f.removeAttribute("data-animation"),s.inertia?f.setAttribute("data-inertia",""):f.removeAttribute("data-inertia"),f.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?f.setAttribute("role",s.role):f.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&jp(c,t.props),s.arrow?d?i.arrow!==s.arrow&&(f.removeChild(d),f.appendChild(Mp(s.arrow))):f.appendChild(Mp(s.arrow)):d&&f.removeChild(d)}return{popper:e,onUpdate:a}}ab.$$tippy=!0;var sS=1,ks=[],pf=[];function oS(t,e){var n=wp(t,Object.assign({},bt,nb(gp(e)))),r,a,i,s=!1,o=!1,f=!1,c=!1,d,u,p,h=[],m=pp(ir,n.interactiveDebounce),g,b=sS++,x=null,v=Hk(n.plugins),j={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:b,reference:t,popper:di(),popperInstance:x,props:n,state:j,plugins:v,clearDelayTimeouts:ls,setProps:fs,setContent:cs,show:V4,hide:G4,hideWithInteractivity:Y4,enable:za,disable:ss,unmount:Q4,destroy:W4};if(!n.render)return process.env.NODE_ENV!=="production"&&oc(!0,"render() function has not been supplied."),y;var L=n.render(y),C=L.popper,N=L.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+y.id,y.popper=C,t._tippy=y,C._tippy=y;var S=v.map(function(D){return D.fn(y)}),T=t.hasAttribute("aria-expanded");return un(),we(),G(),Z("onCreate",[y]),n.showOnCreate&&Aa(),C.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&Y().addEventListener("mousemove",m)}),y;function z(){var D=y.props.touch;return Array.isArray(D)?D:[D,0]}function P(){return z()[0]==="hold"}function U(){var D;return!!((D=y.props.render)!=null&&D.$$tippy)}function J(){return g||t}function Y(){var D=J().parentNode;return D?Gk(D):document}function K(){return fc(C)}function E(D){return y.state.isMounted&&!y.state.isVisible||an.isTouch||d&&d.type==="focus"?0:df(y.props.delay,D?0:1,bt.delay)}function G(D){D===void 0&&(D=!1),C.style.pointerEvents=y.props.interactive&&!D?"":"none",C.style.zIndex=""+y.props.zIndex}function Z(D,Q,X){if(X===void 0&&(X=!0),S.forEach(function(ce){ce[D]&&ce[D].apply(ce,Q)}),X){var de;(de=y.props)[D].apply(de,Q)}}function le(){var D=y.props.aria;if(D.content){var Q="aria-"+D.content,X=C.id,de=ta(y.props.triggerTarget||t);de.forEach(function(ce){var et=ce.getAttribute(Q);if(y.state.isVisible)ce.setAttribute(Q,et?et+" "+X:X);else{var Lt=et&&et.replace(X,"").trim();Lt?ce.setAttribute(Q,Lt):ce.removeAttribute(Q)}})}}function we(){if(!(T||!y.props.aria.expanded)){var D=ta(y.props.triggerTarget||t);D.forEach(function(Q){y.props.interactive?Q.setAttribute("aria-expanded",y.state.isVisible&&Q===J()?"true":"false"):Q.removeAttribute("aria-expanded")})}}function Ie(){Y().removeEventListener("mousemove",m),ks=ks.filter(function(D){return D!==m})}function Le(D){if(!(an.isTouch&&(f||D.type==="mousedown"))){var Q=D.composedPath&&D.composedPath()[0]||D.target;if(!(y.props.interactive&&xp(C,Q))){if(ta(y.props.triggerTarget||t).some(function(X){return xp(X,Q)})){if(an.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else Z("onClickOutside",[y,D]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),o=!0,setTimeout(function(){o=!1}),y.state.isMounted||A())}}}function V(){f=!0}function q(){f=!1}function re(){var D=Y();D.addEventListener("mousedown",Le,!0),D.addEventListener("touchend",Le,fr),D.addEventListener("touchstart",q,fr),D.addEventListener("touchmove",V,fr)}function A(){var D=Y();D.removeEventListener("mousedown",Le,!0),D.removeEventListener("touchend",Le,fr),D.removeEventListener("touchstart",q,fr),D.removeEventListener("touchmove",V,fr)}function B(D,Q){he(D,function(){!y.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&Q()})}function ee(D,Q){he(D,Q)}function he(D,Q){var X=K().box;function de(ce){ce.target===X&&(hf(X,"remove",de),Q())}if(D===0)return Q();hf(X,"remove",u),hf(X,"add",de),u=de}function Oe(D,Q,X){X===void 0&&(X=!1);var de=ta(y.props.triggerTarget||t);de.forEach(function(ce){ce.addEventListener(D,Q,X),h.push({node:ce,eventType:D,handler:Q,options:X})})}function un(){P()&&(Oe("touchstart",Zt,{passive:!0}),Oe("touchend",Vr,{passive:!0})),Bk(y.props.trigger).forEach(function(D){if(D!=="manual")switch(Oe(D,Zt),D){case"mouseenter":Oe("mouseleave",Vr);break;case"focus":Oe(qk?"focusout":"blur",Da);break;case"focusin":Oe("focusout",Da);break}})}function dt(){h.forEach(function(D){var Q=D.node,X=D.eventType,de=D.handler,ce=D.options;Q.removeEventListener(X,de,ce)}),h=[]}function Zt(D){var Q,X=!1;if(!(!y.state.isEnabled||Ea(D)||o)){var de=((Q=d)==null?void 0:Q.type)==="focus";d=D,g=D.currentTarget,we(),!y.state.isVisible&&_k(D)&&ks.forEach(function(ce){return ce(D)}),D.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||s)&&y.props.hideOnClick!==!1&&y.state.isVisible?X=!0:Aa(D),D.type==="click"&&(s=!X),X&&!de&&sr(D)}}function ir(D){var Q=D.target,X=J().contains(Q)||C.contains(Q);if(!(D.type==="mousemove"&&X)){var de=In().concat(C).map(function(ce){var et,Lt=ce._tippy,Gr=(et=Lt.popperInstance)==null?void 0:et.state;return Gr?{popperRect:ce.getBoundingClientRect(),popperState:Gr,props:n}:null}).filter(Boolean);Yk(de,D)&&(Ie(),sr(D))}}function Vr(D){var Q=Ea(D)||y.props.trigger.indexOf("click")>=0&&s;if(!Q){if(y.props.interactive){y.hideWithInteractivity(D);return}sr(D)}}function Da(D){y.props.trigger.indexOf("focusin")<0&&D.target!==J()||y.props.interactive&&D.relatedTarget&&C.contains(D.relatedTarget)||sr(D)}function Ea(D){return an.isTouch?P()!==D.type.indexOf("touch")>=0:!1}function as(){is();var D=y.props,Q=D.popperOptions,X=D.placement,de=D.offset,ce=D.getReferenceClientRect,et=D.moveTransition,Lt=U()?fc(C).arrow:null,Gr=ce?{getBoundingClientRect:ce,contextElement:ce.contextElement||J()}:t,pu={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ds){var Yr=ds.state;if(U()){var $4=K(),Ol=$4.box;["placement","reference-hidden","escaped"].forEach(function(us){us==="placement"?Ol.setAttribute("data-placement",Yr.placement):Yr.attributes.popper["data-popper-"+us]?Ol.setAttribute("data-"+us,""):Ol.removeAttribute("data-"+us)}),Yr.attributes.popper={}}}},or=[{name:"offset",options:{offset:de}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!et}},pu];U()&&Lt&&or.push({name:"arrow",options:{element:Lt,padding:3}}),or.push.apply(or,(Q==null?void 0:Q.modifiers)||[]),y.popperInstance=Ak(Gr,C,Object.assign({},Q,{placement:X,onFirstUpdate:p,modifiers:or}))}function is(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function hn(){var D=y.props.appendTo,Q,X=J();y.props.interactive&&D===qg||D==="parent"?Q=X.parentNode:Q=Kg(D,[X]),Q.contains(C)||Q.appendChild(C),y.state.isMounted=!0,as(),process.env.NODE_ENV!=="production"&&wn(y.props.interactive&&D===bt.appendTo&&X.nextElementSibling!==C,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
156
156
 
157
157
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
158
158
 
159
159
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
160
160
 
161
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function In(){return Ho(C.querySelectorAll("[data-tippy-root]"))}function Aa(D){y.clearDelayTimeouts(),D&&Z("onTrigger",[y,D]),re();var Q=E(!0),X=z(),de=X[0],ce=X[1];an.isTouch&&de==="hold"&&ce&&(Q=ce),Q?r=setTimeout(function(){y.show()},Q):y.show()}function sr(D){if(y.clearDelayTimeouts(),Z("onUntrigger",[y,D]),!y.state.isVisible){A();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(D.type)>=0&&s)){var Q=E(!1);Q?a=setTimeout(function(){y.state.isVisible&&y.hide()},Q):i=requestAnimationFrame(function(){y.hide()})}}function za(){y.state.isEnabled=!0}function ss(){y.hide(),y.state.isEnabled=!1}function ls(){clearTimeout(r),clearTimeout(a),cancelAnimationFrame(i)}function fs(D){if(process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("setProps")),!y.state.isDestroyed){Z("onBeforeUpdate",[y,D]),dt();var Q=y.props,X=wp(t,Object.assign({},Q,gp(D),{ignoreAttributes:!0}));y.props=X,un(),Q.interactiveDebounce!==X.interactiveDebounce&&(Ie(),m=pp(ir,X.interactiveDebounce)),Q.triggerTarget&&!X.triggerTarget?ta(Q.triggerTarget).forEach(function(de){de.removeAttribute("aria-expanded")}):X.triggerTarget&&t.removeAttribute("aria-expanded"),we(),Y(),N&&N(Q,X),y.popperInstance&&(as(),In().forEach(function(de){requestAnimationFrame(de._tippy.popperInstance.forceUpdate)})),Z("onAfterUpdate",[y,D])}}function cs(D){y.setProps({content:D})}function V4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("show"));var D=y.state.isVisible,Q=y.state.isDestroyed,X=!y.state.isEnabled,de=an.isTouch&&!y.props.touch,ce=df(y.props.duration,0,bt.duration);if(!(D||Q||X||de)&&!J().hasAttribute("disabled")&&(Z("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,U()&&(C.style.visibility="visible"),Y(),re(),y.state.isMounted||(C.style.transition="none"),U()){var et=K(),Lt=et.box,Gr=et.content;uf([Lt,Gr],0)}p=function(){var or;if(!(!y.state.isVisible||c)){if(c=!0,C.offsetHeight,C.style.transition=y.props.moveTransition,U()&&y.props.animation){var zl=K(),ds=zl.box,Yr=zl.content;uf([ds,Yr],ce),bp([ds,Yr],"visible")}le(),we(),mp(pf,y),(or=y.popperInstance)==null||or.forceUpdate(),Z("onMount",[y]),y.props.animation&&U()&&ee(ce,function(){y.state.isShown=!0,Z("onShown",[y])})}},hn()}}function G4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("hide"));var D=!y.state.isVisible,Q=y.state.isDestroyed,X=!y.state.isEnabled,de=df(y.props.duration,1,bt.duration);if(!(D||Q||X)&&(Z("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,s=!1,U()&&(C.style.visibility="hidden"),Ie(),A(),Y(!0),U()){var ce=K(),et=ce.box,Lt=ce.content;y.props.animation&&(uf([et,Lt],de),bp([et,Lt],"hidden"))}le(),we(),y.props.animation?U()&&B(de,y.unmount):y.unmount()}}function Y4(D){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("hideWithInteractivity")),G().addEventListener("mousemove",m),mp(ks,m),m(D)}function Q4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(is(),In().forEach(function(D){D._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),pf=pf.filter(function(D){return D!==y}),y.state.isMounted=!1,Z("onHidden",[y]))}function W4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),dt(),delete t._tippy,y.state.isDestroyed=!0,Z("onDestroy",[y]))}}function Xi(t,e){e===void 0&&(e={});var n=bt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(eS(t),rb(e,n)),$k();var r=Object.assign({},e,{plugins:n}),a=Vk(t);if(process.env.NODE_ENV!=="production"){var i=Ti(r.content),s=a.length>1;wn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
161
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function In(){return Ho(C.querySelectorAll("[data-tippy-root]"))}function Aa(D){y.clearDelayTimeouts(),D&&Z("onTrigger",[y,D]),re();var Q=E(!0),X=z(),de=X[0],ce=X[1];an.isTouch&&de==="hold"&&ce&&(Q=ce),Q?r=setTimeout(function(){y.show()},Q):y.show()}function sr(D){if(y.clearDelayTimeouts(),Z("onUntrigger",[y,D]),!y.state.isVisible){A();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(D.type)>=0&&s)){var Q=E(!1);Q?a=setTimeout(function(){y.state.isVisible&&y.hide()},Q):i=requestAnimationFrame(function(){y.hide()})}}function za(){y.state.isEnabled=!0}function ss(){y.hide(),y.state.isEnabled=!1}function ls(){clearTimeout(r),clearTimeout(a),cancelAnimationFrame(i)}function fs(D){if(process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("setProps")),!y.state.isDestroyed){Z("onBeforeUpdate",[y,D]),dt();var Q=y.props,X=wp(t,Object.assign({},Q,gp(D),{ignoreAttributes:!0}));y.props=X,un(),Q.interactiveDebounce!==X.interactiveDebounce&&(Ie(),m=pp(ir,X.interactiveDebounce)),Q.triggerTarget&&!X.triggerTarget?ta(Q.triggerTarget).forEach(function(de){de.removeAttribute("aria-expanded")}):X.triggerTarget&&t.removeAttribute("aria-expanded"),we(),G(),N&&N(Q,X),y.popperInstance&&(as(),In().forEach(function(de){requestAnimationFrame(de._tippy.popperInstance.forceUpdate)})),Z("onAfterUpdate",[y,D])}}function cs(D){y.setProps({content:D})}function V4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("show"));var D=y.state.isVisible,Q=y.state.isDestroyed,X=!y.state.isEnabled,de=an.isTouch&&!y.props.touch,ce=df(y.props.duration,0,bt.duration);if(!(D||Q||X||de)&&!J().hasAttribute("disabled")&&(Z("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,U()&&(C.style.visibility="visible"),G(),re(),y.state.isMounted||(C.style.transition="none"),U()){var et=K(),Lt=et.box,Gr=et.content;uf([Lt,Gr],0)}p=function(){var or;if(!(!y.state.isVisible||c)){if(c=!0,C.offsetHeight,C.style.transition=y.props.moveTransition,U()&&y.props.animation){var zl=K(),ds=zl.box,Yr=zl.content;uf([ds,Yr],ce),bp([ds,Yr],"visible")}le(),we(),mp(pf,y),(or=y.popperInstance)==null||or.forceUpdate(),Z("onMount",[y]),y.props.animation&&U()&&ee(ce,function(){y.state.isShown=!0,Z("onShown",[y])})}},hn()}}function G4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("hide"));var D=!y.state.isVisible,Q=y.state.isDestroyed,X=!y.state.isEnabled,de=df(y.props.duration,1,bt.duration);if(!(D||Q||X)&&(Z("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,s=!1,U()&&(C.style.visibility="hidden"),Ie(),A(),G(!0),U()){var ce=K(),et=ce.box,Lt=ce.content;y.props.animation&&(uf([et,Lt],de),bp([et,Lt],"hidden"))}le(),we(),y.props.animation?U()&&B(de,y.unmount):y.unmount()}}function Y4(D){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("hideWithInteractivity")),Y().addEventListener("mousemove",m),mp(ks,m),m(D)}function Q4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(is(),In().forEach(function(D){D._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),pf=pf.filter(function(D){return D!==y}),y.state.isMounted=!1,Z("onHidden",[y]))}function W4(){process.env.NODE_ENV!=="production"&&wn(y.state.isDestroyed,$r("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),dt(),delete t._tippy,y.state.isDestroyed=!0,Z("onDestroy",[y]))}}function Xi(t,e){e===void 0&&(e={});var n=bt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(eS(t),rb(e,n)),$k();var r=Object.assign({},e,{plugins:n}),a=Vk(t);if(process.env.NODE_ENV!=="production"){var i=Ti(r.content),s=a.length>1;wn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
162
162
 
163
163
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
164
164
 
@@ -218,7 +218,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
218
218
  </div>
219
219
  </body>
220
220
  </html>
221
- `),p.document.close(),p.onload=()=>{setTimeout(()=>{p.print(),p.close(),a==null||a()},250)}}catch(u){i==null||i(u),console.error("Erro ao imprimir contrato:",u)}},downloadPDF:()=>{try{s==null||s(),setTimeout(()=>{console.log("PDF gerado (simulado):",{contractNumber:e,timestamp:new Date().toISOString()}),o==null||o()},1500),console.info("usePrintContract: downloadPDF é uma implementação simulada. Para gerar PDFs reais, integre com html2pdf.js ou jsPDF. Veja a documentação do hook para exemplos.")}catch(u){f==null||f(u),console.error("Erro ao gerar PDF:",u)}}}}function QI({data:t,logo:e,showActions:n=!0,showSummary:r=!0,showServices:a=!0,showInfo:i=!1,className:s,onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}){const h=I.useRef(null),{printContract:m,downloadPDF:g}=j2(h,t.numeroContrato,{onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}),b=x=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(x);return l.jsxs("div",{className:w("space-y-6",s),children:[n&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center justify-between",children:[l.jsx("span",{children:"Ações do Documento"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:g,className:"gap-2",children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Download PDF"]}),l.jsxs(F,{variant:"default",size:"sm",onClick:m,className:"gap-2",children:[l.jsx(k.Printer,{className:"h-4 w-4"}),"Imprimir"]})]})]})}),r&&l.jsx(ca,{children:l.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Nº do Contrato"}),l.jsx("p",{className:"font-semibold",children:t.numeroContrato})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Cliente"}),l.jsx("p",{className:"font-semibold",children:t.cliente.nome})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Valor do Fee"}),l.jsx("p",{className:"font-semibold",children:b(t.valorFee)})]})]})})]}),l.jsx("div",{className:"bg-white rounded-lg shadow-sm p-8",children:l.jsx("div",{ref:h,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:a})})}),i&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center gap-2",children:[l.jsx(k.Eye,{className:"h-5 w-5"}),"Sobre este Template"]})}),l.jsx(ca,{children:l.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Design System:"})," Utiliza a paleta de cores e tipografia do iClips"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Impressão Otimizada:"})," Layout preparado para impressão em A4"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Componentes Reutilizáveis:"})," PrintHeader, PrintFooter, PrintTable, PrintSignature"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Quebras de Página:"})," Configuradas automaticamente para evitar cortes"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Profissional:"})," Layout clean e adequado para documentos legais"]})]})})]})]})}const C2=I.forwardRef(({data:t,logo:e,showServices:n=!0,className:r},a)=>l.jsx("div",{className:w("bg-white rounded-lg shadow-sm p-8",r),ref:a,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:n})}));C2.displayName="ContractPrintPreview";const Go=I.forwardRef(({className:t,inputClassName:e,containerClassName:n,style:r,value:a,defaultValue:i=0,onChange:s,min:o=Number.MIN_SAFE_INTEGER,max:f=Number.MAX_SAFE_INTEGER,step:c=1,precision:d=0,formatOptions:u,locale:p="pt-BR",allowMouseWheel:h=!1,clampValueOnBlur:m=!0,keepWithinRange:g=!0,showButtons:b=!0,buttonLayout:x="vertical",buttonPosition:v="right",disabled:j,readOnly:y,...L},C)=>{const[N,S]=I.useState(i),[T,z]=I.useState(""),[P,U]=I.useState(!1),J=I.useRef(null),G=a!==void 0?a:N,K=I.useCallback(B=>u?new Intl.NumberFormat(p,u).format(B):B.toFixed(d),[u,p,d]),E=B=>{const he=B.replace(/[^\d,.-]/g,"").replace(",","."),Oe=parseFloat(he);return isNaN(Oe)?0:Oe},Y=B=>g?Math.min(Math.max(B,o),f):B,Z=I.useCallback((B,ee=!1)=>{const he=ee?Y(B):B;a===void 0&&S(he),s&&s(he)},[a,s,o,f,g]);I.useEffect(()=>{P||z(K(G))},[G,K,P]);const le=()=>{if(j||y)return;const B=G+c;B<=f&&Z(B)},we=()=>{if(j||y)return;const B=G-c;B>=o&&Z(B)},Ie=B=>{const he=B.target.value.replace(/[^\d,.-]/g,"");z(he);const Oe=E(he);Z(Oe,!1)},Le=B=>{if(U(!1),m){const ee=Y(G);Z(ee,!1),z(K(ee))}else z(K(G));L.onBlur&&L.onBlur(B)},V=B=>{U(!0),z(G.toString()),B.target.select(),L.onFocus&&L.onFocus(B)},q=B=>{j||y||(B.key==="ArrowUp"?(B.preventDefault(),le()):B.key==="ArrowDown"&&(B.preventDefault(),we()),L.onKeyDown&&L.onKeyDown(B))},re=B=>{!h||j||y||!P||(B.preventDefault(),B.deltaY<0?le():B.deltaY>0&&we())};I.useImperativeHandle(C,()=>J.current);const A=()=>{if(!b)return null;const B=l.jsx("button",{type:"button",onClick:le,disabled:j||y||G>=f,tabIndex:-1,"aria-label":"Increment",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-l-md border-r border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronUp,{className:"h-3 w-3"}):l.jsx(k.Plus,{className:"h-4 w-4"})},"inc"),ee=l.jsx("button",{type:"button",onClick:we,disabled:j||y||G<=o,tabIndex:-1,"aria-label":"Decrement",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-r-md border-l border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronDown,{className:"h-3 w-3"}):l.jsx(k.Minus,{className:"h-4 w-4"})},"dec");if(x==="vertical")return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-[2px] self-stretch px-1 shrink-0 overflow-hidden",v==="right"?"order-2 border-l border-input rounded-r-md":"order-[-1] border-r border-input rounded-l-md"),children:[B,ee]});if(x==="horizontal")return[ee,B]};return x==="horizontal"&&b?l.jsxs("div",{className:w("inline-flex items-center w-full",n),style:r,children:[A(),l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border-y px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","text-center tabular-nums",t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":G,role:"spinbutton",...L})]}):l.jsxs("div",{className:w("inline-flex w-full items-stretch",n),style:r,children:[l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","tabular-nums",b&&x==="vertical"&&v==="right"&&"text-right rounded-r-none border-r-0",b&&x==="vertical"&&v==="left"&&"text-left rounded-l-none border-l-0",!b&&"text-right",e,t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":G,role:"spinbutton",...L}),A()]})});Go.displayName="NumberInput";function ru({className:t,...e}){return l.jsx("textarea",{"data-slot":"textarea",className:w("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function L2({className:t,...e}){return l.jsx("div",{"data-slot":"input-group",role:"group",className:w("group/input-group cn-input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...e})}const WI=$t.cva("cn-input-group-addon flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"cn-input-group-addon-align-inline-start order-first","inline-end":"cn-input-group-addon-align-inline-end order-last","block-start":"cn-input-group-addon-align-block-start order-first w-full justify-start","block-end":"cn-input-group-addon-align-block-end order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function bc({className:t,align:e="inline-start",...n}){return l.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:w(WI({align:e}),t),onClick:r=>{var a,i;r.target.closest("button")||(i=(a=r.currentTarget.parentElement)==null?void 0:a.querySelector("input"))==null||i.focus()},...n})}const $I=$t.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{default:"h-7",sm:"h-6",xs:"h-5","icon-xs":"size-5"}},defaultVariants:{size:"default"}});function ZI({className:t,size:e,variant:n="ghost",type:r="button",...a}){return l.jsx(F,{"data-slot":"input-group-button",type:r,variant:n,className:w($I({size:e}),t),...a})}function qI({className:t,...e}){return l.jsx("span",{"data-slot":"input-group-text",className:w("text-muted-foreground text-sm",t),...e})}function KI({className:t,...e}){return l.jsx(Ht,{"data-slot":"input-group-control",className:w("cn-input-group-input flex-1",t),...e})}function XI({className:t,...e}){return l.jsx(ru,{"data-slot":"input-group-control",className:w("cn-input-group-textarea flex-1 resize-none",t),...e})}const eD={BRL:{symbol:"R$",icon:k.Coins,locale:"pt-BR"},USD:{symbol:"$",icon:k.DollarSign,locale:"en-US"},EUR:{symbol:"€",icon:k.Euro,locale:"de-DE"}},N2=I.forwardRef(({className:t,currency:e="BRL",locale:n,showSymbol:r=!1,symbolPosition:a="start",min:i=0,...s},o)=>{const f=eD[e],c=n||f.locale,d=f.icon;return r?l.jsxs(L2,{className:t,children:[a==="start"&&l.jsx(bc,{children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx(Go,{ref:o,className:w("border-none shadow-none ring-0 focus-visible:ring-0 focus-visible:border-transparent",a==="start"?"pl-2":"pr-2"),min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s}),a==="end"&&l.jsx(bc,{align:"inline-end",children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})})]}):l.jsx(Go,{ref:o,className:t,min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s})});N2.displayName="CurrencyInput";const tD=()=>{const t=new Date;return t.setHours(0,0,0,0),[{label:"Hoje",value:{from:t,to:t}},{label:"Últimos 7 dias",value:{from:H.subDays(t,6),to:t}},{label:"Últimos 30 dias",value:{from:H.subDays(t,29),to:t}},{label:"Este mês",value:{from:H.startOfMonth(t),to:t}},{label:"Mês passado",value:{from:H.startOfMonth(H.subMonths(t,1)),to:H.endOfMonth(H.subMonths(t,1))}}]};function k2({value:t,onChange:e,placeholder:n="Selecione um período",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s="dd/MM/yyyy",locale:o=yt,className:f,error:c=!1,numberOfMonths:d=2,showTime:u=!1,timeFormat:p="24h",minuteStep:h=15,presets:m,showDefaultPresets:g=!0,id:b,name:x}){const[v,j]=I.useState(!1),[y,L]=I.useState(""),[C,N]=I.useState(!1),S=u?`${s} HH:mm`:s,T=I.useMemo(()=>u?["dd/MM/yyyy HH:mm","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy"],[u]);I.useEffect(()=>{if(t!=null&&t.from){const V=H.format(t.from,S,{locale:o}),q=t.to?H.format(t.to,S,{locale:o}):"";L(q?`${V} → ${q}`:V),N(!1)}else L(""),N(!1)},[t,S,o]);const z=I.useMemo(()=>[...g?tD():[],...m||[]],[m,g]),P=I.useMemo(()=>{if(!(t!=null&&t.from))return"00:00";const V=t.from.getHours().toString().padStart(2,"0"),q=t.from.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.from]),U=I.useMemo(()=>{if(!(t!=null&&t.to))return"23:59";const V=t.to.getHours().toString().padStart(2,"0"),q=t.to.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.to]),J=V=>{if(!V){e==null||e(void 0);return}if(u){if(V.from){const[q,re]=P.split(":").map(Number);V.from.setHours(q,re,0,0)}if(V.to){const[q,re]=U.split(":").map(Number);V.to.setHours(q,re,0,0)}}else V.from&&V.from.setHours(0,0,0,0),V.to&&V.to.setHours(23,59,59,999);e==null||e(V)},G=V=>{if(!(t!=null&&t.from))return;const q=new Date(t.from),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,from:q})},K=V=>{if(!(t!=null&&t.to))return;const q=new Date(t.to),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,to:q})},E=V=>{const q={from:new Date(V.value.from),to:new Date(V.value.to)};if(u){const[re,A]=P.split(":").map(Number),[B,ee]=U.split(":").map(Number);q.from.setHours(re,A,0,0),q.to.setHours(B,ee,0,0)}e==null||e(q)},Y=V=>{const q=V.trim();if(!q)return null;for(const re of T)try{const A=H.parse(q,re,new Date);if(H.isValid(A)){if(a&&A<a||i&&A>i)continue;return A}}catch{continue}return null},Z=V=>{const q=V.trim();if(!q)return null;const re=["→","-","até","a"];let A=null,B=null;for(const ee of re)if(q.includes(ee)){const he=q.split(ee).map(Oe=>Oe.trim());if(he.length===2&&(A=Y(he[0]),B=Y(he[1]),A&&B))break}return A||(A=Y(q),A&&(B=new Date(A))),!A||!B?null:(A>B&&([A,B]=[B,A]),{from:A,to:B})},le=V=>{const q=V.target.value;L(q),N(!1)},we=()=>{if(!y.trim()){e==null||e(void 0),N(!1);return}const V=Z(y);V?(e==null||e(V),N(!1)):N(!0)},Ie=V=>{if(V.key==="Enter")V.preventDefault(),we(),C||j(!0);else if(V.key==="Escape"){if(V.preventDefault(),t!=null&&t.from){const q=H.format(t.from,S,{locale:o}),re=t.to?H.format(t.to,S,{locale:o}):"";L(re?`${q} → ${re}`:q)}else L("");N(!1)}},Le=V=>{V.stopPropagation(),e==null||e(void 0),L(""),N(!1)};return l.jsxs(st,{open:v,onOpenChange:j,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:b,name:x,value:y,onChange:le,onBlur:we,onKeyDown:Ie,placeholder:n,disabled:r,"aria-invalid":c||C,className:w("pr-20",(c||C)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[y&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:Le,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>j(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsxs("div",{className:"flex",children:[z.length>0&&l.jsxs("div",{className:"border-r p-3 space-y-1 min-w-[140px]",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Atalhos"}),z.map(V=>l.jsx(F,{variant:"ghost",size:"sm",className:"w-full justify-start text-sm h-8",onClick:()=>E(V),children:V.label},V.label))]}),l.jsxs("div",{children:[l.jsx(Qo,{mode:"range",selected:t,onSelect:J,numberOfMonths:d,disabled:V=>!!(a&&V<a||i&&V>i),locale:o,autoFocus:!0}),u&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&l.jsxs("div",{className:"border-t p-3 flex gap-6",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora início"}),l.jsx(mi,{value:P,onChange:G,format:p,minuteStep:h,variant:"select",showIcon:!1})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora fim"}),l.jsx(mi,{value:U,onChange:K,format:p,minuteStep:h,variant:"select",showIcon:!1})]})]}),l.jsxs("div",{className:"border-t p-3 flex justify-end gap-2",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>{e==null||e(void 0)},children:"Limpar"}),l.jsx(F,{size:"sm",onClick:()=>j(!1),children:"Confirmar"})]})]})]})})]})}k2.displayName="DateRangePicker";var nD=bN,rD=Se.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),aD=rD;const au=$t.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function S2({className:t,variant:e,size:n,...r}){return l.jsx(Ax.Root,{"data-slot":"toggle",className:w(au({variant:e,size:n,className:t})),...r})}const tt=({onClick:t,isActive:e=!1,disabled:n=!1,children:r,title:a})=>l.jsx(S2,{pressed:e,onPressedChange:t,disabled:n,size:"sm",className:"h-8 w-8 p-0",title:a,children:r}),iD=({editor:t,variant:e})=>{if(!t)return null;const n=()=>{const a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},r=()=>{const a=window.prompt("URL da imagem");a&&t.chain().focus().setImage({src:a}).run()};return l.jsxs("div",{className:w("flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30 sticky top-0 z-10",e==="full"?"px-4 py-2":"px-2 py-1"),children:[l.jsxs("div",{className:"flex items-center gap-0.5 mr-2",children:[l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),children:l.jsx(k.Undo,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),children:l.jsx(k.Redo,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Título 1",children:l.jsx(k.Heading1,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Título 2",children:l.jsx(k.Heading2,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Título 3",children:l.jsx(k.Heading3,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"})]}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Negrito",children:l.jsx(k.Bold,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Itálico",children:l.jsx(k.Italic,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Sublinhado",children:l.jsx(k.Underline,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Tachado",children:l.jsx(k.Strikethrough,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Lista com marcadores",children:l.jsx(k.List,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Lista numerada",children:l.jsx(k.ListOrdered,{className:"h-4 w-4"})}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Alinhar à esquerda",children:l.jsx(k.AlignLeft,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Centralizar",children:l.jsx(k.AlignCenter,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Alinhar à direita",children:l.jsx(k.AlignRight,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Citação",children:l.jsx(k.Quote,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:n,isActive:t.isActive("link"),title:"Link",children:l.jsx(k.Link,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:r,title:"Imagem",children:l.jsx(k.Image,{className:"h-4 w-4"})})]})};function sD({content:t="",onChange:e,placeholder:n="Comece a escrever...",variant:r="simple",className:a,readOnly:i=!1,label:s}){var c,d;const o=I.useMemo(()=>[Og.configure({heading:{levels:[1,2,3]}}),Pg.configure({HTMLAttributes:{class:"rounded-lg border shadow-sm max-w-full"}}),nD.configure({placeholder:n}),aD.configure({types:["heading","paragraph"]})],[n]),f=ig({extensions:o,content:t,editable:!i,onUpdate:({editor:u})=>{e==null||e(u.getHTML())},editorProps:{attributes:{class:w("prose prose-stone dark:prose-invert max-w-none focus:outline-none","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl","prose-p:leading-7 prose-p:my-3","prose-blockquote:border-l-4 prose-blockquote:border-primary/50 prose-blockquote:pl-4 prose-blockquote:italic","prose-ul:list-disc prose-ul:pl-6 prose-ol:list-decimal prose-ol:pl-6","prose-img:rounded-lg prose-img:shadow-md prose-img:my-6",r==="full"?"min-h-[400px] p-8":"min-h-[120px] px-3 py-2")}}});return f?l.jsxs("div",{className:w("flex flex-col w-full",a),children:[s&&l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:s}),l.jsxs("div",{className:w("border rounded-lg bg-background overflow-hidden transition-shadow focus-within:ring-2 focus-within:ring-primary/20",i&&"opacity-80 bg-muted/30 pointer-events-none border-transparent"),children:[!i&&l.jsx(iD,{editor:f,variant:r}),l.jsx("div",{className:w("bg-background relative",r==="full"?"bg-white dark:bg-zinc-950":""),children:l.jsx(od,{editor:f})})]}),!i&&r==="full"&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-1.5 text-right px-1",children:[((d=(c=f.storage.characterCount)==null?void 0:c.words)==null?void 0:d.call(c))||0," palavras"]})]}):null}function oD({...t}){return l.jsx(Kn.Drawer.Root,{"data-slot":"drawer",...t})}const T2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Trigger,{ref:e,"data-slot":"drawer-trigger",...t}));T2.displayName="DrawerTrigger";function lD({...t}){return l.jsx(Kn.Drawer.Portal,{"data-slot":"drawer-portal",...t})}const I2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Close,{ref:e,"data-slot":"drawer-close",...t}));I2.displayName="DrawerClose";const D2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Overlay,{ref:n,"data-slot":"drawer-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));D2.displayName="DrawerOverlay";const E2=I.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(lD,{"data-slot":"drawer-portal",children:[l.jsx(D2,{}),l.jsxs(Kn.Drawer.Content,{ref:r,"data-slot":"drawer-content",className:w("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[l.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e]})]}));E2.displayName="DrawerContent";function fD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function cD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}const A2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Title,{ref:n,"data-slot":"drawer-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e}));A2.displayName="DrawerTitle";const z2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Description,{ref:n,"data-slot":"drawer-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e}));z2.displayName="DrawerDescription";function dD({value:t,options:e,onValueChange:n,onCancel:r,disabled:a=!1,variant:i="default",confirmTitle:s="Confirmar alteração",confirmDescription:o="Tem certeza que deseja alterar este valor?",confirmButtonText:f="Confirmar",cancelButtonText:c="Cancelar",skipConfirmation:d=!1,isLoading:u=!1,renderValue:p,className:h,...m},g){const[b,x]=I.useState(null),[v,j]=I.useState(!1),[y,L]=I.useState(!1),[C,N]=I.useState(!1),S=I.useMemo(()=>e.find(E=>E.value===t),[e,t]),T=I.useMemo(()=>b?e.find(E=>E.value===b):null,[e,b]),z=I.useCallback(E=>{if(E===t){L(!1);return}x(E),L(!1),d?P(E):j(!0)},[t,d]),P=I.useCallback(async E=>{const Y=E??b;if(Y){N(!0);try{await n(Y),j(!1),x(null)}catch(Z){console.error("Error confirming value change:",Z)}finally{N(!1)}}},[b,n]),U=I.useCallback(()=>{j(!1),x(null),r==null||r()},[r]),J=I.useCallback(()=>p&&S?p(t,S):S?l.jsxs(l.Fragment,{children:[S.icon,S.label]}):t,[p,t,S]),G=(S==null?void 0:S.variant)||i,K=S==null?void 0:S.className;return a?l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsx(pe,{variant:G,className:K,children:J()})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsxs(Hi,{open:y,onOpenChange:L,children:[l.jsx(Fi,{asChild:!0,disabled:u,children:l.jsxs(pe,{variant:G,className:w("cursor-pointer hover:opacity-80 transition-opacity gap-1.5",u&&"opacity-50 cursor-not-allowed",K),children:[J(),!u&&l.jsx(k.ChevronDown,{className:"h-3 w-3"})]})}),l.jsx(Ui,{align:"start",className:"w-48",children:e.map(E=>l.jsxs(gr,{onClick:()=>z(E.value),className:"gap-2",children:[E.icon&&l.jsx("span",{className:"w-4 h-4",children:E.icon}),l.jsx("span",{className:"flex-1",children:E.label}),E.value===t&&l.jsx(k.Check,{className:"h-4 w-4 text-primary"})]},String(E.value)))})]})}),l.jsx(_i,{open:v,onOpenChange:j,children:l.jsxs(Ji,{children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:s}),l.jsx(Yi,{children:o})]}),T&&l.jsxs("div",{className:"flex items-center gap-3 py-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"De:"}),l.jsxs(pe,{variant:(S==null?void 0:S.variant)||i,className:S==null?void 0:S.className,children:[S==null?void 0:S.icon,(S==null?void 0:S.label)||t]})]}),l.jsx("span",{className:"text-muted-foreground",children:"→"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Para:"}),l.jsxs(pe,{variant:T.variant||i,className:T.className,children:[T.icon,T.label]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:U,disabled:C,children:c}),l.jsx(F,{onClick:()=>P(),disabled:C,children:C?"Confirmando...":f})]})]})})]})}const O2=I.forwardRef(dD);O2.displayName="EditableBadge";function P2({className:t,...e}){return l.jsx(Yo.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",t),...e})}function R2({className:t,...e}){return l.jsx(Yo.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",t),...e})}function _s({className:t,...e}){return l.jsx(Yo.Trigger,{"data-slot":"tabs-trigger",className:w("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function uD({className:t,...e}){return l.jsx(Yo.Content,{"data-slot":"tabs-content",className:w("flex-1 outline-none",t),...e})}const B2=M.createContext({dragDropManager:void 0});function St(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Yp=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Qp=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wp={INIT:"@@redux/INIT"+Qp(),REPLACE:"@@redux/REPLACE"+Qp()};function hD(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function pD(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(bD(t))return"date";if(gD(t))return"error";var n=mD(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mD(t){return typeof t.constructor=="function"?t.constructor.name:null}function gD(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function bD(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Zr(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=pD(t)),e}function H2(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?St(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?St(1):"Expected the enhancer to be a function. Instead, received: '"+Zr(n)+"'");return n(H2)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?St(2):"Expected the root reducer to be a function. Instead, received: '"+Zr(t)+"'");var a=t,i=e,s=[],o=s,f=!1;function c(){o===s&&(o=s.slice())}function d(){if(f)throw new Error(process.env.NODE_ENV==="production"?St(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(4):"Expected the listener to be a function. Instead, received: '"+Zr(g)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?St(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return c(),o.push(g),function(){if(b){if(f)throw new Error(process.env.NODE_ENV==="production"?St(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c();var v=o.indexOf(g);o.splice(v,1),s=null}}}function p(g){if(!hD(g))throw new Error(process.env.NODE_ENV==="production"?St(7):"Actions must be plain objects. Instead, the actual type was: '"+Zr(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?St(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?St(9):"Reducers may not dispatch actions.");try{f=!0,i=a(i,g)}finally{f=!1}for(var b=s=o,x=0;x<b.length;x++){var v=b[x];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(10):"Expected the nextReducer to be a function. Instead, received: '"+Zr(g));a=g,p({type:Wp.REPLACE})}function m(){var g,b=u;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?St(11):"Expected the observer to be an object. Instead, received: '"+Zr(v)+"'");function j(){v.next&&v.next(d())}j();var y=b(j);return{unsubscribe:y}}},g[Yp]=function(){return this},g}return p({type:Wp.INIT}),r={dispatch:p,subscribe:u,getState:d,replaceReducer:h},r[Yp]=m,r}function ne(t,e,...n){if(xD()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;r=new Error(e.replace(/%s/g,function(){return n[a++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function xD(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function yD(t,e,n){return e.split(".").reduce((r,a)=>r&&r[a]?r[a]:n||null,t)}function vD(t,e){return t.filter(n=>n!==e)}function F2(t){return typeof t=="object"}function wD(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,s)=>{i===1&&a.push(s)}),a}function MD(t,e){return t.filter(n=>e.indexOf(n)>-1)}const iu="dnd-core/INIT_COORDS",Sl="dnd-core/BEGIN_DRAG",su="dnd-core/PUBLISH_DRAG_SOURCE",Tl="dnd-core/HOVER",Il="dnd-core/DROP",Dl="dnd-core/END_DRAG";function $p(t,e){return{type:iu,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const jD={type:iu,payload:{clientOffset:null,sourceClientOffset:null}};function CD(t){return function(n=[],r={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:s}=r,o=t.getMonitor(),f=t.getRegistry();t.dispatch($p(i)),LD(n,o,f);const c=SD(n,o);if(c==null){t.dispatch(jD);return}let d=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");ND(s),d=s(c)}t.dispatch($p(i,d));const p=f.getSource(c).beginDrag(o,c);if(p==null)return;kD(p),f.pinSource(c);const h=f.getSourceType(c);return{type:Sl,payload:{itemType:h,item:p,sourceId:c,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function LD(t,e,n){ne(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){ne(n.getSource(r),"Expected sourceIds to be registered.")})}function ND(t){ne(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function kD(t){ne(F2(t),"Item must be an object.")}function SD(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function TD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){TD(t,a,n[a])})}return t}function DD(t){return function(n={}){const r=t.getMonitor(),a=t.getRegistry();ED(r),OD(r).forEach((s,o)=>{const f=AD(s,o,a,r),c={type:Il,payload:{dropResult:ID({},n,f)}};t.dispatch(c)})}}function ED(t){ne(t.isDragging(),"Cannot call drop while not dragging."),ne(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function AD(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return zD(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function zD(t){ne(typeof t>"u"||F2(t),"Drop result must either be an object or undefined.")}function OD(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function PD(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RD(n);const a=n.getSourceId();return a!=null&&(r.getSource(a,!0).endDrag(n,a),r.unpinSource()),{type:Dl}}}function RD(t){ne(t.isDragging(),"Cannot call endDrag while not dragging.")}function xc(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function BD(t){return function(n,{clientOffset:r}={}){HD(n);const a=n.slice(0),i=t.getMonitor(),s=t.getRegistry(),o=i.getItemType();return UD(a,s,o),FD(a,i,s),_D(a,i,s),{type:Tl,payload:{targetIds:a,clientOffset:r||null}}}}function HD(t){ne(Array.isArray(t),"Expected targetIds to be an array.")}function FD(t,e,n){ne(e.isDragging(),"Cannot call hover while not dragging."),ne(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const a=t[r];ne(t.lastIndexOf(a)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(a);ne(i,"Expected targetIds to be registered.")}}function UD(t,e,n){for(let r=t.length-1;r>=0;r--){const a=t[r],i=e.getTargetType(a);xc(i,n)||t.splice(r,1)}}function _D(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function JD(t){return function(){if(t.getMonitor().isDragging())return{type:su}}}function VD(t){return{beginDrag:CD(t),publishDragSource:JD(t),hover:BD(t),drop:DD(t),endDrag:PD(t)}}class GD{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...s)=>{const o=i.apply(e,s);typeof o<"u"&&n(o)}}const a=VD(this);return Object.keys(a).reduce((i,s)=>{const o=a[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function YD(t,e){return{x:t.x+e.x,y:t.y+e.y}}function U2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function QD(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:U2(YD(e,r),n)}function WD(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:U2(e,n)}const hi=[],ou=[];hi.__IS_NONE__=!0;ou.__IS_ALL__=!0;function $D(t,e){return t===hi?!1:t===ou||typeof e>"u"?!0:MD(e,t).length>0}class ZD{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;ne(typeof e=="function","listener must be a function."),ne(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const s=this.store.getState(),o=s.stateId;try{o===a||o===a+1&&!$D(s.dirtyHandlerIds,r)||e()}finally{a=o}};return this.store.subscribe(i)}subscribeToOffsetChange(e){ne(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return ne(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(ne(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return xc(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(ne(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!xc(a,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return QD(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return WD(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const Zp=typeof global<"u"?global:self,_2=Zp.MutationObserver||Zp.WebKitMutationObserver;function J2(t){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),t()}}}function qD(t){let e=1;const n=new _2(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const KD=typeof _2=="function"?qD:J2;class XD{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,a=e.length-this.index;r<a;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=KD(this.flush),this.requestErrorThrow=J2(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class eE{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class tE{create(e){const n=this.freeTasks,r=n.length?n.pop():new eE(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const V2=new XD,nE=new tE(V2.registerPendingError);function rE(t){V2.enqueueTask(nE.create(t))}const lu="dnd-core/ADD_SOURCE",fu="dnd-core/ADD_TARGET",cu="dnd-core/REMOVE_SOURCE",El="dnd-core/REMOVE_TARGET";function aE(t){return{type:lu,payload:{sourceId:t}}}function iE(t){return{type:fu,payload:{targetId:t}}}function sE(t){return{type:cu,payload:{sourceId:t}}}function oE(t){return{type:El,payload:{targetId:t}}}function lE(t){ne(typeof t.canDrag=="function","Expected canDrag to be a function."),ne(typeof t.beginDrag=="function","Expected beginDrag to be a function."),ne(typeof t.endDrag=="function","Expected endDrag to be a function.")}function fE(t){ne(typeof t.canDrop=="function","Expected canDrop to be a function."),ne(typeof t.hover=="function","Expected hover to be a function."),ne(typeof t.drop=="function","Expected beginDrag to be a function.")}function yc(t,e){if(e&&Array.isArray(t)){t.forEach(n=>yc(n,!1));return}ne(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var At;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(At||(At={}));let cE=0;function dE(){return cE++}function uE(t){const e=dE().toString();switch(t){case At.SOURCE:return`S${e}`;case At.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function qp(t){switch(t[0]){case"S":return At.SOURCE;case"T":return At.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Kp(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class hE{addSource(e,n){yc(e),lE(n);const r=this.addHandler(At.SOURCE,e,n);return this.store.dispatch(aE(r)),r}addTarget(e,n){yc(e,!0),fE(n);const r=this.addHandler(At.TARGET,e,n);return this.store.dispatch(iE(r)),r}containsHandler(e){return Kp(this.dragSources,e)||Kp(this.dropTargets,e)}getSource(e,n=!1){return ne(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return ne(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return qp(e)===At.SOURCE}isTargetId(e){return qp(e)===At.TARGET}removeSource(e){ne(this.getSource(e),"Expected an existing source."),this.store.dispatch(sE(e)),rE(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){ne(this.getTarget(e),"Expected an existing target."),this.store.dispatch(oE(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);ne(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){ne(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=uE(e);return this.types.set(a,n),e===At.SOURCE?this.dragSources.set(a,r):e===At.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pE=(t,e)=>t===e;function mE(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function gE(t,e,n=pE){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function bE(t=hi,e){switch(e.type){case Tl:break;case lu:case fu:case El:case cu:return hi;case Sl:case su:case Dl:case Il:default:return ou}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,a=wD(n,r);if(!(a.length>0||!gE(n,r)))return hi;const s=r[r.length-1],o=n[n.length-1];return s!==o&&(s&&a.push(s),o&&a.push(o)),a}function xE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){xE(t,a,n[a])})}return t}const Xp={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function vE(t=Xp,e){const{payload:n}=e;switch(e.type){case iu:case Sl:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Tl:return mE(t.clientOffset,n.clientOffset)?t:yE({},t,{clientOffset:n.clientOffset});case Dl:case Il:return Xp;default:return t}}function wE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){wE(t,a,n[a])})}return t}const ME={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jE(t=ME,e){const{payload:n}=e;switch(e.type){case Sl:return qr({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case su:return qr({},t,{isSourcePublic:!0});case Tl:return qr({},t,{targetIds:n.targetIds});case El:return t.targetIds.indexOf(n.targetId)===-1?t:qr({},t,{targetIds:vD(t.targetIds,n.targetId)});case Il:return qr({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Dl:return qr({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function CE(t=0,e){switch(e.type){case lu:case fu:return t+1;case cu:case El:return t-1;default:return t}}function LE(t=0){return t+1}function NE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){NE(t,a,n[a])})}return t}function SE(t={},e){return{dirtyHandlerIds:bE(t.dirtyHandlerIds,{type:e.type,payload:kE({},e.payload,{prevTargetIds:yD(t,"dragOperation.targetIds",[])})}),dragOffset:vE(t.dragOffset,e),refCount:CE(t.refCount,e),dragOperation:jE(t.dragOperation,e),stateId:LE(t.stateId)}}function TE(t,e=void 0,n={},r=!1){const a=IE(r),i=new ZD(a,new hE(a)),s=new GD(a,i),o=t(s,e,n);return s.receiveBackend(o),s}function IE(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return H2(SE,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function DE(t,e){if(t==null)return{};var n=EE(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EE(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i<r.length;i++)a=r[i],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}let e0=0;const Js=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var G2=M.memo(function(e){var{children:n}=e,r=DE(e,["children"]);const[a,i]=AE(r);return M.useEffect(()=>{if(i){const s=Y2();return++e0,()=>{--e0===0&&(s[Js]=null)}}},[]),l.jsx(B2.Provider,{value:a,children:n})});function AE(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=zE(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function zE(t,e=Y2(),n,r){const a=e;return a[Js]||(a[Js]={dragDropManager:TE(t,e,n,r)}),a[Js]}function Y2(){return typeof global<"u"?global:window}function OE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xf,t0;function PE(){return t0||(t0=1,xf=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),xf}var RE=PE();const BE=OE(RE),Ir=typeof window<"u"?M.useLayoutEffect:M.useEffect;function HE(t,e,n){const[r,a]=M.useState(()=>e(t)),i=M.useCallback(()=>{const s=e(t);BE(r,s)||(a(s),n&&n())},[r,t,n]);return Ir(i),[r,i]}function FE(t,e,n){const[r,a]=HE(t,e,n);return Ir(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(a,{handlerIds:[s]})},[t,a]),r}function Q2(t,e,n){return FE(e,t||(()=>({})),()=>n.reconnect())}function W2(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),M.useMemo(()=>typeof t=="function"?t():t,n)}function UE(t){return M.useMemo(()=>t.hooks.dragSource(),[t])}function _E(t){return M.useMemo(()=>t.hooks.dragPreview(),[t])}let yf=!1,vf=!1;class JE{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){ne(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}isDragging(){if(!this.sourceId)return!1;ne(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let wf=!1;class VE{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;ne(!wf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return wf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{wf=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function GE(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function YE(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function vc(t,e,n,r){let a;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let f=0;f<i.length;f++){const c=i[f];if(!o(c))return!1;const d=t[c],u=e[c];if(a=void 0,a===!1||a===void 0&&d!==u)return!1}return!0}function wc(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function QE(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function WE(t){return(e=null,n=null)=>{if(!M.isValidElement(e)){const i=e;return t(i,n),i}const r=e;return QE(r),$E(r,n?i=>t(i,n):t)}}function $2(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=WE(r);e[n]=()=>a}}),e}function n0(t,e){typeof t=="function"?t(e):t.current=e}function $E(t,e){const n=t.ref;return ne(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?M.cloneElement(t,{ref:r=>{n0(n,r),n0(e,r)}}):M.cloneElement(t,{ref:e})}class ZE{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vc(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=$2({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,wc(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,wc(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class qE{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vc(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=$2({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,wc(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Ia(){const{dragDropManager:t}=M.useContext(B2);return ne(t!=null,"Expected drag drop context"),t}function KE(t,e){const n=Ia(),r=M.useMemo(()=>new ZE(n.getBackend()),[n]);return Ir(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Ir(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function XE(){const t=Ia();return M.useMemo(()=>new JE(t),[t])}class e5{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function t5(t,e,n){const r=M.useMemo(()=>new e5(t,e,n),[e,n]);return M.useEffect(()=>{r.spec=t},[t]),r}function n5(t){return M.useMemo(()=>{const e=t.type;return ne(e!=null,"spec.type must be defined"),e},[t])}function r5(t,e,n){const r=Ia(),a=t5(t,e,n),i=n5(t);Ir(function(){if(i!=null){const[o,f]=YE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f}},[r,e,n,a,i])}function a5(t,e){const n=W2(t,e);ne(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=XE(),a=KE(n.options,n.previewOptions);return r5(n,r,a),[Q2(n.collect,r,a),UE(a),_E(a)]}function i5(t){return M.useMemo(()=>t.hooks.dropTarget(),[t])}function s5(t){const e=Ia(),n=M.useMemo(()=>new qE(e.getBackend()),[e]);return Ir(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function o5(){const t=Ia();return M.useMemo(()=>new VE(t),[t])}function l5(t){const{accept:e}=t;return M.useMemo(()=>(ne(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class f5{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function c5(t,e){const n=M.useMemo(()=>new f5(t,e),[e]);return M.useEffect(()=>{n.spec=t},[t]),n}function d5(t,e,n){const r=Ia(),a=c5(t,e),i=l5(t);Ir(function(){const[o,f]=GE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f},[r,e,a,n,i.map(s=>s.toString()).join("|")])}function du(t,e){const n=W2(t,e),r=o5(),a=s5(n.options);return d5(n,r,a),[Q2(n.collect,r,a),i5(a)]}function Z2(t){let e=null;return()=>(e==null&&(e=t()),e)}function u5(t,e){return t.filter(n=>n!==e)}function h5(t,e){const n=new Set,r=i=>n.add(i);t.forEach(r),e.forEach(r);const a=[];return n.forEach(i=>a.push(i)),a}class p5{enter(e){const n=this.entered.length,r=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(e));return this.entered=h5(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=u5(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class m5{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];a!=null&&(n[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const q2="__NATIVE_FILE__",K2="__NATIVE_URL__",X2="__NATIVE_TEXT__",e4="__NATIVE_HTML__",r0=Object.freeze(Object.defineProperty({__proto__:null,FILE:q2,HTML:e4,TEXT:X2,URL:K2},Symbol.toStringTag,{value:"Module"}));function Mf(t,e,n){const r=e.reduce((a,i)=>a||t.getData(i),"");return r??n}const Mc={[q2]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[e4]:{exposeProperties:{html:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K2]:{exposeProperties:{urls:(t,e)=>Mf(t,e,"").split(`
222
- `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[X2]:{exposeProperties:{text:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function g5(t,e){const n=Mc[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new m5(n);return r.loadDataTransfer(e),r}function jf(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Mc).filter(n=>{const r=Mc[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(a=>e.indexOf(a)>-1):!1})[0]||null}const b5=Z2(()=>/firefox/i.test(navigator.userAgent)),t4=Z2(()=>!!window.safari);class a0{interpolate(e){const{xs:n,ys:r,c1s:a,c2s:i,c3s:s}=this;let o=n.length-1;if(e===n[o])return r[o];let f=0,c=s.length-1,d;for(;f<=c;){d=Math.floor(.5*(f+c));const h=n[d];if(h<e)f=d+1;else if(h>e)c=d-1;else return r[d]}o=Math.max(0,c);const u=e-n[o],p=u*u;return r[o]+a[o]*u+i[o]*p+s[o]*u*p}constructor(e,n){const{length:r}=e,a=[];for(let h=0;h<r;h++)a.push(h);a.sort((h,m)=>e[h]<e[m]?-1:1);const i=[],s=[];let o,f;for(let h=0;h<r-1;h++)o=e[h+1]-e[h],f=n[h+1]-n[h],i.push(o),s.push(f/o);const c=[s[0]];for(let h=0;h<i.length-1;h++){const m=s[h],g=s[h+1];if(m*g<=0)c.push(0);else{o=i[h];const b=i[h+1],x=o+b;c.push(3*x/((x+b)/m+(x+o)/g))}}c.push(s[s.length-1]);const d=[],u=[];let p;for(let h=0;h<c.length-1;h++){p=s[h];const m=c[h],g=1/i[h],b=m+c[h+1]-p-p;d.push((p-m-b)*g),u.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=d,this.c3s=u}}const x5=1;function n4(t){const e=t.nodeType===x5?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ds(t){return{x:t.clientX,y:t.clientY}}function y5(t){var e;return t.nodeName==="IMG"&&(b5()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function v5(t,e,n,r){let a=t?e.width:n,i=t?e.height:r;return t4()&&t&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function w5(t,e,n,r,a){const i=y5(e),o=n4(i?t:e),f={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:d}=t,{anchorX:u,anchorY:p}=r,{dragPreviewWidth:h,dragPreviewHeight:m}=v5(i,e,c,d),g=()=>{let C=new a0([0,.5,1],[f.y,f.y/d*m,f.y+m-d]).interpolate(p);return t4()&&i&&(C+=(window.devicePixelRatio-1)*m),C},b=()=>new a0([0,.5,1],[f.x,f.x/c*h,f.x+h-c]).interpolate(u),{offsetX:x,offsetY:v}=a,j=x===0||x,y=v===0||v;return{x:j?x:b(),y:y?v:g()}}class M5{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function j5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){j5(t,a,n[a])})}return t}class C5{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const a=s=>this.handleDragStart(s,e),i=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),a=s=>this.handleDragOver(s,e),i=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",a),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return i0({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return i0({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(r0).some(n=>r0[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=g5(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&n4(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const s=Ds(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:o}=a,f=jf(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),p=this.sourcePreviewNodes.get(d)||u;if(p){const{anchorX:h,anchorY:m,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),j=w5(u,p,s,{anchorX:h,anchorY:m},{offsetX:g,offsetY:b});o.setDragImage(p,j.x,j.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(f)this.beginDragNativeItem(f);else{if(o&&!o.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:o}=a,f=jf(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:Ds(a)}),i.some(o=>this.monitor.canDropOnTarget(o))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Ds(a),this.scheduleHover(i),(i||[]).some(o=>this.monitor.canDropOnTarget(o))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else jf(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:Ds(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new M5(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new p5(this.isNodeInDocument)}}const r4=function(e,n,r){return new C5(e,n,r)},Bi={TASK:"task"},a4={instagram:k.Instagram,linkedin:k.Linkedin,facebook:k.Facebook,twitter:k.Twitter,youtube:k.Youtube,blog:k.Calendar,other:k.Calendar},Cf={instagram:"text-pink-600",linkedin:"text-blue-700",facebook:"text-blue-600",twitter:"text-sky-500",youtube:"text-red-600",blog:"text-orange-500",other:"text-gray-500"},jc={idea:"bg-gray-100 text-gray-600 border-gray-200",planned:"bg-blue-50 text-blue-600 border-blue-200","in-progress":"bg-yellow-50 text-yellow-600 border-yellow-200",approval:"bg-purple-50 text-purple-600 border-purple-200",scheduled:"bg-green-50 text-green-600 border-green-200",published:"bg-slate-800 text-white border-slate-700"},s0=["bg-blue-50 border-blue-100 text-blue-700","bg-green-50 border-green-100 text-green-700","bg-purple-50 border-purple-100 text-purple-700","bg-orange-50 border-orange-100 text-orange-700","bg-pink-50 border-pink-100 text-pink-700","bg-yellow-50 border-yellow-100 text-yellow-700"],o0=t=>{const e=t.split("").reduce((n,r)=>n+r.charCodeAt(0),0);return s0[e%s0.length]};function Al({task:t,view:e="month",mode:n="editorial",onClick:r,style:a}){var p;const[{isDragging:i},s]=a5(()=>({type:Bi.TASK,item:{id:t.id,type:Bi.TASK},collect:h=>({isDragging:!!h.isDragging()})}),[t.id]),o=t.channel?a4[t.channel]:k.Calendar,f=t.date?new Date(t.date):null,c=t.endDate?new Date(t.endDate):f?H.addHours(f,1):null,d=f?H.format(f,"HH:mm"):null,u=f&&c?`${H.format(f,"HH:mm")} - ${H.format(c,"HH:mm")}`:d;return n==="editorial"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-3 overflow-hidden",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-gray-50/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(o,{size:14,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),d&&l.jsx("span",{className:"text-xs font-medium text-gray-500",children:d})]}),l.jsx("div",{className:"opacity-0 group-hover:opacity-100 text-gray-400 cursor-grab",children:l.jsx(k.GripVertical,{size:14})})]}),t.imageUrl&&l.jsx("div",{className:"w-full aspect-video bg-gray-100 relative border-b",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"p-3",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 line-clamp-2 mb-2 leading-snug",children:t.title}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(pe,{variant:"outline",className:w("px-1.5 py-0 text-[10px] h-5 font-normal uppercase tracking-wide",jc[t.status]),children:t.status}),t.assignees&&t.assignees.length>0&&l.jsx("div",{className:"flex -space-x-2",children:t.assignees.slice(0,2).map((h,m)=>l.jsxs(Ft,{className:"w-5 h-5 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))})]})]})]}):n==="editorial"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-1 overflow-hidden flex items-center gap-2 p-1.5",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[t.imageUrl&&l.jsx("div",{className:"w-8 h-8 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsx("div",{className:"min-w-0 flex-1",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-xs",children:t.title})]})})]}):n==="execution"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,style:a,className:w("absolute z-10 rounded-md border shadow-sm p-1.5 text-xs flex flex-col overflow-hidden hover:overflow-visible hover:h-auto! hover:min-h-[min-content] hover:z-50 transition-all cursor-pointer group",i?"opacity-50":"opacity-100",t.color||o0(t.id)),children:[l.jsxs("div",{className:"flex items-center gap-1 mb-0.5 font-semibold opacity-75 text-[10px] leading-none",children:[l.jsx(k.Clock,{size:10}),l.jsx("span",{className:"truncate",children:u})]}),l.jsx("div",{className:"font-bold leading-tight mb-1 line-clamp-2 text-[11px]",children:t.title}),l.jsxs("div",{className:"mt-auto flex items-center justify-between pt-1",children:[l.jsx("div",{className:"flex -space-x-1.5",children:(p=t.assignees)==null?void 0:p.map((h,m)=>l.jsxs(Ft,{className:"w-4 h-4 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))}),t.status!=="published"&&l.jsx("div",{className:w("w-2 h-2 rounded-full",jc[t.status].split(" ")[1].replace("text-","bg-"))})]})]}):n==="execution"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer rounded px-2 py-1 mb-1 text-xs truncate font-medium transition-all",i?"opacity-50":"opacity-100",t.color||o0(t.id).replace("bg-","bg-opacity-20 bg-")),children:[d," ",t.title]}):l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-2 p-2 flex items-start gap-3",i?"opacity-50":"opacity-100",n==="editorial"&&(t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]")),children:[n==="editorial"&&t.imageUrl&&l.jsx("div",{className:"w-10 h-10 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n==="editorial"&&l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-sm",children:t.title})]}),l.jsx(pe,{variant:"secondary",className:"text-[10px] h-4 px-1 py-0",children:t.status})]})]})}function L5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,view:i}){return l.jsx("div",{className:w("grid h-full min-h-[calc(100vh-200px)] bg-gray-50/30",i==="week"?"grid-cols-7 divide-x":"grid-cols-1 border-x"),children:t.map(s=>{const o=e.filter(f=>f.date&&H.isSameDay(new Date(f.date),s)).sort((f,c)=>f.date&&c.date?new Date(f.date).getTime()-new Date(c.date).getTime():0);return l.jsx(N5,{day:s,tasks:o,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:H.isToday(s)},s.toISOString())})})}function N5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:i}){const[{isOver:s},o]=du(()=>({accept:Bi.TASK,drop:f=>n(f.id,t),collect:f=>({isOver:!!f.isOver()})}),[t,n]);return l.jsxs("div",{ref:o,className:w("flex flex-col h-full min-h-0 transition-colors",s&&"bg-purple-50 ring-inset ring-2 ring-[#7F26BF]"),children:[l.jsxs("div",{className:w("p-2 text-center border-b bg-white sticky top-0 z-10",i&&"bg-purple-50/50"),children:[l.jsx("div",{className:"text-xs font-semibold uppercase text-gray-500 mb-1",children:H.format(t,"EEE")}),l.jsx("div",{className:w("w-8 h-8 rounded-full flex items-center justify-center mx-auto text-sm font-medium",i?"bg-[#7F26BF] text-white":"text-gray-900 bg-gray-100"),children:H.format(t,"d")})]}),l.jsxs("div",{className:"flex-1 p-2 space-y-3 overflow-y-auto",children:[l.jsxs(F,{variant:"outline",size:"sm",className:"w-full mb-2 justify-center px-1",onClick:()=>a(t),children:[l.jsx(k.Plus,{size:12,className:"flex-shrink-0"}),l.jsx("span",{className:"truncate ml-1.5 hidden xl:inline",children:"Add Post"}),l.jsx("span",{className:"truncate ml-1.5 inline xl:hidden",children:"Add"})]}),e.map(f=>l.jsx(Al,{task:f,view:"week",mode:"editorial",onClick:()=>r(f)},f.id))]})]})}function k5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a}){const i=Array.from({length:24},(s,o)=>o);return l.jsxs("div",{className:"flex h-full relative overflow-y-auto bg-white select-none",children:[l.jsxs("div",{className:"w-14 flex-shrink-0 border-r bg-white sticky left-0 z-30",children:[l.jsx("div",{className:"h-10 border-b bg-white sticky top-0 z-40 flex-shrink-0"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b text-right pr-2 pt-2 text-xs text-gray-400 font-medium relative",children:l.jsx("span",{className:"-top-2.5 relative",children:H.format(H.setHours(new Date,s),"ha")})},s))]}),l.jsxs("div",{className:"flex flex-1 min-w-0 relative",children:[t.map((s,o)=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),s));return l.jsx(S5,{day:s,tasks:f,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:o===t.length-1,HOURS:i},s.toISOString())}),l.jsxs("div",{className:"absolute inset-0 pointer-events-none z-0",children:[l.jsx("div",{className:"h-10 border-b bg-transparent"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b border-dashed border-gray-100 w-full"},s))]})]})]})}function S5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:i,HOURS:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:(c,d)=>{n(c.id,t)},collect:c=>({isOver:!!c.isOver()})}),[t,n]);return l.jsxs("div",{ref:f,className:w("flex-1 relative min-w-[150px]",!i&&"border-r",o&&"bg-blue-50/30"),children:[l.jsx("div",{className:"sticky top-0 z-20 bg-white border-b h-10 flex items-center justify-center shadow-sm",children:l.jsxs("div",{className:"text-xs font-bold text-gray-500",children:[H.format(t,"EEE")," ",l.jsx("span",{className:w("ml-1",H.isToday(t)&&"text-blue-600"),children:H.format(t,"d")})]})}),s.map(c=>l.jsx("div",{className:"h-24 w-full absolute hover:bg-gray-50/50 transition-colors cursor-pointer z-10",style:{top:`${c*96+40}px`},onClick:d=>{d.stopPropagation();const u=new Date(t);u.setHours(c,0),a(u)}},c)),e.map(c=>{const d=c.date?new Date(c.date):new Date,u=c.endDate?new Date(c.endDate):H.addHours(d,1),p=H.getHours(d),h=H.getMinutes(d);let m=H.differenceInMinutes(u,d);m<30&&(m=30);const g=p*96+h/60*96+40,b=m/60*96;return l.jsx(Al,{task:c,view:"week",mode:"execution",onClick:()=>r(c),style:{top:`${g}px`,height:`${b}px`,left:"4px",right:"4px",position:"absolute"}},c.id)})]})}function i4({days:t,tasks:e,currentDate:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){return l.jsx("div",{className:"grid grid-cols-7 auto-rows-fr min-h-[800px]",children:t.map(o=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),o));return l.jsx(T5,{date:o,tasks:f,isCurrentMonth:H.isSameMonth(o,n),onDropTask:r,onTaskClick:a,onAddClick:i,mode:s},o.toISOString())})})}function T5({date:t,tasks:e,isCurrentMonth:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:d=>r(d.id,t),collect:d=>({isOver:!!d.isOver()})}),[t,r]),c=H.isToday(t);return l.jsxs("div",{ref:f,className:w("min-h-[120px] border-b border-r p-2 relative transition-colors group flex flex-col",!n&&"bg-gray-50/50 text-gray-400",o&&"bg-purple-50 ring-2 ring-inset ring-[#7F26BF]",c&&"bg-purple-50/30"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("span",{className:w("text-sm font-medium rounded-full w-7 h-7 flex items-center justify-center",c?"bg-[#7F26BF] text-white":"text-gray-700"),children:H.format(t,"d")}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>i(t),children:l.jsx(k.Plus,{size:14})})]}),l.jsx("div",{className:"flex-1 flex flex-col gap-1",children:e.map(d=>l.jsx(Al,{task:d,view:"month",mode:s,onClick:()=>a(d)},d.id))})]})}function s4({isOpen:t,onClose:e,task:n,onSave:r,isNew:a=!1}){const[i,s]=M.useState(n||{});M.useMemo(()=>{s(n||{})},[n]);const o=()=>{r(i),e()};return l.jsx(_i,{open:t,onOpenChange:f=>!f&&e(),children:l.jsxs(Ji,{className:"sm:max-w-[600px]",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:a?"Create New Task":"Edit Task"}),l.jsx(Yi,{children:a?"Enter the details for the new task below.":"Modify the details of the selected task."})]}),l.jsxs("div",{className:"grid gap-6 py-4",children:[l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"title",className:"text-right text-sm font-medium",children:"Title"}),l.jsx("input",{id:"title",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.title||"",onChange:f=>s({...i,title:f.target.value}),placeholder:"e.g. New Feature Announcement"})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{className:"text-right text-sm font-medium",children:"Time"}),l.jsxs("div",{className:"col-span-3 flex gap-2 items-center",children:[l.jsx("input",{type:"date",className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):typeof i.date=="string"?i.date.split("T")[0]:"",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?i.date:new Date,u=new Date(`${c}T${H.format(d,"HH:mm")}`);s({...i,date:u})}}),l.jsx("span",{className:"text-sm text-gray-500",children:"at"}),l.jsx("input",{type:"time",className:"w-32 flex h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"HH:mm"):"09:00",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):H.format(new Date,"yyyy-MM-dd");s({...i,date:new Date(`${d}T${c}`)})}})]})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"channel",className:"text-right text-sm font-medium",children:"Channel / Category"}),l.jsx("select",{id:"channel",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.channel||"instagram",onChange:f=>s({...i,channel:f.target.value}),children:Object.keys(a4).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium",children:"Status"}),l.jsx("select",{id:"status",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.status||"idea",onChange:f=>s({...i,status:f.target.value}),children:Object.keys(jc).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[l.jsx("label",{htmlFor:"description",className:"text-right text-sm font-medium pt-2",children:"Description"}),l.jsx("textarea",{id:"description",className:"col-span-3 flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.description||"",onChange:f=>s({...i,description:f.target.value}),placeholder:"Details about this post..."})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:e,children:"Cancel"}),l.jsx(F,{className:"bg-[#7F26BF] hover:bg-[#6E21A6]",onClick:o,children:"Save Changes"})]})]})})}function o4({tasks:t,onTaskUpdate:e,onTaskCreate:n,defaultView:r="month"}){const[a,i]=M.useState(new Date),[s,o]=M.useState(r),[f,c]=M.useState(!0),[d,u]=M.useState(!1),[p,h]=M.useState(null),[m,g]=M.useState(!1),b=M.useMemo(()=>{let z,P;if(s==="month"){const U=H.startOfMonth(a),J=H.endOfMonth(U);z=H.startOfWeek(U),P=H.endOfWeek(J)}else s==="week"?(z=H.startOfWeek(a),P=H.endOfWeek(a)):(z=a,P=a);return H.eachDayOfInterval({start:z,end:P})},[a,s]),x=t.filter(z=>!z.date),v=t.filter(z=>z.date);return{currentDate:a,view:s,setView:o,isSidebarOpen:f,setIsSidebarOpen:c,isModalOpen:d,setIsModalOpen:u,editingTask:p,isNewTask:m,calendarDays:b,unplannedTasks:x,scheduledTasks:v,handlePrev:()=>{i(s==="month"?H.subMonths(a,1):s==="week"?H.addDays(a,-7):H.addDays(a,-1))},handleNext:()=>{i(s==="month"?H.addMonths(a,1):s==="week"?H.addDays(a,7):H.addDays(a,1))},handleToday:()=>i(new Date),handleDropTask:(z,P,U)=>{const J=t.find(G=>G.id===z);if(J){let G=new Date(P);if(s==="month"||U==="editorial")if(J.date){const E=new Date(J.date);G.setHours(E.getHours(),E.getMinutes())}else G.setHours(9,0);const K={...J,date:G};e(K)}},handleTaskClick:z=>{h(z),g(!1),u(!0)},handleAddClick:z=>{const P=z||new Date;H.getHours(P)===0&&H.getMinutes(P)===0&&P.setHours(9,0),h({date:P,status:"idea",channel:"instagram"}),g(!0),u(!0)},handleModalSave:z=>{m?n&&n(z):z.id&&e(z),u(!1)}}}function l4({isOpen:t,setIsOpen:e,tasks:n,onAddClick:r,onTaskClick:a,mode:i}){return t?l.jsxs("div",{className:"w-72 border-r bg-gray-50/50 flex flex-col transition-all duration-300 flex-shrink-0",children:[l.jsxs("div",{className:"p-4 border-b bg-white flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-semibold text-sm text-gray-900",children:"Backlog"}),l.jsx(pe,{variant:"secondary",className:"bg-gray-100 text-xs",children:n.length})]}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>e(!1),children:l.jsx(k.PanelLeftClose,{size:16})})]}),l.jsx("div",{className:"px-4 pt-3 bg-white pb-3 border-b space-y-2",children:l.jsxs(F,{onClick:r,variant:"outline",size:"sm",className:"w-full justify-start pl-2",children:[l.jsx(k.Plus,{size:12,className:"mr-1.5"})," New Task"]})}),l.jsx(Wo,{className:"flex-1 p-3",children:l.jsx("div",{className:"space-y-2",children:n.length===0?l.jsx("div",{className:"text-center py-10 px-4 border-2 border-dashed border-gray-200 rounded-lg",children:l.jsx("p",{className:"text-xs text-gray-400",children:"No unscheduled items"})}):n.map(s=>l.jsx(Al,{task:s,view:"backlog",mode:i,onClick:()=>a(s)},s.id))})})]}):l.jsxs("div",{className:"border-r bg-white flex flex-col items-center py-4 w-12 flex-shrink-0 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>e(!0),children:[l.jsx(k.PanelLeftOpen,{className:"text-gray-500 mb-4",size:20}),l.jsx("div",{className:"flex-1 flex items-center justify-center min-h-0",children:l.jsx("div",{className:"whitespace-nowrap text-xs font-medium text-gray-400 -rotate-90 transform",children:"BACKLOG"})}),l.jsx(pe,{className:"mt-2 h-5 w-5 p-0 flex items-center justify-center rounded-full bg-[#7F26BF] text-[10px]",children:n.length})]})}function f4({title:t,onPrev:e,onNext:n,onToday:r,onAdd:a,view:i,setView:s}){return l.jsxs("div",{className:"flex flex-col xl:flex-row items-center justify-between p-4 border-b gap-4 flex-shrink-0 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-4 w-full xl:w-auto justify-between xl:justify-start",children:[l.jsxs("div",{className:"flex items-center border rounded-md bg-white shadow-sm",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:e,className:"h-8 w-8 rounded-r-none",children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",onClick:r,className:"h-8 px-3 rounded-none border-x text-sm font-medium hover:bg-gray-50",children:"Today"}),l.jsx(F,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8 rounded-l-none",children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx("h2",{className:"text-lg font-bold text-gray-900 whitespace-nowrap",children:t})]}),l.jsxs("div",{className:"flex items-center gap-3 w-full xl:w-auto overflow-x-auto pb-1 xl:pb-0 justify-end",children:[l.jsx(P2,{value:i,onValueChange:o=>s(o),className:"flex-shrink-0",children:l.jsxs(R2,{className:"h-9",children:[l.jsx(_s,{value:"month",className:"text-xs",children:"Month"}),l.jsx(_s,{value:"week",className:"text-xs",children:"Week"}),l.jsx(_s,{value:"day",className:"text-xs",children:"Day"})]})}),l.jsxs(F,{variant:"default",className:"h-9 px-4 flex-shrink-0",onClick:a,children:[l.jsx(k.Plus,{className:"mr-2 h-4 w-4"})," Create"]})]})]})}function c4({days:t}){return l.jsx("div",{className:"grid grid-cols-7 border-b bg-gray-50 flex-shrink-0 divide-x",children:t.slice(0,7).map((e,n)=>l.jsx("div",{className:"py-2 text-center group",children:l.jsx("div",{className:w("text-xs font-semibold uppercase tracking-wider",H.isToday(e)?"text-[#7F26BF]":"text-gray-500"),children:H.format(e,"EEE")})},n))})}function I5(t){const e=o4({...t,defaultView:"month"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"editorial"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"editorial"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"editorial"}):l.jsx(L5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,view:e.view})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}function D5(t){const e=o4({...t,defaultView:"week"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"execution"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"execution"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"execution"}):l.jsx(k5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}const E5=Vs.FormProvider,d4=I.createContext({}),A5=({...t})=>l.jsx(d4.Provider,{value:{name:t.name},children:l.jsx(Vs.Controller,{...t})}),ns=()=>{const t=I.useContext(d4),e=I.useContext(u4),{getFieldState:n}=Vs.useFormContext(),r=Vs.useFormState({name:t.name}),a=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},u4=I.createContext({});function z5({className:t,...e}){const n=I.useId();return l.jsx(u4.Provider,{value:{id:n},children:l.jsx("div",{"data-slot":"form-item",className:w("grid gap-2",t),...e})})}function O5({className:t,...e}){const{error:n,formItemId:r}=ns();return l.jsx(Ue,{"data-slot":"form-label","data-error":!!n,className:w("data-[error=true]:text-destructive",t),htmlFor:r,...e})}function P5({...t}){const{error:e,formItemId:n,formDescriptionId:r,formMessageId:a}=ns();return l.jsx(kn.Slot,{"data-slot":"form-control",id:n,"aria-describedby":e?`${r} ${a}`:`${r}`,"aria-invalid":!!e,...t})}function R5({className:t,...e}){const{formDescriptionId:n}=ns();return l.jsx("p",{"data-slot":"form-description",id:n,className:w("text-muted-foreground text-sm",t),...e})}function B5({className:t,...e}){const{error:n,formMessageId:r}=ns(),a=n?String((n==null?void 0:n.message)??""):e.children;return a?l.jsx("p",{"data-slot":"form-message",id:r,className:w("text-destructive text-sm",t),...e,children:a}):null}const h4={"not-started":{label:"Não iniciada",icon:k.Circle,variant:"outline",barColor:"bg-gray-300 dark:bg-gray-600"},"in-progress":{label:"Em progresso",icon:k.Clock,variant:"default",barColor:"bg-primary"},"on-hold":{label:"Em espera",icon:k.AlertCircle,variant:"secondary",barColor:"bg-cyan-500"},completed:{label:"Concluída",icon:k.CheckCircle2,variant:"outline",barColor:"bg-green-500"},delayed:{label:"Atrasada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-red-500"},cancelled:{label:"Cancelada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-orange-500"}},l0=["#7F26BF","#0086E6","#24B347","#F26924","#E91E63","#9C27B0","#00BCD4","#FF9800"];function H5(t,e,n,r,a){const i=H.differenceInDays(r,n),s=H.differenceInDays(t,n),o=H.differenceInDays(e,t)+1,f=s/i*100,c=o/i*100;return{left:f,width:c}}const p4=I.memo(({task:t,timelineStart:e,timelineEnd:n,columnWidth:r,rowHeight:a,onTaskClick:i,onTaskEdit:s})=>{const{left:o,width:f}=H5(t.startDate,t.endDate,e,n),c=h4[t.status],d=c.icon;return t.milestone?l.jsxs("div",{className:"absolute group/milestone",style:{left:`${o}%`,top:"50%",transform:"translateY(-50%)"},children:[l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("div",{className:w("w-4 h-4 rotate-45 cursor-pointer transition-all hover:scale-125",c.barColor),onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Milestone: ${t.name}`})}),l.jsx(at,{side:"top",className:"max-w-sm",children:l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium",children:t.name}),l.jsx("p",{className:"text-xs opacity-90",children:"📍 Marco importante"}),l.jsxs("p",{className:"text-xs opacity-90",children:["📅 ",H.format(t.startDate,"dd/MM/yyyy",{locale:yt})]})]})})]}),s&&l.jsx("button",{className:"absolute -right-6 top-1/2 -translate-y-1/2 opacity-0 group-hover/milestone:opacity-100 transition-opacity bg-background border rounded p-1 shadow-md hover:bg-primary hover:text-primary-foreground",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar marco",children:l.jsx(k.Edit,{className:"size-3"})})]}):l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"absolute group/task cursor-pointer",style:{left:`${o}%`,width:`${f}%`,top:"20%",height:"60%"},onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Task: ${t.name}, Status: ${c.label}, Progress: ${t.progress}%`,children:[l.jsx("div",{className:w("absolute inset-0 rounded-lg transition-all",c.barColor,"group-hover/task:shadow-lg group-hover/task:scale-[1.02]","opacity-90 group-hover/task:opacity-100")}),t.progress>0&&l.jsx("div",{className:"absolute inset-0 rounded-lg bg-white/20 dark:bg-black/20",style:{clipPath:`inset(0 ${100-t.progress}% 0 0)`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center px-2 gap-1.5",children:[l.jsx(d,{className:"size-3 text-white flex-shrink-0"}),l.jsx("span",{className:"text-xs text-white truncate",children:t.name}),t.assignee&&l.jsx("div",{className:"ml-auto flex-shrink-0",children:l.jsx(Ft,{className:"size-5 border border-white/50",children:l.jsx(Ut,{className:"bg-white/20 text-white text-[8px]",children:t.assignee.initials||t.assignee.name.substring(0,2).toUpperCase()})})})]}),s&&l.jsx("button",{className:"absolute -right-7 top-1/2 -translate-y-1/2 opacity-0 group-hover/task:opacity-100 transition-opacity bg-background border rounded p-1.5 shadow-lg hover:bg-primary hover:text-primary-foreground z-20",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar tarefa",children:l.jsx(k.Edit,{className:"size-3.5"})})]})}),l.jsx(Ze,{className:"w-80",align:"start",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium mb-1",children:t.name}),t.description&&l.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Calendar,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.format(t.startDate,"dd/MM/yyyy",{locale:yt})," -"," ",H.format(t.endDate,"dd/MM/yyyy",{locale:yt})]})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.differenceInDays(t.endDate,t.startDate)+1," dias"]})]}),t.assignee&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.User,{className:"size-4 text-muted-foreground"}),l.jsx("span",{children:t.assignee.name})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs(pe,{variant:c.variant,className:"gap-1",children:[l.jsx(d,{className:"size-3"}),c.label]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.progress,"% concluído"]})]})]})})]})});p4.displayName="TaskRow";const F5=["DOM","SEG","TER","QUA","QUI","SEX","SAB"],m4=I.forwardRef(({tasks:t,projects:e=[],onTaskClick:n,onTaskEdit:r,rowHeight:a=48,columnWidth:i=40,groupBy:s="projects"},o)=>{const[f,c]=I.useState(new Date),[d,u]=I.useState(new Set),p=H.startOfMonth(f),h=H.endOfMonth(f),m=H.eachDayOfInterval({start:p,end:h}),g=()=>c(H.subMonths(f,1)),b=()=>c(H.addMonths(f,1)),x=()=>c(new Date),v=I.useMemo(()=>{if(s==="assignees"){const y=new Map;return t.forEach(C=>{var S;const N=((S=C.assignee)==null?void 0:S.name)||"Sem responsável";y.has(N)||y.set(N,[]),y.get(N).push(C)}),Array.from(y.entries()).map(([C,N],S)=>{var T,z,P;return{id:C,name:C,color:(T=N[0])!=null&&T.assignee?l0[S%l0.length]:"#999",initials:((P=(z=N[0])==null?void 0:z.assignee)==null?void 0:P.initials)||"??",tasks:N}})}else{const y=new Map;return t.forEach(L=>{const C=L.projectId;y.has(C)||y.set(C,[]),y.get(C).push(L)}),e.length>0?e.map(C=>({...C,tasks:y.get(C.id)||[]})).filter(C=>C.tasks.length>0):[{id:"default",name:"Tarefas",color:"#7F26BF",tasks:t}]}},[t,e,s]),j=y=>{u(L=>{const C=new Set(L);return C.has(y)?C.delete(y):C.add(y),C})};return l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:g,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx("h2",{className:"text-lg font-bold min-w-[200px] text-center",children:H.format(f,"MMMM yyyy",{locale:yt})}),l.jsx(F,{variant:"ghost",size:"icon",onClick:b,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx(F,{variant:"outline",size:"sm",onClick:x,children:"Hoje"})]}),l.jsx("div",{ref:o,className:w("gantt-chart overflow-hidden rounded-lg border bg-card flex flex-col"),role:"grid","aria-label":"Gantt Chart",children:l.jsx("div",{className:"overflow-auto max-h-[600px] relative",children:l.jsxs("div",{style:{minWidth:"max-content"},children:[l.jsxs("div",{className:"sticky top-0 z-40 flex bg-background border-b shadow-sm",children:[l.jsx("div",{className:"sticky left-0 z-50 border-r bg-background flex items-center px-4",style:{width:"280px",height:"50px"},children:l.jsx("span",{className:"font-medium text-sm",children:s==="assignees"?"Colaboradores":"Tarefas"})}),l.jsx("div",{className:"flex",children:m.map(y=>{const L=H.isWeekend(y);return l.jsx("div",{className:w("flex-shrink-0 border-r text-center bg-background",L&&"bg-muted/20"),style:{width:`${i}px`},children:l.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-0.5 py-1",children:[l.jsx("span",{className:"text-[10px] font-bold leading-none text-foreground",children:F5[y.getDay()]}),l.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:H.format(y,"d",{locale:yt})})]})},y.toISOString())})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex pointer-events-none pl-[280px]",children:m.map(y=>{const L=H.isWeekend(y),C=H.isSameDay(y,new Date);return l.jsx("div",{className:w("flex-shrink-0 h-full",L&&"bg-muted/10",C&&"bg-primary/5"),style:{width:`${i}px`}},`grid-${y.toISOString()}`)})}),v.map(y=>{const L=d.has(y.id);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex sticky-container",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 border-b hover:bg-muted/50 transition-colors cursor-pointer",style:{height:`${a}px`},onClick:()=>j(y.id),children:[L?l.jsx(k.ChevronRight,{className:"size-4 text-muted-foreground"}):l.jsx(k.ChevronDown,{className:"size-4 text-muted-foreground"}),s==="assignees"&&y.initials?l.jsx(Ft,{className:"size-6",children:l.jsx(Ut,{style:{backgroundColor:y.color},className:"text-white text-[10px]",children:y.initials})}):l.jsx("div",{className:"size-3 rounded-full flex-shrink-0",style:{backgroundColor:y.color||"var(--primary)"}}),l.jsx("span",{className:"font-medium text-sm truncate",children:y.name}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:y.tasks.length})]}),l.jsx("div",{className:"flex-1 border-b",style:{height:`${a}px`}})]}),!L&&y.tasks.map(C=>l.jsxs("div",{className:"flex sticky-container group",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 pl-9 border-b hover:bg-muted/20 transition-colors",style:{height:`${a}px`},children:[l.jsx("div",{className:w("size-2 rounded-full flex-shrink-0",C.milestone&&"rotate-45"),style:{backgroundColor:y.color}}),l.jsx("span",{className:"text-sm truncate flex-1",children:C.name}),s==="projects"&&C.assignee&&l.jsx(Ft,{className:"size-6 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(Ut,{className:"text-[10px]",children:C.assignee.initials||C.assignee.name.substring(0,2).toUpperCase()})}),r&&l.jsx(k.Edit,{className:"size-4 text-muted-foreground cursor-pointer hover:text-primary ml-2 opacity-0 group-hover:opacity-100",onClick:()=>r(C)})]}),l.jsx("div",{className:"relative flex-1 border-b",style:{height:`${a}px`},children:l.jsx(p4,{task:C,timelineStart:p,timelineEnd:h,columnWidth:i,rowHeight:a,onTaskClick:n,onTaskEdit:r})})]},C.id))]},y.id)}),(()=>{const y=new Date;if(y>=p&&y<=h){const C=280+H.differenceInDays(y,p)*i+i/2;return l.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-primary pointer-events-none z-20",style:{left:`${C}px`},children:l.jsx("div",{className:"absolute -top-1 -left-1.5 size-3 rounded-full bg-primary shadow-sm"})})}return null})()]})]})})})]})});m4.displayName="GanttChart";const g4=I.forwardRef(({className:t},e)=>l.jsxs("div",{ref:e,className:w("flex flex-wrap gap-4",t),children:[Object.entries(h4).map(([n,r])=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-3 rounded",r.barColor)}),l.jsx("span",{className:"text-sm text-muted-foreground",children:r.label})]},n)),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"size-3 rotate-45 bg-primary"}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"Marco"})]})]}));g4.displayName="GanttLegend";function U5({...t}){return l.jsx(Gs.Root,{"data-slot":"hover-card",...t})}function _5({...t}){return l.jsx(Gs.Trigger,{"data-slot":"hover-card-trigger",...t})}function J5({className:t,align:e="center",sideOffset:n=4,...r}){return l.jsx(Gs.Portal,{"data-slot":"hover-card-portal",children:l.jsx(Gs.Content,{"data-slot":"hover-card-content",align:e,sideOffset:n,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...r})})}function V5({className:t,containerClassName:e,...n}){return l.jsx(u0.OTPInput,{"data-slot":"input-otp",containerClassName:w("flex items-center gap-2 has-disabled:opacity-50",e),className:w("disabled:cursor-not-allowed",t),...n})}function G5({className:t,...e}){return l.jsx("div",{"data-slot":"input-otp-group",className:w("flex items-center gap-1",t),...e})}function Y5({index:t,className:e,...n}){const r=I.useContext(u0.OTPInputContext),{char:a,hasFakeCaret:i,isActive:s}=(r==null?void 0:r.slots[t])??{};return l.jsxs("div",{"data-slot":"input-otp-slot","data-active":s,className:w("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",e),...n,children:[a,i&&l.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:l.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Q5({...t}){return l.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:l.jsx(k.MinusIcon,{})})}function W5({validationState:t,validate:e,onChange:n,className:r,...a}){const[i,s]=I.useState("idle"),o=t??i;function f(c){if(t===void 0&&e){const d=e(c.target.value);s(d===null?"idle":d?"valid":"invalid")}n==null||n(c)}return l.jsxs("div",{className:"relative flex items-center",children:[l.jsx(Ht,{className:w(o!=="idle"&&"pr-9",r),"aria-invalid":o==="invalid"||void 0,onChange:f,...a}),o==="valid"&&l.jsx(k.CheckCircle2,{className:"absolute right-3 size-4 text-green-600 pointer-events-none","aria-hidden":"true"}),o==="invalid"&&l.jsx(k.XCircle,{className:"absolute right-3 size-4 text-destructive pointer-events-none","aria-hidden":"true"})]})}function uu({className:t,value:e,...n}){return l.jsx(gu.Root,{"data-slot":"progress",className:w("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...n,children:l.jsx(gu.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const $5={low:{color:"bg-blue-500",label:"Baixa",textColor:"text-blue-700",bgColor:"bg-blue-50 dark:bg-blue-950/20"},medium:{color:"bg-yellow-500",label:"Média",textColor:"text-yellow-700",bgColor:"bg-yellow-50 dark:bg-yellow-950/20"},high:{color:"bg-orange-500",label:"Alta",textColor:"text-orange-700",bgColor:"bg-orange-50 dark:bg-orange-950/20"},urgent:{color:"bg-red-500",label:"Urgente",textColor:"text-red-700",bgColor:"bg-red-50 dark:bg-red-950/20"}},b4=I.forwardRef(({title:t,description:e,coverImage:n,thumbnailImage:r,tags:a=[],assignees:i=[],priority:s,dueDate:o,comments:f,attachments:c,checklist:d,progress:u,status:p,variant:h="default",isDragging:m=!1,onClick:g,onEdit:b,onDelete:x,onDuplicate:v,className:j},y)=>{const L=o&&new Date(o)<new Date,C=s?$5[s]:null,N=T=>{const z=T.getDate().toString().padStart(2,"0"),P=(T.getMonth()+1).toString().padStart(2,"0");return`${z}/${P}`},S=T=>{T.target.closest("button")||T.target.closest("[role='menuitem']")||g==null||g()};return l.jsxs(jr,{ref:y,className:w("group cursor-grab active:cursor-grabbing transition-all duration-200","hover:shadow-lg hover:scale-[1.02]",m&&"opacity-50 rotate-2 scale-105 shadow-2xl cursor-grabbing",s&&"border-l-4",s==="low"&&"border-l-blue-500",s==="medium"&&"border-l-yellow-500",s==="high"&&"border-l-orange-500",s==="urgent"&&"border-l-red-500",h==="compact"&&"hover:scale-[1.01]",j),onClick:S,children:[n&&h!=="compact"&&l.jsxs("div",{className:"relative w-full h-40 overflow-hidden rounded-t-lg",children:[l.jsx("img",{src:n,alt:t,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),s&&l.jsx("div",{className:"absolute top-2 right-2",children:l.jsxs(pe,{variant:"secondary",className:w("shadow-sm",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})})]}),l.jsxs(la,{className:w(h==="compact"?"p-3 pb-2":"p-4 pb-3"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[r&&!n&&l.jsx("img",{src:r,alt:t,className:"w-10 h-10 rounded object-cover flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(fa,{className:w("line-clamp-2",h==="compact"?"text-sm":"text-base"),children:t}),p&&h==="detailed"&&l.jsx(pe,{variant:"outline",className:"mt-1 text-xs",children:p})]})]}),e&&h!=="compact"&&l.jsx(m0,{className:"mt-2 line-clamp-2 text-xs",children:e})]}),(b||x||v)&&l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:l.jsx(k.MoreVertical,{className:"h-4 w-4"})})}),l.jsxs(Ui,{align:"end",children:[b&&l.jsx(gr,{onClick:b,children:"Editar"}),v&&l.jsx(gr,{onClick:v,children:"Duplicar"}),x&&l.jsx(gr,{onClick:x,className:"text-destructive",children:"Excluir"})]})]})]}),a.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[a.slice(0,h==="compact"?2:3).map(T=>l.jsx(pe,{variant:"secondary",className:"text-xs",style:T.color?{backgroundColor:T.color+"20",color:T.color,borderColor:T.color+"40"}:void 0,children:T.label},T.id)),a.length>(h==="compact"?2:3)&&l.jsxs(pe,{variant:"secondary",className:"text-xs",children:["+",a.length-(h==="compact"?2:3)]})]}),s&&!n&&h==="detailed"&&l.jsxs(pe,{variant:"secondary",className:w("mt-2 w-fit text-xs",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})]}),u!==void 0&&h!=="compact"&&l.jsx(ca,{className:"px-4 pb-3 pt-0",children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"Progresso"}),l.jsxs("span",{children:[u,"%"]})]}),l.jsx(uu,{value:u,className:"h-1.5"})]})}),l.jsxs(g0,{className:w("flex items-center justify-between gap-2",h==="compact"?"px-3 pb-3 pt-1":"px-4 pb-4 pt-2"),children:[l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground flex-wrap",children:[o&&l.jsxs("div",{className:w("flex items-center gap-1",L&&"text-destructive font-medium"),children:[L&&l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx(k.Calendar,{className:"h-3 w-3"}),l.jsx("span",{children:N(o)})]}),d&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.CheckSquare,{className:"h-3 w-3"}),l.jsxs("span",{children:[d.completed,"/",d.total]})]}),f!==void 0&&f>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.MessageSquare,{className:"h-3 w-3"}),l.jsx("span",{children:f})]}),c!==void 0&&c>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.Paperclip,{className:"h-3 w-3"}),l.jsx("span",{children:c})]})]}),i.length>0&&l.jsxs("div",{className:"flex -space-x-2",children:[i.slice(0,3).map(T=>l.jsxs(Ft,{className:"h-6 w-6 border-2 border-background",children:[T.avatar&&l.jsx(Ln,{src:T.avatar,alt:T.name}),l.jsx(Ut,{className:"text-xs",children:T.initials||T.name.slice(0,2).toUpperCase()})]},T.id)),i.length>3&&l.jsxs("div",{className:"h-6 w-6 rounded-full border-2 border-background bg-muted flex items-center justify-center text-xs",children:["+",i.length-3]})]})]})]})});b4.displayName="KanbanCard";const x4=I.forwardRef(({title:t,primaryContent:e,secondaryContent:n,trendValue:r,trendLabel:a,icon:i=k.Activity,isLoading:s=!1,onClick:o,className:f},c)=>s?l.jsxs(jr,{ref:c,className:f,children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2",children:[l.jsx(Bn,{className:"h-4 w-4 rounded"}),l.jsx(Bn,{className:"h-4 w-24"})]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsx(Bn,{className:"h-8 w-32"}),l.jsx(Bn,{className:"h-3 w-full"})]})]}):l.jsxs(jr,{ref:c,onClick:o,className:w(o&&"cursor-pointer hover:bg-accent/50 transition-colors",f),children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2 text-muted-foreground",children:[l.jsx(i,{className:"h-4 w-4 text-muted-foreground"}),t]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsxs("div",{className:"flex items-baseline flex-wrap gap-2",children:[l.jsx("span",{className:"text-2xl font-bold",children:e}),r!==void 0&&l.jsxs(pe,{variant:"secondary",className:w("px-1.5 py-0 h-auto text-xs",r>0?"text-green-600":"text-red-600"),children:[r>0?l.jsx(k.TrendingUp,{className:"h-3 w-3 mr-0.5 inline"}):l.jsx(k.TrendingDown,{className:"h-3 w-3 mr-0.5 inline"}),a]})]}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}));x4.displayName="KPICard";function Z5(t){return t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`:""}function q5(t){if(!t)return"";try{return new Date(t).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function K5(t,e){if(t.length<=e)return t;const n=t.lastIndexOf(".");if(n===-1)return t.substring(0,e-3)+"...";const r=t.substring(n);return t.substring(0,n).substring(0,e-r.length-3)+"..."+r}function X5({attachments:t,onDownload:e,onRemove:n,onView:r,showDownload:a=!0,showRemove:i=!1,showView:s=!1,maxFilenameLength:o=40,variant:f="compact",emptyMessage:c="Nenhum anexo",isLoading:d=!1,className:u}){const[p,h]=M.useState({}),m=async(g,b,x)=>{if(!x)return;const v=g.chave||g.nomeOriginal;h(j=>({...j,[v]:b}));try{await x(g)}finally{h(j=>({...j,[v]:null}))}};return d?l.jsx("div",{className:w("space-y-2",u),children:[1,2,3].map(g=>l.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded bg-muted/30 animate-pulse",children:[l.jsx("div",{className:"h-4 w-4 bg-muted-foreground/20 rounded"}),l.jsx("div",{className:"h-4 flex-1 bg-muted-foreground/20 rounded"})]},g))}):t.length===0?l.jsx("div",{className:w("text-center py-6 text-sm text-muted-foreground border rounded-lg bg-muted/20",u),children:c}):l.jsx("div",{className:w("space-y-2",u),children:t.map((g,b)=>{const x=g.chave||g.id||`${g.nomeOriginal}-${b}`,v=p[g.chave||g.nomeOriginal],j=v==="download",y=v==="view",L=(()=>{switch(g.status){case"completed":return l.jsx(pe,{variant:"outline",className:"bg-green-50 text-green-600 border-green-200 hover:bg-green-50",children:"✓ Enviado"});case"uploading":return l.jsx(pe,{variant:"outline",className:"bg-blue-50 text-blue-600 border-blue-200 hover:bg-blue-50",children:"Enviando..."});case"failed":return l.jsx(pe,{variant:"outline",className:"bg-red-50 text-red-600 border-red-200 hover:bg-red-50",children:"✗ Erro"});case"retrying":return l.jsx(pe,{variant:"outline",className:"bg-yellow-50 text-yellow-600 border-yellow-200 hover:bg-yellow-50",children:"Tentando..."});default:return null}})();return f==="detailed"?l.jsx("div",{className:w("p-4 border rounded-lg bg-card transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("p",{className:"text-sm font-medium truncate",children:g.nomeOriginal})}),l.jsx(at,{children:l.jsx("p",{children:g.nomeOriginal})})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[g.tamanhoBytes&&l.jsx("span",{children:Z5(g.tamanhoBytes)}),g.tamanhoBytes&&g.dataUpload&&l.jsx("span",{children:"•"}),g.dataUpload&&l.jsx("span",{children:q5(g.dataUpload)})]}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsx(uu,{value:g.progress,className:"h-1 mt-2"}),g.status==="failed"&&g.erro&&l.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-red-600",children:[l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx("span",{children:g.erro})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[L,g.status==="completed"&&l.jsxs(l.Fragment,{children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]})]})]})},x):l.jsxs("div",{className:w("flex items-center justify-between gap-2 p-3 border rounded-lg bg-muted/30 transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("span",{className:"text-sm truncate",children:K5(g.nomeOriginal,o)})}),l.jsx(at,{children:l.jsx("p",{className:"max-w-xs break-all",children:g.nomeOriginal})})]})}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[g.progress,"%"]}),L]}),g.status==="completed"&&l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]}),g.status==="failed"&&g.erro&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(k.AlertCircle,{className:"h-4 w-4 text-red-600 flex-shrink-0"})}),l.jsx(at,{children:l.jsx("p",{children:g.erro})})]})})]},x)})})}function eA({className:t,...e}){return l.jsx(Qe.Root,{"data-slot":"menubar",className:w("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",t),...e})}function tA({...t}){return l.jsx(Qe.Menu,{"data-slot":"menubar-menu",...t})}function nA({...t}){return l.jsx(Qe.Group,{"data-slot":"menubar-group",...t})}function y4({...t}){return l.jsx(Qe.Portal,{"data-slot":"menubar-portal",...t})}function rA({...t}){return l.jsx(Qe.RadioGroup,{"data-slot":"menubar-radio-group",...t})}function aA({className:t,...e}){return l.jsx(Qe.Trigger,{"data-slot":"menubar-trigger",className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",t),...e})}function iA({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...a}){return l.jsx(y4,{children:l.jsx(Qe.Content,{"data-slot":"menubar-content",align:e,alignOffset:n,sideOffset:r,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",t),...a})})}function sA({className:t,inset:e,variant:n="default",...r}){return l.jsx(Qe.Item,{"data-slot":"menubar-item","data-inset":e,"data-variant":n,className:w("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function oA({className:t,children:e,checked:n,...r}){return l.jsxs(Qe.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function lA({className:t,children:e,...n}){return l.jsxs(Qe.RadioItem,{"data-slot":"menubar-radio-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function fA({className:t,inset:e,...n}){return l.jsx(Qe.Label,{"data-slot":"menubar-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8",t),...n})}function cA({className:t,...e}){return l.jsx(Qe.Separator,{"data-slot":"menubar-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function dA({className:t,...e}){return l.jsx("span",{"data-slot":"menubar-shortcut",className:w("text-muted-foreground ml-auto text-xs tracking-widest",t),...e})}function uA({...t}){return l.jsx(Qe.Sub,{"data-slot":"menubar-sub",...t})}function hA({className:t,inset:e,children:n,...r}){return l.jsxs(Qe.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":e,className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",t),...r,children:[n,l.jsx(k.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function pA({className:t,...e}){return l.jsx(Qe.SubContent,{"data-slot":"menubar-sub-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...e})}function mA({className:t,children:e,viewport:n=!0,...r}){return l.jsxs(Er.Root,{"data-slot":"navigation-menu","data-viewport":n,className:w("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...r,children:[e,n&&l.jsx(vA,{})]})}function gA({className:t,...e}){return l.jsx(Er.List,{"data-slot":"navigation-menu-list",className:w("group flex flex-1 list-none items-center justify-center gap-1",t),...e})}function bA({className:t,...e}){return l.jsx(Er.Item,{"data-slot":"navigation-menu-item",className:w("relative",t),...e})}const v4=$t.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function xA({className:t,children:e,...n}){return l.jsxs(Er.Trigger,{"data-slot":"navigation-menu-trigger",className:w(v4(),"group",t),...n,children:[e," ",l.jsx(k.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function yA({className:t,...e}){return l.jsx(Er.Content,{"data-slot":"navigation-menu-content",className:w("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...e})}function vA({className:t,...e}){return l.jsx("div",{className:w("absolute top-full left-0 isolate z-50 flex justify-center"),children:l.jsx(Er.Viewport,{"data-slot":"navigation-menu-viewport",className:w("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...e})})}function wA({className:t,...e}){return l.jsx(Er.Link,{"data-slot":"navigation-menu-link",className:w("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...e})}function MA({title:t,description:e,breadcrumbs:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("border-b bg-background",i),children:[l.jsxs("div",{className:"flex h-14 items-center gap-4 px-6",children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),n&&n.length>0&&l.jsx(z0,{children:l.jsx(O0,{children:n.map((s,o)=>l.jsxs(I.Fragment,{children:[o>0&&l.jsx(H0,{}),l.jsx(P0,{children:o===n.length-1?l.jsx(B0,{children:s.label}):s.href?l.jsx(R0,{href:s.href,children:s.label}):l.jsx("span",{children:s.label})})]},o))})}),!n&&l.jsx("div",{className:"flex-1",children:l.jsx("h1",{className:"text-lg font-semibold",children:t})})]}),e&&l.jsx("div",{className:"border-t px-6 py-3",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}function jA({title:t,icon:e,badge:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("flex h-14 items-center gap-3 border-b bg-background px-6",i),children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),e&&l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:l.jsx(e,{className:"h-4 w-4 text-primary"})}),l.jsx("h1",{className:"flex-1 text-lg font-semibold",children:t}),n&&l.jsx("div",{className:"shrink-0",children:n})]})}function CA({title:t,subtitle:e,actions:n,className:r}){return l.jsxs("div",{className:w("flex items-start justify-between gap-4",r),children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e})]}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]})}function LA({className:t,...e}){return l.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:w("mx-auto flex w-full justify-center",t),...e})}function NA({className:t,...e}){return l.jsx("ul",{"data-slot":"pagination-content",className:w("flex flex-row items-center gap-1",t),...e})}function kA({...t}){return l.jsx("li",{"data-slot":"pagination-item",...t})}function hu({className:t,isActive:e,size:n="icon",...r}){return l.jsx("a",{"aria-current":e?"page":void 0,"data-slot":"pagination-link","data-active":e,className:w(Jn({variant:e?"outline":"ghost",size:n}),t),...r})}function SA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to previous page",size:"default",className:w("gap-1 px-2.5 sm:pl-2.5",t),...e,children:[l.jsx(k.ChevronLeftIcon,{}),l.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function TA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to next page",size:"default",className:w("gap-1 px-2.5 sm:pr-2.5",t),...e,children:[l.jsx("span",{className:"hidden sm:block",children:"Next"}),l.jsx(k.ChevronRightIcon,{})]})}function IA({className:t,...e}){return l.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:w("flex size-9 items-center justify-center",t),...e,children:[l.jsx(k.MoreHorizontalIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]})}const w4=I.forwardRef(({className:t,showToggle:e=!0,...n},r)=>{const[a,i]=I.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:a?"text":"password","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e&&"pr-10",t),ref:r,...n}),e&&l.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",tabIndex:-1,"aria-label":a?"Hide password":"Show password",children:a?l.jsx(k.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(k.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})});w4.displayName="PasswordInput";function DA({className:t,...e}){return l.jsx(Nf.Root,{"data-slot":"radio-group",className:w("grid gap-3",t),...e})}function EA({className:t,...e}){return l.jsx(Nf.Item,{"data-slot":"radio-group-item",className:w("peer h-5 w-5 shrink-0 rounded-full border border-gray-300 bg-white shadow-sm transition-all hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:l.jsx(Nf.Indicator,{"data-slot":"radio-group-indicator",className:"flex items-center justify-center",children:l.jsx("div",{className:"h-2 w-2 rounded-full bg-white"})})})}function AA({className:t,...e}){return l.jsx(Nc.PanelGroup,{"data-slot":"resizable-panel-group",className:w("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function zA({...t}){return l.jsx(Nc.Panel,{"data-slot":"resizable-panel",...t})}function OA({withHandle:t,className:e,...n}){return l.jsx(Nc.PanelResizeHandle,{"data-slot":"resizable-handle",className:w("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(k.GripVerticalIcon,{className:"size-2.5"})})})}function PA({filters:t=[],onSelectFilter:e,onToggleFavorite:n,onDeleteFilter:r,className:a}){const i=t.filter(o=>o.isFavorite),s=t.filter(o=>!o.isFavorite);return l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsxs(F,{variant:"outline",size:"sm",className:w("gap-2",a),children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Filtros salvos",t.length>0&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]})]})}),l.jsx(Ui,{align:"start",className:"w-[280px]",children:t.length===0?l.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:"No saved filters yet"}):l.jsxs(l.Fragment,{children:[i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Favorites"}),i.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id)),s.length>0&&l.jsx(Qs,{})]}),s.length>0&&l.jsxs(l.Fragment,{children:[i.length>0&&l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Todos filtros"}),s.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id))]})]})})]})}function f0({filter:t,onSelect:e,onToggleFavorite:n,onDelete:r}){return l.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 hover:bg-muted rounded-sm group",children:[l.jsx("button",{onClick:a=>{a.stopPropagation(),n==null||n(t.id)},className:"p-1 hover:bg-accent rounded-sm",children:l.jsx(k.Star,{className:w("h-3.5 w-3.5",t.isFavorite?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})}),l.jsxs("button",{onClick:()=>e==null?void 0:e(t.id),className:"flex-1 text-left px-2",children:[l.jsx("div",{className:"text-sm",children:t.name}),t.description&&l.jsx("div",{className:"text-xs text-muted-foreground",children:t.description}),t.filterCount!==void 0&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[t.filterCount," ",t.filterCount===1?"filter":"filters"]})]}),l.jsx("button",{onClick:a=>{a.stopPropagation(),r==null||r(t.id)},className:"p-1 hover:bg-accent rounded-sm opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(k.Trash2,{className:"h-3.5 w-3.5 text-destructive"})})]})}function M4({...t}){return l.jsx(Ae.Root,{"data-slot":"sheet",...t})}function RA({...t}){return l.jsx(Ae.Trigger,{"data-slot":"sheet-trigger",...t})}function BA({...t}){return l.jsx(Ae.Close,{"data-slot":"sheet-close",...t})}function HA({...t}){return l.jsx(Ae.Portal,{"data-slot":"sheet-portal",...t})}const j4=I.forwardRef(({className:t,...e},n)=>l.jsx(Ae.Overlay,{ref:n,"data-slot":"sheet-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));j4.displayName=Ae.Overlay.displayName;function C4({className:t,children:e,side:n="right",...r}){return l.jsxs(HA,{children:[l.jsx(j4,{}),l.jsxs(Ae.Content,{"data-slot":"sheet-content",className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,l.jsxs(Ae.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[l.jsx(k.XIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function L4({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function FA({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}function N4({className:t,...e}){return l.jsx(Ae.Title,{"data-slot":"sheet-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e})}function k4({className:t,...e}){return l.jsx(Ae.Description,{"data-slot":"sheet-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e})}const Lf=768;function S4(){const[t,e]=I.useState(void 0);return I.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Lf-1}px)`),r=()=>{e(window.innerWidth<Lf)};return n.addEventListener("change",r),e(window.innerWidth<Lf),()=>n.removeEventListener("change",r)},[]),!!t}const UA="sidebar_state",_A=3600*24*7,JA="16rem",VA="18rem",GA="3rem",YA="b",T4=I.createContext(null);function rs(){const t=I.useContext(T4);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function QA({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:a,children:i,...s}){const o=S4(),[f,c]=I.useState(!1),[d,u]=I.useState(t),p=e??d,h=I.useCallback(x=>{const v=typeof x=="function"?x(p):x;n?n(v):u(v),document.cookie=`${UA}=${v}; path=/; max-age=${_A}`},[n,p]),m=I.useCallback(()=>o?c(x=>!x):h(x=>!x),[o,h,c]);I.useEffect(()=>{const x=v=>{v.key===YA&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),m())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m]);const g=p?"expanded":"collapsed",b=I.useMemo(()=>({state:g,open:p,setOpen:h,isMobile:o,openMobile:f,setOpenMobile:c,toggleSidebar:m}),[g,p,h,o,f,c,m]);return l.jsx(T4.Provider,{value:b,children:l.jsx(It,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":JA,"--sidebar-width-icon":GA,...a},className:w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:i})})})}function WA({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:a,...i}){const{isMobile:s,state:o,openMobile:f,setOpenMobile:c}=rs();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:w("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:a}):s?l.jsx(M4,{open:f,onOpenChange:c,...i,children:l.jsxs(C4,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":VA},side:t,children:[l.jsxs(L4,{className:"sr-only",children:[l.jsx(N4,{children:"Sidebar"}),l.jsx(k4,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):l.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":o,"data-collapsible":o==="collapsed"?n:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container",className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function $A({className:t,onClick:e,...n}){const{toggleSidebar:r}=rs();return l.jsxs(F,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:w("size-7",t),onClick:a=>{e==null||e(a),r()},...n,children:[l.jsx(k.PanelLeftIcon,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ZA({className:t,...e}){const{toggleSidebar:n}=rs();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:w("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})}function qA({className:t,...e}){return l.jsx("main",{"data-slot":"sidebar-inset",className:w("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...e})}function KA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...e})}function XA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...e})}function e8({className:t,...e}){return l.jsx(Hn,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:w("bg-sidebar-border mx-2 w-auto",t),...e})}function t8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function n8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...e})}function r8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"div";return l.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:w("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function a8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"button";return l.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...n})}function i8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...e})}function s8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-1",t),...e})}function o8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...e})}const l8=$t.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f8({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:a,className:i,...s}){const o=t?kn.Slot:"button",{isMobile:f,state:c}=rs(),d=l.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:w(l8({variant:n,size:r}),i),...s});return a?(typeof a=="string"&&(a={children:a}),l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:d}),l.jsx(at,{side:"right",align:"center",hidden:c!=="collapsed"||f,...a})]})):d}function c8({className:t,asChild:e=!1,showOnHover:n=!1,...r}){const a=e?kn.Slot:"button";return l.jsx(a,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...r})}function d8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e})}function u8({className:t,showIcon:e=!1,...n}){const r=I.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:w("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[e&&l.jsx(Bn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Bn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function h8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:w("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e})}function p8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:w("group/menu-sub-item relative",t),...e})}function m8({asChild:t=!1,size:e="md",isActive:n=!1,className:r,...a}){const i=t?kn.Slot:"a";return l.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})}function I4({className:t,defaultValue:e,value:n,min:r=0,max:a=100,...i}){const s=I.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,a],[n,e,r,a]);return l.jsxs(hs.Root,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:a,className:w("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[l.jsx(hs.Track,{"data-slot":"slider-track",className:w("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:l.jsx(hs.Range,{"data-slot":"slider-range",className:w("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(o,f)=>l.jsx(hs.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},f))]})}const D4=$t.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent hover:text-accent-foreground text-foreground",google:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground",github:"bg-[#24292F] hover:bg-[#24292F]/90 text-white dark:bg-[#24292F] dark:hover:bg-[#24292F]/80",facebook:"bg-[#1877F2] hover:bg-[#1877F2]/90 text-white",apple:"bg-black hover:bg-black/90 text-white dark:bg-white dark:hover:bg-white/90 dark:text-black",microsoft:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),g8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),b8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),x8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),y8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M11.4 11.4H2V2h9.4v9.4z",fill:"#F25022"}),l.jsx("path",{d:"M22 11.4h-9.4V2H22v9.4z",fill:"#7FBA00"}),l.jsx("path",{d:"M11.4 22H2v-9.4h9.4V22z",fill:"#00A4EF"}),l.jsx("path",{d:"M22 22h-9.4v-9.4H22V22z",fill:"#FFB900"})]}),E4=I.forwardRef(({className:t,variant:e,size:n,provider:r,children:a,...i},s)=>{const o=e||r,f=()=>{switch(r){case"google":return l.jsx(g8,{});case"github":return l.jsx(k.Github,{className:"h-5 w-5"});case"facebook":return l.jsx(x8,{});case"apple":return l.jsx(b8,{});case"microsoft":return l.jsx(y8,{});default:return null}},c=()=>`Continue with ${{google:"Google",github:"GitHub",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft"}[r]}`;return l.jsxs("button",{className:w(D4({variant:o,size:n,className:t})),ref:s,...i,children:[f(),l.jsx("span",{children:a||c()})]})});E4.displayName="SocialButton";function A4({className:t,...e}){return l.jsx(bu.Root,{"data-slot":"switch",className:w("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(bu.Thumb,{"data-slot":"switch-thumb",className:w("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const v8=[{value:"not-started",label:"Não iniciada",color:"bg-gray-500"},{value:"in-progress",label:"Em progresso",color:"bg-primary"},{value:"on-hold",label:"Em espera",color:"bg-cyan-500"},{value:"completed",label:"Concluída",color:"bg-green-500"},{value:"delayed",label:"Atrasada",color:"bg-red-500"},{value:"cancelled",label:"Cancelada",color:"bg-orange-500"}];function w8({task:t,open:e,onOpenChange:n,onSave:r,availableTasks:a=[],availableAssignees:i=[]}){var x;const[s,o]=I.useState(null),[f,c]=I.useState(!1),[d,u]=I.useState(!1);if(I.useEffect(()=>{t&&o({...t})},[t]),!s)return null;const p=()=>{r(s),n(!1)},h=(v,j)=>{o(y=>y?{...y,[v]:j}:null)},m=v=>{o(j=>{if(!j)return null;const y=j.dependencies||[],L=y.includes(v)?y.filter(C=>C!==v):[...y,v];return{...j,dependencies:L}})},g=a.filter(v=>v.id!==s.id),b=s.name.trim()!==""&&s.startDate<=s.endDate;return l.jsx(_i,{open:e,onOpenChange:n,children:l.jsxs(Ji,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:"Editar Tarefa"}),l.jsx(Yi,{children:'Altere os detalhes da tarefa abaixo. As mudanças serão salvas ao clicar em "Salvar alterações".'})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-name",children:"Nome da Tarefa *"}),l.jsx(Ht,{id:"task-name",value:s.name,onChange:v=>h("name",v.target.value),placeholder:"Ex: Briefing com cliente"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-description",children:"Descrição"}),l.jsx(ru,{id:"task-description",value:s.description||"",onChange:v=>h("description",v.target.value),placeholder:"Adicione detalhes sobre esta tarefa...",rows:3})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Início *"}),l.jsxs(st,{open:f,onOpenChange:c,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.startDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.startDate?H.format(s.startDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.startDate,onSelect:v=>{v&&(h("startDate",v),c(!1))},initialFocus:!0})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Término *"}),l.jsxs(st,{open:d,onOpenChange:u,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.endDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.endDate?H.format(s.endDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.endDate,onSelect:v=>{v&&(h("endDate",v),u(!1))},disabled:v=>s.startDate?v<s.startDate:!1,initialFocus:!0})})]})]})]}),s.startDate>s.endDate&&l.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900",children:[l.jsx(k.AlertCircle,{className:"size-4 text-red-600 flex-shrink-0"}),l.jsx("p",{className:"text-sm text-red-900 dark:text-red-200",children:"A data de término deve ser posterior à data de início"})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-status",children:"Status"}),l.jsxs(en,{value:s.status,onValueChange:v=>h("status",v),children:[l.jsx(nn,{id:"task-status",children:l.jsx(tn,{})}),l.jsx(rn,{children:v8.map(v=>l.jsx(Dt,{value:v.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-2 rounded-full",v.color)}),v.label]})},v.value))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-assignee",children:"Responsável"}),l.jsxs(en,{value:((x=s.assignee)==null?void 0:x.name)||"",onValueChange:v=>{const j=i.find(y=>y.name===v);h("assignee",j||void 0)},children:[l.jsx(nn,{id:"task-assignee",children:l.jsx(tn,{placeholder:"Selecionar responsável"})}),l.jsx(rn,{children:i.map(v=>l.jsx(Dt,{value:v.name,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.User,{className:"size-4"}),v.name]})},v.name))})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ue,{children:"Progresso"}),l.jsxs("span",{className:"text-sm font-medium",children:[s.progress,"%"]})]}),l.jsx(I4,{value:[s.progress],onValueChange:v=>h("progress",v[0]),max:100,step:5,className:"w-full"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"0%"}),l.jsx("span",{children:"50%"}),l.jsx("span",{children:"100%"})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(Ue,{htmlFor:"milestone-toggle",className:"cursor-pointer",children:"Marco Importante (Milestone)"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Marcos aparecem como losangos no cronograma"})]}),l.jsx(A4,{id:"milestone-toggle",checked:s.milestone||!1,onCheckedChange:v=>h("milestone",v)})]}),g.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.Link2,{className:"size-4 text-muted-foreground"}),l.jsx(Ue,{children:"Dependências"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Selecione as tarefas que precisam ser concluídas antes desta"}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-3",children:g.map(v=>{var y;const j=((y=s.dependencies)==null?void 0:y.includes(v.id))||!1;return l.jsxs("div",{className:w("flex items-center gap-3 p-2 rounded-md cursor-pointer transition-colors",j?"bg-primary/10 border border-primary/20":"hover:bg-muted/50"),onClick:()=>m(v.id),children:[l.jsx("div",{className:w("size-4 rounded border-2 flex items-center justify-center transition-all",j?"bg-primary border-primary":"border-muted-foreground"),children:j&&l.jsx("div",{className:"size-2 rounded-sm bg-white"})}),l.jsx("span",{className:"text-sm flex-1",children:v.name}),v.assignee&&l.jsx(pe,{variant:"outline",className:"text-xs",children:v.assignee.name})]},v.id)})}),s.dependencies&&s.dependencies.length>0&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.dependencies.length," dependência(s) selecionada(s)"]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:()=>n(!1),children:"Cancelar"}),l.jsx(F,{onClick:p,disabled:!b,children:"Salvar alterações"})]})]})})}const M8=t=>{switch(t){case"create":return l.jsx(k.PlusCircle,{className:"h-4 w-4 text-green-600"});case"status_change":return l.jsx(k.RefreshCw,{className:"h-4 w-4 text-blue-600"});case"comment":return l.jsx(k.MessageSquare,{className:"h-4 w-4 text-slate-500"});case"upload":return l.jsx(k.Paperclip,{className:"h-4 w-4 text-orange-600"});case"assignment":return l.jsx(k.User,{className:"h-4 w-4 text-purple-600"});case"update":return l.jsx(k.Pencil,{className:"h-4 w-4 text-amber-600"});default:return l.jsx(k.Circle,{className:"h-4 w-4 text-slate-400"})}},j8=t=>{switch(t){case"create":return"bg-green-50 border-green-200";case"status_change":return"bg-blue-50 border-blue-200";case"comment":return"bg-slate-50 border-slate-200";case"upload":return"bg-orange-50 border-orange-200";case"assignment":return"bg-purple-50 border-purple-200";case"update":return"bg-amber-50 border-amber-200";default:return"bg-slate-50 border-slate-200"}},C8=({event:t,isLast:e,onDetailsOpen:n})=>{var o,f,c,d,u,p,h;const[r,a]=I.useState(!1),i=!!((o=t.metadata)!=null&&o.before||(f=t.metadata)!=null&&f.after||(c=t.metadata)!=null&&c.details),s=m=>{a(m),m&&n&&n(t)};return l.jsxs("div",{className:"flex gap-4 group",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:w("flex items-center justify-center w-8 h-8 rounded-full border shadow-sm z-10 transition-colors","bg-background group-hover:border-primary/50",j8(t.action)),children:M8(t.action)}),!e&&l.jsx("div",{className:"w-px h-full bg-border group-hover:bg-primary/20 transition-colors min-h-[2rem]"})]}),l.jsx("div",{className:"flex-1 pb-8 min-w-0",children:l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/90",children:[l.jsx("span",{className:"font-semibold",children:t.user.name}),l.jsx("span",{className:"text-muted-foreground font-normal",children:t.title})]}),l.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",title:H.format(t.timestamp,"PPpp",{locale:yt}),children:H.formatDistanceToNow(t.timestamp,{addSuffix:!0,locale:yt})})]}),i&&l.jsxs(J0,{open:r,onOpenChange:s,className:"mt-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[t.action==="upload"&&((d=t.metadata)==null?void 0:d.fileName)&&l.jsxs(pe,{variant:"outline",className:"gap-1 font-normal bg-muted/30 text-muted-foreground hover:bg-muted/50",children:[l.jsx(k.FileText,{className:"h-3 w-3"}),t.metadata.fileName]}),l.jsx(V0,{asChild:!0,children:l.jsxs(F,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-primary gap-1",children:[r?"Ocultar detalhes":"Ver detalhes",l.jsx(k.ChevronRight,{className:w("h-3 w-3 transition-transform duration-200",r&&"rotate-90")})]})})]}),l.jsx(G0,{className:"mt-2",children:l.jsxs("div",{className:"rounded-md border bg-muted/30 p-3 text-sm animate-in slide-in-from-top-2 duration-200",children:[(((u=t.metadata)==null?void 0:u.before)||((p=t.metadata)==null?void 0:p.after))&&l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4",children:[t.metadata.before&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background/50 border border-dashed text-muted-foreground line-through text-xs",children:t.metadata.before}),t.metadata.before&&t.metadata.after&&l.jsx(k.ArrowRight,{className:"h-4 w-4 text-muted-foreground hidden sm:block"}),t.metadata.after&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background border border-l-4 border-l-[#7F26BF] shadow-sm text-foreground text-xs font-medium",children:t.metadata.after})]}),((h=t.metadata)==null?void 0:h.details)&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-xs",children:t.metadata.details})]})})]})]})})]})},L8=({events:t,className:e,onDetailsOpen:n})=>l.jsx("div",{className:w("flex flex-col",e),children:t.map((r,a)=>l.jsx(C8,{event:r,isLast:a===t.length-1,onDetailsOpen:n},r.id))});function N8(t){const{theme:e="system"}=Sx.useTheme();return l.jsx(h0.Toaster,{theme:e,className:"toaster group",toastOptions:{unstyled:!0,classNames:{toast:"w-full rounded-lg border px-4 py-3 shadow-lg flex items-start gap-3 bg-card text-card-foreground border-border",title:"font-semibold text-sm leading-[1.2]",description:"text-sm mt-1 leading-relaxed",actionButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-8 px-3",cancelButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-muted text-muted-foreground hover:bg-muted/90 h-8 px-3",closeButton:"absolute right-2 top-2 rounded-md p-1 text-foreground/50 hover:text-foreground",error:"!bg-red-50 dark:!bg-red-950/30 !text-red-700 dark:!text-red-400 !border-red-200 dark:!border-red-800 [&_[data-title]]:text-red-700 dark:[&_[data-title]]:text-red-400 [&_[data-description]]:text-red-700/90 dark:[&_[data-description]]:text-red-400/90",success:"!bg-green-100 dark:!bg-green-950/30 !text-green-800 dark:!text-green-400 !border-green-300 dark:!border-green-800 [&_[data-title]]:text-green-800 dark:[&_[data-title]]:text-green-400 [&_[data-description]]:text-green-800 dark:[&_[data-description]]:text-green-400",warning:"!bg-yellow-50 dark:!bg-yellow-950/30 !text-yellow-700 dark:!text-yellow-400 !border-yellow-200 dark:!border-yellow-800 [&_[data-title]]:text-yellow-700 dark:[&_[data-title]]:text-yellow-400 [&_[data-description]]:text-yellow-700/90 dark:[&_[data-description]]:text-yellow-400/90",info:"!bg-cyan-50 dark:!bg-cyan-950/30 !text-cyan-700 dark:!text-cyan-400 !border-cyan-200 dark:!border-cyan-800 [&_[data-title]]:text-cyan-700 dark:[&_[data-title]]:text-cyan-400 [&_[data-description]]:text-cyan-700/90 dark:[&_[data-description]]:text-cyan-400/90"}},...t})}const z4=I.createContext({size:"default",variant:"default"});function k8({className:t,variant:e,size:n,children:r,...a}){return l.jsx(p0.Root,{"data-slot":"toggle-group","data-variant":e,"data-size":n,className:w("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",t),...a,children:l.jsx(z4.Provider,{value:{variant:e,size:n},children:r})})}function S8({className:t,children:e,variant:n,size:r,...a}){const i=I.useContext(z4);return l.jsx(p0.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,className:w(au({variant:i.variant||n,size:i.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",t),...a,children:e})}const O4=I.createContext(void 0);function P4(){const t=I.useContext(O4);if(!t)throw new Error("UnderlineTabs components must be used within UnderlineTabs");return t}function T8({defaultValue:t,value:e,onValueChange:n,children:r,className:a}){const[i,s]=I.useState(t||""),o=e!==void 0?e:i,f=c=>{e===void 0&&s(c),n==null||n(c)};return l.jsx(O4.Provider,{value:{value:o,onValueChange:f},children:l.jsx("div",{className:w("w-full",a),role:"tablist",children:r})})}function I8({children:t,className:e}){return l.jsx("div",{className:w("border-b border-border bg-background",e),children:l.jsx("div",{className:"flex",children:t})})}function D8({value:t,children:e,className:n,disabled:r=!1}){const{value:a,onValueChange:i}=P4(),s=a===t;return l.jsx("button",{type:"button",role:"tab","aria-selected":s,"aria-disabled":r,disabled:r,onClick:()=>!r&&i(t),className:w("px-4 h-12 text-sm font-medium border-b-2 transition-colors relative","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",s?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-border",n),children:e})}function E8({value:t,children:e,className:n}){const{value:r}=P4();return r!==t?null:l.jsx("div",{role:"tabpanel","aria-labelledby":t,className:w("mt-4",n),children:e})}function A8(t,e){const n=e*1024*1024;return t.size>n?`Arquivo muito grande. Máximo: ${e}MB`:null}function z8(t,e){if(!e)return null;const n=e.split(",").map(s=>s.trim().toLowerCase()),r=t.name.toLowerCase(),a=t.type.toLowerCase();return n.some(s=>{if(s.includes("*")){const[o]=s.split("/");return a.startsWith(o+"/")}return s.startsWith(".")?r.endsWith(s):a===s})?null:"Tipo de arquivo não suportado"}function O8({onFilesSelected:t,accept:e,multiple:n=!0,maxFiles:r=10,maxSizeMB:a=50,disabled:i=!1,isUploading:s=!1,title:o="Clique para fazer upload de arquivos",description:f,icon:c,className:d,onError:u}){const[p,h]=M.useState(!1),m=M.useRef(null),g=M.useCallback(N=>{u==null||u(N)},[u]),b=M.useCallback(N=>{if(!N||N.length===0)return;const S=Array.from(N);if(S.length>r){g(`Máximo de ${r} arquivo(s) permitido(s)`);return}const T=[],z=[];for(const P of S){const U=A8(P,a);if(U){z.push(`${P.name}: ${U}`);continue}const J=z8(P,e);if(J){z.push(`${P.name}: ${J}`);continue}T.push(P)}z.length>0&&g(z.join(`
221
+ `),p.document.close(),p.onload=()=>{setTimeout(()=>{p.print(),p.close(),a==null||a()},250)}}catch(u){i==null||i(u),console.error("Erro ao imprimir contrato:",u)}},downloadPDF:()=>{try{s==null||s(),setTimeout(()=>{console.log("PDF gerado (simulado):",{contractNumber:e,timestamp:new Date().toISOString()}),o==null||o()},1500),console.info("usePrintContract: downloadPDF é uma implementação simulada. Para gerar PDFs reais, integre com html2pdf.js ou jsPDF. Veja a documentação do hook para exemplos.")}catch(u){f==null||f(u),console.error("Erro ao gerar PDF:",u)}}}}function QI({data:t,logo:e,showActions:n=!0,showSummary:r=!0,showServices:a=!0,showInfo:i=!1,className:s,onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}){const h=I.useRef(null),{printContract:m,downloadPDF:g}=j2(h,t.numeroContrato,{onPrintStart:o,onPrintSuccess:f,onPrintError:c,onDownloadStart:d,onDownloadSuccess:u,onDownloadError:p}),b=x=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(x);return l.jsxs("div",{className:w("space-y-6",s),children:[n&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center justify-between",children:[l.jsx("span",{children:"Ações do Documento"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(F,{variant:"outline",size:"sm",onClick:g,className:"gap-2",children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Download PDF"]}),l.jsxs(F,{variant:"default",size:"sm",onClick:m,className:"gap-2",children:[l.jsx(k.Printer,{className:"h-4 w-4"}),"Imprimir"]})]})]})}),r&&l.jsx(ca,{children:l.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Nº do Contrato"}),l.jsx("p",{className:"font-semibold",children:t.numeroContrato})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Cliente"}),l.jsx("p",{className:"font-semibold",children:t.cliente.nome})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground mb-1",children:"Valor do Fee"}),l.jsx("p",{className:"font-semibold",children:b(t.valorFee)})]})]})})]}),l.jsx("div",{className:"bg-white rounded-lg shadow-sm p-8",children:l.jsx("div",{ref:h,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:a})})}),i&&l.jsxs(jr,{className:"no-print",children:[l.jsx(la,{children:l.jsxs(fa,{className:"flex items-center gap-2",children:[l.jsx(k.Eye,{className:"h-5 w-5"}),"Sobre este Template"]})}),l.jsx(ca,{children:l.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Design System:"})," Utiliza a paleta de cores e tipografia do iClips"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Impressão Otimizada:"})," Layout preparado para impressão em A4"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Componentes Reutilizáveis:"})," PrintHeader, PrintFooter, PrintTable, PrintSignature"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Quebras de Página:"})," Configuradas automaticamente para evitar cortes"]}),l.jsxs("p",{children:["✅ ",l.jsx("strong",{children:"Profissional:"})," Layout clean e adequado para documentos legais"]})]})})]})]})}const C2=I.forwardRef(({data:t,logo:e,showServices:n=!0,className:r},a)=>l.jsx("div",{className:w("bg-white rounded-lg shadow-sm p-8",r),ref:a,children:l.jsx(nu,{data:t,showPreview:!0,logo:e,showServices:n})}));C2.displayName="ContractPrintPreview";const Go=I.forwardRef(({className:t,inputClassName:e,containerClassName:n,style:r,value:a,defaultValue:i=0,onChange:s,min:o=Number.MIN_SAFE_INTEGER,max:f=Number.MAX_SAFE_INTEGER,step:c=1,precision:d=0,formatOptions:u,locale:p="pt-BR",allowMouseWheel:h=!1,clampValueOnBlur:m=!0,keepWithinRange:g=!0,showButtons:b=!0,buttonLayout:x="vertical",buttonPosition:v="right",disabled:j,readOnly:y,...L},C)=>{const[N,S]=I.useState(i),[T,z]=I.useState(""),[P,U]=I.useState(!1),J=I.useRef(null),Y=a!==void 0?a:N,K=I.useCallback(B=>u?new Intl.NumberFormat(p,u).format(B):B.toFixed(d),[u,p,d]),E=B=>{const he=B.replace(/[^\d,.-]/g,"").replace(",","."),Oe=parseFloat(he);return isNaN(Oe)?0:Oe},G=B=>g?Math.min(Math.max(B,o),f):B,Z=I.useCallback((B,ee=!1)=>{const he=ee?G(B):B;a===void 0&&S(he),s&&s(he)},[a,s,o,f,g]);I.useEffect(()=>{P||z(K(Y))},[Y,K,P]);const le=()=>{if(j||y)return;const B=Y+c;B<=f&&Z(B)},we=()=>{if(j||y)return;const B=Y-c;B>=o&&Z(B)},Ie=B=>{const he=B.target.value.replace(/[^\d,.-]/g,"");z(he);const Oe=E(he);Z(Oe,!1)},Le=B=>{if(U(!1),m){const ee=G(Y);Z(ee,!1),z(K(ee))}else z(K(Y));L.onBlur&&L.onBlur(B)},V=B=>{U(!0),z(Y.toString()),B.target.select(),L.onFocus&&L.onFocus(B)},q=B=>{j||y||(B.key==="ArrowUp"?(B.preventDefault(),le()):B.key==="ArrowDown"&&(B.preventDefault(),we()),L.onKeyDown&&L.onKeyDown(B))},re=B=>{!h||j||y||!P||(B.preventDefault(),B.deltaY<0?le():B.deltaY>0&&we())};I.useImperativeHandle(C,()=>J.current);const A=()=>{if(!b)return null;const B=l.jsx("button",{type:"button",onClick:le,disabled:j||y||Y>=f,tabIndex:-1,"aria-label":"Increment",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-l-md border-r border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronUp,{className:"h-3 w-3"}):l.jsx(k.Plus,{className:"h-4 w-4"})},"inc"),ee=l.jsx("button",{type:"button",onClick:we,disabled:j||y||Y<=o,tabIndex:-1,"aria-label":"Decrement",className:w("inline-flex items-center justify-center transition-colors","hover:bg-muted active:bg-accent","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",x==="vertical"&&"h-4 w-7 rounded-sm",x==="horizontal"&&"h-9 w-9 rounded-r-md border-l border-input bg-input-background"),children:x==="vertical"?l.jsx(k.ChevronDown,{className:"h-3 w-3"}):l.jsx(k.Minus,{className:"h-4 w-4"})},"dec");if(x==="vertical")return l.jsxs("div",{className:w("flex flex-col items-center justify-center gap-[2px] self-stretch px-1 shrink-0 overflow-hidden",v==="right"?"order-2 border-l border-input rounded-r-md":"order-[-1] border-r border-input rounded-l-md"),children:[B,ee]});if(x==="horizontal")return[ee,B]};return x==="horizontal"&&b?l.jsxs("div",{className:w("inline-flex items-center w-full",n),style:r,children:[A(),l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border-y px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:relative focus-visible:z-10 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","text-center tabular-nums",t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L})]}):l.jsxs("div",{className:w("inline-flex w-full items-stretch",n),style:r,children:[l.jsx("input",{ref:J,type:"text",inputMode:"decimal","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","tabular-nums",b&&x==="vertical"&&v==="right"&&"text-right rounded-r-none border-r-0",b&&x==="vertical"&&v==="left"&&"text-left rounded-l-none border-l-0",!b&&"text-right",e,t),value:T,onChange:Ie,onBlur:Le,onFocus:V,onKeyDown:q,onWheel:re,disabled:j,readOnly:y,"aria-valuemin":o,"aria-valuemax":f,"aria-valuenow":Y,role:"spinbutton",...L}),A()]})});Go.displayName="NumberInput";function ru({className:t,...e}){return l.jsx("textarea",{"data-slot":"textarea",className:w("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function L2({className:t,...e}){return l.jsx("div",{"data-slot":"input-group",role:"group",className:w("group/input-group cn-input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",t),...e})}const WI=$t.cva("cn-input-group-addon flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"cn-input-group-addon-align-inline-start order-first","inline-end":"cn-input-group-addon-align-inline-end order-last","block-start":"cn-input-group-addon-align-block-start order-first w-full justify-start","block-end":"cn-input-group-addon-align-block-end order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function bc({className:t,align:e="inline-start",...n}){return l.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:w(WI({align:e}),t),onClick:r=>{var a,i;r.target.closest("button")||(i=(a=r.currentTarget.parentElement)==null?void 0:a.querySelector("input"))==null||i.focus()},...n})}const $I=$t.cva("flex items-center gap-2 text-sm shadow-none",{variants:{size:{default:"h-7",sm:"h-6",xs:"h-5","icon-xs":"size-5"}},defaultVariants:{size:"default"}});function ZI({className:t,size:e,variant:n="ghost",type:r="button",...a}){return l.jsx(F,{"data-slot":"input-group-button",type:r,variant:n,className:w($I({size:e}),t),...a})}function qI({className:t,...e}){return l.jsx("span",{"data-slot":"input-group-text",className:w("text-muted-foreground text-sm",t),...e})}function KI({className:t,...e}){return l.jsx(Ht,{"data-slot":"input-group-control",className:w("cn-input-group-input flex-1",t),...e})}function XI({className:t,...e}){return l.jsx(ru,{"data-slot":"input-group-control",className:w("cn-input-group-textarea flex-1 resize-none",t),...e})}const eD={BRL:{symbol:"R$",icon:k.Coins,locale:"pt-BR"},USD:{symbol:"$",icon:k.DollarSign,locale:"en-US"},EUR:{symbol:"€",icon:k.Euro,locale:"de-DE"}},N2=I.forwardRef(({className:t,currency:e="BRL",locale:n,showSymbol:r=!1,symbolPosition:a="start",min:i=0,...s},o)=>{const f=eD[e],c=n||f.locale,d=f.icon;return r?l.jsxs(L2,{className:t,children:[a==="start"&&l.jsx(bc,{children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx(Go,{ref:o,className:w("border-none shadow-none ring-0 focus-visible:ring-0 focus-visible:border-transparent",a==="start"?"pl-2":"pr-2"),min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s}),a==="end"&&l.jsx(bc,{align:"inline-end",children:l.jsx(d,{className:"h-4 w-4 text-muted-foreground"})})]}):l.jsx(Go,{ref:o,className:t,min:i,precision:2,formatOptions:{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2},locale:c,...s})});N2.displayName="CurrencyInput";const tD=()=>{const t=new Date;return t.setHours(0,0,0,0),[{label:"Hoje",value:{from:t,to:t}},{label:"Últimos 7 dias",value:{from:H.subDays(t,6),to:t}},{label:"Últimos 30 dias",value:{from:H.subDays(t,29),to:t}},{label:"Este mês",value:{from:H.startOfMonth(t),to:t}},{label:"Mês passado",value:{from:H.startOfMonth(H.subMonths(t,1)),to:H.endOfMonth(H.subMonths(t,1))}}]};function k2({value:t,onChange:e,placeholder:n="Selecione um período",disabled:r=!1,minDate:a,maxDate:i,dateFormat:s="dd/MM/yyyy",locale:o=yt,className:f,error:c=!1,numberOfMonths:d=2,showTime:u=!1,timeFormat:p="24h",minuteStep:h=15,presets:m,showDefaultPresets:g=!0,id:b,name:x}){const[v,j]=I.useState(!1),[y,L]=I.useState(""),[C,N]=I.useState(!1),S=u?`${s} HH:mm`:s,T=I.useMemo(()=>u?["dd/MM/yyyy HH:mm","dd/MM/yy HH:mm","d/M/yyyy HH:mm","d/M/yy HH:mm"]:["dd/MM/yyyy","dd/MM/yy","d/M/yyyy","d/M/yy"],[u]);I.useEffect(()=>{if(t!=null&&t.from){const V=H.format(t.from,S,{locale:o}),q=t.to?H.format(t.to,S,{locale:o}):"";L(q?`${V} → ${q}`:V),N(!1)}else L(""),N(!1)},[t,S,o]);const z=I.useMemo(()=>[...g?tD():[],...m||[]],[m,g]),P=I.useMemo(()=>{if(!(t!=null&&t.from))return"00:00";const V=t.from.getHours().toString().padStart(2,"0"),q=t.from.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.from]),U=I.useMemo(()=>{if(!(t!=null&&t.to))return"23:59";const V=t.to.getHours().toString().padStart(2,"0"),q=t.to.getMinutes().toString().padStart(2,"0");return`${V}:${q}`},[t==null?void 0:t.to]),J=V=>{if(!V){e==null||e(void 0);return}if(u){if(V.from){const[q,re]=P.split(":").map(Number);V.from.setHours(q,re,0,0)}if(V.to){const[q,re]=U.split(":").map(Number);V.to.setHours(q,re,0,0)}}else V.from&&V.from.setHours(0,0,0,0),V.to&&V.to.setHours(23,59,59,999);e==null||e(V)},Y=V=>{if(!(t!=null&&t.from))return;const q=new Date(t.from),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,from:q})},K=V=>{if(!(t!=null&&t.to))return;const q=new Date(t.to),[re,A]=V.split(":").map(Number);q.setHours(re,A,0,0),e==null||e({...t,to:q})},E=V=>{const q={from:new Date(V.value.from),to:new Date(V.value.to)};if(u){const[re,A]=P.split(":").map(Number),[B,ee]=U.split(":").map(Number);q.from.setHours(re,A,0,0),q.to.setHours(B,ee,0,0)}e==null||e(q)},G=V=>{const q=V.trim();if(!q)return null;for(const re of T)try{const A=H.parse(q,re,new Date);if(H.isValid(A)){if(a&&A<a||i&&A>i)continue;return A}}catch{continue}return null},Z=V=>{const q=V.trim();if(!q)return null;const re=["→","-","até","a"];let A=null,B=null;for(const ee of re)if(q.includes(ee)){const he=q.split(ee).map(Oe=>Oe.trim());if(he.length===2&&(A=G(he[0]),B=G(he[1]),A&&B))break}return A||(A=G(q),A&&(B=new Date(A))),!A||!B?null:(A>B&&([A,B]=[B,A]),{from:A,to:B})},le=V=>{const q=V.target.value;L(q),N(!1)},we=()=>{if(!y.trim()){e==null||e(void 0),N(!1);return}const V=Z(y);V?(e==null||e(V),N(!1)):N(!0)},Ie=V=>{if(V.key==="Enter")V.preventDefault(),we(),C||j(!0);else if(V.key==="Escape"){if(V.preventDefault(),t!=null&&t.from){const q=H.format(t.from,S,{locale:o}),re=t.to?H.format(t.to,S,{locale:o}):"";L(re?`${q} → ${re}`:q)}else L("");N(!1)}},Le=V=>{V.stopPropagation(),e==null||e(void 0),L(""),N(!1)};return l.jsxs(st,{open:v,onOpenChange:j,children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"relative w-full",children:[l.jsx(Ht,{id:b,name:x,value:y,onChange:le,onBlur:we,onKeyDown:Ie,placeholder:n,disabled:r,"aria-invalid":c||C,className:w("pr-20",(c||C)&&"border-destructive focus-visible:ring-destructive/20",f)}),l.jsxs("div",{className:"absolute inset-y-0 right-0 flex items-center gap-1 pr-1",children:[y&&!r&&l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",onClick:Le,tabIndex:-1,children:[l.jsx(k.X,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"sr-only",children:"Limpar"})]}),l.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 w-7 p-0 hover:bg-transparent",disabled:r,onClick:()=>j(!0),tabIndex:-1,children:[l.jsx(k.CalendarIcon,{className:"h-4 w-4 text-muted-foreground"}),l.jsx("span",{className:"sr-only",children:"Abrir calendário"})]})]})]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsxs("div",{className:"flex",children:[z.length>0&&l.jsxs("div",{className:"border-r p-3 space-y-1 min-w-[140px]",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Atalhos"}),z.map(V=>l.jsx(F,{variant:"ghost",size:"sm",className:"w-full justify-start text-sm h-8",onClick:()=>E(V),children:V.label},V.label))]}),l.jsxs("div",{children:[l.jsx(Qo,{mode:"range",selected:t,onSelect:J,numberOfMonths:d,disabled:V=>!!(a&&V<a||i&&V>i),locale:o,autoFocus:!0}),u&&(t==null?void 0:t.from)&&(t==null?void 0:t.to)&&l.jsxs("div",{className:"border-t p-3 flex gap-6",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora início"}),l.jsx(mi,{value:P,onChange:Y,format:p,minuteStep:h,variant:"select",showIcon:!1})]}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Hora fim"}),l.jsx(mi,{value:U,onChange:K,format:p,minuteStep:h,variant:"select",showIcon:!1})]})]}),l.jsxs("div",{className:"border-t p-3 flex justify-end gap-2",children:[l.jsx(F,{variant:"outline",size:"sm",onClick:()=>{e==null||e(void 0)},children:"Limpar"}),l.jsx(F,{size:"sm",onClick:()=>j(!1),children:"Confirmar"})]})]})]})})]})}k2.displayName="DateRangePicker";var nD=bN,rD=Se.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),aD=rD;const au=$t.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function S2({className:t,variant:e,size:n,...r}){return l.jsx(Ax.Root,{"data-slot":"toggle",className:w(au({variant:e,size:n,className:t})),...r})}const tt=({onClick:t,isActive:e=!1,disabled:n=!1,children:r,title:a})=>l.jsx(S2,{pressed:e,onPressedChange:t,disabled:n,size:"sm",className:"h-8 w-8 p-0",title:a,children:r}),iD=({editor:t,variant:e})=>{if(!t)return null;const n=()=>{const a=t.getAttributes("link").href,i=window.prompt("URL",a);if(i!==null){if(i===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:i}).run()}},r=()=>{const a=window.prompt("URL da imagem");a&&t.chain().focus().setImage({src:a}).run()};return l.jsxs("div",{className:w("flex flex-wrap items-center gap-1 p-2 border-b bg-muted/30 sticky top-0 z-10",e==="full"?"px-4 py-2":"px-2 py-1"),children:[l.jsxs("div",{className:"flex items-center gap-0.5 mr-2",children:[l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),children:l.jsx(k.Undo,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),children:l.jsx(k.Redo,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t.isActive("heading",{level:1}),title:"Título 1",children:l.jsx(k.Heading1,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t.isActive("heading",{level:2}),title:"Título 2",children:l.jsx(k.Heading2,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t.isActive("heading",{level:3}),title:"Título 3",children:l.jsx(k.Heading3,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"})]}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBold().run(),isActive:t.isActive("bold"),title:"Negrito",children:l.jsx(k.Bold,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleItalic().run(),isActive:t.isActive("italic"),title:"Itálico",children:l.jsx(k.Italic,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleUnderline().run(),isActive:t.isActive("underline"),title:"Sublinhado",children:l.jsx(k.Underline,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:()=>t.chain().focus().toggleStrike().run(),isActive:t.isActive("strike"),title:"Tachado",children:l.jsx(k.Strikethrough,{className:"h-4 w-4"})}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBulletList().run(),isActive:t.isActive("bulletList"),title:"Lista com marcadores",children:l.jsx(k.List,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleOrderedList().run(),isActive:t.isActive("orderedList"),title:"Lista numerada",children:l.jsx(k.ListOrdered,{className:"h-4 w-4"})}),e==="full"&&l.jsxs(l.Fragment,{children:[l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("left").run(),isActive:t.isActive({textAlign:"left"}),title:"Alinhar à esquerda",children:l.jsx(k.AlignLeft,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("center").run(),isActive:t.isActive({textAlign:"center"}),title:"Centralizar",children:l.jsx(k.AlignCenter,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:()=>t.chain().focus().setTextAlign("right").run(),isActive:t.isActive({textAlign:"right"}),title:"Alinhar à direita",children:l.jsx(k.AlignRight,{className:"h-4 w-4"})})]}),l.jsx(Hn,{orientation:"vertical",className:"h-6 mx-1"}),l.jsx(tt,{onClick:()=>t.chain().focus().toggleBlockquote().run(),isActive:t.isActive("blockquote"),title:"Citação",children:l.jsx(k.Quote,{className:"h-4 w-4"})}),l.jsx(tt,{onClick:n,isActive:t.isActive("link"),title:"Link",children:l.jsx(k.Link,{className:"h-4 w-4"})}),e==="full"&&l.jsx(tt,{onClick:r,title:"Imagem",children:l.jsx(k.Image,{className:"h-4 w-4"})})]})};function sD({content:t="",onChange:e,placeholder:n="Comece a escrever...",variant:r="simple",className:a,readOnly:i=!1,label:s}){var c,d;const o=I.useMemo(()=>[Og.configure({heading:{levels:[1,2,3]}}),Pg.configure({HTMLAttributes:{class:"rounded-lg border shadow-sm max-w-full"}}),nD.configure({placeholder:n}),aD.configure({types:["heading","paragraph"]})],[n]),f=ig({extensions:o,content:t,editable:!i,onUpdate:({editor:u})=>{e==null||e(u.getHTML())},editorProps:{attributes:{class:w("prose prose-stone dark:prose-invert max-w-none focus:outline-none","prose-headings:font-semibold prose-headings:tracking-tight","prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl","prose-p:leading-7 prose-p:my-3","prose-blockquote:border-l-4 prose-blockquote:border-primary/50 prose-blockquote:pl-4 prose-blockquote:italic","prose-ul:list-disc prose-ul:pl-6 prose-ol:list-decimal prose-ol:pl-6","prose-img:rounded-lg prose-img:shadow-md prose-img:my-6",r==="full"?"min-h-[400px] p-8":"min-h-[120px] px-3 py-2")}}});return f?l.jsxs("div",{className:w("flex flex-col w-full",a),children:[s&&l.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:s}),l.jsxs("div",{className:w("border rounded-lg bg-background overflow-hidden transition-shadow focus-within:ring-2 focus-within:ring-primary/20",i&&"opacity-80 bg-muted/30 pointer-events-none border-transparent"),children:[!i&&l.jsx(iD,{editor:f,variant:r}),l.jsx("div",{className:w("bg-background relative",r==="full"?"bg-white dark:bg-zinc-950":""),children:l.jsx(od,{editor:f})})]}),!i&&r==="full"&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-1.5 text-right px-1",children:[((d=(c=f.storage.characterCount)==null?void 0:c.words)==null?void 0:d.call(c))||0," palavras"]})]}):null}function oD({...t}){return l.jsx(Kn.Drawer.Root,{"data-slot":"drawer",...t})}const T2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Trigger,{ref:e,"data-slot":"drawer-trigger",...t}));T2.displayName="DrawerTrigger";function lD({...t}){return l.jsx(Kn.Drawer.Portal,{"data-slot":"drawer-portal",...t})}const I2=I.forwardRef(({...t},e)=>l.jsx(Kn.Drawer.Close,{ref:e,"data-slot":"drawer-close",...t}));I2.displayName="DrawerClose";const D2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Overlay,{ref:n,"data-slot":"drawer-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));D2.displayName="DrawerOverlay";const E2=I.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(lD,{"data-slot":"drawer-portal",children:[l.jsx(D2,{}),l.jsxs(Kn.Drawer.Content,{ref:r,"data-slot":"drawer-content",className:w("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[l.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e]})]}));E2.displayName="DrawerContent";function fD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function cD({className:t,...e}){return l.jsx("div",{"data-slot":"drawer-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}const A2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Title,{ref:n,"data-slot":"drawer-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e}));A2.displayName="DrawerTitle";const z2=I.forwardRef(({className:t,...e},n)=>l.jsx(Kn.Drawer.Description,{ref:n,"data-slot":"drawer-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e}));z2.displayName="DrawerDescription";function dD({value:t,options:e,onValueChange:n,onCancel:r,disabled:a=!1,variant:i="default",confirmTitle:s="Confirmar alteração",confirmDescription:o="Tem certeza que deseja alterar este valor?",confirmButtonText:f="Confirmar",cancelButtonText:c="Cancelar",skipConfirmation:d=!1,isLoading:u=!1,renderValue:p,className:h,...m},g){const[b,x]=I.useState(null),[v,j]=I.useState(!1),[y,L]=I.useState(!1),[C,N]=I.useState(!1),S=I.useMemo(()=>e.find(E=>E.value===t),[e,t]),T=I.useMemo(()=>b?e.find(E=>E.value===b):null,[e,b]),z=I.useCallback(E=>{if(E===t){L(!1);return}x(E),L(!1),d?P(E):j(!0)},[t,d]),P=I.useCallback(async E=>{const G=E??b;if(G!=null){N(!0);try{await n(G),j(!1),x(null)}catch(Z){console.error("Error confirming value change:",Z)}finally{N(!1)}}},[b,n]),U=I.useCallback(()=>{j(!1),x(null),r==null||r()},[r]),J=I.useCallback(()=>p&&S?p(t,S):S?l.jsxs(l.Fragment,{children:[S.icon,S.label]}):t,[p,t,S]),Y=(S==null?void 0:S.variant)||i,K=S==null?void 0:S.className;return a?l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsx(pe,{variant:Y,className:K,children:J()})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:g,className:w("inline-flex",h),...m,children:l.jsxs(Hi,{open:y,onOpenChange:L,children:[l.jsx(Fi,{asChild:!0,disabled:u,children:l.jsxs(pe,{variant:Y,className:w("cursor-pointer hover:opacity-80 transition-opacity gap-1.5",u&&"opacity-50 cursor-not-allowed",K),children:[J(),!u&&l.jsx(k.ChevronDown,{className:"h-3 w-3"})]})}),l.jsx(Ui,{align:"start",className:"w-48",children:e.map(E=>l.jsxs(gr,{onClick:()=>z(E.value),className:"gap-2",children:[E.icon&&l.jsx("span",{className:"w-4 h-4",children:E.icon}),l.jsx("span",{className:"flex-1",children:E.label}),E.value===t&&l.jsx(k.Check,{className:"h-4 w-4 text-primary"})]},String(E.value)))})]})}),l.jsx(_i,{open:v,onOpenChange:j,children:l.jsxs(Ji,{children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:s}),l.jsx(Yi,{children:o})]}),T&&l.jsxs("div",{className:"flex items-center gap-3 py-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"De:"}),l.jsxs(pe,{variant:(S==null?void 0:S.variant)||i,className:S==null?void 0:S.className,children:[S==null?void 0:S.icon,(S==null?void 0:S.label)||t]})]}),l.jsx("span",{className:"text-muted-foreground",children:"→"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Para:"}),l.jsxs(pe,{variant:T.variant||i,className:T.className,children:[T.icon,T.label]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:U,disabled:C,children:c}),l.jsx(F,{onClick:()=>P(),disabled:C,children:C?"Confirmando...":f})]})]})})]})}const O2=I.forwardRef(dD);O2.displayName="EditableBadge";function P2({className:t,...e}){return l.jsx(Yo.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",t),...e})}function R2({className:t,...e}){return l.jsx(Yo.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",t),...e})}function _s({className:t,...e}){return l.jsx(Yo.Trigger,{"data-slot":"tabs-trigger",className:w("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function uD({className:t,...e}){return l.jsx(Yo.Content,{"data-slot":"tabs-content",className:w("flex-1 outline-none",t),...e})}const B2=M.createContext({dragDropManager:void 0});function St(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var Yp=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Qp=function(){return Math.random().toString(36).substring(7).split("").join(".")},Wp={INIT:"@@redux/INIT"+Qp(),REPLACE:"@@redux/REPLACE"+Qp()};function hD(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function pD(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(bD(t))return"date";if(gD(t))return"error";var n=mD(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function mD(t){return typeof t.constructor=="function"?t.constructor.name:null}function gD(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function bD(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Zr(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=pD(t)),e}function H2(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?St(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?St(1):"Expected the enhancer to be a function. Instead, received: '"+Zr(n)+"'");return n(H2)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?St(2):"Expected the root reducer to be a function. Instead, received: '"+Zr(t)+"'");var a=t,i=e,s=[],o=s,f=!1;function c(){o===s&&(o=s.slice())}function d(){if(f)throw new Error(process.env.NODE_ENV==="production"?St(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function u(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(4):"Expected the listener to be a function. Instead, received: '"+Zr(g)+"'");if(f)throw new Error(process.env.NODE_ENV==="production"?St(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var b=!0;return c(),o.push(g),function(){if(b){if(f)throw new Error(process.env.NODE_ENV==="production"?St(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");b=!1,c();var v=o.indexOf(g);o.splice(v,1),s=null}}}function p(g){if(!hD(g))throw new Error(process.env.NODE_ENV==="production"?St(7):"Actions must be plain objects. Instead, the actual type was: '"+Zr(g)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof g.type>"u")throw new Error(process.env.NODE_ENV==="production"?St(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(f)throw new Error(process.env.NODE_ENV==="production"?St(9):"Reducers may not dispatch actions.");try{f=!0,i=a(i,g)}finally{f=!1}for(var b=s=o,x=0;x<b.length;x++){var v=b[x];v()}return g}function h(g){if(typeof g!="function")throw new Error(process.env.NODE_ENV==="production"?St(10):"Expected the nextReducer to be a function. Instead, received: '"+Zr(g));a=g,p({type:Wp.REPLACE})}function m(){var g,b=u;return g={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(process.env.NODE_ENV==="production"?St(11):"Expected the observer to be an object. Instead, received: '"+Zr(v)+"'");function j(){v.next&&v.next(d())}j();var y=b(j);return{unsubscribe:y}}},g[Yp]=function(){return this},g}return p({type:Wp.INIT}),r={dispatch:p,subscribe:u,getState:d,replaceReducer:h},r[Yp]=m,r}function ne(t,e,...n){if(xD()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let a=0;r=new Error(e.replace(/%s/g,function(){return n[a++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function xD(){return typeof process<"u"&&process.env.NODE_ENV==="production"}function yD(t,e,n){return e.split(".").reduce((r,a)=>r&&r[a]?r[a]:n||null,t)}function vD(t,e){return t.filter(n=>n!==e)}function F2(t){return typeof t=="object"}function wD(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,s)=>{i===1&&a.push(s)}),a}function MD(t,e){return t.filter(n=>e.indexOf(n)>-1)}const iu="dnd-core/INIT_COORDS",Sl="dnd-core/BEGIN_DRAG",su="dnd-core/PUBLISH_DRAG_SOURCE",Tl="dnd-core/HOVER",Il="dnd-core/DROP",Dl="dnd-core/END_DRAG";function $p(t,e){return{type:iu,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const jD={type:iu,payload:{clientOffset:null,sourceClientOffset:null}};function CD(t){return function(n=[],r={publishSource:!0}){const{publishSource:a=!0,clientOffset:i,getSourceClientOffset:s}=r,o=t.getMonitor(),f=t.getRegistry();t.dispatch($p(i)),LD(n,o,f);const c=SD(n,o);if(c==null){t.dispatch(jD);return}let d=null;if(i){if(!s)throw new Error("getSourceClientOffset must be defined");ND(s),d=s(c)}t.dispatch($p(i,d));const p=f.getSource(c).beginDrag(o,c);if(p==null)return;kD(p),f.pinSource(c);const h=f.getSourceType(c);return{type:Sl,payload:{itemType:h,item:p,sourceId:c,clientOffset:i||null,sourceClientOffset:d||null,isSourcePublic:!!a}}}}function LD(t,e,n){ne(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){ne(n.getSource(r),"Expected sourceIds to be registered.")})}function ND(t){ne(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function kD(t){ne(F2(t),"Item must be an object.")}function SD(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function TD(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ID(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){TD(t,a,n[a])})}return t}function DD(t){return function(n={}){const r=t.getMonitor(),a=t.getRegistry();ED(r),OD(r).forEach((s,o)=>{const f=AD(s,o,a,r),c={type:Il,payload:{dropResult:ID({},n,f)}};t.dispatch(c)})}}function ED(t){ne(t.isDragging(),"Cannot call drop while not dragging."),ne(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function AD(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return zD(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function zD(t){ne(typeof t>"u"||F2(t),"Drop result must either be an object or undefined.")}function OD(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function PD(t){return function(){const n=t.getMonitor(),r=t.getRegistry();RD(n);const a=n.getSourceId();return a!=null&&(r.getSource(a,!0).endDrag(n,a),r.unpinSource()),{type:Dl}}}function RD(t){ne(t.isDragging(),"Cannot call endDrag while not dragging.")}function xc(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function BD(t){return function(n,{clientOffset:r}={}){HD(n);const a=n.slice(0),i=t.getMonitor(),s=t.getRegistry(),o=i.getItemType();return UD(a,s,o),FD(a,i,s),_D(a,i,s),{type:Tl,payload:{targetIds:a,clientOffset:r||null}}}}function HD(t){ne(Array.isArray(t),"Expected targetIds to be an array.")}function FD(t,e,n){ne(e.isDragging(),"Cannot call hover while not dragging."),ne(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const a=t[r];ne(t.lastIndexOf(a)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(a);ne(i,"Expected targetIds to be registered.")}}function UD(t,e,n){for(let r=t.length-1;r>=0;r--){const a=t[r],i=e.getTargetType(a);xc(i,n)||t.splice(r,1)}}function _D(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function JD(t){return function(){if(t.getMonitor().isDragging())return{type:su}}}function VD(t){return{beginDrag:CD(t),publishDragSource:JD(t),hover:BD(t),drop:DD(t),endDrag:PD(t)}}class GD{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...s)=>{const o=i.apply(e,s);typeof o<"u"&&n(o)}}const a=VD(this);return Object.keys(a).reduce((i,s)=>{const o=a[s];return i[s]=r(o),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function YD(t,e){return{x:t.x+e.x,y:t.y+e.y}}function U2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function QD(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:U2(YD(e,r),n)}function WD(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:U2(e,n)}const hi=[],ou=[];hi.__IS_NONE__=!0;ou.__IS_ALL__=!0;function $D(t,e){return t===hi?!1:t===ou||typeof e>"u"?!0:MD(e,t).length>0}class ZD{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;ne(typeof e=="function","listener must be a function."),ne(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const s=this.store.getState(),o=s.stateId;try{o===a||o===a+1&&!$D(s.dirtyHandlerIds,r)||e()}finally{a=o}};return this.store.subscribe(i)}subscribeToOffsetChange(e){ne(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return ne(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(ne(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return xc(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(ne(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!xc(a,i))return!1;const s=this.getTargetIds();if(!s.length)return!1;const o=s.indexOf(e);return r?o===s.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return QD(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return WD(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const Zp=typeof global<"u"?global:self,_2=Zp.MutationObserver||Zp.WebKitMutationObserver;function J2(t){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),t()}}}function qD(t){let e=1;const n=new _2(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const KD=typeof _2=="function"?qD:J2;class XD{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,a=e.length-this.index;r<a;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=KD(this.flush),this.requestErrorThrow=J2(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class eE{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class tE{create(e){const n=this.freeTasks,r=n.length?n.pop():new eE(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const V2=new XD,nE=new tE(V2.registerPendingError);function rE(t){V2.enqueueTask(nE.create(t))}const lu="dnd-core/ADD_SOURCE",fu="dnd-core/ADD_TARGET",cu="dnd-core/REMOVE_SOURCE",El="dnd-core/REMOVE_TARGET";function aE(t){return{type:lu,payload:{sourceId:t}}}function iE(t){return{type:fu,payload:{targetId:t}}}function sE(t){return{type:cu,payload:{sourceId:t}}}function oE(t){return{type:El,payload:{targetId:t}}}function lE(t){ne(typeof t.canDrag=="function","Expected canDrag to be a function."),ne(typeof t.beginDrag=="function","Expected beginDrag to be a function."),ne(typeof t.endDrag=="function","Expected endDrag to be a function.")}function fE(t){ne(typeof t.canDrop=="function","Expected canDrop to be a function."),ne(typeof t.hover=="function","Expected hover to be a function."),ne(typeof t.drop=="function","Expected beginDrag to be a function.")}function yc(t,e){if(e&&Array.isArray(t)){t.forEach(n=>yc(n,!1));return}ne(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var At;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(At||(At={}));let cE=0;function dE(){return cE++}function uE(t){const e=dE().toString();switch(t){case At.SOURCE:return`S${e}`;case At.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function qp(t){switch(t[0]){case"S":return At.SOURCE;case"T":return At.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Kp(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class hE{addSource(e,n){yc(e),lE(n);const r=this.addHandler(At.SOURCE,e,n);return this.store.dispatch(aE(r)),r}addTarget(e,n){yc(e,!0),fE(n);const r=this.addHandler(At.TARGET,e,n);return this.store.dispatch(iE(r)),r}containsHandler(e){return Kp(this.dragSources,e)||Kp(this.dropTargets,e)}getSource(e,n=!1){return ne(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return ne(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return ne(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return qp(e)===At.SOURCE}isTargetId(e){return qp(e)===At.TARGET}removeSource(e){ne(this.getSource(e),"Expected an existing source."),this.store.dispatch(sE(e)),rE(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){ne(this.getTarget(e),"Expected an existing target."),this.store.dispatch(oE(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);ne(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){ne(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=uE(e);return this.types.set(a,n),e===At.SOURCE?this.dragSources.set(a,r):e===At.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const pE=(t,e)=>t===e;function mE(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function gE(t,e,n=pE){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function bE(t=hi,e){switch(e.type){case Tl:break;case lu:case fu:case El:case cu:return hi;case Sl:case su:case Dl:case Il:default:return ou}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,a=wD(n,r);if(!(a.length>0||!gE(n,r)))return hi;const s=r[r.length-1],o=n[n.length-1];return s!==o&&(s&&a.push(s),o&&a.push(o)),a}function xE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){xE(t,a,n[a])})}return t}const Xp={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function vE(t=Xp,e){const{payload:n}=e;switch(e.type){case iu:case Sl:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Tl:return mE(t.clientOffset,n.clientOffset)?t:yE({},t,{clientOffset:n.clientOffset});case Dl:case Il:return Xp;default:return t}}function wE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){wE(t,a,n[a])})}return t}const ME={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jE(t=ME,e){const{payload:n}=e;switch(e.type){case Sl:return qr({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case su:return qr({},t,{isSourcePublic:!0});case Tl:return qr({},t,{targetIds:n.targetIds});case El:return t.targetIds.indexOf(n.targetId)===-1?t:qr({},t,{targetIds:vD(t.targetIds,n.targetId)});case Il:return qr({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Dl:return qr({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function CE(t=0,e){switch(e.type){case lu:case fu:return t+1;case cu:case El:return t-1;default:return t}}function LE(t=0){return t+1}function NE(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kE(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){NE(t,a,n[a])})}return t}function SE(t={},e){return{dirtyHandlerIds:bE(t.dirtyHandlerIds,{type:e.type,payload:kE({},e.payload,{prevTargetIds:yD(t,"dragOperation.targetIds",[])})}),dragOffset:vE(t.dragOffset,e),refCount:CE(t.refCount,e),dragOperation:jE(t.dragOperation,e),stateId:LE(t.stateId)}}function TE(t,e=void 0,n={},r=!1){const a=IE(r),i=new ZD(a,new hE(a)),s=new GD(a,i),o=t(s,e,n);return s.receiveBackend(o),s}function IE(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return H2(SE,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function DE(t,e){if(t==null)return{};var n=EE(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function EE(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i<r.length;i++)a=r[i],!(e.indexOf(a)>=0)&&(n[a]=t[a]);return n}let e0=0;const Js=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var G2=M.memo(function(e){var{children:n}=e,r=DE(e,["children"]);const[a,i]=AE(r);return M.useEffect(()=>{if(i){const s=Y2();return++e0,()=>{--e0===0&&(s[Js]=null)}}},[]),l.jsx(B2.Provider,{value:a,children:n})});function AE(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=zE(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function zE(t,e=Y2(),n,r){const a=e;return a[Js]||(a[Js]={dragDropManager:TE(t,e,n,r)}),a[Js]}function Y2(){return typeof global<"u"?global:window}function OE(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xf,t0;function PE(){return t0||(t0=1,xf=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var s=i[a];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),xf}var RE=PE();const BE=OE(RE),Ir=typeof window<"u"?M.useLayoutEffect:M.useEffect;function HE(t,e,n){const[r,a]=M.useState(()=>e(t)),i=M.useCallback(()=>{const s=e(t);BE(r,s)||(a(s),n&&n())},[r,t,n]);return Ir(i),[r,i]}function FE(t,e,n){const[r,a]=HE(t,e,n);return Ir(function(){const s=t.getHandlerId();if(s!=null)return t.subscribeToStateChange(a,{handlerIds:[s]})},[t,a]),r}function Q2(t,e,n){return FE(e,t||(()=>({})),()=>n.reconnect())}function W2(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),M.useMemo(()=>typeof t=="function"?t():t,n)}function UE(t){return M.useMemo(()=>t.hooks.dragSource(),[t])}function _E(t){return M.useMemo(()=>t.hooks.dragPreview(),[t])}let yf=!1,vf=!1;class JE{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){ne(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}isDragging(){if(!this.sourceId)return!1;ne(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let wf=!1;class VE{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;ne(!wf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return wf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{wf=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function GE(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function YE(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function vc(t,e,n,r){let a;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),s=Object.keys(e);if(i.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(e);for(let f=0;f<i.length;f++){const c=i[f];if(!o(c))return!1;const d=t[c],u=e[c];if(a=void 0,a===!1||a===void 0&&d!==u)return!1}return!0}function wc(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function QE(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function WE(t){return(e=null,n=null)=>{if(!M.isValidElement(e)){const i=e;return t(i,n),i}const r=e;return QE(r),$E(r,n?i=>t(i,n):t)}}function $2(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=WE(r);e[n]=()=>a}}),e}function n0(t,e){typeof t=="function"?t(e):t.current=e}function $E(t,e){const n=t.ref;return ne(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?M.cloneElement(t,{ref:r=>{n0(n,r),n0(e,r)}}):M.cloneElement(t,{ref:e})}class ZE{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vc(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vc(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=$2({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,wc(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,wc(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class qE{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vc(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=$2({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,wc(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Ia(){const{dragDropManager:t}=M.useContext(B2);return ne(t!=null,"Expected drag drop context"),t}function KE(t,e){const n=Ia(),r=M.useMemo(()=>new ZE(n.getBackend()),[n]);return Ir(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),Ir(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function XE(){const t=Ia();return M.useMemo(()=>new JE(t),[t])}class e5{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function t5(t,e,n){const r=M.useMemo(()=>new e5(t,e,n),[e,n]);return M.useEffect(()=>{r.spec=t},[t]),r}function n5(t){return M.useMemo(()=>{const e=t.type;return ne(e!=null,"spec.type must be defined"),e},[t])}function r5(t,e,n){const r=Ia(),a=t5(t,e,n),i=n5(t);Ir(function(){if(i!=null){const[o,f]=YE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f}},[r,e,n,a,i])}function a5(t,e){const n=W2(t,e);ne(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=XE(),a=KE(n.options,n.previewOptions);return r5(n,r,a),[Q2(n.collect,r,a),UE(a),_E(a)]}function i5(t){return M.useMemo(()=>t.hooks.dropTarget(),[t])}function s5(t){const e=Ia(),n=M.useMemo(()=>new qE(e.getBackend()),[e]);return Ir(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function o5(){const t=Ia();return M.useMemo(()=>new VE(t),[t])}function l5(t){const{accept:e}=t;return M.useMemo(()=>(ne(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class f5{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function c5(t,e){const n=M.useMemo(()=>new f5(t,e),[e]);return M.useEffect(()=>{n.spec=t},[t]),n}function d5(t,e,n){const r=Ia(),a=c5(t,e),i=l5(t);Ir(function(){const[o,f]=GE(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),f},[r,e,a,n,i.map(s=>s.toString()).join("|")])}function du(t,e){const n=W2(t,e),r=o5(),a=s5(n.options);return d5(n,r,a),[Q2(n.collect,r,a),i5(a)]}function Z2(t){let e=null;return()=>(e==null&&(e=t()),e)}function u5(t,e){return t.filter(n=>n!==e)}function h5(t,e){const n=new Set,r=i=>n.add(i);t.forEach(r),e.forEach(r);const a=[];return n.forEach(i=>a.push(i)),a}class p5{enter(e){const n=this.entered.length,r=a=>this.isNodeInDocument(a)&&(!a.contains||a.contains(e));return this.entered=h5(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=u5(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class m5{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const a=this.config.exposeProperties[r];a!=null&&(n[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const q2="__NATIVE_FILE__",K2="__NATIVE_URL__",X2="__NATIVE_TEXT__",e4="__NATIVE_HTML__",r0=Object.freeze(Object.defineProperty({__proto__:null,FILE:q2,HTML:e4,TEXT:X2,URL:K2},Symbol.toStringTag,{value:"Module"}));function Mf(t,e,n){const r=e.reduce((a,i)=>a||t.getData(i),"");return r??n}const Mc={[q2]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[e4]:{exposeProperties:{html:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[K2]:{exposeProperties:{urls:(t,e)=>Mf(t,e,"").split(`
222
+ `),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[X2]:{exposeProperties:{text:(t,e)=>Mf(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function g5(t,e){const n=Mc[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new m5(n);return r.loadDataTransfer(e),r}function jf(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Mc).filter(n=>{const r=Mc[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(a=>e.indexOf(a)>-1):!1})[0]||null}const b5=Z2(()=>/firefox/i.test(navigator.userAgent)),t4=Z2(()=>!!window.safari);class a0{interpolate(e){const{xs:n,ys:r,c1s:a,c2s:i,c3s:s}=this;let o=n.length-1;if(e===n[o])return r[o];let f=0,c=s.length-1,d;for(;f<=c;){d=Math.floor(.5*(f+c));const h=n[d];if(h<e)f=d+1;else if(h>e)c=d-1;else return r[d]}o=Math.max(0,c);const u=e-n[o],p=u*u;return r[o]+a[o]*u+i[o]*p+s[o]*u*p}constructor(e,n){const{length:r}=e,a=[];for(let h=0;h<r;h++)a.push(h);a.sort((h,m)=>e[h]<e[m]?-1:1);const i=[],s=[];let o,f;for(let h=0;h<r-1;h++)o=e[h+1]-e[h],f=n[h+1]-n[h],i.push(o),s.push(f/o);const c=[s[0]];for(let h=0;h<i.length-1;h++){const m=s[h],g=s[h+1];if(m*g<=0)c.push(0);else{o=i[h];const b=i[h+1],x=o+b;c.push(3*x/((x+b)/m+(x+o)/g))}}c.push(s[s.length-1]);const d=[],u=[];let p;for(let h=0;h<c.length-1;h++){p=s[h];const m=c[h],g=1/i[h],b=m+c[h+1]-p-p;d.push((p-m-b)*g),u.push(b*g*g)}this.xs=e,this.ys=n,this.c1s=c,this.c2s=d,this.c3s=u}}const x5=1;function n4(t){const e=t.nodeType===x5?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Ds(t){return{x:t.clientX,y:t.clientY}}function y5(t){var e;return t.nodeName==="IMG"&&(b5()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function v5(t,e,n,r){let a=t?e.width:n,i=t?e.height:r;return t4()&&t&&(i/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:i}}function w5(t,e,n,r,a){const i=y5(e),o=n4(i?t:e),f={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:d}=t,{anchorX:u,anchorY:p}=r,{dragPreviewWidth:h,dragPreviewHeight:m}=v5(i,e,c,d),g=()=>{let C=new a0([0,.5,1],[f.y,f.y/d*m,f.y+m-d]).interpolate(p);return t4()&&i&&(C+=(window.devicePixelRatio-1)*m),C},b=()=>new a0([0,.5,1],[f.x,f.x/c*h,f.x+h-c]).interpolate(u),{offsetX:x,offsetY:v}=a,j=x===0||x,y=v===0||v;return{x:j?x:b(),y:y?v:g()}}class M5{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}}function j5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i0(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){j5(t,a,n[a])})}return t}class C5{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const a=s=>this.handleDragStart(s,e),i=s=>this.handleSelectStart(s);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=s=>this.handleDragEnter(s,e),a=s=>this.handleDragOver(s,e),i=s=>this.handleDrop(s,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",a),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return i0({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return i0({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(r0).some(n=>r0[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=g5(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&n4(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=a=>!!(a&&this.document&&this.document.body&&this.document.body.contains(a)),this.endDragIfSourceWasRemovedFromDOM=()=>{const a=this.currentDragSourceNode;a==null||this.isNodeInDocument(a)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=a=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(a||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=a=>{if(a.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const s=Ds(a);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:s});const{dataTransfer:o}=a,f=jf(o);if(this.monitor.isDragging()){if(o&&typeof o.setDragImage=="function"){const d=this.monitor.getSourceId(),u=this.sourceNodes.get(d),p=this.sourcePreviewNodes.get(d)||u;if(p){const{anchorX:h,anchorY:m,offsetX:g,offsetY:b}=this.getCurrentSourcePreviewNodeOptions(),j=w5(u,p,s,{anchorX:h,anchorY:m},{offsetX:g,offsetY:b});o.setDragImage(p,j.x,j.y)}}try{o==null||o.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(a.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(f)this.beginDragNativeItem(f);else{if(o&&!o.types&&(a.target&&!a.target.hasAttribute||!a.target.hasAttribute("draggable")))return;a.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=a=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}if(!this.enterLeaveCounter.enter(a.target)||this.monitor.isDragging())return;const{dataTransfer:o}=a,f=jf(o);f&&this.beginDragNativeItem(f,o)},this.handleTopDragEnter=a=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=a.altKey,i.length>0&&this.actions.hover(i,{clientOffset:Ds(a)}),i.some(o=>this.monitor.canDropOnTarget(o))&&(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=a=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}},this.handleTopDragOver=a=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none");return}this.altKeyPressed=a.altKey,this.lastClientOffset=Ds(a),this.scheduleHover(i),(i||[]).some(o=>this.monitor.canDropOnTarget(o))?(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?a.preventDefault():(a.preventDefault(),a.dataTransfer&&(a.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=a=>{this.isDraggingNativeItem()&&a.preventDefault(),this.enterLeaveCounter.leave(a.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=a=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;a.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(a.dataTransfer)}else jf(a.dataTransfer)&&a.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=a=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:Ds(a)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=a=>{const i=a.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(a.preventDefault(),i.dragDrop()))},this.options=new M5(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new p5(this.isNodeInDocument)}}const r4=function(e,n,r){return new C5(e,n,r)},Bi={TASK:"task"},a4={instagram:k.Instagram,linkedin:k.Linkedin,facebook:k.Facebook,twitter:k.Twitter,youtube:k.Youtube,blog:k.Calendar,other:k.Calendar},Cf={instagram:"text-pink-600",linkedin:"text-blue-700",facebook:"text-blue-600",twitter:"text-sky-500",youtube:"text-red-600",blog:"text-orange-500",other:"text-gray-500"},jc={idea:"bg-gray-100 text-gray-600 border-gray-200",planned:"bg-blue-50 text-blue-600 border-blue-200","in-progress":"bg-yellow-50 text-yellow-600 border-yellow-200",approval:"bg-purple-50 text-purple-600 border-purple-200",scheduled:"bg-green-50 text-green-600 border-green-200",published:"bg-slate-800 text-white border-slate-700"},s0=["bg-blue-50 border-blue-100 text-blue-700","bg-green-50 border-green-100 text-green-700","bg-purple-50 border-purple-100 text-purple-700","bg-orange-50 border-orange-100 text-orange-700","bg-pink-50 border-pink-100 text-pink-700","bg-yellow-50 border-yellow-100 text-yellow-700"],o0=t=>{const e=t.split("").reduce((n,r)=>n+r.charCodeAt(0),0);return s0[e%s0.length]};function Al({task:t,view:e="month",mode:n="editorial",onClick:r,style:a}){var p;const[{isDragging:i},s]=a5(()=>({type:Bi.TASK,item:{id:t.id,type:Bi.TASK},collect:h=>({isDragging:!!h.isDragging()})}),[t.id]),o=t.channel?a4[t.channel]:k.Calendar,f=t.date?new Date(t.date):null,c=t.endDate?new Date(t.endDate):f?H.addHours(f,1):null,d=f?H.format(f,"HH:mm"):null,u=f&&c?`${H.format(f,"HH:mm")} - ${H.format(c,"HH:mm")}`:d;return n==="editorial"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-3 overflow-hidden",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-gray-50/50",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(o,{size:14,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),d&&l.jsx("span",{className:"text-xs font-medium text-gray-500",children:d})]}),l.jsx("div",{className:"opacity-0 group-hover:opacity-100 text-gray-400 cursor-grab",children:l.jsx(k.GripVertical,{size:14})})]}),t.imageUrl&&l.jsx("div",{className:"w-full aspect-video bg-gray-100 relative border-b",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"p-3",children:[l.jsx("h4",{className:"text-sm font-medium text-gray-900 line-clamp-2 mb-2 leading-snug",children:t.title}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(pe,{variant:"outline",className:w("px-1.5 py-0 text-[10px] h-5 font-normal uppercase tracking-wide",jc[t.status]),children:t.status}),t.assignees&&t.assignees.length>0&&l.jsx("div",{className:"flex -space-x-2",children:t.assignees.slice(0,2).map((h,m)=>l.jsxs(Ft,{className:"w-5 h-5 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))})]})]})]}):n==="editorial"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-1 overflow-hidden flex items-center gap-2 p-1.5",i?"opacity-50":"opacity-100",t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]"),children:[t.imageUrl&&l.jsx("div",{className:"w-8 h-8 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsx("div",{className:"min-w-0 flex-1",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-xs",children:t.title})]})})]}):n==="execution"&&(e==="week"||e==="day")?l.jsxs("div",{ref:s,onClick:r,style:a,className:w("absolute z-10 rounded-md border shadow-sm p-1.5 text-xs flex flex-col overflow-hidden hover:overflow-visible hover:h-auto! hover:min-h-[min-content] hover:z-50 transition-all cursor-pointer group",i?"opacity-50":"opacity-100",t.color||o0(t.id)),children:[l.jsxs("div",{className:"flex items-center gap-1 mb-0.5 font-semibold opacity-75 text-[10px] leading-none",children:[l.jsx(k.Clock,{size:10}),l.jsx("span",{className:"truncate",children:u})]}),l.jsx("div",{className:"font-bold leading-tight mb-1 line-clamp-2 text-[11px]",children:t.title}),l.jsxs("div",{className:"mt-auto flex items-center justify-between pt-1",children:[l.jsx("div",{className:"flex -space-x-1.5",children:(p=t.assignees)==null?void 0:p.map((h,m)=>l.jsxs(Ft,{className:"w-4 h-4 border border-white",children:[l.jsx(Ln,{src:h.avatar}),l.jsx(Ut,{className:"text-[8px]",children:h.name[0]})]},m))}),t.status!=="published"&&l.jsx("div",{className:w("w-2 h-2 rounded-full",jc[t.status].split(" ")[1].replace("text-","bg-"))})]})]}):n==="execution"&&e==="month"?l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer rounded px-2 py-1 mb-1 text-xs truncate font-medium transition-all",i?"opacity-50":"opacity-100",t.color||o0(t.id).replace("bg-","bg-opacity-20 bg-")),children:[d," ",t.title]}):l.jsxs("div",{ref:s,onClick:r,className:w("relative group cursor-pointer bg-white border rounded-md shadow-sm hover:shadow-md transition-all mb-2 p-2 flex items-start gap-3",i?"opacity-50":"opacity-100",n==="editorial"&&(t.status==="published"?"border-l-4 border-l-slate-800":"border-l-4 border-l-[#7F26BF]")),children:[n==="editorial"&&t.imageUrl&&l.jsx("div",{className:"w-10 h-10 flex-shrink-0 bg-gray-100 rounded overflow-hidden",children:l.jsx("img",{src:t.imageUrl,alt:"",className:"w-full h-full object-cover"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[n==="editorial"&&l.jsx(o,{size:12,className:w(t.channel?Cf[t.channel]:"text-gray-400")}),l.jsx("span",{className:"truncate font-medium text-sm",children:t.title})]}),l.jsx(pe,{variant:"secondary",className:"text-[10px] h-4 px-1 py-0",children:t.status})]})]})}function L5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,view:i}){return l.jsx("div",{className:w("grid h-full min-h-[calc(100vh-200px)] bg-gray-50/30",i==="week"?"grid-cols-7 divide-x":"grid-cols-1 border-x"),children:t.map(s=>{const o=e.filter(f=>f.date&&H.isSameDay(new Date(f.date),s)).sort((f,c)=>f.date&&c.date?new Date(f.date).getTime()-new Date(c.date).getTime():0);return l.jsx(N5,{day:s,tasks:o,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:H.isToday(s)},s.toISOString())})})}function N5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isToday:i}){const[{isOver:s},o]=du(()=>({accept:Bi.TASK,drop:f=>n(f.id,t),collect:f=>({isOver:!!f.isOver()})}),[t,n]);return l.jsxs("div",{ref:o,className:w("flex flex-col h-full min-h-0 transition-colors",s&&"bg-purple-50 ring-inset ring-2 ring-[#7F26BF]"),children:[l.jsxs("div",{className:w("p-2 text-center border-b bg-white sticky top-0 z-10",i&&"bg-purple-50/50"),children:[l.jsx("div",{className:"text-xs font-semibold uppercase text-gray-500 mb-1",children:H.format(t,"EEE")}),l.jsx("div",{className:w("w-8 h-8 rounded-full flex items-center justify-center mx-auto text-sm font-medium",i?"bg-[#7F26BF] text-white":"text-gray-900 bg-gray-100"),children:H.format(t,"d")})]}),l.jsxs("div",{className:"flex-1 p-2 space-y-3 overflow-y-auto",children:[l.jsxs(F,{variant:"outline",size:"sm",className:"w-full mb-2 justify-center px-1",onClick:()=>a(t),children:[l.jsx(k.Plus,{size:12,className:"flex-shrink-0"}),l.jsx("span",{className:"truncate ml-1.5 hidden xl:inline",children:"Add Post"}),l.jsx("span",{className:"truncate ml-1.5 inline xl:hidden",children:"Add"})]}),e.map(f=>l.jsx(Al,{task:f,view:"week",mode:"editorial",onClick:()=>r(f)},f.id))]})]})}function k5({days:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a}){const i=Array.from({length:24},(s,o)=>o);return l.jsxs("div",{className:"flex h-full relative overflow-y-auto bg-white select-none",children:[l.jsxs("div",{className:"w-14 flex-shrink-0 border-r bg-white sticky left-0 z-30",children:[l.jsx("div",{className:"h-10 border-b bg-white sticky top-0 z-40 flex-shrink-0"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b text-right pr-2 pt-2 text-xs text-gray-400 font-medium relative",children:l.jsx("span",{className:"-top-2.5 relative",children:H.format(H.setHours(new Date,s),"ha")})},s))]}),l.jsxs("div",{className:"flex flex-1 min-w-0 relative",children:[t.map((s,o)=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),s));return l.jsx(S5,{day:s,tasks:f,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:o===t.length-1,HOURS:i},s.toISOString())}),l.jsxs("div",{className:"absolute inset-0 pointer-events-none z-0",children:[l.jsx("div",{className:"h-10 border-b bg-transparent"})," ",i.map(s=>l.jsx("div",{className:"h-24 border-b border-dashed border-gray-100 w-full"},s))]})]})]})}function S5({day:t,tasks:e,onDropTask:n,onTaskClick:r,onAddClick:a,isLast:i,HOURS:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:(c,d)=>{n(c.id,t)},collect:c=>({isOver:!!c.isOver()})}),[t,n]);return l.jsxs("div",{ref:f,className:w("flex-1 relative min-w-[150px]",!i&&"border-r",o&&"bg-blue-50/30"),children:[l.jsx("div",{className:"sticky top-0 z-20 bg-white border-b h-10 flex items-center justify-center shadow-sm",children:l.jsxs("div",{className:"text-xs font-bold text-gray-500",children:[H.format(t,"EEE")," ",l.jsx("span",{className:w("ml-1",H.isToday(t)&&"text-blue-600"),children:H.format(t,"d")})]})}),s.map(c=>l.jsx("div",{className:"h-24 w-full absolute hover:bg-gray-50/50 transition-colors cursor-pointer z-10",style:{top:`${c*96+40}px`},onClick:d=>{d.stopPropagation();const u=new Date(t);u.setHours(c,0),a(u)}},c)),e.map(c=>{const d=c.date?new Date(c.date):new Date,u=c.endDate?new Date(c.endDate):H.addHours(d,1),p=H.getHours(d),h=H.getMinutes(d);let m=H.differenceInMinutes(u,d);m<30&&(m=30);const g=p*96+h/60*96+40,b=m/60*96;return l.jsx(Al,{task:c,view:"week",mode:"execution",onClick:()=>r(c),style:{top:`${g}px`,height:`${b}px`,left:"4px",right:"4px",position:"absolute"}},c.id)})]})}function i4({days:t,tasks:e,currentDate:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){return l.jsx("div",{className:"grid grid-cols-7 auto-rows-fr min-h-[800px]",children:t.map(o=>{const f=e.filter(c=>c.date&&H.isSameDay(new Date(c.date),o));return l.jsx(T5,{date:o,tasks:f,isCurrentMonth:H.isSameMonth(o,n),onDropTask:r,onTaskClick:a,onAddClick:i,mode:s},o.toISOString())})})}function T5({date:t,tasks:e,isCurrentMonth:n,onDropTask:r,onTaskClick:a,onAddClick:i,mode:s}){const[{isOver:o},f]=du(()=>({accept:Bi.TASK,drop:d=>r(d.id,t),collect:d=>({isOver:!!d.isOver()})}),[t,r]),c=H.isToday(t);return l.jsxs("div",{ref:f,className:w("min-h-[120px] border-b border-r p-2 relative transition-colors group flex flex-col",!n&&"bg-gray-50/50 text-gray-400",o&&"bg-purple-50 ring-2 ring-inset ring-[#7F26BF]",c&&"bg-purple-50/30"),children:[l.jsxs("div",{className:"flex justify-between items-start mb-2",children:[l.jsx("span",{className:w("text-sm font-medium rounded-full w-7 h-7 flex items-center justify-center",c?"bg-[#7F26BF] text-white":"text-gray-700"),children:H.format(t,"d")}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>i(t),children:l.jsx(k.Plus,{size:14})})]}),l.jsx("div",{className:"flex-1 flex flex-col gap-1",children:e.map(d=>l.jsx(Al,{task:d,view:"month",mode:s,onClick:()=>a(d)},d.id))})]})}function s4({isOpen:t,onClose:e,task:n,onSave:r,isNew:a=!1}){const[i,s]=M.useState(n||{});M.useMemo(()=>{s(n||{})},[n]);const o=()=>{r(i),e()};return l.jsx(_i,{open:t,onOpenChange:f=>!f&&e(),children:l.jsxs(Ji,{className:"sm:max-w-[600px]",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:a?"Create New Task":"Edit Task"}),l.jsx(Yi,{children:a?"Enter the details for the new task below.":"Modify the details of the selected task."})]}),l.jsxs("div",{className:"grid gap-6 py-4",children:[l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"title",className:"text-right text-sm font-medium",children:"Title"}),l.jsx("input",{id:"title",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.title||"",onChange:f=>s({...i,title:f.target.value}),placeholder:"e.g. New Feature Announcement"})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{className:"text-right text-sm font-medium",children:"Time"}),l.jsxs("div",{className:"col-span-3 flex gap-2 items-center",children:[l.jsx("input",{type:"date",className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):typeof i.date=="string"?i.date.split("T")[0]:"",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?i.date:new Date,u=new Date(`${c}T${H.format(d,"HH:mm")}`);s({...i,date:u})}}),l.jsx("span",{className:"text-sm text-gray-500",children:"at"}),l.jsx("input",{type:"time",className:"w-32 flex h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.date instanceof Date?H.format(i.date,"HH:mm"):"09:00",onChange:f=>{const c=f.target.value,d=i.date instanceof Date?H.format(i.date,"yyyy-MM-dd"):H.format(new Date,"yyyy-MM-dd");s({...i,date:new Date(`${d}T${c}`)})}})]})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"channel",className:"text-right text-sm font-medium",children:"Channel / Category"}),l.jsx("select",{id:"channel",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.channel||"instagram",onChange:f=>s({...i,channel:f.target.value}),children:Object.keys(a4).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[l.jsx("label",{htmlFor:"status",className:"text-right text-sm font-medium",children:"Status"}),l.jsx("select",{id:"status",className:"col-span-3 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm",value:i.status||"idea",onChange:f=>s({...i,status:f.target.value}),children:Object.keys(jc).map(f=>l.jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))})]}),l.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[l.jsx("label",{htmlFor:"description",className:"text-right text-sm font-medium pt-2",children:"Description"}),l.jsx("textarea",{id:"description",className:"col-span-3 flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:i.description||"",onChange:f=>s({...i,description:f.target.value}),placeholder:"Details about this post..."})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:e,children:"Cancel"}),l.jsx(F,{className:"bg-[#7F26BF] hover:bg-[#6E21A6]",onClick:o,children:"Save Changes"})]})]})})}function o4({tasks:t,onTaskUpdate:e,onTaskCreate:n,defaultView:r="month"}){const[a,i]=M.useState(new Date),[s,o]=M.useState(r),[f,c]=M.useState(!0),[d,u]=M.useState(!1),[p,h]=M.useState(null),[m,g]=M.useState(!1),b=M.useMemo(()=>{let z,P;if(s==="month"){const U=H.startOfMonth(a),J=H.endOfMonth(U);z=H.startOfWeek(U),P=H.endOfWeek(J)}else s==="week"?(z=H.startOfWeek(a),P=H.endOfWeek(a)):(z=a,P=a);return H.eachDayOfInterval({start:z,end:P})},[a,s]),x=t.filter(z=>!z.date),v=t.filter(z=>z.date);return{currentDate:a,view:s,setView:o,isSidebarOpen:f,setIsSidebarOpen:c,isModalOpen:d,setIsModalOpen:u,editingTask:p,isNewTask:m,calendarDays:b,unplannedTasks:x,scheduledTasks:v,handlePrev:()=>{i(s==="month"?H.subMonths(a,1):s==="week"?H.addDays(a,-7):H.addDays(a,-1))},handleNext:()=>{i(s==="month"?H.addMonths(a,1):s==="week"?H.addDays(a,7):H.addDays(a,1))},handleToday:()=>i(new Date),handleDropTask:(z,P,U)=>{const J=t.find(Y=>Y.id===z);if(J){let Y=new Date(P);if(s==="month"||U==="editorial")if(J.date){const E=new Date(J.date);Y.setHours(E.getHours(),E.getMinutes())}else Y.setHours(9,0);const K={...J,date:Y};e(K)}},handleTaskClick:z=>{h(z),g(!1),u(!0)},handleAddClick:z=>{const P=z||new Date;H.getHours(P)===0&&H.getMinutes(P)===0&&P.setHours(9,0),h({date:P,status:"idea",channel:"instagram"}),g(!0),u(!0)},handleModalSave:z=>{m?n&&n(z):z.id&&e(z),u(!1)}}}function l4({isOpen:t,setIsOpen:e,tasks:n,onAddClick:r,onTaskClick:a,mode:i}){return t?l.jsxs("div",{className:"w-72 border-r bg-gray-50/50 flex flex-col transition-all duration-300 flex-shrink-0",children:[l.jsxs("div",{className:"p-4 border-b bg-white flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-semibold text-sm text-gray-900",children:"Backlog"}),l.jsx(pe,{variant:"secondary",className:"bg-gray-100 text-xs",children:n.length})]}),l.jsx(F,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>e(!1),children:l.jsx(k.PanelLeftClose,{size:16})})]}),l.jsx("div",{className:"px-4 pt-3 bg-white pb-3 border-b space-y-2",children:l.jsxs(F,{onClick:r,variant:"outline",size:"sm",className:"w-full justify-start pl-2",children:[l.jsx(k.Plus,{size:12,className:"mr-1.5"})," New Task"]})}),l.jsx(Wo,{className:"flex-1 p-3",children:l.jsx("div",{className:"space-y-2",children:n.length===0?l.jsx("div",{className:"text-center py-10 px-4 border-2 border-dashed border-gray-200 rounded-lg",children:l.jsx("p",{className:"text-xs text-gray-400",children:"No unscheduled items"})}):n.map(s=>l.jsx(Al,{task:s,view:"backlog",mode:i,onClick:()=>a(s)},s.id))})})]}):l.jsxs("div",{className:"border-r bg-white flex flex-col items-center py-4 w-12 flex-shrink-0 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>e(!0),children:[l.jsx(k.PanelLeftOpen,{className:"text-gray-500 mb-4",size:20}),l.jsx("div",{className:"flex-1 flex items-center justify-center min-h-0",children:l.jsx("div",{className:"whitespace-nowrap text-xs font-medium text-gray-400 -rotate-90 transform",children:"BACKLOG"})}),l.jsx(pe,{className:"mt-2 h-5 w-5 p-0 flex items-center justify-center rounded-full bg-[#7F26BF] text-[10px]",children:n.length})]})}function f4({title:t,onPrev:e,onNext:n,onToday:r,onAdd:a,view:i,setView:s}){return l.jsxs("div",{className:"flex flex-col xl:flex-row items-center justify-between p-4 border-b gap-4 flex-shrink-0 bg-white",children:[l.jsxs("div",{className:"flex items-center gap-4 w-full xl:w-auto justify-between xl:justify-start",children:[l.jsxs("div",{className:"flex items-center border rounded-md bg-white shadow-sm",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:e,className:"h-8 w-8 rounded-r-none",children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx(F,{variant:"ghost",onClick:r,className:"h-8 px-3 rounded-none border-x text-sm font-medium hover:bg-gray-50",children:"Today"}),l.jsx(F,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8 rounded-l-none",children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx("h2",{className:"text-lg font-bold text-gray-900 whitespace-nowrap",children:t})]}),l.jsxs("div",{className:"flex items-center gap-3 w-full xl:w-auto overflow-x-auto pb-1 xl:pb-0 justify-end",children:[l.jsx(P2,{value:i,onValueChange:o=>s(o),className:"flex-shrink-0",children:l.jsxs(R2,{className:"h-9",children:[l.jsx(_s,{value:"month",className:"text-xs",children:"Month"}),l.jsx(_s,{value:"week",className:"text-xs",children:"Week"}),l.jsx(_s,{value:"day",className:"text-xs",children:"Day"})]})}),l.jsxs(F,{variant:"default",className:"h-9 px-4 flex-shrink-0",onClick:a,children:[l.jsx(k.Plus,{className:"mr-2 h-4 w-4"})," Create"]})]})]})}function c4({days:t}){return l.jsx("div",{className:"grid grid-cols-7 border-b bg-gray-50 flex-shrink-0 divide-x",children:t.slice(0,7).map((e,n)=>l.jsx("div",{className:"py-2 text-center group",children:l.jsx("div",{className:w("text-xs font-semibold uppercase tracking-wider",H.isToday(e)?"text-[#7F26BF]":"text-gray-500"),children:H.format(e,"EEE")})},n))})}function I5(t){const e=o4({...t,defaultView:"month"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"editorial"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"editorial"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"editorial"}):l.jsx(L5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"editorial"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,view:e.view})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}function D5(t){const e=o4({...t,defaultView:"week"});return l.jsx(G2,{backend:r4,children:l.jsxs("div",{className:w("flex h-[calc(100vh-100px)] bg-background border rounded-lg overflow-hidden shadow-sm",t.className),children:[l.jsx(l4,{isOpen:e.isSidebarOpen,setIsOpen:e.setIsSidebarOpen,tasks:e.unplannedTasks,onAddClick:()=>e.handleAddClick(),onTaskClick:e.handleTaskClick,mode:"execution"}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-white",children:[l.jsx(f4,{title:e.view==="day"?H.format(e.currentDate,"MMM d, yyyy"):H.format(e.currentDate,"MMMM yyyy"),onPrev:e.handlePrev,onNext:e.handleNext,onToday:e.handleToday,onAdd:()=>e.handleAddClick(e.currentDate),view:e.view,setView:e.setView,mode:"execution"}),e.view==="month"&&l.jsx(c4,{days:e.calendarDays}),l.jsx("div",{className:"flex-1 overflow-hidden flex flex-col relative",children:e.view==="month"?l.jsx(i4,{days:e.calendarDays,tasks:e.scheduledTasks,currentDate:e.currentDate,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick,mode:"execution"}):l.jsx(k5,{days:e.calendarDays,tasks:e.scheduledTasks,onDropTask:(n,r)=>e.handleDropTask(n,r,"execution"),onTaskClick:e.handleTaskClick,onAddClick:e.handleAddClick})})]}),e.isModalOpen&&l.jsx(s4,{isOpen:e.isModalOpen,onClose:()=>e.setIsModalOpen(!1),task:e.editingTask||{},onSave:e.handleModalSave,isNew:e.isNewTask})]})})}const E5=Vs.FormProvider,d4=I.createContext({}),A5=({...t})=>l.jsx(d4.Provider,{value:{name:t.name},children:l.jsx(Vs.Controller,{...t})}),ns=()=>{const t=I.useContext(d4),e=I.useContext(u4),{getFieldState:n}=Vs.useFormContext(),r=Vs.useFormState({name:t.name}),a=n(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},u4=I.createContext({});function z5({className:t,...e}){const n=I.useId();return l.jsx(u4.Provider,{value:{id:n},children:l.jsx("div",{"data-slot":"form-item",className:w("grid gap-2",t),...e})})}function O5({className:t,...e}){const{error:n,formItemId:r}=ns();return l.jsx(Ue,{"data-slot":"form-label","data-error":!!n,className:w("data-[error=true]:text-destructive",t),htmlFor:r,...e})}function P5({...t}){const{error:e,formItemId:n,formDescriptionId:r,formMessageId:a}=ns();return l.jsx(kn.Slot,{"data-slot":"form-control",id:n,"aria-describedby":e?`${r} ${a}`:`${r}`,"aria-invalid":!!e,...t})}function R5({className:t,...e}){const{formDescriptionId:n}=ns();return l.jsx("p",{"data-slot":"form-description",id:n,className:w("text-muted-foreground text-sm",t),...e})}function B5({className:t,...e}){const{error:n,formMessageId:r}=ns(),a=n?String((n==null?void 0:n.message)??""):e.children;return a?l.jsx("p",{"data-slot":"form-message",id:r,className:w("text-destructive text-sm",t),...e,children:a}):null}const h4={"not-started":{label:"Não iniciada",icon:k.Circle,variant:"outline",barColor:"bg-gray-300 dark:bg-gray-600"},"in-progress":{label:"Em progresso",icon:k.Clock,variant:"default",barColor:"bg-primary"},"on-hold":{label:"Em espera",icon:k.AlertCircle,variant:"secondary",barColor:"bg-cyan-500"},completed:{label:"Concluída",icon:k.CheckCircle2,variant:"outline",barColor:"bg-green-500"},delayed:{label:"Atrasada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-red-500"},cancelled:{label:"Cancelada",icon:k.AlertCircle,variant:"destructive",barColor:"bg-orange-500"}},l0=["#7F26BF","#0086E6","#24B347","#F26924","#E91E63","#9C27B0","#00BCD4","#FF9800"];function H5(t,e,n,r,a){const i=H.differenceInDays(r,n),s=H.differenceInDays(t,n),o=H.differenceInDays(e,t)+1,f=s/i*100,c=o/i*100;return{left:f,width:c}}const p4=I.memo(({task:t,timelineStart:e,timelineEnd:n,columnWidth:r,rowHeight:a,onTaskClick:i,onTaskEdit:s})=>{const{left:o,width:f}=H5(t.startDate,t.endDate,e,n),c=h4[t.status],d=c.icon;return t.milestone?l.jsxs("div",{className:"absolute group/milestone",style:{left:`${o}%`,top:"50%",transform:"translateY(-50%)"},children:[l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("div",{className:w("w-4 h-4 rotate-45 cursor-pointer transition-all hover:scale-125",c.barColor),onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Milestone: ${t.name}`})}),l.jsx(at,{side:"top",className:"max-w-sm",children:l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"font-medium",children:t.name}),l.jsx("p",{className:"text-xs opacity-90",children:"📍 Marco importante"}),l.jsxs("p",{className:"text-xs opacity-90",children:["📅 ",H.format(t.startDate,"dd/MM/yyyy",{locale:yt})]})]})})]}),s&&l.jsx("button",{className:"absolute -right-6 top-1/2 -translate-y-1/2 opacity-0 group-hover/milestone:opacity-100 transition-opacity bg-background border rounded p-1 shadow-md hover:bg-primary hover:text-primary-foreground",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar marco",children:l.jsx(k.Edit,{className:"size-3"})})]}):l.jsxs(st,{children:[l.jsx($e,{asChild:!0,children:l.jsxs("div",{className:"absolute group/task cursor-pointer",style:{left:`${o}%`,width:`${f}%`,top:"20%",height:"60%"},onClick:()=>i==null?void 0:i(t),role:"button",tabIndex:0,"aria-label":`Task: ${t.name}, Status: ${c.label}, Progress: ${t.progress}%`,children:[l.jsx("div",{className:w("absolute inset-0 rounded-lg transition-all",c.barColor,"group-hover/task:shadow-lg group-hover/task:scale-[1.02]","opacity-90 group-hover/task:opacity-100")}),t.progress>0&&l.jsx("div",{className:"absolute inset-0 rounded-lg bg-white/20 dark:bg-black/20",style:{clipPath:`inset(0 ${100-t.progress}% 0 0)`}}),l.jsxs("div",{className:"absolute inset-0 flex items-center px-2 gap-1.5",children:[l.jsx(d,{className:"size-3 text-white flex-shrink-0"}),l.jsx("span",{className:"text-xs text-white truncate",children:t.name}),t.assignee&&l.jsx("div",{className:"ml-auto flex-shrink-0",children:l.jsx(Ft,{className:"size-5 border border-white/50",children:l.jsx(Ut,{className:"bg-white/20 text-white text-[8px]",children:t.assignee.initials||t.assignee.name.substring(0,2).toUpperCase()})})})]}),s&&l.jsx("button",{className:"absolute -right-7 top-1/2 -translate-y-1/2 opacity-0 group-hover/task:opacity-100 transition-opacity bg-background border rounded p-1.5 shadow-lg hover:bg-primary hover:text-primary-foreground z-20",onClick:u=>{u.stopPropagation(),s(t)},"aria-label":"Editar tarefa",children:l.jsx(k.Edit,{className:"size-3.5"})})]})}),l.jsx(Ze,{className:"w-80",align:"start",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium mb-1",children:t.name}),t.description&&l.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Calendar,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.format(t.startDate,"dd/MM/yyyy",{locale:yt})," -"," ",H.format(t.endDate,"dd/MM/yyyy",{locale:yt})]})]}),l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.Clock,{className:"size-4 text-muted-foreground"}),l.jsxs("span",{children:[H.differenceInDays(t.endDate,t.startDate)+1," dias"]})]}),t.assignee&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(k.User,{className:"size-4 text-muted-foreground"}),l.jsx("span",{children:t.assignee.name})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs(pe,{variant:c.variant,className:"gap-1",children:[l.jsx(d,{className:"size-3"}),c.label]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.progress,"% concluído"]})]})]})})]})});p4.displayName="TaskRow";const F5=["DOM","SEG","TER","QUA","QUI","SEX","SAB"],m4=I.forwardRef(({tasks:t,projects:e=[],onTaskClick:n,onTaskEdit:r,rowHeight:a=48,columnWidth:i=40,groupBy:s="projects"},o)=>{const[f,c]=I.useState(new Date),[d,u]=I.useState(new Set),p=H.startOfMonth(f),h=H.endOfMonth(f),m=H.eachDayOfInterval({start:p,end:h}),g=()=>c(H.subMonths(f,1)),b=()=>c(H.addMonths(f,1)),x=()=>c(new Date),v=I.useMemo(()=>{if(s==="assignees"){const y=new Map;return t.forEach(C=>{var S;const N=((S=C.assignee)==null?void 0:S.name)||"Sem responsável";y.has(N)||y.set(N,[]),y.get(N).push(C)}),Array.from(y.entries()).map(([C,N],S)=>{var T,z,P;return{id:C,name:C,color:(T=N[0])!=null&&T.assignee?l0[S%l0.length]:"#999",initials:((P=(z=N[0])==null?void 0:z.assignee)==null?void 0:P.initials)||"??",tasks:N}})}else{const y=new Map;return t.forEach(L=>{const C=L.projectId;y.has(C)||y.set(C,[]),y.get(C).push(L)}),e.length>0?e.map(C=>({...C,tasks:y.get(C.id)||[]})).filter(C=>C.tasks.length>0):[{id:"default",name:"Tarefas",color:"#7F26BF",tasks:t}]}},[t,e,s]),j=y=>{u(L=>{const C=new Set(L);return C.has(y)?C.delete(y):C.add(y),C})};return l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(F,{variant:"ghost",size:"icon",onClick:g,children:l.jsx(k.ChevronLeft,{className:"h-4 w-4"})}),l.jsx("h2",{className:"text-lg font-bold min-w-[200px] text-center",children:H.format(f,"MMMM yyyy",{locale:yt})}),l.jsx(F,{variant:"ghost",size:"icon",onClick:b,children:l.jsx(k.ChevronRight,{className:"h-4 w-4"})})]}),l.jsx(F,{variant:"outline",size:"sm",onClick:x,children:"Hoje"})]}),l.jsx("div",{ref:o,className:w("gantt-chart overflow-hidden rounded-lg border bg-card flex flex-col"),role:"grid","aria-label":"Gantt Chart",children:l.jsx("div",{className:"overflow-auto max-h-[600px] relative",children:l.jsxs("div",{style:{minWidth:"max-content"},children:[l.jsxs("div",{className:"sticky top-0 z-40 flex bg-background border-b shadow-sm",children:[l.jsx("div",{className:"sticky left-0 z-50 border-r bg-background flex items-center px-4",style:{width:"280px",height:"50px"},children:l.jsx("span",{className:"font-medium text-sm",children:s==="assignees"?"Colaboradores":"Tarefas"})}),l.jsx("div",{className:"flex",children:m.map(y=>{const L=H.isWeekend(y);return l.jsx("div",{className:w("flex-shrink-0 border-r text-center bg-background",L&&"bg-muted/20"),style:{width:`${i}px`},children:l.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-0.5 py-1",children:[l.jsx("span",{className:"text-[10px] font-bold leading-none text-foreground",children:F5[y.getDay()]}),l.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:H.format(y,"d",{locale:yt})})]})},y.toISOString())})})]}),l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute inset-0 flex pointer-events-none pl-[280px]",children:m.map(y=>{const L=H.isWeekend(y),C=H.isSameDay(y,new Date);return l.jsx("div",{className:w("flex-shrink-0 h-full",L&&"bg-muted/10",C&&"bg-primary/5"),style:{width:`${i}px`}},`grid-${y.toISOString()}`)})}),v.map(y=>{const L=d.has(y.id);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex sticky-container",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 border-b hover:bg-muted/50 transition-colors cursor-pointer",style:{height:`${a}px`},onClick:()=>j(y.id),children:[L?l.jsx(k.ChevronRight,{className:"size-4 text-muted-foreground"}):l.jsx(k.ChevronDown,{className:"size-4 text-muted-foreground"}),s==="assignees"&&y.initials?l.jsx(Ft,{className:"size-6",children:l.jsx(Ut,{style:{backgroundColor:y.color},className:"text-white text-[10px]",children:y.initials})}):l.jsx("div",{className:"size-3 rounded-full flex-shrink-0",style:{backgroundColor:y.color||"var(--primary)"}}),l.jsx("span",{className:"font-medium text-sm truncate",children:y.name}),l.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:y.tasks.length})]}),l.jsx("div",{className:"flex-1 border-b",style:{height:`${a}px`}})]}),!L&&y.tasks.map(C=>l.jsxs("div",{className:"flex sticky-container group",children:[l.jsxs("div",{className:"sticky left-0 z-30 w-[280px] border-r bg-background flex items-center gap-2 px-3 py-2 pl-9 border-b hover:bg-muted/20 transition-colors",style:{height:`${a}px`},children:[l.jsx("div",{className:w("size-2 rounded-full flex-shrink-0",C.milestone&&"rotate-45"),style:{backgroundColor:y.color}}),l.jsx("span",{className:"text-sm truncate flex-1",children:C.name}),s==="projects"&&C.assignee&&l.jsx(Ft,{className:"size-6 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(Ut,{className:"text-[10px]",children:C.assignee.initials||C.assignee.name.substring(0,2).toUpperCase()})}),r&&l.jsx(k.Edit,{className:"size-4 text-muted-foreground cursor-pointer hover:text-primary ml-2 opacity-0 group-hover:opacity-100",onClick:()=>r(C)})]}),l.jsx("div",{className:"relative flex-1 border-b",style:{height:`${a}px`},children:l.jsx(p4,{task:C,timelineStart:p,timelineEnd:h,columnWidth:i,rowHeight:a,onTaskClick:n,onTaskEdit:r})})]},C.id))]},y.id)}),(()=>{const y=new Date;if(y>=p&&y<=h){const C=280+H.differenceInDays(y,p)*i+i/2;return l.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-primary pointer-events-none z-20",style:{left:`${C}px`},children:l.jsx("div",{className:"absolute -top-1 -left-1.5 size-3 rounded-full bg-primary shadow-sm"})})}return null})()]})]})})})]})});m4.displayName="GanttChart";const g4=I.forwardRef(({className:t},e)=>l.jsxs("div",{ref:e,className:w("flex flex-wrap gap-4",t),children:[Object.entries(h4).map(([n,r])=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-3 rounded",r.barColor)}),l.jsx("span",{className:"text-sm text-muted-foreground",children:r.label})]},n)),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"size-3 rotate-45 bg-primary"}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"Marco"})]})]}));g4.displayName="GanttLegend";function U5({...t}){return l.jsx(Gs.Root,{"data-slot":"hover-card",...t})}function _5({...t}){return l.jsx(Gs.Trigger,{"data-slot":"hover-card-trigger",...t})}function J5({className:t,align:e="center",sideOffset:n=4,...r}){return l.jsx(Gs.Portal,{"data-slot":"hover-card-portal",children:l.jsx(Gs.Content,{"data-slot":"hover-card-content",align:e,sideOffset:n,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...r})})}function V5({className:t,containerClassName:e,...n}){return l.jsx(u0.OTPInput,{"data-slot":"input-otp",containerClassName:w("flex items-center gap-2 has-disabled:opacity-50",e),className:w("disabled:cursor-not-allowed",t),...n})}function G5({className:t,...e}){return l.jsx("div",{"data-slot":"input-otp-group",className:w("flex items-center gap-1",t),...e})}function Y5({index:t,className:e,...n}){const r=I.useContext(u0.OTPInputContext),{char:a,hasFakeCaret:i,isActive:s}=(r==null?void 0:r.slots[t])??{};return l.jsxs("div",{"data-slot":"input-otp-slot","data-active":s,className:w("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",e),...n,children:[a,i&&l.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:l.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Q5({...t}){return l.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:l.jsx(k.MinusIcon,{})})}function W5({validationState:t,validate:e,onChange:n,className:r,...a}){const[i,s]=I.useState("idle"),o=t??i;function f(c){if(t===void 0&&e){const d=e(c.target.value);s(d===null?"idle":d?"valid":"invalid")}n==null||n(c)}return l.jsxs("div",{className:"relative flex items-center",children:[l.jsx(Ht,{className:w(o!=="idle"&&"pr-9",r),"aria-invalid":o==="invalid"||void 0,onChange:f,...a}),o==="valid"&&l.jsx(k.CheckCircle2,{className:"absolute right-3 size-4 text-green-600 pointer-events-none","aria-hidden":"true"}),o==="invalid"&&l.jsx(k.XCircle,{className:"absolute right-3 size-4 text-destructive pointer-events-none","aria-hidden":"true"})]})}function uu({className:t,value:e,...n}){return l.jsx(gu.Root,{"data-slot":"progress",className:w("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...n,children:l.jsx(gu.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})})}const $5={low:{color:"bg-blue-500",label:"Baixa",textColor:"text-blue-700",bgColor:"bg-blue-50 dark:bg-blue-950/20"},medium:{color:"bg-yellow-500",label:"Média",textColor:"text-yellow-700",bgColor:"bg-yellow-50 dark:bg-yellow-950/20"},high:{color:"bg-orange-500",label:"Alta",textColor:"text-orange-700",bgColor:"bg-orange-50 dark:bg-orange-950/20"},urgent:{color:"bg-red-500",label:"Urgente",textColor:"text-red-700",bgColor:"bg-red-50 dark:bg-red-950/20"}},b4=I.forwardRef(({title:t,description:e,coverImage:n,thumbnailImage:r,tags:a=[],assignees:i=[],priority:s,dueDate:o,comments:f,attachments:c,checklist:d,progress:u,status:p,variant:h="default",isDragging:m=!1,onClick:g,onEdit:b,onDelete:x,onDuplicate:v,className:j},y)=>{const L=o&&new Date(o)<new Date,C=s?$5[s]:null,N=T=>{const z=T.getDate().toString().padStart(2,"0"),P=(T.getMonth()+1).toString().padStart(2,"0");return`${z}/${P}`},S=T=>{T.target.closest("button")||T.target.closest("[role='menuitem']")||g==null||g()};return l.jsxs(jr,{ref:y,className:w("group cursor-grab active:cursor-grabbing transition-all duration-200","hover:shadow-lg hover:scale-[1.02]",m&&"opacity-50 rotate-2 scale-105 shadow-2xl cursor-grabbing",s&&"border-l-4",s==="low"&&"border-l-blue-500",s==="medium"&&"border-l-yellow-500",s==="high"&&"border-l-orange-500",s==="urgent"&&"border-l-red-500",h==="compact"&&"hover:scale-[1.01]",j),onClick:S,children:[n&&h!=="compact"&&l.jsxs("div",{className:"relative w-full h-40 overflow-hidden rounded-t-lg",children:[l.jsx("img",{src:n,alt:t,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}),s&&l.jsx("div",{className:"absolute top-2 right-2",children:l.jsxs(pe,{variant:"secondary",className:w("shadow-sm",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})})]}),l.jsxs(la,{className:w(h==="compact"?"p-3 pb-2":"p-4 pb-3"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[r&&!n&&l.jsx("img",{src:r,alt:t,className:"w-10 h-10 rounded object-cover flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(fa,{className:w("line-clamp-2",h==="compact"?"text-sm":"text-base"),children:t}),p&&h==="detailed"&&l.jsx(pe,{variant:"outline",className:"mt-1 text-xs",children:p})]})]}),e&&h!=="compact"&&l.jsx(m0,{className:"mt-2 line-clamp-2 text-xs",children:e})]}),(b||x||v)&&l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:l.jsx(k.MoreVertical,{className:"h-4 w-4"})})}),l.jsxs(Ui,{align:"end",children:[b&&l.jsx(gr,{onClick:b,children:"Editar"}),v&&l.jsx(gr,{onClick:v,children:"Duplicar"}),x&&l.jsx(gr,{onClick:x,className:"text-destructive",children:"Excluir"})]})]})]}),a.length>0&&l.jsxs("div",{className:"flex flex-wrap gap-1 mt-2",children:[a.slice(0,h==="compact"?2:3).map(T=>l.jsx(pe,{variant:"secondary",className:"text-xs",style:T.color?{backgroundColor:T.color+"20",color:T.color,borderColor:T.color+"40"}:void 0,children:T.label},T.id)),a.length>(h==="compact"?2:3)&&l.jsxs(pe,{variant:"secondary",className:"text-xs",children:["+",a.length-(h==="compact"?2:3)]})]}),s&&!n&&h==="detailed"&&l.jsxs(pe,{variant:"secondary",className:w("mt-2 w-fit text-xs",C==null?void 0:C.bgColor),children:[l.jsx("div",{className:w("w-2 h-2 rounded-full mr-1",C==null?void 0:C.color)}),C==null?void 0:C.label]})]}),u!==void 0&&h!=="compact"&&l.jsx(ca,{className:"px-4 pb-3 pt-0",children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"Progresso"}),l.jsxs("span",{children:[u,"%"]})]}),l.jsx(uu,{value:u,className:"h-1.5"})]})}),l.jsxs(g0,{className:w("flex items-center justify-between gap-2",h==="compact"?"px-3 pb-3 pt-1":"px-4 pb-4 pt-2"),children:[l.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground flex-wrap",children:[o&&l.jsxs("div",{className:w("flex items-center gap-1",L&&"text-destructive font-medium"),children:[L&&l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx(k.Calendar,{className:"h-3 w-3"}),l.jsx("span",{children:N(o)})]}),d&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.CheckSquare,{className:"h-3 w-3"}),l.jsxs("span",{children:[d.completed,"/",d.total]})]}),f!==void 0&&f>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.MessageSquare,{className:"h-3 w-3"}),l.jsx("span",{children:f})]}),c!==void 0&&c>0&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(k.Paperclip,{className:"h-3 w-3"}),l.jsx("span",{children:c})]})]}),i.length>0&&l.jsxs("div",{className:"flex -space-x-2",children:[i.slice(0,3).map(T=>l.jsxs(Ft,{className:"h-6 w-6 border-2 border-background",children:[T.avatar&&l.jsx(Ln,{src:T.avatar,alt:T.name}),l.jsx(Ut,{className:"text-xs",children:T.initials||T.name.slice(0,2).toUpperCase()})]},T.id)),i.length>3&&l.jsxs("div",{className:"h-6 w-6 rounded-full border-2 border-background bg-muted flex items-center justify-center text-xs",children:["+",i.length-3]})]})]})]})});b4.displayName="KanbanCard";const x4=I.forwardRef(({title:t,primaryContent:e,secondaryContent:n,trendValue:r,trendLabel:a,icon:i=k.Activity,isLoading:s=!1,onClick:o,className:f},c)=>s?l.jsxs(jr,{ref:c,className:f,children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2",children:[l.jsx(Bn,{className:"h-4 w-4 rounded"}),l.jsx(Bn,{className:"h-4 w-24"})]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsx(Bn,{className:"h-8 w-32"}),l.jsx(Bn,{className:"h-3 w-full"})]})]}):l.jsxs(jr,{ref:c,onClick:o,className:w(o&&"cursor-pointer hover:bg-accent/50 transition-colors",f),children:[l.jsx(la,{className:"pb-1",children:l.jsxs(fa,{className:"text-sm flex items-center gap-2 text-muted-foreground",children:[l.jsx(i,{className:"h-4 w-4 text-muted-foreground"}),t]})}),l.jsxs(ca,{className:"space-y-1 pt-0",children:[l.jsxs("div",{className:"flex items-baseline flex-wrap gap-2",children:[l.jsx("span",{className:"text-2xl font-bold",children:e}),r!==void 0&&l.jsxs(pe,{variant:"secondary",className:w("px-1.5 py-0 h-auto text-xs",r>0?"text-green-600":"text-red-600"),children:[r>0?l.jsx(k.TrendingUp,{className:"h-3 w-3 mr-0.5 inline"}):l.jsx(k.TrendingDown,{className:"h-3 w-3 mr-0.5 inline"}),a]})]}),n&&l.jsx("p",{className:"text-xs text-muted-foreground",children:n})]})]}));x4.displayName="KPICard";function Z5(t){return t?t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`:""}function q5(t){if(!t)return"";try{return new Date(t).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function K5(t,e){if(t.length<=e)return t;const n=t.lastIndexOf(".");if(n===-1)return t.substring(0,e-3)+"...";const r=t.substring(n);return t.substring(0,n).substring(0,e-r.length-3)+"..."+r}function X5({attachments:t,onDownload:e,onRemove:n,onView:r,showDownload:a=!0,showRemove:i=!1,showView:s=!1,maxFilenameLength:o=40,variant:f="compact",emptyMessage:c="Nenhum anexo",isLoading:d=!1,className:u}){const[p,h]=M.useState({}),m=async(g,b,x)=>{if(!x)return;const v=g.chave||g.nomeOriginal;h(j=>({...j,[v]:b}));try{await x(g)}finally{h(j=>({...j,[v]:null}))}};return d?l.jsx("div",{className:w("space-y-2",u),children:[1,2,3].map(g=>l.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded bg-muted/30 animate-pulse",children:[l.jsx("div",{className:"h-4 w-4 bg-muted-foreground/20 rounded"}),l.jsx("div",{className:"h-4 flex-1 bg-muted-foreground/20 rounded"})]},g))}):t.length===0?l.jsx("div",{className:w("text-center py-6 text-sm text-muted-foreground border rounded-lg bg-muted/20",u),children:c}):l.jsx("div",{className:w("space-y-2",u),children:t.map((g,b)=>{const x=g.chave||g.id||`${g.nomeOriginal}-${b}`,v=p[g.chave||g.nomeOriginal],j=v==="download",y=v==="view",L=(()=>{switch(g.status){case"completed":return l.jsx(pe,{variant:"outline",className:"bg-green-50 text-green-600 border-green-200 hover:bg-green-50",children:"✓ Enviado"});case"uploading":return l.jsx(pe,{variant:"outline",className:"bg-blue-50 text-blue-600 border-blue-200 hover:bg-blue-50",children:"Enviando..."});case"failed":return l.jsx(pe,{variant:"outline",className:"bg-red-50 text-red-600 border-red-200 hover:bg-red-50",children:"✗ Erro"});case"retrying":return l.jsx(pe,{variant:"outline",className:"bg-yellow-50 text-yellow-600 border-yellow-200 hover:bg-yellow-50",children:"Tentando..."});default:return null}})();return f==="detailed"?l.jsx("div",{className:w("p-4 border rounded-lg bg-card transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-5 w-5 text-muted-foreground mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("p",{className:"text-sm font-medium truncate",children:g.nomeOriginal})}),l.jsx(at,{children:l.jsx("p",{children:g.nomeOriginal})})]})}),l.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[g.tamanhoBytes&&l.jsx("span",{children:Z5(g.tamanhoBytes)}),g.tamanhoBytes&&g.dataUpload&&l.jsx("span",{children:"•"}),g.dataUpload&&l.jsx("span",{children:q5(g.dataUpload)})]}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsx(uu,{value:g.progress,className:"h-1 mt-2"}),g.status==="failed"&&g.erro&&l.jsxs("div",{className:"flex items-center gap-1 mt-2 text-xs text-red-600",children:[l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx("span",{children:g.erro})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[L,g.status==="completed"&&l.jsxs(l.Fragment,{children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]})]})]})},x):l.jsxs("div",{className:w("flex items-center justify-between gap-2 p-3 border rounded-lg bg-muted/30 transition-colors",g.status==="failed"&&"border-red-200 bg-red-50/30"),children:[l.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[l.jsx(k.Paperclip,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx("span",{className:"text-sm truncate",children:K5(g.nomeOriginal,o)})}),l.jsx(at,{children:l.jsx("p",{className:"max-w-xs break-all",children:g.nomeOriginal})})]})}),g.status==="uploading"&&typeof g.progress=="number"&&l.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[g.progress,"%"]}),L]}),g.status==="completed"&&l.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[s&&r&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"view",r),disabled:y,children:l.jsx(k.Eye,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Visualizar"})]})}),a&&e&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>m(g,"download",e),disabled:j,children:l.jsx(k.Download,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Baixar"})]})}),i&&n&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>n(g),children:l.jsx(k.Trash2,{className:"h-4 w-4"})})}),l.jsx(at,{children:"Remover"})]})})]}),g.status==="failed"&&g.erro&&l.jsx(It,{children:l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:l.jsx(k.AlertCircle,{className:"h-4 w-4 text-red-600 flex-shrink-0"})}),l.jsx(at,{children:l.jsx("p",{children:g.erro})})]})})]},x)})})}function eA({className:t,...e}){return l.jsx(Qe.Root,{"data-slot":"menubar",className:w("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",t),...e})}function tA({...t}){return l.jsx(Qe.Menu,{"data-slot":"menubar-menu",...t})}function nA({...t}){return l.jsx(Qe.Group,{"data-slot":"menubar-group",...t})}function y4({...t}){return l.jsx(Qe.Portal,{"data-slot":"menubar-portal",...t})}function rA({...t}){return l.jsx(Qe.RadioGroup,{"data-slot":"menubar-radio-group",...t})}function aA({className:t,...e}){return l.jsx(Qe.Trigger,{"data-slot":"menubar-trigger",className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",t),...e})}function iA({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...a}){return l.jsx(y4,{children:l.jsx(Qe.Content,{"data-slot":"menubar-content",align:e,alignOffset:n,sideOffset:r,className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",t),...a})})}function sA({className:t,inset:e,variant:n="default",...r}){return l.jsx(Qe.Item,{"data-slot":"menubar-item","data-inset":e,"data-variant":n,className:w("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function oA({className:t,children:e,checked:n,...r}){return l.jsxs(Qe.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CheckIcon,{className:"size-4"})})}),e]})}function lA({className:t,children:e,...n}){return l.jsxs(Qe.RadioItem,{"data-slot":"menubar-radio-item",className:w("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Qe.ItemIndicator,{children:l.jsx(k.CircleIcon,{className:"size-2 fill-current"})})}),e]})}function fA({className:t,inset:e,...n}){return l.jsx(Qe.Label,{"data-slot":"menubar-label","data-inset":e,className:w("px-2 py-1.5 text-sm font-semibold data-[inset]:pl-8",t),...n})}function cA({className:t,...e}){return l.jsx(Qe.Separator,{"data-slot":"menubar-separator",className:w("bg-border -mx-1 my-1 h-px",t),...e})}function dA({className:t,...e}){return l.jsx("span",{"data-slot":"menubar-shortcut",className:w("text-muted-foreground ml-auto text-xs tracking-widest",t),...e})}function uA({...t}){return l.jsx(Qe.Sub,{"data-slot":"menubar-sub",...t})}function hA({className:t,inset:e,children:n,...r}){return l.jsxs(Qe.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":e,className:w("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",t),...r,children:[n,l.jsx(k.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function pA({className:t,...e}){return l.jsx(Qe.SubContent,{"data-slot":"menubar-sub-content",className:w("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...e})}function mA({className:t,children:e,viewport:n=!0,...r}){return l.jsxs(Er.Root,{"data-slot":"navigation-menu","data-viewport":n,className:w("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...r,children:[e,n&&l.jsx(vA,{})]})}function gA({className:t,...e}){return l.jsx(Er.List,{"data-slot":"navigation-menu-list",className:w("group flex flex-1 list-none items-center justify-center gap-1",t),...e})}function bA({className:t,...e}){return l.jsx(Er.Item,{"data-slot":"navigation-menu-item",className:w("relative",t),...e})}const v4=$t.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function xA({className:t,children:e,...n}){return l.jsxs(Er.Trigger,{"data-slot":"navigation-menu-trigger",className:w(v4(),"group",t),...n,children:[e," ",l.jsx(k.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function yA({className:t,...e}){return l.jsx(Er.Content,{"data-slot":"navigation-menu-content",className:w("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...e})}function vA({className:t,...e}){return l.jsx("div",{className:w("absolute top-full left-0 isolate z-50 flex justify-center"),children:l.jsx(Er.Viewport,{"data-slot":"navigation-menu-viewport",className:w("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...e})})}function wA({className:t,...e}){return l.jsx(Er.Link,{"data-slot":"navigation-menu-link",className:w("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...e})}function MA({title:t,description:e,breadcrumbs:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("border-b bg-background",i),children:[l.jsxs("div",{className:"flex h-14 items-center gap-4 px-6",children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),n&&n.length>0&&l.jsx(z0,{children:l.jsx(O0,{children:n.map((s,o)=>l.jsxs(I.Fragment,{children:[o>0&&l.jsx(H0,{}),l.jsx(P0,{children:o===n.length-1?l.jsx(B0,{children:s.label}):s.href?l.jsx(R0,{href:s.href,children:s.label}):l.jsx("span",{children:s.label})})]},o))})}),!n&&l.jsx("div",{className:"flex-1",children:l.jsx("h1",{className:"text-lg font-semibold",children:t})})]}),e&&l.jsx("div",{className:"border-t px-6 py-3",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}function jA({title:t,icon:e,badge:n,secondaryNavCollapsed:r=!1,onSecondaryNavToggle:a,className:i}){return l.jsxs("div",{className:w("flex h-14 items-center gap-3 border-b bg-background px-6",i),children:[a&&l.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:a,title:r?"Mostrar menu lateral":"Ocultar menu lateral",children:r?l.jsx(k.PanelLeftOpen,{className:"h-4 w-4"}):l.jsx(k.PanelLeftClose,{className:"h-4 w-4"})}),e&&l.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10",children:l.jsx(e,{className:"h-4 w-4 text-primary"})}),l.jsx("h1",{className:"flex-1 text-lg font-semibold",children:t}),n&&l.jsx("div",{className:"shrink-0",children:n})]})}function CA({title:t,subtitle:e,actions:n,className:r}){return l.jsxs("div",{className:w("flex items-start justify-between gap-4",r),children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:t}),e&&l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:e})]}),n&&l.jsx("div",{className:"flex items-center gap-2",children:n})]})}function LA({className:t,...e}){return l.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:w("mx-auto flex w-full justify-center",t),...e})}function NA({className:t,...e}){return l.jsx("ul",{"data-slot":"pagination-content",className:w("flex flex-row items-center gap-1",t),...e})}function kA({...t}){return l.jsx("li",{"data-slot":"pagination-item",...t})}function hu({className:t,isActive:e,size:n="icon",...r}){return l.jsx("a",{"aria-current":e?"page":void 0,"data-slot":"pagination-link","data-active":e,className:w(Jn({variant:e?"outline":"ghost",size:n}),t),...r})}function SA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to previous page",size:"default",className:w("gap-1 px-2.5 sm:pl-2.5",t),...e,children:[l.jsx(k.ChevronLeftIcon,{}),l.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function TA({className:t,...e}){return l.jsxs(hu,{"aria-label":"Go to next page",size:"default",className:w("gap-1 px-2.5 sm:pr-2.5",t),...e,children:[l.jsx("span",{className:"hidden sm:block",children:"Next"}),l.jsx(k.ChevronRightIcon,{})]})}function IA({className:t,...e}){return l.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:w("flex size-9 items-center justify-center",t),...e,children:[l.jsx(k.MoreHorizontalIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"More pages"})]})}const w4=I.forwardRef(({className:t,showToggle:e=!0,...n},r)=>{const[a,i]=I.useState(!1);return l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:a?"text":"password","data-slot":"input",className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e&&"pr-10",t),ref:r,...n}),e&&l.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",tabIndex:-1,"aria-label":a?"Hide password":"Show password",children:a?l.jsx(k.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(k.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})});w4.displayName="PasswordInput";function DA({className:t,...e}){return l.jsx(Nf.Root,{"data-slot":"radio-group",className:w("grid gap-3",t),...e})}function EA({className:t,...e}){return l.jsx(Nf.Item,{"data-slot":"radio-group-item",className:w("peer h-5 w-5 shrink-0 rounded-full border border-gray-300 bg-white shadow-sm transition-all hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:l.jsx(Nf.Indicator,{"data-slot":"radio-group-indicator",className:"flex items-center justify-center",children:l.jsx("div",{className:"h-2 w-2 rounded-full bg-white"})})})}function AA({className:t,...e}){return l.jsx(Nc.PanelGroup,{"data-slot":"resizable-panel-group",className:w("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function zA({...t}){return l.jsx(Nc.Panel,{"data-slot":"resizable-panel",...t})}function OA({withHandle:t,className:e,...n}){return l.jsx(Nc.PanelResizeHandle,{"data-slot":"resizable-handle",className:w("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",e),...n,children:t&&l.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:l.jsx(k.GripVerticalIcon,{className:"size-2.5"})})})}function PA({filters:t=[],onSelectFilter:e,onToggleFavorite:n,onDeleteFilter:r,className:a}){const i=t.filter(o=>o.isFavorite),s=t.filter(o=>!o.isFavorite);return l.jsxs(Hi,{children:[l.jsx(Fi,{asChild:!0,children:l.jsxs(F,{variant:"outline",size:"sm",className:w("gap-2",a),children:[l.jsx(k.Download,{className:"h-4 w-4"}),"Filtros salvos",t.length>0&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]})]})}),l.jsx(Ui,{align:"start",className:"w-[280px]",children:t.length===0?l.jsx("div",{className:"px-2 py-6 text-center text-sm text-muted-foreground",children:"No saved filters yet"}):l.jsxs(l.Fragment,{children:[i.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Favorites"}),i.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id)),s.length>0&&l.jsx(Qs,{})]}),s.length>0&&l.jsxs(l.Fragment,{children:[i.length>0&&l.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Todos filtros"}),s.map(o=>l.jsx(f0,{filter:o,onSelect:e,onToggleFavorite:n,onDelete:r},o.id))]})]})})]})}function f0({filter:t,onSelect:e,onToggleFavorite:n,onDelete:r}){return l.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 hover:bg-muted rounded-sm group",children:[l.jsx("button",{onClick:a=>{a.stopPropagation(),n==null||n(t.id)},className:"p-1 hover:bg-accent rounded-sm",children:l.jsx(k.Star,{className:w("h-3.5 w-3.5",t.isFavorite?"fill-yellow-500 text-yellow-500":"text-muted-foreground")})}),l.jsxs("button",{onClick:()=>e==null?void 0:e(t.id),className:"flex-1 text-left px-2",children:[l.jsx("div",{className:"text-sm",children:t.name}),t.description&&l.jsx("div",{className:"text-xs text-muted-foreground",children:t.description}),t.filterCount!==void 0&&l.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[t.filterCount," ",t.filterCount===1?"filter":"filters"]})]}),l.jsx("button",{onClick:a=>{a.stopPropagation(),r==null||r(t.id)},className:"p-1 hover:bg-accent rounded-sm opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsx(k.Trash2,{className:"h-3.5 w-3.5 text-destructive"})})]})}function M4({...t}){return l.jsx(Ae.Root,{"data-slot":"sheet",...t})}function RA({...t}){return l.jsx(Ae.Trigger,{"data-slot":"sheet-trigger",...t})}function BA({...t}){return l.jsx(Ae.Close,{"data-slot":"sheet-close",...t})}function HA({...t}){return l.jsx(Ae.Portal,{"data-slot":"sheet-portal",...t})}const j4=I.forwardRef(({className:t,...e},n)=>l.jsx(Ae.Overlay,{ref:n,"data-slot":"sheet-overlay",className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e}));j4.displayName=Ae.Overlay.displayName;function C4({className:t,children:e,side:n="right",...r}){return l.jsxs(HA,{children:[l.jsx(j4,{}),l.jsxs(Ae.Content,{"data-slot":"sheet-content",className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,l.jsxs(Ae.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[l.jsx(k.XIcon,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function L4({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-1.5 p-4",t),...e})}function FA({className:t,...e}){return l.jsx("div",{"data-slot":"sheet-footer",className:w("mt-auto flex flex-col gap-2 p-4",t),...e})}function N4({className:t,...e}){return l.jsx(Ae.Title,{"data-slot":"sheet-title",className:w("text-foreground font-semibold leading-[1.2]",t),...e})}function k4({className:t,...e}){return l.jsx(Ae.Description,{"data-slot":"sheet-description",className:w("text-muted-foreground text-sm leading-relaxed",t),...e})}const Lf=768;function S4(){const[t,e]=I.useState(void 0);return I.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Lf-1}px)`),r=()=>{e(window.innerWidth<Lf)};return n.addEventListener("change",r),e(window.innerWidth<Lf),()=>n.removeEventListener("change",r)},[]),!!t}const UA="sidebar_state",_A=3600*24*7,JA="16rem",VA="18rem",GA="3rem",YA="b",T4=I.createContext(null);function rs(){const t=I.useContext(T4);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function QA({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:a,children:i,...s}){const o=S4(),[f,c]=I.useState(!1),[d,u]=I.useState(t),p=e??d,h=I.useCallback(x=>{const v=typeof x=="function"?x(p):x;n?n(v):u(v),document.cookie=`${UA}=${v}; path=/; max-age=${_A}`},[n,p]),m=I.useCallback(()=>o?c(x=>!x):h(x=>!x),[o,h,c]);I.useEffect(()=>{const x=v=>{v.key===YA&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),m())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m]);const g=p?"expanded":"collapsed",b=I.useMemo(()=>({state:g,open:p,setOpen:h,isMobile:o,openMobile:f,setOpenMobile:c,toggleSidebar:m}),[g,p,h,o,f,c,m]);return l.jsx(T4.Provider,{value:b,children:l.jsx(It,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":JA,"--sidebar-width-icon":GA,...a},className:w("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...s,children:i})})})}function WA({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:a,...i}){const{isMobile:s,state:o,openMobile:f,setOpenMobile:c}=rs();return n==="none"?l.jsx("div",{"data-slot":"sidebar",className:w("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:a}):s?l.jsx(M4,{open:f,onOpenChange:c,...i,children:l.jsxs(C4,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":VA},side:t,children:[l.jsxs(L4,{className:"sr-only",children:[l.jsx(N4,{children:"Sidebar"}),l.jsx(k4,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):l.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":o,"data-collapsible":o==="collapsed"?n:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container",className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:l.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:a})})]})}function $A({className:t,onClick:e,...n}){const{toggleSidebar:r}=rs();return l.jsxs(F,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:w("size-7",t),onClick:a=>{e==null||e(a),r()},...n,children:[l.jsx(k.PanelLeftIcon,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function ZA({className:t,...e}){const{toggleSidebar:n}=rs();return l.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:w("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...e})}function qA({className:t,...e}){return l.jsx("main",{"data-slot":"sidebar-inset",className:w("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...e})}function KA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...e})}function XA({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...e})}function e8({className:t,...e}){return l.jsx(Hn,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:w("bg-sidebar-border mx-2 w-auto",t),...e})}function t8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function n8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...e})}function r8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"div";return l.jsx(r,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:w("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function a8({className:t,asChild:e=!1,...n}){const r=e?kn.Slot:"button";return l.jsx(r,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...n})}function i8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...e})}function s8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-1",t),...e})}function o8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...e})}const l8=$t.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function f8({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:a,className:i,...s}){const o=t?kn.Slot:"button",{isMobile:f,state:c}=rs(),d=l.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:w(l8({variant:n,size:r}),i),...s});return a?(typeof a=="string"&&(a={children:a}),l.jsxs(nt,{children:[l.jsx(rt,{asChild:!0,children:d}),l.jsx(at,{side:"right",align:"center",hidden:c!=="collapsed"||f,...a})]})):d}function c8({className:t,asChild:e=!1,showOnHover:n=!1,...r}){const a=e?kn.Slot:"button";return l.jsx(a,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...r})}function d8({className:t,...e}){return l.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e})}function u8({className:t,showIcon:e=!1,...n}){const r=I.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:w("flex h-8 items-center gap-2 rounded-md px-2",t),...n,children:[e&&l.jsx(Bn,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Bn,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})}function h8({className:t,...e}){return l.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:w("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...e})}function p8({className:t,...e}){return l.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:w("group/menu-sub-item relative",t),...e})}function m8({asChild:t=!1,size:e="md",isActive:n=!1,className:r,...a}){const i=t?kn.Slot:"a";return l.jsx(i,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":e,"data-active":n,className:w("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",e==="sm"&&"text-xs",e==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})}function I4({className:t,defaultValue:e,value:n,min:r=0,max:a=100,...i}){const s=I.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,a],[n,e,r,a]);return l.jsxs(hs.Root,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:a,className:w("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...i,children:[l.jsx(hs.Track,{"data-slot":"slider-track",className:w("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:l.jsx(hs.Range,{"data-slot":"slider-range",className:w("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(o,f)=>l.jsx(hs.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},f))]})}const D4=$t.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent hover:text-accent-foreground text-foreground",google:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground",github:"bg-[#24292F] hover:bg-[#24292F]/90 text-white dark:bg-[#24292F] dark:hover:bg-[#24292F]/80",facebook:"bg-[#1877F2] hover:bg-[#1877F2]/90 text-white",apple:"bg-black hover:bg-black/90 text-white dark:bg-white dark:hover:bg-white/90 dark:text-black",microsoft:"bg-white dark:bg-zinc-900 border border-input hover:bg-accent text-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),g8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),b8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),x8=()=>l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),y8=()=>l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:[l.jsx("path",{d:"M11.4 11.4H2V2h9.4v9.4z",fill:"#F25022"}),l.jsx("path",{d:"M22 11.4h-9.4V2H22v9.4z",fill:"#7FBA00"}),l.jsx("path",{d:"M11.4 22H2v-9.4h9.4V22z",fill:"#00A4EF"}),l.jsx("path",{d:"M22 22h-9.4v-9.4H22V22z",fill:"#FFB900"})]}),E4=I.forwardRef(({className:t,variant:e,size:n,provider:r,children:a,...i},s)=>{const o=e||r,f=()=>{switch(r){case"google":return l.jsx(g8,{});case"github":return l.jsx(k.Github,{className:"h-5 w-5"});case"facebook":return l.jsx(x8,{});case"apple":return l.jsx(b8,{});case"microsoft":return l.jsx(y8,{});default:return null}},c=()=>`Continue with ${{google:"Google",github:"GitHub",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft"}[r]}`;return l.jsxs("button",{className:w(D4({variant:o,size:n,className:t})),ref:s,...i,children:[f(),l.jsx("span",{children:a||c()})]})});E4.displayName="SocialButton";function A4({className:t,...e}){return l.jsx(bu.Root,{"data-slot":"switch",className:w("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:l.jsx(bu.Thumb,{"data-slot":"switch-thumb",className:w("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const v8=[{value:"not-started",label:"Não iniciada",color:"bg-gray-500"},{value:"in-progress",label:"Em progresso",color:"bg-primary"},{value:"on-hold",label:"Em espera",color:"bg-cyan-500"},{value:"completed",label:"Concluída",color:"bg-green-500"},{value:"delayed",label:"Atrasada",color:"bg-red-500"},{value:"cancelled",label:"Cancelada",color:"bg-orange-500"}];function w8({task:t,open:e,onOpenChange:n,onSave:r,availableTasks:a=[],availableAssignees:i=[]}){var x;const[s,o]=I.useState(null),[f,c]=I.useState(!1),[d,u]=I.useState(!1);if(I.useEffect(()=>{t&&o({...t})},[t]),!s)return null;const p=()=>{r(s),n(!1)},h=(v,j)=>{o(y=>y?{...y,[v]:j}:null)},m=v=>{o(j=>{if(!j)return null;const y=j.dependencies||[],L=y.includes(v)?y.filter(C=>C!==v):[...y,v];return{...j,dependencies:L}})},g=a.filter(v=>v.id!==s.id),b=s.name.trim()!==""&&s.startDate<=s.endDate;return l.jsx(_i,{open:e,onOpenChange:n,children:l.jsxs(Ji,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(Vi,{children:[l.jsx(Gi,{children:"Editar Tarefa"}),l.jsx(Yi,{children:'Altere os detalhes da tarefa abaixo. As mudanças serão salvas ao clicar em "Salvar alterações".'})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-name",children:"Nome da Tarefa *"}),l.jsx(Ht,{id:"task-name",value:s.name,onChange:v=>h("name",v.target.value),placeholder:"Ex: Briefing com cliente"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-description",children:"Descrição"}),l.jsx(ru,{id:"task-description",value:s.description||"",onChange:v=>h("description",v.target.value),placeholder:"Adicione detalhes sobre esta tarefa...",rows:3})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Início *"}),l.jsxs(st,{open:f,onOpenChange:c,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.startDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.startDate?H.format(s.startDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.startDate,onSelect:v=>{v&&(h("startDate",v),c(!1))},initialFocus:!0})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{children:"Data de Término *"}),l.jsxs(st,{open:d,onOpenChange:u,children:[l.jsx($e,{asChild:!0,children:l.jsxs(F,{variant:"outline",className:w("w-full justify-start text-left font-normal",!s.endDate&&"text-muted-foreground"),children:[l.jsx(k.CalendarIcon,{className:"mr-2 size-4"}),s.endDate?H.format(s.endDate,"dd/MM/yyyy",{locale:yt}):"Selecionar data"]})}),l.jsx(Ze,{className:"w-auto p-0",align:"start",children:l.jsx(Calendar,{mode:"single",selected:s.endDate,onSelect:v=>{v&&(h("endDate",v),u(!1))},disabled:v=>s.startDate?v<s.startDate:!1,initialFocus:!0})})]})]})]}),s.startDate>s.endDate&&l.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-900",children:[l.jsx(k.AlertCircle,{className:"size-4 text-red-600 flex-shrink-0"}),l.jsx("p",{className:"text-sm text-red-900 dark:text-red-200",children:"A data de término deve ser posterior à data de início"})]}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-status",children:"Status"}),l.jsxs(en,{value:s.status,onValueChange:v=>h("status",v),children:[l.jsx(nn,{id:"task-status",children:l.jsx(tn,{})}),l.jsx(rn,{children:v8.map(v=>l.jsx(Dt,{value:v.value,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:w("size-2 rounded-full",v.color)}),v.label]})},v.value))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ue,{htmlFor:"task-assignee",children:"Responsável"}),l.jsxs(en,{value:((x=s.assignee)==null?void 0:x.name)||"",onValueChange:v=>{const j=i.find(y=>y.name===v);h("assignee",j||void 0)},children:[l.jsx(nn,{id:"task-assignee",children:l.jsx(tn,{placeholder:"Selecionar responsável"})}),l.jsx(rn,{children:i.map(v=>l.jsx(Dt,{value:v.name,children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.User,{className:"size-4"}),v.name]})},v.name))})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(Ue,{children:"Progresso"}),l.jsxs("span",{className:"text-sm font-medium",children:[s.progress,"%"]})]}),l.jsx(I4,{value:[s.progress],onValueChange:v=>h("progress",v[0]),max:100,step:5,className:"w-full"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"0%"}),l.jsx("span",{children:"50%"}),l.jsx("span",{children:"100%"})]})]}),l.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(Ue,{htmlFor:"milestone-toggle",className:"cursor-pointer",children:"Marco Importante (Milestone)"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Marcos aparecem como losangos no cronograma"})]}),l.jsx(A4,{id:"milestone-toggle",checked:s.milestone||!1,onCheckedChange:v=>h("milestone",v)})]}),g.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(k.Link2,{className:"size-4 text-muted-foreground"}),l.jsx(Ue,{children:"Dependências"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Selecione as tarefas que precisam ser concluídas antes desta"}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto border rounded-lg p-3",children:g.map(v=>{var y;const j=((y=s.dependencies)==null?void 0:y.includes(v.id))||!1;return l.jsxs("div",{className:w("flex items-center gap-3 p-2 rounded-md cursor-pointer transition-colors",j?"bg-primary/10 border border-primary/20":"hover:bg-muted/50"),onClick:()=>m(v.id),children:[l.jsx("div",{className:w("size-4 rounded border-2 flex items-center justify-center transition-all",j?"bg-primary border-primary":"border-muted-foreground"),children:j&&l.jsx("div",{className:"size-2 rounded-sm bg-white"})}),l.jsx("span",{className:"text-sm flex-1",children:v.name}),v.assignee&&l.jsx(pe,{variant:"outline",className:"text-xs",children:v.assignee.name})]},v.id)})}),s.dependencies&&s.dependencies.length>0&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.dependencies.length," dependência(s) selecionada(s)"]})]})]}),l.jsxs(Zo,{children:[l.jsx(F,{variant:"outline",onClick:()=>n(!1),children:"Cancelar"}),l.jsx(F,{onClick:p,disabled:!b,children:"Salvar alterações"})]})]})})}const M8=t=>{switch(t){case"create":return l.jsx(k.PlusCircle,{className:"h-4 w-4 text-green-600"});case"status_change":return l.jsx(k.RefreshCw,{className:"h-4 w-4 text-blue-600"});case"comment":return l.jsx(k.MessageSquare,{className:"h-4 w-4 text-slate-500"});case"upload":return l.jsx(k.Paperclip,{className:"h-4 w-4 text-orange-600"});case"assignment":return l.jsx(k.User,{className:"h-4 w-4 text-purple-600"});case"update":return l.jsx(k.Pencil,{className:"h-4 w-4 text-amber-600"});default:return l.jsx(k.Circle,{className:"h-4 w-4 text-slate-400"})}},j8=t=>{switch(t){case"create":return"bg-green-50 border-green-200";case"status_change":return"bg-blue-50 border-blue-200";case"comment":return"bg-slate-50 border-slate-200";case"upload":return"bg-orange-50 border-orange-200";case"assignment":return"bg-purple-50 border-purple-200";case"update":return"bg-amber-50 border-amber-200";default:return"bg-slate-50 border-slate-200"}},C8=({event:t,isLast:e,onDetailsOpen:n})=>{var o,f,c,d,u,p,h;const[r,a]=I.useState(!1),i=!!((o=t.metadata)!=null&&o.before||(f=t.metadata)!=null&&f.after||(c=t.metadata)!=null&&c.details),s=m=>{a(m),m&&n&&n(t)};return l.jsxs("div",{className:"flex gap-4 group",children:[l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:w("flex items-center justify-center w-8 h-8 rounded-full border shadow-sm z-10 transition-colors","bg-background group-hover:border-primary/50",j8(t.action)),children:M8(t.action)}),!e&&l.jsx("div",{className:"w-px h-full bg-border group-hover:bg-primary/20 transition-colors min-h-[2rem]"})]}),l.jsx("div",{className:"flex-1 pb-8 min-w-0",children:l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-foreground/90",children:[l.jsx("span",{className:"font-semibold",children:t.user.name}),l.jsx("span",{className:"text-muted-foreground font-normal",children:t.title})]}),l.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",title:H.format(t.timestamp,"PPpp",{locale:yt}),children:H.formatDistanceToNow(t.timestamp,{addSuffix:!0,locale:yt})})]}),i&&l.jsxs(J0,{open:r,onOpenChange:s,className:"mt-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[t.action==="upload"&&((d=t.metadata)==null?void 0:d.fileName)&&l.jsxs(pe,{variant:"outline",className:"gap-1 font-normal bg-muted/30 text-muted-foreground hover:bg-muted/50",children:[l.jsx(k.FileText,{className:"h-3 w-3"}),t.metadata.fileName]}),l.jsx(V0,{asChild:!0,children:l.jsxs(F,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-muted-foreground hover:text-primary gap-1",children:[r?"Ocultar detalhes":"Ver detalhes",l.jsx(k.ChevronRight,{className:w("h-3 w-3 transition-transform duration-200",r&&"rotate-90")})]})})]}),l.jsx(G0,{className:"mt-2",children:l.jsxs("div",{className:"rounded-md border bg-muted/30 p-3 text-sm animate-in slide-in-from-top-2 duration-200",children:[(((u=t.metadata)==null?void 0:u.before)||((p=t.metadata)==null?void 0:p.after))&&l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4",children:[t.metadata.before&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background/50 border border-dashed text-muted-foreground line-through text-xs",children:t.metadata.before}),t.metadata.before&&t.metadata.after&&l.jsx(k.ArrowRight,{className:"h-4 w-4 text-muted-foreground hidden sm:block"}),t.metadata.after&&l.jsx("div",{className:"flex-1 p-2 rounded bg-background border border-l-4 border-l-[#7F26BF] shadow-sm text-foreground text-xs font-medium",children:t.metadata.after})]}),((h=t.metadata)==null?void 0:h.details)&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-xs",children:t.metadata.details})]})})]})]})})]})},L8=({events:t,className:e,onDetailsOpen:n})=>l.jsx("div",{className:w("flex flex-col",e),children:t.map((r,a)=>l.jsx(C8,{event:r,isLast:a===t.length-1,onDetailsOpen:n},r.id))});function N8(t){const{theme:e="system"}=Sx.useTheme();return l.jsx(h0.Toaster,{theme:e,className:"toaster group",toastOptions:{unstyled:!0,classNames:{toast:"w-full rounded-lg border px-4 py-3 shadow-lg flex items-start gap-3 bg-card text-card-foreground border-border",title:"font-semibold text-sm leading-[1.2]",description:"text-sm mt-1 leading-relaxed",actionButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-8 px-3",cancelButton:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-muted text-muted-foreground hover:bg-muted/90 h-8 px-3",closeButton:"absolute right-2 top-2 rounded-md p-1 text-foreground/50 hover:text-foreground",error:"!bg-red-50 dark:!bg-red-950/30 !text-red-700 dark:!text-red-400 !border-red-200 dark:!border-red-800 [&_[data-title]]:text-red-700 dark:[&_[data-title]]:text-red-400 [&_[data-description]]:text-red-700/90 dark:[&_[data-description]]:text-red-400/90",success:"!bg-green-100 dark:!bg-green-950/30 !text-green-800 dark:!text-green-400 !border-green-300 dark:!border-green-800 [&_[data-title]]:text-green-800 dark:[&_[data-title]]:text-green-400 [&_[data-description]]:text-green-800 dark:[&_[data-description]]:text-green-400",warning:"!bg-yellow-50 dark:!bg-yellow-950/30 !text-yellow-700 dark:!text-yellow-400 !border-yellow-200 dark:!border-yellow-800 [&_[data-title]]:text-yellow-700 dark:[&_[data-title]]:text-yellow-400 [&_[data-description]]:text-yellow-700/90 dark:[&_[data-description]]:text-yellow-400/90",info:"!bg-cyan-50 dark:!bg-cyan-950/30 !text-cyan-700 dark:!text-cyan-400 !border-cyan-200 dark:!border-cyan-800 [&_[data-title]]:text-cyan-700 dark:[&_[data-title]]:text-cyan-400 [&_[data-description]]:text-cyan-700/90 dark:[&_[data-description]]:text-cyan-400/90"}},...t})}const z4=I.createContext({size:"default",variant:"default"});function k8({className:t,variant:e,size:n,children:r,...a}){return l.jsx(p0.Root,{"data-slot":"toggle-group","data-variant":e,"data-size":n,className:w("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",t),...a,children:l.jsx(z4.Provider,{value:{variant:e,size:n},children:r})})}function S8({className:t,children:e,variant:n,size:r,...a}){const i=I.useContext(z4);return l.jsx(p0.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,className:w(au({variant:i.variant||n,size:i.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",t),...a,children:e})}const O4=I.createContext(void 0);function P4(){const t=I.useContext(O4);if(!t)throw new Error("UnderlineTabs components must be used within UnderlineTabs");return t}function T8({defaultValue:t,value:e,onValueChange:n,children:r,className:a}){const[i,s]=I.useState(t||""),o=e!==void 0?e:i,f=c=>{e===void 0&&s(c),n==null||n(c)};return l.jsx(O4.Provider,{value:{value:o,onValueChange:f},children:l.jsx("div",{className:w("w-full",a),role:"tablist",children:r})})}function I8({children:t,className:e}){return l.jsx("div",{className:w("border-b border-border bg-background",e),children:l.jsx("div",{className:"flex",children:t})})}function D8({value:t,children:e,className:n,disabled:r=!1}){const{value:a,onValueChange:i}=P4(),s=a===t;return l.jsx("button",{type:"button",role:"tab","aria-selected":s,"aria-disabled":r,disabled:r,onClick:()=>!r&&i(t),className:w("px-4 h-12 text-sm font-medium border-b-2 transition-colors relative","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",s?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-border",n),children:e})}function E8({value:t,children:e,className:n}){const{value:r}=P4();return r!==t?null:l.jsx("div",{role:"tabpanel","aria-labelledby":t,className:w("mt-4",n),children:e})}function A8(t,e){const n=e*1024*1024;return t.size>n?`Arquivo muito grande. Máximo: ${e}MB`:null}function z8(t,e){if(!e)return null;const n=e.split(",").map(s=>s.trim().toLowerCase()),r=t.name.toLowerCase(),a=t.type.toLowerCase();return n.some(s=>{if(s.includes("*")){const[o]=s.split("/");return a.startsWith(o+"/")}return s.startsWith(".")?r.endsWith(s):a===s})?null:"Tipo de arquivo não suportado"}function O8({onFilesSelected:t,accept:e,multiple:n=!0,maxFiles:r=10,maxSizeMB:a=50,disabled:i=!1,isUploading:s=!1,title:o="Clique para fazer upload de arquivos",description:f,icon:c,className:d,onError:u}){const[p,h]=M.useState(!1),m=M.useRef(null),g=M.useCallback(N=>{u==null||u(N)},[u]),b=M.useCallback(N=>{if(!N||N.length===0)return;const S=Array.from(N);if(S.length>r){g(`Máximo de ${r} arquivo(s) permitido(s)`);return}const T=[],z=[];for(const P of S){const U=A8(P,a);if(U){z.push(`${P.name}: ${U}`);continue}const J=z8(P,e);if(J){z.push(`${P.name}: ${J}`);continue}T.push(P)}z.length>0&&g(z.join(`
223
223
  `)),T.length>0&&t(T),m.current&&(m.current.value="")},[r,a,e,t,g]),x=M.useCallback(()=>{var N;i||s||(N=m.current)==null||N.click()},[i,s]),v=M.useCallback(N=>{b(N.target.files)},[b]),j=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),!i&&!s&&h(!0)},[i,s]),y=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1)},[]),L=M.useCallback(N=>{N.preventDefault(),N.stopPropagation(),h(!1),!(i||s)&&b(N.dataTransfer.files)},[i,s,b]),C=f||(()=>{const N=[];if(e){const S=e.split(",").map(T=>T.trim().replace(".","").toUpperCase()).join(", ");N.push(S)}return a&&N.push(`máx ${a}MB cada`),N.join(" • ")})();return l.jsxs("div",{className:w("relative border-2 border-dashed rounded-lg p-8 text-center transition-all cursor-pointer","hover:border-primary/50 hover:bg-muted/30",p&&"border-primary bg-primary/5 scale-[1.02]",(i||s)&&"opacity-50 cursor-not-allowed hover:border-dashed hover:bg-transparent",s&&"animate-pulse",d),onClick:x,onDragOver:j,onDragLeave:y,onDrop:L,children:[l.jsx("input",{ref:m,type:"file",multiple:n,accept:e,className:"hidden",onChange:v,disabled:i||s}),l.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c||l.jsx("div",{className:w("transition-transform",p&&"scale-110"),children:s?l.jsx("div",{className:"h-12 w-12 mx-auto",children:l.jsxs("svg",{className:"animate-spin h-12 w-12 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.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"})]})}):l.jsx(k.Upload,{className:w("h-12 w-12 mx-auto text-muted-foreground transition-colors",p&&"text-primary")})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:w("font-medium transition-colors",p&&"text-primary",s&&"text-muted-foreground"),children:s?"Enviando arquivos...":p?"Solte os arquivos aqui":o}),C&&l.jsx("p",{className:"text-xs text-muted-foreground",children:C}),!i&&!s&&n&&r>1&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Você pode selecionar até ",r," arquivo(s)"]})]}),i&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[l.jsx(k.AlertCircle,{className:"h-3 w-3"}),l.jsx("span",{children:"Upload desabilitado"})]})]})]})}const P8={sm:"w-24 h-24",md:"w-32 h-32",lg:"w-48 h-48"};function Jr({src:t,alt:e,size:n="md",className:r}){return l.jsx("img",{src:t,alt:e,className:w(P8[n],"object-contain",r)})}function R4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-task-approved.png",alt:"Caixa de entrada vazia",size:t,className:e})}function B4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-no-results.png",alt:"Nenhum resultado encontrado",size:t,className:e})}function H4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/create-record.png",alt:"Nenhum projeto criado",size:t,className:e})}function F4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/scheduled-tasks.png",alt:"Calendário sem eventos",size:t,className:e})}function U4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/empty-not-found.png",alt:"Erro ou item não encontrado",size:t,className:e})}function _4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/success-checkmark.png",alt:"Ação concluída com sucesso",size:t,className:e})}function J4({size:t="md",className:e}){return l.jsx(Jr,{src:"/illustrations/contract-agreement.png",alt:"Nenhum contrato cadastrado",size:t,className:e})}const R8={EmptyInbox:R4,EmptySearch:B4,EmptyProjects:H4,EmptyCalendar:F4,EmptyContracts:J4,ErrorState:U4,SuccessState:_4};function B8({data:t,showPreview:e=!1,logo:n}){const r=i=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(i),a=i=>new Date(i).toLocaleDateString("pt-BR",{year:"numeric",month:"long",day:"numeric"});return l.jsxs("div",{className:w("proposal-template bg-white text-black",e?"shadow-lg rounded-lg p-8 max-w-5xl mx-auto my-8":"p-0"),style:{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12pt",lineHeight:"1.6"},children:[l.jsx(eu,{logo:n,companyName:t.agency.name,contactInfo:{email:t.agency.email,phone:t.agency.phone},documentType:"Proposta Comercial",documentNumber:t.proposalNumber,issueDate:a(t.issueDate)}),l.jsx(it,{children:l.jsx(mr,{columns:2,items:[{label:"Nº da Proposta",value:t.proposalNumber,highlight:!0},{label:"Validade",value:a(t.validUntil)},{label:"Cliente",value:t.client.name,highlight:!0},...t.client.contact?[{label:"Contato",value:t.client.contact}]:[]]})}),l.jsxs(it,{title:"Projeto",children:[l.jsx("h3",{className:"text-base font-semibold text-primary mb-3",children:t.projectTitle}),t.projectDescription&&l.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:t.projectDescription})]}),t.objectives&&t.objectives.length>0&&l.jsx(it,{title:"Objetivos",children:l.jsx("ul",{className:"list-disc list-inside space-y-2",children:t.objectives.map((i,s)=>l.jsx("li",{className:"text-sm text-gray-700",children:i},s))})}),l.jsxs(it,{title:"Escopo e Investimento",children:[l.jsx(Vo,{columns:[{header:"Item",key:"name",width:"35%"},{header:"Descrição",key:"description",width:"30%"},{header:"Qtd.",key:"quantity",align:"center",width:"10%",render:i=>i||"-"},{header:"Valor Unit.",key:"unitPrice",align:"right",width:"12.5%",render:i=>i?r(i):"-"},{header:"Valor Total",key:"totalPrice",align:"right",width:"12.5%",render:i=>r(i)}],data:t.items,striped:!0,density:"comfortable"}),l.jsx("div",{className:"mt-6 flex justify-end",children:l.jsxs("div",{className:"w-80 space-y-2",children:[l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-gray-600",children:"Subtotal:"}),l.jsx("span",{className:"font-semibold",children:r(t.subtotal)})]}),t.discount&&t.discount>0&&l.jsxs("div",{className:"flex justify-between text-sm",children:[l.jsx("span",{className:"text-gray-600",children:"Desconto:"}),l.jsxs("span",{className:"font-semibold text-green-600",children:["- ",r(t.discount)]})]}),l.jsxs("div",{className:"border-t-2 border-primary pt-2 flex justify-between",children:[l.jsx("span",{className:"font-semibold text-base",children:"Total:"}),l.jsx("span",{className:"font-semibold text-lg text-primary",children:r(t.total)})]})]})})]}),(t.paymentConditions||t.deliveryTime)&&l.jsx(it,{title:"Condições Comerciais",children:l.jsx(mr,{columns:1,items:[...t.paymentConditions?[{label:"Forma de Pagamento",value:t.paymentConditions}]:[],...t.deliveryTime?[{label:"Prazo de Entrega",value:t.deliveryTime}]:[]]})}),t.notes&&l.jsx(it,{title:"Observações",children:l.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:t.notes})}),l.jsx(tu,{signatures:[{label:"APROVAÇÃO DO CLIENTE",name:t.client.name,role:t.client.contact}],layout:"vertical",instructionText:"Para aprovar esta proposta, assine abaixo e retorne para o e-mail indicado no cabeçalho."}),l.jsx(Xd,{pageNumber:1,totalPages:1,footerText:`Proposta válida até ${a(t.validUntil)}`})]})}Object.defineProperty(exports,"toast",{enumerable:!0,get:()=>h0.toast});exports.Accordion=zx;exports.AccordionContent=Rx;exports.AccordionItem=Ox;exports.AccordionTrigger=Px;exports.AdvancedDataTable=k0;exports.Alert=Ay;exports.AlertDescription=Oy;exports.AlertDialog=Py;exports.AlertDialogAction=Vy;exports.AlertDialogCancel=Gy;exports.AlertDialogContent=Hy;exports.AlertDialogDescription=Jy;exports.AlertDialogFooter=Uy;exports.AlertDialogHeader=Fy;exports.AlertDialogTitle=_y;exports.AlertDialogTrigger=Ry;exports.AlertTitle=zy;exports.AppLayoutPrimaryNav=nv;exports.AppLayoutSecondaryNav=rv;exports.AppLayoutUserMenu=E0;exports.AspectRatio=av;exports.AuthLayout=A0;exports.Avatar=Ft;exports.AvatarFallback=Ut;exports.AvatarImage=Ln;exports.Badge=pe;exports.BrandLogo=Ys;exports.Breadcrumb=z0;exports.BreadcrumbEllipsis=iv;exports.BreadcrumbItem=P0;exports.BreadcrumbLink=R0;exports.BreadcrumbList=O0;exports.BreadcrumbPage=B0;exports.BreadcrumbSeparator=H0;exports.Button=F;exports.Calendar=Qo;exports.Card=jr;exports.CardAction=Bx;exports.CardContent=ca;exports.CardDescription=m0;exports.CardFooter=g0;exports.CardHeader=la;exports.CardTitle=fa;exports.Carousel=sv;exports.CarouselContent=ov;exports.CarouselItem=lv;exports.CarouselNext=cv;exports.CarouselPrevious=fv;exports.ChartContainer=uv;exports.ChartLegend=gv;exports.ChartLegendContent=bv;exports.ChartTooltip=pv;exports.ChartTooltipContent=mv;exports.Checkbox=C0;exports.Collapsible=J0;exports.CollapsibleContent=G0;exports.CollapsibleTrigger=V0;exports.ColorPicker=xv;exports.Command=Q0;exports.CommandDialog=Mv;exports.CommandEmpty=Lv;exports.CommandGroup=Nv;exports.CommandInput=jv;exports.CommandItem=Sv;exports.CommandList=Cv;exports.CommandSeparator=kv;exports.CommandShortcut=Tv;exports.CommentSystem=TI;exports.CompactPageHeader=jA;exports.ContentSectionHeader=CA;exports.ContextMenu=II;exports.ContextMenuCheckboxItem=FI;exports.ContextMenuContent=BI;exports.ContextMenuGroup=EI;exports.ContextMenuItem=HI;exports.ContextMenuLabel=_I;exports.ContextMenuPortal=AI;exports.ContextMenuRadioGroup=OI;exports.ContextMenuRadioItem=UI;exports.ContextMenuSeparator=JI;exports.ContextMenuShortcut=VI;exports.ContextMenuSub=zI;exports.ContextMenuSubContent=RI;exports.ContextMenuSubTrigger=PI;exports.ContextMenuTrigger=DI;exports.ContractPrint=QI;exports.ContractPrintPreview=C2;exports.ContractTemplate=nu;exports.CurrencyInput=N2;exports.DataTable=N0;exports.DatePicker=Ec;exports.DateRangePicker=k2;exports.Dialog=_i;exports.DialogClose=wv;exports.DialogContent=Ji;exports.DialogDescription=Yi;exports.DialogFooter=Zo;exports.DialogHeader=Vi;exports.DialogTitle=Gi;exports.DialogTrigger=yv;exports.DocumentEditor=sD;exports.Drawer=oD;exports.DrawerClose=I2;exports.DrawerContent=E2;exports.DrawerDescription=z2;exports.DrawerFooter=cD;exports.DrawerHeader=fD;exports.DrawerTitle=A2;exports.DrawerTrigger=T2;exports.DropdownMenu=Hi;exports.DropdownMenuCheckboxItem=Qy;exports.DropdownMenuContent=Ui;exports.DropdownMenuGroup=I0;exports.DropdownMenuItem=gr;exports.DropdownMenuLabel=D0;exports.DropdownMenuPortal=Yy;exports.DropdownMenuRadioGroup=Wy;exports.DropdownMenuRadioItem=$y;exports.DropdownMenuSeparator=Qs;exports.DropdownMenuShortcut=Zy;exports.DropdownMenuSub=qy;exports.DropdownMenuSubContent=Xy;exports.DropdownMenuSubTrigger=Ky;exports.DropdownMenuTrigger=Fi;exports.EditableBadge=O2;exports.EditorialCalendar=I5;exports.EmptyCalendarIllustration=F4;exports.EmptyContractsIllustration=J4;exports.EmptyInboxIllustration=R4;exports.EmptyProjectsIllustration=H4;exports.EmptySearchIllustration=B4;exports.EmptyState=kf;exports.ErrorStateIllustration=U4;exports.FileAttachmentList=X5;exports.FileUploadZone=O8;exports.FilterBar=j0;exports.FilterBuilder=L0;exports.FilterChip=M0;exports.Form=E5;exports.FormControl=P5;exports.FormDescription=R5;exports.FormField=A5;exports.FormItem=z5;exports.FormLabel=O5;exports.FormMessage=B5;exports.GanttChart=m4;exports.GanttLegend=g4;exports.HoverCard=U5;exports.HoverCardContent=J5;exports.HoverCardTrigger=_5;exports.Illustrations=R8;exports.ImageWithFallback=M2;exports.Input=Ht;exports.InputGroup=L2;exports.InputGroupAddon=bc;exports.InputGroupButton=ZI;exports.InputGroupInput=KI;exports.InputGroupText=qI;exports.InputGroupTextarea=XI;exports.InputOTP=V5;exports.InputOTPGroup=G5;exports.InputOTPSeparator=Q5;exports.InputOTPSlot=Y5;exports.InputValidation=W5;exports.KPICard=x4;exports.KanbanCard=b4;exports.Label=Ue;exports.MentionList=Sd;exports.Menubar=eA;exports.MenubarCheckboxItem=oA;exports.MenubarContent=iA;exports.MenubarGroup=nA;exports.MenubarItem=sA;exports.MenubarLabel=fA;exports.MenubarMenu=tA;exports.MenubarPortal=y4;exports.MenubarRadioGroup=rA;exports.MenubarRadioItem=lA;exports.MenubarSeparator=cA;exports.MenubarShortcut=dA;exports.MenubarSub=uA;exports.MenubarSubContent=pA;exports.MenubarSubTrigger=hA;exports.MenubarTrigger=aA;exports.NavigationMenu=mA;exports.NavigationMenuContent=yA;exports.NavigationMenuItem=bA;exports.NavigationMenuLink=wA;exports.NavigationMenuList=gA;exports.NavigationMenuTrigger=xA;exports.NumberInput=Go;exports.PageHeader=MA;exports.Pagination=LA;exports.PaginationContent=NA;exports.PaginationEllipsis=IA;exports.PaginationItem=kA;exports.PaginationLink=hu;exports.PaginationNext=TA;exports.PaginationPrevious=SA;exports.PasswordInput=w4;exports.Popover=st;exports.PopoverContent=Ze;exports.PopoverTrigger=$e;exports.PrintFooter=Xd;exports.PrintHeader=eu;exports.PrintInfoGrid=mr;exports.PrintSection=it;exports.PrintSignature=tu;exports.PrintTable=Vo;exports.Progress=uu;exports.ProposalTemplate=B8;exports.RadioGroup=DA;exports.RadioGroupItem=EA;exports.ResizableHandle=OA;exports.ResizablePanel=zA;exports.ResizablePanelGroup=AA;exports.SavedFilters=PA;exports.ScrollArea=Wo;exports.ScrollBar=T0;exports.Select=en;exports.SelectContent=rn;exports.SelectGroup=Hx;exports.SelectItem=Dt;exports.SelectLabel=Fx;exports.SelectSeparator=Ux;exports.SelectTrigger=nn;exports.SelectValue=tn;exports.Separator=Hn;exports.Sheet=M4;exports.SheetClose=BA;exports.SheetContent=C4;exports.SheetDescription=k4;exports.SheetFooter=FA;exports.SheetHeader=L4;exports.SheetTitle=N4;exports.SheetTrigger=RA;exports.Sidebar=WA;exports.SidebarContent=t8;exports.SidebarFooter=XA;exports.SidebarGroup=n8;exports.SidebarGroupAction=a8;exports.SidebarGroupContent=i8;exports.SidebarGroupLabel=r8;exports.SidebarHeader=KA;exports.SidebarInset=qA;exports.SidebarMenu=s8;exports.SidebarMenuAction=c8;exports.SidebarMenuBadge=d8;exports.SidebarMenuButton=f8;exports.SidebarMenuItem=o8;exports.SidebarMenuSkeleton=u8;exports.SidebarMenuSub=h8;exports.SidebarMenuSubButton=m8;exports.SidebarMenuSubItem=p8;exports.SidebarProvider=QA;exports.SidebarRail=ZA;exports.SidebarSeparator=e8;exports.SidebarTrigger=$A;exports.Skeleton=Bn;exports.Slider=I4;exports.SocialButton=E4;exports.SuccessStateIllustration=_4;exports.Switch=A4;exports.Table=kc;exports.TableBody=Tc;exports.TableCaption=x0;exports.TableCell=qa;exports.TableFooter=b0;exports.TableHead=Ic;exports.TableHeader=Sc;exports.TablePagination=Dc;exports.TableRow=na;exports.Tabs=P2;exports.TabsContent=uD;exports.TabsList=R2;exports.TabsTrigger=_s;exports.TaskCalendar=D5;exports.TaskEditDialog=w8;exports.Textarea=ru;exports.TimePicker=mi;exports.Timeline=L8;exports.Toaster=N8;exports.Toggle=S2;exports.ToggleGroup=k8;exports.ToggleGroupItem=S8;exports.Tooltip=nt;exports.TooltipContent=at;exports.TooltipProvider=It;exports.TooltipTrigger=rt;exports.UnderlineTabs=T8;exports.UnderlineTabsContent=E8;exports.UnderlineTabsList=I8;exports.UnderlineTabsTrigger=D8;exports.badgeVariants=w0;exports.buttonVariants=Jn;exports.calculatePaginationMetadata=v0;exports.cn=w;exports.dadosContratoExemplo=YI;exports.getPageNumbers=y0;exports.navigationMenuTriggerStyle=v4;exports.socialButtonVariants=D4;exports.toggleVariants=au;exports.useFormField=ns;exports.useIsMobile=S4;exports.usePrintContract=j2;exports.useSidebar=rs;
224
224
  //# sourceMappingURL=index.cjs.map