@vertesia/ui 1.0.0-dev.20260227.112605Z → 1.0.0-dev.20260305.083323Z

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.
Files changed (46) hide show
  1. package/lib/esm/core/components/shadcn/selectBox.js +1 -1
  2. package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js +3 -4
  3. package/lib/esm/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
  4. package/lib/esm/core/components/shadcn/tooltip.js +1 -1
  5. package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
  6. package/lib/esm/features/agent/chat/ModernAgentConversation.js +3 -3
  7. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  8. package/lib/esm/features/store/collections/CreateCollection.js +13 -13
  9. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  10. package/lib/esm/features/store/types/SelectContentType.js +1 -1
  11. package/lib/esm/features/store/types/SelectContentType.js.map +1 -1
  12. package/lib/esm/session/UserSession.js +8 -0
  13. package/lib/esm/session/UserSession.js.map +1 -1
  14. package/lib/esm/shell/login/TerminalLogin.js +1 -1
  15. package/lib/esm/shell/login/TerminalLogin.js.map +1 -1
  16. package/lib/tsconfig.tsbuildinfo +1 -1
  17. package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts +6 -1
  18. package/lib/types/core/components/shadcn/theme/ThemeSwitcher.d.ts.map +1 -1
  19. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  20. package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -1
  21. package/lib/types/session/UserSession.d.ts.map +1 -1
  22. package/lib/types/shell/login/TerminalLogin.d.ts.map +1 -1
  23. package/lib/vertesia-ui-core.js +1 -1
  24. package/lib/vertesia-ui-core.js.map +1 -1
  25. package/lib/vertesia-ui-features.js +1 -1
  26. package/lib/vertesia-ui-features.js.map +1 -1
  27. package/lib/vertesia-ui-session.js +1 -1
  28. package/lib/vertesia-ui-session.js.map +1 -1
  29. package/lib/vertesia-ui-shell.js.map +1 -1
  30. package/llms.txt +124 -4
  31. package/package.json +19 -5
  32. package/src/core/components/shadcn/selectBox.tsx +1 -1
  33. package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +13 -8
  34. package/src/core/components/shadcn/tooltip.tsx +1 -1
  35. package/src/css/base.css +31 -0
  36. package/src/css/color.css +136 -0
  37. package/src/css/custom-tooltips.css +64 -0
  38. package/src/css/index.css +27 -0
  39. package/src/css/theme.css +86 -0
  40. package/src/css/typography.css +88 -0
  41. package/src/css/utilities.css +72 -0
  42. package/src/features/agent/chat/ModernAgentConversation.tsx +84 -91
  43. package/src/features/store/collections/CreateCollection.tsx +36 -34
  44. package/src/features/store/types/SelectContentType.tsx +1 -1
  45. package/src/session/UserSession.ts +8 -0
  46. package/src/shell/login/TerminalLogin.tsx +1 -2
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{clsx as a}from"clsx";import{ChevronUpIcon as i,ChevronDownIcon as s,Check as l,ChevronDown as o,Plus as c,Info as d,X as u,Loader2 as m,CopyIcon as h,Computer as p,Sun as f,Moon as g,TriangleAlert as v,AlertTriangle as x,CircleX as b,CircleCheck as y,Search as w,LoaderCircle as N,ChevronsUpDown as C,SearchIcon as k,SquarePlus as _,ChevronRight as z,MoreHorizontal as I,ListFilter as T,Minus as L,ChevronUp as M}from"lucide-react";import*as R from"react";import O,{createContext as S,useRef as D,useState as $,useEffect as A,useContext as E,Fragment as P,forwardRef as F,useMemo as j,useCallback as V,useLayoutEffect as Y}from"react";import{createPortal as B}from"react-dom";import{Menu as H,MenuButton as W,Transition as U,MenuItems as G,MenuItem as K,Listbox as J,ListboxButton as Z,ListboxOptions as q,ListboxOption as X,RadioGroup as Q,Switch as ee}from"@headlessui/react";import{Button as te,VTooltip as ne,useIntersectionObserver as re}from"@vertesia/ui/core";import*as ae from"@radix-ui/react-tooltip";import{twMerge as ie}from"tailwind-merge";import{cva as se}from"class-variance-authority";import{motion as le,AnimatePresence as oe}from"framer-motion";import{Slot as ce}from"@radix-ui/react-slot";import*as de from"@radix-ui/react-dialog";import*as ue from"@radix-ui/react-separator";import{isEqual as me}from"lodash-es";import*as he from"@radix-ui/react-popover";import{Command as pe}from"cmdk";import*as fe from"@radix-ui/react-tabs";import*as ge from"@radix-ui/react-label";import*as ve from"@radix-ui/react-checkbox";import xe from"dayjs";import be from"react-calendar";import*as ye from"react-resizable-panels";function we(e){switch(e){case"xs":return"size-4";case"sm":return"size-6";case"md":return"size-8";case"lg":return"size-10";case"xl":return"size-12";case"2xl":return"size-14";default:throw new Error("Unexpected size: "+e)}}function Ne({size:t,src:n,name:r,shape:a="circle",color:i="bg-gray-500",className:s}){const l="circle"===a?"rounded-full":"rounded-md",o=we(t||"md");if(n)return e("img",{className:`inline-block ${o} ${l} ${i} ${s}`,src:n,alt:r||n,title:r});if(r){const[n,a]=r.split(" ");let c=a?`${n[0]}${a[0]}`:`${n[0]}${n[1]}`;return e("span",{className:`inline-flex ${o} items-center justify-center ${l} ${i} ${s}`,title:r,children:e("span",{className:("xs"!=t?"text-xs":"text-[0.6rem]")+" font-medium leading-none text-white",children:c})})}return e("span",{className:`inline-block ${o} overflow-hidden ${l} ${i}`,children:e("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:e("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})})}function Ce({size:t,shape:n="circle",color:r="bg-gray-500",className:a,children:i}){const s="circle"===n?"rounded-full":"rounded-md",l=we(t||"md");return e("span",{className:`inline-block ${l} overflow-hidden ${s} ${r} ${a}`,children:i})}function ke({className:t,children:n}){return e("div",{className:r("flex items-center justify-center",t),children:n})}class _e{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case"top":this.top=t.top-n.height-this.gap,this.alignAxis="x";break;case"bottom":this.top=t.bottom+this.gap,this.alignAxis="x";break;case"left":this.left=t.left-n.width-this.gap,this.alignAxis="y";break;case"right":this.left=t.right+this.gap,this.alignAxis="y";break;case"ne":this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case"nw":this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case"se":this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case"sw":this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case"start":"x"===this.alignAxis?this.left=t.left:this.top=t.top;break;case"end":"x"===this.alignAxis?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case"center":"x"===this.alignAxis?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case"fill":"x"===this.alignAxis?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw new Error("Invalid position. Cannot compute x,y coordinates");const r=null!=this.width,a=null!=this.height,i=r?this.width:t.width,s=a?this.height:t.height;return{rect:new DOMRect(this.left,this.top,i,s),constrainWidth:r,constrainHeight:a,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){const t=function(e){switch(e){case"start":return"end";case"end":return"start";default:return e}}(e.align);if(t!==e.align)return{...e,align:t}}}else{const t=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";default:return e}}(e.position);if(t!==e.position)return{...e,position:t}}return null}}function ze(e,t,n){return"x"===n?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Ie(e,t,n,r){const a=new _e(e.gap);let i=a.computePosition(e,t,n);const s=ze(i.rect,r,"x"),l=ze(i.rect,r,"y");if(s&&l)return i;let o=null;return s||(o=a.flipAxis(e,"x")),l||(o=a.flipAxis(o||e,"y")),o?(i=new _e(a.gap).computePosition(o,t,n),function(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}(i.rect,r)?i:null):null}function Te(e,t){const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),a=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return a<=n||i<=r?null:new DOMRect(n,r,a-n,i-r)}function Le(e){const t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){const r=getComputedStyle(e);if(t&&"visible"!==r.overflowY||n&&"visible"!==r.overflowX)return!0}return!1}class Me{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=function(e,t=document.documentElement){const n=[];let r=e.parentElement;for(;r&&r!==t;)Le(r)&&n.push(r),r=r.parentElement;return n.push(t),n}(this.anchor,this.root),this.visibleClientRect=function(e){if(0===e.length)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Te(e[n].getBoundingClientRect(),t),!t)return null;return t}(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){const t=this.scrollableParents,n=()=>{this.update()};window.addEventListener("resize",n);for(const e of t)e.addEventListener("scroll",n);let r,a;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(function(){r&&document.addEventListener("click",r)},0)),this.options.closeOnEsc&&(a=e=>{"Escape"===e.key&&this.tryClose()},window.setTimeout(function(){a&&document.addEventListener("keydown",a)},0));const i=this.options.blockPageScroll;return i&&(document.body.style.overflow="hidden",document.body.style.height="100%"),()=>{window.removeEventListener("resize",n);for(const e of t)e.removeEventListener("scroll",n);r&&document.removeEventListener("click",r),a&&document.removeEventListener("keydown",a),i&&(document.body.style.overflow="",document.body.style.height="")}}open(e,t){if(this.context)throw new Error("The popup controller is already bound to an element");this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display="",e.style.visibility="hidden",this.update(),this.options.onOpen&&this.options.onOpen(this))}close(){if(!this.context)throw new Error("The popup controller is not bound to an element");this.tryClose()}tryClose(){this.context&&(this.options.onClose&&this.options.onClose(this),this.context.cleanup(),this.context.element.style.display="none",this.context=void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;const e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),a=this.visibleClientRect;if(!a)return;const i=Ie(t,n,r,a);this.context.position=i||void 0,i&&(i.constrainHeight&&(e.style.height=i.rect.height+"px"),i.constrainWidth&&(e.style.width=i.rect.width+"px"),e.style.left=i.rect.left+"px",e.style.top=i.rect.top+"px",e.style.visibility="visible")}createPopupElement(){const e=document.createElement("div");return e.style.margin="0",e.style.padding="0",e.style.border="none",e.style.background="transparent",e.className="composable-Popup",e}}const Re=S(void 0);function Oe(){const e=E(Re);if(!e)throw new Error("usePopupController must be used inside a Popup component");return e}function Se({ctrlRef:t,id:n,constraints:r,isOpen:a,children:i,className:s,onClose:l,zIndex:o,position:c,...d}){const u=D(null),[m,h]=$();return A(()=>{if(!d.anchor)throw new Error("Anchor element is required");const e=new Me({...d,onClose:l});return h(e),()=>{e.tryClose()}},[]),A(()=>{t&&(t.current=m)},[m]),A(()=>{m&&u.current?m.isOpen!==a&&(a?m.open(u.current,r):m.close()):m?.isOpen&&!a&&m.close()},[a,m,u.current]),e(Re.Provider,{value:m,children:a&&B(e("div",{id:n,style:{visibility:"hidden",position:c||"absolute",zIndex:o||100},ref:u,className:s,children:i}),document.body)})}function De({anchor:t,root:n,children:r,...a}){return!t.current||n&&!n.current?null:e(Se,{anchor:t.current,root:n?.current||void 0,...a,children:r})}class $e{filter(e,t){const n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}}class Ae extends $e{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new Ae}class Ee extends Ae{createItem(e){return e}static instance=new Ee}function Pe(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:"w-72 bg-white mt-1 shadow-md border border-gray-200 overflow-auto p-0 z-10",inputClass:r(t?"block m-0 p-0 border-0 focus:outline-none focus:ring-0 bg-transparent":"block sm:text-sm sm:leading-6 rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 placeholder:text-gray-400 dark:placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-800 py-1.5",e?"w-full":"!w-auto"),optionClass:"py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300",Input:je,Menu:Ye,Toggle:Ve}}function Fe({menuAlign:r="fill",menuGap:a,focusOnMount:i,onSelect:s,value:l,zIndex:o,unstyledInput:c,fullWidth:d,api:u,layout:m,adapter:h,items:p,placeholder:f}){const[g]=$(`combobox-popup-${Math.floor(1e6*Math.random())}`),v=D(void 0),x=D(null),b=m?Object.assign(Pe(d,c),m):Pe(d,c),y=O.useRef(null),w=Be({adapter:h,items:p,value:l,popupId:g});A(()=>{x.current&&i&&x.current.focus()},[x.current]),A(()=>{w.onSelect=s,w.popupCtrl=v.current},[s,v.current]),A(()=>{if(u&&w&&x.current)return u.current={open:()=>w.openMenu(),close:()=>w.closeMenu(),toggle:()=>w.toggleMenu(),setInputValue:e=>w.inputText=e,inputValue:w.inputText||"",selectedItem:w.selectedItem,focus:()=>x.current?.focus()},()=>{u.current=null}},[u,w,x.current]);const N=w.isMenuOpen&&w.filteredItems.length>0;return t(n,{children:[e(b.Input,{boxRef:y,inputRef:x,ctrl:w,layout:b,placeholder:f}),e(De,{id:g,ctrlRef:v,className:"combobox-popup",closeOnClick:!0,closeOnEsc:!0,onClose:()=>w.closeMenu(),isOpen:N,anchor:y,zIndex:o,constraints:{position:"bottom",align:r,gap:null!=a?a:4},children:e(b.Menu,{fillWidth:"fill"===r,items:w.filteredItems,ctrl:w,layout:b,adapter:h})})]})}function je({inputRef:n,placeholder:r,boxRef:a,ctrl:i,layout:s}){const l=s.buttonWidth,o=l>0?{paddingRight:`${l}px`}:void 0,c=s.Toggle;return t("div",{className:"relative",ref:a,children:[e("input",{ref:n,placeholder:r,...i.getInputProps(),style:o,className:s.inputClass}),c&&e("button",{style:{top:0,bottom:0,right:`${s.buttonRight}px`,width:`${l}px`,position:"absolute",border:"none",padding:0,margin:0,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},...i.getToggleButtonProps(),children:e(c,{ctrl:i,layout:s})})]})}function Ve({ctrl:t}){return t.isMenuOpen?e(i,{className:"w-4 h-4"}):e(s,{className:"w-4 h-4"})}function Ye({fillWidth:t,items:n,layout:a,ctrl:i,adapter:s}){const{highlightedIndex:l,selectedItem:o}=i;return e("ul",{style:{width:t?"100%":void 0,maxHeight:a.maxMenuHeight?`${a.maxMenuHeight}px`:"240px"},className:a.menuClass,...i.getMenuProps(),children:n.map((t,n)=>e("li",{"data-index":n,className:r(a.optionClass,l===n&&"option-highlighted",o===t&&"option-selected"),...i.getItemProps(t,n),children:s.renderOption(t)},s.idOf(t)))})}function Be(e){const[t,n]=$(new He(e));return A(()=>{t?.withState(n)},[]),t}class He{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText="";_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,"string"==typeof n?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._inputText?this._filteredItems=this.adapter.filter(this.items,this._inputText):this._filteredItems=this.items}withState(e){return this.setState=e,this}clone(){const e=new He({adapter:this.adapter,items:this.items,popupId:this.popupId});return e.setState=this.setState,e.onSelect=this.onSelect,e._inputText=this._inputText,e._highlightedIndex=this._highlightedIndex,e._selectedItem=this._selectedItem,e._isMenuOpen=this._isMenuOpen,e._filteredItems=this._filteredItems,e.popupCtrl=this.popupCtrl,e}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):"",this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){const e=this.popupCtrl,t=e.context?.position?.position;t&&"top"===t&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;const n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){const e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{const t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{const n=t.key;if("Enter"===n){if(null!=this.highlightedIndex)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){const e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else"ArrowDown"===n?this.isMenuOpen?this.highlightIndex(null===this.highlightedIndex?0:(r=this.highlightedIndex,a=e.length,(r+1)%a),!1):this.openMenu():"ArrowUp"===n&&this.isMenuOpen&&this.highlightIndex(null===this.highlightedIndex?0:function(e,t){return(e-1+t)%t}(this.highlightedIndex,e.length),!0);var r,a}}}}function We({className:t}){return e("hr",{className:r("w-full h-0.5 border-t-0 bg-border",t)})}function Ue({trigger:n,children:r}){return t(H,{as:"div",className:"relative",children:[e(W,{as:"span",className:"-m-1.5 flex items-center p-1.5",children:n}),e(U,{as:P,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e(G,{className:"absolute right-0 z-10 mt-2.5 w-48 origin-top-right rounded-md bg-white dark:bg-slate-900 dark:border-slate-800 dark:border py-2 shadow-lg ring-1 ring-gray-900/5 dark:ring-slate-200/5 focus:outline-hidden",children:r})})]})}function Ge({children:t,href:n="#",onClick:a,closeOnClick:i=!0,isDisabled:s=!1}){return e(K,{disabled:s,children:({active:l,close:o})=>e("a",{href:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),a&&a(e),i&&o()},className:r(l?"bg-gray-50 dark:bg-slate-800":"",s?"opacity-50 cursor-not-allowed":"","block px-3 py-1 text-sm leading-6 text-gray-900 dark:text-gray-200"),children:t})})}function Ke({items:n,value:a,onChange:i}){return e(J,{value:a,onChange:i,children:({open:i})=>t("div",{className:"relative",children:[t("div",{className:"inline-flex divide-x divide-indigo-700 rounded-md shadow-2xs",children:[t("div",{className:"inline-flex items-center gap-x-1.5 rounded-l-md bg-indigo-600 px-3 py-2 text-white shadow-2xs",children:[a.name&&e(l,{className:"-ml-0.5 size-5","aria-hidden":"true"}),e("p",{className:"text-sm font-semibold",children:a.name||""})]}),t(Z,{className:"inline-flex items-center rounded-l-none rounded-r-md bg-indigo-600 p-2 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-gray-50",children:[e("span",{className:"sr-only",children:"Change selection"}),e(o,{className:"size-5 text-white","aria-hidden":"true"})]})]}),e(U,{show:i,as:P,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e(q,{className:"absolute right-0 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:n.map(n=>e(X,{className:({active:e})=>r(e?"bg-indigo-600 text-white":"text-gray-900","cursor-default select-none p-4 text-sm"),value:n,children:({selected:a,active:i})=>t("div",{className:"flex flex-col",children:[t("div",{className:"flex justify-between",children:[e("p",{className:a?"font-semibold":"font-normal",children:n.name}),a?e("span",{className:i?"text-white":"text-indigo-600",children:e(l,{className:"size-5","aria-hidden":"true"})}):null]}),e("p",{className:r(i?"text-indigo-200":"text-gray-500","mt-2"),children:n.description})]})},n.id))})})]})})}function Je({buttonLabel:n,title:r,children:a,onClick:i}){return e("div",{className:"flex items-center justify-center h-full text-center",children:t("div",{className:"py-12",children:[e("svg",{className:"mx-auto size-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),e("h3",{className:"mt-2 text-sm font-semibold",children:r}),e("p",{className:"mt-1 text-sm text-muted",children:a}),e("div",{className:"mt-6",children:t(te,{onClick:i,children:[e(c,{className:"-ml-0.5 mr-1.5 size-5","aria-hidden":"true"}),n]})})]})})}function Ze({children:n,onUpload:r}){const a=D(null);return t("label",{style:{cursor:"pointer"},children:[n,e("input",{ref:a,type:"file",style:{display:"none"},onChange:()=>{a.current?.files&&r(function(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}(a.current.files))}})]})}function qe({onUpload:n}){const r=Xe({onUpload:n});return e("div",{...r,className:"flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:t("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-full",children:[t("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),t("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[e("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),e("input",{id:"dropzone-file",type:"file",className:"hidden"})]})})}function Xe({onUpload:e,dragOverClass:t="is-drag-over-on",dropEffect:n="copy"}){const r=D(null);return{onDrop:n=>{n.preventDefault(),delete r.current.__dragOver_cnt__,r.current?.classList.remove(t);const a=n.dataTransfer.items;if(a){const t=[],n=(e,t="")=>new Promise(r=>{if(e.isFile)e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(e.isDirectory){const a=e.createReader(),i=[],s=()=>{a.readEntries(a=>{if(a.length){for(const r of a)i.push(n(r,t+e.name+"/"));s()}else Promise.all(i).then(e=>r(e.flat()))})};s()}});for(let e=0;e<a.length;e++){const r=a[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{const n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{(function(e){let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t})(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{(function(e){let t=e.__dragOver_cnt__;return!!t&&(e.__dragOver_cnt__=t-1,1===t)})(r.current)&&r.current?.classList.remove(t)},ref:r}}function Qe(...e){return ie(a(e))}const et=O.createContext(void 0);function tt({children:t,id:n="plugin-portal-container"}){const r=O.useRef(null),[a,i]=O.useState(void 0);return O.useEffect(()=>{if(r.current){const e=r.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){const t=function(e,t="plugin-portal-container"){const n=e instanceof Document?e.body:e;for(const e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;const r=document.createElement("div");return r.id=t,n.appendChild(r),r}(e,n);i(t)}else i(null)}},[n]),void 0===a?e("div",{ref:r,style:{display:"none"}}):e(et.Provider,{value:a||void 0,children:t})}function nt(){return O.useContext(et)}const rt=ae.Provider,at=ae.Root,it=ae.Trigger,st=R.forwardRef(({className:t,sideOffset:n=4,side:r="top",...a},i)=>{const s=nt();return e(ae.Portal,{container:s,children:e(ae.Content,{ref:i,sideOffset:n,side:r,style:{zIndex:100},className:Qe("max-w-[90vw]","z-50 overflow-hidden rounded-md bg-tooltips border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",t),...a})})});function lt({description:n,children:r,size:a="sm",placement:i="top",className:s,asChild:l}){return e(rt,{delayDuration:0,children:t(at,{children:[e(it,{className:"cursor-pointer",asChild:l,children:r}),e(st,{side:i,className:`px-3 py-1.5 max-w-${a} text-${a} px-3 ${s}`,children:n})]})})}function ot({description:n,required:a,label:i,className:s,direction:l="column",children:o,disabled:c=!1}){return t("div",{className:r("flex w-full space-y-1",s,"row"===l?"flex-row justify-between items-center gap-2":"flex-col"),children:[t("div",{className:"flex items-center gap-1",children:[t("label",{className:"text-sm font-medium mb-1 "+(c?"text-muted":""),children:[i,a?e("span",{className:"text-destructive -mt-4 ml-1",children:"*"}):""]}),n&&e("div",{className:"mx-2 flex w-4 items-center",children:e(lt,{description:n,children:e(d,{className:"size-3 text-muted"})})})]}),o]})}st.displayName=ae.Content.displayName;const ct=se("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium",{variants:{variant:{default:"text-foreground bg-muted",secondary:"bg-secondary text-primary",destructive:"bg-destructive text-destructive",attention:"bg-attention text-attention",success:"bg-success text-success",info:"bg-info text-info",done:"bg-done text-done"}},defaultVariants:{variant:"default"}});function dt({className:t,variant:n,children:r,onClick:a,...i}){return e("span",{className:Qe(ct({variant:n}),t),onClick:a,...i,children:r})}const ut=se("inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border",{variants:{variant:{default:"",success:"",destructive:"",attention:"",done:"",info:""}},defaultVariants:{variant:"default"}}),mt=se("h-1.5 w-1.5",{variants:{variant:{default:"fill-foreground",success:"fill-success",destructive:"fill-destructive",attention:"fill-attention",done:"fill-done",info:"fill-info"}},defaultVariants:{variant:"default"}});function ht({variant:n,className:r,dotClassName:a,children:i,...s}){return t("span",{className:Qe(ut({variant:n}),r),...s,children:[e("div",{className:"flex-shrink-0",children:e("svg",{className:Qe(mt({variant:n}),a),viewBox:"0 0 6 6","aria-hidden":"true",children:e("circle",{cx:3,cy:3,r:3})})}),e("span",{className:"truncate",children:i})]})}const pt=se("",{variants:{size:{xs:"rounded py-1 text-xs rounded-xs",sm:"rounded text-xs rounded-sm",md:"rounded-md py-2 text-sm",lg:"rounded-md text-base",xl:"rounded-md py-2.5 text-lg"},variant:{default:"flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",unstyled:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",noPadding:"block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background",legacy:"py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background"}},defaultVariants:{size:"md",variant:"default"}}),ft=R.forwardRef(({className:n,type:r,size:a="md",variant:i="default",clearable:s=!0,onChange:l,value:o,...c},d)=>t("div",{className:"w-full relative inline-block [&:hover_.clear-button]:opacity-100",children:[e("input",{type:r,className:Qe(pt({size:a,variant:i}),n,s&&o?"pr-8":""),ref:d,value:null==o?"":o,onChange:e=>{l&&l(e.target.value)},...c}),s&&o&&!c.readOnly&&!c.disabled&&e(te,{variant:"link",size:"icon",type:"button",onClick:()=>{l&&l("")},className:"clear-button opacity-0 transition-opacity duration-200\n absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer\n flex items-center justify-center size-6 rounded right-2",alt:"Clear input",children:e(u,{size:16})})]}));function gt({value:n=[],onChange:a,className:i,delimiters:s=", ",placeholder:l,autoFocus:o}){const[c,d]=$("");return t("div",{className:r(i,"w-full flex flex-wrap items-center gap-1 p-2 py-1.5","rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"),children:[n&&n.length>0&&n.map((t,r)=>e(ne,{description:"click to remove",children:e(dt,{variant:"secondary",onClick:()=>(e=>{n&&n.length>0&&(n.splice(e,1),a([...n]))})(r),className:"cursor-pointer flex-shrink-0 hover:bg-destructive hover:text-destructive transition-colors",title:t,children:e("span",{className:"break-all",children:t})},r)},r)),e(ft,{clearable:!1,className:"placeholder:text-muted px-1 flex-1 min-w-[120px]",variant:"unstyled",type:"text",value:c,onBlur:e=>{const t=e.target.value;t&&t.trim()&&(a([...n,t.trim()]),d(""))},onKeyDown:e=>{const t=e.target.value,r=!t.trim(),i=e.key;"Enter"===i||s.indexOf(i)>-1?(e.preventDefault(),n&&!r&&(a([...n,t.trim()]),d(""))):"Backspace"===i&&r&&n&&n.length>0&&(n.pop(),a([...n]))},onPaste:e=>{const t=e.clipboardData.getData("text");if(t){e.preventDefault();const r=s.split("").map(e=>" "===e?"\\s":e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(`[${r}]+`),l=t.split(i).map(e=>e.trim()).filter(e=>e.length>0);l.length>0&&a([...n,...l]),d("")}},onChange:d,placeholder:n&&0!==n.length?"":l,autoFocus:o})]})}function vt({underline:t="always",className:n,children:a,...i}){let s;return"always"===t?s="underline":"hover"===t&&(s="hover:underline"),e("a",{className:r("text-indigo-800 dark:text-indigo-300",n,s),...i,children:a})}function xt({className:t,children:n}){return e("ul",{className:`${t} space-y-1 flex flex-col items-start`,children:n})}ft.displayName="Input";const bt=F(function(t,n){const{current:a,children:i,className:s,href:l="#",onClick:o,...c}=t;return e("li",{className:r(s,a?"bg-muted":"","w-full p-2 pl-3 text-sm leading-6 font-semibold hover:bg-muted"),children:e("a",{ref:n,href:l,onClick:e=>{o?(e.preventDefault(),o(e)):"#"===l&&e.preventDefault()},className:"w-full flex items-center gap-x-3",...c,children:i})})});xt.Item=bt;const yt="rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",wt={INPUT_UNSTYLED:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",INPUT_NO_PADDING:yt,INPUT:yt+" py-1.5"};function Nt(e){return null==e||isNaN(e)?"":e.toString()}const Ct=O.forwardRef(({value:t,onChange:n,className:a,noScroll:i=!1,noSpinners:s=!1,...l},o)=>{const[c,d]=O.useState(Nt(t));return A(()=>{if(null==t||!isNaN(t)){const e=Nt(t);d(e)}},[t]),e("input",{onWheel:i?e=>{e.target.blur()}:l.onWheel,type:"number",value:c,onChange:e=>{const t=e.target.value;if(d(t),""===t)n&&n(void 0,t);else{const e=parseFloat(t);n&&n(e,t)}},className:r(a,wt.INPUT,{"no-spinners":s},s&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),ref:o,...l})}),kt=se("hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{destructive:"bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50",outline:"border border-input bg-background shadow-xs hover:bg-muted ring-inset",secondary:"bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset",ghost:"hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset",link:"text-foreground underline-offset-4 hover:underline ring-inset",primary:"bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset",unstyled:""},size:{xs:"h-7 rounded px-2 py-1 text-xs gap-x-1",sm:"h-8 rounded px-3 text-xs",md:"h-9 rounded-md px-4 py-2",lg:"h-10 rounded-md px-3",xl:"rounded-md px-3.5 py-2.5 text-sm gap-x-2",icon:"p-0 m-0 rounded-full"}},defaultVariants:{variant:"primary",size:"md"}}),_t=R.forwardRef(({className:n,variant:a,size:i,asChild:s=!1,alt:l,isDisabled:o,isLoading:c,title:d,onClick:u,type:h,...p},f)=>{const g=t(s?ce:"button",{className:r(Qe(kt({variant:a,size:i})),n),disabled:o||c||p.disabled,ref:f,onClick:u,type:h,autoFocus:!1,...p,children:[c&&e(m,{className:"animate-spin"}),p.children]});return l||d?e(ne,{description:l||d,asChild:!0,className:"cursor-pointer",size:"xs",placement:"top",children:g}):g});_t.displayName="Button";const zt=R.forwardRef(({size:t,content:n,toast:r,className:a,alt:i,...s},o)=>{const[c,d]=$(!1);return e(_t,{ref:o,className:Qe(a),variant:"unstyled",size:t||"sm",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r&&r.toast&&r.toast({status:"success",title:r.message||"Copied to clipboard",duration:2e3})}).catch(e=>{console.error("Failed to copy text: ",e),r&&r.toast&&r.toast({status:"error",title:"Failed to copy",duration:2e3})})},...s,alt:i??"Copy",children:c?e(l,{className:"text-success"}):e(h,{className:"size-4"})})});function It({children:n,overlayContent:r,className:a="",overlayClassName:i="",position:s="right",width:l,height:o,showCloseButton:c=!0,onOpen:d,onClose:m,triggerClassName:h="",backdropClassName:p="",animationConfig:f={type:"spring",stiffness:300,damping:30}}){const[g,v]=$(!1),x=function(e){switch(e){case"left":return{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"}};case"right":default:return{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"}};case"top":return{initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"}};case"bottom":return{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}};case"center":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}}}}(s),b=function(e,t,n){const r="fixed bg-white shadow-lg p-4 relative";switch(e){case"left":return`${r} left-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"right":default:return`${r} right-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"top":return`${r} top-[var(--header-height)] left-0 right-0 ${n||"h-80"}`;case"bottom":return`${r} bottom-0 left-0 right-0 ${n||"h-80"}`;case"center":return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||"w-96"} ${n||"max-h-96"}`}}(s,l,o);return t("div",{className:`flex items-center justify-center w-full ${a}`,children:[e("div",{onClick:()=>{v(!0),d?.()},className:`w-full align-left cursor-pointer ${h}`,children:n}),g&&e("div",{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:t(le.div,{...x,transition:f,className:`${b} ${i}`,children:[c&&e("div",{className:"absolute top-2 right-2 z-10",children:e(_t,{onClick:()=>{v(!1),m?.()},variant:"primary",children:e(u,{})})}),e("div",{className:c?"mt-8":"",children:r})]})})]})}zt.displayName="CopyButton";const Tt="--tailwind-portal";function Lt({children:t}){const n=D(null),[r,a]=$(null);return A(()=>{if(n.current){const e=n.current.ownerDocument;let t=e.getElementById(Tt);t||(t=e.createElement("DIV"),t.id=Tt,e.body.appendChild(t)),a(t)}},[n.current]),r?B(t,r):e("span",{ref:n})}class Mt{renderOption(e){return this.labelOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}}function Rt({checkColor:t,cols:n="grid-cols-1",gap:a="gap-2",value:i,onChange:s,options:l,checkIcon:o=St,adapter:c}){const[d,u]=$(i),m=e=>{u(e),s(e)},h=d?c.idOf(d):void 0;return e("div",{className:r("grid",n,a),children:l.map(n=>{const r=c.idOf(n);return e(Ot,{checkColor:t,isSelected:r===h,option:n,adapter:c,onSelect:m,CheckIcon:o},r)})})}function Ot({checkColor:n,CheckIcon:r,adapter:a,isSelected:i,option:s,onSelect:l}){const[o,c]=$(!1);return t("div",{className:"flex gap-1 cursor-pointer items-center",onClick:()=>l(s),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e("div",{className:"",children:e(r,{size:24,isChecked:i,isHighlighted:o,color:n})}),e("div",{children:a.renderOption(s)})]})}function St({size:t,isChecked:n,isHighlighted:r,color:a="currentColor"}){const i=r?1:.6;return e("svg",n?{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_checked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 Z M10,14.4393398 L16.4696699,7.96966991 C16.7625631,7.6767767 17.2374369,7.6767767 17.5303301,7.96966991 C17.7965966,8.23593648 17.8208027,8.65260016 17.6029482,8.94621165 L17.5303301,9.03033009 L10.5303301,16.0303301 C10.2640635,16.2965966 9.84739984,16.3208027 9.55378835,16.1029482 L9.46966991,16.0303301 L6.46966991,13.0303301 C6.1767767,12.7374369 6.1767767,12.2625631 6.46966991,11.9696699 C6.73593648,11.7034034 7.15260016,11.6791973 7.44621165,11.8970518 L7.53033009,11.9696699 L10,14.4393398 L16.4696699,7.96966991 L10,14.4393398 Z"})})})}:{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_unchecked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z"})})})})}const Dt=S({theme:"system",setTheme:()=>null});function $t({children:t,defaultTheme:n="system",storageKey:r="vite-ui-theme",...a}){const[i,s]=$(()=>localStorage.getItem(r)||n);A(()=>{const e=window.document.documentElement;if(e.classList.remove("light","dark"),"system"===i){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return void e.classList.add(t)}e.classList.add(i)},[i]);const l={theme:i,setTheme:e=>{localStorage.setItem(r,e),s(e)}};return e(Dt.Provider,{...a,value:l,children:t})}const At=()=>{const e=E(Dt);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e};function Et({option:t,current:n,setTheme:r,icon:a}){return e(_t,{variant:n===t?"secondary":"outline",size:"sm",onClick:()=>r(t),alt:t,children:a})}function Pt(){const{setTheme:n}=At(),r=At().theme;return t("div",{className:"flex justify-between px-2 items-center",children:[e("p",{className:"text-sm font-semibold",children:"Theme"}),t("div",{className:"flex gap-2",children:[e(Et,{current:r,option:"system",setTheme:n,icon:e(p,{className:"text-muted"})}),e(Et,{current:r,option:"light",setTheme:n,icon:e(f,{className:"text-muted"})}),e(Et,{current:r,option:"dark",setTheme:n,icon:e(g,{className:"text-muted"})})]})]})}const Ft=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("rounded-xl border bg-card text-card-foreground shadow",t),...n}));Ft.displayName="Card";const jt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("flex flex-col p-6",t),...n}));jt.displayName="CardHeader";const Vt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("font-semibold leading-none tracking-tight",t),...n}));Vt.displayName="CardTitle";const Yt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("text-sm text-muted-foreground",t),...n}));Yt.displayName="CardDescription";const Bt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("p-6 pt-0",t),...n}));Bt.displayName="CardContent";const Ht=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("flex items-center p-6 pt-0",t),...n}));function Wt({children:t}){return e("span",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},children:t})}Ht.displayName="CardFooter";const Ut=S(!1);function Gt(){return!!E(Ut)}function Kt({children:t}){return e(Ut.Provider,{value:!0,children:t})}function Jt({className:r,children:a,isOpen:i,onClose:s,description:l="Modal Description",noCloseButton:o=!1,allowOverflow:c=!1,disableCloseOnClickOutside:d=!1,size:m="md",action:h}){const p=e=>{e||s()};return t(Qt,{open:i,onOpenChange:e=>{d&&!e||p(e)},children:[c&&e(rn,{className:"z-50 fixed inset-0 bg-black/80"}),e(Wt,{children:e(sn,{children:l})}),t(an,{className:Qe("min-h-20 p-4","fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg",function(){switch(m){case"sm":return"max-w-[20vw]";case"md":default:return"max-w-[60vw] lg:max-w-[40vw]";case"lg":return"max-w-[80vw] md:max-w-[60vw]";case"xl":return"max-w-[95vw] lg:max-w-[80vw]"}}(),r),children:[e("div",{className:"top-4 right-4 absolute",children:t("div",{className:"flex gap-2",children:[h&&e(n,{children:h}),!o&&e(nn,{onClick:()=>p(!1),asChild:!0,autoFocus:!1,children:e(_t,{variant:"outline",alt:"Close",className:"data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none",children:e(u,{className:"size-4"})})})]})}),e(Kt,{children:a})]})]})}const Zt=({children:r,show:a=!0,className:i,description:s,showDivider:l=!1,...o})=>a?e(n,{children:t(ln,{className:Qe(l?"border-b-solid border-b border-b-1 pb-2 mb-4":"","text-lg font-semibold leading-6 tracking-tight",{"py-2":!s},i),...o,children:[r,s&&e(sn,{className:"text-sm !font-normal text-muted-foreground pb-2",children:s})]})}):t(Wt,{children:[e(ln,{children:r}),s&&e(sn,{children:s})]}),qt=({children:t,className:n,...r})=>e("div",{className:Qe("text-sm max-h-[80vh] overflow-y-auto",n),...r,children:t}),Xt=({align:t="right",children:n,className:r,...a})=>e("div",{className:Qe("w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end sm:space-x-2",{left:"justify-start",center:"justify-center",right:"justify-end"}[t],r),...a,children:n}),Qt=de.Root,en=de.Trigger,tn=de.Portal,nn=de.Close,rn=R.forwardRef(({className:t,...n},r)=>e(de.Overlay,{ref:r,className:Qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));rn.displayName=de.Overlay.displayName;const an=R.forwardRef(({className:n,children:r,...a},i)=>{const s=nt();return t(tn,{container:s,children:[e(rn,{}),e(de.Content,{ref:i,autoFocus:!1,onOpenAutoFocus:e=>{e.preventDefault()},className:Qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...a,children:r})]})});an.displayName=de.Content.displayName;const sn=R.forwardRef(({className:t,...n},r)=>e(de.Description,{ref:r,className:Qe("text-sm text-muted",t),...n}));sn.displayName=de.Description.displayName;const ln=R.forwardRef(({className:t,...n},r)=>e(de.Title,{ref:r,className:Qe("text-lg font-semibold leading-none tracking-tight",t),...n}));function on({title:n,content:r,onConfirm:a,onCancel:i,isOpen:s}){const l=D(null);return t(Jt,{isOpen:s,onClose:i,description:"Confirm Modal",children:[t("div",{className:"sm:flex sm:items-start p-2",children:[e("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:e(v,{className:"size-6 text-red-600","aria-hidden":"true"})}),t("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[e(Zt,{className:"leading-6",show:!0,children:n}),e("div",{className:"mt-2",children:e("div",{className:"prose text-sm text-gray-500",children:r})})]})]}),t(Xt,{align:"right",children:[e(_t,{variant:"destructive",onClick:a,children:"Confirm"}),e(_t,{variant:"outline",onClick:i,ref:l,children:"Cancel"})]})]})}function cn(){return E(dn)}ln.displayName=de.Title.displayName;const dn=S(()=>{}),un={success:y,error:b,warning:x,info:d},mn={success:"text-success",error:"text-destructive",warning:"text-attention",info:"text-info"};function hn({data:n,onClose:r}){const[a,i]=$(!0),s=D(null),l=()=>{s.current&&globalThis.clearTimeout(s.current),n.duration&&(s.current=setTimeout(()=>i(!1),n.duration))},o=()=>{s.current&&(globalThis.clearTimeout(s.current),s.current=null)};A(()=>(l(),o),[n.duration]);const c=un[n.status]||d,m=mn[n.status]||"text-info";return e("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100",children:e("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:e(U,{appear:!0,show:a,as:P,afterLeave:r,enter:"transform ease-out duration-700 transition",enterFrom:"translate-y-0 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-2 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border",onMouseEnter:o,onMouseLeave:l,children:e("div",{className:"p-5",children:t("div",{className:"flex items-start",children:[e("div",{className:"shrink-0",children:e(c,{className:`size-6 ${m}`,"aria-hidden":"true"})}),t("div",{className:"ml-3 flex-1 pt-0.5 min-w-0",children:[e("p",{className:"text-sm font-semibold text-foreground break-words",children:n.title}),n.description&&e("p",{className:"mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed",children:n.description})]}),e("div",{className:"ml-4 flex shrink-0",children:t("button",{type:"button",className:"inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",onClick:()=>i(!1),children:[e("span",{className:"sr-only",children:"Close"}),e(u,{className:"size-5","aria-hidden":"true"})]})})]})})})})})})}function pn({children:r}){const[a,i]=$(null),s=e=>{i(e)};return t(n,{children:[e(dn.Provider,{value:s,children:r}),a&&e(Lt,{children:e(hn,{data:a,onClose:()=>s(null)})})]})}function fn({idToDelete:t,title:n,content:r,setIdToDelete:a,deleteApi:i}){const s=cn();return e(on,{title:n,content:r,isOpen:!!t,onConfirm:async()=>{if(t)return i(t).then(()=>{s({title:"Delete succeeded",status:"success"})}).catch(e=>{s({title:"Failed to delete",description:e.message??"An error occurred while deleting the object",status:"error"})}).finally(()=>{a(void 0)})},onCancel:()=>{a(void 0)}})}const gn=R.forwardRef(({className:t,orientation:n="horizontal",decorative:r=!0,...a},i)=>e(ue.Root,{ref:i,decorative:r,orientation:n,className:Qe("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...a}));gn.displayName=ue.Root.displayName;const vn=R.createContext(null),xn=({hover:t=!1,click:n=!1,children:r,_open:a,onOpenChange:i})=>{const[s,l]=R.useState(a||!1),o=Gt();return e(vn.Provider,{value:{open:s,setOpen:l,hover:t,click:n},children:e(he.Root,{open:s,onOpenChange:e=>{l(e),i&&i(e)},modal:o,children:r})})};function bn(e=!1,t=()=>{},n){e&&t("enter"===n)}const yn=R.forwardRef(({children:t,...n},r)=>{const a=R.useContext(vn);if(!a)throw new Error("PopoverTrigger must be used within a Popover");const{setOpen:i,hover:s,click:l}=a;return e(he.Trigger,{ref:r,asChild:!0,onMouseEnter:()=>bn(s,i,"enter"),onMouseLeave:()=>bn(s,i,"leave"),onClick:()=>{l&&i(e=>!e)},...n,children:t})});yn.displayName=he.Trigger.displayName;const wn=he.Anchor,Nn=R.forwardRef(({className:t,align:n="center",side:r="bottom",...a},i)=>{const s=R.useContext(vn);if(!s)throw new Error("PopoverContent must be used within a Popover");const{setOpen:l,hover:o}=s,c=nt();return e(he.Portal,{container:c,children:e(he.Content,{ref:i,align:n,side:r,onMouseEnter:()=>bn(o,l,"enter"),onMouseLeave:()=>bn(o,l,"leave"),className:Qe("z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in","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",t),...a})})});Nn.displayName=he.Content.displayName;const Cn=he.Close;Cn.displayName=he.Close.displayName;const kn=R.forwardRef(({className:t,...n},r)=>e(pe,{ref:r,className:Qe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));kn.displayName=pe.displayName;const _n=({children:t,...n})=>e(Qt,{...n,children:e(an,{className:"shadow-lg p-0 overflow-hidden",children:e(kn,{className:"[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",children:t})})}),zn=R.forwardRef(({className:n,...r},a)=>t("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[e(w,{className:"opacity-50 size-4 shrink-0"}),e(pe.Input,{ref:a,className:Qe("focus:ring-0","border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]}));zn.displayName=pe.Input.displayName;const In=R.forwardRef(({className:t,...n},r)=>e(pe.List,{ref:r,className:Qe("overflow-y-auto overflow-x-hidden",t),...n}));In.displayName=pe.List.displayName;const Tn=R.forwardRef((t,n)=>e(pe.Empty,{ref:n,className:"py-2 text-sm text-center",...t}));Tn.displayName=pe.Empty.displayName;const Ln=R.forwardRef(({className:t,...n},r)=>e(pe.Group,{ref:r,className:Qe("overflow-y-auto overflow-x-hidden p-1 text-foreground","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));Ln.displayName=pe.Group.displayName;const Mn=R.forwardRef(({className:t,...n},r)=>e(pe.Separator,{ref:r,className:Qe("-mx-1 h-px bg-border",t),...n}));Mn.displayName=pe.Separator.displayName;const Rn=R.forwardRef(({className:t,...n},r)=>e(pe.Item,{ref:r,className:Qe("hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...n}));Rn.displayName=pe.Item.displayName;const On=({className:t,...n})=>e("span",{className:Qe("ml-auto text-xs tracking-widest text-muted-foreground",t),...n});function Sn({options:a,optionLabel:i,value:s,onChange:o,addNew:c,addNewLabel:d,disabled:m,filterBy:h,label:p,placeholder:f,className:g,popupClass:v,isClearable:b,border:y=!0,multiple:w=!1,by:z,inline:I=!1,isLoading:T=!1,warnOnMissingValue:L=!0,missingValueWarning:M="Value not in options list, may not be valid",clearIcon:R,clearTitle:O}){const S=D(null),[E,P]=$(!1),[F,V]=$(0),[Y,B]=$(""),H=j(()=>!(!L||w||null==s||!a)&&!a.some(e=>"string"==typeof z?e[z]===s[z]:"function"==typeof z?z(e,s):me(e,s)),[L,w,s,a,z]);A(()=>{const e=S.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;V(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);const W=(e,t)=>!(!t||0===t.length)&&t.some(t=>U(t,e)),U=(e,t)=>null==e||null==t?e===t:"string"==typeof z?e[z]===t[z]:"function"==typeof z?z(e,t):me(e,t);let G=a||[];const K=Y.toLowerCase(),J=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(h);G=G.filter(e=>J(e).includes(K));const Z=()=>t(n,{children:[h&&t("div",{className:"flex justify-start items-center mb-1",children:[e("div",{className:"mx-2",children:e(k,{className:"size-4"})}),e(ft,{variant:"unstyled",value:Y,onChange:B,className:"w-full p-1 rounded-md",placeholder:"Search..."})]}),e(kn,{className:"overflow-hidden",children:t(In,{className:I?"max-h-full overflow-y-auto":"max-h-[200px] overflow-y-auto",onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[e(Tn,{children:"No result found."}),e(Ln,{children:G?.map((n,r)=>{const a=w?W(n,Array.isArray(s)?s:[]):null!=s&&U(s,n);return e(Rn,{onSelect:()=>(e=>{if(w){const t=Array.isArray(s)?s:[];if(W(e,t)){const n=t.filter(t=>!U(t,e));o(n)}else o([...t,e])}else P(!1),o(e)})(n),className:"w-full",children:w||I?t("div",{className:"w-full flex justify-between items-center cursor-pointer",children:[e("div",{className:"w-full truncate text-left",children:i?i(n):n}),a&&e(l,{className:"size-4"})]}):t(Cn,{className:"w-full flex justify-between items-center",children:[e("div",{className:"w-full truncate text-left",children:i?i(n):n}),a&&e(l,{className:"size-4"})]})},r)})})]})}),c&&e("div",{className:"p-1",children:t("a",{onClick:c,className:r("gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent"),children:[e(_,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),d]})})]});return I?e("div",{className:r(g,y&&"border border-border rounded-md","bg-popover p-1",v),children:T?e("div",{className:"flex justify-center items-center p-2 text-muted text-sm",children:e(N,{className:"size-4 animate-spin"})}):Z()}):t(xn,{children:[e(yn,{asChild:!0,children:e("div",{ref:S,onClick:e=>{m||T?e.preventDefault():P(!E)},className:r(g,T?"flex justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm":r(y&&(H?"border border-destructive":"border border-border"),"flex flex-row gap-2 items-center justify-between p-2 rounded-md group relative [&:hover_.clear-button]:opacity-100",m?"cursor-not-allowed text-muted":"cursor-pointer hover:bg-muted")),children:T?e(N,{className:"size-4 animate-spin"}):t(n,{children:[t("div",{className:r("flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate",!m&&"",b&&s&&(!Array.isArray(s)||s.length>0)&&"pr-6"),children:[p&&e("div",{className:"w-full text-left text-xs font-semibold",children:p}),t("div",{className:r("w-full text-left ",!m&&"",H&&"text-destructive"),children:[H&&e(lt,{description:M,placement:"top",asChild:!0,children:e(x,{className:"inline-block size-4 mr-1 -mt-0.5 cursor-help"})}),w?(()=>{const n=Array.isArray(s)?s:s?[s]:[];return 0===n.length?e("span",{className:"text-muted",children:f}):1===n.length?i?i(n[0]):n[0]:t("div",{className:"flex flex-wrap gap-1",children:[n.slice(0,1).map((t,n)=>e("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded",children:i?i(t):t},n)),n.length>1&&t("span",{className:"inline-flex items-center px-2 py-1 text-xs bg-muted rounded",children:["+",n.length-1," more"]})]})})():(()=>{if(!s||Array.isArray(s)&&0===s.length)return e("span",{className:"text-muted",children:f});const t=Array.isArray(s)?s[0]:s;return i?i(t):t})()]})]}),t("div",{className:"flex items-center gap-1 group",children:[b&&s&&(!Array.isArray(s)||s.length>0)&&e(_t,{variant:"link",size:"icon",disabled:m,alt:O||"Clear selection",onClick:e=>{e.stopPropagation(),o(w?[]:void 0)},className:"cursor-pointer hover:bg-muted/20 clear-button opacity-0 transition-opacity duration-200 rounded p-1",children:R||e(u,{className:"size-4"})}),!m&&e(C,{className:"size-4 opacity-50"})]})]})})}),e(Nn,{style:{width:`${F}px`,zIndex:1e6},className:r("min-w-[8rem] w-64 bg-popover p-1 border shadow","divide-y divide-border",v),children:Z()})]})}On.displayName="CommandShortcut";const Dn=R.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:"tabs",updateHash:!0}),$n=({tabs:t,defaultValue:n,current:r,className:a,fullWidth:i,children:s,onTabChange:l,responsive:o=!1,variant:c="tabs",updateHash:d=!0})=>{const u=R.useMemo(()=>t.filter(e=>void 0===e.is_allowed||!0===e.is_allowed),[t]),[m,h]=R.useState(()=>{const e="function"==typeof r?r():r;if(e)return e;const t=window.location.hash,a=t?t.substring(1):void 0;return a&&u.some(e=>e.name===a)?a:n||u[0]?.name});R.useEffect(()=>{const e="function"==typeof r?r():r;e&&e!==m&&h(e)},[r]),R.useEffect(()=>{if(r)return;const e=()=>{const e=window.location.hash,t=e?e.substring(1):void 0;t&&u.some(e=>e.name===t)?h(t):!e&&n&&h(n)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[r,u,n]);const p=e=>{if(h(e),d&&!r){const t=window.history.state,n=window.location.pathname+window.location.search+"#"+e;window.history.pushState(t,"",n)}l&&l(e)},f=R.useCallback(e=>{p(e)},[p]);return e(Dn.Provider,{value:{tabs:u,size:i?u.length:0,current:m,setTab:f,responsive:o,variant:c,updateHash:d},children:e(fe.Root,{defaultValue:m||u[0]?.name,value:m,onValueChange:p,className:a,children:s})})},An=({className:r})=>{const{tabs:a,size:i,current:s,setTab:l,responsive:o,variant:c,updateHash:d}=R.useContext(Dn),u=0!==i,m=R.useCallback(e=>{if(!a||!l)return;const t=a.find(t=>t.name===e);if(t?.href&&d){const e=window.history.state;window.history.pushState(e,"",t.href)}l(e)},[a,l,d]);return a&&l?t(n,{children:[o&&e("div",{className:"px-2 block lg:hidden",children:e(Sn,{label:"Tab",className:r,options:a,optionLabel:e=>"string"==typeof e.label?e.label:String(e.label),value:a.find(e=>e.name===s),onChange:e=>{m(e.name)}})}),e(Pn,{size:i,variant:c,className:Qe(u?"w-full":"",r,o?"hidden lg:flex":""),children:a.map(t=>e(Fn,{value:t.name,disabled:t.disabled,href:t.href,variant:c,onClick:()=>m(t.name),children:t.label},t.name))})]}):(console.warn("TabsBar: No tabs provided or setTab not available"),null)},En=({className:t})=>{const{tabs:r}=R.useContext(Dn);return r?e(n,{children:r.map(n=>e(jn,{value:n.name,className:t,children:n.content},n.name))}):null},Pn=R.forwardRef(({className:t,size:n,variant:r="tabs",...a},i)=>e(Dn.Provider,{value:{size:n,variant:r},children:e(fe.List,{ref:i,className:Qe("tabs"===r?"border-b -mb-px flex space-x-4":"flex space-x-2 p-1 rounded-md",t),...a})}));Pn.displayName=fe.List.displayName;const Fn=R.forwardRef(({className:t,href:n,variant:r="tabs",...a},i)=>{const{size:s}=R.useContext(Dn),l=R.useCallback(e=>{if(n){e.preventDefault();const t=window.history.state;window.history.pushState(t,"",n)}a.onClick&&a.onClick(e)},[n,a.onClick]);return e(fe.Trigger,{ref:i,className:Qe("tabs"===r?Qe("border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer","border-transparent text-muted-foreground hover:border-border hover:text-foreground","data-[state=active]:border-primary data-[state=active]:text-primary","disabled:pointer-events-none disabled:opacity-50"):Qe("px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors","tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset","data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm","disabled:pointer-events-none disabled:opacity-50"),t,s?`w-1/${s}`:""),onClick:l,...a})});Fn.displayName=fe.Trigger.displayName;const jn=R.forwardRef(({className:t,...n},r)=>e(fe.Content,{ref:r,className:Qe("focus-visible:outline-none","flex-1 overflow-y-auto min-h-0 pt-2",t),...n}));jn.displayName=fe.Content.displayName;const Vn=se("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Yn=R.forwardRef(({className:n,required:r,...a},i)=>t(ge.Root,{ref:i,className:Qe(Vn(),n),...a,children:[a.children,r&&e("span",{className:"text-destructive-foreground ml-1",children:"*"})]}));function Bn({path:n,maxItems:r=3,className:a,separator:i}){const s=n||[],l=t=>t.onClick?e(Gn,{onClick:t.onClick,href:t.href,children:t.label}):t.href?e(Gn,{href:t.href,children:t.label}):e(Kn,{children:t.label});if(s.length<=r)return e(Hn,{className:Qe("w-full",a),children:e(Wn,{children:s.map((n,r)=>t(R.Fragment,{children:[e(Un,{children:l(n)}),r<s.length-1&&e(Jn,{children:i??e(z,{})})]},r))})});const o=s.slice(-(r-1));return e(Hn,{className:Qe("w-full",a),children:t(Wn,{children:[e(Un,{children:e(Zn,{})}),e(Jn,{children:i??e(z,{})}),o.map((n,r)=>t(R.Fragment,{children:[e(Un,{children:l(n)}),r<o.length-1&&e(Jn,{children:i??e(z,{})})]},r))]})})}Yn.displayName=ge.Root.displayName;const Hn=R.forwardRef(({...t},n)=>e("nav",{ref:n,"aria-label":"breadcrumb",...t}));Hn.displayName="Breadcrumb";const Wn=R.forwardRef(({className:t,...n},r)=>e("ol",{ref:r,className:Qe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...n}));Wn.displayName="BreadcrumbList";const Un=R.forwardRef(({className:t,...n},r)=>e("li",{ref:r,className:Qe("inline-flex items-center gap-1.5 text-muted",t),...n}));Un.displayName="BreadcrumbItem";R.forwardRef(({asChild:t,className:n,...r},a)=>e("a",{ref:a,className:Qe("transition-colors hover:text-muted",n),...r})).displayName="BreadcrumbLink";const Gn=R.forwardRef(({className:t,href:n,onClick:r,...a},i)=>e("button",{ref:i,className:Qe("transition-colors hover:text-foreground cursor-pointer",t),onClick:e=>{e.preventDefault(),r&&r(e)},...a}));Gn.displayName="BreadcrumbButton";const Kn=R.forwardRef(({className:t,...n},r)=>e("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:Qe("font-normal text-foreground",t),...n}));Kn.displayName="BreadcrumbPage";const Jn=({children:t,className:n,...r})=>e("li",{role:"presentation","aria-hidden":"true",className:Qe("[&>svg]:w-3.5 [&>svg]:h-3.5",n),...r,children:t??e(z,{})});Jn.displayName="BreadcrumbSeparator";const Zn=({className:n,...r})=>t("span",{role:"presentation","aria-hidden":"true",className:Qe("flex h-9 w-9 items-center justify-center",n),...r,children:[e(I,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"More"})]});Zn.displayName="BreadcrumbEllipsis";const qn=({children:t,className:n})=>{const r=D(null),[a,i]=$("auto");return A(()=>{if(r.current){const e=new ResizeObserver(e=>{const t=e[0].contentRect.height;i(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),e("div",{className:Qe(n,"overflow-hidden transition-all duration-100 ease-in"),style:{height:a},children:e("div",{ref:r,children:t})})},Xn=R.forwardRef(({className:t,...n},r)=>e(ve.Root,{ref:r,className:Qe("peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white",t),...n,children:e(ve.Indicator,{className:Qe("flex items-center justify-center text-current"),children:e(l,{className:"size-4"})})}));function Qn({value:t,labelRenderer:r,fallbackLabel:a}){const[i,s]=$(a||t),[l,o]=$(!1);return A(()=>{if(!r)return void s(a||t);(async()=>{o(!0);try{const e=r(t);if(e instanceof Promise){const t=await e;s(t)}else s(e)}catch(e){console.error("Error rendering label:",e),s(a||t)}finally{o(!1)}})()},[t,r,a]),l?e("span",{className:"text-muted-foreground",children:"Loading..."}):e(n,{children:i})}Xn.displayName=ve.Root.displayName;const er=({filterType:r,filterValues:a,setFilterValues:i,options:s,labelRenderer:l})=>{const[o,c]=$(!1),[d,u]=$(""),m=D(null),h=s?.filter(e=>!a.some(t=>t.value===e.value));return t(xn,{_open:o,onOpenChange:e=>{c(e),e||setTimeout(()=>{u("")},200)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0",children:e("div",{className:"flex gap-1.5 items-center",children:1===a?.length?(()=>{const t=a[0];return e(Qn,{value:t.value||"",labelRenderer:l,fallbackLabel:t.label})})():`${a?.length} selected`})}),e(Nn,{className:"w-[300px] p-0",children:e(qn,{children:t(kn,{children:[e(zn,{placeholder:r,className:"h-9",value:d,onInputCapture:e=>{u(e.currentTarget.value)},ref:m}),t(In,{children:[e(Tn,{children:"No results found."}),e(Ln,{children:a.map(n=>t(Rn,{className:"group flex gap-2 items-center",onSelect:()=>{i(a.filter(e=>e.value!==n.value)),setTimeout(()=>{u("")},200),c(!1)},children:[e("input",{type:"checkbox",checked:!0,onChange:()=>{}}),e(Qn,{value:n.value||"",labelRenderer:l,fallbackLabel:n.label})]},n.value))}),h?.length>0&&t(n,{children:[e(Mn,{}),e(Ln,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(n=>t(Rn,{className:"group flex gap-2 items-center",value:String(n.label||n.value),onSelect:()=>{i([...a,{value:n.value,label:n.label}]),setTimeout(()=>{u("")},200),c(!1)},children:[e(Xn,{checked:!1,className:"opacity-0 group-data-[selected=true]:opacity-100"}),e("span",{className:"text-muted",children:e(Qn,{value:n.value||"",labelRenderer:n.labelRenderer||l,fallbackLabel:n.label})})]},n.value))})]})]})]})})})]})},tr="\n.calendar-wrapper .react-calendar__navigation {\n display: flex !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 8px !important;\n padding: 8px !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__label {\n flex: 1 !important;\n text-align: center !important;\n font-weight: 500 !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n min-width: 32px !important;\n height: 32px !important;\n border-radius: 4px !important;\n border: 1px solid hsl(var(--border)) !important;\n background: hsl(var(--background)) !important;\n color: hsl(var(--foreground)) !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow:hover {\n background: oklch(var(--muted)) !important;\n}\n\n.calendar-wrapper .react-calendar__tile {\n cursor: pointer !important;\n width: 0.5rem !important;\n font-size: 0.875rem !important;\n}\n\n.calendar-wrapper .react-calendar__tile:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile:not(.react-calendar__tile--active):hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled,\n.calendar-wrapper .react-calendar__tile:disabled,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled {\n cursor: not-allowed !important;\n color: #9ca3af !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled:hover,\n.calendar-wrapper .react-calendar__tile:disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled:hover {\n background: transparent !important;\n}\n\n\n.calendar-wrapper .react-calendar__month-view__weekdays {\n font-size: 0.75rem !important;\n}\n\n.calendar-wrapper .react-calendar__month-view__weekdays__weekday {\n width: 0.75rem !important;\n font-size: 0.75rem !important;\n text-align: center !important;\n}\n \n",nr=({filterValues:r,setFilterValues:a,isRange:i=!1})=>{const[s,l]=$(!1),[o,c]=$([null,null]),d=r[0]?new Date(r[0]):void 0,u=i?[o[0]||(r[0]?new Date(r[0]):null),o[1]||(r[1]?new Date(r[1]):null)]:[null,null];A(()=>{i&&c([r[0]?new Date(r[0]):null,r[1]?new Date(r[1]):null])},[r,i]);const m=e=>{if(i)Array.isArray(e)&&(c([e[0],e[1]]),e[0]&&e[1]?a([xe(e[0]).format("YYYY-MM-DD"),xe(e[1]).format("YYYY-MM-DD")]):e[0]&&a([xe(e[0]).format("YYYY-MM-DD")]));else if(e){const t=Array.isArray(e)?e[0]:e;t&&(a([xe(t).format("YYYY-MM-DD")]),l(!1))}};return t(xn,{_open:s,onOpenChange:l,children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center min-h-[20px]",children:i?u[0]&&u[1]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:xe(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"-"}),e("span",{className:"font-medium",children:xe(u[1]).format("MMMM DD, YYYY")})]}):u[0]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:xe(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"- Select end"})]}):e("span",{className:"text-muted-foreground",children:"Select range"}):d?xe(d).format("MMMM DD, YYYY"):"Pick a date"})}),e(Nn,{className:"w-auto p-0",align:"start",side:"bottom",alignOffset:-4,sideOffset:6,children:e("div",{className:"p-2",children:i?t(n,{children:[t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:u,onChange:m,selectRange:!0,returnValue:"range",maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(u[0]){const e=u[0].getTime();if(u[1]){const n=u[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}})]}),u[0]&&u[1]&&e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"}),e(_t,{size:"sm",onClick:()=>l(!1),children:"Apply"})]})})]}):t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(d&&t===d.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})]})},rr=({filterType:n,filterValue:r,setFilterValue:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(xn,{_open:i,onOpenChange:e=>{s(e),e||l===r||o(r)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r||"Enter text..."})}),e(Nn,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(ft,{autoFocus:!0,type:"text",size:"sm",value:l,onChange:o,onKeyDown:e=>{"Enter"===e.key&&(a(l),s(!1))},placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})})]})})]})},ar=({filterType:n,filterValues:r,setFilterValues:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(xn,{_open:i,onOpenChange:e=>{s(e),e||JSON.stringify(l)===JSON.stringify(r)||o(r)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r.length>0?1===r.length?r[0]:`${r.length} tags`:"Add tags..."})}),e(Nn,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-3",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(gt,{value:l,onChange:o,placeholder:`Add ${n.toLowerCase()}...`}),t("div",{className:"flex gap-2 justify-end",children:[e(_t,{size:"sm",variant:"ghost",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})]})})]})};function ir(t,n,r){switch(t.type){case"date":return e(nr,{filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value.map(e=>e.value||""):[],isRange:t.multiple,setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e.length>0?e.map(e=>({value:e,label:xe(e).format("LLL dd, y")})):[]}:n))}});case"text":return e(rr,{filterType:t.placeholder||t.name,filterValue:Array.isArray(t.value)&&t.value[0]&&"object"==typeof t.value[0]&&t.value[0].value||"",setFilterValue:e=>{n(n=>n.map(n=>n===t?{...n,value:[{value:e,label:e}]}:n))}});case"stringList":return e(ar,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"string"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e}:n))}});default:{const a=r.find(e=>e.name===t.name);return e(er,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e}:n))},options:a?.options||[],labelRenderer:a?.labelRenderer})}}}function sr({filters:n,setFilters:r,filterGroups:a}){return e("div",{className:"flex gap-2 flex-wrap justify-start",children:n.filter(e=>e.value?.length>0).map(n=>t("div",{className:"flex gap-[1px] items-center text-sm",children:[e("div",{className:"flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center",children:n.placeholder||n.name}),ir(n,r,a),e(_t,{variant:"ghost",size:"icon",onClick:()=>{r(e=>e.filter(e=>e!==n))},className:"bg-muted rounded-l-none rounded-r-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0",children:e(u,{className:"size-6"})})]},n.name+"-"+("date"==n.type?"date":"stringList"===n.type&&"string"==typeof n.value[0]?n.value.join(","):Array.isArray(n.value)?n.value.map(e=>e.value).join(","):"")))})}function lr({selectedView:n,textValue:r,setTextValue:a,setFilters:i,handleClose:s,filterGroups:l}){const o=()=>{i(e=>[...e,{name:n||"",placeholder:l.find(e=>e.name===n)?.placeholder,value:[{value:r,label:r}],type:"text"}]),s()};return t("div",{className:"p-2 flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:l.find(e=>e.name===n)?.placeholder})}),e(ft,{autoFocus:!0,type:"text",size:"sm",value:r,onChange:a,onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(_t,{size:"sm",onClick:o,disabled:!r.trim(),children:"Apply"})]})})]})}function or({selectedView:r,selectedDate:a,setSelectedDate:i,setFilters:s,filters:l,handleClose:o,filterGroups:c}){const[d,u]=$([null,null]),[m,h]=$([null,null]),p=c.find(e=>e.name===r),f=p?.multiple,g=new Date;g.setHours(23,59,59,999);const v=[m[0]||d[0],m[1]||d[1]],x=e=>{if(f)Array.isArray(e)?(h([e[0],e[1]]),u([e[0],e[1]])):(h([e,null]),u([e,null]));else{const t=Array.isArray(e)?e[0]:e;if(i(t||void 0),t){const e=new Date(t);e.setHours(0,0,0,0),s([...l,{name:r||"",placeholder:p?.placeholder,value:[{value:e.toISOString(),label:xe(e).format("LLL dd, y")}],type:p?.type||"date",multiple:p?.multiple||!1}]),o()}}};return e("div",{className:"p-2",children:f?t(n,{children:[e("div",{children:f?v[0]&&v[1]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:xe(v[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"To:"}),e("span",{className:"text-xs font-medium",children:xe(v[1]).format("MMMM DD, YYYY")})]}):v[0]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:xe(v[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"→ Select end date"})]}):e("span",{className:"text-muted text-xs",children:p?.placeholder||p?.name||r||"Select date range"}):a?xe(a).format("MMMM DD, YYYY"):"Pick a date"}),t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:v,onChange:x,selectRange:!0,returnValue:"range",maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(v[0]){const e=v[0].getTime();if(v[1]){const n=v[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:o,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{if(d[0]){const e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);const n=[];n.push({value:e.toISOString(),label:xe(e).format("LLL dd, y")}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:xe(t).format("LLL dd, y")}),s([...l,{name:r||"",placeholder:p?.placeholder,value:n,type:p?.type||"date",multiple:p?.multiple||!1}]),o()}},disabled:!v[0],children:"Apply"})]})})]}):e(n,{children:t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:a,onChange:x,selectRange:!1,maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(a&&t===a.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})}function cr({selectedView:n,commandInput:r,setFilters:a,handleClose:i,filterGroups:s}){const[l,o]=$([]);if(!n)return null;const c=(e=>{const t=s.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){const e=r.toLowerCase();return n.filter(n=>void 0!==n.value&&t.filterBy(n.value,e))}const a=r.toLowerCase();return n.filter(e=>String(e.value||"").toLowerCase().includes(a))})(n),d=s.find(e=>e.name===n);return t("div",{className:"flex flex-col h-full",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted shrink-0",children:e("span",{children:d?.placeholder||d?.name})}),e("div",{className:"flex-1 overflow-hidden min-h-0",children:e("div",{className:"max-h-[200px] overflow-y-auto",children:c.length>0&&c.map(r=>{const s=l.some(e=>e.value===r.value);return t(Rn,{className:"group flex gap-2 items-center w-full hover:bg-muted "+(d?.multiple&&s?"bg-muted":""),onSelect:()=>(e=>{const t={value:e.value,label:e.label};if(d?.multiple){const n=l.some(t=>t.value===e.value);o(n?t=>t.filter(t=>t.value!==e.value):e=>[...e,t])}else a(e=>{const r=e.findIndex(e=>e.name===n);if(r>=0){const n=[...e];return n[r]={...n[r],value:[t]},n}return[...e,{name:n||"",placeholder:d?.placeholder||"",value:[t],type:d?.type||"select",multiple:d?.multiple||!1}]}),i()})(r),children:[e(Qn,{value:r.value||"",labelRenderer:r.labelRenderer||d?.labelRenderer,fallbackLabel:r.label}),d?.multiple&&s&&e("span",{className:"ml-auto text-xs text-success",children:"✓"})]},r.value||`option-${Math.random()}`)})})}),d?.multiple&&e("div",{className:"p-2 border-t shrink-0",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:i,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{l.length>0&&a(e=>[...e.filter(e=>e.name!==n),{name:n||"",placeholder:d?.placeholder||"",value:l,type:d?.type||"select",multiple:d?.multiple||!1}]),i()},disabled:0===l.length,children:"Apply"})]})})]})}function dr({selectedView:n,setFilters:r,handleClose:a,filterGroups:i}){const[s,l]=$([]),o=i.find(e=>e.name===n);return t("div",{className:"p-2 space-y-3",children:[e("div",{className:"space-y-2",children:e(gt,{value:s,onChange:l,placeholder:o?.placeholder||`Add ${n}...`,autoFocus:!0})}),t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{s.length>0&&r(e=>[...e.filter(e=>e.name!==n),{name:n,placeholder:o?.placeholder,value:s,type:"stringList"}]),a()},disabled:0===s.length,children:"Apply"})]})]})}const ur=O.createContext({}),mr=({filters:t,setFilters:n,filterGroups:r,children:a})=>{const i=new URL(window.location.href).searchParams,[s]=O.useState(()=>new URLSearchParams(window.location.search).get("filters")),l=O.useRef(new Set),o=O.useRef(!s);return A(()=>{if(o.current)try{const e=new URLSearchParams(i.toString());if(t.length>0){const n=t.map(e=>{let t;if("stringList"===e.type&&Array.isArray(e.value)&&"string"==typeof e.value[0])t=`[${e.value.map(e=>encodeURIComponent(e)).join(",")}]`;else if(Array.isArray(e.value))if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(e.value||e||"")).join(",")}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(e.value||e||"")).join(",")}]`;else{const n=e.value[0];t="string"==typeof n?encodeURIComponent(n):"object"==typeof n&&void 0!==n?.value?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||""))}else t=encodeURIComponent(e.value||"");return`${encodeURIComponent(e.name)}:${t}`}).join(";");e.set("filters",n)}else e.delete("filters");const n=`${window.location.pathname}?${e.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},"",n)}catch(e){console.error("Failed to update URL with filters:",e)}},[t]),A(()=>{if(s&&0!==r.length)try{const e=s.split(";"),t=[];for(const n of e){const[e,a]=n.split(":"),i=decodeURIComponent(e);if(l.current.has(i))continue;const s=r.find(e=>e.name===i);if(!s)continue;let o,c;if(l.current.add(i),a.startsWith("[")&&a.endsWith("]")){const e=a.slice(1,-1);o=e?e.split(",").map(e=>decodeURIComponent(e)):[]}else o=[decodeURIComponent(a)];c="stringList"===s.type?o:"text"===s.type?1===o.length?[{value:o[0],label:o[0]}]:o.map(e=>({value:e,label:e})):o.map(e=>{const t=s.options?.find(t=>t.value===e);let n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),!s.multiple||a.startsWith("[")||a.endsWith("]")||("stringList"===s.type?c=o:Array.isArray(c)||(c=[c])),t.push({name:i,type:s.type,placeholder:s.placeholder,value:c,multiple:s.multiple})}t.length>0&&n(e=>[...e,...t]),o.current=!0}catch(e){}},[r,s]),e(ur.Provider,{value:{filters:t,setFilters:n,filterGroups:r},children:a})},hr=({className:n})=>{const{filters:r,setFilters:a,filterGroups:i}=O.useContext(ur),[s,l]=O.useState(!1),[o,c]=O.useState(null),[d,u]=O.useState(""),m=O.useRef(null),[h,p]=O.useState(),[f,g]=O.useState(""),v=()=>{l(!1),setTimeout(()=>{c(null),u(""),p(void 0)},200)};return t(xn,{_open:s,onOpenChange:e=>{l(e),e||setTimeout(()=>{c(null),u(""),g("")},200)},children:[e(yn,{asChild:!0,children:t(_t,{variant:"outline",role:"combobox","aria-expanded":s,size:"md",className:Qe("transition group flex gap-1.5",n),children:[e(T,{className:"size-4 shrink-0 transition-all text-muted"}),"Filter"]})}),e(Nn,{className:"w-[300px] p-0",align:"start",sideOffset:4,children:t(kn,{children:["select"===i.find(e=>e.name===o)?.type&&e(zn,{placeholder:o?`Filter by ${o}`:"Filter...",className:"h-9 ring-0",value:d,onValueChange:e=>{u(e)},ref:m,autoFocus:!0}),t(In,{children:[e(Tn,{children:"No matching filters"}),e(Ln,{children:o?(()=>{if(!o)return null;const t=i.find(e=>e.name===o)?.type;switch(t){case"date":return e(or,{selectedView:o,selectedDate:h,setSelectedDate:p,setFilters:a,filters:r,handleClose:v,filterGroups:i});case"text":return e(lr,{selectedView:o,textValue:f,setTextValue:g,setFilters:a,handleClose:v,filterGroups:i});case"stringList":return e(dr,{selectedView:o,setFilters:a,handleClose:v,filterGroups:i});default:return e(cr,{selectedView:o,commandInput:d,setFilters:a,handleClose:v,filterGroups:i})}})():(()=>{let t=i.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>"date"===n.type?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&"string"==typeof n.value[0]?n.value.some(e=>e===t.value):n.value.some(e=>e.value===t.value))))})).filter(e=>(e.options??[]).length>0||"date"===e.type&&!r.some(t=>t.name===e.name)||"text"===e.type&&!r.some(t=>t.name===e.name)||"stringList"===e.type&&!r.some(t=>t.name===e.name));return 0===t.length?e(Tn,{children:"No available filters"}):t.map((t,n)=>e(Rn,{onSelect:()=>{return e=t.name,c(e),u(""),void m.current?.focus();var e},className:"group flex gap-2 items-center hover:bg-muted",children:e("span",{children:t.placeholder??t.name})},n))})()})]})]})})]})},pr=({className:t})=>{const{filters:n,setFilters:r,filterGroups:a}=O.useContext(ur);return e("div",{className:Qe(t),children:e(sr,{filters:n,setFilters:r,filterGroups:a})})},fr=({className:t})=>{const{filters:n,setFilters:r}=O.useContext(ur);return n.filter(e=>e.value?.length>0).length>0?e(_t,{variant:"outline",size:"xs",className:Qe("transition group",t),onClick:()=>r([]),children:"Clear All"}):null};var gr;!function(e){e.IS="is",e.IS_NOT="is_not",e.CONTAINS="contains",e.BEFORE="before",e.AFTER="after",e.IS_ANY_OF="is_any_of"}(gr||(gr={}));const vr=F(({className:t,level:n=3,...r},a)=>e(`h${n}`,{ref:a,className:Qe({h1:"text-2xl font-medium tracking-tight",h2:"text-xl font-medium tracking-tight",h3:"text-lg font-medium",h4:"text-base font-medium",h5:"text-sm font-medium",h6:"text-xs font-medium"}[`h${n}`],"mb-2",t),...r}));vr.displayName="Heading";const xr=se("text-foreground",{variants:{size:{xl:"text-base md:text-lg leading-relaxed",lg:"text-base leading-relaxed",default:"text-sm leading-normal",sm:"text-sm leading-normal",xs:"text-xs leading-normal"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold"}},defaultVariants:{size:"default",weight:"normal"}}),br=F(({className:t,size:n,weight:r,...a},i)=>e("p",{ref:i,className:Qe(xr({size:n,weight:r,className:t})),...a}));function yr({className:t,...n}){return e(ye.PanelGroup,{"data-slot":"resizable-panel-group",className:Qe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...n})}function wr({...t}){return e(ye.Panel,{"data-slot":"resizable-panel",...t})}function Nr({withHandle:t,className:n,...r}){return e(ye.PanelResizeHandle,{"data-slot":"resizable-handle",className:Qe("bg-muted 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),...r,children:t&&e("div",{className:"z-10 flex size-4 items-center justify-center rounded-xs font-semibold",children:e(L,{className:"size-4 rotate-90"})})})}function Cr({className:t,minLines:n,maxLines:r,value:a,...i}){const s=D(null),l=void 0!==n||void 0!==r,o=V(()=>{const e=s.current;if(!e)return;const t=getComputedStyle(e),a=parseFloat(t.lineHeight)||1.5*parseFloat(t.fontSize),i=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),l=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),o=r??1/0,c=(n??1)*a+i+l,d=o===1/0?1/0:o*a+i+l;e.style.height="auto";const u=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${u}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?"auto":"hidden"},[n,r]);return Y(()=>{l&&o()},[a,l,o]),e("textarea",{ref:s,"data-slot":"textarea",value:a,className:Qe("py-2 text-sm","flex w-full rounded-md border border-input bg-background ring-offset-background","placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",l&&"resize-none",t),...i})}function kr({icon:n,status:r,title:a,children:i,className:s}){let l,o,c,u;switch(r){case"error":l=e(b,{className:"size-5 text-destructive","aria-hidden":"true"}),o="",c="text-foreground",u="bg-destructive border border-destructive";break;case"warning":l=e(x,{className:"size-5 text-attention","aria-hidden":"true"}),o="",c="text-foreground",u="bg-attention border border-attention";break;case"success":l=e(y,{className:"size-5 text-success","aria-hidden":"true"}),o="",c="text-foreground",u="bg-success border border-success";break;case"info":l=e(d,{className:"size-5 text-info","aria-hidden":"true"}),o="",c="text-foreground",u="bg-info border border-info";break;case"default":l=e(d,{className:"size-5 text-muted","aria-hidden":"true"}),o="",c="text-foreground",u="bg-muted border border-muted";break;case"done":l=e(d,{className:"size-5 text-done","aria-hidden":"true"}),o="",c="text-foreground",u="bg-done border border-done"}return e("div",{className:`rounded-md p-4 ${u} ${s}`,children:t("div",{className:"flex",children:[e("div",{className:"shrink-0",children:n??l}),t("div",{className:"w-full ml-2 px-1",children:[a&&e("h3",{className:`text-sm font-medium mb-2 ${o}`,children:a}),e("div",{className:`text-sm ${c} break-words`,children:i})]})]})})}function _r({title:t,className:n,children:r}){return e(kr,{status:"error",title:t,className:n,children:e("pre",{className:"whitespace-pre-wrap break-words",children:r})})}function zr({title:t,className:n,children:r}){return e(kr,{status:"info",title:t,className:n,children:r})}function Ir({title:t,className:n,children:r}){return e(kr,{status:"warning",title:t,className:n,children:r})}function Tr({title:t,className:n,children:r}){return e(kr,{status:"success",title:t,className:n,children:r})}function Lr({title:t,className:n,children:r}){return e(kr,{status:"default",title:t,className:n,children:r})}function Mr({children:n,action:r,title:a,description:i,footer:s,className:l,collapsible:c,defaultCollapsed:u=!1}){const[m,h]=$(u);return t("div",{className:`p-4 flex flex-col gap-2 rounded-sm border bg-card ${l}`,children:[t("div",{className:"flex items-center justify-between",children:[t("div",{className:"flex items-center gap-2",children:[e("div",{className:"font-semibold text-lg",children:a}),i&&e(lt,{description:i,children:e(d,{className:"size-4 text-muted"})})]}),t("div",{className:"flex gap-2 items-center",children:[r,c&&e(_t,{variant:"ghost",size:"icon",onClick:()=>h(!m),children:e(m?o:M,{className:"size-4"})})]})]}),!m&&n,s&&e("div",{className:"border-t border-muted flex flex-col-2 text-sm pt-4",children:s})]})}br.displayName="Text";function Rr(t,n){return{label:String(t),check:e(n?l:"div",{className:"size-4"}),reverse:!1,className:"flex-1 px-2 py-2 hover:bg-accent nowrap"}}function Or({value:n,options:a,onChange:i,className:s,optionLayout:l,by:o,noCheck:c,filterBy:d}){const[u,m]=$(n),[h,p]=$(""),f=e=>{m(e),i(e)},g=j(()=>"string"==typeof o?(e,t)=>e[o]===t[o]:o||((e,t)=>e===t),[o]);return t("div",{className:r("",s),children:[d&&e(ft,{type:"text",placeholder:"Filter...",value:h,onChange:e=>p(e)}),a.map((t,n)=>{if(d&&!d(h)(t))return null;const r=!!u&&g(u,t);let a;return l?(a=l(t,r),a=Object.assign(Rr(t,r),a)):a=Rr(t,r),e(Sr,{option:t,onSelect:f,layout:a,noCheck:c},n)})]})}function Sr({option:n,onSelect:a,layout:i,noCheck:s}){return t("div",{className:r("group flex items-center cursor-pointer gap-x-2 hover:bg-muted",i.reverse&&"flex-row-reverse",i.className),onClick:()=>a(n),children:[s?null:e("div",{className:"",children:i.check}),e("div",{className:"flex-1",children:i.label})]})}function Dr({onSelect:a,selected:i,options:s}){return t(Q,{value:i,onChange:a,children:[e(Q.Label,{className:"sr-only",children:"Server size"}),e("div",{className:"space-y-4",children:s.map(a=>e(Q.Option,{value:a,className:({active:e})=>r(e?"border-border ring-2 ring-ring":"border-border","relative block cursor-pointer rounded-lg border bg-accent px-6 py-4 shadow-2xs focus:outline-hidden sm:flex sm:justify-between"),children:({active:i,checked:s})=>t(n,{children:[e("span",{className:"flex items-center",children:t("span",{className:"flex flex-col text-sm",children:[e(Q.Label,{as:"span",className:"font-medium text-text",children:a.label}),a.description&&e(Q.Description,{as:"span",className:"text-muted-foreground",children:a.description})]})}),e("span",{className:r(i?"border":"border-2",s?"border-accent-foreground":"border-transparent","pointer-events-none absolute -inset-px rounded-lg"),"aria-hidden":"true"})]})},a.id))})]})}function $r({isOpen:n,title:r,onClose:a,children:i,panelWidth:s=768,backdrop:l=!1,side:o="right",resizable:c=!0,className:d}){const[u,m]=$(s),h="left"===o,p=h?"left-0":"right-0",f=h?"pr-10 sm:pr-16":"pl-10 sm:pl-16",g=h?"border-r":"border-l",v=h?"-right-1":"-left-1",x=h?"-100%":"100%";return e(oe,{children:n&&t("div",{className:"relative z-20",children:[l&&e(le.div,{className:"fixed inset-0 bg-black/70",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),e("div",{className:`fixed inset-y-0 ${p} overflow-hidden`,children:e("div",{className:"absolute inset-0 overflow-hidden",children:e("div",{className:`pointer-events-none fixed inset-y-0 ${p} flex max-w-full ${f}`,children:e(le.div,{className:`pointer-events-auto ${g}`,style:{width:`${u}px`},initial:{x:x},animate:{x:0},exit:{x:x},transition:{type:"spring",stiffness:300,damping:30},children:t("div",{className:"relative flex h-full",children:[c&&e("div",{className:`absolute ${v} top-0 bottom-0 w-3 cursor-ew-resize hover:bg-indigo-500 transition-colors flex items-center justify-center`,onMouseDown:e=>{e.preventDefault();let t=!0;const n=e.pageX,r=u,a=e=>{if(t){const t=n-e.pageX,a=Math.max(r+t,480);m(a)}},i=()=>{t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)},children:e(L,{className:"rotate-90 font-semibold",strokeWidth:4})}),t("div",{className:`flex-1 flex flex-col bg-background shadow-xl ${d}`,children:[r&&e("div",{className:"sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b",children:t("div",{className:"flex items-start justify-between",children:[e("h2",{className:"w-full text-base font-semibold leading-6",children:e("div",{className:"text-2xl",children:r??""})}),e("div",{className:"ml-3 flex h-7 items-center",children:e(Ar,{onClose:a})})]})}),e("div",{className:"flex-1 overflow-y-auto px-2 sm:px-4 py-4",children:i})]})]})})})})})]})})}function Ar({onClose:t}){return e(_t,{alt:"Close panel",variant:"ghost",onClick:t,children:e(u,{className:"size-6","aria-hidden":"true"})})}function Er({size:a,className:i}){const s=function(e){switch(e){case"xs":return"size-2";case"sm":return"size-3";case"md":return"size-4";case"lg":return"size-5";case"xl":return"size-7";case"2xl":return"size-10";default:throw new Error("Unexpected size: "+e)}}(a||"md");return e(n,{children:t("svg",{className:r("animate-[spin_0.8s_linear_infinite] text-indigo-500",s,i),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("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"})]})})}const Pr={sm:["h-5 w-8","size-3","translate-x-4"],md:["h-6 w-11","size-4","translate-x-6"],lg:["h-8 w-16","size-6","translate-x-9"]};function Fr({value:n,onChange:r,size:a="md",children:i,className:s,disabled:l}){const o=Pr[a];return t(ee,{checked:n,onChange:()=>r(!n),disabled:l,className:`flex items-center ${s} ${l?"cursor-not-allowed opacity-50":"hover:cursor-pointer"}`,children:[e("div",{className:`${n?"bg-primary":"bg-muted/50"} relative inline-flex ${o[0]} items-center rounded-full border-1`,children:e("span",{className:`${n?o[2]:"translate-x-1"} inline-block ${o[1]} transform rounded-full bg-white transition`})}),i&&e("span",{className:"px-2",children:i})]})}function jr({className:t,children:n,...a}){return e("table",{className:r("\ndivide-y divide-border\n[&>tbody]:divide-y [&>tbody]:divide-border\n[&_th]:text-left [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted-foreground\n[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm\n",t),...a,children:n})}function Vr({children:t}){return e("thead",{className:"sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:left-0 after:w-full after:h-px after:bg-muted/20",children:t})}function Yr({columns:t}){return e("tr",{className:"hover:bg-muted",children:Array(t).fill(0).map((t,n)=>e("td",{children:e("div",{className:"animate-pulse rounded-xs h-5 bg-muted"})},n))})}function Br({isLoading:t=!1,columns:n,rows:r=3,children:a}){return e("tbody",{children:t?Array(r).fill(0).map((t,r)=>e(Yr,{columns:n},r)):a})}function Hr({className:t,children:n,...a}){return e("tr",{className:r("hover:bg-muted hover:cursor-pointer",t),...a,children:n})}function Wr({options:a,value:i,onChange:s,onOptionsChange:l,placeholder:o,className:c,disabled:d,layout:m="horizontal",creatable:h=!1,createText:p='Create "%value%"',maxDropdownHeight:f=200}){const g=E(vn),[v,x]=$(""),[b,y]=$(0),[w,N]=$(0),[C,k]=$(null),_=D(null),z=D(null),I=D(null),T=D(null),L=g?.open??!1,M=g?.setOpen??(()=>{});A(()=>{const e=z.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;N(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);const R=a.filter(e=>!i.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),O=h&&v&&!i.includes(v)&&!a.includes(v),S=R.length+(O?1:0);A(()=>{y(0)},[v,O]),A(()=>{""!==v&&k(null)},[v]),A(()=>{L&&T.current&&I.current&&T.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[b,L]),A(()=>{L?_.current?.focus():x("")},[L]);const P=e=>{s([...i,e]),x(""),M(!1),y(0),k(null)},F=e=>{s([...i,e]),l&&!a.includes(e)&&l([...a,e]),x(""),M(!1),y(0),k(null)},j=(e,t)=>{t.stopPropagation(),s(i.filter(t=>t!==e)),k(null)};return t("div",{className:r("relative",c),children:[e(yn,{asChild:!0,children:t("div",{ref:z,className:r("min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2","flex items-center gap-1","horizontal"===m?"flex-wrap":"flex-col items-stretch","cursor-text","ring-offset-background",d&&"opacity-50 cursor-not-allowed",L?"ring-1 ring-inset ring-ring":""),onClick:()=>{d||_.current?.focus()},children:["vertical"===m&&i.length>0&&e("div",{className:"flex flex-col gap-1 w-full",children:i.map((n,a)=>t("span",{className:r("inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-primary/10 text-primary rounded-md w-full transition-all",C===a&&"ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]"),children:[e("span",{className:"truncate",children:n}),e("button",{type:"button",onClick:e=>j(n,e),disabled:d,className:"hover:bg-primary/20 rounded-sm transition-colors flex-shrink-0",children:e(u,{className:"h-3 w-3"})})]},n))}),"horizontal"===m&&i.map((n,a)=>t("span",{className:r("inline-flex items-center gap-1 px-2 py-1 text-sm bg-primary/10 text-primary rounded-md transition-all",C===a&&"ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]"),children:[n,e("button",{type:"button",onClick:e=>j(n,e),disabled:d,className:"hover:bg-primary/20 rounded-sm transition-colors",children:e(u,{className:"h-3 w-3"})})]},n)),e("input",{ref:_,type:"text",value:v,onChange:e=>x(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&L&&S>0)return e.preventDefault(),e.stopPropagation(),void(b===R.length&&O?F(v):b<R.length&&P(R[b]));if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),void(L?y(e=>e<S-1?e+1:e):M(!0));if("ArrowUp"===e.key)return e.preventDefault(),e.stopPropagation(),void(L?y(e=>e>0?e-1:0):M(!0));if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void M(!1);if("Backspace"===e.key&&""===v&&i.length>0){e.stopPropagation();const t=i.length-1;return void(C===t?(s(i.slice(0,-1)),k(null)):k(t))}L||1!==e.key.length||M(!0)},onClick:e=>{e.stopPropagation(),d||M(!0)},onFocus:()=>{d||M(!0)},disabled:d,placeholder:0===i.length?o:"",className:r("flex-1 min-w-[120px] bg-transparent text-sm","placeholder:text-muted-foreground","border-none outline-none focus:outline-none focus:ring-0 p-0 m-0","vertical"===m&&"w-full")})]})}),e(Nn,{style:{width:`${w}px`},className:"p-0 bg-popover border border-border shadow-lg",align:"start",side:"bottom",onOpenAutoFocus:e=>{e.preventDefault()},children:e("div",{ref:I,className:"overflow-y-auto",style:{maxHeight:`${f}px`},children:0!==R.length||O?t(n,{children:[R.length>0&&e("ul",{className:"py-1",children:R.map((t,n)=>e("li",{ref:e=>{n===b&&(T.current=e)},onClick:()=>P(t),onMouseEnter:()=>y(n),className:r("px-3 py-2 text-sm cursor-pointer transition-colors",n===b?"bg-blue-500/20 text-foreground":"hover:bg-accent/50"),children:t},t))}),O&&t(n,{children:[R.length>0&&e("div",{className:"border-t border-border"}),e("div",{ref:e=>{b===R.length&&(T.current=e)},onClick:()=>F(v),onMouseEnter:()=>y(R.length),className:r("px-3 py-2 text-sm cursor-pointer transition-colors text-primary",b===R.length?"bg-blue-500/20":"hover:bg-accent/50"),children:p.replace("%value%",v)})]})]}):e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:v?"No options found":"No more options available"})})})]})}function Ur(t){return e(xn,{click:!0,children:e(Wr,{...t})})}class Gr{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}}function Kr(e){const t=O.createContext(void 0);return e.Context=t,t.Provider}class Jr{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e&&e(this.current),this}}function Zr(e){const t=e.Context;if(!t)throw new Error("Context not defined for "+e.name);return E(t)}function qr(e){const[t,n]=$(e.value);return A(()=>e.watch(e=>{n("function"==typeof e?()=>e:e)}),[e]),t}function Xr(e,t){return A(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Qr(e,t){A(()=>e.watch(t),[e,t])}function ea(e){const[t,n]=$(e.current);return A(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function ta(e,t){A(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function na(e,t){A(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}class ra{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(const e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){const e=this.compute();if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(const e of this.unsubscribers)e();this.watchers=[]}}class aa{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}}function ia(e){const[t,n]=$(e.value);return A(()=>e.addWatcher(e=>{n("function"==typeof e?()=>e:e)}),[e]),t}function sa(e,t){const n=D(null);return A(()=>{const r=r=>{n.current&&!n.current.contains(r.target)&&(t&&t(r)||e(r))};return window.setTimeout(()=>{document.addEventListener("click",r)},0),()=>{document.removeEventListener("click",r)}},[]),n}function la(){const[e,t]=$(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn("Copy failed",e),t(null),!1}}]}function oa(e){A(()=>{const t=window.matchMedia("(prefers-color-scheme: dark)"),n=t=>e(t.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)},[])}function ca(e,t){const[n,r]=$(e);return A(()=>{const n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function da(e,t,n){const r=[],a=new EventSource(e);return a.addEventListener("message",e=>{const n=JSON.parse(e.data);n&&(r.push(n),t(r.join("")))}),a.addEventListener("close",e=>{a.close();const t=JSON.parse(e.data);n(t)}),()=>{a.close()}}function ua(e,t,n){A(()=>{"function"==typeof e?e().then(e=>da(e,t,n)):da(e,t,n)},[e])}function ma(e,t){Array.isArray(t)&&(t={deps:t});const n=t||{},[r,a]=$(null),[i,s]=$(!1),[l,o]=$(n.defaultValue),c=()=>(n.start&&n.start(),s(!0),e().then(e=>{o(e),n.onSuccess&&n.onSuccess(e)}).catch(e=>{a(e),n.onError&&n.onError(e)}).finally(()=>{s(!1),n.end&&n.end()}));return A(()=>{n.condition&&!n.condition()||c()},n.deps),{data:l,isLoading:i,error:r,setData:o,refetch:c}}function ha(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),ma(e,t)}function pa(e=!1){const[t,n]=$(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function fa(e,t,n={}){A(()=>{const r=new IntersectionObserver(e=>{const r=e[0].isIntersecting;n.leave?r||t(e[0]):r&&t(e[0])},{threshold:n.threshold||1});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},n.deps?n.deps.concat(e):[e])}function ga(){const e=D(!0);return A(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const va="undefined"!=typeof window?Y:A;function xa(e,t=[]){const n=e.pageSize||50,[r,a]=$(null),[i,s]=$(e.payload),[l,o]=$(null),[c,d]=$([]),[u,m]=$(null),[h,p]=$(!1),f=D(0),g=e=>{a(null),d([]),m(null),s(e)},v=()=>{null!==u&&a(u)};return A(()=>{f.current+=1;const t=f.current;p(!0),e.search(i,r,n).then(e=>{t===f.current&&(d(null===r?e.result:t=>[...t,...e.result]),m(e.nextPage),o(null))}).catch(e=>{t===f.current&&o(e)}).finally(()=>{t===f.current&&p(!1)})},[...t,i,r]),re(e.nextPageTrigger,()=>{!h&&u&&v()},{threshold:.1,deps:[u,h]}),{search:g,refresh:()=>g(i),searchMore:v,result:c,page:r,hasMore:null!==u,error:l,isSearching:h}}function ba(e,t=[]){return xa({...e,async search(t,n,r){const a=n??0,i=a*r,s=await e.search(t,i,r);return{result:s,nextPage:0===s.length?null:a+1}}},t)}class ya{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}}function wa(e){const t=$(e);return new ya(t)}function Na(...e){return ie(a(e))}export{qn as AnimateChangeInHeight,Ne as Avatar,dt as Badge,Bn as Breadcrumbs,_t as Button,Ft as Card,Bt as CardContent,Yt as CardDescription,Ht as CardFooter,jt as CardHeader,Vt as CardTitle,ke as Center,Xn as Checkbox,Fe as ComboBox,kn as Command,_n as CommandDialog,Tn as CommandEmpty,Ln as CommandGroup,zn as CommandInput,Rn as CommandItem,In as CommandList,Mn as CommandSeparator,On as CommandShortcut,ra as ComputedProperty,on as ConfirmModal,zt as CopyButton,Se as DOMPopup,nr as DateCombobox,Lr as DefaultBox,fn as DeleteModal,Qt as Dialog,nn as DialogClose,an as DialogContent,sn as DialogDescription,rn as DialogOverlay,tn as DialogPortal,ln as DialogTitle,en as DialogTrigger,We as Divider,ht as DotBadge,qe as DropZone,Ue as Dropdown,Ke as DropdownList,Je as EmptyCollection,_r as ErrorBox,Ze as FileUploadInput,pr as FilterBar,hr as FilterBtn,fr as FilterClear,gr as FilterOperator,mr as FilterProvider,ot as FormItem,vr as Heading,zr as InfoBox,ft as Input,gt as InputList,Yn as Label,vt as Link,Ge as MenuItem,xt as MenuList,kr as MessageBox,Jt as Modal,qt as ModalBody,Kt as ModalContextProvider,Xt as ModalFooter,Zt as ModalTitle,Et as ModeOption,Pt as ModeToggle,Ct as NumberInput,$e as OptionAdapter,It as Overlay,Mr as Panel,xn as Popover,wn as PopoverAnchor,Cn as PopoverClose,Nn as PopoverContent,vn as PopoverContext,yn as PopoverTrigger,De as Popup,Me as PopupController,Lt as Portal,tt as PortalContainerProvider,Gr as Property,Rt as RadioGroup,Mt as RadioOptionAdapter,Nr as ResizableHandle,wr as ResizablePanel,yr as ResizablePanelGroup,Yr as RowSkeleton,Sn as SelectBox,Or as SelectList,Dr as SelectStack,er as SelectionCombobox,gn as Separator,aa as SharedState,ya as SharedValue,$r as SidePanel,Jr as Slot,Er as Spinner,ar as StringListCombobox,Ae as StringOptionAdapter,Ee as StringOptionAdapterWithCreate,wt as Styles,Tr as SuccessBox,Ce as SvgAvatar,Fr as Switch,Br as TBody,Vr as THead,Hr as TR,jr as Table,$n as Tabs,An as TabsBar,jn as TabsContent,Pn as TabsList,En as TabsPanel,Fn as TabsTrigger,Ur as TagsInput,br as Text,rr as TextCombobox,Cr as Textarea,$t as ThemeProvider,Dt as ThemeProviderContext,dn as ToastContext,pn as ToastProvider,at as Tooltip,st as TooltipContent,rt as TooltipProvider,it as TooltipTrigger,lt as VTooltip,Ir as WarningBox,kt as buttonVariants,Na as cn,Ie as computePosition,Kr as createCompositeStateProvider,Pe as getDefaultComboBoxLayout,sa as useClickOutside,Be as useComboboxCtrl,Zr as useCompositeState,la as useCopyToClipboard,oa as useDarkMode,ca as useDebounce,ba as useDefaultScrollableSearch,na as useDefineSlot,Xe as useDropZone,ua as useEventSource,ma as useFetch,ha as useFetchOnce,pa as useFlag,qr as useGetCompositeStateProperty,fa as useIntersectionObserver,ga as useIsFirstRendering,Gt as useIsInModal,Oe as usePopupController,nt as usePortalContainer,va as useSafeLayoutEffect,xa as useScrollableSearch,Xr as useSetCompositeStateProperty,wa as useSharedValue,ea as useSlot,At as useTheme,cn as useToast,Qr as useWatchCompositeStateProperty,ia as useWatchSharedState,ta as useWatchSlot};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{clsx as a}from"clsx";import{ChevronUpIcon as i,ChevronDownIcon as s,Check as l,ChevronDown as o,Plus as c,Info as d,X as u,Loader2 as m,CopyIcon as h,Computer as p,Sun as f,Moon as g,TriangleAlert as v,AlertTriangle as x,CircleX as b,CircleCheck as y,Search as w,LoaderCircle as N,ChevronsUpDown as C,SearchIcon as k,SquarePlus as _,ChevronRight as z,MoreHorizontal as I,ListFilter as T,Minus as L,ChevronUp as M}from"lucide-react";import*as R from"react";import O,{createContext as S,useRef as D,useState as $,useEffect as A,useContext as E,Fragment as P,forwardRef as F,useMemo as j,useCallback as V,useLayoutEffect as Y}from"react";import{createPortal as B}from"react-dom";import{Menu as H,MenuButton as W,Transition as U,MenuItems as G,MenuItem as K,Listbox as J,ListboxButton as Z,ListboxOptions as q,ListboxOption as X,RadioGroup as Q,Switch as ee}from"@headlessui/react";import{Button as te,VTooltip as ne,useIntersectionObserver as re}from"@vertesia/ui/core";import*as ae from"@radix-ui/react-tooltip";import{twMerge as ie}from"tailwind-merge";import{cva as se}from"class-variance-authority";import{motion as le,AnimatePresence as oe}from"framer-motion";import{Slot as ce}from"@radix-ui/react-slot";import*as de from"@radix-ui/react-dialog";import*as ue from"@radix-ui/react-separator";import{isEqual as me}from"lodash-es";import*as he from"@radix-ui/react-popover";import{Command as pe}from"cmdk";import*as fe from"@radix-ui/react-tabs";import*as ge from"@radix-ui/react-label";import*as ve from"@radix-ui/react-checkbox";import xe from"dayjs";import be from"react-calendar";import*as ye from"react-resizable-panels";function we(e){switch(e){case"xs":return"size-4";case"sm":return"size-6";case"md":return"size-8";case"lg":return"size-10";case"xl":return"size-12";case"2xl":return"size-14";default:throw new Error("Unexpected size: "+e)}}function Ne({size:t,src:n,name:r,shape:a="circle",color:i="bg-gray-500",className:s}){const l="circle"===a?"rounded-full":"rounded-md",o=we(t||"md");if(n)return e("img",{className:`inline-block ${o} ${l} ${i} ${s}`,src:n,alt:r||n,title:r});if(r){const[n,a]=r.split(" ");let c=a?`${n[0]}${a[0]}`:`${n[0]}${n[1]}`;return e("span",{className:`inline-flex ${o} items-center justify-center ${l} ${i} ${s}`,title:r,children:e("span",{className:("xs"!=t?"text-xs":"text-[0.6rem]")+" font-medium leading-none text-white",children:c})})}return e("span",{className:`inline-block ${o} overflow-hidden ${l} ${i}`,children:e("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:e("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})})}function Ce({size:t,shape:n="circle",color:r="bg-gray-500",className:a,children:i}){const s="circle"===n?"rounded-full":"rounded-md",l=we(t||"md");return e("span",{className:`inline-block ${l} overflow-hidden ${s} ${r} ${a}`,children:i})}function ke({className:t,children:n}){return e("div",{className:r("flex items-center justify-center",t),children:n})}class _e{left;top;width;height;alignAxis;gap;constructor(e=0){this.gap=e}position(e,t,n){switch(e){case"top":this.top=t.top-n.height-this.gap,this.alignAxis="x";break;case"bottom":this.top=t.bottom+this.gap,this.alignAxis="x";break;case"left":this.left=t.left-n.width-this.gap,this.alignAxis="y";break;case"right":this.left=t.right+this.gap,this.alignAxis="y";break;case"ne":this.top=t.top-n.height-this.gap,this.left=t.right+this.gap;break;case"nw":this.top=t.top-n.height-this.gap,this.left=t.left-n.width-this.gap;break;case"se":this.top=t.bottom+this.gap,this.left=t.right+this.gap;break;case"sw":this.top=t.bottom+this.gap,this.left=t.left-n.width-this.gap}}align(e,t,n){if(this.alignAxis)switch(e){case"start":"x"===this.alignAxis?this.left=t.left:this.top=t.top;break;case"end":"x"===this.alignAxis?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case"center":"x"===this.alignAxis?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case"fill":"x"===this.alignAxis?(this.left=t.left,this.width=t.right-t.left):(this.top=t.top,this.height=t.bottom-t.top)}}computePosition(e,t,n){if(this.position(e.position,n,t),e.align&&this.align(e.align,n,t),!this.left&&!this.top)throw new Error("Invalid position. Cannot compute x,y coordinates");const r=null!=this.width,a=null!=this.height,i=r?this.width:t.width,s=a?this.height:t.height;return{rect:new DOMRect(this.left,this.top,i,s),constrainWidth:r,constrainHeight:a,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){const t=function(e){switch(e){case"start":return"end";case"end":return"start";default:return e}}(e.align);if(t!==e.align)return{...e,align:t}}}else{const t=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";default:return e}}(e.position);if(t!==e.position)return{...e,position:t}}return null}}function ze(e,t,n){return"x"===n?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function Ie(e,t,n,r){const a=new _e(e.gap);let i=a.computePosition(e,t,n);const s=ze(i.rect,r,"x"),l=ze(i.rect,r,"y");if(s&&l)return i;let o=null;return s||(o=a.flipAxis(e,"x")),l||(o=a.flipAxis(o||e,"y")),o?(i=new _e(a.gap).computePosition(o,t,n),function(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}(i.rect,r)?i:null):null}function Te(e,t){const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),a=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return a<=n||i<=r?null:new DOMRect(n,r,a-n,i-r)}function Le(e){const t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){const r=getComputedStyle(e);if(t&&"visible"!==r.overflowY||n&&"visible"!==r.overflowX)return!0}return!1}class Me{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=function(e,t=document.documentElement){const n=[];let r=e.parentElement;for(;r&&r!==t;)Le(r)&&n.push(r),r=r.parentElement;return n.push(t),n}(this.anchor,this.root),this.visibleClientRect=function(e){if(0===e.length)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=Te(e[n].getBoundingClientRect(),t),!t)return null;return t}(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){const t=this.scrollableParents,n=()=>{this.update()};window.addEventListener("resize",n);for(const e of t)e.addEventListener("scroll",n);let r,a;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(function(){r&&document.addEventListener("click",r)},0)),this.options.closeOnEsc&&(a=e=>{"Escape"===e.key&&this.tryClose()},window.setTimeout(function(){a&&document.addEventListener("keydown",a)},0));const i=this.options.blockPageScroll;return i&&(document.body.style.overflow="hidden",document.body.style.height="100%"),()=>{window.removeEventListener("resize",n);for(const e of t)e.removeEventListener("scroll",n);r&&document.removeEventListener("click",r),a&&document.removeEventListener("keydown",a),i&&(document.body.style.overflow="",document.body.style.height="")}}open(e,t){if(this.context)throw new Error("The popup controller is already bound to an element");this.tryOpen(e,t)}tryOpen(e,t){this.context||(this.context={element:e,constraints:t,cleanup:this.registerListeners(e)},e.style.display="",e.style.visibility="hidden",this.update(),this.options.onOpen&&this.options.onOpen(this))}close(){if(!this.context)throw new Error("The popup controller is not bound to an element");this.tryClose()}tryClose(){this.context&&(this.options.onClose&&this.options.onClose(this),this.context.cleanup(),this.context.element.style.display="none",this.context=void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;const e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),a=this.visibleClientRect;if(!a)return;const i=Ie(t,n,r,a);this.context.position=i||void 0,i&&(i.constrainHeight&&(e.style.height=i.rect.height+"px"),i.constrainWidth&&(e.style.width=i.rect.width+"px"),e.style.left=i.rect.left+"px",e.style.top=i.rect.top+"px",e.style.visibility="visible")}createPopupElement(){const e=document.createElement("div");return e.style.margin="0",e.style.padding="0",e.style.border="none",e.style.background="transparent",e.className="composable-Popup",e}}const Re=S(void 0);function Oe(){const e=E(Re);if(!e)throw new Error("usePopupController must be used inside a Popup component");return e}function Se({ctrlRef:t,id:n,constraints:r,isOpen:a,children:i,className:s,onClose:l,zIndex:o,position:c,...d}){const u=D(null),[m,h]=$();return A(()=>{if(!d.anchor)throw new Error("Anchor element is required");const e=new Me({...d,onClose:l});return h(e),()=>{e.tryClose()}},[]),A(()=>{t&&(t.current=m)},[m]),A(()=>{m&&u.current?m.isOpen!==a&&(a?m.open(u.current,r):m.close()):m?.isOpen&&!a&&m.close()},[a,m,u.current]),e(Re.Provider,{value:m,children:a&&B(e("div",{id:n,style:{visibility:"hidden",position:c||"absolute",zIndex:o||100},ref:u,className:s,children:i}),document.body)})}function De({anchor:t,root:n,children:r,...a}){return!t.current||n&&!n.current?null:e(Se,{anchor:t.current,root:n?.current||void 0,...a,children:r})}class $e{filter(e,t){const n=t.toLowerCase();return e.filter(e=>this.valueOf(e).toLowerCase().includes(n))}renderOption(e){return this.valueOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}createItem(e){return null}}class Ae extends $e{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new Ae}class Ee extends Ae{createItem(e){return e}static instance=new Ee}function Pe(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:"w-72 bg-white mt-1 shadow-md border border-gray-200 overflow-auto p-0 z-10",inputClass:r(t?"block m-0 p-0 border-0 focus:outline-none focus:ring-0 bg-transparent":"block sm:text-sm sm:leading-6 rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 dark:ring-slate-600 dark:text-slate-50 dark:bg-slate-800 placeholder:text-gray-400 dark:placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 dark:focus:ring-indigo-800 py-1.5",e?"w-full":"!w-auto"),optionClass:"py-2 px-3 shadow-sm flex flex-col [&.option-selected]:font-semibold [&.option-highlighted]:bg-blue-300",Input:je,Menu:Ye,Toggle:Ve}}function Fe({menuAlign:r="fill",menuGap:a,focusOnMount:i,onSelect:s,value:l,zIndex:o,unstyledInput:c,fullWidth:d,api:u,layout:m,adapter:h,items:p,placeholder:f}){const[g]=$(`combobox-popup-${Math.floor(1e6*Math.random())}`),v=D(void 0),x=D(null),b=m?Object.assign(Pe(d,c),m):Pe(d,c),y=O.useRef(null),w=Be({adapter:h,items:p,value:l,popupId:g});A(()=>{x.current&&i&&x.current.focus()},[x.current]),A(()=>{w.onSelect=s,w.popupCtrl=v.current},[s,v.current]),A(()=>{if(u&&w&&x.current)return u.current={open:()=>w.openMenu(),close:()=>w.closeMenu(),toggle:()=>w.toggleMenu(),setInputValue:e=>w.inputText=e,inputValue:w.inputText||"",selectedItem:w.selectedItem,focus:()=>x.current?.focus()},()=>{u.current=null}},[u,w,x.current]);const N=w.isMenuOpen&&w.filteredItems.length>0;return t(n,{children:[e(b.Input,{boxRef:y,inputRef:x,ctrl:w,layout:b,placeholder:f}),e(De,{id:g,ctrlRef:v,className:"combobox-popup",closeOnClick:!0,closeOnEsc:!0,onClose:()=>w.closeMenu(),isOpen:N,anchor:y,zIndex:o,constraints:{position:"bottom",align:r,gap:null!=a?a:4},children:e(b.Menu,{fillWidth:"fill"===r,items:w.filteredItems,ctrl:w,layout:b,adapter:h})})]})}function je({inputRef:n,placeholder:r,boxRef:a,ctrl:i,layout:s}){const l=s.buttonWidth,o=l>0?{paddingRight:`${l}px`}:void 0,c=s.Toggle;return t("div",{className:"relative",ref:a,children:[e("input",{ref:n,placeholder:r,...i.getInputProps(),style:o,className:s.inputClass}),c&&e("button",{style:{top:0,bottom:0,right:`${s.buttonRight}px`,width:`${l}px`,position:"absolute",border:"none",padding:0,margin:0,backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},...i.getToggleButtonProps(),children:e(c,{ctrl:i,layout:s})})]})}function Ve({ctrl:t}){return t.isMenuOpen?e(i,{className:"w-4 h-4"}):e(s,{className:"w-4 h-4"})}function Ye({fillWidth:t,items:n,layout:a,ctrl:i,adapter:s}){const{highlightedIndex:l,selectedItem:o}=i;return e("ul",{style:{width:t?"100%":void 0,maxHeight:a.maxMenuHeight?`${a.maxMenuHeight}px`:"240px"},className:a.menuClass,...i.getMenuProps(),children:n.map((t,n)=>e("li",{"data-index":n,className:r(a.optionClass,l===n&&"option-highlighted",o===t&&"option-selected"),...i.getItemProps(t,n),children:s.renderOption(t)},s.idOf(t)))})}function Be(e){const[t,n]=$(new He(e));return A(()=>{t?.withState(n)},[]),t}class He{popupId;items;adapter;onSelect;setState;_selectedItem=null;_filteredItems;_inputText="";_highlightedIndex=null;_isMenuOpen=!1;popupCtrl;constructor({adapter:e,items:t,value:n,popupId:r}){this.adapter=e,this.items=t,this.popupId=r,"string"==typeof n?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._inputText?this._filteredItems=this.adapter.filter(this.items,this._inputText):this._filteredItems=this.items}withState(e){return this.setState=e,this}clone(){const e=new He({adapter:this.adapter,items:this.items,popupId:this.popupId});return e.setState=this.setState,e.onSelect=this.onSelect,e._inputText=this._inputText,e._highlightedIndex=this._highlightedIndex,e._selectedItem=this._selectedItem,e._isMenuOpen=this._isMenuOpen,e._filteredItems=this._filteredItems,e.popupCtrl=this.popupCtrl,e}updateState(){this.setState?.(this.clone())}get filteredItems(){return this._inputText?this.adapter.filter(this.items,this._inputText):this.items}get selectedItem(){return this._selectedItem}set selectedItem(e){this._selectedItem=e,this._inputText=e?this.adapter.valueOf(e):"",this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items,this.updateState(),this.onSelect?.(e)}get isMenuOpen(){return this._isMenuOpen}set inputText(e){if(this._inputText=e,this._filteredItems=e?this.adapter.filter(this.items,e):this.items,this._highlightedIndex=null,this._selectedItem=null,this.updateState(),this.isMenuOpen&&this.popupCtrl){const e=this.popupCtrl,t=e.context?.position?.position;t&&"top"===t&&window.setTimeout(()=>{e.update()},100)}}get inputText(){return this._inputText}set highlightedIndex(e){this._highlightedIndex=e,this.updateState()}get highlightedIndex(){return this._highlightedIndex}openMenu(){this._filteredItems.length>0&&(this._isMenuOpen=!0,this.updateState())}closeMenu(e){this._isMenuOpen&&(this._highlightedIndex=null,this._isMenuOpen=!1,this.updateState())}toggleMenu(){this._isMenuOpen?this.closeMenu():this.openMenu()}highlightIndex(e,t=!1){this.highlightedIndex=e;const n=document.getElementById(this.popupId);n&&n.querySelector(`li[data-index="${e}"]`)?.scrollIntoView(t)}getMenuProps(){return{}}getToggleButtonProps(){return{onClick:()=>{this._isMenuOpen=!this._isMenuOpen,this.updateState()}}}getItemProps(e,t){return{"aria-selected":this._highlightedIndex===t,onClick:()=>{this.selectedItem=e,this.closeMenu()},onMouseEnter:()=>{this.highlightedIndex!==t&&(this.highlightedIndex=t)},onMouseLeave:()=>{this.highlightedIndex===t&&(this.highlightedIndex=null)}}}getInputProps(){const e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{const t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{const n=t.key;if("Enter"===n){if(null!=this.highlightedIndex)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){const e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else"ArrowDown"===n?this.isMenuOpen?this.highlightIndex(null===this.highlightedIndex?0:(r=this.highlightedIndex,a=e.length,(r+1)%a),!1):this.openMenu():"ArrowUp"===n&&this.isMenuOpen&&this.highlightIndex(null===this.highlightedIndex?0:function(e,t){return(e-1+t)%t}(this.highlightedIndex,e.length),!0);var r,a}}}}function We({className:t}){return e("hr",{className:r("w-full h-0.5 border-t-0 bg-border",t)})}function Ue({trigger:n,children:r}){return t(H,{as:"div",className:"relative",children:[e(W,{as:"span",className:"-m-1.5 flex items-center p-1.5",children:n}),e(U,{as:P,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e(G,{className:"absolute right-0 z-10 mt-2.5 w-48 origin-top-right rounded-md bg-white dark:bg-slate-900 dark:border-slate-800 dark:border py-2 shadow-lg ring-1 ring-gray-900/5 dark:ring-slate-200/5 focus:outline-hidden",children:r})})]})}function Ge({children:t,href:n="#",onClick:a,closeOnClick:i=!0,isDisabled:s=!1}){return e(K,{disabled:s,children:({active:l,close:o})=>e("a",{href:n,onClick:e=>{e.preventDefault(),e.stopPropagation(),a&&a(e),i&&o()},className:r(l?"bg-gray-50 dark:bg-slate-800":"",s?"opacity-50 cursor-not-allowed":"","block px-3 py-1 text-sm leading-6 text-gray-900 dark:text-gray-200"),children:t})})}function Ke({items:n,value:a,onChange:i}){return e(J,{value:a,onChange:i,children:({open:i})=>t("div",{className:"relative",children:[t("div",{className:"inline-flex divide-x divide-indigo-700 rounded-md shadow-2xs",children:[t("div",{className:"inline-flex items-center gap-x-1.5 rounded-l-md bg-indigo-600 px-3 py-2 text-white shadow-2xs",children:[a.name&&e(l,{className:"-ml-0.5 size-5","aria-hidden":"true"}),e("p",{className:"text-sm font-semibold",children:a.name||""})]}),t(Z,{className:"inline-flex items-center rounded-l-none rounded-r-md bg-indigo-600 p-2 hover:bg-indigo-700 focus:outline-hidden focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2 focus:ring-offset-gray-50",children:[e("span",{className:"sr-only",children:"Change selection"}),e(o,{className:"size-5 text-white","aria-hidden":"true"})]})]}),e(U,{show:i,as:P,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e(q,{className:"absolute right-0 z-10 mt-2 w-72 origin-top-right divide-y divide-gray-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:n.map(n=>e(X,{className:({active:e})=>r(e?"bg-indigo-600 text-white":"text-gray-900","cursor-default select-none p-4 text-sm"),value:n,children:({selected:a,active:i})=>t("div",{className:"flex flex-col",children:[t("div",{className:"flex justify-between",children:[e("p",{className:a?"font-semibold":"font-normal",children:n.name}),a?e("span",{className:i?"text-white":"text-indigo-600",children:e(l,{className:"size-5","aria-hidden":"true"})}):null]}),e("p",{className:r(i?"text-indigo-200":"text-gray-500","mt-2"),children:n.description})]})},n.id))})})]})})}function Je({buttonLabel:n,title:r,children:a,onClick:i}){return e("div",{className:"flex items-center justify-center h-full text-center",children:t("div",{className:"py-12",children:[e("svg",{className:"mx-auto size-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),e("h3",{className:"mt-2 text-sm font-semibold",children:r}),e("p",{className:"mt-1 text-sm text-muted",children:a}),e("div",{className:"mt-6",children:t(te,{onClick:i,children:[e(c,{className:"-ml-0.5 mr-1.5 size-5","aria-hidden":"true"}),n]})})]})})}function Ze({children:n,onUpload:r}){const a=D(null);return t("label",{style:{cursor:"pointer"},children:[n,e("input",{ref:a,type:"file",style:{display:"none"},onChange:()=>{a.current?.files&&r(function(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}(a.current.files))}})]})}function qe({onUpload:n}){const r=Xe({onUpload:n});return e("div",{...r,className:"flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:t("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-full",children:[t("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[e("svg",{className:"w-8 h-8 mb-4 text-gray-500 dark:text-gray-400","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),t("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[e("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),e("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),e("input",{id:"dropzone-file",type:"file",className:"hidden"})]})})}function Xe({onUpload:e,dragOverClass:t="is-drag-over-on",dropEffect:n="copy"}){const r=D(null);return{onDrop:n=>{n.preventDefault(),delete r.current.__dragOver_cnt__,r.current?.classList.remove(t);const a=n.dataTransfer.items;if(a){const t=[],n=(e,t="")=>new Promise(r=>{if(e.isFile)e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(e.isDirectory){const a=e.createReader(),i=[],s=()=>{a.readEntries(a=>{if(a.length){for(const r of a)i.push(n(r,t+e.name+"/"));s()}else Promise.all(i).then(e=>r(e.flat()))})};s()}});for(let e=0;e<a.length;e++){const r=a[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{const n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{(function(e){let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t})(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{(function(e){let t=e.__dragOver_cnt__;return!!t&&(e.__dragOver_cnt__=t-1,1===t)})(r.current)&&r.current?.classList.remove(t)},ref:r}}function Qe(...e){return ie(a(e))}const et=O.createContext(void 0);function tt({children:t,id:n="plugin-portal-container"}){const r=O.useRef(null),[a,i]=O.useState(void 0);return O.useEffect(()=>{if(r.current){const e=r.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){const t=function(e,t="plugin-portal-container"){const n=e instanceof Document?e.body:e;for(const e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;const r=document.createElement("div");return r.id=t,n.appendChild(r),r}(e,n);i(t)}else i(null)}},[n]),void 0===a?e("div",{ref:r,style:{display:"none"}}):e(et.Provider,{value:a||void 0,children:t})}function nt(){return O.useContext(et)}const rt=ae.Provider,at=ae.Root,it=ae.Trigger,st=R.forwardRef(({className:t,sideOffset:n=4,side:r="top",...a},i)=>{const s=nt();return e(ae.Portal,{container:s,children:e(ae.Content,{ref:i,sideOffset:n,side:r,style:{zIndex:100},className:Qe("max-w-[90vw]","z-50 overflow-hidden rounded-md bg-tooltips border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",t),...a})})});function lt({description:n,children:r,size:a="sm",placement:i="top",className:s,asChild:l}){return e(rt,{delayDuration:0,children:t(at,{children:[e(it,{className:"cursor-pointer",asChild:l,children:r}),e(st,{side:i,className:`px-3 py-1.5 max-w-${a} text-${a} px-3 ${s}`,children:n})]})})}function ot({description:n,required:a,label:i,className:s,direction:l="column",children:o,disabled:c=!1}){return t("div",{className:r("flex w-full space-y-1",s,"row"===l?"flex-row justify-between items-center gap-2":"flex-col"),children:[t("div",{className:"flex items-center gap-1",children:[t("label",{className:"text-sm font-medium mb-1 "+(c?"text-muted":""),children:[i,a?e("span",{className:"text-destructive -mt-4 ml-1",children:"*"}):""]}),n&&e("div",{className:"mx-2 flex w-4 items-center",children:e(lt,{description:n,children:e(d,{className:"size-3 text-muted"})})})]}),o]})}st.displayName=ae.Content.displayName;const ct=se("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium",{variants:{variant:{default:"text-foreground bg-muted",secondary:"bg-secondary text-primary",destructive:"bg-destructive text-destructive",attention:"bg-attention text-attention",success:"bg-success text-success",info:"bg-info text-info",done:"bg-done text-done"}},defaultVariants:{variant:"default"}});function dt({className:t,variant:n,children:r,onClick:a,...i}){return e("span",{className:Qe(ct({variant:n}),t),onClick:a,...i,children:r})}const ut=se("inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ring-border",{variants:{variant:{default:"",success:"",destructive:"",attention:"",done:"",info:""}},defaultVariants:{variant:"default"}}),mt=se("h-1.5 w-1.5",{variants:{variant:{default:"fill-foreground",success:"fill-success",destructive:"fill-destructive",attention:"fill-attention",done:"fill-done",info:"fill-info"}},defaultVariants:{variant:"default"}});function ht({variant:n,className:r,dotClassName:a,children:i,...s}){return t("span",{className:Qe(ut({variant:n}),r),...s,children:[e("div",{className:"flex-shrink-0",children:e("svg",{className:Qe(mt({variant:n}),a),viewBox:"0 0 6 6","aria-hidden":"true",children:e("circle",{cx:3,cy:3,r:3})})}),e("span",{className:"truncate",children:i})]})}const pt=se("",{variants:{size:{xs:"rounded py-1 text-xs rounded-xs",sm:"rounded text-xs rounded-sm",md:"rounded-md py-2 text-sm",lg:"rounded-md text-base",xl:"rounded-md py-2.5 text-lg"},variant:{default:"flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",unstyled:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",noPadding:"block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background",legacy:"py-1.5 block rounded-md border-0 bg-background shadow-2xs ring-1 ring-inset ring-ring placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background"}},defaultVariants:{size:"md",variant:"default"}}),ft=R.forwardRef(({className:n,type:r,size:a="md",variant:i="default",clearable:s=!0,onChange:l,value:o,...c},d)=>t("div",{className:"w-full relative inline-block [&:hover_.clear-button]:opacity-100",children:[e("input",{type:r,className:Qe(pt({size:a,variant:i}),n,s&&o?"pr-8":""),ref:d,value:null==o?"":o,onChange:e=>{l&&l(e.target.value)},...c}),s&&o&&!c.readOnly&&!c.disabled&&e(te,{variant:"link",size:"icon",type:"button",onClick:()=>{l&&l("")},className:"clear-button opacity-0 transition-opacity duration-200\n absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer\n flex items-center justify-center size-6 rounded right-2",alt:"Clear input",children:e(u,{size:16})})]}));function gt({value:n=[],onChange:a,className:i,delimiters:s=", ",placeholder:l,autoFocus:o}){const[c,d]=$("");return t("div",{className:r(i,"w-full flex flex-wrap items-center gap-1 p-2 py-1.5","rounded-md text-sm rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"),children:[n&&n.length>0&&n.map((t,r)=>e(ne,{description:"click to remove",children:e(dt,{variant:"secondary",onClick:()=>(e=>{n&&n.length>0&&(n.splice(e,1),a([...n]))})(r),className:"cursor-pointer flex-shrink-0 hover:bg-destructive hover:text-destructive transition-colors",title:t,children:e("span",{className:"break-all",children:t})},r)},r)),e(ft,{clearable:!1,className:"placeholder:text-muted px-1 flex-1 min-w-[120px]",variant:"unstyled",type:"text",value:c,onBlur:e=>{const t=e.target.value;t&&t.trim()&&(a([...n,t.trim()]),d(""))},onKeyDown:e=>{const t=e.target.value,r=!t.trim(),i=e.key;"Enter"===i||s.indexOf(i)>-1?(e.preventDefault(),n&&!r&&(a([...n,t.trim()]),d(""))):"Backspace"===i&&r&&n&&n.length>0&&(n.pop(),a([...n]))},onPaste:e=>{const t=e.clipboardData.getData("text");if(t){e.preventDefault();const r=s.split("").map(e=>" "===e?"\\s":e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(`[${r}]+`),l=t.split(i).map(e=>e.trim()).filter(e=>e.length>0);l.length>0&&a([...n,...l]),d("")}},onChange:d,placeholder:n&&0!==n.length?"":l,autoFocus:o})]})}function vt({underline:t="always",className:n,children:a,...i}){let s;return"always"===t?s="underline":"hover"===t&&(s="hover:underline"),e("a",{className:r("text-indigo-800 dark:text-indigo-300",n,s),...i,children:a})}function xt({className:t,children:n}){return e("ul",{className:`${t} space-y-1 flex flex-col items-start`,children:n})}ft.displayName="Input";const bt=F(function(t,n){const{current:a,children:i,className:s,href:l="#",onClick:o,...c}=t;return e("li",{className:r(s,a?"bg-muted":"","w-full p-2 pl-3 text-sm leading-6 font-semibold hover:bg-muted"),children:e("a",{ref:n,href:l,onClick:e=>{o?(e.preventDefault(),o(e)):"#"===l&&e.preventDefault()},className:"w-full flex items-center gap-x-3",...c,children:i})})});xt.Item=bt;const yt="rounded-md text-sm flex w-full rounded-md border border-input bg-background ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",wt={INPUT_UNSTYLED:"block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent",INPUT_NO_PADDING:yt,INPUT:yt+" py-1.5"};function Nt(e){return null==e||isNaN(e)?"":e.toString()}const Ct=O.forwardRef(({value:t,onChange:n,className:a,noScroll:i=!1,noSpinners:s=!1,...l},o)=>{const[c,d]=O.useState(Nt(t));return A(()=>{if(null==t||!isNaN(t)){const e=Nt(t);d(e)}},[t]),e("input",{onWheel:i?e=>{e.target.blur()}:l.onWheel,type:"number",value:c,onChange:e=>{const t=e.target.value;if(d(t),""===t)n&&n(void 0,t);else{const e=parseFloat(t);n&&n(e,t)}},className:r(a,wt.INPUT,{"no-spinners":s},s&&"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"),ref:o,...l})}),kt=se("hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{destructive:"bg-destructive dark:bg-destructive/10 text-destructive ring-1 ring-inset ring-destructive-muted/50 dark:ring-destructive-muted/50 shadow-xs hover:bg-destructive/50",outline:"border border-input bg-background shadow-xs hover:bg-muted ring-inset",secondary:"bg-primary/5 dark:bg-primary/10 text-primary shadow-xs hover:bg-primary/10 dark:hover:bg-primary/20 ring-inset",ghost:"hover:bg-muted/50 dark:hover:bg-muted/20 ring-inset",link:"text-foreground underline-offset-4 hover:underline ring-inset",primary:"bg-primary text-white shadow-xs hover:bg-primary/90 ring-inset",unstyled:""},size:{xs:"h-7 rounded px-2 py-1 text-xs gap-x-1",sm:"h-8 rounded px-3 text-xs",md:"h-9 rounded-md px-4 py-2",lg:"h-10 rounded-md px-3",xl:"rounded-md px-3.5 py-2.5 text-sm gap-x-2",icon:"p-0 m-0 rounded-full"}},defaultVariants:{variant:"primary",size:"md"}}),_t=R.forwardRef(({className:n,variant:a,size:i,asChild:s=!1,alt:l,isDisabled:o,isLoading:c,title:d,onClick:u,type:h,...p},f)=>{const g=t(s?ce:"button",{className:r(Qe(kt({variant:a,size:i})),n),disabled:o||c||p.disabled,ref:f,onClick:u,type:h,autoFocus:!1,...p,children:[c&&e(m,{className:"animate-spin"}),p.children]});return l||d?e(ne,{description:l||d,asChild:!0,className:"cursor-pointer",size:"xs",placement:"top",children:g}):g});_t.displayName="Button";const zt=R.forwardRef(({size:t,content:n,toast:r,className:a,alt:i,...s},o)=>{const[c,d]=$(!1);return e(_t,{ref:o,className:Qe(a),variant:"unstyled",size:t||"sm",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{d(!0),setTimeout(()=>d(!1),2e3),r&&r.toast&&r.toast({status:"success",title:r.message||"Copied to clipboard",duration:2e3})}).catch(e=>{console.error("Failed to copy text: ",e),r&&r.toast&&r.toast({status:"error",title:"Failed to copy",duration:2e3})})},...s,alt:i??"Copy",children:c?e(l,{className:"text-success"}):e(h,{className:"size-4"})})});function It({children:n,overlayContent:r,className:a="",overlayClassName:i="",position:s="right",width:l,height:o,showCloseButton:c=!0,onOpen:d,onClose:m,triggerClassName:h="",backdropClassName:p="",animationConfig:f={type:"spring",stiffness:300,damping:30}}){const[g,v]=$(!1),x=function(e){switch(e){case"left":return{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"}};case"right":default:return{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"}};case"top":return{initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"}};case"bottom":return{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}};case"center":return{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8}}}}(s),b=function(e,t,n){const r="fixed bg-white shadow-lg p-4 relative";switch(e){case"left":return`${r} left-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"right":default:return`${r} right-0 top-[var(--header-height)] h-full ${t||"w-80"}`;case"top":return`${r} top-[var(--header-height)] left-0 right-0 ${n||"h-80"}`;case"bottom":return`${r} bottom-0 left-0 right-0 ${n||"h-80"}`;case"center":return`${r} top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 ${t||"w-96"} ${n||"max-h-96"}`}}(s,l,o);return t("div",{className:`flex items-center justify-center w-full ${a}`,children:[e("div",{onClick:()=>{v(!0),d?.()},className:`w-full align-left cursor-pointer ${h}`,children:n}),g&&e("div",{className:`z-45 fixed inset-0 bg-black bg-opacity-50 ${p}`,children:t(le.div,{...x,transition:f,className:`${b} ${i}`,children:[c&&e("div",{className:"absolute top-2 right-2 z-10",children:e(_t,{onClick:()=>{v(!1),m?.()},variant:"primary",children:e(u,{})})}),e("div",{className:c?"mt-8":"",children:r})]})})]})}zt.displayName="CopyButton";const Tt="--tailwind-portal";function Lt({children:t}){const n=D(null),[r,a]=$(null);return A(()=>{if(n.current){const e=n.current.ownerDocument;let t=e.getElementById(Tt);t||(t=e.createElement("DIV"),t.id=Tt,e.body.appendChild(t)),a(t)}},[n.current]),r?B(t,r):e("span",{ref:n})}class Mt{renderOption(e){return this.labelOf(e)}findById(e,t){return e.find(e=>this.idOf(e)===t)}}function Rt({checkColor:t,cols:n="grid-cols-1",gap:a="gap-2",value:i,onChange:s,options:l,checkIcon:o=St,adapter:c}){const[d,u]=$(i),m=e=>{u(e),s(e)},h=d?c.idOf(d):void 0;return e("div",{className:r("grid",n,a),children:l.map(n=>{const r=c.idOf(n);return e(Ot,{checkColor:t,isSelected:r===h,option:n,adapter:c,onSelect:m,CheckIcon:o},r)})})}function Ot({checkColor:n,CheckIcon:r,adapter:a,isSelected:i,option:s,onSelect:l}){const[o,c]=$(!1);return t("div",{className:"flex gap-1 cursor-pointer items-center",onClick:()=>l(s),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:[e("div",{className:"",children:e(r,{size:24,isChecked:i,isHighlighted:o,color:n})}),e("div",{children:a.renderOption(s)})]})}function St({size:t,isChecked:n,isHighlighted:r,color:a="currentColor"}){const i=r?1:.6;return e("svg",n?{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_checked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 L18.25,3 Z M18.25,4.5 L5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 Z M10,14.4393398 L16.4696699,7.96966991 C16.7625631,7.6767767 17.2374369,7.6767767 17.5303301,7.96966991 C17.7965966,8.23593648 17.8208027,8.65260016 17.6029482,8.94621165 L17.5303301,9.03033009 L10.5303301,16.0303301 C10.2640635,16.2965966 9.84739984,16.3208027 9.55378835,16.1029482 L9.46966991,16.0303301 L6.46966991,13.0303301 C6.1767767,12.7374369 6.1767767,12.2625631 6.46966991,11.9696699 C6.73593648,11.7034034 7.15260016,11.6791973 7.44621165,11.8970518 L7.53033009,11.9696699 L10,14.4393398 L16.4696699,7.96966991 L10,14.4393398 Z"})})})}:{width:`${t}px`,height:`${t}px`,viewBox:"0 0 24 24",version:"1.1",children:e("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:e("g",{id:"ic_fluent_checkbox_unchecked_24_regular",fill:a,fillRule:"nonzero",opacity:i,children:e("path",{d:"M5.75,3 L18.25,3 C19.7687831,3 21,4.23121694 21,5.75 L21,18.25 C21,19.7687831 19.7687831,21 18.25,21 L5.75,21 C4.23121694,21 3,19.7687831 3,18.25 L3,5.75 C3,4.23121694 4.23121694,3 5.75,3 Z M5.75,4.5 C5.05964406,4.5 4.5,5.05964406 4.5,5.75 L4.5,18.25 C4.5,18.9403559 5.05964406,19.5 5.75,19.5 L18.25,19.5 C18.9403559,19.5 19.5,18.9403559 19.5,18.25 L19.5,5.75 C19.5,5.05964406 18.9403559,4.5 18.25,4.5 L5.75,4.5 Z"})})})})}const Dt=S({theme:"system",setTheme:()=>null});function $t({children:t,defaultTheme:n="system",storageKey:r="vite-ui-theme",...a}){const[i,s]=$(()=>localStorage.getItem(r)||n);A(()=>{const e=window.document.documentElement;if(e.classList.remove("light","dark"),"system"===i){const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return void e.classList.add(t)}e.classList.add(i)},[i]);const l={theme:i,setTheme:e=>{localStorage.setItem(r,e),s(e)}};return e(Dt.Provider,{...a,value:l,children:t})}const At=()=>{const e=E(Dt);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e};function Et({option:t,current:n,setTheme:r,icon:a}){return e(_t,{variant:n===t?"secondary":"outline",size:"sm",onClick:()=>r(t),alt:t,children:a})}function Pt({label:n="Theme",className:r}={}){const{setTheme:a,theme:i}=At();return t("div",{className:r??(n?"flex justify-between px-2 items-center":"flex items-center gap-1"),children:[n&&e("p",{className:"text-sm font-semibold",children:n}),t("div",{className:"flex gap-2",children:[e(Et,{current:i,option:"system",setTheme:a,icon:e(p,{})}),e(Et,{current:i,option:"light",setTheme:a,icon:e(f,{})}),e(Et,{current:i,option:"dark",setTheme:a,icon:e(g,{})})]})]})}const Ft=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("rounded-xl border bg-card text-card-foreground shadow",t),...n}));Ft.displayName="Card";const jt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("flex flex-col p-6",t),...n}));jt.displayName="CardHeader";const Vt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("font-semibold leading-none tracking-tight",t),...n}));Vt.displayName="CardTitle";const Yt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("text-sm text-muted-foreground",t),...n}));Yt.displayName="CardDescription";const Bt=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("p-6 pt-0",t),...n}));Bt.displayName="CardContent";const Ht=R.forwardRef(({className:t,...n},r)=>e("div",{ref:r,className:Qe("flex items-center p-6 pt-0",t),...n}));function Wt({children:t}){return e("span",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},children:t})}Ht.displayName="CardFooter";const Ut=S(!1);function Gt(){return!!E(Ut)}function Kt({children:t}){return e(Ut.Provider,{value:!0,children:t})}function Jt({className:r,children:a,isOpen:i,onClose:s,description:l="Modal Description",noCloseButton:o=!1,allowOverflow:c=!1,disableCloseOnClickOutside:d=!1,size:m="md",action:h}){const p=e=>{e||s()};return t(Qt,{open:i,onOpenChange:e=>{d&&!e||p(e)},children:[c&&e(rn,{className:"z-50 fixed inset-0 bg-black/80"}),e(Wt,{children:e(sn,{children:l})}),t(an,{className:Qe("min-h-20 p-4","fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 sm:rounded-lg",function(){switch(m){case"sm":return"max-w-[20vw]";case"md":default:return"max-w-[60vw] lg:max-w-[40vw]";case"lg":return"max-w-[80vw] md:max-w-[60vw]";case"xl":return"max-w-[95vw] lg:max-w-[80vw]"}}(),r),children:[e("div",{className:"top-4 right-4 absolute",children:t("div",{className:"flex gap-2",children:[h&&e(n,{children:h}),!o&&e(nn,{onClick:()=>p(!1),asChild:!0,autoFocus:!1,children:e(_t,{variant:"outline",alt:"Close",className:"data-[state=open]:bg-accent opacity-70 hover:opacity-100 rounded-sm focus:outline-none focus:ring-2 focus:ring-ring ring-offset-background focus:ring-offset-2 data-[state=open]:text-muted-foreground transition-opacity disabled:pointer-events-none",children:e(u,{className:"size-4"})})})]})}),e(Kt,{children:a})]})]})}const Zt=({children:r,show:a=!0,className:i,description:s,showDivider:l=!1,...o})=>a?e(n,{children:t(ln,{className:Qe(l?"border-b-solid border-b border-b-1 pb-2 mb-4":"","text-lg font-semibold leading-6 tracking-tight",{"py-2":!s},i),...o,children:[r,s&&e(sn,{className:"text-sm !font-normal text-muted-foreground pb-2",children:s})]})}):t(Wt,{children:[e(ln,{children:r}),s&&e(sn,{children:s})]}),qt=({children:t,className:n,...r})=>e("div",{className:Qe("text-sm max-h-[80vh] overflow-y-auto",n),...r,children:t}),Xt=({align:t="right",children:n,className:r,...a})=>e("div",{className:Qe("w-full flex py-3 sm:py-2 sm:flex sm:flex-row-reverse sm:flex-row sm:justify-end sm:space-x-2",{left:"justify-start",center:"justify-center",right:"justify-end"}[t],r),...a,children:n}),Qt=de.Root,en=de.Trigger,tn=de.Portal,nn=de.Close,rn=R.forwardRef(({className:t,...n},r)=>e(de.Overlay,{ref:r,className:Qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));rn.displayName=de.Overlay.displayName;const an=R.forwardRef(({className:n,children:r,...a},i)=>{const s=nt();return t(tn,{container:s,children:[e(rn,{}),e(de.Content,{ref:i,autoFocus:!1,onOpenAutoFocus:e=>{e.preventDefault()},className:Qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...a,children:r})]})});an.displayName=de.Content.displayName;const sn=R.forwardRef(({className:t,...n},r)=>e(de.Description,{ref:r,className:Qe("text-sm text-muted",t),...n}));sn.displayName=de.Description.displayName;const ln=R.forwardRef(({className:t,...n},r)=>e(de.Title,{ref:r,className:Qe("text-lg font-semibold leading-none tracking-tight",t),...n}));function on({title:n,content:r,onConfirm:a,onCancel:i,isOpen:s}){const l=D(null);return t(Jt,{isOpen:s,onClose:i,description:"Confirm Modal",children:[t("div",{className:"sm:flex sm:items-start p-2",children:[e("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:e(v,{className:"size-6 text-red-600","aria-hidden":"true"})}),t("div",{className:"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left",children:[e(Zt,{className:"leading-6",show:!0,children:n}),e("div",{className:"mt-2",children:e("div",{className:"prose text-sm text-gray-500",children:r})})]})]}),t(Xt,{align:"right",children:[e(_t,{variant:"destructive",onClick:a,children:"Confirm"}),e(_t,{variant:"outline",onClick:i,ref:l,children:"Cancel"})]})]})}function cn(){return E(dn)}ln.displayName=de.Title.displayName;const dn=S(()=>{}),un={success:y,error:b,warning:x,info:d},mn={success:"text-success",error:"text-destructive",warning:"text-attention",info:"text-info"};function hn({data:n,onClose:r}){const[a,i]=$(!0),s=D(null),l=()=>{s.current&&globalThis.clearTimeout(s.current),n.duration&&(s.current=setTimeout(()=>i(!1),n.duration))},o=()=>{s.current&&(globalThis.clearTimeout(s.current),s.current=null)};A(()=>(l(),o),[n.duration]);const c=un[n.status]||d,m=mn[n.status]||"text-info";return e("div",{"aria-live":"assertive",className:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-100",children:e("div",{className:"flex w-full flex-col items-center space-y-4 sm:items-end",children:e(U,{appear:!0,show:a,as:P,afterLeave:r,enter:"transform ease-out duration-700 transition",enterFrom:"translate-y-0 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-2 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border",onMouseEnter:o,onMouseLeave:l,children:e("div",{className:"p-5",children:t("div",{className:"flex items-start",children:[e("div",{className:"shrink-0",children:e(c,{className:`size-6 ${m}`,"aria-hidden":"true"})}),t("div",{className:"ml-3 flex-1 pt-0.5 min-w-0",children:[e("p",{className:"text-sm font-semibold text-foreground break-words",children:n.title}),n.description&&e("p",{className:"mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed",children:n.description})]}),e("div",{className:"ml-4 flex shrink-0",children:t("button",{type:"button",className:"inline-flex rounded-md bg-muted text-muted hover:text-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",onClick:()=>i(!1),children:[e("span",{className:"sr-only",children:"Close"}),e(u,{className:"size-5","aria-hidden":"true"})]})})]})})})})})})}function pn({children:r}){const[a,i]=$(null),s=e=>{i(e)};return t(n,{children:[e(dn.Provider,{value:s,children:r}),a&&e(Lt,{children:e(hn,{data:a,onClose:()=>s(null)})})]})}function fn({idToDelete:t,title:n,content:r,setIdToDelete:a,deleteApi:i}){const s=cn();return e(on,{title:n,content:r,isOpen:!!t,onConfirm:async()=>{if(t)return i(t).then(()=>{s({title:"Delete succeeded",status:"success"})}).catch(e=>{s({title:"Failed to delete",description:e.message??"An error occurred while deleting the object",status:"error"})}).finally(()=>{a(void 0)})},onCancel:()=>{a(void 0)}})}const gn=R.forwardRef(({className:t,orientation:n="horizontal",decorative:r=!0,...a},i)=>e(ue.Root,{ref:i,decorative:r,orientation:n,className:Qe("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...a}));gn.displayName=ue.Root.displayName;const vn=R.createContext(null),xn=({hover:t=!1,click:n=!1,children:r,_open:a,onOpenChange:i})=>{const[s,l]=R.useState(a||!1),o=Gt();return e(vn.Provider,{value:{open:s,setOpen:l,hover:t,click:n},children:e(he.Root,{open:s,onOpenChange:e=>{l(e),i&&i(e)},modal:o,children:r})})};function bn(e=!1,t=()=>{},n){e&&t("enter"===n)}const yn=R.forwardRef(({children:t,...n},r)=>{const a=R.useContext(vn);if(!a)throw new Error("PopoverTrigger must be used within a Popover");const{setOpen:i,hover:s,click:l}=a;return e(he.Trigger,{ref:r,asChild:!0,onMouseEnter:()=>bn(s,i,"enter"),onMouseLeave:()=>bn(s,i,"leave"),onClick:()=>{l&&i(e=>!e)},...n,children:t})});yn.displayName=he.Trigger.displayName;const wn=he.Anchor,Nn=R.forwardRef(({className:t,align:n="center",side:r="bottom",...a},i)=>{const s=R.useContext(vn);if(!s)throw new Error("PopoverContent must be used within a Popover");const{setOpen:l,hover:o}=s,c=nt();return e(he.Portal,{container:c,children:e(he.Content,{ref:i,align:n,side:r,onMouseEnter:()=>bn(o,l,"enter"),onMouseLeave:()=>bn(o,l,"leave"),className:Qe("z-50 w-72 rounded-md border-popover bg-popover text-popover-foreground ring-1 ring-gray-200 dark:ring-slate-700 shadow-md focus:outline-none animate-in","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",t),...a})})});Nn.displayName=he.Content.displayName;const Cn=he.Close;Cn.displayName=he.Close.displayName;const kn=R.forwardRef(({className:t,...n},r)=>e(pe,{ref:r,className:Qe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));kn.displayName=pe.displayName;const _n=({children:t,...n})=>e(Qt,{...n,children:e(an,{className:"shadow-lg p-0 overflow-hidden",children:e(kn,{className:"[&_[cmdk-group]]:px-2 [&_[cmdk-item]]:px-2 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:w-5 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",children:t})})}),zn=R.forwardRef(({className:n,...r},a)=>t("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[e(w,{className:"opacity-50 size-4 shrink-0"}),e(pe.Input,{ref:a,className:Qe("focus:ring-0","border-0 flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...r})]}));zn.displayName=pe.Input.displayName;const In=R.forwardRef(({className:t,...n},r)=>e(pe.List,{ref:r,className:Qe("overflow-y-auto overflow-x-hidden",t),...n}));In.displayName=pe.List.displayName;const Tn=R.forwardRef((t,n)=>e(pe.Empty,{ref:n,className:"py-2 text-sm text-center",...t}));Tn.displayName=pe.Empty.displayName;const Ln=R.forwardRef(({className:t,...n},r)=>e(pe.Group,{ref:r,className:Qe("overflow-y-auto overflow-x-hidden p-1 text-foreground","[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));Ln.displayName=pe.Group.displayName;const Mn=R.forwardRef(({className:t,...n},r)=>e(pe.Separator,{ref:r,className:Qe("-mx-1 h-px bg-border",t),...n}));Mn.displayName=pe.Separator.displayName;const Rn=R.forwardRef(({className:t,...n},r)=>e(pe.Item,{ref:r,className:Qe("hover:bg-muted cursor-pointer relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...n}));Rn.displayName=pe.Item.displayName;const On=({className:t,...n})=>e("span",{className:Qe("ml-auto text-xs tracking-widest text-muted-foreground",t),...n});function Sn({options:a,optionLabel:i,value:s,onChange:o,addNew:c,addNewLabel:d,disabled:m,filterBy:h,label:p,placeholder:f,className:g,popupClass:v,isClearable:b,border:y=!0,multiple:w=!1,by:z,inline:I=!1,isLoading:T=!1,warnOnMissingValue:L=!0,missingValueWarning:M="Value not in options list, may not be valid",clearIcon:R,clearTitle:O}){const S=D(null),[E,P]=$(!1),[F,V]=$(0),[Y,B]=$(""),H=j(()=>!(!L||w||null==s||!a)&&!a.some(e=>"string"==typeof z?e[z]===s[z]:"function"==typeof z?z(e,s):me(e,s)),[L,w,s,a,z]);A(()=>{const e=S.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;V(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);const W=(e,t)=>!(!t||0===t.length)&&t.some(t=>U(t,e)),U=(e,t)=>null==e||null==t?e===t:"string"==typeof z?e[z]===t[z]:"function"==typeof z?z(e,t):me(e,t);let G=a||[];const K=Y.toLowerCase(),J=function(e){return e?"string"==typeof e?t=>String(t[e]).toLowerCase():e:e=>String(e).toLowerCase()}(h);G=G.filter(e=>J(e).includes(K));const Z=()=>t(n,{children:[h&&t("div",{className:"flex justify-start items-center mb-1",children:[e("div",{className:"mx-2",children:e(k,{className:"size-4"})}),e(ft,{variant:"unstyled",value:Y,onChange:B,className:"w-full p-1 rounded-md",placeholder:"Search..."})]}),e(kn,{className:"overflow-hidden",children:t(In,{className:I?"max-h-full overflow-y-auto":"max-h-[200px] overflow-y-auto",onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[e(Tn,{children:"No result found."}),e(Ln,{children:G?.map((n,r)=>{const a=w?W(n,Array.isArray(s)?s:[]):null!=s&&U(s,n);return e(Rn,{onSelect:()=>(e=>{if(w){const t=Array.isArray(s)?s:[];if(W(e,t)){const n=t.filter(t=>!U(t,e));o(n)}else o([...t,e])}else P(!1),o(e)})(n),className:"w-full",children:w||I?t("div",{className:"w-full flex justify-between items-center cursor-pointer",children:[e("div",{className:"w-full truncate text-left",children:i?i(n):n}),a&&e(l,{className:"size-4"})]}):t(Cn,{className:"w-full flex justify-between items-center",children:[e("div",{className:"w-full truncate text-left",children:i?i(n):n}),a&&e(l,{className:"size-4"})]})},r)})})]})}),c&&e("div",{className:"p-1",children:t("a",{onClick:c,className:r("gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-accent"),children:[e(_,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),d]})})]});return I?e("div",{className:r(g,y&&"border border-border rounded-md","bg-popover p-1",v),children:T?e("div",{className:"flex justify-center items-center p-2 text-muted text-sm",children:e(N,{className:"size-4 animate-spin"})}):Z()}):t(xn,{children:[e(yn,{asChild:!0,children:e("div",{ref:S,onClick:e=>{m||T?e.preventDefault():P(!E)},className:r(g,T?"flex justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm":r(y&&(H?"border border-destructive":"border border-border"),"flex flex-row gap-2 items-center justify-between p-2 rounded-md group relative [&:hover_.clear-button]:opacity-100",m?"cursor-not-allowed text-muted":"cursor-pointer hover:bg-muted")),children:T?e(N,{className:"size-4 animate-spin"}):t(n,{children:[t("div",{className:r("flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate",!m&&"",b&&s&&(!Array.isArray(s)||s.length>0)&&"pr-2"),children:[p&&e("div",{className:"w-full text-left text-xs font-semibold",children:p}),t("div",{className:r("w-full text-left ",!m&&"",H&&"text-destructive"),children:[H&&e(lt,{description:M,placement:"top",asChild:!0,children:e(x,{className:"inline-block size-4 mr-1 -mt-0.5 cursor-help"})}),w?(()=>{const n=Array.isArray(s)?s:s?[s]:[];return 0===n.length?e("span",{className:"text-muted",children:f}):1===n.length?i?i(n[0]):n[0]:t("div",{className:"flex flex-wrap gap-1",children:[n.slice(0,1).map((t,n)=>e("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded",children:i?i(t):t},n)),n.length>1&&t("span",{className:"inline-flex items-center px-2 py-1 text-xs bg-muted rounded",children:["+",n.length-1," more"]})]})})():(()=>{if(!s||Array.isArray(s)&&0===s.length)return e("span",{className:"text-muted",children:f});const t=Array.isArray(s)?s[0]:s;return i?i(t):t})()]})]}),t("div",{className:"flex items-center gap-1 group",children:[b&&s&&(!Array.isArray(s)||s.length>0)&&e(_t,{variant:"link",size:"icon",disabled:m,alt:O||"Clear selection",onClick:e=>{e.stopPropagation(),o(w?[]:void 0)},className:"cursor-pointer hover:bg-muted/20 clear-button opacity-0 transition-opacity duration-200 rounded p-1",children:R||e(u,{className:"size-4"})}),!m&&e(C,{className:"size-4 opacity-50"})]})]})})}),e(Nn,{style:{width:`${F}px`,zIndex:1e6},className:r("min-w-[8rem] w-64 bg-popover p-1 border shadow","divide-y divide-border",v),children:Z()})]})}On.displayName="CommandShortcut";const Dn=R.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:"tabs",updateHash:!0}),$n=({tabs:t,defaultValue:n,current:r,className:a,fullWidth:i,children:s,onTabChange:l,responsive:o=!1,variant:c="tabs",updateHash:d=!0})=>{const u=R.useMemo(()=>t.filter(e=>void 0===e.is_allowed||!0===e.is_allowed),[t]),[m,h]=R.useState(()=>{const e="function"==typeof r?r():r;if(e)return e;const t=window.location.hash,a=t?t.substring(1):void 0;return a&&u.some(e=>e.name===a)?a:n||u[0]?.name});R.useEffect(()=>{const e="function"==typeof r?r():r;e&&e!==m&&h(e)},[r]),R.useEffect(()=>{if(r)return;const e=()=>{const e=window.location.hash,t=e?e.substring(1):void 0;t&&u.some(e=>e.name===t)?h(t):!e&&n&&h(n)};return e(),window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[r,u,n]);const p=e=>{if(h(e),d&&!r){const t=window.history.state,n=window.location.pathname+window.location.search+"#"+e;window.history.pushState(t,"",n)}l&&l(e)},f=R.useCallback(e=>{p(e)},[p]);return e(Dn.Provider,{value:{tabs:u,size:i?u.length:0,current:m,setTab:f,responsive:o,variant:c,updateHash:d},children:e(fe.Root,{defaultValue:m||u[0]?.name,value:m,onValueChange:p,className:a,children:s})})},An=({className:r})=>{const{tabs:a,size:i,current:s,setTab:l,responsive:o,variant:c,updateHash:d}=R.useContext(Dn),u=0!==i,m=R.useCallback(e=>{if(!a||!l)return;const t=a.find(t=>t.name===e);if(t?.href&&d){const e=window.history.state;window.history.pushState(e,"",t.href)}l(e)},[a,l,d]);return a&&l?t(n,{children:[o&&e("div",{className:"px-2 block lg:hidden",children:e(Sn,{label:"Tab",className:r,options:a,optionLabel:e=>"string"==typeof e.label?e.label:String(e.label),value:a.find(e=>e.name===s),onChange:e=>{m(e.name)}})}),e(Pn,{size:i,variant:c,className:Qe(u?"w-full":"",r,o?"hidden lg:flex":""),children:a.map(t=>e(Fn,{value:t.name,disabled:t.disabled,href:t.href,variant:c,onClick:()=>m(t.name),children:t.label},t.name))})]}):(console.warn("TabsBar: No tabs provided or setTab not available"),null)},En=({className:t})=>{const{tabs:r}=R.useContext(Dn);return r?e(n,{children:r.map(n=>e(jn,{value:n.name,className:t,children:n.content},n.name))}):null},Pn=R.forwardRef(({className:t,size:n,variant:r="tabs",...a},i)=>e(Dn.Provider,{value:{size:n,variant:r},children:e(fe.List,{ref:i,className:Qe("tabs"===r?"border-b -mb-px flex space-x-4":"flex space-x-2 p-1 rounded-md",t),...a})}));Pn.displayName=fe.List.displayName;const Fn=R.forwardRef(({className:t,href:n,variant:r="tabs",...a},i)=>{const{size:s}=R.useContext(Dn),l=R.useCallback(e=>{if(n){e.preventDefault();const t=window.history.state;window.history.pushState(t,"",n)}a.onClick&&a.onClick(e)},[n,a.onClick]);return e(fe.Trigger,{ref:i,className:Qe("tabs"===r?Qe("border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer","border-transparent text-muted-foreground hover:border-border hover:text-foreground","data-[state=active]:border-primary data-[state=active]:text-primary","disabled:pointer-events-none disabled:opacity-50"):Qe("px-3 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer rounded-sm transition-colors","tborder border-input bg-muted shadow-xs hover:bg-muted ring-inset","data-[state=active]:bg-primary data-[state=active]:text-white data-[state=active]:shadow-sm","disabled:pointer-events-none disabled:opacity-50"),t,s?`w-1/${s}`:""),onClick:l,...a})});Fn.displayName=fe.Trigger.displayName;const jn=R.forwardRef(({className:t,...n},r)=>e(fe.Content,{ref:r,className:Qe("focus-visible:outline-none","flex-1 overflow-y-auto min-h-0 pt-2",t),...n}));jn.displayName=fe.Content.displayName;const Vn=se("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Yn=R.forwardRef(({className:n,required:r,...a},i)=>t(ge.Root,{ref:i,className:Qe(Vn(),n),...a,children:[a.children,r&&e("span",{className:"text-destructive-foreground ml-1",children:"*"})]}));function Bn({path:n,maxItems:r=3,className:a,separator:i}){const s=n||[],l=t=>t.onClick?e(Gn,{onClick:t.onClick,href:t.href,children:t.label}):t.href?e(Gn,{href:t.href,children:t.label}):e(Kn,{children:t.label});if(s.length<=r)return e(Hn,{className:Qe("w-full",a),children:e(Wn,{children:s.map((n,r)=>t(R.Fragment,{children:[e(Un,{children:l(n)}),r<s.length-1&&e(Jn,{children:i??e(z,{})})]},r))})});const o=s.slice(-(r-1));return e(Hn,{className:Qe("w-full",a),children:t(Wn,{children:[e(Un,{children:e(Zn,{})}),e(Jn,{children:i??e(z,{})}),o.map((n,r)=>t(R.Fragment,{children:[e(Un,{children:l(n)}),r<o.length-1&&e(Jn,{children:i??e(z,{})})]},r))]})})}Yn.displayName=ge.Root.displayName;const Hn=R.forwardRef(({...t},n)=>e("nav",{ref:n,"aria-label":"breadcrumb",...t}));Hn.displayName="Breadcrumb";const Wn=R.forwardRef(({className:t,...n},r)=>e("ol",{ref:r,className:Qe("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...n}));Wn.displayName="BreadcrumbList";const Un=R.forwardRef(({className:t,...n},r)=>e("li",{ref:r,className:Qe("inline-flex items-center gap-1.5 text-muted",t),...n}));Un.displayName="BreadcrumbItem";R.forwardRef(({asChild:t,className:n,...r},a)=>e("a",{ref:a,className:Qe("transition-colors hover:text-muted",n),...r})).displayName="BreadcrumbLink";const Gn=R.forwardRef(({className:t,href:n,onClick:r,...a},i)=>e("button",{ref:i,className:Qe("transition-colors hover:text-foreground cursor-pointer",t),onClick:e=>{e.preventDefault(),r&&r(e)},...a}));Gn.displayName="BreadcrumbButton";const Kn=R.forwardRef(({className:t,...n},r)=>e("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:Qe("font-normal text-foreground",t),...n}));Kn.displayName="BreadcrumbPage";const Jn=({children:t,className:n,...r})=>e("li",{role:"presentation","aria-hidden":"true",className:Qe("[&>svg]:w-3.5 [&>svg]:h-3.5",n),...r,children:t??e(z,{})});Jn.displayName="BreadcrumbSeparator";const Zn=({className:n,...r})=>t("span",{role:"presentation","aria-hidden":"true",className:Qe("flex h-9 w-9 items-center justify-center",n),...r,children:[e(I,{className:"h-4 w-4"}),e("span",{className:"sr-only",children:"More"})]});Zn.displayName="BreadcrumbEllipsis";const qn=({children:t,className:n})=>{const r=D(null),[a,i]=$("auto");return A(()=>{if(r.current){const e=new ResizeObserver(e=>{const t=e[0].contentRect.height;i(t)});return e.observe(r.current),()=>{e.disconnect()}}},[]),e("div",{className:Qe(n,"overflow-hidden transition-all duration-100 ease-in"),style:{height:a},children:e("div",{ref:r,children:t})})},Xn=R.forwardRef(({className:t,...n},r)=>e(ve.Root,{ref:r,className:Qe("peer size-4 shrink-0 rounded-sm border border-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-white",t),...n,children:e(ve.Indicator,{className:Qe("flex items-center justify-center text-current"),children:e(l,{className:"size-4"})})}));function Qn({value:t,labelRenderer:r,fallbackLabel:a}){const[i,s]=$(a||t),[l,o]=$(!1);return A(()=>{if(!r)return void s(a||t);(async()=>{o(!0);try{const e=r(t);if(e instanceof Promise){const t=await e;s(t)}else s(e)}catch(e){console.error("Error rendering label:",e),s(a||t)}finally{o(!1)}})()},[t,r,a]),l?e("span",{className:"text-muted-foreground",children:"Loading..."}):e(n,{children:i})}Xn.displayName=ve.Root.displayName;const er=({filterType:r,filterValues:a,setFilterValues:i,options:s,labelRenderer:l})=>{const[o,c]=$(!1),[d,u]=$(""),m=D(null),h=s?.filter(e=>!a.some(t=>t.value===e.value));return t(xn,{_open:o,onOpenChange:e=>{c(e),e||setTimeout(()=>{u("")},200)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-primary shrink-0",children:e("div",{className:"flex gap-1.5 items-center",children:1===a?.length?(()=>{const t=a[0];return e(Qn,{value:t.value||"",labelRenderer:l,fallbackLabel:t.label})})():`${a?.length} selected`})}),e(Nn,{className:"w-[300px] p-0",children:e(qn,{children:t(kn,{children:[e(zn,{placeholder:r,className:"h-9",value:d,onInputCapture:e=>{u(e.currentTarget.value)},ref:m}),t(In,{children:[e(Tn,{children:"No results found."}),e(Ln,{children:a.map(n=>t(Rn,{className:"group flex gap-2 items-center",onSelect:()=>{i(a.filter(e=>e.value!==n.value)),setTimeout(()=>{u("")},200),c(!1)},children:[e("input",{type:"checkbox",checked:!0,onChange:()=>{}}),e(Qn,{value:n.value||"",labelRenderer:l,fallbackLabel:n.label})]},n.value))}),h?.length>0&&t(n,{children:[e(Mn,{}),e(Ln,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(n=>t(Rn,{className:"group flex gap-2 items-center",value:String(n.label||n.value),onSelect:()=>{i([...a,{value:n.value,label:n.label}]),setTimeout(()=>{u("")},200),c(!1)},children:[e(Xn,{checked:!1,className:"opacity-0 group-data-[selected=true]:opacity-100"}),e("span",{className:"text-muted",children:e(Qn,{value:n.value||"",labelRenderer:n.labelRenderer||l,fallbackLabel:n.label})})]},n.value))})]})]})]})})})]})},tr="\n.calendar-wrapper .react-calendar__navigation {\n display: flex !important;\n justify-content: space-between !important;\n align-items: center !important;\n gap: 8px !important;\n padding: 8px !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__label {\n flex: 1 !important;\n text-align: center !important;\n font-weight: 500 !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n min-width: 32px !important;\n height: 32px !important;\n border-radius: 4px !important;\n border: 1px solid hsl(var(--border)) !important;\n background: hsl(var(--background)) !important;\n color: hsl(var(--foreground)) !important;\n}\n\n.calendar-wrapper .react-calendar__navigation__arrow:hover {\n background: oklch(var(--muted)) !important;\n}\n\n.calendar-wrapper .react-calendar__tile {\n cursor: pointer !important;\n width: 0.5rem !important;\n font-size: 0.875rem !important;\n}\n\n.calendar-wrapper .react-calendar__tile:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile:not(.react-calendar__tile--active):hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--hover {\n background: #b5b5b580 !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled,\n.calendar-wrapper .react-calendar__tile:disabled,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled {\n cursor: not-allowed !important;\n color: #9ca3af !important;\n}\n\n.calendar-wrapper .react-calendar__tile--disabled:hover,\n.calendar-wrapper .react-calendar__tile:disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day--disabled:hover,\n.calendar-wrapper .react-calendar__month-view__days__day:disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month--disabled:hover,\n.calendar-wrapper .react-calendar__year-view__months__month:disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year--disabled:hover,\n.calendar-wrapper .react-calendar__decade-view__years__year:disabled:hover {\n background: transparent !important;\n}\n\n\n.calendar-wrapper .react-calendar__month-view__weekdays {\n font-size: 0.75rem !important;\n}\n\n.calendar-wrapper .react-calendar__month-view__weekdays__weekday {\n width: 0.75rem !important;\n font-size: 0.75rem !important;\n text-align: center !important;\n}\n \n",nr=({filterValues:r,setFilterValues:a,isRange:i=!1})=>{const[s,l]=$(!1),[o,c]=$([null,null]),d=r[0]?new Date(r[0]):void 0,u=i?[o[0]||(r[0]?new Date(r[0]):null),o[1]||(r[1]?new Date(r[1]):null)]:[null,null];A(()=>{i&&c([r[0]?new Date(r[0]):null,r[1]?new Date(r[1]):null])},[r,i]);const m=e=>{if(i)Array.isArray(e)&&(c([e[0],e[1]]),e[0]&&e[1]?a([xe(e[0]).format("YYYY-MM-DD"),xe(e[1]).format("YYYY-MM-DD")]):e[0]&&a([xe(e[0]).format("YYYY-MM-DD")]));else if(e){const t=Array.isArray(e)?e[0]:e;t&&(a([xe(t).format("YYYY-MM-DD")]),l(!1))}};return t(xn,{_open:s,onOpenChange:l,children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center min-h-[20px]",children:i?u[0]&&u[1]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:xe(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"-"}),e("span",{className:"font-medium",children:xe(u[1]).format("MMMM DD, YYYY")})]}):u[0]?t("span",{className:"flex items-center gap-1.5",children:[e("span",{className:"font-medium",children:xe(u[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted-foreground",children:"- Select end"})]}):e("span",{className:"text-muted-foreground",children:"Select range"}):d?xe(d).format("MMMM DD, YYYY"):"Pick a date"})}),e(Nn,{className:"w-auto p-0",align:"start",side:"bottom",alignOffset:-4,sideOffset:6,children:e("div",{className:"p-2",children:i?t(n,{children:[t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:u,onChange:m,selectRange:!0,returnValue:"range",maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(u[0]){const e=u[0].getTime();if(u[1]){const n=u[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}})]}),u[0]&&u[1]&&e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:()=>l(!1),children:"Cancel"}),e(_t,{size:"sm",onClick:()=>l(!1),children:"Apply"})]})})]}):t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{const e=new Date;return e.setHours(23,59,59,999),e})(),className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(d&&t===d.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})]})},rr=({filterType:n,filterValue:r,setFilterValue:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(xn,{_open:i,onOpenChange:e=>{s(e),e||l===r||o(r)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r||"Enter text..."})}),e(Nn,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(ft,{autoFocus:!0,type:"text",size:"sm",value:l,onChange:o,onKeyDown:e=>{"Enter"===e.key&&(a(l),s(!1))},placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})})]})})]})},ar=({filterType:n,filterValues:r,setFilterValues:a})=>{const[i,s]=$(!1),[l,o]=$(r);return t(xn,{_open:i,onOpenChange:e=>{s(e),e||JSON.stringify(l)===JSON.stringify(r)||o(r)},children:[e(yn,{className:"rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition",children:e("div",{className:"flex gap-1.5 items-center",children:r.length>0?1===r.length?r[0]:`${r.length} tags`:"Add tags..."})}),e(Nn,{className:"w-[300px] p-3",children:t("div",{className:"flex flex-col gap-3",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:n})}),e(gt,{value:l,onChange:o,placeholder:`Add ${n.toLowerCase()}...`}),t("div",{className:"flex gap-2 justify-end",children:[e(_t,{size:"sm",variant:"ghost",onClick:()=>{o(r),s(!1)},children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{a(l),s(!1)},children:"Apply"})]})]})})]})};function ir(t,n,r){switch(t.type){case"date":return e(nr,{filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value.map(e=>e.value||""):[],isRange:t.multiple,setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e.length>0?e.map(e=>({value:e,label:xe(e).format("LLL dd, y")})):[]}:n))}});case"text":return e(rr,{filterType:t.placeholder||t.name,filterValue:Array.isArray(t.value)&&t.value[0]&&"object"==typeof t.value[0]&&t.value[0].value||"",setFilterValue:e=>{n(n=>n.map(n=>n===t?{...n,value:[{value:e,label:e}]}:n))}});case"stringList":return e(ar,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"string"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e}:n))}});default:{const a=r.find(e=>e.name===t.name);return e(er,{filterType:t.placeholder||t.name,filterValues:Array.isArray(t.value)&&"object"==typeof t.value[0]?t.value:[],setFilterValues:e=>{n(n=>n.map(n=>n===t?{...n,value:e}:n))},options:a?.options||[],labelRenderer:a?.labelRenderer})}}}function sr({filters:n,setFilters:r,filterGroups:a}){return e("div",{className:"flex gap-2 flex-wrap justify-start",children:n.filter(e=>e.value?.length>0).map(n=>t("div",{className:"flex gap-[1px] items-center text-sm",children:[e("div",{className:"flex gap-1.5 shrink-0 rounded-l bg-muted p-1.5 h-8 items-center",children:n.placeholder||n.name}),ir(n,r,a),e(_t,{variant:"ghost",size:"icon",onClick:()=>{r(e=>e.filter(e=>e!==n))},className:"bg-muted rounded-l-none rounded-r-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0",children:e(u,{className:"size-6"})})]},n.name+"-"+("date"==n.type?"date":"stringList"===n.type&&"string"==typeof n.value[0]?n.value.join(","):Array.isArray(n.value)?n.value.map(e=>e.value).join(","):"")))})}function lr({selectedView:n,textValue:r,setTextValue:a,setFilters:i,handleClose:s,filterGroups:l}){const o=()=>{i(e=>[...e,{name:n||"",placeholder:l.find(e=>e.name===n)?.placeholder,value:[{value:r,label:r}],type:"text"}]),s()};return t("div",{className:"p-2 flex flex-col gap-1",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted",children:e("span",{children:l.find(e=>e.name===n)?.placeholder})}),e(ft,{autoFocus:!0,type:"text",size:"sm",value:r,onChange:a,onKeyDown:e=>"Enter"===e.key&&o(),placeholder:"Enter text..."}),e("div",{className:"mt-2 p-2 border-t",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:s,children:"Cancel"}),e(_t,{size:"sm",onClick:o,disabled:!r.trim(),children:"Apply"})]})})]})}function or({selectedView:r,selectedDate:a,setSelectedDate:i,setFilters:s,filters:l,handleClose:o,filterGroups:c}){const[d,u]=$([null,null]),[m,h]=$([null,null]),p=c.find(e=>e.name===r),f=p?.multiple,g=new Date;g.setHours(23,59,59,999);const v=[m[0]||d[0],m[1]||d[1]],x=e=>{if(f)Array.isArray(e)?(h([e[0],e[1]]),u([e[0],e[1]])):(h([e,null]),u([e,null]));else{const t=Array.isArray(e)?e[0]:e;if(i(t||void 0),t){const e=new Date(t);e.setHours(0,0,0,0),s([...l,{name:r||"",placeholder:p?.placeholder,value:[{value:e.toISOString(),label:xe(e).format("LLL dd, y")}],type:p?.type||"date",multiple:p?.multiple||!1}]),o()}}};return e("div",{className:"p-2",children:f?t(n,{children:[e("div",{children:f?v[0]&&v[1]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:xe(v[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"To:"}),e("span",{className:"text-xs font-medium",children:xe(v[1]).format("MMMM DD, YYYY")})]}):v[0]?t("span",{className:"flex items-center gap-2",children:[e("span",{className:"text-xs text-muted",children:"From:"}),e("span",{className:"text-xs font-medium",children:xe(v[0]).format("MMMM DD, YYYY")}),e("span",{className:"text-xs text-muted",children:"→ Select end date"})]}):e("span",{className:"text-muted text-xs",children:p?.placeholder||p?.name||r||"Select date range"}):a?xe(a).format("MMMM DD, YYYY"):"Pick a date"}),t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:v,onChange:x,selectRange:!0,returnValue:"range",maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(v[0]){const e=v[0].getTime();if(v[1]){const n=v[1].getTime();if(t===e)return"bg-primary text-primary-foreground rounded-l-md font-semibold";if(t===n)return"bg-primary text-primary-foreground rounded-r-md font-semibold";if(t>e&&t<n)return"bg-primary/20 text-primary font-medium"}else if(t===e)return"bg-primary text-primary-foreground rounded-md font-semibold"}}return""}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),e("div",{className:"border-t pt-2",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:o,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{if(d[0]){const e=new Date(d[0]),t=d[1]?new Date(d[1]):new Date(d[0]);e.setHours(0,0,0,0),t.setHours(23,59,59,999);const n=[];n.push({value:e.toISOString(),label:xe(e).format("LLL dd, y")}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:xe(t).format("LLL dd, y")}),s([...l,{name:r||"",placeholder:p?.placeholder,value:n,type:p?.type||"date",multiple:p?.multiple||!1}]),o()}},disabled:!v[0],children:"Apply"})]})})]}):e(n,{children:t("div",{className:"calendar-wrapper",children:[e("style",{children:tr}),e(be,{value:a,onChange:x,selectRange:!1,maxDate:g,className:"mb-2 border-0",tileClassName:({date:e,view:t})=>{if("month"===t){const t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return"text-muted/20 cursor-not-allowed";if(a&&t===a.getTime())return"bg-primary text-primary-foreground rounded-md font-semibold"}return""}})]})})})}function cr({selectedView:n,commandInput:r,setFilters:a,handleClose:i,filterGroups:s}){const[l,o]=$([]);if(!n)return null;const c=(e=>{const t=s.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){const e=r.toLowerCase();return n.filter(n=>void 0!==n.value&&t.filterBy(n.value,e))}const a=r.toLowerCase();return n.filter(e=>String(e.value||"").toLowerCase().includes(a))})(n),d=s.find(e=>e.name===n);return t("div",{className:"flex flex-col h-full",children:[e("div",{className:"flex items-center p-1.5 text-xs text-muted shrink-0",children:e("span",{children:d?.placeholder||d?.name})}),e("div",{className:"flex-1 overflow-hidden min-h-0",children:e("div",{className:"max-h-[200px] overflow-y-auto",children:c.length>0&&c.map(r=>{const s=l.some(e=>e.value===r.value);return t(Rn,{className:"group flex gap-2 items-center w-full hover:bg-muted "+(d?.multiple&&s?"bg-muted":""),onSelect:()=>(e=>{const t={value:e.value,label:e.label};if(d?.multiple){const n=l.some(t=>t.value===e.value);o(n?t=>t.filter(t=>t.value!==e.value):e=>[...e,t])}else a(e=>{const r=e.findIndex(e=>e.name===n);if(r>=0){const n=[...e];return n[r]={...n[r],value:[t]},n}return[...e,{name:n||"",placeholder:d?.placeholder||"",value:[t],type:d?.type||"select",multiple:d?.multiple||!1}]}),i()})(r),children:[e(Qn,{value:r.value||"",labelRenderer:r.labelRenderer||d?.labelRenderer,fallbackLabel:r.label}),d?.multiple&&s&&e("span",{className:"ml-auto text-xs text-success",children:"✓"})]},r.value||`option-${Math.random()}`)})})}),d?.multiple&&e("div",{className:"p-2 border-t shrink-0",children:t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:i,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{l.length>0&&a(e=>[...e.filter(e=>e.name!==n),{name:n||"",placeholder:d?.placeholder||"",value:l,type:d?.type||"select",multiple:d?.multiple||!1}]),i()},disabled:0===l.length,children:"Apply"})]})})]})}function dr({selectedView:n,setFilters:r,handleClose:a,filterGroups:i}){const[s,l]=$([]),o=i.find(e=>e.name===n);return t("div",{className:"p-2 space-y-3",children:[e("div",{className:"space-y-2",children:e(gt,{value:s,onChange:l,placeholder:o?.placeholder||`Add ${n}...`,autoFocus:!0})}),t("div",{className:"flex gap-2 justify-end",children:[e(_t,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e(_t,{size:"sm",onClick:()=>{s.length>0&&r(e=>[...e.filter(e=>e.name!==n),{name:n,placeholder:o?.placeholder,value:s,type:"stringList"}]),a()},disabled:0===s.length,children:"Apply"})]})]})}const ur=O.createContext({}),mr=({filters:t,setFilters:n,filterGroups:r,children:a})=>{const i=new URL(window.location.href).searchParams,[s]=O.useState(()=>new URLSearchParams(window.location.search).get("filters")),l=O.useRef(new Set),o=O.useRef(!s);return A(()=>{if(o.current)try{const e=new URLSearchParams(i.toString());if(t.length>0){const n=t.map(e=>{let t;if("stringList"===e.type&&Array.isArray(e.value)&&"string"==typeof e.value[0])t=`[${e.value.map(e=>encodeURIComponent(e)).join(",")}]`;else if(Array.isArray(e.value))if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(e.value||e||"")).join(",")}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(e.value||e||"")).join(",")}]`;else{const n=e.value[0];t="string"==typeof n?encodeURIComponent(n):"object"==typeof n&&void 0!==n?.value?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||""))}else t=encodeURIComponent(e.value||"");return`${encodeURIComponent(e.name)}:${t}`}).join(";");e.set("filters",n)}else e.delete("filters");const n=`${window.location.pathname}?${e.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},"",n)}catch(e){console.error("Failed to update URL with filters:",e)}},[t]),A(()=>{if(s&&0!==r.length)try{const e=s.split(";"),t=[];for(const n of e){const[e,a]=n.split(":"),i=decodeURIComponent(e);if(l.current.has(i))continue;const s=r.find(e=>e.name===i);if(!s)continue;let o,c;if(l.current.add(i),a.startsWith("[")&&a.endsWith("]")){const e=a.slice(1,-1);o=e?e.split(",").map(e=>decodeURIComponent(e)):[]}else o=[decodeURIComponent(a)];c="stringList"===s.type?o:"text"===s.type?1===o.length?[{value:o[0],label:o[0]}]:o.map(e=>({value:e,label:e})):o.map(e=>{const t=s.options?.find(t=>t.value===e);let n=e;return t?.label?n=String(t.label):t?.labelRenderer?n=String(t.labelRenderer(e)):s.labelRenderer&&(n=String(s.labelRenderer(e))),{value:e,label:n}}),!s.multiple||a.startsWith("[")||a.endsWith("]")||("stringList"===s.type?c=o:Array.isArray(c)||(c=[c])),t.push({name:i,type:s.type,placeholder:s.placeholder,value:c,multiple:s.multiple})}t.length>0&&n(e=>[...e,...t]),o.current=!0}catch(e){}},[r,s]),e(ur.Provider,{value:{filters:t,setFilters:n,filterGroups:r},children:a})},hr=({className:n})=>{const{filters:r,setFilters:a,filterGroups:i}=O.useContext(ur),[s,l]=O.useState(!1),[o,c]=O.useState(null),[d,u]=O.useState(""),m=O.useRef(null),[h,p]=O.useState(),[f,g]=O.useState(""),v=()=>{l(!1),setTimeout(()=>{c(null),u(""),p(void 0)},200)};return t(xn,{_open:s,onOpenChange:e=>{l(e),e||setTimeout(()=>{c(null),u(""),g("")},200)},children:[e(yn,{asChild:!0,children:t(_t,{variant:"outline",role:"combobox","aria-expanded":s,size:"md",className:Qe("transition group flex gap-1.5",n),children:[e(T,{className:"size-4 shrink-0 transition-all text-muted"}),"Filter"]})}),e(Nn,{className:"w-[300px] p-0",align:"start",sideOffset:4,children:t(kn,{children:["select"===i.find(e=>e.name===o)?.type&&e(zn,{placeholder:o?`Filter by ${o}`:"Filter...",className:"h-9 ring-0",value:d,onValueChange:e=>{u(e)},ref:m,autoFocus:!0}),t(In,{children:[e(Tn,{children:"No matching filters"}),e(Ln,{children:o?(()=>{if(!o)return null;const t=i.find(e=>e.name===o)?.type;switch(t){case"date":return e(or,{selectedView:o,selectedDate:h,setSelectedDate:p,setFilters:a,filters:r,handleClose:v,filterGroups:i});case"text":return e(lr,{selectedView:o,textValue:f,setTextValue:g,setFilters:a,handleClose:v,filterGroups:i});case"stringList":return e(dr,{selectedView:o,setFilters:a,handleClose:v,filterGroups:i});default:return e(cr,{selectedView:o,commandInput:d,setFilters:a,handleClose:v,filterGroups:i})}})():(()=>{let t=i.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>"date"===n.type?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&"string"==typeof n.value[0]?n.value.some(e=>e===t.value):n.value.some(e=>e.value===t.value))))})).filter(e=>(e.options??[]).length>0||"date"===e.type&&!r.some(t=>t.name===e.name)||"text"===e.type&&!r.some(t=>t.name===e.name)||"stringList"===e.type&&!r.some(t=>t.name===e.name));return 0===t.length?e(Tn,{children:"No available filters"}):t.map((t,n)=>e(Rn,{onSelect:()=>{return e=t.name,c(e),u(""),void m.current?.focus();var e},className:"group flex gap-2 items-center hover:bg-muted",children:e("span",{children:t.placeholder??t.name})},n))})()})]})]})})]})},pr=({className:t})=>{const{filters:n,setFilters:r,filterGroups:a}=O.useContext(ur);return e("div",{className:Qe(t),children:e(sr,{filters:n,setFilters:r,filterGroups:a})})},fr=({className:t})=>{const{filters:n,setFilters:r}=O.useContext(ur);return n.filter(e=>e.value?.length>0).length>0?e(_t,{variant:"outline",size:"xs",className:Qe("transition group",t),onClick:()=>r([]),children:"Clear All"}):null};var gr;!function(e){e.IS="is",e.IS_NOT="is_not",e.CONTAINS="contains",e.BEFORE="before",e.AFTER="after",e.IS_ANY_OF="is_any_of"}(gr||(gr={}));const vr=F(({className:t,level:n=3,...r},a)=>e(`h${n}`,{ref:a,className:Qe({h1:"text-2xl font-medium tracking-tight",h2:"text-xl font-medium tracking-tight",h3:"text-lg font-medium",h4:"text-base font-medium",h5:"text-sm font-medium",h6:"text-xs font-medium"}[`h${n}`],"mb-2",t),...r}));vr.displayName="Heading";const xr=se("text-foreground",{variants:{size:{xl:"text-base md:text-lg leading-relaxed",lg:"text-base leading-relaxed",default:"text-sm leading-normal",sm:"text-sm leading-normal",xs:"text-xs leading-normal"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold"}},defaultVariants:{size:"default",weight:"normal"}}),br=F(({className:t,size:n,weight:r,...a},i)=>e("p",{ref:i,className:Qe(xr({size:n,weight:r,className:t})),...a}));function yr({className:t,...n}){return e(ye.PanelGroup,{"data-slot":"resizable-panel-group",className:Qe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...n})}function wr({...t}){return e(ye.Panel,{"data-slot":"resizable-panel",...t})}function Nr({withHandle:t,className:n,...r}){return e(ye.PanelResizeHandle,{"data-slot":"resizable-handle",className:Qe("bg-muted 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),...r,children:t&&e("div",{className:"z-10 flex size-4 items-center justify-center rounded-xs font-semibold",children:e(L,{className:"size-4 rotate-90"})})})}function Cr({className:t,minLines:n,maxLines:r,value:a,...i}){const s=D(null),l=void 0!==n||void 0!==r,o=V(()=>{const e=s.current;if(!e)return;const t=getComputedStyle(e),a=parseFloat(t.lineHeight)||1.5*parseFloat(t.fontSize),i=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),l=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),o=r??1/0,c=(n??1)*a+i+l,d=o===1/0?1/0:o*a+i+l;e.style.height="auto";const u=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${u}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?"auto":"hidden"},[n,r]);return Y(()=>{l&&o()},[a,l,o]),e("textarea",{ref:s,"data-slot":"textarea",value:a,className:Qe("py-2 text-sm","flex w-full rounded-md border border-input bg-background ring-offset-background","placeholder:text-muted focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",l&&"resize-none",t),...i})}function kr({icon:n,status:r,title:a,children:i,className:s}){let l,o,c,u;switch(r){case"error":l=e(b,{className:"size-5 text-destructive","aria-hidden":"true"}),o="",c="text-foreground",u="bg-destructive border border-destructive";break;case"warning":l=e(x,{className:"size-5 text-attention","aria-hidden":"true"}),o="",c="text-foreground",u="bg-attention border border-attention";break;case"success":l=e(y,{className:"size-5 text-success","aria-hidden":"true"}),o="",c="text-foreground",u="bg-success border border-success";break;case"info":l=e(d,{className:"size-5 text-info","aria-hidden":"true"}),o="",c="text-foreground",u="bg-info border border-info";break;case"default":l=e(d,{className:"size-5 text-muted","aria-hidden":"true"}),o="",c="text-foreground",u="bg-muted border border-muted";break;case"done":l=e(d,{className:"size-5 text-done","aria-hidden":"true"}),o="",c="text-foreground",u="bg-done border border-done"}return e("div",{className:`rounded-md p-4 ${u} ${s}`,children:t("div",{className:"flex",children:[e("div",{className:"shrink-0",children:n??l}),t("div",{className:"w-full ml-2 px-1",children:[a&&e("h3",{className:`text-sm font-medium mb-2 ${o}`,children:a}),e("div",{className:`text-sm ${c} break-words`,children:i})]})]})})}function _r({title:t,className:n,children:r}){return e(kr,{status:"error",title:t,className:n,children:e("pre",{className:"whitespace-pre-wrap break-words",children:r})})}function zr({title:t,className:n,children:r}){return e(kr,{status:"info",title:t,className:n,children:r})}function Ir({title:t,className:n,children:r}){return e(kr,{status:"warning",title:t,className:n,children:r})}function Tr({title:t,className:n,children:r}){return e(kr,{status:"success",title:t,className:n,children:r})}function Lr({title:t,className:n,children:r}){return e(kr,{status:"default",title:t,className:n,children:r})}function Mr({children:n,action:r,title:a,description:i,footer:s,className:l,collapsible:c,defaultCollapsed:u=!1}){const[m,h]=$(u);return t("div",{className:`p-4 flex flex-col gap-2 rounded-sm border bg-card ${l}`,children:[t("div",{className:"flex items-center justify-between",children:[t("div",{className:"flex items-center gap-2",children:[e("div",{className:"font-semibold text-lg",children:a}),i&&e(lt,{description:i,children:e(d,{className:"size-4 text-muted"})})]}),t("div",{className:"flex gap-2 items-center",children:[r,c&&e(_t,{variant:"ghost",size:"icon",onClick:()=>h(!m),children:e(m?o:M,{className:"size-4"})})]})]}),!m&&n,s&&e("div",{className:"border-t border-muted flex flex-col-2 text-sm pt-4",children:s})]})}br.displayName="Text";function Rr(t,n){return{label:String(t),check:e(n?l:"div",{className:"size-4"}),reverse:!1,className:"flex-1 px-2 py-2 hover:bg-accent nowrap"}}function Or({value:n,options:a,onChange:i,className:s,optionLayout:l,by:o,noCheck:c,filterBy:d}){const[u,m]=$(n),[h,p]=$(""),f=e=>{m(e),i(e)},g=j(()=>"string"==typeof o?(e,t)=>e[o]===t[o]:o||((e,t)=>e===t),[o]);return t("div",{className:r("",s),children:[d&&e(ft,{type:"text",placeholder:"Filter...",value:h,onChange:e=>p(e)}),a.map((t,n)=>{if(d&&!d(h)(t))return null;const r=!!u&&g(u,t);let a;return l?(a=l(t,r),a=Object.assign(Rr(t,r),a)):a=Rr(t,r),e(Sr,{option:t,onSelect:f,layout:a,noCheck:c},n)})]})}function Sr({option:n,onSelect:a,layout:i,noCheck:s}){return t("div",{className:r("group flex items-center cursor-pointer gap-x-2 hover:bg-muted",i.reverse&&"flex-row-reverse",i.className),onClick:()=>a(n),children:[s?null:e("div",{className:"",children:i.check}),e("div",{className:"flex-1",children:i.label})]})}function Dr({onSelect:a,selected:i,options:s}){return t(Q,{value:i,onChange:a,children:[e(Q.Label,{className:"sr-only",children:"Server size"}),e("div",{className:"space-y-4",children:s.map(a=>e(Q.Option,{value:a,className:({active:e})=>r(e?"border-border ring-2 ring-ring":"border-border","relative block cursor-pointer rounded-lg border bg-accent px-6 py-4 shadow-2xs focus:outline-hidden sm:flex sm:justify-between"),children:({active:i,checked:s})=>t(n,{children:[e("span",{className:"flex items-center",children:t("span",{className:"flex flex-col text-sm",children:[e(Q.Label,{as:"span",className:"font-medium text-text",children:a.label}),a.description&&e(Q.Description,{as:"span",className:"text-muted-foreground",children:a.description})]})}),e("span",{className:r(i?"border":"border-2",s?"border-accent-foreground":"border-transparent","pointer-events-none absolute -inset-px rounded-lg"),"aria-hidden":"true"})]})},a.id))})]})}function $r({isOpen:n,title:r,onClose:a,children:i,panelWidth:s=768,backdrop:l=!1,side:o="right",resizable:c=!0,className:d}){const[u,m]=$(s),h="left"===o,p=h?"left-0":"right-0",f=h?"pr-10 sm:pr-16":"pl-10 sm:pl-16",g=h?"border-r":"border-l",v=h?"-right-1":"-left-1",x=h?"-100%":"100%";return e(oe,{children:n&&t("div",{className:"relative z-20",children:[l&&e(le.div,{className:"fixed inset-0 bg-black/70",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),e("div",{className:`fixed inset-y-0 ${p} overflow-hidden`,children:e("div",{className:"absolute inset-0 overflow-hidden",children:e("div",{className:`pointer-events-none fixed inset-y-0 ${p} flex max-w-full ${f}`,children:e(le.div,{className:`pointer-events-auto ${g}`,style:{width:`${u}px`},initial:{x:x},animate:{x:0},exit:{x:x},transition:{type:"spring",stiffness:300,damping:30},children:t("div",{className:"relative flex h-full",children:[c&&e("div",{className:`absolute ${v} top-0 bottom-0 w-3 cursor-ew-resize hover:bg-indigo-500 transition-colors flex items-center justify-center`,onMouseDown:e=>{e.preventDefault();let t=!0;const n=e.pageX,r=u,a=e=>{if(t){const t=n-e.pageX,a=Math.max(r+t,480);m(a)}},i=()=>{t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",i)},children:e(L,{className:"rotate-90 font-semibold",strokeWidth:4})}),t("div",{className:`flex-1 flex flex-col bg-background shadow-xl ${d}`,children:[r&&e("div",{className:"sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b",children:t("div",{className:"flex items-start justify-between",children:[e("h2",{className:"w-full text-base font-semibold leading-6",children:e("div",{className:"text-2xl",children:r??""})}),e("div",{className:"ml-3 flex h-7 items-center",children:e(Ar,{onClose:a})})]})}),e("div",{className:"flex-1 overflow-y-auto px-2 sm:px-4 py-4",children:i})]})]})})})})})]})})}function Ar({onClose:t}){return e(_t,{alt:"Close panel",variant:"ghost",onClick:t,children:e(u,{className:"size-6","aria-hidden":"true"})})}function Er({size:a,className:i}){const s=function(e){switch(e){case"xs":return"size-2";case"sm":return"size-3";case"md":return"size-4";case"lg":return"size-5";case"xl":return"size-7";case"2xl":return"size-10";default:throw new Error("Unexpected size: "+e)}}(a||"md");return e(n,{children:t("svg",{className:r("animate-[spin_0.8s_linear_infinite] text-indigo-500",s,i),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e("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"})]})})}const Pr={sm:["h-5 w-8","size-3","translate-x-4"],md:["h-6 w-11","size-4","translate-x-6"],lg:["h-8 w-16","size-6","translate-x-9"]};function Fr({value:n,onChange:r,size:a="md",children:i,className:s,disabled:l}){const o=Pr[a];return t(ee,{checked:n,onChange:()=>r(!n),disabled:l,className:`flex items-center ${s} ${l?"cursor-not-allowed opacity-50":"hover:cursor-pointer"}`,children:[e("div",{className:`${n?"bg-primary":"bg-muted/50"} relative inline-flex ${o[0]} items-center rounded-full border-1`,children:e("span",{className:`${n?o[2]:"translate-x-1"} inline-block ${o[1]} transform rounded-full bg-white transition`})}),i&&e("span",{className:"px-2",children:i})]})}function jr({className:t,children:n,...a}){return e("table",{className:r("\ndivide-y divide-border\n[&>tbody]:divide-y [&>tbody]:divide-border\n[&_th]:text-left [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted-foreground\n[&_td]:px-3 [&_td]:py-4 [&_td]:text-sm\n",t),...a,children:n})}function Vr({children:t}){return e("thead",{className:"sticky top-0 bg-background z-10 after:absolute after:bottom-0 after:left-0 after:w-full after:h-px after:bg-muted/20",children:t})}function Yr({columns:t}){return e("tr",{className:"hover:bg-muted",children:Array(t).fill(0).map((t,n)=>e("td",{children:e("div",{className:"animate-pulse rounded-xs h-5 bg-muted"})},n))})}function Br({isLoading:t=!1,columns:n,rows:r=3,children:a}){return e("tbody",{children:t?Array(r).fill(0).map((t,r)=>e(Yr,{columns:n},r)):a})}function Hr({className:t,children:n,...a}){return e("tr",{className:r("hover:bg-muted hover:cursor-pointer",t),...a,children:n})}function Wr({options:a,value:i,onChange:s,onOptionsChange:l,placeholder:o,className:c,disabled:d,layout:m="horizontal",creatable:h=!1,createText:p='Create "%value%"',maxDropdownHeight:f=200}){const g=E(vn),[v,x]=$(""),[b,y]=$(0),[w,N]=$(0),[C,k]=$(null),_=D(null),z=D(null),I=D(null),T=D(null),L=g?.open??!1,M=g?.setOpen??(()=>{});A(()=>{const e=z.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect().width;N(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);const R=a.filter(e=>!i.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),O=h&&v&&!i.includes(v)&&!a.includes(v),S=R.length+(O?1:0);A(()=>{y(0)},[v,O]),A(()=>{""!==v&&k(null)},[v]),A(()=>{L&&T.current&&I.current&&T.current.scrollIntoView({block:"nearest",behavior:"smooth"})},[b,L]),A(()=>{L?_.current?.focus():x("")},[L]);const P=e=>{s([...i,e]),x(""),M(!1),y(0),k(null)},F=e=>{s([...i,e]),l&&!a.includes(e)&&l([...a,e]),x(""),M(!1),y(0),k(null)},j=(e,t)=>{t.stopPropagation(),s(i.filter(t=>t!==e)),k(null)};return t("div",{className:r("relative",c),children:[e(yn,{asChild:!0,children:t("div",{ref:z,className:r("min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2","flex items-center gap-1","horizontal"===m?"flex-wrap":"flex-col items-stretch","cursor-text","ring-offset-background",d&&"opacity-50 cursor-not-allowed",L?"ring-1 ring-inset ring-ring":""),onClick:()=>{d||_.current?.focus()},children:["vertical"===m&&i.length>0&&e("div",{className:"flex flex-col gap-1 w-full",children:i.map((n,a)=>t("span",{className:r("inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-primary/10 text-primary rounded-md w-full transition-all",C===a&&"ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]"),children:[e("span",{className:"truncate",children:n}),e("button",{type:"button",onClick:e=>j(n,e),disabled:d,className:"hover:bg-primary/20 rounded-sm transition-colors flex-shrink-0",children:e(u,{className:"h-3 w-3"})})]},n))}),"horizontal"===m&&i.map((n,a)=>t("span",{className:r("inline-flex items-center gap-1 px-2 py-1 text-sm bg-primary/10 text-primary rounded-md transition-all",C===a&&"ring-2 ring-red-300 shadow-[0_0_8px_rgba(252,165,165,0.5)]"),children:[n,e("button",{type:"button",onClick:e=>j(n,e),disabled:d,className:"hover:bg-primary/20 rounded-sm transition-colors",children:e(u,{className:"h-3 w-3"})})]},n)),e("input",{ref:_,type:"text",value:v,onChange:e=>x(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&L&&S>0)return e.preventDefault(),e.stopPropagation(),void(b===R.length&&O?F(v):b<R.length&&P(R[b]));if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),void(L?y(e=>e<S-1?e+1:e):M(!0));if("ArrowUp"===e.key)return e.preventDefault(),e.stopPropagation(),void(L?y(e=>e>0?e-1:0):M(!0));if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),void M(!1);if("Backspace"===e.key&&""===v&&i.length>0){e.stopPropagation();const t=i.length-1;return void(C===t?(s(i.slice(0,-1)),k(null)):k(t))}L||1!==e.key.length||M(!0)},onClick:e=>{e.stopPropagation(),d||M(!0)},onFocus:()=>{d||M(!0)},disabled:d,placeholder:0===i.length?o:"",className:r("flex-1 min-w-[120px] bg-transparent text-sm","placeholder:text-muted-foreground","border-none outline-none focus:outline-none focus:ring-0 p-0 m-0","vertical"===m&&"w-full")})]})}),e(Nn,{style:{width:`${w}px`},className:"p-0 bg-popover border border-border shadow-lg",align:"start",side:"bottom",onOpenAutoFocus:e=>{e.preventDefault()},children:e("div",{ref:I,className:"overflow-y-auto",style:{maxHeight:`${f}px`},children:0!==R.length||O?t(n,{children:[R.length>0&&e("ul",{className:"py-1",children:R.map((t,n)=>e("li",{ref:e=>{n===b&&(T.current=e)},onClick:()=>P(t),onMouseEnter:()=>y(n),className:r("px-3 py-2 text-sm cursor-pointer transition-colors",n===b?"bg-blue-500/20 text-foreground":"hover:bg-accent/50"),children:t},t))}),O&&t(n,{children:[R.length>0&&e("div",{className:"border-t border-border"}),e("div",{ref:e=>{b===R.length&&(T.current=e)},onClick:()=>F(v),onMouseEnter:()=>y(R.length),className:r("px-3 py-2 text-sm cursor-pointer transition-colors text-primary",b===R.length?"bg-blue-500/20":"hover:bg-accent/50"),children:p.replace("%value%",v)})]})]}):e("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:v?"No options found":"No more options available"})})})]})}function Ur(t){return e(xn,{click:!0,children:e(Wr,{...t})})}class Gr{_value;watchers=[];name;constructor(e,t){this._value=e,this.name=t}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}}function Kr(e){const t=O.createContext(void 0);return e.Context=t,t.Provider}class Jr{consume=void 0;_current;constructor(e){this._current=e}set current(e){e!==this._current&&(this._current=e,this.consume?.(e))}get current(){return this._current}withConsumer(e){return this.consume=e,e&&e(this.current),this}}function Zr(e){const t=e.Context;if(!t)throw new Error("Context not defined for "+e.name);return E(t)}function qr(e){const[t,n]=$(e.value);return A(()=>e.watch(e=>{n("function"==typeof e?()=>e:e)}),[e]),t}function Xr(e,t){return A(()=>(e.value=t,()=>{e.value=void 0}),[e,t]),t}function Qr(e,t){A(()=>e.watch(t),[e,t])}function ea(e){const[t,n]=$(e.current);return A(()=>(e.withConsumer(n),()=>{e.withConsumer(void 0)}),[e]),t}function ta(e,t){A(()=>(e.withConsumer(t),()=>{e.withConsumer(void 0)}),[e,t])}function na(e,t){A(()=>(e.current=t,()=>{e.current=void 0}),[e,t])}class ra{compute;_value;watchers=[];unsubscribers=[];name;constructor(e,t,n){this.compute=e,this.name=n,this.recalculate();for(const e of t)this.unsubscribers.push(e.watch(()=>this.recalculate()))}recalculate(){const e=this.compute();if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}get value(){return this._value}watch(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}dispose(){for(const e of this.unsubscribers)e();this.watchers=[]}}class aa{_value;watchers=[];constructor(e){this._value=e}get value(){return this._value}set value(e){if(e!==this._value){this._value=e;for(const t of this.watchers)t(e)}}addWatcher(e){return this.watchers.push(e),()=>{this.watchers=this.watchers.filter(t=>t!==e)}}}function ia(e){const[t,n]=$(e.value);return A(()=>e.addWatcher(e=>{n("function"==typeof e?()=>e:e)}),[e]),t}function sa(e,t){const n=D(null);return A(()=>{const r=r=>{n.current&&!n.current.contains(r.target)&&(t&&t(r)||e(r))};return window.setTimeout(()=>{document.addEventListener("click",r)},0),()=>{document.removeEventListener("click",r)}},[]),n}function la(){const[e,t]=$(null);return[e,async e=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(e),t(e),!0}catch(e){return console.warn("Copy failed",e),t(null),!1}}]}function oa(e){A(()=>{const t=window.matchMedia("(prefers-color-scheme: dark)"),n=t=>e(t.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)},[])}function ca(e,t){const[n,r]=$(e);return A(()=>{const n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}function da(e,t,n){const r=[],a=new EventSource(e);return a.addEventListener("message",e=>{const n=JSON.parse(e.data);n&&(r.push(n),t(r.join("")))}),a.addEventListener("close",e=>{a.close();const t=JSON.parse(e.data);n(t)}),()=>{a.close()}}function ua(e,t,n){A(()=>{"function"==typeof e?e().then(e=>da(e,t,n)):da(e,t,n)},[e])}function ma(e,t){Array.isArray(t)&&(t={deps:t});const n=t||{},[r,a]=$(null),[i,s]=$(!1),[l,o]=$(n.defaultValue),c=()=>(n.start&&n.start(),s(!0),e().then(e=>{o(e),n.onSuccess&&n.onSuccess(e)}).catch(e=>{a(e),n.onError&&n.onError(e)}).finally(()=>{s(!1),n.end&&n.end()}));return A(()=>{n.condition&&!n.condition()||c()},n.deps),{data:l,isLoading:i,error:r,setData:o,refetch:c}}function ha(e,t){return!t||Array.isArray(t)?t={deps:[]}:t&&(t.deps=[]),ma(e,t)}function pa(e=!1){const[t,n]=$(e);return{isOn:t,isOff:!t,set:e=>n(e),on:()=>n(!0),off:()=>n(!1),toggle:()=>n(!t)}}function fa(e,t,n={}){A(()=>{const r=new IntersectionObserver(e=>{const r=e[0].isIntersecting;n.leave?r||t(e[0]):r&&t(e[0])},{threshold:n.threshold||1});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}},n.deps?n.deps.concat(e):[e])}function ga(){const e=D(!0);return A(t=>(t&&e.current&&t(),e.current=!1,()=>{e.current=!0}),[]),e.current}const va="undefined"!=typeof window?Y:A;function xa(e,t=[]){const n=e.pageSize||50,[r,a]=$(null),[i,s]=$(e.payload),[l,o]=$(null),[c,d]=$([]),[u,m]=$(null),[h,p]=$(!1),f=D(0),g=e=>{a(null),d([]),m(null),s(e)},v=()=>{null!==u&&a(u)};return A(()=>{f.current+=1;const t=f.current;p(!0),e.search(i,r,n).then(e=>{t===f.current&&(d(null===r?e.result:t=>[...t,...e.result]),m(e.nextPage),o(null))}).catch(e=>{t===f.current&&o(e)}).finally(()=>{t===f.current&&p(!1)})},[...t,i,r]),re(e.nextPageTrigger,()=>{!h&&u&&v()},{threshold:.1,deps:[u,h]}),{search:g,refresh:()=>g(i),searchMore:v,result:c,page:r,hasMore:null!==u,error:l,isSearching:h}}function ba(e,t=[]){return xa({...e,async search(t,n,r){const a=n??0,i=a*r,s=await e.search(t,i,r);return{result:s,nextPage:0===s.length?null:a+1}}},t)}class ya{state;constructor(e){this.state=e}get(){return this.state[0]}set(e){this.state[1](e)}}function wa(e){const t=$(e);return new ya(t)}function Na(...e){return ie(a(e))}export{qn as AnimateChangeInHeight,Ne as Avatar,dt as Badge,Bn as Breadcrumbs,_t as Button,Ft as Card,Bt as CardContent,Yt as CardDescription,Ht as CardFooter,jt as CardHeader,Vt as CardTitle,ke as Center,Xn as Checkbox,Fe as ComboBox,kn as Command,_n as CommandDialog,Tn as CommandEmpty,Ln as CommandGroup,zn as CommandInput,Rn as CommandItem,In as CommandList,Mn as CommandSeparator,On as CommandShortcut,ra as ComputedProperty,on as ConfirmModal,zt as CopyButton,Se as DOMPopup,nr as DateCombobox,Lr as DefaultBox,fn as DeleteModal,Qt as Dialog,nn as DialogClose,an as DialogContent,sn as DialogDescription,rn as DialogOverlay,tn as DialogPortal,ln as DialogTitle,en as DialogTrigger,We as Divider,ht as DotBadge,qe as DropZone,Ue as Dropdown,Ke as DropdownList,Je as EmptyCollection,_r as ErrorBox,Ze as FileUploadInput,pr as FilterBar,hr as FilterBtn,fr as FilterClear,gr as FilterOperator,mr as FilterProvider,ot as FormItem,vr as Heading,zr as InfoBox,ft as Input,gt as InputList,Yn as Label,vt as Link,Ge as MenuItem,xt as MenuList,kr as MessageBox,Jt as Modal,qt as ModalBody,Kt as ModalContextProvider,Xt as ModalFooter,Zt as ModalTitle,Et as ModeOption,Pt as ModeToggle,Ct as NumberInput,$e as OptionAdapter,It as Overlay,Mr as Panel,xn as Popover,wn as PopoverAnchor,Cn as PopoverClose,Nn as PopoverContent,vn as PopoverContext,yn as PopoverTrigger,De as Popup,Me as PopupController,Lt as Portal,tt as PortalContainerProvider,Gr as Property,Rt as RadioGroup,Mt as RadioOptionAdapter,Nr as ResizableHandle,wr as ResizablePanel,yr as ResizablePanelGroup,Yr as RowSkeleton,Sn as SelectBox,Or as SelectList,Dr as SelectStack,er as SelectionCombobox,gn as Separator,aa as SharedState,ya as SharedValue,$r as SidePanel,Jr as Slot,Er as Spinner,ar as StringListCombobox,Ae as StringOptionAdapter,Ee as StringOptionAdapterWithCreate,wt as Styles,Tr as SuccessBox,Ce as SvgAvatar,Fr as Switch,Br as TBody,Vr as THead,Hr as TR,jr as Table,$n as Tabs,An as TabsBar,jn as TabsContent,Pn as TabsList,En as TabsPanel,Fn as TabsTrigger,Ur as TagsInput,br as Text,rr as TextCombobox,Cr as Textarea,$t as ThemeProvider,Dt as ThemeProviderContext,dn as ToastContext,pn as ToastProvider,at as Tooltip,st as TooltipContent,rt as TooltipProvider,it as TooltipTrigger,lt as VTooltip,Ir as WarningBox,kt as buttonVariants,Na as cn,Ie as computePosition,Kr as createCompositeStateProvider,Pe as getDefaultComboBoxLayout,sa as useClickOutside,Be as useComboboxCtrl,Zr as useCompositeState,la as useCopyToClipboard,oa as useDarkMode,ca as useDebounce,ba as useDefaultScrollableSearch,na as useDefineSlot,Xe as useDropZone,ua as useEventSource,ma as useFetch,ha as useFetchOnce,pa as useFlag,qr as useGetCompositeStateProperty,fa as useIntersectionObserver,ga as useIsFirstRendering,Gt as useIsInModal,Oe as usePopupController,nt as usePortalContainer,va as useSafeLayoutEffect,xa as useScrollableSearch,Xr as useSetCompositeStateProperty,wa as useSharedValue,ea as useSlot,At as useTheme,cn as useToast,Qr as useWatchCompositeStateProperty,ia as useWatchSharedState,ta as useWatchSlot};
2
2
  //# sourceMappingURL=vertesia-ui-core.js.map