@firecms/ui 3.0.0-canary.65 → 3.0.0-canary.67

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.umd.js CHANGED
@@ -887,7 +887,7 @@
887
887
  to {
888
888
  height: 0;
889
889
  }
890
- }`);const[y,h]=f.useState(i!==void 0?i:l),[K,s]=f.useState(y);return f.useEffect(()=>{y?setTimeout(()=>{s(!0)},220):s(!1)},[y]),f.useEffect(()=>{i!==void 0&&h(i)},[i]),o.jsx(o.Fragment,{children:o.jsxs($.Root,{className:u(!t&&J+" border","rounded-md","w-full"),open:y,onOpenChange:b=>{a?.(b),h(b)},children:[o.jsxs($.Trigger,{className:u(D,"rounded flex items-center justify-between w-full min-h-[52px]","hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-10",t?"border-b px-2":"p-4",t&&J,d&&z,_),children:[n,o.jsx(an,{className:u("transition",y?"rotate-180":"")})]}),o.jsx($.Content,{className:u("CollapsibleContent"),style:{overflow:K?"visible":"hidden"},children:o.jsx("div",{className:I,children:r})})]})})}function uen({accept:n,onFilesAdded:r,onFilesRejected:t,maxSize:i,disabled:a,maxFiles:l,title:_,uploadDescription:d,children:I,preventDropOnDocument:y=!0,size:h}){const{getRootProps:K,getInputProps:s,isDragActive:b,isDragAccept:w,isDragReject:S}=eo.useDropzone({accept:n,noDragEventsBubbling:!0,maxSize:i,onDrop:r,onDropRejected:t,disabled:a,maxFiles:l,preventDropOnDocument:y});return o.jsxs("div",{...K(),className:u(z,G,D,"flex gap-2","p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",{"h-44":h==="medium","h-28":h==="small","cursor-pointer":!a,"hover:bg-field-hover dark:hover:bg-field-hover-dark":!b,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500":S,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-green-500":w}),children:[o.jsx(en,{variant:"caption",color:"secondary",className:"absolute top-2 left-3.5 cursor-inherit",children:_}),o.jsx("input",{...s()}),I,o.jsx("div",{className:"flex-grow h-28 box-border flex flex-col items-center justify-center text-center",children:o.jsx(en,{align:"center",variant:"label",children:d})})]})}const _en={info:"bg-sky-200 dark:bg-teal-900",warn:"bg-orange-200 dark:bg-yellow-950"};function den({children:n,mode:r="info"}){return o.jsx("div",{className:u("my-3 py-2 px-4 rounded",_en[r]),children:n})}function Ien({children:n,loading:r,disabled:t,onClick:i,startIcon:a,...l}){return o.jsxs(Ln,{disabled:r||t,onClick:i,component:l.component,...l,children:[r&&o.jsx(sn,{size:"small"}),!r&&a,n]})}const fen={small:"prose-sm text-sm",medium:"prose text-base",large:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"},yen=new ro({html:!0}),sen=f.memo(function({source:r,className:t,size:i="medium"}){const a=f.useMemo(()=>yen.render(typeof r=="string"?r:""),[r]);return o.jsx("div",{className:u(fen[i],"dark:prose-invert prose-headings:font-title",t),dangerouslySetInnerHTML:{__html:a}})},co);function gen({children:n,trigger:r,open:t,defaultOpen:i,onOpenChange:a,portalContainer:l}){return o.jsxs(X.Root,{open:t,defaultOpen:i,onOpenChange:a,children:[o.jsx(X.Trigger,{asChild:!0,children:r}),o.jsx(X.Portal,{container:l,children:o.jsx(X.Content,{className:u(Z,"shadow py-2 z-30"),children:n})})]})}function hen({children:n,dense:r=!1,onClick:t}){const i=u(D,t&&"cursor-pointer","rounded-md text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4",r?"px-3 py-1.5":"px-4 py-2");return o.jsx(X.Item,{className:i,onClick:t,children:n})}function Ken({children:n,className:r}){return o.jsx(L.Root,{className:u("z-10 flex bg-white dark:bg-gray-950 p-[3px] rounded-sm shadow-sm",r),children:n})}function ben({children:n}){return o.jsx(L.Menu,{children:n})}function ken({children:n,className:r}){return o.jsx(L.Trigger,{className:u("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-gray-100 data-[highlighted]:dark:bg-gray-800 data-[state=open]:bg-gray-100 data-[state=open]:dark:bg-gray-800",r),children:n})}function wen({children:n}){return o.jsx(L.Portal,{children:n})}function pen({children:n,className:r,align:t,sideOffset:i,alignOffset:a,...l}){return o.jsx(L.Content,{className:u("min-w-[220px] bg-white dark:bg-gray-950 rounded-md p-[6px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)] will-change-[transform,opacity]",r),align:t??"start",sideOffset:i??5,alignOffset:a??-3,...l,children:n})}function ven({children:n,leftPadding:r,className:t,disabled:i,...a}){return o.jsx(L.Item,{className:u("group text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none outline-none data-[state=open]:bg-gray-100 data-[state=open]:dark:bg-gray-800 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-gray-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r?"pl-5":"",t),disabled:i,...a,children:n})}function Sen({children:n,className:r,...t}){return o.jsx(L.Separator,{className:u("h-[1px] bg-gray-100 dark:bg-gray-800 m-[5px]",r),...t,children:n})}function Cen({children:n,...r}){return o.jsx(L.Sub,{...r,children:n})}function Aen({children:n,className:r,...t}){return o.jsx(L.SubTrigger,{className:u("group text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none outline-none data-[state=open]:bg-gray-100 data-[state=open]:dark:bg-gray-800 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-gray-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r),...t,children:n})}function men({children:n,alignOffset:r,className:t,...i}){return o.jsx(L.SubContent,{alignOffset:r??-5,className:u("min-w-[220px] bg-white dark:bg-gray-950 rounded-md p-[6px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)] will-change-[transform,opacity]",t),...i,children:n})}function Pen({children:n,checked:r,onCheckedChange:t,className:i,...a}){return o.jsx(L.CheckboxItem,{className:u("text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none pl-5 outline-none data-[highlighted]:bg-gray-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",i),checked:r,onCheckedChange:t,...a,children:n})}function Den({children:n,className:r,...t}){return o.jsx(L.ItemIndicator,{className:u("absolute left-0 w-4 inline-flex items-center justify-center",r),...t,children:n??o.jsx(on,{size:"smallest"})})}function Ben({children:n,className:r,value:t,onValueChange:i,...a}){return o.jsx(L.RadioGroup,{className:u(r),value:t,onValueChange:i,...a,children:n??o.jsx(on,{size:"small"})})}function Fen({children:n,className:r,value:t,...i}){return o.jsx(L.RadioItem,{className:u("text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none pl-5 outline-none data-[highlighted]:bg-gray-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r),value:t,...i,children:n??o.jsx(on,{size:"small"})})}function Men({children:n,className:r,...t}){return o.jsx("div",{className:u("ml-auto pl-5 group-data-[highlighted]:text-white group-data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark",r),children:n})}function Ten(){return o.jsx("div",{className:"ml-auto pl-5 ",children:o.jsx(Hn,{size:"small"})})}function Gn({children:n,error:r}){return o.jsx("div",{className:u("text-sm font-medium ml-3.5 mb-1",r?"text-red-500 dark:text-red-600":"text-slate-500 dark:text-slate-300"),children:n})}const kn=k.createContext({});function Len({value:n,open:r,onMultiValueChange:t,size:i="medium",label:a,disabled:l,renderValue:_,renderValues:d,includeFocusOutline:I=!0,containerClassName:y,className:h,children:K,error:s}){const b=k.useRef(null),w=k.useRef(null),S=k.useRef(null);yn(S,()=>v(!1));const[P,v]=k.useState(!1);f.useEffect(()=>{v(r??!1)},[r]);const F=k.useCallback(g=>{Array.isArray(n)&&n.includes(g)?t?.(n.filter(A=>A!==g)):t?.([...n??[],g])},[n,t]),[C,M]=k.useState(""),[O,N]=k.useState(null),U=k.useCallback(g=>{const A=w.current;if(A){if((g.key==="Delete"||g.key==="Backspace")&&A.value===""){const m=[...n??[]];m.pop(),t?.(m)}g.key==="Escape"&&(A.blur(),v(!1),g.stopPropagation())}},[t,n]),W=k.useCallback(()=>{N(b.current?.getBoundingClientRect()??null),v(!0)},[]),T=O??b.current?.getBoundingClientRect(),q=window.innerHeight-(T?.top??0)-(T?.height??0)-16;return o.jsxs(o.Fragment,{children:[typeof a=="string"?o.jsx(Gn,{error:s,children:a}):a,o.jsxs(rn.Command,{onKeyDown:U,onClick:()=>{w.current?.focus(),W()},className:u("relative overflow-visible bg-transparent",y),children:[o.jsxs("div",{ref:b,className:u("flex flex-row",i==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",z,l?Q:G,"relative flex items-center","p-4",s?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",s?"border border-red-500 dark:border-red-600":"",I?D:"",h),children:[o.jsxs("div",{className:u("flex-grow flex gap-1.5 flex-wrap items-center"),children:[_&&(n??[]).map((g,A)=>_(g,A)),d&&d(n??[]),o.jsx(rn.Command.Input,{ref:w,value:C,onValueChange:M,onFocus:W,className:"ml-2 bg-transparent outline-none flex-1 h-full w-full "})]}),o.jsx("div",{className:"px-2 h-full flex items-center",children:o.jsx(an,{size:"small",className:u("transition ",P?"rotate-180":"")})})]}),o.jsx(E.Root,{open:P,onOpenChange:v,children:o.jsx(E.Portal,{children:o.jsx(kn.Provider,{value:{fieldValue:n,setInputValue:M,onValueChangeInternal:F},children:o.jsx("div",{ref:S,className:"z-50 absolute overflow-auto outline-none",style:{pointerEvents:P?"auto":"none",top:(T?.top??0)+(T?.height??0),left:T?.left,width:T?.width,maxHeight:q},children:o.jsx(rn.Command.Group,{className:"mt-2 text-slate-900 dark:text-white animate-in z-50 border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg flex flex-col outline-none w-full",children:K})})})})})]})]})}function Oen({children:n,value:r,className:t}){const i=k.useContext(kn);if(!i)throw new Error("MultiSelectItem must be used inside a MultiSelect");const{fieldValue:a,setInputValue:l,onValueChangeInternal:_}=i;return o.jsx(rn.Command.Item,{onMouseDown:d=>{d.preventDefault(),d.stopPropagation()},onSelect:d=>{l(""),_(r)},className:u((a??[]).includes(r)?"bg-slate-200 dark:bg-slate-950":"","cursor-pointer","m-1","ring-offset-transparent","p-2 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2","aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900","cursor-pointer p-2 rounded aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900",t),children:n})}function Nen({children:n,style:r,className:t}){return o.jsx("div",{className:u(Z,t),style:r,children:n})}const Un=k.forwardRef(({className:n,...r},t)=>o.jsx(x.Root,{className:u("grid gap-2",n),...r,ref:t}));Un.displayName=x.Root.displayName;const qn=k.forwardRef(({className:n,...r},t)=>o.jsx(x.Item,{ref:t,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...r,children:o.jsx(x.Indicator,{className:"flex items-center justify-center",children:o.jsx("div",{className:"h-2.5 w-2.5 fill-current text-current bg-primary rounded-lg"})})}));qn.displayName=x.Item.displayName;function Een({onClick:n,onTextSearch:r,placeholder:t="Search",expandable:i=!1,large:a=!1,innerClassName:l,className:_,autoFocus:d,disabled:I,loading:y,inputRef:h}){const[K,s]=f.useState(""),[b,w]=f.useState(!1),S=Bn(K,200);f.useEffect(()=>{r&&r(S||void 0)},[S]);const P=f.useCallback(()=>{r&&(s(""),r(void 0))},[r]);return o.jsxs("div",{onClick:n,className:u("relative",a?"h-14":"h-[42px]","bg-slate-50 dark:bg-gray-800 border",J,"rounded",_),children:[o.jsx("div",{className:"absolute p-0 px-4 h-full pointer-events-none flex items-center justify-center top-0",children:y?o.jsx(sn,{size:"small"}):o.jsx(Vn,{className:"text-slate-500 dark:text-gray-500"})}),o.jsx("input",{value:K??"",ref:h,onClick:n,placeholder:t,readOnly:!r,onChange:r?v=>{s(v.target.value)}:void 0,autoFocus:d,onFocus:()=>w(!0),onBlur:()=>w(!1),className:u((I||y)&&"pointer-events-none","relative flex items-center rounded transition-all bg-transparent outline-none appearance-none border-none","pl-12 h-full text-current ",i?b?"w-[220px]":"w-[180px]":"",D,l)}),K?o.jsx(ln,{className:`${a?"mr-2 top-1":"mr-1 top-0"} absolute right-0 z-10`,onClick:P,children:o.jsx(gn,{size:"small"})}):o.jsx("div",{style:{width:26}})]})}function Hen({inputRef:n,open:r,name:t,id:i,onOpenChange:a,value:l,onChange:_,onValueChange:d,onMultiValueChange:I,className:y,inputClassName:h,placeholder:K,renderValue:s,renderValues:b,label:w,size:S="medium",includeFocusOutline:P=!0,error:v,disabled:F,padding:C=!0,position:M="item-aligned",endAdornment:O,multiple:N,invisible:U,children:W,...T}){const[q,g]=f.useState(!1);f.useEffect(()=>{g(r??!1)},[r]);const A=f.useCallback(p=>{N?Array.isArray(l)&&l.includes(p)?I?.(l.filter(V=>V!==p)):I?.([...l??[],p]):d?.(p),!N&&_&&_({target:{name:t,value:p}})},[N,_,l,I,d]),m=Array.isArray(l)?l.length>0:l!=null;return o.jsxs(H.Root,{name:t,value:Array.isArray(l)?void 0:l,defaultOpen:r,open:q,disabled:F,onValueChange:A,onOpenChange:p=>{a?.(p),g(p)},...T,children:[typeof w=="string"?o.jsx(Gn,{error:v,children:w}):w,o.jsxs("div",{className:u(S==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",U?fn:z,F?Q:G,"relative flex items-center",y),children:[o.jsxs(H.Trigger,{ref:n,id:i,className:u("w-full h-full",S==="small"?"h-[42px]":"h-[64px]",C?"px-4 ":"","outline-none focus:outline-none","select-none rounded-md text-sm",v?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",v?"border border-red-500 dark:border-red-600":"",F?"text-slate-600 dark:text-slate-400":"text-slate-800 dark:text-white","relative flex items-center",P?D:"",h),children:[o.jsx("div",{className:u("flex-grow w-full max-w-full flex flex-row gap-2 items-center","overflow-visible",S==="small"?"h-[42px]":"h-[64px]"),children:o.jsxs(H.Value,{placeholder:K,children:[s&&(m&&Array.isArray(l)?l.map((p,V)=>o.jsx("div",{className:"flex items-center gap-1 max-w-full",children:s?s(p,V):p},p)):typeof l=="string"?s?s(l,0):l:K),b&&(!m||Array.isArray(l))?b(l??[]):null,!s&&!b&&m]})}),o.jsx(H.Icon,{className:u("px-2 h-full flex items-center"),children:o.jsx(an,{size:"small",className:u("transition",r?"rotate-180":"")})})]}),O&&o.jsx("div",{className:u("absolute h-full flex items-center",S==="small"?"right-10":"right-14"),onClick:p=>p.stopPropagation(),children:O})]}),o.jsx(H.Portal,{children:o.jsx(H.Content,{position:M,className:"z-50 relative overflow-hidden border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg",children:o.jsx(H.Viewport,{className:"p-1",style:{maxHeight:"var(--radix-select-content-available-height)"},children:W})})})]})}function Wen({value:n,children:r,disabled:t,className:i}){return o.jsxs(H.Item,{value:n,disabled:t,onClick:a=>{a.preventDefault(),a.stopPropagation()},className:u("w-full","relative relative flex items-center p-2 rounded-md text-sm text-slate-700 dark:text-slate-300",D,"focus:z-10","data-[state=checked]:bg-slate-100 data-[state=checked]:dark:bg-slate-900 focus:bg-slate-100 dark:focus:bg-slate-950","data-[state=checked]:focus:bg-slate-200 data-[state=checked]:dark:focus:bg-slate-950",t?"opacity-50 cursor-not-allowed":"cursor-pointer","[&>*]:w-full","overflow-visible",i),children:[o.jsx(H.ItemText,{children:r}),o.jsx("div",{className:"absolute left-1 data-[state=checked]:block hidden",children:o.jsx(on,{size:16})})]},n)}function Ven({label:n,children:r,className:t}){return o.jsxs(o.Fragment,{children:[o.jsx(H.Group,{className:u("text-xs text-slate-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2","px-2 py-2",t),children:n}),r]})}function zen({orientation:n,decorative:r}){return n==="horizontal"?o.jsx(Sn.Root,{decorative:r,orientation:"horizontal",className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-[8px]"}):o.jsx(Sn.Root,{className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-[8px]",decorative:r,orientation:"vertical"})}const Gen=({children:n,side:r="right",open:t,onOpenChange:i,transparent:a,...l})=>{const[_,d]=f.useState(!1);f.useEffect(()=>{if(t)return d(!0),()=>{};{const y=setTimeout(()=>{d(!1)},250);return()=>clearTimeout(y)}},[t]);const I={top:"-translate-y-full",bottom:"translate-y-full",left:"-translate-x-full",right:"translate-x-full"};return o.jsx(E.Root,{open:_||t,onOpenChange:i,children:o.jsxs(E.Portal,{children:[o.jsx(E.Overlay,{className:u("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 backdrop-blur-sm",a?"bg-white bg-opacity-80":"bg-black bg-opacity-50","dark:bg-black dark:bg-opacity-60",_&&t?"opacity-100":"opacity-0"),style:{pointerEvents:_?"auto":"none"}}),o.jsx(E.Content,{...l,className:u("will-change-transform","text-slate-900 dark:text-white","fixed transform z-20 transition-all duration-[240ms] ease-in-out","outline-none focus:outline-none",a?"":"shadow-md",r==="top"||r==="bottom"?"w-full":"h-full",r==="left"||r==="top"?"left-0 top-0":"right-0 bottom-0",_&&t?"opacity-100":"opacity-0",!_||!t?I[r]:""),children:n})]})})};function cn(n){return parseInt(n,10)||0}const Uen={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function jn(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflow}const Qn=k.forwardRef(function(r,t){const{onChange:i,onScroll:a,onResize:l,maxRows:_,minRows:d=1,style:I,value:y,onFocus:h,onBlur:K,sizeRef:s,ignoreBoxSizing:b,...w}=r,{current:S}=k.useRef(y!=null),P=k.useRef(null),v=qen(t,P),F=k.useRef(null),C=k.useRef(0),[M,O]=k.useState({outerHeightStyle:0}),N=k.useCallback(()=>{const g=P.current;if(typeof window>"u")return{outerHeightStyle:0};const m=window.getComputedStyle(g);if(m.width==="0px")return{outerHeightStyle:0};const p=s?.current??F.current,V=F.current;p.style.width=m.width,V.value=g.value||r.placeholder||"x",V.value.slice(-1)===`
890
+ }`);const[y,h]=f.useState(i!==void 0?i:l),[K,s]=f.useState(y);return f.useEffect(()=>{y?setTimeout(()=>{s(!0)},220):s(!1)},[y]),f.useEffect(()=>{i!==void 0&&h(i)},[i]),o.jsx(o.Fragment,{children:o.jsxs($.Root,{className:u(!t&&J+" border","rounded-md","w-full"),open:y,onOpenChange:b=>{a?.(b),h(b)},children:[o.jsxs($.Trigger,{className:u(D,"rounded flex items-center justify-between w-full min-h-[52px]","hover:bg-slate-50 dark:hover:bg-gray-800 dark:hover:bg-opacity-10",t?"border-b px-2":"p-4",t&&J,d&&z,_),children:[n,o.jsx(an,{className:u("transition",y?"rotate-180":"")})]}),o.jsx($.Content,{className:u("CollapsibleContent"),style:{overflow:K?"visible":"hidden"},children:o.jsx("div",{className:I,children:r})})]})})}function uen({accept:n,onFilesAdded:r,onFilesRejected:t,maxSize:i,disabled:a,maxFiles:l,title:_,uploadDescription:d,children:I,preventDropOnDocument:y=!0,size:h}){const{getRootProps:K,getInputProps:s,isDragActive:b,isDragAccept:w,isDragReject:S}=eo.useDropzone({accept:n,noDragEventsBubbling:!0,maxSize:i,onDrop:r,onDropRejected:t,disabled:a,maxFiles:l,preventDropOnDocument:y});return o.jsxs("div",{...K(),className:u(z,G,D,"flex gap-2","p-4 box-border relative items-center border-2 border-solid border-transparent outline-none rounded-md duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] focus:border-primary-solid",{"h-44":h==="medium","h-28":h==="small","cursor-pointer":!a,"hover:bg-field-hover dark:hover:bg-field-hover-dark":!b,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-red-500":S,"transition-colors duration-200 ease-[cubic-bezier(0,0,0.2,1)] border-green-500":w}),children:[o.jsx(en,{variant:"caption",color:"secondary",className:"absolute top-2 left-3.5 cursor-inherit",children:_}),o.jsx("input",{...s()}),I,o.jsx("div",{className:"flex-grow h-28 box-border flex flex-col items-center justify-center text-center",children:o.jsx(en,{align:"center",variant:"label",children:d})})]})}const _en={info:"bg-sky-200 dark:bg-teal-900",warn:"bg-orange-200 dark:bg-yellow-950"};function den({children:n,mode:r="info"}){return o.jsx("div",{className:u("my-3 py-2 px-4 rounded",_en[r]),children:n})}function Ien({children:n,loading:r,disabled:t,onClick:i,startIcon:a,...l}){return o.jsxs(Ln,{disabled:r||t,onClick:i,component:l.component,...l,children:[r&&o.jsx(sn,{size:"small"}),!r&&a,n]})}const fen={small:"prose-sm text-sm",medium:"prose text-base",large:"prose-lg",xl:"prose-xl","2xl":"prose-2xl"},yen=new ro({html:!0}),sen=f.memo(function({source:r,className:t,size:i="medium"}){const a=f.useMemo(()=>yen.render(typeof r=="string"?r:""),[r]);return o.jsx("div",{className:u(fen[i],"dark:prose-invert prose-headings:font-title",t),dangerouslySetInnerHTML:{__html:a}})},co);function gen({children:n,trigger:r,open:t,defaultOpen:i,onOpenChange:a,portalContainer:l}){return o.jsxs(X.Root,{open:t,defaultOpen:i,onOpenChange:a,children:[o.jsx(X.Trigger,{asChild:!0,children:r}),o.jsx(X.Portal,{container:l,children:o.jsx(X.Content,{className:u(Z,"shadow py-2 z-30"),children:n})})]})}function hen({children:n,dense:r=!1,onClick:t}){const i=u(D,t&&"cursor-pointer","rounded-md text-sm font-medium text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-900 flex items-center gap-4",r?"px-3 py-1.5":"px-4 py-2");return o.jsx(X.Item,{className:i,onClick:t,children:n})}function Ken({children:n,className:r}){return o.jsx(L.Root,{className:u("z-10 flex bg-white dark:bg-gray-950 p-[3px] rounded-sm shadow-sm",r),children:n})}function ben({children:n}){return o.jsx(L.Menu,{children:n})}function ken({children:n,className:r}){return o.jsx(L.Trigger,{className:u("py-2 px-3 outline-none select-none font-medium leading-none rounded text-text-primary dark:text-text-primary-dark text-[13px] flex items-center justify-between gap-[2px] data-[highlighted]:bg-slate-100 data-[highlighted]:dark:bg-gray-800 data-[state=open]:bg-slate-100 data-[state=open]:dark:bg-gray-800 hover:bg-slate-200 hover:bg-opacity-75 dark:hover:bg-gray-700 dark:hover:bg-opacity-50",r),children:n})}function wen({children:n}){return o.jsx(L.Portal,{children:n})}function pen({children:n,className:r,align:t,sideOffset:i,alignOffset:a,...l}){return o.jsx(L.Content,{className:u("min-w-[220px] bg-white dark:bg-gray-950 rounded-md p-[6px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)] will-change-[transform,opacity]",r),align:t??"start",sideOffset:i??5,alignOffset:a??-3,...l,children:n})}function ven({children:n,leftPadding:r,className:t,disabled:i,...a}){return o.jsx(L.Item,{className:u("group text-[13px] leading-none rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none outline-none data-[state=open]:bg-slate-100 data-[state=open]:dark:bg-gray-800 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-slate-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r?"pl-5":"",i?"pointer-events-none text-text-secondary dark:text-text-secondary-dark":"text-text-primary dark:text-text-primary-dark",t),disabled:i,...a,children:n})}function Sen({children:n,className:r,...t}){return o.jsx(L.Separator,{className:u("h-[1px] bg-slate-100 dark:bg-gray-800 m-[5px]",r),...t,children:n})}function Cen({children:n,...r}){return o.jsx(L.Sub,{...r,children:n})}function Aen({children:n,className:r,...t}){return o.jsx(L.SubTrigger,{className:u("group text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none outline-none data-[state=open]:bg-slate-100 data-[state=open]:dark:bg-gray-800 data-[state=open]:text-text-primary data-[state=open]:dark:text-text-primary-dark data-[highlighted]:bg-slate-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r),...t,children:n})}function men({children:n,alignOffset:r,className:t,...i}){return o.jsx(L.SubContent,{alignOffset:r??-5,className:u("min-w-[220px] bg-white dark:bg-gray-950 rounded-md p-[6px] shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)] will-change-[transform,opacity]",t),...i,children:n})}function Pen({children:n,checked:r,onCheckedChange:t,className:i,...a}){return o.jsx(L.CheckboxItem,{className:u("text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none pl-5 outline-none data-[highlighted]:bg-slate-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",i),checked:r,onCheckedChange:t,...a,children:n})}function Den({children:n,className:r,...t}){return o.jsx(L.ItemIndicator,{className:u("absolute left-0 w-4 inline-flex items-center justify-center",r),...t,children:n??o.jsx(on,{size:"smallest"})})}function Ben({children:n,className:r,value:t,onValueChange:i,...a}){return o.jsx(L.RadioGroup,{className:u(r),value:t,onValueChange:i,...a,children:n??o.jsx(on,{size:"small"})})}function Fen({children:n,className:r,value:t,...i}){return o.jsx(L.RadioItem,{className:u("text-[13px] leading-none text-text-primary dark:text-text-primary-dark rounded flex items-center h-[32px] px-[10px] py-[2px] relative select-none pl-5 outline-none data-[highlighted]:bg-slate-100 data-[highlighted]:dark:bg-gray-800 data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark data-[disabled]:pointer-events-none",r),value:t,...i,children:n??o.jsx(on,{size:"small"})})}function Men({children:n,className:r,...t}){return o.jsx("div",{className:u("ml-auto pl-5 group-data-[disabled]:text-disabled data-[disabled]:dark:text-disabled-dark",r),...t,children:n})}function Ten(){return o.jsx("div",{className:"ml-auto pl-5 ",children:o.jsx(Hn,{size:"small"})})}function Gn({children:n,error:r}){return o.jsx("div",{className:u("text-sm font-medium ml-3.5 mb-1",r?"text-red-500 dark:text-red-600":"text-slate-500 dark:text-slate-300"),children:n})}const kn=k.createContext({});function Len({value:n,open:r,onMultiValueChange:t,size:i="medium",label:a,disabled:l,renderValue:_,renderValues:d,includeFocusOutline:I=!0,containerClassName:y,className:h,children:K,error:s}){const b=k.useRef(null),w=k.useRef(null),S=k.useRef(null);yn(S,()=>v(!1));const[P,v]=k.useState(!1);f.useEffect(()=>{v(r??!1)},[r]);const F=k.useCallback(g=>{Array.isArray(n)&&n.includes(g)?t?.(n.filter(A=>A!==g)):t?.([...n??[],g])},[n,t]),[C,M]=k.useState(""),[O,N]=k.useState(null),U=k.useCallback(g=>{const A=w.current;if(A){if((g.key==="Delete"||g.key==="Backspace")&&A.value===""){const m=[...n??[]];m.pop(),t?.(m)}g.key==="Escape"&&(A.blur(),v(!1),g.stopPropagation())}},[t,n]),W=k.useCallback(()=>{N(b.current?.getBoundingClientRect()??null),v(!0)},[]),T=O??b.current?.getBoundingClientRect(),q=window.innerHeight-(T?.top??0)-(T?.height??0)-16;return o.jsxs(o.Fragment,{children:[typeof a=="string"?o.jsx(Gn,{error:s,children:a}):a,o.jsxs(rn.Command,{onKeyDown:U,onClick:()=>{w.current?.focus(),W()},className:u("relative overflow-visible bg-transparent",y),children:[o.jsxs("div",{ref:b,className:u("flex flex-row",i==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",z,l?Q:G,"relative flex items-center","p-4",s?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",s?"border border-red-500 dark:border-red-600":"",I?D:"",h),children:[o.jsxs("div",{className:u("flex-grow flex gap-1.5 flex-wrap items-center"),children:[_&&(n??[]).map((g,A)=>_(g,A)),d&&d(n??[]),o.jsx(rn.Command.Input,{ref:w,value:C,onValueChange:M,onFocus:W,className:"ml-2 bg-transparent outline-none flex-1 h-full w-full "})]}),o.jsx("div",{className:"px-2 h-full flex items-center",children:o.jsx(an,{size:"small",className:u("transition ",P?"rotate-180":"")})})]}),o.jsx(E.Root,{open:P,onOpenChange:v,children:o.jsx(E.Portal,{children:o.jsx(kn.Provider,{value:{fieldValue:n,setInputValue:M,onValueChangeInternal:F},children:o.jsx("div",{ref:S,className:"z-50 absolute overflow-auto outline-none",style:{pointerEvents:P?"auto":"none",top:(T?.top??0)+(T?.height??0),left:T?.left,width:T?.width,maxHeight:q},children:o.jsx(rn.Command.Group,{className:"mt-2 text-slate-900 dark:text-white animate-in z-50 border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg flex flex-col outline-none w-full",children:K})})})})})]})]})}function Oen({children:n,value:r,className:t}){const i=k.useContext(kn);if(!i)throw new Error("MultiSelectItem must be used inside a MultiSelect");const{fieldValue:a,setInputValue:l,onValueChangeInternal:_}=i;return o.jsx(rn.Command.Item,{onMouseDown:d=>{d.preventDefault(),d.stopPropagation()},onSelect:d=>{l(""),_(r)},className:u((a??[]).includes(r)?"bg-slate-200 dark:bg-slate-950":"","cursor-pointer","m-1","ring-offset-transparent","p-2 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2","aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900","cursor-pointer p-2 rounded aria-[selected=true]:bg-slate-100 aria-[selected=true]:dark:bg-slate-900",t),children:n})}function Nen({children:n,style:r,className:t}){return o.jsx("div",{className:u(Z,t),style:r,children:n})}const Un=k.forwardRef(({className:n,...r},t)=>o.jsx(x.Root,{className:u("grid gap-2",n),...r,ref:t}));Un.displayName=x.Root.displayName;const qn=k.forwardRef(({className:n,...r},t)=>o.jsx(x.Item,{ref:t,className:u("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...r,children:o.jsx(x.Indicator,{className:"flex items-center justify-center",children:o.jsx("div",{className:"h-2.5 w-2.5 fill-current text-current bg-primary rounded-lg"})})}));qn.displayName=x.Item.displayName;function Een({onClick:n,onTextSearch:r,placeholder:t="Search",expandable:i=!1,large:a=!1,innerClassName:l,className:_,autoFocus:d,disabled:I,loading:y,inputRef:h}){const[K,s]=f.useState(""),[b,w]=f.useState(!1),S=Bn(K,200);f.useEffect(()=>{r&&r(S||void 0)},[S]);const P=f.useCallback(()=>{r&&(s(""),r(void 0))},[r]);return o.jsxs("div",{onClick:n,className:u("relative",a?"h-14":"h-[42px]","bg-slate-50 dark:bg-gray-800 border",J,"rounded",_),children:[o.jsx("div",{className:"absolute p-0 px-4 h-full pointer-events-none flex items-center justify-center top-0",children:y?o.jsx(sn,{size:"small"}):o.jsx(Vn,{className:"text-slate-500 dark:text-gray-500"})}),o.jsx("input",{value:K??"",ref:h,onClick:n,placeholder:t,readOnly:!r,onChange:r?v=>{s(v.target.value)}:void 0,autoFocus:d,onFocus:()=>w(!0),onBlur:()=>w(!1),className:u((I||y)&&"pointer-events-none","relative flex items-center rounded transition-all bg-transparent outline-none appearance-none border-none","pl-12 h-full text-current ",i?b?"w-[220px]":"w-[180px]":"",D,l)}),K?o.jsx(ln,{className:`${a?"mr-2 top-1":"mr-1 top-0"} absolute right-0 z-10`,onClick:P,children:o.jsx(gn,{size:"small"})}):o.jsx("div",{style:{width:26}})]})}function Hen({inputRef:n,open:r,name:t,id:i,onOpenChange:a,value:l,onChange:_,onValueChange:d,onMultiValueChange:I,className:y,inputClassName:h,placeholder:K,renderValue:s,renderValues:b,label:w,size:S="medium",includeFocusOutline:P=!0,error:v,disabled:F,padding:C=!0,position:M="item-aligned",endAdornment:O,multiple:N,invisible:U,children:W,...T}){const[q,g]=f.useState(!1);f.useEffect(()=>{g(r??!1)},[r]);const A=f.useCallback(p=>{N?Array.isArray(l)&&l.includes(p)?I?.(l.filter(V=>V!==p)):I?.([...l??[],p]):d?.(p),!N&&_&&_({target:{name:t,value:p}})},[N,_,l,I,d]),m=Array.isArray(l)?l.length>0:l!=null;return o.jsxs(H.Root,{name:t,value:Array.isArray(l)?void 0:l,defaultOpen:r,open:q,disabled:F,onValueChange:A,onOpenChange:p=>{a?.(p),g(p)},...T,children:[typeof w=="string"?o.jsx(Gn,{error:v,children:w}):w,o.jsxs("div",{className:u(S==="small"?"min-h-[42px]":"min-h-[64px]","select-none rounded-md text-sm",U?fn:z,F?Q:G,"relative flex items-center",y),children:[o.jsxs(H.Trigger,{ref:n,id:i,className:u("w-full h-full",S==="small"?"h-[42px]":"h-[64px]",C?"px-4 ":"","outline-none focus:outline-none","select-none rounded-md text-sm",v?"text-red-500 dark:text-red-600":"focus:text-text-primary dark:focus:text-text-primary-dark",v?"border border-red-500 dark:border-red-600":"",F?"text-slate-600 dark:text-slate-400":"text-slate-800 dark:text-white","relative flex items-center",P?D:"",h),children:[o.jsx("div",{className:u("flex-grow w-full max-w-full flex flex-row gap-2 items-center","overflow-visible",S==="small"?"h-[42px]":"h-[64px]"),children:o.jsxs(H.Value,{placeholder:K,children:[s&&(m&&Array.isArray(l)?l.map((p,V)=>o.jsx("div",{className:"flex items-center gap-1 max-w-full",children:s?s(p,V):p},p)):typeof l=="string"?s?s(l,0):l:K),b&&(!m||Array.isArray(l))?b(l??[]):null,!s&&!b&&m]})}),o.jsx(H.Icon,{className:u("px-2 h-full flex items-center"),children:o.jsx(an,{size:"small",className:u("transition",r?"rotate-180":"")})})]}),O&&o.jsx("div",{className:u("absolute h-full flex items-center",S==="small"?"right-10":"right-14"),onClick:p=>p.stopPropagation(),children:O})]}),o.jsx(H.Portal,{children:o.jsx(H.Content,{position:M,className:"z-50 relative overflow-hidden border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-800 p-2 rounded-lg shadow-lg",children:o.jsx(H.Viewport,{className:"p-1",style:{maxHeight:"var(--radix-select-content-available-height)"},children:W})})})]})}function Wen({value:n,children:r,disabled:t,className:i}){return o.jsxs(H.Item,{value:n,disabled:t,onClick:a=>{a.preventDefault(),a.stopPropagation()},className:u("w-full","relative relative flex items-center p-2 rounded-md text-sm text-slate-700 dark:text-slate-300",D,"focus:z-10","data-[state=checked]:bg-slate-100 data-[state=checked]:dark:bg-slate-900 focus:bg-slate-100 dark:focus:bg-slate-950","data-[state=checked]:focus:bg-slate-200 data-[state=checked]:dark:focus:bg-slate-950",t?"opacity-50 cursor-not-allowed":"cursor-pointer","[&>*]:w-full","overflow-visible",i),children:[o.jsx(H.ItemText,{children:r}),o.jsx("div",{className:"absolute left-1 data-[state=checked]:block hidden",children:o.jsx(on,{size:16})})]},n)}function Ven({label:n,children:r,className:t}){return o.jsxs(o.Fragment,{children:[o.jsx(H.Group,{className:u("text-xs text-slate-900 dark:text-white uppercase tracking-wider font-bold mt-6 first:mt-2","px-2 py-2",t),children:n}),r]})}function zen({orientation:n,decorative:r}){return n==="horizontal"?o.jsx(Sn.Root,{decorative:r,orientation:"horizontal",className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px my-[8px]"}):o.jsx(Sn.Root,{className:"dark:bg-opacity-50 bg-opacity-50 dark:bg-gray-600 bg-gray-300 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px mx-[8px]",decorative:r,orientation:"vertical"})}const Gen=({children:n,side:r="right",open:t,onOpenChange:i,transparent:a,...l})=>{const[_,d]=f.useState(!1);f.useEffect(()=>{if(t)return d(!0),()=>{};{const y=setTimeout(()=>{d(!1)},250);return()=>clearTimeout(y)}},[t]);const I={top:"-translate-y-full",bottom:"translate-y-full",left:"-translate-x-full",right:"translate-x-full"};return o.jsx(E.Root,{open:_||t,onOpenChange:i,children:o.jsxs(E.Portal,{children:[o.jsx(E.Overlay,{className:u("fixed inset-0 transition-opacity z-20 ease-in-out duration-200 backdrop-blur-sm",a?"bg-white bg-opacity-80":"bg-black bg-opacity-50","dark:bg-black dark:bg-opacity-60",_&&t?"opacity-100":"opacity-0"),style:{pointerEvents:_?"auto":"none"}}),o.jsx(E.Content,{...l,className:u("will-change-transform","text-slate-900 dark:text-white","fixed transform z-20 transition-all duration-[240ms] ease-in-out","outline-none focus:outline-none",a?"":"shadow-md",r==="top"||r==="bottom"?"w-full":"h-full",r==="left"||r==="top"?"left-0 top-0":"right-0 bottom-0",_&&t?"opacity-100":"opacity-0",!_||!t?I[r]:""),children:n})]})})};function cn(n){return parseInt(n,10)||0}const Uen={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function jn(n){return n==null||Object.keys(n).length===0||n.outerHeightStyle===0&&!n.overflow}const Qn=k.forwardRef(function(r,t){const{onChange:i,onScroll:a,onResize:l,maxRows:_,minRows:d=1,style:I,value:y,onFocus:h,onBlur:K,sizeRef:s,ignoreBoxSizing:b,...w}=r,{current:S}=k.useRef(y!=null),P=k.useRef(null),v=qen(t,P),F=k.useRef(null),C=k.useRef(0),[M,O]=k.useState({outerHeightStyle:0}),N=k.useCallback(()=>{const g=P.current;if(typeof window>"u")return{outerHeightStyle:0};const m=window.getComputedStyle(g);if(m.width==="0px")return{outerHeightStyle:0};const p=s?.current??F.current,V=F.current;p.style.width=m.width,V.value=g.value||r.placeholder||"x",V.value.slice(-1)===`
891
891
  `&&(V.value+=" ");const lcn=m.boxSizing,ucn=cn(m.paddingBottom)+cn(m.paddingTop),_cn=cn(m.borderBottomWidth)+cn(m.borderTopWidth),dcn=cn(m.minHeight),Zn=p.scrollHeight;V.value="x";const wn=p.scrollHeight;let j=Zn;d&&(j=Math.max(Number(d)*wn,j)),_&&(j=Math.min(Number(_)*wn,j)),j=Math.max(j,wn,dcn);const Icn=j+(!b&&lcn==="border-box"?ucn+_cn:0),fcn=Math.abs(j-Zn)<=1;return{outerHeightStyle:Icn,overflow:fcn}},[_,d,r.placeholder]),U=(g,A)=>{const{outerHeightStyle:m,overflow:p}=A;return C.current<20&&(m>0&&Math.abs((g.outerHeightStyle||0)-m)>1||g.overflow!==p)?(C.current+=1,{overflow:p,outerHeightStyle:m}):(process.env.NODE_ENV!=="production"&&C.current===20&&console.error(["MUI: Too many re-renders. The layout is unstable.","TextareaAutosize limits the number of renders to prevent an infinite loop."].join(`
892
892
  `)),g)},W=k.useCallback(()=>{const g=N();jn(g)||(l&&l(g),O(A=>U(A,g)))},[N,l]),T=()=>{const g=N();jn(g)||go.flushSync(()=>{O(A=>U(A,g))})};k.useEffect(()=>{const g=mn(()=>{C.current=0,P.current&&T()});let A;const m=P.current,p=window;if(!(typeof window>"u"))return p.addEventListener("resize",g),typeof ResizeObserver<"u"&&(A=new ResizeObserver(g),A.observe(m)),()=>{g.clear(),p.removeEventListener("resize",g),A&&A.disconnect()}}),f.useLayoutEffect(()=>{W()}),k.useEffect(()=>{C.current=0},[y]);const q=g=>{C.current=0,S||W(),i&&i(g)};return o.jsxs(k.Fragment,{children:[o.jsx("textarea",{value:y,onChange:q,className:r.className,ref:v,onFocus:h,onBlur:K,rows:d,style:{height:M.outerHeightStyle,overflow:M.overflow?"hidden":void 0,...I},onScroll:a,...w}),o.jsx("textarea",{"aria-hidden":!0,className:u(r.className,r.shadowClassName),readOnly:!0,ref:F,tabIndex:-1,style:{...Uen.shadow,...I,padding:0}})]})});function qen(...n){return k.useMemo(()=>n.every(r=>r==null)?null:r=>{n.forEach(t=>{jen(t,r)})},n)}function jen(n,r){typeof n=="function"?n(r):n&&(n.current=r)}function Jn({value:n,onChange:r,label:t,type:i="text",multiline:a=!1,invisible:l,rows:_,disabled:d,error:I,endAdornment:y,autoFocus:h,placeholder:K,size:s="medium",className:b,style:w,inputClassName:S,inputStyle:P,inputRef:v,...F}){const C=v??f.useRef(null),[M,O]=f.useState(document.activeElement===C.current),N=n!=null&&n!=="";f.useEffect(()=>{if(i!=="number")return;const T=g=>{g.preventDefault()},q="current"in C?C.current:C;return q.addEventListener("wheel",T),()=>{q.removeEventListener("wheel",T)}},[C,i]);const U=f.useCallback(T=>{T.preventDefault()},[]),W=a?o.jsx(Qn,{...F,ref:C,placeholder:M||N||!t?K:void 0,autoFocus:h,rows:_,value:n??"",onChange:r,style:P,className:u(l?dn:D,"rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-[28px]",d&&"border border-transparent outline-none opacity-50 text-slate-600 dark:text-slate-500")}):o.jsx("input",{...F,ref:C,onWheel:i==="number"?U:void 0,disabled:d,style:P,className:u("w-full outline-none bg-transparent leading-normal px-3","rounded-md",l?dn:D,d?Q:G,s==="smallest"?"min-h-[32px]":s==="small"?"min-h-[48px]":"min-h-[64px]",t?s==="medium"?"pt-[28px] pb-2":"pt-4 pb-2":"py-2",M?"text-text-primary dark:text-text-primary-dark":"",y?"pr-10":"pr-3",d&&"border border-transparent outline-none opacity-50 dark:opacity-50 text-slate-800 dark:text-white",S),placeholder:M||N||!t?K:void 0,autoFocus:h,onFocus:()=>O(!0),onBlur:()=>O(!1),type:i,value:Number.isNaN(n)?"":n??"",onChange:r});return o.jsxs("div",{className:u("rounded-md relative max-w-full",l?fn:z,d?Q:G,I?"border border-red-500 dark:border-red-600":"",{"min-h-[32px]":!l&&s==="smallest","min-h-[48px]":!l&&s==="small","min-h-[64px]":!l&&s==="medium"},b),style:w,children:[t&&o.jsx(bn,{className:u("pointer-events-none absolute",s==="medium"?"top-1":"-top-1",I?"text-red-500 dark:text-red-600":M?"text-primary dark:text-primary":"text-text-secondary dark:text-text-secondary-dark",d?"opacity-50":""),shrink:N||M,children:t}),W,y&&o.jsx("div",{className:"flex flex-row justify-center items-center absolute h-full right-0 top-0 mr-4 ",children:y})]})}const Qen=({open:n,side:r="bottom",delayDuration:t=250,sideOffset:i,align:a,onOpenChange:l,title:_,className:d,style:I,tooltipClassName:y,children:h})=>(Y("Tooltip",Jen),_?o.jsx(R.Provider,{delayDuration:t,children:o.jsxs(R.Root,{open:n,onOpenChange:l,children:[o.jsx(R.Trigger,{asChild:!0,children:o.jsx("div",{className:d,style:I,children:h})}),o.jsx(R.Portal,{children:o.jsx(R.Content,{className:u("TooltipContent","max-w-lg leading-relaxed","z-50 rounded px-3 py-2 text-xs leading-none bg-slate-700 dark:bg-slate-800 bg-opacity-90 font-medium text-slate-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",y),sideOffset:i===void 0?4:i,align:a,side:r,children:_})})]})}):o.jsx(o.Fragment,{children:h})),Jen=`
893
893