@vertesia/ui 1.5.0-dev.20260910.052912Z → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/components/Link.js +1 -1
- package/lib/core/components/Link.js.map +1 -1
- package/lib/core/components/Spinner.js +1 -1
- package/lib/core/components/Spinner.js.map +1 -1
- package/lib/core/components/TagsInput.js +7 -7
- package/lib/core/components/TagsInput.js.map +1 -1
- package/lib/core/components/shadcn/badge.js +1 -1
- package/lib/core/components/shadcn/badge.js.map +1 -1
- package/lib/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/core/components/shadcn/button.js +2 -2
- package/lib/core/components/shadcn/button.js.map +1 -1
- package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js +2 -2
- package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -1
- package/lib/core/components/shadcn/filters/comboBox/SelectCombobox.js +1 -1
- package/lib/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -1
- package/lib/core/components/shadcn/filters/comboBox/StringListCombobox.js +1 -1
- package/lib/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -1
- package/lib/core/components/shadcn/filters/comboBox/TextCombobox.js +1 -1
- package/lib/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -1
- package/lib/core/components/shadcn/filters/filter/dateFilter.js +1 -1
- package/lib/core/components/shadcn/filters/filter/dateFilter.js.map +1 -1
- package/lib/core/components/shadcn/filters/filters.js +1 -1
- package/lib/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/core/components/shadcn/overflowTabs.js +2 -2
- package/lib/core/components/shadcn/overflowTabs.js.map +1 -1
- package/lib/core/components/shadcn/tabs.js +1 -1
- package/lib/core/components/shadcn/tabs.js.map +1 -1
- package/lib/features/activity-doc/ActivityDoc.js +1 -1
- package/lib/features/activity-doc/ActivityDoc.js.map +1 -1
- package/lib/features/agent/chat/AskUserWidget.d.ts +1 -0
- package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
- package/lib/features/agent/chat/AskUserWidget.js +15 -4
- package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +5 -3
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +3 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/features/layout/GenericPageNavHeader.js +1 -1
- package/lib/features/layout/GenericPageNavHeader.js.map +1 -1
- package/lib/features/magic-pdf/AnnotatedImageSlider.js +1 -1
- package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionView.js +3 -3
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
- package/lib/features/store/objects/DocumentPreviewPanel.js +5 -5
- package/lib/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/features/store/objects/components/DocumentInput.js +1 -1
- package/lib/features/store/objects/components/DocumentInput.js.map +1 -1
- package/lib/features/store/objects/upload/DocumentUploadModal.js +1 -1
- package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/features/user/UserInfo.d.ts +2 -0
- package/lib/features/user/UserInfo.d.ts.map +1 -1
- package/lib/features/user/UserInfo.js +1 -1
- package/lib/features/user/UserInfo.js.map +1 -1
- package/lib/router/RouteComponent.d.ts.map +1 -1
- package/lib/router/RouteComponent.js +15 -12
- package/lib/router/RouteComponent.js.map +1 -1
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +4 -0
- package/lib/session/UserSession.js.map +1 -1
- package/lib/shell/SplashScreen.js +1 -1
- package/lib/shell/SplashScreen.js.map +1 -1
- package/lib/vertesia-ui-core.js +3 -3
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +32 -32
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +2 -2
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/json-view/JSONCode.js +1 -1
- package/lib/widgets/json-view/JSONCode.js.map +1 -1
- package/lib/widgets/upload/DropZone.d.ts.map +1 -1
- package/lib/widgets/upload/DropZone.js +1 -1
- package/lib/widgets/upload/DropZone.js.map +1 -1
- package/package.json +7 -7
- package/src/core/components/Link.tsx +1 -1
- package/src/core/components/Spinner.tsx +1 -1
- package/src/core/components/TagsInput.tsx +7 -7
- package/src/core/components/shadcn/badge.tsx +1 -1
- package/src/core/components/shadcn/button.tsx +2 -3
- package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +2 -2
- package/src/core/components/shadcn/filters/comboBox/SelectCombobox.tsx +1 -1
- package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +1 -1
- package/src/core/components/shadcn/filters/comboBox/TextCombobox.tsx +1 -1
- package/src/core/components/shadcn/filters/filter/dateFilter.tsx +1 -1
- package/src/core/components/shadcn/filters/filters.tsx +1 -1
- package/src/core/components/shadcn/overflowTabs.tsx +2 -2
- package/src/core/components/shadcn/tabs.tsx +1 -1
- package/src/css/utilities.css +7 -0
- package/src/features/activity-doc/ActivityDoc.tsx +1 -1
- package/src/features/agent/chat/AskUserWidget.test.tsx +24 -2
- package/src/features/agent/chat/AskUserWidget.tsx +19 -4
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +62 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +8 -7
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +4 -3
- package/src/features/layout/GenericPageNavHeader.test.tsx +36 -0
- package/src/features/layout/GenericPageNavHeader.tsx +1 -1
- package/src/features/magic-pdf/AnnotatedImageSlider.tsx +1 -1
- package/src/features/magic-pdf/GroundedExtractionView.tsx +3 -3
- package/src/features/permissions/UserPermissionsProvider.tsx +1 -1
- package/src/features/store/objects/DocumentPreviewPanel.tsx +10 -10
- package/src/features/store/objects/components/DocumentInput.tsx +1 -1
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +1 -1
- package/src/features/user/UserInfo.tsx +1 -1
- package/src/router/RouteComponent.test.tsx +65 -1
- package/src/router/RouteComponent.tsx +18 -15
- package/src/session/UserSession.test.ts +65 -0
- package/src/session/UserSession.ts +4 -0
- package/src/shell/SplashScreen.tsx +1 -1
- package/src/widgets/json-view/JSONCode.test.tsx +2 -2
- package/src/widgets/json-view/JSONCode.tsx +1 -1
- package/src/widgets/upload/DropZone.tsx +2 -4
package/lib/vertesia-ui-core.js
CHANGED
|
@@ -185,7 +185,7 @@ let n=p(({className:n,...r},i)=>f(je,{ref:i,iconNode:t,className:Ce(`lucide-${we
|
|
|
185
185
|
* This source code is licensed under the ISC license.
|
|
186
186
|
* See the LICENSE file in the root directory of this source tree.
|
|
187
187
|
*/
|
|
188
|
-
;function Qe(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}}function $e(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var et=class{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`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(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 Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=$e(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Qe(e.position);if(t!==e.position)return{...e,position:t}}return null}};function tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function nt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function rt(e,t,n,r){let i=new et(e.gap),a=i.computePosition(e,t,n),o=nt(a.rect,r,`x`),s=nt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new et(i.gap).computePosition(c,t,n),tt(a.rect,r)?a:null):null}function it(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function at(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=it(e[n].getBoundingClientRect(),t),!t)return null;return t}function ot(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function st(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)ot(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var ct=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=st(this.anchor,this.root),this.visibleClientRect=at(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw 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))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=rt(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let 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 lt=d(void 0);function ut(){let e=g(lt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function dt({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new ct({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(lt.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function ft({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(dt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function pt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var mt=class{filter(e,t){let 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}},ht=class e extends mt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},gt=class e extends ht{createItem(e){return e}static instance=new e};function _t(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary 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-info`,Input:yt,Menu:xt,Toggle:bt}}function vt({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(pt()),S=C(void 0),T=C(null),E=p?Object.assign(_t(d,u),p):_t(d,u),D=o.useRef(null),O=St({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(ft,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function yt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(Ze,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function bt({ctrl:e}){return e.isMenuOpen?t(Fe,{className:`w-4 h-4`}):t(Ne,{className:`w-4 h-4`})}function xt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function St(e){let[t,n]=w(new Ct(e));return _(()=>{t?.withState(n)},[t]),t}var Ct=class e{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,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}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){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&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;let 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(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:wt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Tt(this.highlightedIndex,e.length),!0)}}}};function wt(e,t){return(e+1)%t}function Tt(e,t){return(e-1+t)%t}function Et({options:e,creatable:n,...r}){let i=n?gt.instance:ht.instance;return t(vt,{adapter:i,items:e,...r})}function Dt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Ot=Object.defineProperty,kt=(e,t)=>Ot(e,`name`,{value:t,configurable:!0});function At(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}kt(At,`setRef`);function jt(...e){return t=>{let n=!1,r=e.map(e=>{let r=At(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():At(e[t],null)}}}}kt(jt,`composeRefs`);function R(...e){return a.useCallback(jt(...e),e)}kt(R,`useComposedRefs`);var Mt=Object.defineProperty,Nt=(e,t)=>Mt(e,`name`,{value:t,configurable:!0});function Pt(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];Ut(r)&&typeof qt==`function`&&(r=qt(r._payload)),a.Children.forEach(r,e=>{if(Vt(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ut(n)&&typeof qt==`function`&&(n=qt(n._payload)),o=Rt(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?Bt(o):void 0,u=R(n,l);if(!o){if(r||r===0)throw Error(s?Kt(e):Gt(e));return r}let d=zt(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Nt(Pt,`createSlot`);var Ft=Pt(`Slot`),It=Symbol.for(`radix.slottable`);function Lt(e){let t=Nt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=It,t}Nt(Lt,`createSlottable`);var Rt=Nt((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function zt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Nt(zt,`mergeProps`);function Bt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nt(Bt,`getElementRef`);function Vt(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===It}Nt(Vt,`isSlottable`);var Ht=Symbol.for(`react.lazy`);function Ut(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ht&&`_payload`in e&&Wt(e._payload)}Nt(Ut,`isLazyComponent`);function Wt(e){return typeof e==`object`&&!!e&&`then`in e}Nt(Wt,`isPromiseLike`);var Gt=Nt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Kt=Nt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),qt=a.use;function z(...e){return j(i(e))}var Jt=Object.defineProperty,Yt=(e,t)=>Jt(e,`name`,{value:t,configurable:!0}),Xt=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Yt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Yt(B,`composeEventHandlers`);function Zt(e){if(!Xt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Yt(Zt,`getOwnerWindow`);function Qt(e){if(!Xt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Yt(Qt,`getOwnerDocument`);function $t(e,t=!1){let{activeElement:n}=Qt(e);if(!n?.nodeName)return null;if(en(n)&&n.contentDocument)return $t(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Qt(n).getElementById(e);if(t)return t}}return n}Yt($t,`getActiveElement`);function en(e){return e.tagName===`IFRAME`}Yt(en,`isFrame`);var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=nn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:o,children:n})},`Provider`);i.displayName=e+`Provider`;function o(t,i={}){let{optional:o=!1}=i,s=a.useContext(r);if(s)return s;if(n!==void 0)return n;if(!o)throw Error(`\`${t}\` must be used within \`${e}\``)}return nn(o,`useContext`),[i,o]}nn(rn,`createContext`);function an(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=nn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return nn(l,`useContext`),[c,l]}nn(i,`createContext`);let o=nn(()=>{let t=r.map(e=>a.createContext(e));return nn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,on(o,...n)]}nn(an,`createContextScope`);function on(...e){let t=e[0];if(e.length===1)return t;let n=nn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return nn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}nn(on,`composeContextScopes`);var sn=globalThis?.document?a.useLayoutEffect:()=>{},cn=Object.defineProperty,ln=(e,t)=>cn(e,`name`,{value:t,configurable:!0}),un=a.useId||(()=>void 0),dn=0;function V(e){let[t,n]=a.useState(un());return sn(()=>{e||n(e=>e??String(dn++))},[e]),e||(t?`radix-${t}`:``)}ln(V,`useId`);var fn=typeof document<`u`?x:function(){};function pn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){let n=mn(e);return Math.round(t*n)/n}function gn(e){let t=a.useRef(e);return fn(()=>{t.current=e}),t}function _n(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);pn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=gn(l),k=gn(i),A=gn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),te(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!pn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);fn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);fn(()=>(M.current=!0,()=>{M.current=!1}),[]),fn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=hn(P.floating,d.x),r=hn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}const vn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:P({element:r.current,padding:i}).fn(n):r?P({element:r,padding:i}).fn(n):{}}}},yn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},xn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Sn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tn=(e,t)=>{let n=vn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Pt(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function On(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Dn(On,`dispatchDiscreteCustomEvent`);var kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}An(jn,`useCallbackRef`);var Mn=Object.defineProperty,Nn=(e,t)=>Mn(e,`name`,{value:t,configurable:!0});function Pn(e){let[t,n]=a.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Nn(Pn,`useSize`);var Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=`Popper`,[Rn,zn]=an(Ln),[Bn,Vn]=Rn(Ln),Hn=In(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return t(Bn,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),Un=`PopperAnchor`,Wn=a.forwardRef(In(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=Vn(Un,r),c=a.useRef(null),l=s.onAnchorChange,u=R(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&Zn(s.placementState),p=f?.[0],m=f?.[1];return i?null:t(H.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Gn=`PopperContent`,[Kn,qn]=Rn(Gn),Jn=a.forwardRef(In(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Vn(Gn,r),[y,b]=a.useState(null),x=R(n,b),[S,C]=a.useState(null),w=Pn(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Yn),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=_n({strategy:`fixed`,placement:D,whileElementsMounted:In((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[yn({mainAxis:o+E,alignmentAxis:c}),u&&bn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?xn():void 0,...j}),u&&Sn({...j}),Cn({...j,apply:In(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Tn({element:S,padding:l}),Xn({arrowWidth:T,arrowHeight:E}),m&&wn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;sn(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=Zn(P),ae=jn(g);sn(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return sn(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:t(Kn,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:t(H.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function Yn(e){return e!==null}In(Yn,`isNotNull`);var Xn=In(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}In(Zn,`getSideAndAlignFromPlacement`);var Qn=Hn,$n=Wn,er=Jn,tr=Object.defineProperty,nr=a.forwardRef(((e,t)=>tr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);sn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(t(H.div,{...i,ref:n}),c):null},`Portal`)),rr=Object.defineProperty,ir=(e,t)=>rr(e,`name`,{value:t,configurable:!0});function ar(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}ir(ar,`useStateMachine`);var or=ir(e=>{let{present:t,children:n}=e,r=sr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=lr(r.ref,dr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function sr(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=ar(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??ur(r.current),s.current=void 0):o.current=`none`},[c]),sn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=ur(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),sn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=ir(a=>{let o=ur(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ir(e=>{e.target===t&&(o.current=ur(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=ur(t)}else r.current=null;n(e)},[])}}ir(sr,`usePresence`);function cr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ir(cr,`setRef`);function lr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():cr(n[e],null)}}},[])}ir(lr,`useStableComposedRefs`);function ur(e){return e?.animationName||`none`}ir(ur,`getAnimationName`);function dr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ir(dr,`getElementRef`);var fr=Object.defineProperty,pr=(e,t)=>fr(e,`name`,{value:t,configurable:!0}),mr=a.useEffectEvent,hr=a.useInsertionEffect;function gr(e){if(typeof mr==`function`)return mr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof hr==`function`?hr(()=>{t.current=e}):sn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}pr(gr,`useEffectEvent`);var _r=Object.defineProperty,vr=(e,t)=>_r(e,`name`,{value:t,configurable:!0}),yr=a.useInsertionEffect||sn;function br({prop:e,defaultProp:t,onChange:n=vr(()=>{},`onChange`),caller:r}){let[i,o,s]=xr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Sr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}vr(br,`useControllableState`);function xr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return yr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}vr(xr,`useUncontrolledState`);function Sr(e){return typeof e==`function`}vr(Sr,`isFunction`);var Cr=Symbol(`RADIX:SYNC_STATE`);function wr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=gr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Cr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Cr,state:i})},[i,f.state,l]),[g,p]}vr(wr,`useControllableStateReducer`);var Tr=Object.defineProperty,Er=(e,t)=>Tr(e,`name`,{value:t,configurable:!0}),Dr=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Or=a.forwardRef(Er(function(e,n){return t(H.span,{...e,ref:n,style:{...Dr,...e.style}})},`VisuallyHidden`)),kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),[jr,Mr]=an(`Tooltip`,[zn]),Nr=zn(),Pr=`TooltipProvider`,Fr=700,Ir=`tooltip.open`,[Lr,Rr]=jr(Pr),zr=Ar(e=>{let{__scopeTooltip:n,delayDuration:r=Fr,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),t(Lr,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),Br=`Tooltip`,[Vr,Hr]=jr(Br),Ur=Ar(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Rr(Br,e.__scopeTooltip),d=Nr(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=V(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=br({prop:i,defaultProp:o??!1,onChange:Ar(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ir))):u.onClose(),s?.(e)},`onChange`),caller:Br}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return t(Qn,{...d,children:t(Vr,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),Wr=`TooltipTrigger`,Gr=a.forwardRef(Ar(function(e,n){let{__scopeTooltip:r,...i}=e,o=Hr(Wr,r),s=Rr(Wr,r),c=Nr(r),l=R(n,a.useRef(null),o.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),t($n,{asChild:!0,...c,children:t(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})},`TooltipTrigger`)),Kr=`TooltipPortal`,[qr,Jr]=jr(Kr,{forceMount:void 0}),Yr=Ar(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=Hr(Kr,n);return t(qr,{scope:n,forceMount:r,children:t(or,{present:r||o.open,children:t(nr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Xr=`TooltipContent`,Zr=a.forwardRef(Ar(function(e,n){let r=Jr(Xr,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=Hr(Xr,e.__scopeTooltip);return t(or,{present:i||s.open,children:s.disableHoverableContent?t(ei,{side:a,...o,ref:n}):t(Qr,{side:a,...o,ref:n})})},`TooltipContent`)),Qr=a.forwardRef(Ar(function(e,n){let r=Hr(Xr,e.__scopeTooltip),i=Rr(Xr,e.__scopeTooltip),o=a.useRef(null),s=R(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ni(r,ti(r,n.getBoundingClientRect())),a=ri(t.getBoundingClientRect()),o=ai([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=Ar(e=>h(e,f),`handleTriggerLeave`),t=Ar(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=Ar(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ii(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),t(ei,{...e,ref:s})},`TooltipContentHoverable`)),$r=Lt(`TooltipContent`),ei=a.forwardRef(Ar(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Hr(Xr,i),p=Nr(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(Ir,m),()=>document.removeEventListener(Ir,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=Ar(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:h}=f;return sn(()=>(h(c),()=>{h(void 0)}),[c,h]),t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:n(er,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[t($r,{children:o}),s?t(Or,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function ti(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Ar(ti,`getExitSideFromRect`);function ni(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Ar(ni,`getPaddedExitPoints`);function ri(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Ar(ri,`getPointsFromRect`);function ii(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Ar(ii,`isPointInPolygon`);function ai(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),oi(t)}Ar(ai,`getHull`);function oi(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ar(oi,`getHullPresorted`);var si=zr,ci=Ur,li=Gr,ui=Yr,di=Zr;const fi=o.createContext(void 0);function pi(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function mi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(fi),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r){s(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=pi(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(fi.Provider,{value:a||void 0,children:e})}function hi(){return o.useContext(fi)}const gi=si,_i=ci,vi=li,yi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=hi();return t(ui,{container:o,children:t(di,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:z(`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`,e),...i})})});yi.displayName=di.displayName;function bi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(gi,{delayDuration:0,children:n(_i,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(vi,{className:`cursor-pointer`,asChild:c,children:r}),t(yi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const xi=new Set;function Si(e,t,n){_(()=>{t&&!xi.has(e)&&(xi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ci(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ci(t.children)}return!1})}const wi=A(`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 text-destructive ring-1 ring-inset ring-destructive/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`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),U=a.forwardRef(({className:i,variant:a,size:o,asChild:s=!1,alt:c,isDisabled:l,isLoading:u,title:d,tooltipPlacement:f=`top`,onClick:p,type:m,...h},g)=>{Si(`Button.alt`,c!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let _=s?Ft:`button`,v=s?m:m??`button`,y=d??c,b=h[`aria-label`]??c??(Ci(h.children)?void 0:d),x=s?h.children:n(e,{children:[u&&t(Ue,{className:`animate-spin`}),h.children]}),S=t(_,{className:r(z(wi({variant:a,size:o})),i),disabled:l||u||h.disabled,ref:g,onClick:p,type:v,autoFocus:!1,...h,"aria-label":b,children:x});return y?t(bi,{description:y,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:f,children:S}):S});U.displayName=`Button`;const Ti=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":o,...s},c)=>{let[l,u]=w(!1),{t:d}=k();Si(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let f=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u(!0),setTimeout(()=>u(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||d(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:d(`misc.failedToCopy`),duration:2e3})})},p=o??a??d(`misc.copy`);return t(U,{ref:c,className:z(i),variant:`unstyled`,size:e||`sm`,onClick:f,...s,title:p,children:l?t(Me,{className:`text-success`}):t(ze,{className:`size-4`})})});Ti.displayName=`CopyButton`;function Ei({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`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`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(U,{onClick:a,children:[t(Ke,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Di(e){return e.isFile}function Oi(e){return e.isDirectory}function ki(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ai({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(ki(i.current.files))}})]})}function ji({onUpload:e}){let r=Fi({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted dark:hover:bg-bray-800 hover:bg-muted dark:border-border dark:hover:border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`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`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function Mi(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function Ni(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function Pi(e){e&&delete e.__dragOver_cnt__}function Fi({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),Pi(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Di(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Oi(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{Mi(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{Ni(r.current)&&r.current?.classList.remove(t)},ref:r}}function Ii({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(bi,{description:e,placement:r,children:t(Ve,{className:z(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function Li(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function Ri(){try{return se.isDev}catch{return!1}}function zi({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=Li(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else Ri()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(Ii,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function Bi(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const Vi=A(`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`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function Hi({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:Bi(i)}:{};return t(`span`,{className:z(Vi({variant:n}),e),...o,...a,children:r})}const Ui=A(`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:``,outline:``}},defaultVariants:{variant:`default`}}),Wi=A(`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`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function Gi({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:z(Ui({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:z(Wi({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function Ki({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`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`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(bi,{description:`click to remove`,children:t(Hi,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function qi({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-primary`,n,o),...a,children:i})}function Ji({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}Ji.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const Yi=`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 focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,Xi={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:Yi,INPUT:`${Yi} py-1.5`};function Zi(e){return e==null||Number.isNaN(e)?``:e.toString()}const Qi=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Zi(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Zi(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,Xi.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),$i=d({});function ea(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const ta=typeof window<`u`?x:_,na=d(null);function ra(e,t){e.indexOf(t)===-1&&e.push(t)}function ia(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const aa=(e,t,n)=>n>t?t:n<e?e:n,oa={},sa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ca=e=>typeof e==`object`&&!!e,la=e=>/^0[^.\s]+$/u.test(e);function ua(e){let t;return()=>(t===void 0&&(t=e()),t)}const da=e=>e,fa=(...e)=>e.reduce((e,t)=>n=>t(e(n))),pa=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var ma=class{constructor(){this.subscriptions=[]}add(e){return ra(this.subscriptions,e),()=>ia(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const ha=e=>e*1e3,ga=e=>e/1e3,_a=(e,t)=>t?1e3/t*e:0,va=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ya(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=va(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function ba(e,t,n,r){if(e===t&&n===r)return da;let i=t=>ya(t,0,1,e,n);return e=>e===0||e===1?e:va(i(e),t,r)}const xa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Sa=e=>t=>1-e(1-t),Ca=ba(.33,1.53,.69,.99),wa=Sa(Ca),Ta=xa(wa),Ea=e=>e>=1?1:(e*=2)<1?.5*wa(e):.5*(2-2**(-10*(e-1))),Da=e=>1-Math.sin(Math.acos(e)),Oa=Sa(Da),ka=xa(Da),Aa=ba(.42,0,1,1),ja=ba(0,0,.58,1),Ma=ba(.42,0,.58,1),Na=e=>Array.isArray(e)&&typeof e[0]!=`number`,Pa=e=>Array.isArray(e)&&typeof e[0]==`number`,Fa={linear:da,easeIn:Aa,easeInOut:Ma,easeOut:ja,circIn:Da,circInOut:ka,circOut:Oa,backIn:wa,backInOut:Ta,backOut:Ca,anticipate:Ea},Ia=e=>typeof e==`string`,La=e=>{if(Pa(e)){e.length;let[t,n,r,i]=e;return ba(t,n,r,i)}return Ia(e)?(Fa[e],`${e}`,Fa[e]):e},Ra=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function za(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ba(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ra.reduce((e,t)=>(e[t]=za(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=oa.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ra.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ra.length;t++)o[Ra[t]].cancel(e)},state:i,steps:o}}const{schedule:W,cancel:Va,state:Ha,steps:Ua}=Ba(typeof requestAnimationFrame<`u`?requestAnimationFrame:da,!0);let Wa;function Ga(){Wa=void 0}const Ka={now:()=>(Wa===void 0&&Ka.set(Ha.isProcessing||oa.useManualTiming?Ha.timestamp:performance.now()),Wa),set:e=>{Wa=e,queueMicrotask(Ga)}},qa=e=>t=>typeof t==`string`&&t.startsWith(e),Ja=qa(`--`),Ya=qa(`var(--`),Xa=e=>Ya(e)?Za.test(e.split(`/*`)[0].trim()):!1,Za=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qa(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const $a={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},eo={...$a,transform:e=>aa(0,1,e)},to={...$a,default:1},no=e=>Math.round(e*1e5)/1e5,ro=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function io(e){return e==null}const ao=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oo=(e,t)=>n=>!!(typeof n==`string`&&ao.test(n)&&n.startsWith(e)||t&&!io(n)&&Object.prototype.hasOwnProperty.call(n,t)),so=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ro);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},co=e=>aa(0,255,e),lo={...$a,transform:e=>Math.round(co(e))},uo={test:oo(`rgb`,`red`),parse:so(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+lo.transform(e)+`, `+lo.transform(t)+`, `+lo.transform(n)+`, `+no(eo.transform(r))+`)`};function fo(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const po={test:oo(`#`),parse:fo,transform:uo.transform},mo=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ho=mo(`deg`),go=mo(`%`),G=mo(`px`),_o=mo(`vh`),vo=mo(`vw`),yo={...go,parse:e=>go.parse(e)/100,transform:e=>go.transform(e*100)},bo={test:oo(`hsl`,`hue`),parse:so(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+go.transform(no(t))+`, `+go.transform(no(n))+`, `+no(eo.transform(r))+`)`},K={test:e=>uo.test(e)||po.test(e)||bo.test(e),parse:e=>uo.test(e)?uo.parse(e):bo.test(e)?bo.parse(e):po.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?uo.transform(e):bo.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function So(e){return isNaN(e)&&typeof e==`string`&&(e.match(ro)?.length||0)+(e.match(xo)?.length||0)>0}const Co=`number`,wo=`color`,To=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Eo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(To,e=>(K.test(e)?(r.color.push(a),i.push(wo),n.push(K.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Co),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Do(e){return Eo(e).values}function Oo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Co?no(r[a]):e===wo?K.transform(r[a]):r[a]}return i}}function ko(e){return Oo(Eo(e))}const Ao=e=>typeof e==`number`?0:K.test(e)?K.getAnimatableNone(e):e,jo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Ao(e);function Mo(e){let t=Eo(e);return Oo(t)(t.values.map((e,n)=>jo(e,t.split[n])))}const No={test:So,parse:Do,createTransformer:ko,getAnimatableNone:Mo};function Po(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fo({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Po(s,r,e+1/3),a=Po(s,r,e),o=Po(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Io(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,Lo=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ro=[po,uo,bo],zo=e=>Ro.find(t=>t.test(e));function Bo(e){let t=zo(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===bo&&(n=Fo(n)),n}const Vo=(e,t)=>{let n=Bo(e),r=Bo(t);if(!n||!r)return Io(e,t);let i={...n};return e=>(i.red=Lo(n.red,r.red,e),i.green=Lo(n.green,r.green,e),i.blue=Lo(n.blue,r.blue,e),i.alpha=q(n.alpha,r.alpha,e),uo.transform(i))},Ho=new Set([`none`,`hidden`]);function Uo(e,t){return Ho.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Wo(e,t){return n=>q(e,t,n)}function Go(e){return typeof e==`number`?Wo:typeof e==`string`?Xa(e)?Io:K.test(e)?Vo:Yo:Array.isArray(e)?Ko:typeof e==`object`?K.test(e)?Vo:qo:Io}function Ko(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Go(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function qo(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Go(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Jo(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const Yo=(e,t)=>{let n=No.createTransformer(t),r=Eo(e),i=Eo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ho.has(e)&&!i.values.length||Ho.has(t)&&!r.values.length?Uo(e,t):fa(Ko(Jo(r,i),i.values),n):(`${e}${t}`,Io(e,t))};function Xo(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?q(e,t,n):Go(e)(e,t)}const Zo=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>W.update(t,e),stop:()=>Va(t),now:()=>Ha.isProcessing?Ha.timestamp:Ka.now()}},Qo=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},$o=2e4;function es(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function ts(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(es(r),$o);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ga(i)}}const J={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ns(e,t){return e*Math.sqrt(1-t*t)}function rs(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const is=.001;function as({duration:e=J.duration,bounce:t=J.bounce,velocity:n=J.velocity,mass:r=J.mass}){let i,a;J.maxDuration;let o=1-t;o=aa(J.minDamping,J.maxDamping,o),e=aa(J.minDuration,J.maxDuration,ga(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=ns(t,o),c=Math.exp(-i);return is-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=ns(t**2,o);return(-i(t)+is>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=rs(i,a,s);if(e=ha(e),isNaN(c))return{stiffness:J.stiffness,damping:J.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const os=[`duration`,`bounce`],ss=[`stiffness`,`damping`,`mass`];function cs(e,t){return t.some(t=>e[t]!==void 0)}function ls(e){let t={velocity:J.velocity,stiffness:J.stiffness,damping:J.damping,mass:J.mass,isResolvedFromDuration:!1,...e};if(!cs(e,ss)&&cs(e,os)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*aa(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:J.mass,stiffness:i,damping:a}}else{let n=as({...e,velocity:0});t={...t,...n,mass:J.mass},t.isResolvedFromDuration=!0}}return t}function us(e=J.visualDuration,t=J.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ls({...n,velocity:-ga(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ga(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?J.restSpeed.granular:J.restSpeed.default,i||=v?J.restDelta.granular:J.restDelta.default;let y,b,x,S,C,w;if(h<1)x=ns(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>ha(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=ha(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=ha(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(es(T),$o),t=Qo(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}us.applyToOptions=e=>{let t=ts(e,100,us);return e.ease=t.ease,e.duration=ha(t.duration),e.type=`keyframes`,e};function ds(e,t,n){let r=Math.max(t-5,0);return _a(n-e(r),t-r)}function fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=us({keyframes:[f.value,m(f.value)],velocity:ds(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ps(e,t,n){let r=[],i=n||oa.mix||Xo,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||da:t;a=fa(e,a)}r.push(a)}return r}function ms(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ps(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pa(e[r],e[r+1],n);return s[r](i)};return n?t=>l(aa(e[0],e[a-1],t)):l}function hs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pa(0,t,r);e.push(q(n,1,i))}}function gs(e){let t=[0];return hs(t,e.length-1),t}function _s(e,t){return e.map(e=>e*t)}function vs(e,t){return e.map(()=>t||Ma).splice(0,e.length-1)}function ys({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Na(r)?r.map(La):La(r),a={done:!1,value:t[0]},o=ms(_s(n&&n.length===t.length?n:gs(t),e),t,{ease:Array.isArray(i)?i:vs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const bs=e=>e!==null;function xs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(bs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const Ss={decay:fs,inertia:fs,tween:ys,keyframes:ys,spring:us};function Cs(e){typeof e.type==`string`&&(e.type=Ss[e.type])}var ws=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Ts=e=>e/100;var Es=class extends ws{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Ka.now()&&this.tick(Ka.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Cs(e);let{type:t=ys,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ys;s!==ys&&typeof o[0]!=`number`&&(this.mixKeyframes=fa(Ts,Xo(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=es(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=aa(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==fs&&(b.value=xs(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return ga(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(this.currentTime)}set time(e){e=ha(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ds(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Ka.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ga(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Zo,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Ka.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ds(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Os=e=>e*180/Math.PI,ks=e=>{let t=Os(Math.atan2(e[1],e[0]));return js(t)},As={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ks,rotateZ:ks,skewX:e=>Os(Math.atan(e[1])),skewY:e=>Os(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},js=e=>(e%=360,e<0&&(e+=360),e),Ms=ks,Ns=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ps=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Fs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ns,scaleY:Ps,scale:e=>(Ns(e)+Ps(e))/2,rotateX:e=>js(Os(Math.atan2(e[6],e[5]))),rotateY:e=>js(Os(Math.atan2(-e[2],e[0]))),rotateZ:Ms,rotate:Ms,skewX:e=>Os(Math.atan(e[4])),skewY:e=>Os(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Is(e){return+!!e.includes(`scale`)}function Ls(e,t){if(!e||e===`none`)return Is(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Fs,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=As,i=t}if(!i)return Is(t);let a=r[t],o=i[1].split(`,`).map(zs);return typeof a==`function`?a(o):o[a]}const Rs=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ls(n,t)};function zs(e){return parseFloat(e.trim())}const Bs=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Vs=new Set([...Bs,`pathRotation`]),Hs=e=>e===$a||e===G,Us=new Set([`x`,`y`,`z`]),Ws=Bs.filter(e=>!Us.has(e));function Gs(e){let t=[];return Ws.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const Ks={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ls(t,`x`),y:(e,{transform:t})=>Ls(t,`y`)};Ks.translateX=Ks.x,Ks.translateY=Ks.y;const qs=new Set;let Js=!1,Ys=!1,Xs=!1;function Zs(){if(Ys){let e=Array.from(qs).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Gs(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ys=!1,Js=!1,qs.forEach(e=>e.complete(Xs)),qs.clear()}function Qs(){qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ys=!0)})}function $s(){Xs=!0,Qs(),Zs(),Xs=!1}var ec=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(qs.add(this),Js||(Js=!0,W.read(Qs),W.resolveKeyframes(Zs))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ds(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qs.delete(this)}cancel(){this.state===`scheduled`&&(qs.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const tc=e=>e.startsWith(`--`);function nc(e,t,n){tc(t)?e.style.setProperty(t,n):e.style[t]=n}const rc={};function ic(e,t){let n=ua(e);return()=>rc[t]??n()}const ac=ic(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),oc=ic(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),sc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:sc([0,.65,.55,1]),circOut:sc([.55,0,1,.45]),backIn:sc([.31,.01,.66,-.59]),backOut:sc([.33,1.53,.69,.99])};function lc(e,t){if(e)return typeof e==`function`?oc()?Qo(e,t):`ease-out`:Pa(e)?sc(e):Array.isArray(e)?e.map(e=>lc(e,t)||cc.easeOut):cc[e]}function uc(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=lc(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function dc(e){return typeof e==`function`&&`applyToOptions`in e}function fc({type:e,...t}){return dc(e)&&oc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var pc=class extends ws{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=fc(e);this.animation=uc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=xs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),nc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return ga(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ha(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ac()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),da):r(this)}};const mc={anticipate:Ea,backInOut:Ta,circInOut:ka};function hc(e){return e in mc}function gc(e){typeof e.ease==`string`&&hc(e.ease)&&(e.ease=mc[e.ease])}var _c=class extends pc{constructor(e){gc(e),Cs(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Es({...a,autoplay:!1}),s=Math.max(10,Ka.now()-this.startTime),c=aa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&nc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const vc=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(No.test(e)||e===`0`)&&!e.startsWith(`url(`));function yc(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function bc(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=vc(i,t),s=vc(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:yc(e)||(n===`spring`||dc(n))&&r}function xc(e){e.duration=0,e.type=`keyframes`}const Sc=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Cc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function wc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Cc.test(e[t]))return!0;return!1}const Tc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ec=ua(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Dc(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ec()&&n&&(Sc.has(n)||Tc.has(n)&&wc(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Oc=class extends ws{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ka.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||ec;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Ka.now();let u=!0;bc(e,i,a,o)||(u=!1,(oa.instantAnimations||!s)&&l?.(xs(e,n,t)),e[0]=e[e.length-1],xc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Dc(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new _c({...d,element:p})}catch{m=new Es(d)}else m=new Es(d);m.finished.then(()=>{this.notifyFinished()}).catch(da),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$s()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function kc(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Ac=e=>!isNaN(parseFloat(e)),jc={current:void 0};var Mc=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ka.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ka.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ac(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ma);let n=this.events[e].add(t);return e===`change`?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jc.current&&jc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ka.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return _a(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Nc(e,t){return new Mc(e,t)}function Pc(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Fc(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Pc(n,e)}const Ic={type:`spring`,stiffness:500,damping:25,restSpeed:10},Lc=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rc={type:`keyframes`,duration:.8},zc={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Bc=(e,{keyframes:t})=>t.length>2?Rc:Vs.has(e)?e.startsWith(`scale`)?Lc(t[1]):Ic:zc,Vc=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Hc(e){for(let t in e)if(!Vc.has(t))return!0;return!1}const Uc=(e,t,n,r={},i,a)=>o=>{let s=Fc(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ha(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Hc(s)||Object.assign(u,Bc(e,u)),u.duration&&=ha(u.duration),u.repeatDelay&&=ha(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xc(u),u.delay===0&&(d=!0)),(oa.instantAnimations||oa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,xc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=xs(u.keyframes,s);if(e!==void 0){W.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Es(u):new Oc(u)},Wc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gc(e){let t=Wc.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Kc(e,t,n=1){`${e}`;let[r,i]=Gc(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return sa(e)?parseFloat(e):e}return Xa(i)?Kc(i,t,n+1):i}function qc(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Jc(e,t,n,r){if(typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Yc(e,t,n){let r=e.getProps();return Jc(r,t,n===void 0?r.custom:n,e)}const Xc=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Bs]),Zc=e=>Array.isArray(e);function Qc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Nc(n))}function $c(e){return Zc(e)?e[e.length-1]||0:e}function el(e,t){let{transitionEnd:n={},transition:r={},...i}=Yc(e,t)||{};i={...i,...n};for(let t in i)Qc(e,t,$c(i[t]))}const tl=e=>!!(e&&e.getVelocity);function nl(e){return!!(tl(e)&&e.add)}function rl(e,t){let n=e.getValue(`willChange`);if(nl(n))return n.add(t);if(!n&&oa.WillChange){let n=new oa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function il(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const al=`data-`+il(`framerAppearId`);function ol(e){return e.props[al]}function sl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Pc(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&sl(f,t))continue;let o={delay:n,...Fc(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){W.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=ol(e);if(n){let e=window.MotionHandoffAnimation(n,t,W);e!==null&&(o.startTime=e,p=!0)}}rl(e,t);let m=l??e.shouldReduceMotion;r.start(Uc(t,r,i,m&&Xc.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>W.update(()=>{o&&el(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ll(e,t,n={}){let r=Yc(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(cl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ul(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function ul(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(ll(c,t,{...o,delay:n+(typeof r==`function`?0:r)+kc(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function dl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>ll(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=ll(e,t,n);else{let i=typeof t==`function`?Yc(e,t,n.custom):t;r=Promise.all(cl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const fl={test:e=>e===`auto`,parse:e=>e},pl=e=>t=>t.test(e),ml=[$a,G,go,ho,vo,_o,fl],hl=e=>ml.find(pl(e));function gl(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||la(e)}const _l=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function vl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ro)||[];if(!r)return e;let i=n.replace(r,``),a=+!!_l.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const yl=/\b([a-z-]*)\(.*?\)/gu,bl={...No,getAnimatableNone:e=>{let t=e.match(yl);return t?t.map(vl).join(` `):e}},xl={...No,getAnimatableNone:e=>{let t=No.parse(e);return No.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Sl={...$a,transform:Math.round},Cl={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,rotate:ho,pathRotation:ho,rotateX:ho,rotateY:ho,rotateZ:ho,scale:to,scaleX:to,scaleY:to,scaleZ:to,skew:ho,skewX:ho,skewY:ho,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:eo,originX:yo,originY:yo,originZ:G,zIndex:Sl,fillOpacity:eo,strokeOpacity:eo,numOctaves:Sl},wl={...Cl,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:bl,WebkitFilter:bl,mask:xl,WebkitMask:xl},Tl=e=>wl[e],El=new Set([bl,xl]);function Dl(e,t){let n=Tl(e);return El.has(n)||(n=No),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ol=new Set([`auto`,`none`,`0`]);function kl(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ol.has(t)&&Eo(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Dl(n,i)}var Al=class extends ec{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Xa(r))){let i=Kc(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Xc.has(n)||e.length!==2)return;let[r,i]=e,a=hl(r),o=hl(i);if(Qa(r)!==Qa(i)&&Ks[n]){this.needsMeasurement=!0;return}if(a!==o){if(Hs(a)&&Hs(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ks[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||gl(e[t]))&&n.push(t);n.length&&kl(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ks[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Ks[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const jl=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Ml(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const Nl=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Pl(e){return ca(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:Fl,cancel:Il}=Ba(queueMicrotask,!1),Ll={x:!1,y:!1};function Rl(){return Ll.x||Ll.y}function zl(e){return e===`x`||e===`y`?Ll[e]?null:(Ll[e]=!0,()=>{Ll[e]=!1}):Ll.x||Ll.y?null:(Ll.x=Ll.y=!0,()=>{Ll.x=Ll.y=!1})}function Bl(e,t){let n=Ml(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Vl(e){return!(e.pointerType===`touch`||Rl())}function Hl(e,t,n={}){let[r,i,a]=Bl(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Vl(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const Ul=(e,t)=>t?e===t||Ul(e,t.parentElement):!1,Wl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Gl=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Kl(e){return Gl.has(e.tagName)||e.isContentEditable===!0}const ql=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Jl(e){return ql.has(e.tagName)||e.isContentEditable===!0}const Yl=new WeakSet;function Xl(e){return t=>{t.key===`Enter`&&e(t)}}function Zl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Ql=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Xl(()=>{if(Yl.has(n))return;Zl(n,`down`);let e=Xl(()=>{Zl(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Zl(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function $l(e){return Wl(e)&&!Rl()}const eu=new WeakSet;function tu(e,t,n={}){let[r,i,a]=Bl(e,n),o=e=>{let r=e.currentTarget;if(!$l(e)||eu.has(e))return;Yl.add(r),n.stopPropagation&&eu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Yl.has(r)&&Yl.delete(r),$l(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ul(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Pl(e)&&(e.addEventListener(`focus`,e=>Ql(e,i)),!Kl(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nu(e){return ca(e)&&`ownerSVGElement`in e}const ru=new WeakMap;let iu;const au=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ou=au(`inline`,`width`,`offsetWidth`),su=au(`block`,`height`,`offsetHeight`);function cu({target:e,borderBoxSize:t}){ru.get(e)?.forEach(n=>{n(e,{get width(){return ou(e,t)},get height(){return su(e,t)}})})}function lu(e){e.forEach(cu)}function uu(){typeof ResizeObserver>`u`||(iu=new ResizeObserver(lu))}function du(e,t){iu||uu();let n=Ml(e);return n.forEach(e=>{let n=ru.get(e);n||(n=new Set,ru.set(e,n)),n.add(t),iu?.observe(e)}),()=>{n.forEach(e=>{let n=ru.get(e);n?.delete(t),n?.size||iu?.unobserve(e)})}}const fu=new Set;let pu;function mu(){pu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fu.forEach(t=>t(e))},window.addEventListener(`resize`,pu)}function hu(e){return fu.add(e),pu||mu(),()=>{fu.delete(e),!fu.size&&typeof pu==`function`&&(window.removeEventListener(`resize`,pu),pu=void 0)}}function gu(e,t){return typeof e==`function`?hu(e):du(e,t)}const _u={value:null,addProjectionMetrics:null};function vu(e){return nu(e)&&e.tagName===`svg`}const yu=[...ml,K,No],bu=e=>yu.find(pl(e)),xu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:xu(),y:xu()}),Cu=()=>({min:0,max:0}),Y=()=>({x:Cu(),y:Cu()}),wu=new WeakMap;function Tu(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Eu(e){return typeof e==`string`||Array.isArray(e)}const Du=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ou=[`initial`,...Du];function ku(e){return Tu(e.animate)||Ou.some(t=>Eu(e[t]))}function Au(e){return!!(ku(e)||e.variants)}function ju(e,t,n){for(let r in t){let i=t[r],a=n[r];if(tl(i))e.addValue(r,i);else if(tl(a))e.addValue(r,Nc(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Nc(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Mu={current:null},Nu={current:!1},Pu=typeof window<`u`;function Fu(){if(Nu.current=!0,Pu){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Mu.current=e.matches;e.addEventListener(`change`,t),t()}else Mu.current=!1}}const Iu=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Lu={};function Ru(e){Lu=e}function zu(){return Lu}var Bu=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ec,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Ka.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,W.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ku(t),this.isVariantNode=Au(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&tl(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,wu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Nu.current||Fu(),this.shouldReduceMotion=Mu.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Va(this.notifyUpdate),Va(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Sc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new pc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ha(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Vs.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Lu){let t=Lu[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Iu.length;t++){let n=Iu[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ju(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Nc(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(sa(n)||la(n))?n=parseFloat(n):!bu(n)&&No.test(t)&&(n=Dl(e,t)),this.setBaseTarget(e,tl(n)?n.get():n)),tl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Jc(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!tl(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ma),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fl.render(this.render)}},Vu=class extends Bu{constructor(){super(...arguments),this.KeyframeResolver=Al}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Hu=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,q(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const ud={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},dd=Bs.length;function fd(e,t,n){let r=``,i=!0;for(let a=0;a<dd;a++){let o=Bs[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Nl(s,Cl[o]);if(!c){i=!1;let t=ud[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Nl(a,Cl.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function pd(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Vs.has(e)){o=!0;continue}if(Ja(e)){i[e]=n;continue}{let t=Nl(n,Cl[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fd(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function md(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function hd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(G.test(e))e=parseFloat(e);else return e}return`${hd(e,t.target.x)}% ${hd(e,t.target.y)}%`}},_d={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=No.parse(e);if(i.length>5)return r;let a=No.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=q(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},vd={borderRadius:{...gd,applyTo:[...jl]},borderTopLeftRadius:gd,borderTopRightRadius:gd,borderBottomLeftRadius:gd,borderBottomRightRadius:gd,boxShadow:_d};function yd(e,{layout:t,layoutId:n}){return Vs.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!vd[e]||e===`opacity`)}function bd(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(tl(r[t])||i&&tl(i[t])||yd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function xd(e){return window.getComputedStyle(e)}var Sd=class extends Vu{constructor(){super(...arguments),this.type=`html`,this.renderInstance=md}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Vs.has(t))return this.projection?.isProjecting?Is(t):Rs(e,t);{let n=xd(e),r=(Ja(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){pd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bd(e,t,n)}};const Cd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wd={offset:`strokeDashoffset`,array:`strokeDasharray`};function Td(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Cd:wd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ed=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Dd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(pd(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ed)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Td(d,i,a,o,!1)}const Od=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),kd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ad(e,t,n,r){md(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Od.has(n)?n:il(n),t.attrs[n])}function jd(e,t,n){let r=bd(e,t,n);for(let n in e)if(tl(e[n])||tl(t[n])){let t=Bs.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Md=class extends Vu{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vs.has(t)){let e=Tl(t);return e&&e.default||0}return t=Od.has(t)?t:il(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jd(e,t,n)}build(e,t,n){Dd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ad(e,t,n,r)}mount(e){this.isSVGTag=kd(e.tagName),super.mount(e)}};const Nd=Ou.length;function Pd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Pd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Nd;n++){let r=Ou[n],i=e.props[r];(Eu(i)||i===!1)&&(t[r]=i)}return t}function Fd(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Id=[...Du].reverse(),Ld=Du.length;function Rd(e){return t=>Promise.all(t.map(({animation:t,options:n})=>dl(e,t,n)))}function zd(e){let t=Rd(e),n=Hd(),r=!0,i=!1,a=t=>(n,r)=>{let i=Yc(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Pd(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Ld;t++){let p=Id[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Eu(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Tu(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Bd(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Zc(t)&&Zc(n)?!Fd(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Yc(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=kc(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Yc(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Hd(),i=!0}}}function Bd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Fd(t,e):!1}function Vd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hd(){return{animate:Vd(!0),whileInView:Vd(),whileHover:Vd(),whileTap:Vd(),whileDrag:Vd(),whileFocus:Vd(),exit:Vd()}}function Ud(e,t){e.min=t.min,e.max=t.max}function Wd(e,t){Ud(e.x,t.x),Ud(e.y,t.y)}function Gd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kd(e){return e.max-e.min}function qd(e,t,n){return Math.abs(e-t)<=n}function Jd(e,t,n,r=.5){e.origin=r,e.originPoint=q(t.min,t.max,e.origin),e.scale=Kd(n)/Kd(t),e.translate=q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Yd(e,t,n,r){Jd(e.x,t.x,n.x,r?r.originX:void 0),Jd(e.y,t.y,n.y,r?r.originY:void 0)}function Xd(e,t,n,r=0){e.min=(r?q(n.min,n.max,r):n.min)+t.min,e.max=e.min+Kd(t)}function Zd(e,t,n,r){Xd(e.x,t.x,n.x,r?.x),Xd(e.y,t.y,n.y,r?.y)}function Qd(e,t,n,r=0){let i=r?q(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Kd(t)}function $d(e,t,n,r){Qd(e.x,t.x,n.x,r?.x),Qd(e.y,t.y,n.y,r?.y)}function ef(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function tf(e,t=0,n=1,r=.5,i,a=e,o=e){if(go.test(t)&&(t=parseFloat(t),t=q(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=q(a.min,a.max,r);e===a&&(s-=t),e.min=ef(e.min,t,n,s,i),e.max=ef(e.max,t,n,s,i)}function nf(e,t,[n,r,i],a,o){tf(e,t[n],t[r],t[i],t.scale,a,o)}const rf=[`x`,`scaleX`,`originX`],af=[`y`,`scaleY`,`originY`];function of(e,t,n,r){nf(e.x,t,rf,n?n.x:void 0,r?r.x:void 0),nf(e.y,t,af,n?n.y:void 0,r?r.y:void 0)}function sf(e){return e.translate===0&&e.scale===1}function cf(e){return sf(e.x)&&sf(e.y)}function lf(e,t){return e.min===t.min&&e.max===t.max}function uf(e,t){return lf(e.x,t.x)&&lf(e.y,t.y)}function df(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ff(e,t){return df(e.x,t.x)&&df(e.y,t.y)}function pf(e){return Kd(e.x)/Kd(e.y)}function mf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function hf(e){return[e(`x`),e(`y`)]}function gf(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const _f=jl.length,vf=e=>typeof e==`string`?parseFloat(e):e,yf=e=>typeof e==`number`||G.test(e);function bf(e,t,n,r,i,a){i?(e.opacity=q(0,n.opacity??1,Sf(r)),e.opacityExit=q(t.opacity??1,0,Cf(r))):a&&(e.opacity=q(t.opacity??1,n.opacity??1,r));for(let i=0;i<_f;i++){let a=jl[i],o=xf(t,a),s=xf(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||yf(o)===yf(s)?(e[a]=Math.max(q(vf(o),vf(s),r),0),(go.test(s)||go.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=q(t.rotate||0,n.rotate||0,r))}function xf(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Sf=wf(0,.5,Oa),Cf=wf(.5,.95,da);function wf(e,t,n){return r=>r<e?0:r>t?1:n(pa(e,t,r))}function Tf(e,t,n){let r=tl(e)?e:Nc(e);return r.start(Uc(``,r,t,n)),r.animation}function Ef(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Df=(e,t)=>e.depth-t.depth;var Of=class{constructor(){this.children=[],this.isDirty=!1}add(e){ra(this.children,e),this.isDirty=!0}remove(e){ia(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Df),this.isDirty=!1,this.children.forEach(e)}};function kf(e,t){let n=Ka.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Va(r),e(a-t))};return W.setup(r,!0),()=>Va(r)}function Af(e){return tl(e)?e.get():e}var jf=class{constructor(){this.members=[]}add(e){ra(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ia(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ia(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const Mf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nf={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Pf=[``,`X`,`Y`,`Z`];let Ff=0;function If(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Lf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ol(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,W,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Lf(r)}function Rf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ff++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_u.value&&(Nf.nodes=Nf.calculatedTargetDeltas=Nf.calculatedProjections=0),this.nodes.forEach(Vf),this.nodes.forEach(Xf),this.nodes.forEach(Zf),this.nodes.forEach(Hf),_u.addProjectionMetrics&&_u.addProjectionMetrics(Nf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Of)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ma),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=nu(t)&&!vu(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;W.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=kf(i,250),Mf.hasAnimatedSinceResize&&(Mf.hasAnimatedSinceResize=!1,this.nodes.forEach(Yf)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||ip,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!ff(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Fc(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Yf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Va(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Qf),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Lf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Gf),this.nodes.forEach(Wf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qf),this.nodes.forEach(Jf),this.nodes.forEach(zf),this.nodes.forEach(Bf)):this.nodes.forEach(Kf),this.clearAllSnapshots();let e=Ka.now();Ha.delta=aa(0,1e3/60,e-Ha.timestamp),Ha.timestamp=e,Ha.isProcessing=!0,Ua.update.process(Ha),Ua.preRender.process(Ha),Ua.render.process(Ha),Ha.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach($f)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,W.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){W.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kd(this.snapshot.measuredBox.x)&&!Kd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!cf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),cp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(up))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Wd(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Wd(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Wd(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Wd(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Y(),Wd(r,n.measurePageBox())),of(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&of(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ha.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ha.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Wd(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Wd(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_u.value&&Nf.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),$d(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Wd(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ha.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Wd(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gd(this.prevProjectionDelta.x,this.projectionDelta.x),Gd(this.prevProjectionDelta.y,this.projectionDelta.y)),Yd(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!mf(this.projectionDelta.x,this.prevProjectionDelta.x)||!mf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_u.value&&Nf.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(rp));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=q(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=q(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ep(o.x,e.x,n),ep(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),np(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&uf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Wd(f,this.relativeTarget)),c&&(this.animationValues=a,bf(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Va(this.pendingAnimation),void 0),this.pendingAnimation=W.update(()=>{Mf.hasAnimatedSinceResize=!0,this.motionValue||=Nc(0),this.motionValue.jump(0,!1),this.currentAnimation=Tf(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&lp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Kd(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Kd(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wd(t,n),sd(t,i),Yd(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new jf),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&If(`z`,e,r,this.animationValues);for(let t=0;t<Pf.length;t++)If(`rotate${Pf[t]}`,e,r,this.animationValues),If(`skew${Pf[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Af(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Af(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=gf(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in vd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=vd[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Af(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Wf),this.root.sharedNodes.clear()}}}function zf(e){e.updateLayout()}function Bf(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)hf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Kd(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Ud(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else lp(i,t.layoutBox,n)&&hf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Kd(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Su();Yd(o,n,t.layoutBox);let s=Su();a?Yd(s,e.applyTransform(r,!0),t.measuredBox):Yd(s,n,t.layoutBox);let c=!cf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Y();$d(s,t.layoutBox,i.layoutBox,o);let c=Y();$d(c,n,a.layoutBox,o),ff(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Vf(e){_u.value&&Nf.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Hf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function Wf(e){e.clearMeasurements()}function Gf(e){e.isLayoutDirty=!0,e.updateLayout()}function Kf(e){e.isLayoutDirty=!1}function qf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Jf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Yf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xf(e){e.resolveTargetDelta()}function Zf(e){e.calcProjection()}function Qf(e){e.resetSkewAndRotation()}function $f(e){e.removeLeadSnapshot()}function ep(e,t,n){e.translate=q(t.translate,0,n),e.scale=q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function tp(e,t,n,r){e.min=q(t.min,n.min,r),e.max=q(t.max,n.max,r)}function np(e,t,n,r){tp(e.x,t.x,n.x,r),tp(e.y,t.y,n.y,r)}function rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ip={duration:.45,ease:[.4,0,.1,1]},ap=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),op=ap(`applewebkit/`)&&!ap(`chrome/`)?Math.round:da;function sp(e){e.min=op(e.min),e.max=op(e.max)}function cp(e){sp(e.x),sp(e.y)}function lp(e,t,n){return e===`position`||e===`preserve-aspect`&&!qd(pf(t),pf(n),.2)}function up(e){return e!==e.root&&e.scroll?.wasRoot}const dp=Rf({attachResizeListener:(e,t)=>Ef(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fp={current:void 0},pp=Rf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fp.current){let e=new dp({});e.mount(window),e.setOptions({layoutScroll:!0}),fp.current=e}return fp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),mp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function hp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=hp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():hp(e[t],null)}}}}function _p(...e){return a.useCallback(gp(...e),e)}var vp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pl(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pl(e)&&e.offsetWidth||0,r=Pl(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function yp({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(mp),f=_p(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
188
|
+
;function Qe(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}}function $e(e){switch(e){case`start`:return`end`;case`end`:return`start`;default:return e}}var et=class{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`:this.alignAxis===`x`?this.left=t.left:this.top=t.top;break;case`end`:this.alignAxis===`x`?this.left=t.right-n.width:this.top=t.bottom-n.height;break;case`center`:this.alignAxis===`x`?this.left=t.left+t.width/2-n.width/2:this.top=t.top+t.height/2-n.height/2;break;case`fill`:this.alignAxis===`x`?(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 Error(`Invalid position. Cannot compute x,y coordinates`);let r=this.width!=null,i=this.height!=null,a=this.width??t.width,o=this.height??t.height;return{rect:new DOMRect(this.left??0,this.top??0,a,o),constrainWidth:r,constrainHeight:i,position:e.position,align:e.align}}flipAxis(e,t){if(this.alignAxis===t){if(e.align){let t=$e(e.align);if(t!==e.align)return{...e,align:t}}}else{let t=Qe(e.position);if(t!==e.position)return{...e,position:t}}return null}};function tt(e,t){return e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom}function nt(e,t,n){return n===`x`?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}function rt(e,t,n,r){let i=new et(e.gap),a=i.computePosition(e,t,n),o=nt(a.rect,r,`x`),s=nt(a.rect,r,`y`);if(o&&s)return a;let c=null;return o||(c=i.flipAxis(e,`x`)),s||(c=i.flipAxis(c||e,`y`)),c?(a=new et(i.gap).computePosition(c,t,n),tt(a.rect,r)?a:null):null}function it(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return i<=n||a<=r?null:new DOMRect(n,r,i-n,a-r)}function at(e){if(e.length===0)return null;let t=e[0].getBoundingClientRect();for(let n=1,r=e.length;n<r;n++)if(t=it(e[n].getBoundingClientRect(),t),!t)return null;return t}function ot(e){let t=e.scrollHeight>e.clientHeight,n=e.scrollWidth>e.clientWidth;if(t||n){let r=getComputedStyle(e);if(t&&r.overflowY!==`visible`||n&&r.overflowX!==`visible`)return!0}return!1}function st(e,t=document.documentElement){let n=[],r=e.parentElement;for(;r&&r!==t;)ot(r)&&n.push(r),r=r.parentElement;return n.push(t),n}var ct=class{options;root;scrollableParents;visibleClientRect;context;constructor(e){this.options=e,this.root=e.root||document.documentElement,this.scrollableParents=st(this.anchor,this.root),this.visibleClientRect=at(this.scrollableParents)}get anchor(){return this.options.anchor}registerListeners(e){let t=this.scrollableParents,n=()=>{this.update()};window.addEventListener(`resize`,n);for(let e of t)e.addEventListener(`scroll`,n);let r;this.options.closeOnClick&&(r=t=>{e.contains(t.target)||this.tryClose()},window.setTimeout(()=>{r&&document.addEventListener(`click`,r)},0));let i;this.options.closeOnEsc&&(i=e=>{e.key===`Escape`&&this.tryClose()},window.setTimeout(()=>{i&&document.addEventListener(`keydown`,i)},0));let a=this.options.blockPageScroll;return a&&(document.body.style.overflow=`hidden`,document.body.style.height=`100%`),()=>{window.removeEventListener(`resize`,n);for(let e of t)e.removeEventListener(`scroll`,n);r&&document.removeEventListener(`click`,r),i&&document.removeEventListener(`keydown`,i),a&&(document.body.style.overflow=``,document.body.style.height=``)}}open(e,t){if(this.context)throw 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))}close(){if(!this.context)throw Error(`The popup controller is not bound to an element`);this.tryClose()}tryClose(){this.context&&=(this.options.onClose?.(this),this.context.cleanup(),this.context.element.style.display=`none`,void 0)}get isOpen(){return!!this.context}update(){if(!this.context)return;let e=this.context.element,t=this.context.constraints,n=e.getBoundingClientRect(),r=this.anchor.getBoundingClientRect(),i=this.visibleClientRect;if(!i)return;let a=rt(t,n,r,i);this.context.position=a||void 0,a&&(a.constrainHeight&&(e.style.height=`${a.rect.height}px`),a.constrainWidth&&(e.style.width=`${a.rect.width}px`),e.style.left=`${a.rect.left}px`,e.style.top=`${a.rect.top}px`,e.style.visibility=`visible`)}createPopupElement(){let 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 lt=d(void 0);function ut(){let e=g(lt);if(!e)throw Error(`usePopupController must be used inside a Popup component`);return e}function dt({ctrlRef:e,id:n,constraints:r,isOpen:i,children:a,className:o,onClose:s,onOpen:c,zIndex:l,position:u,anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h}){let g=C(null),[v,y]=w(),b=C(s),x=C(c);return b.current=s,x.current=c,_(()=>{if(!d)throw Error(`Anchor element is required`);let e=new ct({anchor:d,root:f,closeOnClick:p,closeOnEsc:m,blockPageScroll:h,onClose:()=>b.current?.(),onOpen:()=>x.current?.()});return y(e),()=>{e.tryClose()}},[d,h,p,m,f]),_(()=>{e&&(e.current=v)},[v,e]),_(()=>{v&&g.current?v.isOpen!==i&&(i?v.open(g.current,r):v.close()):v?.isOpen&&!i&&v.close()},[r,i,v]),t(lt.Provider,{value:v,children:i&&E(t(`div`,{id:n,style:{visibility:`hidden`,position:u||`absolute`,zIndex:l||100},ref:g,className:o,children:a}),document.body)})}function ft({anchor:e,root:n,children:r,...i}){let a=e.current;return a&&(!n||n.current)?t(dt,{anchor:a,root:n?.current||void 0,...i,children:r}):null}function pt(){return`combobox-popup-${Math.floor(Math.random()*1e6)}`}var mt=class{filter(e,t){let 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}},ht=class e extends mt{valueOf(e){return String(e)}idOf(e){return String(e)}static instance=new e},gt=class e extends ht{createItem(e){return e}static instance=new e};function _t(e,t){return{buttonRight:4,buttonWidth:24,maxMenuHeight:240,menuClass:`w-72 mt-1 border-popover bg-popover text-popover-foreground shadow-md overflow-auto p-0 z-10`,inputClass:r(t?`block m-0 p-0 border-0 focus:outline-none focus:ring-0`:`block sm:text-sm sm:leading-6 bg-muted rounded-md border-0 shadow-sm ring-1 ring-inset ring-muted placeholder:text-muted focus:ring-2 focus:ring-inset focus:ring-primary 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-info`,Input:yt,Menu:xt,Toggle:bt}}function vt({menuAlign:r=`fill`,menuGap:i,focusOnMount:a,onSelect:s,value:c,zIndex:l,unstyledInput:u,fullWidth:d,api:f,layout:p,adapter:m,items:h,placeholder:g,clearable:v,noMatchMessage:y,openOnFocus:b}){let[x]=w(pt()),S=C(void 0),T=C(null),E=p?Object.assign(_t(d,u),p):_t(d,u),D=o.useRef(null),O=St({adapter:m,items:h,value:c,popupId:x});_(()=>{T.current&&a&&T.current.focus()},[a]),_(()=>{O.onSelect=s,O.popupCtrl=S.current},[O,s]),_(()=>{if(f&&O&&T.current)return f.current={open:()=>O.openMenu(),close:()=>O.closeMenu(),toggle:()=>O.toggleMenu(),setInputValue:e=>O.inputText=e,inputValue:O.inputText||``,selectedItem:O.selectedItem,focus:()=>T.current?.focus()},()=>{f.current=null}},[f,O]);let k=O.isMenuOpen&&(O.filteredItems.length>0||!!y);return n(e,{children:[t(E.Input,{boxRef:D,inputRef:T,ctrl:O,layout:E,placeholder:g,clearable:v,openOnFocus:b}),t(ft,{id:x,ctrlRef:S,className:`combobox-popup`,closeOnClick:!0,closeOnEsc:!0,onClose:()=>O.closeMenu(),isOpen:k,anchor:D,zIndex:l,constraints:{position:`bottom`,align:r,gap:i??4},children:t(E.Menu,{fillWidth:r===`fill`,items:O.filteredItems,ctrl:O,layout:E,adapter:m,noMatchMessage:y})})]})}function yt({inputRef:e,placeholder:r,boxRef:i,ctrl:a,layout:o,clearable:s,openOnFocus:c}){let l=o.Toggle,u=s&&a.selectedItem!=null,d=+!!l+ +!!u,f=d>0?{paddingRight:`${o.buttonWidth*d+o.buttonRight}px`}:void 0;return n(`div`,{className:`relative`,ref:i,children:[t(`input`,{ref:e,placeholder:r,...a.getInputProps(),onFocus:c?()=>a.openMenu():void 0,style:f,className:o.inputClass}),n(`div`,{style:{position:`absolute`,right:`${o.buttonRight}px`,top:0,bottom:0,display:`flex`,alignItems:`center`,gap:`2px`},children:[u&&t(`button`,{type:`button`,style:{border:`none`,padding:0,margin:0,backgroundColor:`transparent`,cursor:`pointer`,display:`flex`,alignItems:`center`,width:`${o.buttonWidth}px`},onClick:()=>{a.selectedItem=null},children:t(Ze,{className:`w-4 h-4`})}),l&&t(`button`,{type:`button`,style:{width:`${o.buttonWidth}px`,border:`none`,padding:0,margin:0,backgroundColor:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`},...a.getToggleButtonProps(),children:t(l,{ctrl:a,layout:o})})]})]})}function bt({ctrl:e}){return e.isMenuOpen?t(Fe,{className:`w-4 h-4`}):t(Ne,{className:`w-4 h-4`})}function xt({fillWidth:e,items:n,layout:i,ctrl:a,adapter:o,noMatchMessage:s}){let{highlightedIndex:c,selectedItem:l}=a;return n.length===0?s?t(`div`,{style:{width:e?`100%`:void 0},className:i.menuClass,children:s}):null:t(`ul`,{style:{width:e?`100%`:void 0,maxHeight:i.maxMenuHeight?`${i.maxMenuHeight}px`:`240px`},className:i.menuClass,...a.getMenuProps(),children:n.map((e,n)=>t(`li`,{"data-index":n,className:r(i.optionClass,c===n&&`option-highlighted`,l===e&&`option-selected`),...a.getItemProps(e,n),children:o.renderOption(e)},o.idOf(e)))})}function St(e){let[t,n]=w(new Ct(e));return _(()=>{t?.withState(n)},[t]),t}var Ct=class e{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,typeof n==`string`?this._inputText=n:n&&(this._selectedItem=e.findById(t,e.idOf(n))||null,this._selectedItem&&(this._inputText=e.valueOf(n))),this._filteredItems=this._inputText?this.adapter.filter(this.items,this._inputText):this.items}withState(e){return this.setState=e,this}clone(){let t=new e({adapter:this.adapter,items:this.items,popupId:this.popupId});return t.setState=this.setState,t.onSelect=this.onSelect,t._inputText=this._inputText,t._highlightedIndex=this._highlightedIndex,t._selectedItem=this._selectedItem,t._isMenuOpen=this._isMenuOpen,t._filteredItems=this._filteredItems,t.popupCtrl=this.popupCtrl,t}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){let e=this.popupCtrl,t=e.context?.position?.position;t&&t===`top`&&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;let 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(){let e=this._filteredItems;return{onClick:()=>{this.openMenu()},onChange:e=>{let t=e.target.value;this.inputText=t,this.openMenu()},value:this.inputText,onKeyDown:t=>{let n=t.key;if(n===`Enter`){if(this.highlightedIndex!=null)this.selectedItem=e[this.highlightedIndex||0];else if(this.inputText){let e=this.adapter.createItem(this.inputText);e&&(this.items.push(e),this.selectedItem=e)}this.closeMenu()}else n===`ArrowDown`?this.isMenuOpen?this.highlightIndex(this.highlightedIndex===null?0:wt(this.highlightedIndex,e.length),!1):this.openMenu():n===`ArrowUp`&&this.isMenuOpen&&this.highlightIndex(this.highlightedIndex===null?0:Tt(this.highlightedIndex,e.length),!0)}}}};function wt(e,t){return(e+1)%t}function Tt(e,t){return(e-1+t)%t}function Et({options:e,creatable:n,...r}){let i=n?gt.instance:ht.instance;return t(vt,{adapter:i,items:e,...r})}function Dt({className:e}){return t(`hr`,{className:r(`w-full h-0.5 border-t-0 bg-border`,e)})}var Ot=Object.defineProperty,kt=(e,t)=>Ot(e,`name`,{value:t,configurable:!0});function At(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}kt(At,`setRef`);function jt(...e){return t=>{let n=!1,r=e.map(e=>{let r=At(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():At(e[t],null)}}}}kt(jt,`composeRefs`);function R(...e){return a.useCallback(jt(...e),e)}kt(R,`useComposedRefs`);var Mt=Object.defineProperty,Nt=(e,t)=>Mt(e,`name`,{value:t,configurable:!0});function Pt(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];Ut(r)&&typeof qt==`function`&&(r=qt(r._payload)),a.Children.forEach(r,e=>{if(Vt(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ut(n)&&typeof qt==`function`&&(n=qt(n._payload)),o=Rt(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?Bt(o):void 0,u=R(n,l);if(!o){if(r||r===0)throw Error(s?Kt(e):Gt(e));return r}let d=zt(i,o.props??{});return o.type!==a.Fragment&&(d.ref=n?u:l),a.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Nt(Pt,`createSlot`);var Ft=Pt(`Slot`),It=Symbol.for(`radix.slottable`);function Lt(e){let t=Nt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=It,t}Nt(Lt,`createSlottable`);var Rt=Nt((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function zt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}Nt(zt,`mergeProps`);function Bt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Nt(Bt,`getElementRef`);function Vt(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===It}Nt(Vt,`isSlottable`);var Ht=Symbol.for(`react.lazy`);function Ut(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ht&&`_payload`in e&&Wt(e._payload)}Nt(Ut,`isLazyComponent`);function Wt(e){return typeof e==`object`&&!!e&&`then`in e}Nt(Wt,`isPromiseLike`);var Gt=Nt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Kt=Nt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),qt=a.use;function z(...e){return j(i(e))}var Jt=Object.defineProperty,Yt=(e,t)=>Jt(e,`name`,{value:t,configurable:!0}),Xt=!!(typeof window<`u`&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return Yt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Yt(B,`composeEventHandlers`);function Zt(e){if(!Xt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Yt(Zt,`getOwnerWindow`);function Qt(e){if(!Xt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Yt(Qt,`getOwnerDocument`);function $t(e,t=!1){let{activeElement:n}=Qt(e);if(!n?.nodeName)return null;if(en(n)&&n.contentDocument)return $t(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Qt(n).getElementById(e);if(t)return t}}return n}Yt($t,`getActiveElement`);function en(e){return e.tagName===`IFRAME`}Yt(en,`isFrame`);var tn=Object.defineProperty,nn=(e,t)=>tn(e,`name`,{value:t,configurable:!0});function rn(e,n){let r=a.createContext(n);r.displayName=e+`Context`;let i=nn(e=>{let{children:n,...i}=e,o=a.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:o,children:n})},`Provider`);i.displayName=e+`Provider`;function o(t,i={}){let{optional:o=!1}=i,s=a.useContext(r);if(s)return s;if(n!==void 0)return n;if(!o)throw Error(`\`${t}\` must be used within \`${e}\``)}return nn(o,`useContext`),[i,o]}nn(rn,`createContext`);function an(e,n=[]){let r=[];function i(n,i){let o=a.createContext(i);o.displayName=n+`Context`;let s=r.length;r=[...r,i];let c=nn(n=>{let{scope:r,children:i,...c}=n,l=r?.[e]?.[s]||o,u=a.useMemo(()=>c,Object.values(c));return t(l.Provider,{value:u,children:i})},`Provider`);c.displayName=n+`Provider`;function l(t,r,c={}){let{optional:l=!1}=c,u=r?.[e]?.[s]||o,d=a.useContext(u);if(d)return d;if(i!==void 0)return i;if(!l)throw Error(`\`${t}\` must be used within \`${n}\``)}return nn(l,`useContext`),[c,l]}nn(i,`createContext`);let o=nn(()=>{let t=r.map(e=>a.createContext(e));return nn(function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return o.scopeName=e,[i,on(o,...n)]}nn(an,`createContextScope`);function on(...e){let t=e[0];if(e.length===1)return t;let n=nn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return nn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}nn(on,`composeContextScopes`);var sn=globalThis?.document?a.useLayoutEffect:()=>{},cn=Object.defineProperty,ln=(e,t)=>cn(e,`name`,{value:t,configurable:!0}),un=a.useId||(()=>void 0),dn=0;function V(e){let[t,n]=a.useState(un());return sn(()=>{e||n(e=>e??String(dn++))},[e]),e||(t?`radix-${t}`:``)}ln(V,`useId`);var fn=typeof document<`u`?x:function(){};function pn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!pn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!pn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function mn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function hn(e,t){let n=mn(e);return Math.round(t*n)/n}function gn(e){let t=a.useRef(e);return fn(()=>{t.current=e}),t}function _n(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=a.useState(r);pn(p,r)||m(r);let[h,g]=a.useState(null),[_,v]=a.useState(null),y=a.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=a.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=a.useRef(null),w=a.useRef(null),E=a.useRef(d),D=l!=null,O=gn(l),k=gn(i),A=gn(u),j=a.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),te(C.current,w.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!pn(E.current,t)&&(E.current=t,T.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);fn(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=a.useRef(!1);fn(()=>(M.current=!0,()=>{M.current=!1}),[]),fn(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=a.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=a.useMemo(()=>({reference:x,floating:S}),[x,S]),ee=a.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=hn(P.floating,d.x),r=hn(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...mn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return a.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}const vn=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:P({element:r.current,padding:i}).fn(n):r?P({element:r,padding:i}).fn(n):{}}}},yn=(e,t)=>{let n=ie(e);return{name:n.name,fn:n.fn,options:[e,t]}},bn=(e,t)=>{let n=ae(e);return{name:n.name,fn:n.fn,options:[e,t]}},xn=(e,t)=>({fn:re(e).fn,options:[e,t]}),Sn=(e,t)=>{let n=F(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cn=(e,t)=>{let n=oe(e);return{name:n.name,fn:n.fn,options:[e,t]}},wn=(e,t)=>{let n=ne(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tn=(e,t)=>{let n=vn(e);return{name:n.name,fn:n.fn,options:[e,t]}};var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0}),H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Pt(`Primitive.${n}`),i=a.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function On(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}Dn(On,`dispatchDiscreteCustomEvent`);var kn=Object.defineProperty,An=(e,t)=>kn(e,`name`,{value:t,configurable:!0});function jn(e){let t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}An(jn,`useCallbackRef`);var Mn=Object.defineProperty,Nn=(e,t)=>Mn(e,`name`,{value:t,configurable:!0});function Pn(e){let[t,n]=a.useState(void 0);return sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Nn(Pn,`useSize`);var Fn=Object.defineProperty,In=(e,t)=>Fn(e,`name`,{value:t,configurable:!0}),Ln=`Popper`,[Rn,zn]=an(Ln),[Bn,Vn]=Rn(Ln),Hn=In(e=>{let{__scopePopper:n,children:r}=e,[i,o]=a.useState(null),[s,c]=a.useState(void 0);return t(Bn,{scope:n,anchor:i,onAnchorChange:o,placementState:s,setPlacementState:c,children:r})},`Popper`),Un=`PopperAnchor`,Wn=a.forwardRef(In(function(e,n){let{__scopePopper:r,virtualRef:i,...o}=e,s=Vn(Un,r),c=a.useRef(null),l=s.onAnchorChange,u=R(n,a.useCallback(e=>{c.current=e,e&&l(e)},[l])),d=a.useRef(null);a.useEffect(()=>{if(!i)return;let e=d.current;d.current=i.current,e!==d.current&&l(d.current)});let f=s.placementState&&Zn(s.placementState),p=f?.[0],m=f?.[1];return i?null:t(H.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...o,ref:u})},`PopperAnchor`)),Gn=`PopperContent`,[Kn,qn]=Rn(Gn),Jn=a.forwardRef(In(function(e,n){let{__scopePopper:r,side:i=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Vn(Gn,r),[y,b]=a.useState(null),x=R(n,b),[S,C]=a.useState(null),w=Pn(S),T=w?.width??0,E=w?.height??0,D=i+(s===`center`?``:`-`+s),O=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(d)?d:[d],A=k.length>0,j={padding:O,boundary:k.filter(Yn),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:te,middlewareData:F}=_n({strategy:`fixed`,placement:D,whileElementsMounted:In((...e)=>ee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[yn({mainAxis:o+E,alignmentAxis:c}),u&&bn({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?xn():void 0,...j}),u&&Sn({...j}),Cn({...j,apply:In(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&Tn({element:S,padding:l}),Xn({arrowWidth:T,arrowHeight:E}),m&&wn({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ne=v.setPlacementState;sn(()=>(ne(P),()=>{ne(void 0)}),[P,ne]);let[re,ie]=Zn(P),ae=jn(g);sn(()=>{te&&ae?.()},[te,ae]);let oe=F.arrow?.x,se=F.arrow?.y,ce=F.arrow?.centerOffset!==0,[le,ue]=a.useState();return sn(()=>{y&&ue(window.getComputedStyle(y).zIndex)},[y]),t(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:te?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:t(Kn,{scope:r,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:t(H.div,{"data-side":re,"data-align":ie,..._,ref:x,style:{..._.style,animation:te?_.style?.animation:`none`}})})})},`PopperContent`));function Yn(e){return e!==null}In(Yn,`isNotNull`);var Xn=In(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Zn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}In(Zn,`getSideAndAlignFromPlacement`);var Qn=Hn,$n=Wn,er=Jn,tr=Object.defineProperty,nr=a.forwardRef(((e,t)=>tr(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[o,s]=a.useState(!1);sn(()=>s(!0),[]);let c=r||o&&globalThis?.document?.body;return c?T.createPortal(t(H.div,{...i,ref:n}),c):null},`Portal`)),rr=Object.defineProperty,ir=(e,t)=>rr(e,`name`,{value:t,configurable:!0});function ar(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}ir(ar,`useStateMachine`);var or=ir(e=>{let{present:t,children:n}=e,r=sr(t),i=typeof n==`function`?n({present:r.isPresent}):a.Children.only(n),o=lr(r.ref,dr(i));return typeof n==`function`||r.isPresent?a.cloneElement(i,{ref:o}):null},`Presence`);function sr(e){let[t,n]=a.useState(),r=a.useRef(null),i=a.useRef(e),o=a.useRef(`none`),s=a.useRef(void 0),[c,l]=ar(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return a.useEffect(()=>{c===`mounted`?(o.current=s.current??ur(r.current),s.current=void 0):o.current=`none`},[c]),sn(()=>{let t=r.current,n=i.current;if(n!==e){let r=o.current,a=ur(t);e?(s.current=a,l(`MOUNT`)):a===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==a?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),sn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=ir(a=>{let o=ur(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ir(e=>{e.target===t&&(o.current=ur(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,a),t.addEventListener(`animationend`,a),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,a),t.removeEventListener(`animationend`,a)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:a.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=ur(t)}else r.current=null;n(e)},[])}}ir(sr,`usePresence`);function cr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ir(cr,`setRef`);function lr(...e){let t=a.useRef(e);return t.current=e,a.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=cr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():cr(n[e],null)}}},[])}ir(lr,`useStableComposedRefs`);function ur(e){return e?.animationName||`none`}ir(ur,`getAnimationName`);function dr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ir(dr,`getElementRef`);var fr=Object.defineProperty,pr=(e,t)=>fr(e,`name`,{value:t,configurable:!0}),mr=a.useEffectEvent,hr=a.useInsertionEffect;function gr(e){if(typeof mr==`function`)return mr(e);let t=a.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof hr==`function`?hr(()=>{t.current=e}):sn(()=>{t.current=e}),a.useMemo(()=>((...e)=>t.current?.(...e)),[])}pr(gr,`useEffectEvent`);var _r=Object.defineProperty,vr=(e,t)=>_r(e,`name`,{value:t,configurable:!0}),yr=a.useInsertionEffect||sn;function br({prop:e,defaultProp:t,onChange:n=vr(()=>{},`onChange`),caller:r}){let[i,o,s]=xr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,a.useCallback(t=>{if(c){let n=Sr(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)},[c,e,o,s])]}vr(br,`useControllableState`);function xr({defaultProp:e,onChange:t}){let[n,r]=a.useState(e),i=a.useRef(n),o=a.useRef(t);return yr(()=>{o.current=t},[t]),a.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}vr(xr,`useUncontrolledState`);function Sr(e){return typeof e==`function`}vr(Sr,`isFunction`);var Cr=Symbol(`RADIX:SYNC_STATE`);function wr(e,t,n,r){let{prop:i,defaultProp:o,onChange:s,caller:c}=t,l=i!==void 0,u=gr(s),d=[{...n,state:o}];r&&d.push(r);let[f,p]=a.useReducer((t,n)=>{if(n.type===Cr)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=a.useRef(m);a.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=a.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return a.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Cr,state:i})},[i,f.state,l]),[g,p]}vr(wr,`useControllableStateReducer`);var Tr=Object.defineProperty,Er=(e,t)=>Tr(e,`name`,{value:t,configurable:!0}),Dr=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Or=a.forwardRef(Er(function(e,n){return t(H.span,{...e,ref:n,style:{...Dr,...e.style}})},`VisuallyHidden`)),kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),[jr,Mr]=an(`Tooltip`,[zn]),Nr=zn(),Pr=`TooltipProvider`,Fr=700,Ir=`tooltip.open`,[Lr,Rr]=jr(Pr),zr=Ar(e=>{let{__scopeTooltip:n,delayDuration:r=Fr,skipDelayDuration:i=300,disableHoverableContent:o=!1,children:s}=e,c=a.useRef(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),t(Lr,{scope:n,isOpenDelayedRef:c,delayDuration:r,onOpen:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),c.current=!1)},[i]),onClose:a.useCallback(()=>{i<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:s})},`TooltipProvider`),Br=`Tooltip`,[Vr,Hr]=jr(Br),Ur=Ar(e=>{let{__scopeTooltip:n,children:r,open:i,defaultOpen:o,onOpenChange:s,disableHoverableContent:c,delayDuration:l}=e,u=Rr(Br,e.__scopeTooltip),d=Nr(n),[f,p]=a.useState(null),[m,h]=a.useState(void 0),g=V(),_=a.useRef(0),v=c??u.disableHoverableContent,y=l??u.delayDuration,b=a.useRef(!1),[x,S]=br({prop:i,defaultProp:o??!1,onChange:Ar(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(Ir))):u.onClose(),s?.(e)},`onChange`),caller:Br}),C=a.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=a.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=a.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);a.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=m??g;return t(Qn,{...d,children:t(Vr,{scope:n,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:f,onTriggerChange:p,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?E():w()},[u.isOpenDelayedRef,E,w]),onTriggerLeave:a.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:r})})},`Tooltip`),Wr=`TooltipTrigger`,Gr=a.forwardRef(Ar(function(e,n){let{__scopeTooltip:r,...i}=e,o=Hr(Wr,r),s=Rr(Wr,r),c=Nr(r),l=R(n,a.useRef(null),o.onTriggerChange),u=a.useRef(!1),d=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),t($n,{asChild:!0,...c,children:t(H.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:l,onPointerMove:B(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:B(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:B(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})})},`TooltipTrigger`)),Kr=`TooltipPortal`,[qr,Jr]=jr(Kr,{forceMount:void 0}),Yr=Ar(e=>{let{__scopeTooltip:n,forceMount:r,children:i,container:a}=e,o=Hr(Kr,n);return t(qr,{scope:n,forceMount:r,children:t(or,{present:r||o.open,children:t(nr,{asChild:!0,container:a,children:i})})})},`TooltipPortal`),Xr=`TooltipContent`,Zr=a.forwardRef(Ar(function(e,n){let r=Jr(Xr,e.__scopeTooltip),{forceMount:i=r.forceMount,side:a=`top`,...o}=e,s=Hr(Xr,e.__scopeTooltip);return t(or,{present:i||s.open,children:s.disableHoverableContent?t(ei,{side:a,...o,ref:n}):t(Qr,{side:a,...o,ref:n})})},`TooltipContent`)),Qr=a.forwardRef(Ar(function(e,n){let r=Hr(Xr,e.__scopeTooltip),i=Rr(Xr,e.__scopeTooltip),o=a.useRef(null),s=R(n,o),[c,l]=a.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:p}=i,m=a.useCallback(()=>{l(null),p(!1)},[p]),h=a.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ni(r,ti(r,n.getBoundingClientRect())),a=ri(t.getBoundingClientRect()),o=ai([...i,...a]);l(o),p(!0)},[p]);return a.useEffect(()=>()=>m(),[m]),a.useEffect(()=>{if(u&&f){let e=Ar(e=>h(e,f),`handleTriggerLeave`),t=Ar(e=>h(e,u),`handleContentLeave`);return u.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{u.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[u,f,h,m]),a.useEffect(()=>{if(c){let e=Ar(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||f?.contains(t),i=!ii(n,c);r?m():i&&(m(),d())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[u,f,c,d,m]),t(ei,{...e,ref:s})},`TooltipContentHoverable`)),$r=Lt(`TooltipContent`),ei=a.forwardRef(Ar(function(e,r){let{__scopeTooltip:i,children:o,"aria-label":s,id:c,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=Hr(Xr,i),p=Nr(i),{onClose:m}=f;a.useEffect(()=>(document.addEventListener(Ir,m),()=>document.removeEventListener(Ir,m)),[m]),a.useEffect(()=>{if(f.trigger){let e=Ar(e=>{e.target instanceof Node&&e.target.contains(f.trigger)&&m()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[f.trigger,m]);let{setContentId:h}=f;return sn(()=>(h(c),()=>{h(void 0)}),[c,h]),t(M,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:m,children:n(er,{"data-state":f.stateAttribute,role:s?void 0:`tooltip`,id:s?void 0:f.contentId,...p,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[t($r,{children:o}),s?t(Or,{id:f.contentId,role:`tooltip`,children:s}):null]})})},`TooltipContentImpl`));function ti(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Ar(ti,`getExitSideFromRect`);function ni(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Ar(ni,`getPaddedExitPoints`);function ri(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Ar(ri,`getPointsFromRect`);function ii(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Ar(ii,`isPointInPolygon`);function ai(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),oi(t)}Ar(ai,`getHull`);function oi(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ar(oi,`getHullPresorted`);var si=zr,ci=Ur,li=Gr,ui=Yr,di=Zr;const fi=o.createContext(void 0);function pi(e,t=`plugin-portal-container`){let n=e instanceof Document?e.body:e;for(let e of Array.from(n.children))if(e instanceof HTMLElement&&e.id===t)return e;let r=document.createElement(`div`);return r.id=t,n.appendChild(r),r}function mi({children:e,id:n=`plugin-portal-container`}){let r=o.useContext(fi),i=o.useRef(null),[a,s]=o.useState(r||void 0);return o.useEffect(()=>{if(r){s(r);return}if(i.current){let e=i.current.getRootNode();if(e instanceof ShadowRoot||e instanceof Document){let t=pi(e,n);s(t)}else s(null)}},[n,r]),a===void 0?t(`div`,{ref:i,style:{display:`none`}}):t(fi.Provider,{value:a||void 0,children:e})}function hi(){return o.useContext(fi)}const gi=si,_i=ci,vi=li,yi=a.forwardRef(({className:e,sideOffset:n=4,side:r=`top`,...i},a)=>{let o=hi();return t(ui,{container:o,children:t(di,{ref:a,sideOffset:n,side:r,style:{zIndex:100},className:z(`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`,e),...i})})});yi.displayName=di.displayName;function bi({description:e,children:r,size:i=`sm`,placement:o=`top`,className:s,asChild:c}){let[l,u]=a.useState(!1),d=a.useRef(!1);return a.useEffect(()=>{let e=()=>{u(!1),d.current=!0,requestAnimationFrame(()=>{d.current=!1})};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,e)}},[]),t(gi,{delayDuration:0,children:n(_i,{open:l,onOpenChange:e=>{d.current||u(e)},children:[t(vi,{className:`cursor-pointer`,asChild:c,children:r}),t(yi,{side:o,className:`px-3 py-1.5 max-w-${i} text-${i} px-3 ${s}`,children:e})]})})}const xi=new Set;function Si(e,t,n){_(()=>{t&&!xi.has(e)&&(xi.add(e),console.warn(`[@vertesia/ui] ${e} is deprecated: ${n}`))},[t,n,e])}function Ci(e){return a.Children.toArray(e).some(e=>{if(typeof e==`string`)return e.trim().length>0;if(typeof e==`number`)return!0;if(a.isValidElement(e)){let t=e.props;return t[`aria-hidden`]===!0||t[`aria-hidden`]===`true`?!1:Ci(t.children)}return!1})}const wi=A(`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 text-destructive ring-1 ring-inset ring-destructive/50 shadow-xs hover:bg-destructive/50`,outline:`border border-input bg-background shadow-xs hover:bg-muted ring-inset`,secondary:`bg-info text-info shadow-xs hover:bg-mixer-info/10 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-primary 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`,none:``}},defaultVariants:{variant:`primary`,size:`md`}}),U=a.forwardRef(({className:i,variant:a,size:o,asChild:s=!1,alt:c,isDisabled:l,isLoading:u,title:d,tooltipPlacement:f=`top`,onClick:p,type:m,...h},g)=>{Si(`Button.alt`,c!==void 0,"use `title` instead — it drives the same tooltip and the accessible name. `alt` remains an alias for one release.");let _=s?Ft:`button`,v=s?m:m??`button`,y=d??c,b=h[`aria-label`]??c??(Ci(h.children)?void 0:d),x=s?h.children:n(e,{children:[u&&t(Ue,{className:`animate-spin`}),h.children]}),S=t(_,{className:r(z(wi({variant:a,size:o})),i),disabled:l||u||h.disabled,ref:g,onClick:p,type:v,autoFocus:!1,...h,"aria-label":b,children:x});return y?t(bi,{description:y,asChild:!0,className:`cursor-pointer`,size:`xs`,placement:f,children:S}):S});U.displayName=`Button`;const Ti=a.forwardRef(({size:e,content:n,toast:r,className:i,alt:a,"aria-label":o,...s},c)=>{let[l,u]=w(!1),{t:d}=k();Si(`CopyButton.alt`,a!==void 0,"use aria-label for the accessible name. `alt` is forwarded for one release.");let f=e=>{e.stopPropagation(),navigator.clipboard.writeText(n).then(()=>{u(!0),setTimeout(()=>u(!1),2e3),r?.toast&&r.toast({status:`success`,title:r.message||d(`misc.copiedToClipboard`),duration:2e3})}).catch(e=>{console.error(`Failed to copy text: `,e),r?.toast&&r.toast({status:`error`,title:d(`misc.failedToCopy`),duration:2e3})})},p=o??a??d(`misc.copy`);return t(U,{ref:c,className:z(i),variant:`unstyled`,size:e||`sm`,onClick:f,...s,title:p,children:l?t(Me,{className:`text-success`}):t(ze,{className:`size-4`})})});Ti.displayName=`CopyButton`;function Ei({buttonLabel:e,title:r,children:i,onClick:a}){return t(`div`,{className:`flex items-center justify-center h-full text-center`,children:n(`div`,{className:`py-12`,children:[t(`svg`,{className:`mx-auto size-12`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"aria-hidden":`true`,children:t(`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`})}),t(`h3`,{className:`mt-2 text-sm font-semibold`,children:r}),t(`p`,{className:`mt-1 text-sm text-muted`,children:i}),t(`div`,{className:`mt-6`,children:n(U,{onClick:a,children:[t(Ke,{className:`-ms-0.5 me-1.5 size-5`,"aria-hidden":`true`}),e]})})]})})}function Di(e){return e.isFile}function Oi(e){return e.isDirectory}function ki(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ai({children:e,onUpload:r}){let i=C(null);return n(`label`,{style:{cursor:`pointer`},children:[e,t(`input`,{ref:i,type:`file`,style:{display:`none`},onChange:()=>{i.current?.files&&r(ki(i.current.files))}})]})}function ji({onUpload:e}){let r=Fi({onUpload:e});return t(`div`,{...r,className:`flex items-center justify-center w-full h-64 border-2 border-dashed rounded-lg cursor-pointer bg-muted dark:hover:bg-bray-800 hover:bg-muted dark:border-border dark:hover:border-border`,children:n(`label`,{htmlFor:`dropzone-file`,className:`flex flex-col items-center justify-center w-full h-full`,children:[n(`div`,{className:`flex flex-col items-center justify-center pt-5 pb-6`,children:[t(`svg`,{className:`w-8 h-8 mb-4 text-muted`,"aria-hidden":`true`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 16`,children:t(`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`})}),n(`p`,{className:`mb-2 text-sm text-muted`,children:[t(`span`,{className:`font-semibold`,children:`Click to upload`}),` or drag and drop`]}),t(`p`,{className:`text-xs text-muted`,children:`SVG, PNG, JPG or GIF (MAX. 800x400px)`})]}),t(`input`,{id:`dropzone-file`,type:`file`,className:`hidden`})]})})}function Mi(e){if(!e)return!1;let t=e.__dragOver_cnt__||0;return e.__dragOver_cnt__=t+1,!t}function Ni(e){if(!e)return!1;let t=e.__dragOver_cnt__;return t?(e.__dragOver_cnt__=t-1,t===1):!1}function Pi(e){e&&delete e.__dragOver_cnt__}function Fi({onUpload:e,dragOverClass:t=`is-drag-over-on`,dropEffect:n=`copy`}){let r=C(null);return{onDrop:n=>{n.preventDefault(),Pi(r.current),r.current?.classList.remove(t);let i=n.dataTransfer.items;if(i){let t=[],n=(e,t=``)=>new Promise(r=>{if(Di(e))e.file(e=>{Object.defineProperty(e,"webkitRelativePath",{value:t+e.name}),r([e])});else if(Oi(e)){let i=e.createReader(),a=[],o=()=>{i.readEntries(i=>{if(!i.length)Promise.all(a).then(e=>r(e.flat()));else{for(let r of i)a.push(n(r,`${t+e.name}/`));o()}})};o()}});for(let e=0;e<i.length;e++){let r=i[e].webkitGetAsEntry();r&&t.push(n(r))}Promise.all(t).then(t=>{let n=t.flat();n.length&&e(n)})}},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=n},onDragEnter:()=>{Mi(r.current)&&r.current?.classList.add(t)},onDragLeave:()=>{Ni(r.current)&&r.current?.classList.remove(t)},ref:r}}function Ii({description:e,size:n=`sm`,placement:r=`top`,className:i}){return e?t(bi,{description:e,placement:r,children:t(Ve,{className:z(n===`md`?`size-4`:`size-3`,`text-muted`,i)})}):null}function Li(...e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` `):void 0}function Ri(){try{return se.isDev}catch{return!1}}function zi({description:e,helpText:i,error:a,required:o,label:c,className:d,direction:f=`column`,children:p,disabled:h=!1,fullWidthLabel:g=!1,childrenId:_}){let y=v(),b=v(),x=v(),S=_??y,w=C(!1),T=s.toArray(p).filter(m),E=T.length===1?T[0]:void 0,D=E?.type===l,O=!!E&&!D,k=!1,A=p;if(O&&E){let e=E,t=e.props??{},n=Li(t[`aria-describedby`],i?b:void 0,a?x:void 0),r=t[`aria-invalid`]??(a?!0:void 0);A=u(e,{id:t.id??S,"aria-describedby":n,"aria-invalid":r}),k=!0}else Ri()&&!w.current&&(i||a||_===void 0)&&(w.current=!0,console.warn("[@vertesia/ui] FormItem received zero, multiple, or a fragment as element children. ARIA wiring skipped. Pass `childrenId` and set `id` / `aria-describedby` / `aria-invalid` on your input manually, or wrap the input in a single non-fragment element."));let j=k||_?S:void 0;return n(`div`,{className:r(`flex w-full space-y-1`,d,f===`row`?`flex-row justify-between items-center gap-2`:f===`row-reverse`?`flex-row-reverse justify-between items-center gap-2`:`flex-col`),children:[n(`div`,{className:r(`flex items-center gap-1 mb-0`,g&&`w-full`),children:[n(`label`,{htmlFor:j,className:`text-sm font-medium mb-1 ${h?`text-muted`:``} ${g&&`flex-1`}`,children:[c,o?t(`span`,{className:`text-destructive -mt-4 ms-1`,children:`*`}):``]}),e&&t(`div`,{className:`mx-2 flex w-4 items-center`,children:t(Ii,{description:e})})]}),A,i&&t(`p`,{id:b,className:`text-xs text-muted`,children:i}),a&&t(`p`,{id:x,className:`text-xs text-destructive`,children:a})]})}function Bi(e){return t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e(t))}}const Vi=A(`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-info`,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`,outline:`bg-transparent border border-border text-foreground`}},defaultVariants:{variant:`default`}});function Hi({className:e,variant:n,children:r,onClick:i,...a}){let o=i?{role:`button`,tabIndex:0,onClick:i,onKeyDown:Bi(i)}:{};return t(`span`,{className:z(Vi({variant:n}),e),...o,...a,children:r})}const Ui=A(`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:``,outline:``}},defaultVariants:{variant:`default`}}),Wi=A(`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`,outline:`fill-foreground`}},defaultVariants:{variant:`default`}});function Gi({variant:e,className:r,dotClassName:i,children:a,...o}){return n(`span`,{className:z(Ui({variant:e}),r),...o,children:[t(`div`,{className:`flex-shrink-0`,children:t(`svg`,{className:z(Wi({variant:e}),i),viewBox:`0 0 6 6`,"aria-hidden":`true`,children:t(`circle`,{cx:3,cy:3,r:3})})}),t(`span`,{className:`truncate`,children:a})]})}function Ki({value:e=[],onChange:i,className:a,delimiters:o=`, `,placeholder:s,autoFocus:c,disabled:l=!1}){let[u,d]=w(``),f=t=>{if(l)return;let n=t.currentTarget.value;n?.trim()&&(i([...e,n.trim()]),d(``))},p=t=>{if(l)return;let n=t.currentTarget.value,r=!n.trim(),a=t.key;a===`Enter`||o.indexOf(a)>-1?(t.preventDefault(),e&&!r&&(i([...e,n.trim()]),d(``))):a===`Backspace`&&r&&e&&e.length>0&&(e.pop(),i([...e]))},m=t=>{if(l)return;let n=t.clipboardData.getData(`text`);if(n){t.preventDefault();let r=o.split(``).map(e=>e===` `?`\\s`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),a=RegExp(`[${r}]+`),s=n.split(a).map(e=>e.trim()).filter(e=>e.length>0);s.length>0&&i([...e,...s]),d(``)}},h=t=>{l||e&&e.length>0&&(e.splice(t,1),i([...e]))};return n(`div`,{className:r(a,`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`,l&&`opacity-50 cursor-not-allowed`),children:[e&&e.length>0&&e.map((e,n)=>t(bi,{description:`click to remove`,children:t(Hi,{variant:`secondary`,onClick:()=>h(n),className:r(`flex-shrink-0 transition-colors`,l?`cursor-not-allowed`:`cursor-pointer hover:bg-destructive hover:text-destructive`),title:e,children:t(`span`,{className:`break-all`,children:e})})},`item-${n}`)),t(`input`,{className:`flex-1 min-w-[80px] m-0 p-0 px-1 border-0 bg-transparent text-sm placeholder:text-muted focus:outline-none focus:ring-0 disabled:cursor-not-allowed`,type:`text`,value:u,onBlur:f,onKeyDown:p,onPaste:m,onChange:e=>d(e.currentTarget.value),placeholder:!e||e.length===0?s:``,autoFocus:c,disabled:l})]})}function qi({underline:e=`always`,className:n,children:i,...a}){let o;return e===`always`?o=`underline`:e===`hover`&&(o=`hover:underline`),t(`a`,{className:r(`text-info`,n,o),...a,children:i})}function Ji({className:e,children:n}){return t(`ul`,{className:`${e} space-y-1 flex flex-col items-start`,children:n})}Ji.Item=p(function(e,n){let{current:i,children:a,className:o,href:s=`#`,onClick:c,...l}=e;return t(`li`,{className:r(o,i?`bg-muted`:``,`w-full p-2 ps-3 text-sm leading-6 font-semibold hover:bg-muted`),children:t(`a`,{ref:n,href:s,onClick:e=>{c?(e.preventDefault(),c(e)):s===`#`&&e.preventDefault()},className:`w-full flex items-center gap-x-3`,...l,children:a})})});const Yi=`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 focus-visible:outline-none focus-visible:ring-1 ring-inset focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,Xi={INPUT_UNSTYLED:`block m-0 p-0 w-full border-0 focus:outline-hidden focus:ring-0 bg-transparent`,INPUT_NO_PADDING:Yi,INPUT:`${Yi} py-1.5`};function Zi(e){return e==null||Number.isNaN(e)?``:e.toString()}const Qi=o.forwardRef(({value:e,onChange:n,className:i,noScroll:a=!1,noSpinners:s=!1,...c},l)=>{let[u,d]=o.useState(Zi(e));return _(()=>{if(e==null||!Number.isNaN(e)){let t=Zi(e);d(t)}},[e]),t(`input`,{onWheel:a?e=>{e.currentTarget.blur()}:c.onWheel,type:`number`,value:u,onChange:e=>{let t=e.target.value;d(t),t===``?n?.(void 0,t):n?.(parseFloat(t),t)},className:r(i,Xi.INPUT,{"no-spinners":s},s&&`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`),ref:l,...c})}),$i=d({});function ea(e){let t=C(null);return t.current===null&&(t.current=e()),t.current}const ta=typeof window<`u`?x:_,na=d(null);function ra(e,t){e.indexOf(t)===-1&&e.push(t)}function ia(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const aa=(e,t,n)=>n>t?t:n<e?e:n,oa={},sa=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ca=e=>typeof e==`object`&&!!e,la=e=>/^0[^.\s]+$/u.test(e);function ua(e){let t;return()=>(t===void 0&&(t=e()),t)}const da=e=>e,fa=(...e)=>e.reduce((e,t)=>n=>t(e(n))),pa=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var ma=class{constructor(){this.subscriptions=[]}add(e){return ra(this.subscriptions,e),()=>ia(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const ha=e=>e*1e3,ga=e=>e/1e3,_a=(e,t)=>t?1e3/t*e:0,va=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ya(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=va(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function ba(e,t,n,r){if(e===t&&n===r)return da;let i=t=>ya(t,0,1,e,n);return e=>e===0||e===1?e:va(i(e),t,r)}const xa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Sa=e=>t=>1-e(1-t),Ca=ba(.33,1.53,.69,.99),wa=Sa(Ca),Ta=xa(wa),Ea=e=>e>=1?1:(e*=2)<1?.5*wa(e):.5*(2-2**(-10*(e-1))),Da=e=>1-Math.sin(Math.acos(e)),Oa=Sa(Da),ka=xa(Da),Aa=ba(.42,0,1,1),ja=ba(0,0,.58,1),Ma=ba(.42,0,.58,1),Na=e=>Array.isArray(e)&&typeof e[0]!=`number`,Pa=e=>Array.isArray(e)&&typeof e[0]==`number`,Fa={linear:da,easeIn:Aa,easeInOut:Ma,easeOut:ja,circIn:Da,circInOut:ka,circOut:Oa,backIn:wa,backInOut:Ta,backOut:Ca,anticipate:Ea},Ia=e=>typeof e==`string`,La=e=>{if(Pa(e)){e.length;let[t,n,r,i]=e;return ba(t,n,r,i)}return Ia(e)?(Fa[e],`${e}`,Fa[e]):e},Ra=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function za(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function Ba(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ra.reduce((e,t)=>(e[t]=za(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=oa.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ra.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ra.length;t++)o[Ra[t]].cancel(e)},state:i,steps:o}}const{schedule:W,cancel:Va,state:Ha,steps:Ua}=Ba(typeof requestAnimationFrame<`u`?requestAnimationFrame:da,!0);let Wa;function Ga(){Wa=void 0}const Ka={now:()=>(Wa===void 0&&Ka.set(Ha.isProcessing||oa.useManualTiming?Ha.timestamp:performance.now()),Wa),set:e=>{Wa=e,queueMicrotask(Ga)}},qa=e=>t=>typeof t==`string`&&t.startsWith(e),Ja=qa(`--`),Ya=qa(`var(--`),Xa=e=>Ya(e)?Za.test(e.split(`/*`)[0].trim()):!1,Za=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qa(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const $a={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},eo={...$a,transform:e=>aa(0,1,e)},to={...$a,default:1},no=e=>Math.round(e*1e5)/1e5,ro=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function io(e){return e==null}const ao=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oo=(e,t)=>n=>!!(typeof n==`string`&&ao.test(n)&&n.startsWith(e)||t&&!io(n)&&Object.prototype.hasOwnProperty.call(n,t)),so=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ro);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},co=e=>aa(0,255,e),lo={...$a,transform:e=>Math.round(co(e))},uo={test:oo(`rgb`,`red`),parse:so(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+lo.transform(e)+`, `+lo.transform(t)+`, `+lo.transform(n)+`, `+no(eo.transform(r))+`)`};function fo(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const po={test:oo(`#`),parse:fo,transform:uo.transform},mo=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ho=mo(`deg`),go=mo(`%`),G=mo(`px`),_o=mo(`vh`),vo=mo(`vw`),yo={...go,parse:e=>go.parse(e)/100,transform:e=>go.transform(e*100)},bo={test:oo(`hsl`,`hue`),parse:so(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+go.transform(no(t))+`, `+go.transform(no(n))+`, `+no(eo.transform(r))+`)`},K={test:e=>uo.test(e)||po.test(e)||bo.test(e),parse:e=>uo.test(e)?uo.parse(e):bo.test(e)?bo.parse(e):po.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?uo.transform(e):bo.transform(e),getAnimatableNone:e=>{let t=K.parse(e);return t.alpha=0,K.transform(t)}},xo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function So(e){return isNaN(e)&&typeof e==`string`&&(e.match(ro)?.length||0)+(e.match(xo)?.length||0)>0}const Co=`number`,wo=`color`,To=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Eo(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(To,e=>(K.test(e)?(r.color.push(a),i.push(wo),n.push(K.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Co),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Do(e){return Eo(e).values}function Oo({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Co?no(r[a]):e===wo?K.transform(r[a]):r[a]}return i}}function ko(e){return Oo(Eo(e))}const Ao=e=>typeof e==`number`?0:K.test(e)?K.getAnimatableNone(e):e,jo=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Ao(e);function Mo(e){let t=Eo(e);return Oo(t)(t.values.map((e,n)=>jo(e,t.split[n])))}const No={test:So,parse:Do,createTransformer:ko,getAnimatableNone:Mo};function Po(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fo({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Po(s,r,e+1/3),a=Po(s,r,e),o=Po(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Io(e,t){return n=>n>0?t:e}const q=(e,t,n)=>e+(t-e)*n,Lo=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Ro=[po,uo,bo],zo=e=>Ro.find(t=>t.test(e));function Bo(e){let t=zo(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===bo&&(n=Fo(n)),n}const Vo=(e,t)=>{let n=Bo(e),r=Bo(t);if(!n||!r)return Io(e,t);let i={...n};return e=>(i.red=Lo(n.red,r.red,e),i.green=Lo(n.green,r.green,e),i.blue=Lo(n.blue,r.blue,e),i.alpha=q(n.alpha,r.alpha,e),uo.transform(i))},Ho=new Set([`none`,`hidden`]);function Uo(e,t){return Ho.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Wo(e,t){return n=>q(e,t,n)}function Go(e){return typeof e==`number`?Wo:typeof e==`string`?Xa(e)?Io:K.test(e)?Vo:Yo:Array.isArray(e)?Ko:typeof e==`object`?K.test(e)?Vo:qo:Io}function Ko(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Go(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function qo(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Go(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Jo(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const Yo=(e,t)=>{let n=No.createTransformer(t),r=Eo(e),i=Eo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ho.has(e)&&!i.values.length||Ho.has(t)&&!r.values.length?Uo(e,t):fa(Ko(Jo(r,i),i.values),n):(`${e}${t}`,Io(e,t))};function Xo(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?q(e,t,n):Go(e)(e,t)}const Zo=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>W.update(t,e),stop:()=>Va(t),now:()=>Ha.isProcessing?Ha.timestamp:Ka.now()}},Qo=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},$o=2e4;function es(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function ts(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(es(r),$o);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:ga(i)}}const J={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function ns(e,t){return e*Math.sqrt(1-t*t)}function rs(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const is=.001;function as({duration:e=J.duration,bounce:t=J.bounce,velocity:n=J.velocity,mass:r=J.mass}){let i,a;J.maxDuration;let o=1-t;o=aa(J.minDamping,J.maxDamping,o),e=aa(J.minDuration,J.maxDuration,ga(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=ns(t,o),c=Math.exp(-i);return is-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=ns(t**2,o);return(-i(t)+is>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=rs(i,a,s);if(e=ha(e),isNaN(c))return{stiffness:J.stiffness,damping:J.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const os=[`duration`,`bounce`],ss=[`stiffness`,`damping`,`mass`];function cs(e,t){return t.some(t=>e[t]!==void 0)}function ls(e){let t={velocity:J.velocity,stiffness:J.stiffness,damping:J.damping,mass:J.mass,isResolvedFromDuration:!1,...e};if(!cs(e,ss)&&cs(e,os)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*aa(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:J.mass,stiffness:i,damping:a}}else{let n=as({...e,velocity:0});t={...t,...n,mass:J.mass},t.isResolvedFromDuration=!0}}return t}function us(e=J.visualDuration,t=J.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=ls({...n,velocity:-ga(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=ga(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?J.restSpeed.granular:J.restSpeed.default,i||=v?J.restDelta.granular:J.restDelta.default;let y,b,x,S,C,w;if(h<1)x=ns(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>ha(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=ha(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=ha(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(es(T),$o),t=Qo(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}us.applyToOptions=e=>{let t=ts(e,100,us);return e.ease=t.ease,e.duration=ha(t.duration),e.type=`keyframes`,e};function ds(e,t,n){let r=Math.max(t-5,0);return _a(n-e(r),t-r)}function fs({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=us({keyframes:[f.value,m(f.value)],velocity:ds(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ps(e,t,n){let r=[],i=n||oa.mix||Xo,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||da:t;a=fa(e,a)}r.push(a)}return r}function ms(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ps(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=pa(e[r],e[r+1],n);return s[r](i)};return n?t=>l(aa(e[0],e[a-1],t)):l}function hs(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=pa(0,t,r);e.push(q(n,1,i))}}function gs(e){let t=[0];return hs(t,e.length-1),t}function _s(e,t){return e.map(e=>e*t)}function vs(e,t){return e.map(()=>t||Ma).splice(0,e.length-1)}function ys({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Na(r)?r.map(La):La(r),a={done:!1,value:t[0]},o=ms(_s(n&&n.length===t.length?n:gs(t),e),t,{ease:Array.isArray(i)?i:vs(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const bs=e=>e!==null;function xs(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(bs),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const Ss={decay:fs,inertia:fs,tween:ys,keyframes:ys,spring:us};function Cs(e){typeof e.type==`string`&&(e.type=Ss[e.type])}var ws=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Ts=e=>e/100;var Es=class extends ws{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Ka.now()&&this.tick(Ka.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Cs(e);let{type:t=ys,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ys;s!==ys&&typeof o[0]!=`number`&&(this.mixKeyframes=fa(Ts,Xo(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=es(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=aa(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==fs&&(b.value=xs(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return ga(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(this.currentTime)}set time(e){e=ha(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ds(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Ka.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=ga(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Zo,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Ka.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ds(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Os=e=>e*180/Math.PI,ks=e=>{let t=Os(Math.atan2(e[1],e[0]));return js(t)},As={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ks,rotateZ:ks,skewX:e=>Os(Math.atan(e[1])),skewY:e=>Os(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},js=e=>(e%=360,e<0&&(e+=360),e),Ms=ks,Ns=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ps=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Fs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ns,scaleY:Ps,scale:e=>(Ns(e)+Ps(e))/2,rotateX:e=>js(Os(Math.atan2(e[6],e[5]))),rotateY:e=>js(Os(Math.atan2(-e[2],e[0]))),rotateZ:Ms,rotate:Ms,skewX:e=>Os(Math.atan(e[4])),skewY:e=>Os(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Is(e){return+!!e.includes(`scale`)}function Ls(e,t){if(!e||e===`none`)return Is(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Fs,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=As,i=t}if(!i)return Is(t);let a=r[t],o=i[1].split(`,`).map(zs);return typeof a==`function`?a(o):o[a]}const Rs=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Ls(n,t)};function zs(e){return parseFloat(e.trim())}const Bs=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Vs=new Set([...Bs,`pathRotation`]),Hs=e=>e===$a||e===G,Us=new Set([`x`,`y`,`z`]),Ws=Bs.filter(e=>!Us.has(e));function Gs(e){let t=[];return Ws.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const Ks={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ls(t,`x`),y:(e,{transform:t})=>Ls(t,`y`)};Ks.translateX=Ks.x,Ks.translateY=Ks.y;const qs=new Set;let Js=!1,Ys=!1,Xs=!1;function Zs(){if(Ys){let e=Array.from(qs).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Gs(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ys=!1,Js=!1,qs.forEach(e=>e.complete(Xs)),qs.clear()}function Qs(){qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ys=!0)})}function $s(){Xs=!0,Qs(),Zs(),Xs=!1}var ec=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(qs.add(this),Js||(Js=!0,W.read(Qs),W.resolveKeyframes(Zs))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ds(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),qs.delete(this)}cancel(){this.state===`scheduled`&&(qs.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const tc=e=>e.startsWith(`--`);function nc(e,t,n){tc(t)?e.style.setProperty(t,n):e.style[t]=n}const rc={};function ic(e,t){let n=ua(e);return()=>rc[t]??n()}const ac=ic(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),oc=ic(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),sc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cc={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:sc([0,.65,.55,1]),circOut:sc([.55,0,1,.45]),backIn:sc([.31,.01,.66,-.59]),backOut:sc([.33,1.53,.69,.99])};function lc(e,t){if(e)return typeof e==`function`?oc()?Qo(e,t):`ease-out`:Pa(e)?sc(e):Array.isArray(e)?e.map(e=>lc(e,t)||cc.easeOut):cc[e]}function uc(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=lc(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function dc(e){return typeof e==`function`&&`applyToOptions`in e}function fc({type:e,...t}){return dc(e)&&oc()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var pc=class extends ws{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=fc(e);this.animation=uc(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=xs(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),nc(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return ga(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+ga(e)}get time(){return ga(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ha(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&ac()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),da):r(this)}};const mc={anticipate:Ea,backInOut:Ta,circInOut:ka};function hc(e){return e in mc}function gc(e){typeof e.ease==`string`&&hc(e.ease)&&(e.ease=mc[e.ease])}var _c=class extends pc{constructor(e){gc(e),Cs(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Es({...a,autoplay:!1}),s=Math.max(10,Ka.now()-this.startTime),c=aa(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&nc(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const vc=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(No.test(e)||e===`0`)&&!e.startsWith(`url(`));function yc(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function bc(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=vc(i,t),s=vc(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:yc(e)||(n===`spring`||dc(n))&&r}function xc(e){e.duration=0,e.type=`keyframes`}const Sc=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Cc=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function wc(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Cc.test(e[t]))return!0;return!1}const Tc=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Ec=ua(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Dc(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Ec()&&n&&(Sc.has(n)||Tc.has(n)&&wc(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Oc=class extends ws{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Ka.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||ec;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Ka.now();let u=!0;bc(e,i,a,o)||(u=!1,(oa.instantAnimations||!s)&&l?.(xs(e,n,t)),e[0]=e[e.length-1],xc(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Dc(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new _c({...d,element:p})}catch{m=new Es(d)}else m=new Es(d);m.finished.then(()=>{this.notifyFinished()}).catch(da),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),$s()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function kc(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const Ac=e=>!isNaN(parseFloat(e)),jc={current:void 0};var Mc=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Ka.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Ka.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ac(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ma);let n=this.events[e].add(t);return e===`change`?()=>{n(),W.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return jc.current&&jc.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Ka.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return _a(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Nc(e,t){return new Mc(e,t)}function Pc(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Fc(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Pc(n,e)}const Ic={type:`spring`,stiffness:500,damping:25,restSpeed:10},Lc=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Rc={type:`keyframes`,duration:.8},zc={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Bc=(e,{keyframes:t})=>t.length>2?Rc:Vs.has(e)?e.startsWith(`scale`)?Lc(t[1]):Ic:zc,Vc=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function Hc(e){for(let t in e)if(!Vc.has(t))return!0;return!1}const Uc=(e,t,n,r={},i,a)=>o=>{let s=Fc(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=ha(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Hc(s)||Object.assign(u,Bc(e,u)),u.duration&&=ha(u.duration),u.repeatDelay&&=ha(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xc(u),u.delay===0&&(d=!0)),(oa.instantAnimations||oa.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,xc(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=xs(u.keyframes,s);if(e!==void 0){W.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Es(u):new Oc(u)},Wc=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gc(e){let t=Wc.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Kc(e,t,n=1){`${e}`;let[r,i]=Gc(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return sa(e)?parseFloat(e):e}return Xa(i)?Kc(i,t,n+1):i}function qc(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Jc(e,t,n,r){if(typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=qc(r);t=t(n===void 0?e.custom:n,i,a)}return t}function Yc(e,t,n){let r=e.getProps();return Jc(r,t,n===void 0?r.custom:n,e)}const Xc=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Bs]),Zc=e=>Array.isArray(e);function Qc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Nc(n))}function $c(e){return Zc(e)?e[e.length-1]||0:e}function el(e,t){let{transitionEnd:n={},transition:r={},...i}=Yc(e,t)||{};i={...i,...n};for(let t in i)Qc(e,t,$c(i[t]))}const tl=e=>!!(e&&e.getVelocity);function nl(e){return!!(tl(e)&&e.add)}function rl(e,t){let n=e.getValue(`willChange`);if(nl(n))return n.add(t);if(!n&&oa.WillChange){let n=new oa.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function il(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const al=`data-`+il(`framerAppearId`);function ol(e){return e.props[al]}function sl({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function cl(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Pc(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&sl(f,t))continue;let o={delay:n,...Fc(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){W.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=ol(e);if(n){let e=window.MotionHandoffAnimation(n,t,W);e!==null&&(o.startTime=e,p=!0)}}rl(e,t);let m=l??e.shouldReduceMotion;r.start(Uc(t,r,i,m&&Xc.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>W.update(()=>{o&&el(e,o)});d.length?Promise.all(d).then(t):t()}return d}function ll(e,t,n={}){let r=Yc(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(cl(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return ul(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function ul(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(ll(c,t,{...o,delay:n+(typeof r==`function`?0:r)+kc(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function dl(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>ll(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=ll(e,t,n);else{let i=typeof t==`function`?Yc(e,t,n.custom):t;r=Promise.all(cl(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const fl={test:e=>e===`auto`,parse:e=>e},pl=e=>t=>t.test(e),ml=[$a,G,go,ho,vo,_o,fl],hl=e=>ml.find(pl(e));function gl(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||la(e)}const _l=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function vl(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ro)||[];if(!r)return e;let i=n.replace(r,``),a=+!!_l.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const yl=/\b([a-z-]*)\(.*?\)/gu,bl={...No,getAnimatableNone:e=>{let t=e.match(yl);return t?t.map(vl).join(` `):e}},xl={...No,getAnimatableNone:e=>{let t=No.parse(e);return No.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Sl={...$a,transform:Math.round},Cl={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,rotate:ho,pathRotation:ho,rotateX:ho,rotateY:ho,rotateZ:ho,scale:to,scaleX:to,scaleY:to,scaleZ:to,skew:ho,skewX:ho,skewY:ho,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:eo,originX:yo,originY:yo,originZ:G,zIndex:Sl,fillOpacity:eo,strokeOpacity:eo,numOctaves:Sl},wl={...Cl,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:bl,WebkitFilter:bl,mask:xl,WebkitMask:xl},Tl=e=>wl[e],El=new Set([bl,xl]);function Dl(e,t){let n=Tl(e);return El.has(n)||(n=No),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ol=new Set([`auto`,`none`,`0`]);function kl(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ol.has(t)&&Eo(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Dl(n,i)}var Al=class extends ec{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Xa(r))){let i=Kc(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Xc.has(n)||e.length!==2)return;let[r,i]=e,a=hl(r),o=hl(i);if(Qa(r)!==Qa(i)&&Ks[n]){this.needsMeasurement=!0;return}if(a!==o){if(Hs(a)&&Hs(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Ks[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||gl(e[t]))&&n.push(t);n.length&&kl(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ks[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Ks[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const jl=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Ml(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const Nl=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Pl(e){return ca(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:Fl,cancel:Il}=Ba(queueMicrotask,!1),Ll={x:!1,y:!1};function Rl(){return Ll.x||Ll.y}function zl(e){return e===`x`||e===`y`?Ll[e]?null:(Ll[e]=!0,()=>{Ll[e]=!1}):Ll.x||Ll.y?null:(Ll.x=Ll.y=!0,()=>{Ll.x=Ll.y=!1})}function Bl(e,t){let n=Ml(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Vl(e){return!(e.pointerType===`touch`||Rl())}function Hl(e,t,n={}){let[r,i,a]=Bl(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!Vl(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const Ul=(e,t)=>t?e===t||Ul(e,t.parentElement):!1,Wl=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,Gl=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Kl(e){return Gl.has(e.tagName)||e.isContentEditable===!0}const ql=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Jl(e){return ql.has(e.tagName)||e.isContentEditable===!0}const Yl=new WeakSet;function Xl(e){return t=>{t.key===`Enter`&&e(t)}}function Zl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Ql=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=Xl(()=>{if(Yl.has(n))return;Zl(n,`down`);let e=Xl(()=>{Zl(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Zl(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function $l(e){return Wl(e)&&!Rl()}const eu=new WeakSet;function tu(e,t,n={}){let[r,i,a]=Bl(e,n),o=e=>{let r=e.currentTarget;if(!$l(e)||eu.has(e))return;Yl.add(r),n.stopPropagation&&eu.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Yl.has(r)&&Yl.delete(r),$l(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Ul(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Pl(e)&&(e.addEventListener(`focus`,e=>Ql(e,i)),!Kl(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function nu(e){return ca(e)&&`ownerSVGElement`in e}const ru=new WeakMap;let iu;const au=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:nu(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ou=au(`inline`,`width`,`offsetWidth`),su=au(`block`,`height`,`offsetHeight`);function cu({target:e,borderBoxSize:t}){ru.get(e)?.forEach(n=>{n(e,{get width(){return ou(e,t)},get height(){return su(e,t)}})})}function lu(e){e.forEach(cu)}function uu(){typeof ResizeObserver>`u`||(iu=new ResizeObserver(lu))}function du(e,t){iu||uu();let n=Ml(e);return n.forEach(e=>{let n=ru.get(e);n||(n=new Set,ru.set(e,n)),n.add(t),iu?.observe(e)}),()=>{n.forEach(e=>{let n=ru.get(e);n?.delete(t),n?.size||iu?.unobserve(e)})}}const fu=new Set;let pu;function mu(){pu=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};fu.forEach(t=>t(e))},window.addEventListener(`resize`,pu)}function hu(e){return fu.add(e),pu||mu(),()=>{fu.delete(e),!fu.size&&typeof pu==`function`&&(window.removeEventListener(`resize`,pu),pu=void 0)}}function gu(e,t){return typeof e==`function`?hu(e):du(e,t)}const _u={value:null,addProjectionMetrics:null};function vu(e){return nu(e)&&e.tagName===`svg`}const yu=[...ml,K,No],bu=e=>yu.find(pl(e)),xu=()=>({translate:0,scale:1,origin:0,originPoint:0}),Su=()=>({x:xu(),y:xu()}),Cu=()=>({min:0,max:0}),Y=()=>({x:Cu(),y:Cu()}),wu=new WeakMap;function Tu(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Eu(e){return typeof e==`string`||Array.isArray(e)}const Du=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Ou=[`initial`,...Du];function ku(e){return Tu(e.animate)||Ou.some(t=>Eu(e[t]))}function Au(e){return!!(ku(e)||e.variants)}function ju(e,t,n){for(let r in t){let i=t[r],a=n[r];if(tl(i))e.addValue(r,i);else if(tl(a))e.addValue(r,Nc(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Nc(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const Mu={current:null},Nu={current:!1},Pu=typeof window<`u`;function Fu(){if(Nu.current=!0,Pu){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Mu.current=e.matches;e.addEventListener(`change`,t),t()}else Mu.current=!1}}const Iu=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Lu={};function Ru(e){Lu=e}function zu(){return Lu}var Bu=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ec,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Ka.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,W.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ku(t),this.isVariantNode=Au(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&tl(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,wu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Nu.current||Fu(),this.shouldReduceMotion=Mu.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Va(this.notifyUpdate),Va(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Sc.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new pc({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:ha(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Vs.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&W.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Lu){let t=Lu[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Iu.length;t++){let n=Iu[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ju(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Nc(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(sa(n)||la(n))?n=parseFloat(n):!bu(n)&&No.test(t)&&(n=Dl(e,t)),this.setBaseTarget(e,tl(n)?n.get():n)),tl(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Jc(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!tl(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ma),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fl.render(this.render)}},Vu=class extends Bu{constructor(){super(...arguments),this.KeyframeResolver=Al}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tl(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Hu=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Uu({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Wu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gu(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ku(e){return e===void 0||e===1}function qu({scale:e,scaleX:t,scaleY:n}){return!Ku(e)||!Ku(t)||!Ku(n)}function Ju(e){return qu(e)||Yu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Yu(e){return Xu(e.x)||Xu(e.y)}function Xu(e){return e&&e!==`0%`}function Zu(e,t,n){return n+t*(e-n)}function Qu(e,t,n,r,i){return i!==void 0&&(e=Zu(e,i,r)),Zu(e,n,r)+t}function $u(e,t=0,n=1,r,i){e.min=Qu(e.min,t,n,r,i),e.max=Qu(e.max,t,n,r,i)}function ed(e,{x:t,y:n}){$u(e.x,t.translate,t.scale,t.originPoint),$u(e.y,n.translate,n.scale,n.originPoint)}const td=.999999999999,nd=1.0000000000001;function rd(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(id(e.x,-a.scroll.offset.x),id(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ed(e,o)),r&&Ju(a.latestValues)&&sd(e,a.latestValues,a.layout?.layoutBox))}t.x<nd&&t.x>td&&(t.x=1),t.y<nd&&t.y>td&&(t.y=1)}function id(e,t){e.min+=t,e.max+=t}function ad(e,t,n,r,i=.5){$u(e,t,n,q(e.min,e.max,i),r)}function od(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t,n){let r=n??e;ad(e.x,od(t.x,r.x),t.scaleX,t.scale,t.originX),ad(e.y,od(t.y,r.y),t.scaleY,t.scale,t.originY)}function cd(e,t){return Uu(Gu(e.getBoundingClientRect(),t))}function ld(e,t,n){let r=cd(e,n),{scroll:i}=t;return i&&(id(r.x,i.offset.x),id(r.y,i.offset.y)),r}const ud={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},dd=Bs.length;function fd(e,t,n){let r=``,i=!0;for(let a=0;a<dd;a++){let o=Bs[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Nl(s,Cl[o]);if(!c){i=!1;let t=ud[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Nl(a,Cl.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function pd(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Vs.has(e)){o=!0;continue}if(Ja(e)){i[e]=n;continue}{let t=Nl(n,Cl[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=fd(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function md(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function hd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const gd={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(G.test(e))e=parseFloat(e);else return e}return`${hd(e,t.target.x)}% ${hd(e,t.target.y)}%`}},_d={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=No.parse(e);if(i.length>5)return r;let a=No.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=q(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},vd={borderRadius:{...gd,applyTo:[...jl]},borderTopLeftRadius:gd,borderTopRightRadius:gd,borderBottomLeftRadius:gd,borderBottomRightRadius:gd,boxShadow:_d};function yd(e,{layout:t,layoutId:n}){return Vs.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!vd[e]||e===`opacity`)}function bd(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(tl(r[t])||i&&tl(i[t])||yd(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function xd(e){return window.getComputedStyle(e)}var Sd=class extends Vu{constructor(){super(...arguments),this.type=`html`,this.renderInstance=md}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Vs.has(t))return this.projection?.isProjecting?Is(t):Rs(e,t);{let n=xd(e),r=(Ja(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return cd(e,t)}build(e,t,n){pd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return bd(e,t,n)}};const Cd={offset:`stroke-dashoffset`,array:`stroke-dasharray`},wd={offset:`strokeDashoffset`,array:`strokeDasharray`};function Td(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Cd:wd;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Ed=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Dd(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(pd(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Ed)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Td(d,i,a,o,!1)}const Od=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),kd=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Ad(e,t,n,r){md(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Od.has(n)?n:il(n),t.attrs[n])}function jd(e,t,n){let r=bd(e,t,n);for(let n in e)if(tl(e[n])||tl(t[n])){let t=Bs.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Md=class extends Vu{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vs.has(t)){let e=Tl(t);return e&&e.default||0}return t=Od.has(t)?t:il(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return jd(e,t,n)}build(e,t,n){Dd(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Ad(e,t,n,r)}mount(e){this.isSVGTag=kd(e.tagName),super.mount(e)}};const Nd=Ou.length;function Pd(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Pd(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<Nd;n++){let r=Ou[n],i=e.props[r];(Eu(i)||i===!1)&&(t[r]=i)}return t}function Fd(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Id=[...Du].reverse(),Ld=Du.length;function Rd(e){return t=>Promise.all(t.map(({animation:t,options:n})=>dl(e,t,n)))}function zd(e){let t=Rd(e),n=Hd(),r=!0,i=!1,a=t=>(n,r)=>{let i=Yc(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Pd(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Ld;t++){let p=Id[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Eu(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Tu(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Bd(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Zc(t)&&Zc(n)?!Fd(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=Yc(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=kc(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=Yc(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Hd(),i=!0}}}function Bd(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Fd(t,e):!1}function Vd(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hd(){return{animate:Vd(!0),whileInView:Vd(),whileHover:Vd(),whileTap:Vd(),whileDrag:Vd(),whileFocus:Vd(),exit:Vd()}}function Ud(e,t){e.min=t.min,e.max=t.max}function Wd(e,t){Ud(e.x,t.x),Ud(e.y,t.y)}function Gd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Kd(e){return e.max-e.min}function qd(e,t,n){return Math.abs(e-t)<=n}function Jd(e,t,n,r=.5){e.origin=r,e.originPoint=q(t.min,t.max,e.origin),e.scale=Kd(n)/Kd(t),e.translate=q(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function Yd(e,t,n,r){Jd(e.x,t.x,n.x,r?r.originX:void 0),Jd(e.y,t.y,n.y,r?r.originY:void 0)}function Xd(e,t,n,r=0){e.min=(r?q(n.min,n.max,r):n.min)+t.min,e.max=e.min+Kd(t)}function Zd(e,t,n,r){Xd(e.x,t.x,n.x,r?.x),Xd(e.y,t.y,n.y,r?.y)}function Qd(e,t,n,r=0){let i=r?q(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Kd(t)}function $d(e,t,n,r){Qd(e.x,t.x,n.x,r?.x),Qd(e.y,t.y,n.y,r?.y)}function ef(e,t,n,r,i){return e-=t,e=Zu(e,1/n,r),i!==void 0&&(e=Zu(e,1/i,r)),e}function tf(e,t=0,n=1,r=.5,i,a=e,o=e){if(go.test(t)&&(t=parseFloat(t),t=q(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=q(a.min,a.max,r);e===a&&(s-=t),e.min=ef(e.min,t,n,s,i),e.max=ef(e.max,t,n,s,i)}function nf(e,t,[n,r,i],a,o){tf(e,t[n],t[r],t[i],t.scale,a,o)}const rf=[`x`,`scaleX`,`originX`],af=[`y`,`scaleY`,`originY`];function of(e,t,n,r){nf(e.x,t,rf,n?n.x:void 0,r?r.x:void 0),nf(e.y,t,af,n?n.y:void 0,r?r.y:void 0)}function sf(e){return e.translate===0&&e.scale===1}function cf(e){return sf(e.x)&&sf(e.y)}function lf(e,t){return e.min===t.min&&e.max===t.max}function uf(e,t){return lf(e.x,t.x)&&lf(e.y,t.y)}function df(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ff(e,t){return df(e.x,t.x)&&df(e.y,t.y)}function pf(e){return Kd(e.x)/Kd(e.y)}function mf(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function hf(e){return[e(`x`),e(`y`)]}function gf(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const _f=jl.length,vf=e=>typeof e==`string`?parseFloat(e):e,yf=e=>typeof e==`number`||G.test(e);function bf(e,t,n,r,i,a){i?(e.opacity=q(0,n.opacity??1,Sf(r)),e.opacityExit=q(t.opacity??1,0,Cf(r))):a&&(e.opacity=q(t.opacity??1,n.opacity??1,r));for(let i=0;i<_f;i++){let a=jl[i],o=xf(t,a),s=xf(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||yf(o)===yf(s)?(e[a]=Math.max(q(vf(o),vf(s),r),0),(go.test(s)||go.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=q(t.rotate||0,n.rotate||0,r))}function xf(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Sf=wf(0,.5,Oa),Cf=wf(.5,.95,da);function wf(e,t,n){return r=>r<e?0:r>t?1:n(pa(e,t,r))}function Tf(e,t,n){let r=tl(e)?e:Nc(e);return r.start(Uc(``,r,t,n)),r.animation}function Ef(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Df=(e,t)=>e.depth-t.depth;var Of=class{constructor(){this.children=[],this.isDirty=!1}add(e){ra(this.children,e),this.isDirty=!0}remove(e){ia(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Df),this.isDirty=!1,this.children.forEach(e)}};function kf(e,t){let n=Ka.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Va(r),e(a-t))};return W.setup(r,!0),()=>Va(r)}function Af(e){return tl(e)?e.get():e}var jf=class{constructor(){this.members=[]}add(e){ra(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(ia(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(ia(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const Mf={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Nf={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Pf=[``,`X`,`Y`,`Z`];let Ff=0;function If(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Lf(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=ol(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,W,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Lf(r)}function Rf({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Ff++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_u.value&&(Nf.nodes=Nf.calculatedTargetDeltas=Nf.calculatedProjections=0),this.nodes.forEach(Vf),this.nodes.forEach(Xf),this.nodes.forEach(Zf),this.nodes.forEach(Hf),_u.addProjectionMetrics&&_u.addProjectionMetrics(Nf)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Of)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ma),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=nu(t)&&!vu(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;W.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=kf(i,250),Mf.hasAnimatedSinceResize&&(Mf.hasAnimatedSinceResize=!1,this.nodes.forEach(Yf)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||ip,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!ff(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Fc(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Yf(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Va(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Qf),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Lf(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Gf),this.nodes.forEach(Wf);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Kf);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qf),this.nodes.forEach(Jf),this.nodes.forEach(zf),this.nodes.forEach(Bf)):this.nodes.forEach(Kf),this.clearAllSnapshots();let e=Ka.now();Ha.delta=aa(0,1e3/60,e-Ha.timestamp),Ha.timestamp=e,Ha.isProcessing=!0,Ua.update.process(Ha),Ua.preRender.process(Ha),Ua.render.process(Ha),Ha.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach($f)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,W.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){W.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Kd(this.snapshot.measuredBox.x)&&!Kd(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!cf(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Ju(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),cp(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(up))){let{scroll:e}=this.root;e&&(id(t.x,e.offset.x),id(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Wd(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Wd(t,e),id(t.x,i.offset.x),id(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Wd(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(id(r.x,-n.scroll.offset.x),id(r.y,-n.scroll.offset.y)),Ju(n.latestValues)&&sd(r,n.latestValues,n.layout?.layoutBox)}return Ju(this.latestValues)&&sd(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Wd(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Ju(n.latestValues))continue;let r;n.instance&&(qu(n.latestValues)&&n.updateSnapshot(),r=Y(),Wd(r,n.measurePageBox())),of(t,n.latestValues,n.snapshot?.layoutBox,r)}return Ju(this.latestValues)&&of(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ha.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ha.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Zd(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Wd(this.target,this.layout.layoutBox),ed(this.target,this.targetDelta)):Wd(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),_u.value&&Nf.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||qu(this.parent.latestValues)||Yu(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),$d(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Wd(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ha.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Wd(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;rd(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gd(this.prevProjectionDelta.x,this.projectionDelta.x),Gd(this.prevProjectionDelta.y,this.projectionDelta.y)),Yd(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!mf(this.projectionDelta.x,this.prevProjectionDelta.x)||!mf(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_u.value&&Nf.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Su(),this.projectionDelta=Su(),this.projectionDeltaWithTransform=Su()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Su();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(rp));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=q(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=q(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ep(o.x,e.x,n),ep(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($d(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),np(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&uf(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Wd(f,this.relativeTarget)),c&&(this.animationValues=a,bf(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Va(this.pendingAnimation),void 0),this.pendingAnimation=W.update(()=>{Mf.hasAnimatedSinceResize=!0,this.motionValue||=Nc(0),this.motionValue.jump(0,!1),this.currentAnimation=Tf(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&lp(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Kd(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Kd(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Wd(t,n),sd(t,i),Yd(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new jf),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&If(`z`,e,r,this.animationValues);for(let t=0;t<Pf.length;t++)If(`rotate${Pf[t]}`,e,r,this.animationValues),If(`skew${Pf[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Af(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Af(t?.pointerEvents)||``),this.hasProjected&&!Ju(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=gf(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in vd){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=vd[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Af(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Wf),this.root.sharedNodes.clear()}}}function zf(e){e.updateLayout()}function Bf(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)hf(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Kd(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Ud(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else lp(i,t.layoutBox,n)&&hf(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Kd(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Su();Yd(o,n,t.layoutBox);let s=Su();a?Yd(s,e.applyTransform(r,!0),t.measuredBox):Yd(s,n,t.layoutBox);let c=!cf(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Y();$d(s,t.layoutBox,i.layoutBox,o);let c=Y();$d(c,n,a.layoutBox,o),ff(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Vf(e){_u.value&&Nf.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Hf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function Wf(e){e.clearMeasurements()}function Gf(e){e.isLayoutDirty=!0,e.updateLayout()}function Kf(e){e.isLayoutDirty=!1}function qf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Jf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Yf(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xf(e){e.resolveTargetDelta()}function Zf(e){e.calcProjection()}function Qf(e){e.resetSkewAndRotation()}function $f(e){e.removeLeadSnapshot()}function ep(e,t,n){e.translate=q(t.translate,0,n),e.scale=q(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function tp(e,t,n,r){e.min=q(t.min,n.min,r),e.max=q(t.max,n.max,r)}function np(e,t,n,r){tp(e.x,t.x,n.x,r),tp(e.y,t.y,n.y,r)}function rp(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ip={duration:.45,ease:[.4,0,.1,1]},ap=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),op=ap(`applewebkit/`)&&!ap(`chrome/`)?Math.round:da;function sp(e){e.min=op(e.min),e.max=op(e.max)}function cp(e){sp(e.x),sp(e.y)}function lp(e,t,n){return e===`position`||e===`preserve-aspect`&&!qd(pf(t),pf(n),.2)}function up(e){return e!==e.root&&e.scroll?.wasRoot}const dp=Rf({attachResizeListener:(e,t)=>Ef(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),fp={current:void 0},pp=Rf({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fp.current){let e=new dp({});e.mount(window),e.setOptions({layoutScroll:!0}),fp.current=e}return fp.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),mp=d({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function hp(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function gp(...e){return t=>{let n=!1,r=e.map(e=>{let r=hp(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():hp(e[t],null)}}}}function _p(...e){return a.useCallback(gp(...e),e)}var vp=class extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Pl(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Pl(e)&&e.offsetWidth||0,r=Pl(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function yp({children:e,isPresent:n,anchorX:r,anchorY:i,root:o,pop:s}){let c=v(),l=C(null),u=C({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=g(mp),f=_p(l,s===!1?void 0:e.props?.ref??e?.ref);return b(()=>{let{width:e,height:t,top:a,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=r===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=i===`bottom`?`bottom: ${m}`:`top: ${a}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
189
189
|
[data-motion-pop-id="${c}"] {
|
|
190
190
|
position: absolute !important;
|
|
191
191
|
width: ${e}px !important;
|
|
@@ -279,9 +279,9 @@ let n=p(({className:n,...r},i)=>f(je,{ref:i,iconNode:t,className:Ce(`lucide-${we
|
|
|
279
279
|
text-align: center !important;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
`,DT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`- Select end`})]}):t(`span`,{className:`text-muted`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(yT,{_open:o,onOpenChange:s,children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-
|
|
282
|
+
`,DT=({filterValues:r,setFilterValues:i,isRange:a=!1})=>{let[o,s]=w(!1),[c,l]=w([null,null]),{t:u}=k(),d=r[0]?Q(r[0]).toDate():void 0,f=a?[c[0]||(r[0]?Q(r[0]).toDate():null),c[1]||(r[1]?Q(r[1]).toDate():null)]:[null,null];_(()=>{a&&l([r[0]?Q(r[0]).toDate():null,r[1]?Q(r[1]).toDate():null])},[r,a]);let p=()=>a?f[0]&&f[1]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`-`}),t(`span`,{className:`font-medium`,children:Q(f[1]).format(`MMMM DD, YYYY`)})]}):f[0]?n(`span`,{className:`flex items-center gap-1.5`,children:[t(`span`,{className:`font-medium`,children:Q(f[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`- Select end`})]}):t(`span`,{className:`text-muted`,children:u(`filter.selectRange`)}):d?Q(d).format(`MMMM DD, YYYY`):`Pick a date`,m=e=>{if(a)Array.isArray(e)&&(l([e[0],e[1]]),e[0]&&e[1]?i([Q(e[0]).format(`YYYY-MM-DD`),Q(e[1]).format(`YYYY-MM-DD`)]):e[0]&&i([Q(e[0]).format(`YYYY-MM-DD`)]));else if(e){let t=Array.isArray(e)?e[0]:e;t&&(i([Q(t).format(`YYYY-MM-DD`)]),s(!1))}};return n(yT,{_open:o,onOpenChange:s,children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center min-h-[20px]`,children:p()})}),t(CT,{className:`w-auto p-0`,align:`start`,side:`bottom`,alignOffset:-4,sideOffset:6,children:t(`div`,{className:`p-2`,children:a?n(e,{children:[n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:f,onChange:m,selectRange:!0,returnValue:`range`,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(f[0]){let e=f[0].getTime();if(f[1]){let n=f[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}})]}),f[0]&&f[1]&&t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>s(!1),children:`Cancel`}),t(U,{size:`sm`,onClick:()=>s(!1),children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:d,onChange:m,selectRange:!1,maxDate:(()=>{let e=new Date;return e.setHours(23,59,59,999),e})(),className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let 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``}})]})})})]})};function OT({value:n,labelRenderer:r,fallbackLabel:i}){let[a,o]=w(i||n),[s,c]=w(!1);return _(()=>{if(!r){o(i||n);return}(async()=>{c(!0);try{let e=r(n);if(e instanceof Promise){let t=await e;o(t)}else o(e)}catch(e){console.error(`Error rendering label:`,e),o(i||n)}finally{c(!1)}})()},[n,r,i]),s?t(`span`,{className:`text-muted`,children:`Loading...`}):t(e,{children:a})}const kT=({filterType:r,filterValues:i,setFilterValues:a,options:o,labelRenderer:s,multiple:c=!0})=>{let[l,u]=w(!1),[d,f]=w(``),p=C(null),{t:m}=k(),h=o?.filter(e=>!i.some(t=>t.value===e.value));return n(yT,{_open:l,onOpenChange:e=>{u(e),e||setTimeout(()=>{f(``)},200)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 transition text-muted hover:text-info shrink-0`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:i?.length===1?(()=>{let e=i[0];return t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})})():`${i?.length} selected`})}),t(CT,{className:`w-[300px] p-0`,children:t(Wx,{children:n(dv,{children:[t(pv,{placeholder:r,className:`h-9`,value:d,onInputCapture:e=>{f(e.currentTarget.value)},ref:p}),n(mv,{children:[t(hv,{children:m(`filter.noResultsFound`)}),t(gv,{children:i.map(e=>n(vv,{className:`group flex gap-2 items-center`,onSelect:()=>{a(i.filter(t=>t.value!==e.value)),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(`input`,{type:`checkbox`,checked:!0,onChange:()=>{}}),t(OT,{value:e.value||``,labelRenderer:s,fallbackLabel:e.label})]},e.value))}),h?.length>0&&n(e,{children:[t(_v,{}),t(gv,{children:h.filter(e=>String(e.label||e.value).toLowerCase().includes(d.toLowerCase())).map(e=>n(vv,{className:`group flex gap-2 items-center`,value:String(e.label||e.value),onSelect:()=>{let t={value:e.value,label:e.label};a(c?[...i,t]:[t]),setTimeout(()=>{f(``)},200),u(!1)},children:[c&&t(rg,{checked:!1,className:`opacity-0 group-data-[selected=true]:opacity-100`}),t(`span`,{className:`text-muted`,children:t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||s,fallbackLabel:e.label})})]},e.value))})]})]})]})})})]})},AT=({filterType:e,filterValues:r,setFilterValues:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&JSON.stringify(s)!==JSON.stringify(r)&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r.length>0?r.length===1?r[0]:`${r.length} tags`:`Add tags...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-3`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(Ki,{value:s,onChange:c,placeholder:`Add ${e.toLowerCase()}...`}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{size:`sm`,variant:`ghost`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})]})})]})},jT=A(``,{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 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 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 focus:ring-2 focus:ring-inset focus:ring-ring ring-offset-background`}},defaultVariants:{size:`md`,variant:`default`}}),MT=a.forwardRef(({className:e,type:r,size:i=`md`,variant:a=`default`,clearable:o=!0,onChange:s,value:c,invalid:l,...u},d)=>{let f=()=>{s?.(``)},p=e=>{s?.(e.target.value)},m=u[`aria-invalid`]??(l?!0:void 0);return n(`div`,{className:`w-full relative inline-block [&:hover_.clear-button]:opacity-100`,children:[t(`input`,{type:r,className:z(jT({size:i,variant:a}),e,o&&c?`pe-8`:``),ref:d,value:c??``,onChange:p,...u,"aria-invalid":m}),o&&c&&!u.readOnly&&!u.disabled&&t(U,{variant:`link`,size:`icon`,type:`button`,onClick:f,className:`clear-button opacity-0 transition-opacity duration-200
|
|
283
283
|
absolute top-1/2 -translate-y-1/2 text-muted !hover:text-destructive cursor-pointer
|
|
284
|
-
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Ze,{size:16})})]})});MT.displayName=`Input`;const NT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-primary shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function PT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let 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]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-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()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{if(d[0]){let 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);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function FT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(vv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function IT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(Ki,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function LT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function RT(e,n,r){switch(e.type){case`date`:return t(DT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(NT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(AT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(kT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function zT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),RT(e,r,i),t(U,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-primary hover:bg-muted/50 transition shrink-0`,children:t(Ze,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const BT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),VT=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!(a||!c||r.length===0))try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),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(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(BT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},HT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(BT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>GT(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(hv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(vv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(yT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(xT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(He,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(CT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(dv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(pv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(mv,{children:t(gv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(PT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(LT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(IT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(FT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},UT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(BT);return t(`div`,{className:z(e),children:t(zT,{filters:n,setFilters:r,filterGroups:i})})},WT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(BT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function GT(e){return typeof e==`string`?e:e.value||``}var KT;(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`})(KT||={});const qT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({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`,e),...r})});qT.displayName=`Heading`;function JT({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?YT(e,T)===YT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?YT(e,T)===YT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(YT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(vv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]}):n(wT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(qe,{className:`size-4`})}),t(MT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(dv,{className:`overflow-hidden`,children:n(mv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(hv,{children:`No result found.`}),Se?Se.map(e=>t(gv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(gv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(Je,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(Ue,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(yT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(xT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(Ue,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(bi,{description:k,placement:`top`,asChild:!0,children:t(Xe,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ie,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(Ze,{className:`size-4`})})]}),t(CT,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function YT(e,t){return typeof e==`object`&&e?e[t]:void 0}const XT={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function ZT({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(JT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>XT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var QT=Object.defineProperty,$T=a.forwardRef(((e,t)=>QT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const eE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),tE=a.forwardRef(({className:e,required:r,...i},a)=>n($T,{ref:a,className:z(eE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));tE.displayName=$T.displayName;function nE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Re,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(Xe,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Le,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Ve,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Ve,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Ve,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function rE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(nE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function iE({title:e,className:n,children:r}){return t(nE,{status:`info`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(nE,{status:`warning`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(nE,{status:`success`,title:e,className:n,children:r})}function sE({title:e,className:n,children:r}){return t(nE,{status:`default`,title:e,className:n,children:r})}function cE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{!g||s||i()};return n($_,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(Xe,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(ev,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(zi,{label:l??u,children:t(MT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(nv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function lE(){return g(uE)}const uE=d(()=>{}),dE={success:Le,error:Re,warning:Xe,info:Ve},fE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function pE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=dE[e.status]||Ve,u=fE[e.status]||`text-info`;return t(`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:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(Tp,{onExitComplete:r,children:i&&t(vh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`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:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(Ze,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function mE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(uE.Provider,{value:o,children:r}),i&&t(Ch,{children:t(pE,{data:i,onClose:()=>o(null)})})]})}function hE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=lE();return t(cE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const gE=4,_E={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-primary`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function vE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function yE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Tx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Dx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Ne,{className:`ms-1 size-4`})]})}),t(Ox,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function bE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=_E[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=vE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Ne,{className:c.icon})]})]}),n(`div`,{className:z(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(yE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Ne,{className:c.icon}),children:p.map(e=>t(Ax,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-primary`),children:e.label},e.name))})]})]})}function xE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Ne:Fe,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(Ii,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var SE=Object.defineProperty,CE=(e,t)=>SE(e,`name`,{value:t,configurable:!0}),wE=`Radio`,[TE,EE]=an(wE),[DE,OE]=TE(wE);function kE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:CE(()=>l?.(),`onCheck`)};return t(DE,{scope:n,...b,children:IE(f)?f(b):i})}CE(kE,`RadioProvider`);var AE=`RadioTrigger`,jE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=OE(AE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":LE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),ME=`RadioIndicator`,NE=a.forwardRef(CE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=OE(ME,r);return t(or,{present:i||o.checked,children:t(H.span,{"data-state":LE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),PE=`RadioBubbleInput`,FE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=OE(PE,e),_=R(i,m),v=Pn(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function IE(e){return typeof e==`function`}CE(IE,`isFunction`);function LE(e){return e?`checked`:`unchecked`}CE(LE,`getState`);var RE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],zE=`RadioGroup`,[BE,VE]=an(zE,[Xv,EE]),HE=Xv(),UE=EE(),[WE,GE]=BE(zE),KE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=HE(r),_=fe(f),[v,y]=br({prop:c,defaultProp:s??null,onChange:m,caller:zE}),[b,x]=a.useState(null),S=R(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=CE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(WE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(cy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),qE=`RadioGroupItemProvider`,JE=`RadioGroupItemTrigger`;function YE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=GE(qE,n),c=UE(n),l=s.disabled||i;return t(kE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}CE(YE,`RadioGroupItemProvider`);var XE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=HE(r),s=UE(r),{checked:c,disabled:l}=OE(JE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=CE(e=>{RE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=CE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(ly,{asChild:!0,...o,focusable:!l,active:c,children:t(jE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),ZE=a.forwardRef(CE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(YE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(XE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(QE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),QE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(FE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),$E=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(NE,{...a,...i,ref:n})},`RadioGroupIndicator`));function eD({className:e,...n}){return t(ZE,{"data-slot":`radio-group-item`,className:z(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t($E,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var tD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function nD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(KE,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(ZE,{value:o(e),className:z(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function rD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function iD(e){return typeof e==`number`?`${e}%`:e}function aD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:iD(e),minSize:iD(n),maxSize:iD(r),collapsedSize:iD(i),...a})}function oD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`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 aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(We,{className:`size-4 rotate-90`})})})}var sD=Object.defineProperty,cD=(e,t)=>sD(e,`name`,{value:t,configurable:!0}),lD=`horizontal`,uD=[`horizontal`,`vertical`],dD=a.forwardRef(cD(function(e,n){let{decorative:r,orientation:i=lD,...a}=e,o=fD(i)?i:lD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function fD(e){return uD.includes(e)}cD(fD,`isValidOrientation`);var pD=dD;const mD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(pD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));mD.displayName=pD.displayName;var hD=Object.defineProperty,gD=(e,t)=>hD(e,`name`,{value:t,configurable:!0});function _D(e,[t,n]){return Math.min(n,Math.max(t,e))}gD(_D,`clamp`);var vD=Object.defineProperty,yD=(e,t)=>vD(e,`name`,{value:t,configurable:!0});function bD(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yD(bD,`usePrevious`);var xD=Object.defineProperty,$=(e,t)=>xD(e,`name`,{value:t,configurable:!0}),SD=[`PageUp`,`PageDown`],CD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],wD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},TD=`Slider`,[ED,DD,OD]=Sv(TD),[kD,AD]=an(TD,[OD]),[jD,MD]=kD(TD),ND=a.forwardRef($(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?ID:LD,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=br({prop:f,defaultProp:d,onChange:$(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,tO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=oO(s),a=_D(sO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=QD(e,a,t);if(iO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),t(jD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(ED.Provider,{scope:e.__scopeSlider,children:t(ED.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=SD.includes(e.key)||e.shiftKey&&CD.includes(e.key)?10:1,r=y.current,a=T[r];M(cO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[PD,FD]=kD(TD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ID=a.forwardRef($(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=R(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=aO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(RD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=wD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),LD=a.forwardRef($(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=aO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(RD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=wD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),RD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=MD(TD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):SD.concat(CD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),zD=`SliderTrack`,BD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(zD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),VD=`SliderRange`,HD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=MD(VD,r),s=FD(VD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>$D(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[UD,WD]=kD(`SliderThumb`),GD=`SliderThumbProvider`;function KD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=MD(GD,n),c=DD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Pn(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:$D(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return t(UD,{scope:n,..._,children:lO(o)?o(_):i})}$(KD,`SliderThumbProvider`);var qD=`SliderThumbTrigger`,JD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(qD,r),o=FD(qD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=WD(qD,r),f=R(n,d),p=eO(s,a.values.length),m=u?.[o.size],h=m?nO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(ED.ItemSlot,{scope:r,children:t(H.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),YD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(KD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(JD,{...s,ref:i,__scopeSlider:a}),o?t(ZD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),XD=`SliderBubbleInput`,ZD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=WD(XD,e),c=a.useRef(null),l=R(c,r),u=bD(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function QD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(QD,`getNextSortedValues`);function $D(e,t,n){return _D(100/(n-t)*(e-t),[0,100])}$($D,`convertValueToPercentage`);function eO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(eO,`getLabel`);function tO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(tO,`getClosestValueIndex`);function nO(e,t,n){let r=e/2;return(r-aO([0,50],[0,r])(t)*n)*n}$(nO,`getThumbInBoundsOffset`);function rO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(rO,`getStepsBetweenValues`);function iO(e,t){if(t>0){let n=rO(e);return Math.min(...n)>=t}return!0}$(iO,`hasMinStepsBetweenValues`);function aO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(aO,`linearScale`);function oO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(oO,`getDecimalCount`);function sO(e,t){let n=10**t;return Math.round(e*n)/n}$(sO,`roundValue`);function cO(e,{min:t,step:n,direction:r,multiplier:i}){let a=oO(n),o=(e-t)/n,s=Math.round(o),c=sO(s*n+t,a)===sO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),sO(l*n+t,a)}$(cO,`getNextStepValue`);function lO(e){return typeof e==`function`}$(lO,`isFunction`);const uO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(ND,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(BD,{"data-slot":`slider-track`,className:z(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(HD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(YD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,o)},e))]})});uO.displayName=ND.displayName;var dO=Object.defineProperty,fO=(e,t)=>dO(e,`name`,{value:t,configurable:!0}),pO=`Switch`,[mO,hO]=an(pO),[gO,_O]=mO(pO);function vO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:pO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return t(gO,{scope:n,...C,children:EO(p)?p(C):i})}fO(vO,`SwitchProvider`);var yO=`SwitchTrigger`,bO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=_O(yO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=fO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":DO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),xO=a.forwardRef(fO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(vO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bO,{...m,ref:i,__scopeSwitch:a}),r&&t(TO,{__scopeSwitch:a})]})})},`Switch`)),SO=`SwitchThumb`,CO=a.forwardRef(fO(function(e,n){let{__scopeSwitch:r,...i}=e,a=_O(SO,r);return t(H.span,{"data-state":DO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),wO=`SwitchBubbleInput`,TO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=_O(wO,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function EO(e){return typeof e==`function`}fO(EO,`isFunction`);function DO(e){return e?`checked`:`unchecked`}fO(DO,`getState`);const OO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function kO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=OO[r],f=t(xO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(CO,{"data-slot":`switch-thumb`,className:z(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var AO=Object.defineProperty,jO=(e,t)=>AO(e,`name`,{value:t,configurable:!0}),MO=`Tabs`,[NO,PO]=an(MO,[Xv]),FO=Xv(),[IO,LO]=NO(MO),RO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=br({prop:i,onChange:a,defaultProp:o??``,caller:MO});return t(IO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),zO=`TabsList`,BO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=LO(zO,r),s=FO(r);return t(cy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),VO=`TabsTrigger`,HO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=LO(VO,r),c=FO(r),l=GO(s.baseId,i),u=KO(s.baseId,i),d=i===s.value;return t(ly,{asChild:!0,...c,focusable:!a,active:d,children:t(H.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),UO=`TabsContent`,WO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=LO(UO,r),u=GO(l.baseId,i),d=KO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(or,{present:o||f,children:({present:r})=>t(H.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function GO(e,t){return`${e}-trigger-${t}`}jO(GO,`makeTriggerId`);function KO(e,t){return`${e}-content-${t}`}jO(KO,`makeContentId`);var qO=RO,JO=BO,YO=HO,XO=WO;const ZO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),QO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(ZO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(qO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},$O=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(ZO),h=c!==0,g=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(JT,{label:`Tab`,className:z(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{g(e.name)}})}),t(tk,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(nk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},ek=({className:n})=>{let{tabs:r}=a.useContext(ZO);return r?t(e,{children:r.map(e=>t(rk,{value:e.name,className:n,children:e.content},e.name))}):null},tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ZO.Provider,{value:{size:n,variant:r},children:t(JO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ZO),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(YO,{ref:o,className:z(r===`tabs`?z(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-primary`,`disabled:pointer-events-none disabled:opacity-50`):z(`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`),e,s?`w-1/${s}`:``),onClick:c,...i})});nk.displayName=YO.displayName;const rk=a.forwardRef(({className:e,...n},r)=>t(XO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));rk.displayName=XO.displayName;const ik=A(`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`}}),ak=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(ik({size:n,weight:r,className:e})),...i}));ak.displayName=`Text`;function ok({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:z(`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`,s&&`resize-none`,e),...a})}const sk=d({theme:`system`,setTheme:()=>null});function ck({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(sk.Provider,{...i,value:c,children:e})}const lk=()=>{let e=g(sk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function dk({label:e,className:r}={}){let{setTheme:i,theme:a}=lk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(uk,{current:a,option:`system`,setTheme:i,icon:t(L,{}),alt:o(`theme.system`)}),t(uk,{current:a,option:`light`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.light`)}),t(uk,{current:a,option:`dark`,setTheme:i,icon:t(Ge,{}),alt:o(`theme.dark`)})]})]})}function fk(e,n){return{label:String(e),check:t(n?Me:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function pk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(MT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(fk(e,r),i)):i=fk(e,r),t(mk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function mk({option:e,onSelect:i,layout:a,noCheck:o}){return n(U,{variant:`unstyled`,size:`none`,className:r(`group !flex w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function hk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(vh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(vh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(We,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(gk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})}function gk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Ze,{className:`size-6`,"aria-hidden":`true`})})}function _k(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 Error(`Unexpected size: ${e}`)}}function vk({size:e,className:i}){let a=_k(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-primary`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`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`})]})}function yk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(vT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(xT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors flex-shrink-0`,children:t(Ze,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-primary/20 text-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-primary/30 rounded-sm transition-colors`,children:t(Ze,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(CT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:Bi(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-primary/20 text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(U,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-primary`,b===P.length?`bg-primary/20`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function bk(e){return t(yT,{click:!0,children:t(yk,{...e})})}function xk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
284
|
+
flex items-center justify-center size-6 rounded end-2`,"aria-label":`Clear input`,children:t(Ze,{size:16})})]})});MT.displayName=`Input`;const NT=({filterType:e,filterValue:r,setFilterValue:i})=>{let[a,o]=w(!1),[s,c]=w(r);return n(yT,{_open:a,onOpenChange:e=>{o(e),!e&&s!==r&&c(r)},children:[t(xT,{className:`rounded-none p-1 h-8 bg-muted hover:bg-muted/50 text-muted hover:text-info shrink-0 transition`,children:t(`div`,{className:`flex gap-1.5 items-center`,children:r||`Enter text...`})}),t(CT,{className:`w-[300px] p-3`,children:n(`div`,{className:`flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:e})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:s,onChange:c,onKeyDown:e=>{e.key===`Enter`&&(i(s),o(!1))},placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:()=>{c(r),o(!1)},children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{i(s),o(!1)},children:`Apply`})]})})]})})]})};function PT({selectedView:r,selectedDate:i,setSelectedDate:a,setFilters:o,filters:s,handleClose:c,filterGroups:l}){let{t:u}=k(),[d,f]=w([null,null]),[p,m]=w([null,null]),h=l.find(e=>e.name===r),g=h?.multiple,_=new Date;_.setHours(23,59,59,999);let v=[p[0]||d[0],p[1]||d[1]],y=e=>{if(g)Array.isArray(e)?(m([e[0],e[1]]),f([e[0],e[1]])):(m([e,null]),f([e,null]));else{let t=Array.isArray(e)?e[0]:e;if(a(t||void 0),t){let e=new Date(t);e.setHours(0,0,0,0),o([...s,{name:r||``,placeholder:h?.placeholder,value:[{value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}],type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}}};return t(`div`,{className:`p-2`,children:g?n(e,{children:[t(`div`,{children:g?v[0]&&v[1]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:u(`filter.to`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[1]).format(`MMMM DD, YYYY`)})]}):v[0]?n(`span`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`text-xs text-muted`,children:u(`filter.from`)}),t(`span`,{className:`text-xs font-medium`,children:Q(v[0]).format(`MMMM DD, YYYY`)}),t(`span`,{className:`text-xs text-muted`,children:`→ Select end date`})]}):t(`span`,{className:`text-muted text-xs`,children:h?.placeholder||h?.name||r||`Select date range`}):i?Q(i).format(`MMMM DD, YYYY`):`Pick a date`}),n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:v,onChange:y,selectRange:!0,returnValue:`range`,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let 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]){let e=v[0].getTime();if(v[1]){let n=v[1].getTime();if(t===e)return`bg-primary text-primary-foreground rounded-s-md font-semibold`;if(t===n)return`bg-primary text-primary-foreground rounded-e-md font-semibold`;if(t>e&&t<n)return`bg-info text-info font-medium`}else if(t===e)return`bg-primary text-primary-foreground rounded-md font-semibold`}}return``}},`${v[0]?.getTime()}-${v[1]?.getTime()}`)]}),t(`div`,{className:`border-t pt-2`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:c,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{if(d[0]){let 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);let n=[];n.push({value:e.toISOString(),label:Q(e).format(`LLL dd, y`)}),d[1]&&d[0].getTime()!==d[1].getTime()&&n.push({value:t.toISOString(),label:Q(t).format(`LLL dd, y`)}),o([...s,{name:r||``,placeholder:h?.placeholder,value:n,type:h?.type||`date`,multiple:h?.multiple||!1}]),c()}},disabled:!v[0],children:`Apply`})]})})]}):n(`div`,{className:`calendar-wrapper`,children:[t(`style`,{children:ET}),t(zw,{value:i,onChange:y,selectRange:!1,maxDate:_,className:`mb-2 border-0`,tileClassName:({date:e,view:t})=>{if(t===`month`){let t=e.getTime(),n=new Date;if(n.setHours(23,59,59,999),t>n.getTime())return`text-muted/20 cursor-not-allowed`;if(i&&t===i.getTime())return`bg-primary text-primary-foreground rounded-md font-semibold`}return``}})]})})}function FT({selectedView:e,commandInput:r,setFilters:i,handleClose:a,filterGroups:o}){let[s,c]=w([]),l=e=>{let t=o.find(t=>t.name===e);if(!t)return[];let n=t.options||[];if(!r.trim())return n;if(t.filterBy){let e=r.toLowerCase();return n.filter(n=>n.value!==void 0&&t.filterBy?.(n.value,e))}let i=r.toLowerCase();return n.filter(e=>String(e.value||``).toLowerCase().includes(i))};if(!e)return null;let u=l(e),d=o.find(t=>t.name===e),f=d?.placeholder||d?.name,p=()=>{s.length>0&&i(t=>[...t.filter(t=>t.name!==e),{name:e||``,placeholder:d?.placeholder||``,value:s,type:d?.type||`select`,multiple:d?.multiple||!1}]),a()},m=t=>{let n={value:t.value,label:t.label};d?.multiple?s.some(e=>e.value===t.value)?c(e=>e.filter(e=>e.value!==t.value)):c(e=>[...e,n]):(i(t=>{let r=t.findIndex(t=>t.name===e);if(r>=0){let e=[...t];return e[r]={...e[r],value:[n]},e}return[...t,{name:e||``,placeholder:d?.placeholder||``,value:[n],type:d?.type||`select`,multiple:d?.multiple||!1}]}),a())};return n(`div`,{className:`flex flex-col h-full`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted shrink-0`,children:t(`span`,{children:f})}),t(`div`,{className:`flex-1 overflow-hidden min-h-0`,children:t(`div`,{className:`max-h-[200px] overflow-y-auto`,children:u.length>0&&u.map(e=>{let r=s.some(t=>t.value===e.value);return n(vv,{className:`group flex gap-2 items-center w-full hover:bg-muted ${d?.multiple&&r?`bg-muted`:``}`,onSelect:()=>m(e),children:[t(OT,{value:e.value||``,labelRenderer:e.labelRenderer||d?.labelRenderer,fallbackLabel:e.label}),d?.multiple&&r&&t(`span`,{className:`ms-auto text-xs text-success`,children:`✓`})]},e.value||`option-${Math.random()}`)})})}),d?.multiple&&t(`div`,{className:`p-2 border-t shrink-0`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:a,children:`Cancel`}),t(U,{size:`sm`,onClick:p,disabled:s.length===0,children:`Apply`})]})})]})}function IT({selectedView:e,setFilters:r,handleClose:i,filterGroups:a}){let[o,s]=w([]),c=a.find(t=>t.name===e);return n(`div`,{className:`p-2 space-y-3`,children:[t(`div`,{className:`space-y-2`,children:t(Ki,{value:o,onChange:s,placeholder:c?.placeholder||`Add ${e}...`,autoFocus:!0})}),n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:i,children:`Cancel`}),t(U,{size:`sm`,onClick:()=>{o.length>0&&r(t=>[...t.filter(t=>t.name!==e),{name:e,placeholder:c?.placeholder,value:o,type:`stringList`}]),i()},disabled:o.length===0,children:`Apply`})]})]})}function LT({selectedView:e,textValue:r,setTextValue:i,setFilters:a,handleClose:o,filterGroups:s}){let c=()=>{a(t=>[...t,{name:e||``,placeholder:s.find(t=>t.name===e)?.placeholder,value:[{value:r,label:r}],type:`text`}]),o()};return n(`div`,{className:`p-2 flex flex-col gap-1`,children:[t(`div`,{className:`flex items-center p-1.5 text-xs text-muted`,children:t(`span`,{children:s.find(t=>t.name===e)?.placeholder})}),t(MT,{autoFocus:!0,type:`text`,size:`sm`,value:r,onChange:i,onKeyDown:e=>e.key===`Enter`&&c(),placeholder:`Enter text...`}),t(`div`,{className:`mt-2 p-2 border-t`,children:n(`div`,{className:`flex gap-2 justify-end`,children:[t(U,{variant:`ghost`,size:`sm`,onClick:o,children:`Cancel`}),t(U,{size:`sm`,onClick:c,disabled:!r.trim(),children:`Apply`})]})})]})}function RT(e,n,r){switch(e.type){case`date`:return t(DT,{filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value.map(e=>e.value||``):[],isRange:e.multiple,setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t.length>0?t.map(e=>({value:e,label:Q(e).format(`LLL dd, y`)})):[]}:n))}});case`text`:return t(NT,{filterType:e.placeholder||e.name,filterValue:Array.isArray(e.value)&&e.value[0]&&typeof e.value[0]==`object`&&e.value[0].value||``,setFilterValue:t=>{n(n=>n.map(n=>n===e?{...n,value:[{value:t,label:t}]}:n))}});case`stringList`:return t(AT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`string`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))}});default:{let i=r.find(t=>t.name===e.name);return t(kT,{filterType:e.placeholder||e.name,filterValues:Array.isArray(e.value)&&typeof e.value[0]==`object`?e.value:[],setFilterValues:t=>{n(n=>n.map(n=>n===e?{...n,value:t}:n))},options:i?.options||[],labelRenderer:i?.labelRenderer,multiple:e.multiple??i?.multiple})}}}function zT({filters:e,setFilters:r,filterGroups:i}){return t(`div`,{className:`flex gap-2 flex-wrap justify-start`,children:e.filter(e=>e.value?.length>0).map(e=>n(`div`,{className:`flex gap-[1px] items-center text-sm`,children:[t(`div`,{className:`flex gap-1.5 shrink-0 rounded-s bg-muted p-1.5 h-8 items-center`,children:e.placeholder||e.name}),RT(e,r,i),t(U,{variant:`ghost`,size:`icon`,onClick:()=>{r(t=>t.filter(t=>t!==e))},className:`bg-muted rounded-s-none rounded-e-sm size-8 hover:text-info hover:bg-muted/50 transition shrink-0`,children:t(Ze,{className:`size-6`})})]},`${e.name}-${e.type===`date`?`date`:e.type===`stringList`&&typeof e.value[0]==`string`?e.value.join(`,`):Array.isArray(e.value)?e.value.map(e=>e.value).join(`,`):``}`))})}const BT=o.createContext({filters:[],setFilters:()=>void 0,filterGroups:[]}),VT=({filters:e,setFilters:n,filterGroups:r,children:i,inModal:a})=>{let s=new URL(window.location.href).searchParams.toString(),[c]=o.useState(()=>new URLSearchParams(window.location.search).get(`filters`)),l=o.useRef(new Set),u=o.useRef(a||!c);return _(()=>{if(!a&&u.current)try{let t=new URLSearchParams(s);if(e.length>0){let n=e.map(e=>{let t;if(e.type===`stringList`&&Array.isArray(e.value)&&typeof e.value[0]==`string`)t=`[${e.value.map(e=>encodeURIComponent(e)).join(`,`)}]`;else if(Array.isArray(e.value)){if(e.multiple)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else if(e.value.length>1)t=`[${e.value.map(e=>encodeURIComponent(GT(e))).join(`,`)}]`;else{let n=e.value[0];t=typeof n==`string`?encodeURIComponent(n):typeof n==`object`&&n?.value!==void 0?encodeURIComponent(String(n.value)):encodeURIComponent(String(n||``))}}else t=encodeURIComponent(e.value||``);return`${encodeURIComponent(e.name)}:${t}`}).join(`;`);t.set(`filters`,n)}else t.delete(`filters`);let n=`${window.location.pathname}?${t.toString()}${window.location.hash}`;window.history.replaceState(window.history.state||{},``,n)}catch(e){console.error(`Failed to update URL with filters:`,e)}},[e,a,s]),_(()=>{if(!(a||!c||r.length===0))try{let e=c.split(`;`),t=[];for(let n of e){let e=n.indexOf(`:`);if(e===-1)continue;let i=n.slice(0,e),a=n.slice(e+1),o=decodeURIComponent(i);if(l.current.has(o))continue;let s=r.find(e=>e.name===o);if(!s)continue;l.current.add(o);let c;if(a.startsWith(`[`)&&a.endsWith(`]`)){let e=a.slice(1,-1);c=e?e.split(`,`).map(e=>decodeURIComponent(e)):[]}else c=[decodeURIComponent(a)];let u;u=s.type===`stringList`?c:s.type===`text`?c.length===1?[{value:c[0],label:c[0]}]:c.map(e=>({value:e,label:e})):c.map(e=>{let t=s.options?.find(t=>t.value===e),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(`]`)&&(s.type===`stringList`?u=c:Array.isArray(u)||(u=[u])),t.push({name:o,type:s.type,placeholder:s.placeholder,value:u,multiple:s.multiple})}t.length>0&&n(e=>{let n=new Set(t.map(e=>e.name));return[...e.filter(e=>!n.has(e.name)),...t]}),u.current=!0}catch{}},[r,a,c,n]),t(BT.Provider,{value:{filters:e,setFilters:n,filterGroups:r},children:i})},HT=({className:e})=>{let{filters:r,setFilters:i,filterGroups:a}=o.useContext(BT),{t:s}=k(),[c,l]=o.useState(!1),[u,d]=o.useState(null),[f,p]=o.useState(``),m=o.useRef(null),[h,g]=o.useState(),[_,v]=o.useState(``),y=e=>{d(e),p(``),m.current?.focus()},b=()=>{let e=a.map(e=>({...e,options:(e.options??[]).filter(t=>!r.some(n=>n.type===`date`?n.name===e.name:n.name===e.name&&(Array.isArray(n.value)&&typeof n.value[0]==`string`?n.value.some(e=>e===t.value):n.value.some(e=>GT(e)===t.value))))})).filter(e=>(e.options??[]).length>0||e.type===`date`&&!r.some(t=>t.name===e.name)||e.type===`text`&&!r.some(t=>t.name===e.name)||e.type===`stringList`&&!r.some(t=>t.name===e.name));return e.length===0?t(hv,{children:s(`filter.noAvailableFilters`)}):e.map(e=>t(vv,{onSelect:()=>y(e.name),className:`group flex gap-2 items-center hover:bg-muted`,children:t(`span`,{children:e.placeholder??e.name})},e.name))},x=()=>{l(!1),setTimeout(()=>{d(null),p(``),g(void 0)},200)};return n(yT,{_open:c,onOpenChange:e=>{l(e),e||setTimeout(()=>{d(null),p(``),v(``)},200)},children:[t(xT,{asChild:!0,children:n(U,{variant:`outline`,role:`combobox`,"aria-expanded":c,"aria-label":s(`filter.filter`),size:`md`,className:z(`transition group flex gap-1.5`,e),children:[t(He,{className:`size-4 shrink-0 transition-all text-muted`}),s(`filter.filter`)]})}),t(CT,{className:`w-[300px] p-0`,align:`start`,sideOffset:4,children:n(dv,{children:[a.find(e=>e.name===u)?.type===`select`&&t(pv,{placeholder:u?s(`filter.filterBy`,{view:u}):s(`filter.filterPlaceholder`),className:`h-9 ring-0`,value:f,onValueChange:e=>{p(e)},ref:m,autoFocus:!0}),t(mv,{children:t(gv,{children:u?(()=>{if(!u)return null;switch(a.find(e=>e.name===u)?.type){case`date`:return t(PT,{selectedView:u,selectedDate:h,setSelectedDate:g,setFilters:i,filters:r,handleClose:x,filterGroups:a});case`text`:return t(LT,{selectedView:u,textValue:_,setTextValue:v,setFilters:i,handleClose:x,filterGroups:a});case`stringList`:return t(IT,{selectedView:u,setFilters:i,handleClose:x,filterGroups:a});default:return t(FT,{selectedView:u,commandInput:f,setFilters:i,handleClose:x,filterGroups:a})}})():b()})})]})})]})},UT=({className:e})=>{let{filters:n,setFilters:r,filterGroups:i}=o.useContext(BT);return t(`div`,{className:z(e),children:t(zT,{filters:n,setFilters:r,filterGroups:i})})},WT=({className:e})=>{let{filters:n,setFilters:r}=o.useContext(BT),{t:i}=k();return n.filter(e=>e.value?.length>0).length>0?t(U,{variant:`outline`,size:`md`,className:z(`transition group`,e),onClick:()=>r([]),children:i(`filter.clearAll`)}):null};function GT(e){return typeof e==`string`?e:e.value||``}var KT;(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`})(KT||={});const qT=p(({className:e,level:n=3,...r},i)=>{let a=`h${n}`;return t(a,{ref:i,className:z({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`,e),...r})});qT.displayName=`Heading`;function JT({options:i,optionLabel:a,groupBy:o,value:s,onChange:c,addNew:l,addNewLabel:u,disabled:d,filterBy:f,label:p,placeholder:m,className:h,popupClass:g,isClearable:y,border:b=!0,multiple:x=!1,by:T,inline:E=!1,isLoading:D=!1,warnOnMissingValue:O=!0,missingValueWarning:k=`Value not in options list, may not be valid`,clearIcon:A,clearTitle:j,"aria-label":M,"aria-labelledby":N,id:P,"aria-describedby":ee,"aria-invalid":te}){let F=C(null),[ne,re]=w(!1),[ie,ae]=w(0),[oe,se]=w(``),ce=v(),le=v(),ue=S(()=>!O||x||s==null||!i?!1:!i.some(e=>typeof T==`string`?YT(e,T)===YT(s,T):typeof T==`function`?T(e,s):ge(e,s)),[O,x,s,i,T]);_(()=>{let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;ae(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let de=e=>{if(x){let t=Array.isArray(s)?s:[];fe(e,t)?c(t.filter(t=>!pe(t,e))):c([...t,e])}else c(e)},fe=(e,t)=>!t||t.length===0?!1:t.some(t=>pe(t,e)),pe=(e,t)=>e==null||t==null?e===t:typeof T==`string`?YT(e,T)===YT(t,T):typeof T==`function`?T(e,t):ge(e,t),me=i||[];function he(e){return e?typeof e==`string`?t=>String(YT(t,e)).toLowerCase():e:e=>String(e).toLowerCase()}let _e=oe.toLowerCase(),ve=he(f);me=me.filter(e=>ve(e).includes(_e));let ye=()=>{if(!s||Array.isArray(s)&&s.length===0)return t(`span`,{className:`text-muted`,children:m});let e=Array.isArray(s)?s[0]:s;return a?a(e):e},be=()=>{let e=Array.isArray(s)?s:s?[s]:[];return e.length===0?t(`span`,{className:`text-muted`,children:m}):e.length===1?a?a(e[0]):e[0]:n(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,1).map((e,n)=>t(`span`,{className:`inline-flex items-center gap-1 px-2 py-1 text-xs bg-muted rounded`,children:a?a(e):e},`chip-${n}`)),e.length>1&&n(`span`,{className:`inline-flex items-center px-2 py-1 text-xs bg-muted rounded`,children:[`+`,e.length-1,` more`]})]})},xe=(e,r)=>{let i=x?fe(e,Array.isArray(s)?s:[]):s!=null&&pe(s,e);return t(vv,{onSelect:()=>de(e),className:`w-full`,children:x||E?n(`div`,{className:`w-full flex justify-between items-center cursor-pointer`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]}):n(wT,{className:`w-full flex justify-between items-center`,children:[t(`div`,{className:`w-full truncate text-start`,children:a?a(e):e}),i&&t(Me,{className:`size-4`})]})},`option-${r}`)},Se=(()=>{if(!o)return null;let e=[],t=new Map;for(let n of me){let r=o(n),i=t.get(r);i||(i=[],t.set(r,i),e.push({key:r,items:i})),i.push(n)}return e})(),Ce=()=>n(e,{children:[f&&n(`div`,{className:`flex justify-start items-center mb-1`,children:[t(`div`,{className:`mx-2`,children:t(qe,{className:`size-4`})}),t(MT,{variant:`unstyled`,value:oe,onChange:se,className:`w-full p-1 rounded-md`,placeholder:`Search...`})]}),t(dv,{className:`overflow-hidden`,children:n(mv,{className:E?`max-h-full overflow-y-auto`:`max-h-[200px] overflow-y-auto`,onWheel:e=>{e.currentTarget.scrollTop+=e.deltaY},children:[t(hv,{children:`No result found.`}),Se?Se.map(e=>t(gv,{heading:e.key,className:`[&_[cmdk-group-heading]]:text-muted [&_[cmdk-group-heading]]:border-b [&_[cmdk-group-heading]]:border-border [&_[cmdk-group-heading]]:ml-[-0.5rem] [&_[cmdk-group-heading]]:text-xs`,children:e.items.map((t,n)=>xe(t,`${e.key}-${n}`))},e.key)):t(gv,{children:me?.map((e,t)=>xe(e,t))})]})}),l&&t(`div`,{className:`p-1`,children:n(`button`,{type:`button`,onClick:l,className:r(`w-full text-start gap-x-2 px-2 py-1.5 truncate group flex rounded-md items-center text-sm cursor-pointer hover:bg-muted bg-transparent border-0`),children:[t(Je,{size:16,strokeWidth:1.25,absoluteStrokeWidth:!0}),u]})})]});if(E)return t(`div`,{className:r(h,b&&`border border-border rounded-md`,`bg-popover p-1`,g),children:D?t(`div`,{className:`flex justify-center items-center p-2 text-muted text-sm`,children:t(Ue,{className:`size-4 animate-spin`})}):Ce()});let we=!!p,Te=M??(we?void 0:typeof m==`string`?m:void 0),Ee=N??(we?le:void 0),De=!!y&&!!s&&(!Array.isArray(s)||s.length>0),Oe=te===!0||te===`true`||ue?!0:te===!1||te===`false`?!1:void 0;return n(yT,{onOpenChange:re,children:[n(`div`,{ref:F,className:r(`relative`,h),children:[t(xT,{asChild:!0,children:t(`button`,{type:`button`,id:P,disabled:d||D,"aria-haspopup":`dialog`,"aria-expanded":ne,"aria-controls":ce,"aria-label":Te,"aria-labelledby":Ee,"aria-describedby":ee,"aria-invalid":Oe,className:r(D?`flex w-full justify-center items-center gap-2 border border-border rounded-md p-2 text-muted text-sm bg-transparent`:r(b&&(ue||Oe?`border border-destructive`:`border border-border`),`flex w-full flex-row gap-2 items-center justify-between p-2 rounded-md group bg-transparent text-inherit text-start`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,d?`cursor-not-allowed text-muted`:`cursor-pointer hover:bg-muted`,De&&`pe-10`)),children:D?t(Ue,{className:`size-4 animate-spin`}):n(e,{children:[n(`div`,{className:r(`flex flex-col w-full rounded-md text-sm min-h-6 items-center justify-center truncate`),children:[p&&t(`div`,{id:le,className:`w-full text-start text-xs font-semibold`,children:p}),n(`div`,{className:r(`w-full text-start `,ue&&`text-destructive`),children:[ue&&t(bi,{description:k,placement:`top`,asChild:!0,children:t(Xe,{className:`inline-block size-4 me-1 -mt-0.5 cursor-help`})}),x?be():ye()]})]}),!d&&t(Ie,{className:`size-4 opacity-50 shrink-0`,"aria-hidden":`true`})]})})}),De&&!D&&t(U,{variant:`link`,size:`icon`,disabled:d,title:j||`Clear selection`,onClick:e=>{e.stopPropagation(),c(x?[]:void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`absolute end-2 top-1/2 -translate-y-1/2 hover:bg-muted/20 rounded p-1`,children:A||t(Ze,{className:`size-4`})})]}),t(CT,{id:ce,style:{width:`${ie}px`,zIndex:1e6},className:r(`min-w-[8rem] w-64 bg-popover p-1 border shadow`,`divide-y divide-border`,g),children:Ce()})]})}function YT(e,t){return typeof e==`object`&&e?e[t]:void 0}const XT={ar:`العربية`,de:`Deutsch`,en:`English`,es:`Español`,fr:`Français`,it:`Italiano`,ja:`日本語`,ko:`한국어`,pt:`Português`,ru:`Русский`,tr:`Türkçe`,zh:`中文`,"zh-TW":`繁體中文`};function ZT({label:e,className:r}={}){let{language:i,setLanguage:a}=O(),{t:o}=k(),s=e===!1?!1:e??o(`language.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center gap-3`:`flex items-center`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),t(JT,{options:D,value:i,onChange:e=>a(e),optionLabel:e=>XT[e],placeholder:o(`language.placeholder`),isClearable:!1,warnOnMissingValue:!1,className:`min-w-40`})]})}var QT=Object.defineProperty,$T=a.forwardRef(((e,t)=>QT(e,`name`,{value:t,configurable:!0}))(function(e,n){return t(H.label,{...e,ref:n,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));const eE=A(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),tE=a.forwardRef(({className:e,required:r,...i},a)=>n($T,{ref:a,className:z(eE(),e),...i,children:[i.children,r&&t(`span`,{className:`text-destructive-foreground ms-1`,children:`*`})]}));tE.displayName=$T.displayName;function nE({icon:e,status:r,title:i,children:a,className:o}){let s,c,l,u;switch(r){case`error`:s=t(Re,{className:`size-5 text-destructive`,"aria-hidden":`true`}),c=`text-destructive`,l=`text-foreground`,u=`bg-destructive border border-destructive`;break;case`warning`:s=t(Xe,{className:`size-5 text-attention`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-attention border border-attention`;break;case`success`:s=t(Le,{className:`size-5 text-success`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-success border border-success`;break;case`info`:s=t(Ve,{className:`size-5 text-info`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-info border border-info`;break;case`default`:s=t(Ve,{className:`size-5 text-muted`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-muted border border-muted`;break;case`done`:s=t(Ve,{className:`size-5 text-done`,"aria-hidden":`true`}),c=``,l=`text-foreground`,u=`bg-done border border-done`}return t(`div`,{className:`rounded-md p-4 ${u} ${o}`,children:n(`div`,{className:`flex`,children:[t(`div`,{className:`shrink-0`,children:e??s}),n(`div`,{className:`w-full ms-2 px-1`,children:[i&&t(`h3`,{className:`text-base font-medium mb-2 ${c}`,children:i}),t(`div`,{className:`text-sm ${l} break-words`,children:a})]})]})})}function rE({title:e,className:r,children:i,action:a,actionLabel:o}){return n(nE,{status:`error`,title:e,className:`${r} flex flex-col items-center justify-center text-center`,children:[t(`pre`,{className:`whitespace-pre-wrap break-words`,children:i}),a&&o&&t(U,{onClick:a,variant:`ghost`,size:`sm`,className:`mt-4`,children:o})]})}function iE({title:e,className:n,children:r}){return t(nE,{status:`info`,title:e,className:n,children:r})}function aE({title:e,className:n,children:r}){return t(nE,{status:`warning`,title:e,className:n,children:r})}function oE({title:e,className:n,children:r}){return t(nE,{status:`success`,title:e,className:n,children:r})}function sE({title:e,className:n,children:r}){return t(nE,{status:`default`,title:e,className:n,children:r})}function cE({title:e,content:r,onConfirm:i,onCancel:a,isOpen:o,isLoading:s,confirmationValue:c,confirmationLabel:l,confirmationPlaceholder:u}){let{t:d}=k(),f=C(null),[p,m]=w(``);_(()=>{o||m(``)},[o]);let h=!!c,g=!c||p.trim()===c.trim(),v=()=>{!g||s||i()};return n($_,{isOpen:o,onClose:a,description:`Confirm Modal`,children:[n(`div`,{className:`sm:flex sm:items-start p-2`,children:[t(`div`,{className:`mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-destructive sm:mx-0 sm:h-10 sm:w-10`,children:t(Xe,{className:`size-6 text-destructive`,"aria-hidden":`true`})}),n(`div`,{className:`mt-3 text-center sm:ms-4 sm:mt-0 sm:text-start`,children:[t(ev,{className:`leading-6`,show:!0,children:e}),t(`div`,{className:`mt-2`,children:t(`div`,{className:`prose text-sm text-muted`,children:r})})]})]}),h&&t(`div`,{className:`px-2 pb-2 text-start`,children:t(zi,{label:l??u,children:t(MT,{autoFocus:!0,value:p,onChange:m,placeholder:u,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v())}})})}),n(nv,{align:`right`,children:[t(U,{variant:`destructive`,onClick:v,isLoading:s,disabled:!g,children:d(`modal.confirm`)}),t(U,{variant:`outline`,onClick:a,ref:f,children:d(`modal.cancel`)})]})]})}function lE(){return g(uE)}const uE=d(()=>{}),dE={success:Le,error:Re,warning:Xe,info:Ve},fE={success:`text-success`,error:`text-destructive`,warning:`text-attention`,info:`text-info`};function pE({data:e,onClose:r}){let[i,a]=w(!0),o=C(null),s=h(()=>{o.current&&=(globalThis.clearTimeout(o.current),null)},[]),c=h(()=>{s(),e.duration&&(o.current=setTimeout(()=>a(!1),e.duration))},[s,e.duration]);_(()=>(c(),s),[s,c]);let l=dE[e.status]||Ve,u=fE[e.status]||`text-info`;return t(`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:t(`div`,{className:`flex w-full flex-col items-center space-y-4 sm:items-end`,children:t(Tp,{onExitComplete:r,children:i&&t(vh.div,{className:`pointer-events-auto w-full max-w-md overflow-hidden rounded-lg bg-muted shadow-lg ring-1 ring-border`,initial:{opacity:0,x:8},animate:{opacity:1,x:0,transition:{ease:`easeOut`,duration:.7}},exit:{opacity:0,transition:{ease:`easeIn`,duration:.3}},onMouseEnter:s,onMouseLeave:c,children:t(`div`,{className:`p-5`,children:n(`div`,{className:`flex items-start`,children:[t(`div`,{className:`shrink-0`,children:t(l,{className:`size-6 ${u}`,"aria-hidden":`true`})}),n(`div`,{className:`ms-3 flex-1 pt-0.5 min-w-0`,children:[t(`p`,{className:`text-sm font-semibold text-foreground break-words`,children:e.title}),e.description&&t(`p`,{className:`mt-2 text-sm text-muted break-words whitespace-pre-wrap leading-relaxed`,children:e.description})]}),t(`div`,{className:`ms-4 flex shrink-0`,children:n(`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:()=>a(!1),children:[t(`span`,{className:`sr-only`,children:`Close`}),t(Ze,{className:`size-5`,"aria-hidden":`true`})]})})]})})})})})})}function mE({children:r}){let[i,a]=w(null),o=h(e=>{a(e)},[]);return n(e,{children:[t(uE.Provider,{value:o,children:r}),i&&t(Ch,{children:t(pE,{data:i,onClose:()=>o(null)})})]})}function hE({idToDelete:e,title:n,content:r,setIdToDelete:i,deleteApi:a}){let{t:o}=k(),s=lE();return t(cE,{title:n,content:r,isOpen:!!e,onConfirm:async()=>{if(e)return a(e).then(()=>{s({title:o(`modal.delete.succeeded`),status:`success`})}).catch(e=>{s({title:o(`modal.delete.failed`),description:e instanceof Error?e.message:o(`modal.delete.error`),status:`error`})}).finally(()=>{i(void 0)})},onCancel:()=>{i(void 0)}})}const gE=4,_E={tabs:{base:`flex items-center border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`border-transparent text-muted hover:border-border hover:text-foreground`,active:`border-primary text-info`,icon:`ms-1 size-4`},pills:{base:`flex items-center rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap cursor-pointer shrink-0`,inactive:`text-muted hover:bg-muted/60`,active:`bg-muted text-foreground`,icon:`ms-0.5 size-3.5`}};function vE(e,t,n=4){let r=C(null),i=C([]),a=C(null),[o,s]=w({count:e.length,promote:!1}),c=()=>{let o=r.current;if(!o)return;let c=o.clientWidth,l=e.map((e,t)=>i.current[t]?.offsetWidth??0),u=l.reduce((e,t)=>e+t,0)+n*Math.max(0,e.length-1),d=(t,r)=>{let i=0,a=0;for(let o=0;o<e.length;o++){if(o===r)continue;let e=i+(a>0?n:0)+l[o];if(e>t)break;i=e,a+=1}return a},f;if(u<=c)f={count:e.length,promote:!1};else{let r=a.current?.offsetWidth??0,i=Math.max(1,d(c-r-n,-1)),o=e.findIndex(t);f=o<0||o<i?{count:i,promote:!1}:{count:d(c-r-l[o]-n*2,o),promote:!0}}s(e=>e.count===f.count&&e.promote===f.promote?e:f)},l=C(c);l.current=c,x(()=>{l.current()}),_(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>l.current());return t.observe(e),()=>t.disconnect()},[]);let u=e.findIndex(t),d,f;if(o.promote&&u>=0){let t=e.filter((e,t)=>t!==u);d=[...t.slice(0,o.count),e[u]],f=t.slice(o.count)}else d=e.slice(0,o.count),f=e.slice(o.count);return{containerRef:r,setItemRef:e=>t=>{i.current[e]=t},setMoreRef:e=>{a.current=e},visible:d,overflow:f,activeInOverflow:f.some(t)}}function yE({label:e,triggerClassName:r,icon:i,children:a}){let[o,s]=w(!1),c=C(null),l=C(!1),u=()=>{c.current&&=(clearTimeout(c.current),null)},d=()=>{u(),l.current=!0,s(!0)},f=()=>{u(),c.current=setTimeout(()=>s(!1),150)};return _(()=>()=>clearTimeout(c.current??void 0),[]),n(Tx,{modal:!1,open:o,onOpenChange:e=>{u(),e&&(l.current=!1),s(e)},children:[t(Dx,{asChild:!0,children:n(`button`,{type:`button`,onMouseEnter:d,onMouseLeave:f,className:r,children:[e,i??t(Ne,{className:`ms-1 size-4`})]})}),t(Ox,{align:`end`,className:`w-max`,onMouseEnter:u,onMouseLeave:f,onCloseAutoFocus:e=>{l.current&&e.preventDefault()},children:a})]})}function bE({tabs:e,current:r,onTabChange:i,variant:a=`tabs`,className:o}){let{t:s}=k(),c=_E[a],{containerRef:l,setItemRef:u,setMoreRef:d,visible:f,overflow:p,activeInOverflow:m}=vE(e,e=>e.name===r),h=s(`agent.moreTabs`);return n(`div`,{ref:l,className:z(`relative`,o),children:[n(`div`,{"aria-hidden":!0,className:`pointer-events-none invisible absolute start-0 top-0 flex w-max gap-1`,children:[e.map((e,n)=>t(`button`,{type:`button`,tabIndex:-1,ref:u(n),className:z(c.base,c.inactive),children:e.label},e.name)),n(`button`,{type:`button`,tabIndex:-1,ref:d,className:z(c.base,c.inactive),children:[h,t(Ne,{className:c.icon})]})]}),n(`div`,{className:z(`flex gap-1 overflow-hidden`,a===`tabs`&&`-mb-px border-b`),children:[f.map(e=>{let n=e.name===r;return t(`button`,{type:`button`,"aria-current":n?`page`:void 0,disabled:e.disabled,onClick:()=>i(e.name),className:z(c.base,n?c.active:c.inactive,`disabled:pointer-events-none disabled:opacity-50`),children:e.label},e.name)}),p.length>0&&t(yE,{label:h,triggerClassName:z(c.base,m?c.active:c.inactive),icon:t(Ne,{className:c.icon}),children:p.map(e=>t(Ax,{disabled:e.disabled,onClick:()=>i(e.name),className:z(e.name===r&&`text-info`),children:e.label},e.name))})]})]})}function xE({children:r,action:i,title:a,description:o,footer:s,className:c,collapsible:l,defaultCollapsed:u=!1,size:d=`md`,clickableHeader:f=!1}){let[p,m]=w(u),h=l&&f,g=d===`sm`,_=g||h,v=t(p?Ne:Fe,{className:`size-4 text-muted`}),y=n(e,{children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`div`,{className:`font-semibold ${g?`text-sm`:`text-lg`}`,children:a}),t(Ii,{description:o,size:`md`})]}),n(`div`,{className:`flex gap-2 items-center`,children:[i,l&&(h?v:t(U,{variant:`ghost`,size:`icon`,onClick:()=>m(!p),children:v}))]})]}),b=g?`px-4 py-2`:`px-4 py-3`,x=g?`px-4 pt-3 pb-3`:`p-4`,S=g?`px-4 pb-3`:`px-4 pb-4`;return n(`div`,{className:`flex flex-col ${_?``:`p-4 gap-2`} rounded-sm border bg-card ${h?`overflow-hidden`:``} ${c??``}`,children:[h?t(`button`,{type:`button`,className:`w-full flex items-center justify-between ${b} hover:bg-muted/50 transition-colors`,onClick:()=>m(!p),children:y}):t(`div`,{className:`flex items-center justify-between ${_?b:``}`,children:y}),!p&&(_?t(`div`,{className:x,children:r}):r),s&&t(`div`,{className:`border-t border-muted flex flex-col-2 text-sm pt-4 ${_?S:``}`,children:s})]})}var SE=Object.defineProperty,CE=(e,t)=>SE(e,`name`,{value:t,configurable:!0}),wE=`Radio`,[TE,EE]=an(wE),[DE,OE]=TE(wE);function kE(e){let{__scopeRadio:n,checked:r=!1,children:i,disabled:o,form:s,name:c,onCheck:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=a.useState(null),[h,g]=a.useState(null),_=a.useRef(!1),[v,y]=a.useReducer(e=>e+1,0),b={checked:r,disabled:o,required:u,name:c,form:s,value:d,control:p,setControl:m,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:!p||!!s||!!p.closest(`form`),bubbleInput:h,setBubbleInput:g,onCheck:CE(()=>l?.(),`onCheck`)};return t(DE,{scope:n,...b,children:IE(f)?f(b):i})}CE(kE,`RadioProvider`);var AE=`RadioTrigger`,jE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{checked:a,disabled:o,value:s,setControl:c,onCheck:l,hasConsumerStoppedPropagationRef:u,onUserInteraction:d,isFormControl:f,bubbleInput:p}=OE(AE,e),m=R(i,c);return t(H.button,{type:`button`,role:`radio`,"aria-checked":a,"data-state":LE(a),"data-disabled":o?``:void 0,disabled:o,value:s,...r,ref:m,onClick:B(n,e=>{a||(d(),l()),p&&f&&(u.current=e.isPropagationStopped(),u.current||e.stopPropagation())})})},`RadioTrigger`)),ME=`RadioIndicator`,NE=a.forwardRef(CE(function(e,n){let{__scopeRadio:r,forceMount:i,...a}=e,o=OE(ME,r);return t(or,{present:i||o.checked,children:t(H.span,{"data-state":LE(o.checked),"data-disabled":o.disabled?``:void 0,...a,ref:n})})},`RadioIndicator`)),PE=`RadioBubbleInput`,FE=a.forwardRef(CE(function({__scopeRadio:e,onClick:n,...r},i){let{control:o,checked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=OE(PE,e),_=R(i,m),v=Pn(o),y=a.useRef(!1),b=a.useRef(s),x=a.useRef(g);a.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==s;b.current=s;let a=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[p,s,h,g]);let S=a.useRef(s);return t(H.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:c,disabled:l,name:u,value:d,form:f,...r,tabIndex:-1,ref:_,onClick:B(n,e=>{y.current&&e.stopPropagation()}),style:{...r.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function IE(e){return typeof e==`function`}CE(IE,`isFunction`);function LE(e){return e?`checked`:`unchecked`}CE(LE,`getState`);var RE=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],zE=`RadioGroup`,[BE,VE]=an(zE,[Xv,EE]),HE=Xv(),UE=EE(),[WE,GE]=BE(zE),KE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,name:i,form:o,defaultValue:s,value:c,required:l=!1,disabled:u=!1,orientation:d,dir:f,loop:p=!0,onValueChange:m,...h}=e,g=HE(r),_=fe(f),[v,y]=br({prop:c,defaultProp:s??null,onChange:m,caller:zE}),[b,x]=a.useState(null),S=R(n,x),C=a.useRef(v);return a.useEffect(()=>{let e=o?b?.ownerDocument.getElementById(o):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=CE(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,o,y]),t(WE,{scope:r,name:i,form:o,required:l,disabled:u,value:v,onValueChange:y,children:t(cy,{asChild:!0,...g,orientation:d,dir:_,loop:p,children:t(H.div,{role:`radiogroup`,"aria-required":l,"aria-orientation":d,"data-disabled":u?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),qE=`RadioGroupItemProvider`,JE=`RadioGroupItemTrigger`;function YE(e){let{__scopeRadioGroup:n,value:r,disabled:i,children:a,internal_do_not_use_render:o}=e,s=GE(qE,n),c=UE(n),l=s.disabled||i;return t(kE,{...c,checked:s.value===r,disabled:l,required:s.required,name:s.name,form:s.form,value:r,onCheck:()=>s.onValueChange(r),internal_do_not_use_render:o,children:a})}CE(YE,`RadioGroupItemProvider`);var XE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,o=HE(r),s=UE(r),{checked:c,disabled:l}=OE(JE,s.__scopeRadio),u=a.useRef(null),d=R(n,u),f=a.useRef(!1);return a.useEffect(()=>{let e=CE(e=>{RE.includes(e.key)&&(f.current=!0)},`handleKeyDown`),t=CE(()=>f.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),t(ly,{asChild:!0,...o,focusable:!l,active:c,children:t(jE,{...s,...i,ref:d,onKeyDown:B(i.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:B(i.onFocus,()=>{f.current&&u.current?.click()})})})},`RadioGroupItemTrigger`)),ZE=a.forwardRef(CE(function(r,i){let{__scopeRadioGroup:a,value:o,disabled:s,...c}=r;return t(YE,{__scopeRadioGroup:a,value:o,disabled:s,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(XE,{...c,ref:i,__scopeRadioGroup:a}),r&&t(QE,{__scopeRadioGroup:a})]})})},`RadioGroupItem`)),QE=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(FE,{...a,...i,ref:n})},`RadioGroupItemBubbleInput`)),$E=a.forwardRef(CE(function(e,n){let{__scopeRadioGroup:r,...i}=e,a=UE(r);return t(NE,{...a,...i,ref:n})},`RadioGroupIndicator`));function eD({className:e,...n}){return t(ZE,{"data-slot":`radio-group-item`,className:z(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:t($E,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:t(`span`,{className:`bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full`})})})}var tD=class{descriptionOf(e){}selectedClassName(e){return`border-muted`}};function nD({onSelect:e,selected:r,options:i,adapter:a}){let o=e=>a?a.idOf(e):e.id,s=e=>a?a.labelOf(e):e.label,c=e=>a?a.descriptionOf(e):e.description,l=e=>a?a.selectedClassName(e):`border-primary`;return t(KE,{"data-slot":`radio-group`,value:r?o(r):void 0,onValueChange:t=>{let n=i.find(e=>o(e)===t);n&&e(n)},className:`space-y-4`,children:i.map(e=>{let i=r?o(r)===o(e):!1;return t(ZE,{value:o(e),className:z(`relative block w-full cursor-pointer rounded-lg border border-border bg-muted px-6 py-4 shadow-2xs text-start`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`sm:flex sm:justify-between`,i&&l(e)),children:t(`span`,{className:`flex items-center`,children:n(`span`,{className:`flex flex-col text-sm`,children:[t(`span`,{className:`font-medium text-foreground`,children:s(e)}),c(e)&&t(`span`,{className:`text-muted`,children:c(e)})]})})},o(e))})})}function rD({className:e,direction:n=`horizontal`,orientation:r,...i}){let a=r??n;return t(_e.Group,{"data-slot":`resizable-panel-group`,"data-panel-group-direction":a,orientation:a,className:z(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...i})}function iD(e){return typeof e==`number`?`${e}%`:e}function aD({defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...a}){return t(_e.Panel,{"data-slot":`resizable-panel`,defaultSize:iD(e),minSize:iD(n),maxSize:iD(r),collapsedSize:iD(i),...a})}function oD({withHandle:e,className:n,...r}){return t(_e.Separator,{"data-slot":`resizable-handle`,className:z(`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 aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),...r,children:e&&t(`div`,{className:`z-10 flex size-4 items-center justify-center rounded-xs font-semibold`,children:t(We,{className:`size-4 rotate-90`})})})}var sD=Object.defineProperty,cD=(e,t)=>sD(e,`name`,{value:t,configurable:!0}),lD=`horizontal`,uD=[`horizontal`,`vertical`],dD=a.forwardRef(cD(function(e,n){let{decorative:r,orientation:i=lD,...a}=e,o=fD(i)?i:lD,s=r?{role:`none`}:{"aria-orientation":o===`vertical`?o:void 0,role:`separator`};return t(H.div,{"data-orientation":o,...s,...a,ref:n})},`Separator`));function fD(e){return uD.includes(e)}cD(fD,`isValidOrientation`);var pD=dD;const mD=a.forwardRef(({className:e,orientation:n=`horizontal`,decorative:r=!0,...i},a)=>t(pD,{ref:a,decorative:r,orientation:n,className:z(`shrink-0 bg-border`,n===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...i}));mD.displayName=pD.displayName;var hD=Object.defineProperty,gD=(e,t)=>hD(e,`name`,{value:t,configurable:!0});function _D(e,[t,n]){return Math.min(n,Math.max(t,e))}gD(_D,`clamp`);var vD=Object.defineProperty,yD=(e,t)=>vD(e,`name`,{value:t,configurable:!0});function bD(e){let t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}yD(bD,`usePrevious`);var xD=Object.defineProperty,$=(e,t)=>xD(e,`name`,{value:t,configurable:!0}),SD=[`PageUp`,`PageDown`],CD=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],wD={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},TD=`Slider`,[ED,DD,OD]=Sv(TD),[kD,AD]=an(TD,[OD]),[jD,MD]=kD(TD),ND=a.forwardRef($(function(e,n){let{name:r,min:i=0,max:o=100,step:s=1,orientation:c=`horizontal`,disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[i],value:f,onValueChange:p=$(()=>{},`onValueChange`),onValueCommit:m=$(()=>{},`onValueCommit`),inverted:h=!1,form:g,..._}=e,v=a.useRef(new Set),y=a.useRef(0),b=a.useRef(!1),x=c===`horizontal`?ID:LD,[S,C]=a.useState(null),w=R(n,C),[T=[],E]=br({prop:f,defaultProp:d,onChange:$(e=>{[...v.current][y.current]?.focus({preventScroll:!0,focusVisible:b.current}),b.current=!1,p(e)},`onChange`)}),D=a.useRef(T),O=a.useRef(T);a.useEffect(()=>{let e=g?S?.ownerDocument.getElementById(g):S?.closest(`form`);if(e instanceof HTMLFormElement){let t=$(()=>E(O.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[S,g,E]);function k(e){M(e,tO(T,e))}$(k,`handleSlideStart`);function A(e){M(e,y.current)}$(A,`handleSlideMove`);function j(){String(T)!==String(D.current)&&m(T)}$(j,`handleSlideEnd`);function M(e,t,{commit:n}={commit:!1}){let r=oO(s),a=_D(sO(Math.round((e-i)/s)*s+i,r),[i,o]);E((e=[])=>{let r=QD(e,a,t);if(iO(r,u*s)){y.current=r.indexOf(a);let t=String(r)!==String(e);return t&&n&&m(r),t?r:e}return e})}return $(M,`updateValues`),t(jD,{scope:e.__scopeSlider,name:r,disabled:l,min:i,max:o,valueIndexToChangeRef:y,thumbs:v.current,values:T,orientation:c,form:g,children:t(ED.Provider,{scope:e.__scopeSlider,children:t(ED.Slot,{scope:e.__scopeSlider,children:t(x,{"aria-disabled":l,"data-disabled":l?``:void 0,..._,ref:w,onPointerDown:B(_.onPointerDown,()=>{l||(D.current=T,b.current=!1)}),min:i,max:o,inverted:h,onSlideStart:l?void 0:k,onSlideMove:l?void 0:A,onSlideEnd:l?void 0:j,onHomeKeyDown:()=>{l||(b.current=!0,M(i,0,{commit:!0}))},onEndKeyDown:()=>{l||(b.current=!0,M(o,T.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!l){b.current=!0;let n=SD.includes(e.key)||e.shiftKey&&CD.includes(e.key)?10:1,r=y.current,a=T[r];M(cO(a,{min:i,step:s,direction:t,multiplier:n}),r,{commit:!0})}}})})})})},`Slider`)),[PD,FD]=kD(TD,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ID=a.forwardRef($(function(e,n){let{min:r,max:i,dir:o,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...f}=e,[p,m]=a.useState(null),h=R(n,m),g=a.useRef(void 0),_=fe(o),v=_===`ltr`,y=v&&!s||!v&&s;function b(e){let t=g.current||p.getBoundingClientRect(),n=aO([0,t.width],y?[r,i]:[i,r]);return g.current=t,n(e-t.left)}return $(b,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:t(RD,{dir:_,"data-orientation":`horizontal`,...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);c?.(t)},onSlideMove:e=>{let t=b(e.clientX);l?.(t)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:e=>{let t=wD[y?`from-left`:`from-right`].includes(e.key);d?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),LD=a.forwardRef($(function(e,n){let{min:r,max:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...d}=e,f=a.useRef(null),p=R(n,f),m=a.useRef(void 0),h=!o;function g(e){let t=m.current||f.current.getBoundingClientRect(),n=aO([0,t.height],h?[i,r]:[r,i]);return m.current=t,n(e-t.top)}return $(g,`getValueFromPointer`),t(PD,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:t(RD,{"data-orientation":`vertical`,...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);s?.(t)},onSlideMove:e=>{let t=g(e.clientY);c?.(t)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:e=>{let t=wD[h?`from-bottom`:`from-top`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),RD=a.forwardRef($(function(e,n){let{__scopeSlider:r,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:c,onStepKeyDown:l,...u}=e,d=MD(TD,r);return t(H.span,{...u,ref:n,onKeyDown:B(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(c(e),e.preventDefault()):SD.concat(CD).includes(e.key)&&(l(e),e.preventDefault())}),onPointerDown:B(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):i(e)}),onPointerMove:B(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:B(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})},`SliderImpl`)),zD=`SliderTrack`,BD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(zD,r);return t(H.span,{"data-disabled":a.disabled?``:void 0,"data-orientation":a.orientation,...i,ref:n})},`SliderTrack`)),VD=`SliderRange`,HD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,o=MD(VD,r),s=FD(VD,r),c=R(n,a.useRef(null)),l=o.values.length,u=o.values.map(e=>$D(e,o.min,o.max)),d=l>1?Math.min(...u):0,f=100-Math.max(...u);return t(H.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,...i,ref:c,style:{...e.style,[s.startEdge]:d+`%`,[s.endEdge]:f+`%`}})},`SliderRange`)),[UD,WD]=kD(`SliderThumb`),GD=`SliderThumbProvider`;function KD(e){let{__scopeSlider:n,name:r,children:i,internal_do_not_use_render:o}=e,s=MD(GD,n),c=DD(n),[l,u]=a.useState(null),d=a.useMemo(()=>l?c().findIndex(e=>e.ref.current===l):-1,[c,l]),f=Pn(l),p=!l||!!s.form||!!l.closest(`form`),m=s.values[d],h=r??(s.name?s.name+(s.values.length>1?`[]`:``):void 0),g=m===void 0?0:$D(m,s.min,s.max);a.useEffect(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let _={value:m,name:h,form:s.form,isFormControl:p,index:d,thumb:l,onThumbChange:u,percent:g,size:f};return t(UD,{scope:n,..._,children:lO(o)?o(_):i})}$(KD,`SliderThumbProvider`);var qD=`SliderThumbTrigger`,JD=a.forwardRef($(function(e,n){let{__scopeSlider:r,...i}=e,a=MD(qD,r),o=FD(qD,r),{index:s,value:c,percent:l,size:u,onThumbChange:d}=WD(qD,r),f=R(n,d),p=eO(s,a.values.length),m=u?.[o.size],h=m?nO(m,l,o.direction):0;return t(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[o.startEdge]:`calc(${l}% + ${h}px)`},children:t(ED.ItemSlot,{scope:r,children:t(H.span,{role:`slider`,"aria-label":e[`aria-label`]||p,"aria-valuemin":a.min,"aria-valuenow":c,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?``:void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:c===void 0?{display:`none`}:e.style,onFocus:B(e.onFocus,()=>{a.valueIndexToChangeRef.current=s})})})})},`SliderThumbTrigger`)),YD=a.forwardRef($(function(r,i){let{__scopeSlider:a,name:o,...s}=r;return t(KD,{__scopeSlider:a,name:o,internal_do_not_use_render:({index:r,isFormControl:o})=>n(e,{children:[t(JD,{...s,ref:i,__scopeSlider:a}),o?t(ZD,{__scopeSlider:a},r):null]})})},`SliderThumb`)),XD=`SliderBubbleInput`,ZD=a.forwardRef($(function({__scopeSlider:e,...n},r){let{value:i,name:o,form:s}=WD(XD,e),c=a.useRef(null),l=R(c,r),u=bD(i);return a.useEffect(()=>{let e=c.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(u!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[u,i]),t(H.input,{style:{display:`none`},name:o,form:s,...n,ref:l,defaultValue:i})},`SliderBubbleInput`));function QD(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}$(QD,`getNextSortedValues`);function $D(e,t,n){return _D(100/(n-t)*(e-t),[0,100])}$($D,`convertValueToPercentage`);function eO(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}$(eO,`getLabel`);function tO(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}$(tO,`getClosestValueIndex`);function nO(e,t,n){let r=e/2;return(r-aO([0,50],[0,r])(t)*n)*n}$(nO,`getThumbInBoundsOffset`);function rO(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}$(rO,`getStepsBetweenValues`);function iO(e,t){if(t>0){let n=rO(e);return Math.min(...n)>=t}return!0}$(iO,`hasMinStepsBetweenValues`);function aO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}$(aO,`linearScale`);function oO(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}$(oO,`getDecimalCount`);function sO(e,t){let n=10**t;return Math.round(e*n)/n}$(sO,`roundValue`);function cO(e,{min:t,step:n,direction:r,multiplier:i}){let a=oO(n),o=(e-t)/n,s=Math.round(o),c=sO(s*n+t,a)===sO(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),sO(l*n+t,a)}$(cO,`getNextStepValue`);function lO(e){return typeof e==`function`}$(lO,`isFunction`);const uO=a.forwardRef(({className:e,trackClassName:r,rangeClassName:i,thumbClassName:o,value:s,defaultValue:c,min:l=0,max:u=100,"aria-label":d,...f},p)=>{let m=a.useId(),h=Array.isArray(s)?s.length:Array.isArray(c)?c.length:1,g=a.useMemo(()=>Array.from({length:Math.max(1,h)},(e,t)=>`${m}-thumb-${t}`),[m,h]);return n(ND,{ref:p,"data-slot":`slider`,value:s,defaultValue:c,min:l,max:u,...f,className:z(`relative flex w-full touch-none select-none items-center data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col`,e),children:[t(BD,{"data-slot":`slider-track`,className:z(`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,r),children:t(HD,{"data-slot":`slider-range`,className:z(`absolute h-full bg-primary data-[orientation=vertical]:w-full`,i)})}),g.map(e=>t(YD,{"data-slot":`slider-thumb`,"aria-label":d,className:z(`block size-3.5 rounded-full border border-primary bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,o)},e))]})});uO.displayName=ND.displayName;var dO=Object.defineProperty,fO=(e,t)=>dO(e,`name`,{value:t,configurable:!0}),pO=`Switch`,[mO,hO]=an(pO),[gO,_O]=mO(pO);function vO(e){let{__scopeSwitch:n,checked:r,children:i,defaultChecked:o,disabled:s,form:c,name:l,onCheckedChange:u,required:d,value:f=`on`,internal_do_not_use_render:p}=e,[m,h]=br({prop:r,defaultProp:o??!1,onChange:u,caller:pO}),[g,_]=a.useState(null),[v,y]=a.useState(null),b=a.useRef(!1),[x,S]=a.useReducer(e=>e+1,0),C={checked:m,setChecked:h,disabled:s,control:g,setControl:_,name:l,form:c,value:f,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:d,defaultChecked:o,isFormControl:!g||!!c||!!g.closest(`form`),bubbleInput:v,setBubbleInput:y};return t(gO,{scope:n,...C,children:EO(p)?p(C):i})}fO(vO,`SwitchProvider`);var yO=`SwitchTrigger`,bO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,form:s,value:c,disabled:l,checked:u,required:d,setControl:f,setChecked:p,hasConsumerStoppedPropagationRef:m,onUserInteraction:h,isFormControl:g,bubbleInput:_}=_O(yO,e),v=R(i,f),y=a.useRef(u);return a.useEffect(()=>{let e=s?o?.ownerDocument.getElementById(s):o?.form;if(e instanceof HTMLFormElement){let t=fO(()=>p(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,s,p]),t(H.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":d,"data-state":DO(u),"data-disabled":l?``:void 0,disabled:l,value:c,...r,ref:v,onClick:B(n,e=>{h(),p(e=>!e),_&&g&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})},`SwitchTrigger`)),xO=a.forwardRef(fO(function(r,i){let{__scopeSwitch:a,name:o,checked:s,defaultChecked:c,required:l,disabled:u,value:d,onCheckedChange:f,form:p,...m}=r;return t(vO,{__scopeSwitch:a,checked:s,defaultChecked:c,disabled:u,required:l,onCheckedChange:f,name:o,form:p,value:d,internal_do_not_use_render:({isFormControl:r})=>n(e,{children:[t(bO,{...m,ref:i,__scopeSwitch:a}),r&&t(TO,{__scopeSwitch:a})]})})},`Switch`)),SO=`SwitchThumb`,CO=a.forwardRef(fO(function(e,n){let{__scopeSwitch:r,...i}=e,a=_O(SO,r);return t(H.span,{"data-state":DO(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:n})},`SwitchThumb`)),wO=`SwitchBubbleInput`,TO=a.forwardRef(fO(function({__scopeSwitch:e,onClick:n,...r},i){let{control:o,hasConsumerStoppedPropagationRef:s,userInteractionCount:c,checked:l,defaultChecked:u,required:d,disabled:f,name:p,value:m,form:h,bubbleInput:g,setBubbleInput:_}=_O(wO,e),v=R(i,_),y=Pn(o),b=a.useRef(!1),x=a.useRef(l),S=a.useRef(c);a.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==S.current;S.current=c;let i=x.current!==l;x.current=l;let a=!(r&&s.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,l),e.dispatchEvent(t),b.current=!1}},[g,l,s,c]);let C=a.useRef(l);return t(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??C.current,required:d,disabled:f,name:p,value:m,form:h,...r,tabIndex:-1,ref:v,onClick:B(n,e=>{b.current&&e.stopPropagation()}),style:{...r.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function EO(e){return typeof e==`function`}fO(EO,`isFunction`);function DO(e){return e?`checked`:`unchecked`}fO(DO,`getState`);const OO={sm:[`h-5 w-8`,`size-3`,`translate-x-4 rtl:-translate-x-4`],md:[`h-6 w-11`,`size-4`,`translate-x-6 rtl:-translate-x-6`],lg:[`h-8 w-16`,`size-6`,`translate-x-9 rtl:-translate-x-9`]};function kO({className:e,size:r=`md`,value:i,onChange:a,children:o,disabled:s,...c}){let[l,u,d]=OO[r],f=t(xO,{"data-slot":`switch`,checked:i,onCheckedChange:a,disabled:s,...c,className:z(`data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 shrink-0 rounded-full border focus-visible:ring-3 aria-invalid:ring-3 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,l,!o&&e),children:t(CO,{"data-slot":`switch-thumb`,className:z(`bg-white rounded-full pointer-events-none block ring-0 transition-transform`,u,i?d:`translate-x-1 rtl:-translate-x-1`)})});return o?n(`div`,{className:z(`flex items-center`,e),children:[f,t(`span`,{className:`px-2`,children:o})]}):f}var AO=Object.defineProperty,jO=(e,t)=>AO(e,`name`,{value:t,configurable:!0}),MO=`Tabs`,[NO,PO]=an(MO,[Xv]),FO=Xv(),[IO,LO]=NO(MO),RO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:c,activationMode:l=`automatic`,...u}=e,d=fe(c),[f,p]=br({prop:i,onChange:a,defaultProp:o??``,caller:MO});return t(IO,{scope:r,baseId:V(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l,children:t(H.div,{dir:d,"data-orientation":s,...u,ref:n})})},`Tabs`)),zO=`TabsList`,BO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,loop:i=!0,...a}=e,o=LO(zO,r),s=FO(r);return t(cy,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:t(H.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:n})})},`TabsList`)),VO=`TabsTrigger`,HO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,disabled:a=!1,...o}=e,s=LO(VO,r),c=FO(r),l=GO(s.baseId,i),u=KO(s.baseId,i),d=i===s.value;return t(ly,{asChild:!0,...c,focusable:!a,active:d,children:t(H.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":u,"data-state":d?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:n,onMouseDown:B(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:B(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:B(e.onFocus,()=>{let e=s.activationMode!==`manual`;!d&&!a&&e&&s.onValueChange(i)})})})},`TabsTrigger`)),UO=`TabsContent`,WO=a.forwardRef(jO(function(e,n){let{__scopeTabs:r,value:i,forceMount:o,children:s,...c}=e,l=LO(UO,r),u=GO(l.baseId,i),d=KO(l.baseId,i),f=i===l.value,p=a.useRef(f);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),t(or,{present:o||f,children:({present:r})=>t(H.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...c,ref:n,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:r&&s})})},`TabsContent`));function GO(e,t){return`${e}-trigger-${t}`}jO(GO,`makeTriggerId`);function KO(e,t){return`${e}-content-${t}`}jO(KO,`makeContentId`);var qO=RO,JO=BO,YO=HO,XO=WO;const ZO=a.createContext({size:void 0,tabs:void 0,current:void 0,setTab:void 0,responsive:!1,variant:`tabs`,updateHash:!0}),QO=({tabs:e,defaultValue:n,current:r,className:i,fullWidth:o,fullHeight:s,children:c,onTabChange:l,responsive:u=!1,variant:d=`tabs`,updateHash:f=!0,canChangeTab:p})=>{let m=a.useMemo(()=>e.filter(e=>e.is_allowed===void 0||e.is_allowed===!0),[e]),[h,g]=a.useState(()=>{let e=typeof r==`function`?r():r;if(e)return e;let t=window.location.hash,i=t?t.substring(1):void 0;return i&&m.some(e=>e.name===i)?i:n||m[0]?.name});a.useEffect(()=>{let e=typeof r==`function`?r():r;e&&e!==h&&g(e)},[r,h]),a.useEffect(()=>{if(r)return;let e=()=>{let e=window.location.hash,t=e?e.substring(1):void 0;t&&m.some(e=>e.name===t)?g(t):!e&&n&&g(n)};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[r,m,n]);let _=a.useCallback(e=>{if(!(e!==h&&p&&!p(e,h))){if(g(e),f&&!r){let t=window.history.state,n=`${window.location.pathname+window.location.search}#${e}`;window.history.pushState(t,``,n)}l&&l(e)}},[r,l,f,p,h]),v=a.useCallback(e=>{_(e)},[_]);return t(ZO.Provider,{value:{tabs:m,size:o?m.length:0,current:h,setTab:v,responsive:u,variant:d,updateHash:f,canChangeTab:p},children:t(qO,{defaultValue:h||m[0]?.name,value:h,onValueChange:_,className:z(`flex-1 flex flex-col min-h-0 px-2`,s&&`h-full`,i),children:c})})},$O=({className:r,sticky:i,direction:o})=>{let{tabs:s,size:c,current:l,setTab:u,responsive:d,variant:f,updateHash:p,canChangeTab:m}=a.useContext(ZO),h=c!==0,g=a.useCallback(e=>{if(!s||!u||e!==l&&m&&!m(e,l))return;let t=s.find(t=>t.name===e);if(t?.href&&p){let e=window.history.state;window.history.pushState(e,``,t.href)}u(e)},[s,u,p,m,l]);return!s||!u?(console.warn(`TabsBar: No tabs provided or setTab not available`),null):n(e,{children:[d&&t(`div`,{className:`px-2 block lg:hidden`,children:t(JT,{label:`Tab`,className:z(i&&`sticky top-0 bg-background z-10`,r),options:s,optionLabel:e=>typeof e.label==`string`?e.label:String(e.label),value:s.find(e=>e.name===l),onChange:e=>{g(e.name)}})}),t(tk,{size:c,variant:f,className:z(h?`w-full`:``,i&&`sticky top-0 bg-background z-10`,o===`vertical`?`flex-col items-start border-b-0 mb-0`:`flex-row`,d?`hidden lg:flex`:``,r),children:s.map(e=>t(nk,{className:z(o===`vertical`?`w-full text-start`:``),value:e.name,disabled:e.disabled,href:e.href,variant:f,onClick:()=>g(e.name),children:e.label},e.name))})]})},ek=({className:n})=>{let{tabs:r}=a.useContext(ZO);return r?t(e,{children:r.map(e=>t(rk,{value:e.name,className:n,children:e.content},e.name))}):null},tk=a.forwardRef(({className:e,size:n,variant:r=`tabs`,...i},a)=>t(ZO.Provider,{value:{size:n,variant:r},children:t(JO,{ref:a,className:z(r===`tabs`?`border-b -mb-px flex gap-4`:`flex gap-2 p-1 rounded-md`,e),...i})}));tk.displayName=JO.displayName;const nk=a.forwardRef(({className:e,href:n,variant:r=`tabs`,...i},o)=>{let{size:s}=a.useContext(ZO),c=a.useCallback(e=>{if(n){e.preventDefault();let t=window.history.state;window.history.pushState(t,``,n)}i.onClick&&i.onClick(e)},[n,i.onClick]);return t(YO,{ref:o,className:z(r===`tabs`?z(`border-b-2 px-2 py-1.5 text-sm font-medium whitespace-nowrap cursor-pointer`,`border-transparent text-muted hover:border-border hover:text-foreground`,`data-[state=active]:border-primary data-[state=active]:text-info`,`disabled:pointer-events-none disabled:opacity-50`):z(`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`),e,s?`w-1/${s}`:``),onClick:c,...i})});nk.displayName=YO.displayName;const rk=a.forwardRef(({className:e,...n},r)=>t(XO,{ref:r,className:z(`focus-visible:outline-none`,`flex-1 overflow-y-auto min-h-0 pt-2 pb-4`,e),...n}));rk.displayName=XO.displayName;const ik=A(`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`}}),ak=p(({className:e,size:n,weight:r,...i},a)=>t(`p`,{ref:a,className:z(ik({size:n,weight:r,className:e})),...i}));ak.displayName=`Text`;function ok({className:e,minLines:n,maxLines:r,value:i,...a}){let o=C(null),s=n!==void 0||r!==void 0,c=h(()=>{let e=o.current;if(!e)return;let t=getComputedStyle(e),i=parseFloat(t.lineHeight)||parseFloat(t.fontSize)*1.5,a=(parseFloat(t.paddingTop)||0)+(parseFloat(t.paddingBottom)||0),s=(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.borderBottomWidth)||0),c=n??1,l=r??1/0,u=c*i+a+s,d=l===1/0?1/0:l*i+a+s;e.style.height=`auto`;let f=Math.min(Math.max(e.scrollHeight,u),d);e.style.height=`${f}px`,e.style.overflowY=d!==1/0&&e.scrollHeight>d?`auto`:`hidden`},[n,r]);return x(()=>{s&&c()}),t(`textarea`,{ref:o,"data-slot":`textarea`,value:i,className:z(`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`,s&&`resize-none`,e),...a})}const sk=d({theme:`system`,setTheme:()=>null});function ck({children:e,defaultTheme:n=`system`,storageKey:r=`vite-ui-theme`,...i}){let[a,o]=w(()=>localStorage.getItem(r)||n);_(()=>{let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),a===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(a)},[a]);let s=h((e,t)=>{t?.persist!==!1&&localStorage.setItem(r,e),o(e)},[r]),c=S(()=>({theme:a,setTheme:s}),[s,a]);return t(sk.Provider,{...i,value:c,children:e})}const lk=()=>{let e=g(sk);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e};function uk({option:e,current:n,setTheme:r,icon:i,alt:a}){return t(U,{variant:n===e?`secondary`:`outline`,size:`sm`,onClick:()=>r(e),title:a,children:i})}function dk({label:e,className:r}={}){let{setTheme:i,theme:a}=lk(),{t:o}=k(),s=e===!1?!1:e??o(`theme.label`);return n(`div`,{className:r??(s?`flex justify-between px-2 items-center`:`flex items-center gap-1`),children:[s&&t(`p`,{className:`text-sm font-semibold`,children:s}),n(`div`,{className:`flex gap-2`,children:[t(uk,{current:a,option:`system`,setTheme:i,icon:t(L,{}),alt:o(`theme.system`)}),t(uk,{current:a,option:`light`,setTheme:i,icon:t(Ye,{}),alt:o(`theme.light`)}),t(uk,{current:a,option:`dark`,setTheme:i,icon:t(Ge,{}),alt:o(`theme.dark`)})]})]})}function fk(e,n){return{label:String(e),check:t(n?Me:`div`,{className:`size-4`}),reverse:!1,className:`flex-1 px-2 py-2 hover:bg-muted nowrap`}}function pk({value:e,options:i,onChange:a,className:o,optionLayout:s,by:c,noCheck:l,filterBy:u}){let{t:d}=k(),[f,p]=w(e),[m,h]=w(``),g=e=>{p(e),a(e)},_=S(()=>typeof c==`string`?(e,t)=>e[c]===t[c]:c||((e,t)=>e===t),[c]);return n(`div`,{className:r(``,o),children:[u&&t(MT,{type:`text`,placeholder:d(`form.filter`),value:m,onChange:e=>h(e)}),i.map((e,n)=>{if(u&&!u(m)(e))return null;let r=f?_(f,e):!1,i;return s?(i=s(e,r),i=Object.assign(fk(e,r),i)):i=fk(e,r),t(mk,{option:e,onSelect:g,layout:i,noCheck:l},`option-${n}`)})]})}function mk({option:e,onSelect:i,layout:a,noCheck:o}){return n(U,{variant:`unstyled`,size:`none`,className:r(`group !flex w-full items-center cursor-pointer gap-x-2 hover:bg-muted`,a.reverse&&`flex-row-reverse`,a.className),onClick:()=>i(e),children:[o?null:t(`div`,{className:``,children:a.check}),t(`div`,{className:`flex-1`,children:a.label})]})}function hk({isOpen:e,title:r,onClose:i,children:a,panelWidth:o=768,backdrop:s=!1,side:c=`right`,resizable:l=!0,className:u,contentClassName:d}){let[f,p]=w(o),m=e=>{e.preventDefault();let t=!0,n=e.pageX,r=f,i=e=>{if(t){let t=n-e.pageX,i=Math.max(r+t,480);p(i)}},a=()=>{t=!1,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},h=c===`left`,g=h?`left-0`:`right-0`,_=h?`pr-10 sm:pr-16`:`pl-10 sm:pl-16`,v=h?`border-r`:`border-l`,y=h?`-right-1`:`-left-1`,b=h?`-100%`:`100%`;return t(Tp,{children:e&&n(`div`,{className:`relative z-20`,children:[s&&t(vh.div,{className:`fixed inset-0 bg-black/70`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:i}),t(`div`,{className:`fixed inset-y-0 ${g} overflow-hidden`,children:t(`div`,{className:`absolute inset-0 overflow-hidden`,children:t(`div`,{className:`pointer-events-none fixed inset-y-0 ${g} flex max-w-full ${_}`,children:t(vh.div,{className:`pointer-events-auto ${v}`,style:{width:`${f}px`},initial:{x:b},animate:{x:0},exit:{x:b},transition:{type:`spring`,stiffness:300,damping:30},children:n(`div`,{className:`relative flex h-full`,children:[l&&t(`div`,{"aria-label":`Resize panel`,className:`absolute ${y} top-0 bottom-0 w-3 z-25 cursor-ew-resize hover:bg-primary transition-colors flex items-center justify-center`,onMouseDown:m,children:t(We,{className:`rotate-90 font-semibold`,strokeWidth:4})}),n(`div`,{className:`flex-1 min-w-0 flex flex-col bg-background shadow-xl ${u}`,children:[r&&t(`div`,{className:`sticky top-0 z-10 bg-background px-2 sm:px-4 py-2 border-b`,children:n(`div`,{className:`flex items-start justify-between`,children:[t(`h2`,{className:`w-full text-base font-semibold leading-6`,children:t(`div`,{className:`text-2xl`,children:r??``})}),t(`div`,{className:`ms-3 flex h-7 items-center`,children:t(gk,{onClose:i})})]})}),t(`div`,{className:d??`flex-1 overflow-auto px-2 sm:px-4 py-4`,children:t(`div`,{className:`w-full h-full flex-1 flex flex-col`,children:a})})]})]})})})})})]})})}function gk({onClose:e}){return t(U,{title:`Close panel`,variant:`ghost`,onClick:e,children:t(Ze,{className:`size-6`,"aria-hidden":`true`})})}function _k(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 Error(`Unexpected size: ${e}`)}}function vk({size:e,className:i}){let a=_k(e||`md`);return n(`svg`,{className:r(`animate-[spin_0.8s_linear_infinite] text-info`,a,i),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),t(`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`})]})}function yk({options:i,value:a,onChange:o,onOptionsChange:s,placeholder:c,className:l,disabled:u,layout:d=`horizontal`,creatable:f=!1,createText:p=`Create "%value%"`,maxDropdownHeight:m=200}){let h=g(vT),[v,y]=w(``),[b,x]=w(0),[S,T]=w(0),[E,D]=w(null),O=C(null),k=C(null),A=C(null),j=C(null),M=h?.open??!1,N=h?.setOpen??(()=>{});_(()=>{let e=k.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect().width;T(t)},n=new ResizeObserver(()=>{t()});return t(),n.observe(e),()=>{n.disconnect()}},[]);let P=i.filter(e=>!a.includes(e)&&e.toLowerCase().includes(v.toLowerCase())),ee=f&&v&&!a.includes(v)&&!i.includes(v),te=P.length+ +!!ee;_(()=>{v!==``&&D(null)},[v]),_(()=>{M&&b>=0&&j.current&&A.current&&j.current.scrollIntoView({block:`nearest`,behavior:`smooth`})},[b,M]),_(()=>{M?O.current?.focus():y(``)},[M]),_(()=>{if(!M)return;let e=e=>e instanceof Node&&(k.current?.contains(e)===!0||A.current?.contains(e)===!0),t=t=>{e(t.target)||N(!1)},n=t=>{e(t.target)||N(!1)},r=()=>{N(!1)};return document.addEventListener(`pointerdown`,t,!0),document.addEventListener(`focusin`,n,!0),window.addEventListener(`blur`,r),document.addEventListener(`visibilitychange`,r),()=>{document.removeEventListener(`pointerdown`,t,!0),document.removeEventListener(`focusin`,n,!0),window.removeEventListener(`blur`,r),document.removeEventListener(`visibilitychange`,r)}},[M,N]);let F=e=>{o([...a,e]),y(``),N(!1),x(0),D(null)},ne=e=>{o([...a,e]),s&&!i.includes(e)&&s([...i,e]),y(``),N(!1),x(0),D(null)},re=(e,t)=>{t.stopPropagation(),o(a.filter(t=>t!==e)),D(null)};return n(`div`,{className:r(`relative`,l),children:[t(xT,{asChild:!0,children:n(`div`,{ref:k,className:r(`min-h-[40px] w-full rounded-md border border-input bg-background px-3 py-2`,`flex items-center gap-1`,d===`horizontal`?`flex-wrap`:`flex-col items-stretch`,`cursor-text`,`ring-offset-background`,u&&`opacity-50 cursor-not-allowed`,M?`ring-1 ring-inset ring-ring`:``),onClick:()=>{u||O.current?.focus()},children:[d===`vertical`&&a.length>0&&t(`div`,{className:`flex flex-col gap-1 w-full`,children:a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center justify-between gap-2 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md w-full transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[t(`span`,{className:`truncate`,children:e}),t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors flex-shrink-0`,children:t(Ze,{className:`h-3 w-3`})})]},e))}),d===`horizontal`&&a.map((e,i)=>n(`span`,{className:r(`inline-flex items-center gap-1 px-2 py-1 text-sm bg-info text-foreground ring-1 ring-primary/30 rounded-md transition-all`,E===i&&`ring-2 ring-destructive shadow-[0_0_8px_rgba(252,165,165,0.5)]`),children:[e,t(`button`,{type:`button`,onClick:t=>re(e,t),disabled:u,className:`hover:bg-info rounded-sm transition-colors`,children:t(Ze,{className:`h-3 w-3`})})]},e)),t(`input`,{ref:O,type:`text`,value:v,onChange:e=>{y(e.target.value),x(0)},onKeyDown:e=>{if(e.key===`Enter`&&M&&te>0){e.preventDefault(),e.stopPropagation(),b===P.length&&ee?ne(v):b<P.length&&F(P[b]);return}if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),M?x(e=>e<te-1?e+1:e):N(!0);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),M?x(e=>e>0?e-1:0):N(!0);return}if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),N(!1);return}if(e.key===`Backspace`&&v===``&&a.length>0){e.stopPropagation();let t=a.length-1;E===t?(o(a.slice(0,-1)),D(null)):D(t);return}!M&&e.key.length===1&&N(!0)},onClick:e=>{e.stopPropagation(),u||N(!0)},onFocus:()=>{u||N(!0)},disabled:u,placeholder:a.length===0?c:``,className:r(`flex-1 min-w-[120px] bg-transparent text-sm`,`placeholder:text-muted`,`border-none outline-none focus:outline-none focus:ring-0 p-0 m-0`,d===`vertical`&&`w-full`)})]})}),t(CT,{style:{width:`${S}px`},className:`p-0 bg-popover border border-border shadow-lg`,align:`start`,side:`bottom`,onOpenAutoFocus:e=>{e.preventDefault()},children:t(`div`,{ref:A,className:`overflow-y-auto`,style:{maxHeight:`${m}px`},children:P.length===0&&!ee?t(`div`,{className:`px-3 py-2 text-sm text-muted`,children:v?`No options found`:`No more options available`}):n(e,{children:[P.length>0&&t(`ul`,{className:`py-1`,children:P.map((e,n)=>t(`li`,{ref:e=>{n===b&&(j.current=e)},role:`option`,"aria-selected":n===b,tabIndex:0,onClick:()=>F(e),onKeyDown:Bi(()=>F(e)),onMouseEnter:()=>x(n),className:r(`px-3 py-2 text-sm cursor-pointer transition-colors`,n===b?`bg-info text-foreground`:`hover:bg-muted/50`),children:e},e))}),ee&&n(e,{children:[P.length>0&&t(`div`,{className:`border-t border-border`}),t(U,{ref:e=>{b===P.length&&(j.current=e)},variant:`unstyled`,size:`none`,onClick:()=>ne(v),onMouseEnter:()=>x(P.length),className:r(`!flex w-full justify-start px-3 py-2 text-sm cursor-pointer transition-colors text-info`,b===P.length?`bg-info`:`hover:bg-muted/50`),children:p.replace(`%value%`,v)})]})]})})})]})}function bk(e){return t(yT,{click:!0,children:t(yk,{...e})})}function xk({className:e,children:n,...i}){return t(`table`,{className:r(`
|
|
285
285
|
divide-y divide-border
|
|
286
286
|
[&>tbody]:divide-y [&>tbody]:divide-border
|
|
287
287
|
[&_th]:text-start [&_th]:px-3 [&_th]:py-3.5 [&_th]:text-sm [&_th]:font-normal [&_th]:text-muted
|