@usevyre/react 1.2.1 → 1.4.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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),P=require("react-dom");function v(...e){const r=[];for(const a of e)if(a){if(typeof a=="string")r.push(a);else if(Array.isArray(a)){const n=v(...a);n&&r.push(n)}else if(typeof a=="object")for(const[n,o]of Object.entries(a))o&&r.push(n)}return r.join(" ")}const Lr={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Dr={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},we=s.forwardRef(({variant:e="secondary",size:r="md",loading:a=!1,disabled:n,leftIcon:o,rightIcon:i,className:l,children:c,as:d="button",...h},f)=>{const y=n||a;return t.jsxs(d,{ref:f,className:v("vyre-btn",Lr[e],Dr[r],a&&"vyre-btn--loading",l),disabled:d==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":r,...h,children:[a&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(Sr,{})}),!a&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),c&&t.jsx("span",{className:"vyre-btn__label",children:c}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});we.displayName="VyreButton";function Sr(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"vyre-spinner","aria-hidden":"true",children:t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"10"})})}const ke=s.forwardRef(({variant:e="default",dot:r=!1,className:a,children:n,...o},i)=>t.jsxs("span",{ref:i,className:v("vyre-badge",`vyre-badge--${e}`,a),"data-variant":e,...o,children:[r&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),n]}));ke.displayName="VyreBadge";const de=s.forwardRef(({variant:e="default",hoverable:r=!1,clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-card",`vyre-card--${e}`,r&&"vyre-card--hoverable",a&&"vyre-card--clickable",n),"data-variant":e,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));de.displayName="VyreCard";const Ne=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__header",e),...a,children:r}));Ne.displayName="VyreCardHeader";const ue=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__body",e),...a,children:r}));ue.displayName="VyreCardBody";const Ce=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__footer",e),...a,children:r}));Ce.displayName="VyreCardFooter";const Re=s.forwardRef(({label:e,hint:r,state:a="idle",required:n=!1,htmlFor:o,className:i,children:l,...c},d)=>t.jsxs("div",{ref:d,className:v("vyre-field",a!=="idle"&&`vyre-field--${a}`,i),"data-state":a,...c,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,n&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),l,r&&t.jsx("span",{className:"vyre-field__hint",role:a==="error"?"alert":void 0,children:r})]}));Re.displayName="VyreField";const Le=s.forwardRef(({required:e=!1,className:r,children:a,...n},o)=>t.jsxs("label",{ref:o,className:v("vyre-field__label",r),...n,children:[a,e&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}));Le.displayName="VyreFieldLabel";const De=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-field__description",e),...a,children:r}));De.displayName="VyreFieldDescription";const Se=s.forwardRef(({className:e,children:r,...a},n)=>r?t.jsx("p",{ref:n,role:"alert",className:v("vyre-field__error",e),...a,children:r}):null);Se.displayName="VyreFieldError";const Me=s.forwardRef(({orientation:e="vertical",className:r,children:a,...n},o)=>t.jsx("div",{ref:o,className:v("vyre-field-group",`vyre-field-group--${e}`,r),...n,children:a}));Me.displayName="VyreFieldGroup";const Ie=s.forwardRef(({legend:e,className:r,children:a,...n},o)=>t.jsxs("fieldset",{ref:o,className:v("vyre-field-set",r),...n,children:[e&&t.jsx("legend",{className:"vyre-field-set__legend",children:e}),a]}));Ie.displayName="VyreFieldSet";const Te=s.forwardRef(({size:e="md",leftElement:r,rightElement:a,className:n,...o},i)=>r||a?t.jsxs("div",{className:v("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:r}),t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,!!r&&"vyre-input--has-left",!!a&&"vyre-input--has-right",n),...o}),a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:a})]}):t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,n),...o}));Te.displayName="VyreInput";const Ee=s.forwardRef(({size:e="md",resize:r="vertical",className:a,style:n,...o},i)=>t.jsx("textarea",{ref:i,className:v("vyre-textarea",`vyre-textarea--${e}`,a),style:{resize:r,...n},...o}));Ee.displayName="VyreTextarea";const Mr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Ae=s.forwardRef(({open:e,onClose:r,size:a="md",closeOnBackdrop:n=!0,closeOnEsc:o=!0,initialFocus:i,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(g=>{p.current=g,typeof y=="function"?y(g):y&&(y.current=g)},[y]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=p.current;if(!N)return;const b=Array.from(N.querySelectorAll(Mr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]),_=s.useCallback(g=>{g.key==="Escape"&&o&&r()},[o,r]);return s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=setTimeout(()=>{var b;i!=null&&i.current?i.current.focus():(b=p.current)==null||b.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",m),document.body.style.overflow=g,clearTimeout(N)}},[e,_,m,i]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-modal-backdrop",onClick:g=>{n&&g.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:u,className:v("vyre-modal",`vyre-modal--${a}`,l),role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,...f,children:c})}),document.body):null});Ae.displayName="VyreModal";const Be=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__header",e),...a,children:r}));Be.displayName="VyreModalHeader";const Ve=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__body",e),...a,children:r}));Ve.displayName="VyreModalBody";const $e=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__footer",e),...a,children:r}));$e.displayName="VyreModalFooter";const Fe=s.createContext(null);function Ir(e,r){switch(r.type){case"ADD":return[...e,r.payload];case"REMOVE":return e.filter(a=>a.id!==r.id);default:return e}}let Tr=0;const Er=()=>`vyre-t-${++Tr}`;function Ar({children:e}){const[r,a]=s.useReducer(Ir,[]),n=s.useCallback(i=>{const l=Er();return a({type:"ADD",payload:{...i,id:l}}),l},[]),o=s.useCallback(i=>{a({type:"REMOVE",id:i})},[]);return t.jsxs(Fe.Provider,{value:{toast:n,dismiss:o},children:[e,typeof document<"u"&&P.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:r.map(i=>t.jsx(Vr,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function Br(){const e=s.useContext(Fe);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function Vr({title:e,description:r,variant:a="default",duration:n=4e3,onDismiss:o}){return s.useEffect(()=>{if(n===1/0)return;const i=setTimeout(o,n);return()=>clearTimeout(i)},[n,o]),t.jsxs("div",{className:v("vyre-toast",`vyre-toast--${a}`),role:"alert","data-variant":a,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),r&&t.jsx("p",{className:"vyre-toast__description",children:r})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx($r,{})})]})}function $r(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const We=s.forwardRef(({options:e,value:r,defaultValue:a,onChange:n,placeholder:o="Select an option",disabled:i=!1,size:l="md",className:c,...d},h)=>{const f=r!==void 0,[y,p]=s.useState(a??""),x=f?r:y,[u,m]=s.useState(!1),[_,g]=s.useState(-1),N=s.useRef(null),b=s.useRef(null),w=`${s.useId()}-listbox`,I=e.find(j=>j.value===x),A=e.filter(j=>!j.disabled),T=s.useCallback(()=>{m(!1),g(-1)},[]),M=s.useCallback(j=>{var k;j.disabled||(f||p(j.value),n==null||n(j.value),T(),(k=N.current)==null||k.focus())},[f,n,T]);s.useEffect(()=>{if(!u)return;const j=k=>{const D=h==null?void 0:h.current;D&&!D.contains(k.target)&&T()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,h,T]),s.useEffect(()=>{var k;if(!u||_<0)return;const j=(k=b.current)==null?void 0:k.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const B=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){m(!0);const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}break}case"ArrowUp":{j.preventDefault(),u||(m(!0),g(e.length-1));break}case"Escape":{T();break}}},R=j=>{var k;switch(j.key){case"ArrowDown":{j.preventDefault(),g(D=>{let E=D+1;for(;E<e.length&&e[E].disabled;)E++;return E<e.length?E:D});break}case"ArrowUp":{j.preventDefault(),g(D=>{let E=D-1;for(;E>=0&&e[E].disabled;)E--;return E>=0?E:D});break}case"Enter":case" ":{j.preventDefault(),_>=0&&M(e[_]);break}case"Escape":case"Tab":{T(),(k=N.current)==null||k.focus();break}case"Home":{j.preventDefault();const D=e.findIndex(E=>!E.disabled);D>=0&&g(D);break}case"End":{j.preventDefault();const D=[...e].reverse().findIndex(E=>!E.disabled);D>=0&&g(e.length-1-D);break}}};return t.jsxs("div",{ref:h,className:v("vyre-select",`vyre-select--${l}`,c),"data-open":u,...d,children:[t.jsxs("button",{ref:N,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":w,"aria-disabled":i,disabled:i,onClick:()=>{i||m(j=>{if(!j){const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}return!j})},onKeyDown:B,children:[I?t.jsx("span",{className:"vyre-select__value",children:I.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(Fr,{})]}),u&&t.jsxs("ul",{ref:b,id:w,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:R,children:[e.map((j,k)=>t.jsxs("li",{role:"option","aria-selected":j.value===x,"aria-disabled":j.disabled,"data-highlighted":k===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&g(k),onMouseDown:D=>{D.preventDefault(),M(j)},children:[j.label,j.value===x&&t.jsx(Wr,{})]},j.value)),A.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});We.displayName="VyreSelect";function Fr(){return t.jsx("svg",{className:"vyre-select__chevron",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wr(){return t.jsx("svg",{className:"vyre-select__check",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const He=s.createContext(null);function Pe(){const e=s.useContext(He);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Oe=s.forwardRef(({defaultValue:e="",value:r,onChange:a,className:n,children:o,...i},l)=>{const c=r!==void 0,[d,h]=s.useState(e),f=c?r:d,y=s.useId(),p=s.useCallback(x=>{c||h(x),a==null||a(x)},[c,a]);return t.jsx(He.Provider,{value:{value:f,onChange:p,baseId:y},children:t.jsx("div",{ref:l,className:v("vyre-tabs",n),...i,children:o})})});Oe.displayName="VyreTabs";const Ge=s.forwardRef(({className:e,children:r,"aria-label":a,...n},o)=>{const i=s.useRef(null),l=c=>{var y;const d=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),h=d.findIndex(p=>p===document.activeElement);if(h<0)return;let f=h;if(c.key==="ArrowRight")f=(h+1)%d.length;else if(c.key==="ArrowLeft")f=(h-1+d.length)%d.length;else if(c.key==="Home")f=0;else if(c.key==="End")f=d.length-1;else return;c.preventDefault(),d[f].focus(),d[f].click()};return t.jsx("div",{ref:c=>{i.current=c,typeof o=="function"?o(c):o&&(o.current=c)},role:"tablist",className:v("vyre-tabs__list",e),"aria-label":a,onKeyDown:l,...n,children:r})});Ge.displayName="VyreTabList";const Ye=s.forwardRef(({value:e,disabled:r=!1,className:a,children:n,...o},i)=>{const{value:l,onChange:c,baseId:d}=Pe(),h=e===l;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${d}-tab-${e}`,"aria-controls":`${d}-panel-${e}`,"aria-selected":h,disabled:r,tabIndex:h?0:-1,className:v("vyre-tabs__tab",h&&"vyre-tabs__tab--active",a),"data-selected":h,onClick:()=>!r&&c(e),...o,children:n})});Ye.displayName="VyreTab";const Ke=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-tabs__panels",e),...a,children:r}));Ke.displayName="VyreTabPanels";const qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i,baseId:l}=Pe();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:v("vyre-tabs__panel",r),...n,children:a}):null});qe.displayName="VyreTabPanel";const Hr=120,Ue=({content:e,placement:r="top",delay:a=300,children:n,className:o})=>{const[i,l]=s.useState("hidden"),c=s.useRef(null),d=s.useRef(null),h=s.useId(),f=s.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),c.current=setTimeout(()=>l("visible"),a)},[a]),y=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l("leaving"),d.current=setTimeout(()=>l("hidden"),Hr)},[]),p=s.Children.only(n),x=s.cloneElement(p,{onMouseEnter:u=>{var m,_;f(),(_=(m=p.props).onMouseEnter)==null||_.call(m,u)},onMouseLeave:u=>{var m,_;y(),(_=(m=p.props).onMouseLeave)==null||_.call(m,u)},onFocus:u=>{var m,_;l("visible"),(_=(m=p.props).onFocus)==null||_.call(m,u)},onBlur:u=>{var m,_;y(),(_=(m=p.props).onBlur)==null||_.call(m,u)},"aria-describedby":i!=="hidden"?h:void 0});return t.jsxs("span",{className:v("vyre-tooltip-wrapper",o),children:[x,i!=="hidden"&&t.jsxs("span",{id:h,role:"tooltip",className:v("vyre-tooltip",`vyre-tooltip--${r}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":r,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ue.displayName="VyreTooltip";const ze=s.createContext(null);function Xe(){const e=s.useContext(ze);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Ze=s.forwardRef(({type:e="single",defaultValue:r,value:a,onValueChange:n,className:o,children:i,...l},c)=>{const d=x=>x===void 0?[]:Array.isArray(x)?x:[x],[h,f]=s.useState(d(r)),y=a!==void 0?d(a):h,p=s.useCallback(x=>{let u;e==="single"?u=y.includes(x)?[]:[x]:u=y.includes(x)?y.filter(m=>m!==x):[...y,x],a===void 0&&f(u),n==null||n(e==="single"?u[0]??"":u)},[e,y,a,n]);return t.jsx(ze.Provider,{value:{type:e,value:y,toggle:p},children:t.jsx("div",{ref:c,className:["vyre-accordion",o].filter(Boolean).join(" "),...l,children:i})})});Ze.displayName="Accordion";const me=s.createContext(null),Qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i}=Xe(),l=i.includes(e);return t.jsx(me.Provider,{value:{itemValue:e,isOpen:l},children:t.jsx("div",{ref:o,"data-state":l?"open":"closed",className:["vyre-accordion__item",r].filter(Boolean).join(" "),...n,children:a})})});Qe.displayName="AccordionItem";const Je=s.forwardRef(({className:e,children:r,...a},n)=>{const{toggle:o}=Xe(),i=s.useContext(me);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:l,isOpen:c}=i;return t.jsxs("button",{ref:n,type:"button","aria-expanded":c,"data-state":c?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(l),...a,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:r}),t.jsx("svg",{className:"vyre-accordion__chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})});Je.displayName="AccordionTrigger";const et=s.forwardRef(({className:e,children:r,...a},n)=>{const o=s.useContext(me);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:n,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...a,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:r})})});et.displayName="AccordionContent";const ve=s.forwardRef(({src:e,alt:r="",fallback:a,size:n="md",status:o,className:i,...l},c)=>{var y;const[d,h]=s.useState(!1),f=e&&!d;return t.jsxs("span",{ref:c,"data-size":n,className:["vyre-avatar",i].filter(Boolean).join(" "),...l,children:[f?t.jsx("img",{src:e,alt:r,className:"vyre-avatar__img",onError:()=>h(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":r||a,children:a??((y=r==null?void 0:r.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});ve.displayName="Avatar";const tt=s.forwardRef(({checked:e,defaultChecked:r,indeterminate:a=!1,onCheckedChange:n,disabled:o,size:i="md",className:l,id:c,...d},h)=>{const f=s.useRef(null),y=h??f;return s.useEffect(()=>{y.current&&(y.current.indeterminate=a)},[a,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,l].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":a||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:c,checked:e,defaultChecked:r,disabled:o,className:"vyre-checkbox__input",onChange:p=>n==null?void 0:n(p.target.checked),...d}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:a?t.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1 1h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}):t.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:t.jsx("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});tt.displayName="Checkbox";const rt=s.createContext(null);let Pr=0;const at=s.forwardRef(({value:e,defaultValue:r,onChange:a,name:n,disabled:o=!1,size:i="md",orientation:l="vertical",options:c,className:d,children:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0,m=u?e:p,_=s.useMemo(()=>n??`vyre-radio-${++Pr}`,[n]),g=s.useCallback(b=>{u||x(b),a==null||a(b)},[u,a]),N={name:_,value:m,onChange:g,groupDisabled:o,size:i};return t.jsx(rt.Provider,{value:N,children:t.jsx("div",{ref:y,role:"radiogroup","aria-orientation":l,className:v("vyre-radio-group",`vyre-radio-group--${l}`,d),"data-disabled":o||void 0,...f,children:c?c.map(b=>t.jsx(fe,{value:b.value,label:b.label,description:b.description,disabled:b.disabled},b.value)):h})})});at.displayName="VyreRadioGroup";const fe=s.forwardRef(({value:e,label:r,description:a,disabled:n,className:o,id:i,...l},c)=>{const d=s.useContext(rt);if(!d)throw new Error("Radio must be used inside a <RadioGroup>.");const h=d.value===e,f=n||d.groupDisabled,y=i??`${d.name}-${e}`.replace(/\s+/g,"-");return t.jsxs("label",{className:v("vyre-radio",`vyre-radio--${d.size}`,f&&"vyre-radio--disabled",o),"data-checked":h||void 0,"data-disabled":f||void 0,htmlFor:y,children:[t.jsx("input",{ref:c,type:"radio",id:y,name:d.name,value:e,checked:h,disabled:f,className:"vyre-radio__input",onChange:()=>{var p;return(p=d.onChange)==null?void 0:p.call(d,e)},...l}),t.jsx("span",{className:"vyre-radio__control","aria-hidden":"true",children:t.jsx("span",{className:"vyre-radio__dot"})}),(r||a)&&t.jsxs("span",{className:"vyre-radio__content",children:[r&&t.jsx("span",{className:"vyre-radio__label",children:r}),a&&t.jsx("span",{className:"vyre-radio__description",children:a})]})]})});fe.displayName="VyreRadio";const Or=["bold","italic","underline","strike","h1","h2","h3","ul","ol","quote","code","link","clear"];function W(e,r){document.execCommand(e,!1,r)}const nt=s.forwardRef(({value:e,onChange:r,placeholder:a="Write something…",disabled:n=!1,readOnly:o=!1,toolbar:i=Or,minHeight:l="10rem",className:c,...d},h)=>{const f=s.useRef(null),y=!n&&!o;s.useEffect(()=>{const m=f.current;m&&m.innerHTML!==e&&(m.innerHTML=e)},[e]);const p=s.useCallback(()=>{f.current&&r(f.current.innerHTML)},[r]),x=s.useCallback(m=>{var _;y&&((_=f.current)==null||_.focus(),m(),p())},[y,p]),u={bold:{label:"Bold",icon:t.jsx("b",{children:"B"}),run:()=>W("bold")},italic:{label:"Italic",icon:t.jsx("i",{children:"I"}),run:()=>W("italic")},underline:{label:"Underline",icon:t.jsx("u",{children:"U"}),run:()=>W("underline")},strike:{label:"Strikethrough",icon:t.jsx("s",{children:"S"}),run:()=>W("strikeThrough")},h1:{label:"Heading 1",icon:t.jsx(t.Fragment,{children:"H1"}),run:()=>W("formatBlock","<h1>")},h2:{label:"Heading 2",icon:t.jsx(t.Fragment,{children:"H2"}),run:()=>W("formatBlock","<h2>")},h3:{label:"Heading 3",icon:t.jsx(t.Fragment,{children:"H3"}),run:()=>W("formatBlock","<h3>")},ul:{label:"Bullet list",icon:t.jsx(t.Fragment,{children:"•≡"}),run:()=>W("insertUnorderedList")},ol:{label:"Numbered list",icon:t.jsx(t.Fragment,{children:"1.≡"}),run:()=>W("insertOrderedList")},quote:{label:"Quote",icon:t.jsx(t.Fragment,{children:"“”"}),run:()=>W("formatBlock","<blockquote>")},code:{label:"Code block",icon:t.jsx(t.Fragment,{children:"</>"}),run:()=>W("formatBlock","<pre>")},link:{label:"Link",icon:t.jsx(t.Fragment,{children:"🔗"}),run:()=>{const m=window.prompt("Link URL");m&&W("createLink",m)}},clear:{label:"Clear formatting",icon:t.jsx(t.Fragment,{children:"⌫"}),run:()=>W("removeFormat")}};return t.jsxs("div",{ref:h,className:v("vyre-rte",n&&"vyre-rte--disabled",o&&"vyre-rte--readonly",c),...d,children:[!o&&t.jsx("div",{className:"vyre-rte__toolbar",role:"toolbar","aria-label":"Formatting",children:i.map(m=>{const _=u[m];return _?t.jsx("button",{type:"button",className:"vyre-rte__tool",title:_.label,"aria-label":_.label,disabled:!y,onMouseDown:g=>g.preventDefault(),onClick:()=>x(_.run),children:_.icon},m):null})}),t.jsx("div",{ref:f,className:"vyre-rte__content",contentEditable:y,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":a,"data-placeholder":a,style:{minHeight:l},onInput:p,onBlur:p})]})});nt.displayName="VyreRichTextEditor";const st=s.forwardRef(({checked:e,defaultChecked:r=!1,onCheckedChange:a,disabled:n,size:o="md",className:i,...l},c)=>{const[d,h]=s.useState(r),f=e!==void 0?e:d,y=()=>{if(n)return;const p=!f;e===void 0&&h(p),a==null||a(p)};return t.jsx("button",{ref:c,type:"button",role:"switch","aria-checked":f,disabled:n,"data-checked":f||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...l,children:t.jsx("span",{className:"vyre-switch__thumb"})})});st.displayName="Switch";const ot=s.forwardRef(({value:e,defaultValue:r=0,min:a=0,max:n=100,step:o=1,onValueChange:i,disabled:l,size:c="md",className:d,style:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0?e:p,m=(u-a)/(n-a)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${c}`,d].filter(Boolean).join(" "),"data-disabled":l||void 0,style:{"--vyre-slider-pct":`${m}%`,...h},children:[t.jsx("input",{ref:y,type:"range",min:a,max:n,step:o,value:u,disabled:l,className:"vyre-slider__input",onChange:_=>{const g=Number(_.target.value);e===void 0&&x(g),i==null||i(g)},...f}),t.jsxs("div",{className:"vyre-slider__track",children:[t.jsx("div",{className:"vyre-slider__fill",style:{width:`${m}%`}}),t.jsx("div",{className:"vyre-slider__thumb",style:{left:`${m}%`}})]})]})});ot.displayName="Slider";const it=s.forwardRef(({value:e,max:r=100,indeterminate:a=!1,size:n="md",variant:o="default",className:i,...l},c)=>{const d=a?void 0:Math.min(100,Math.max(0,(e??0)/r*100));return t.jsx("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:e??0,"data-size":n,"data-variant":o,"data-indeterminate":a||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...l,children:t.jsx("div",{className:"vyre-progress__bar",style:d!==void 0?{width:`${d}%`}:void 0})})});it.displayName="Progress";const lt=s.forwardRef(({orientation:e="horizontal",decorative:r=!0,className:a,...n},o)=>t.jsx("div",{ref:o,role:r?"none":"separator","aria-orientation":r?void 0:e,"data-orientation":e,className:["vyre-separator",a].filter(Boolean).join(" "),...n}));lt.displayName="Separator";const ct=s.forwardRef(({required:e,disabled:r,className:a,children:n,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":r||void 0,className:["vyre-label",a].filter(Boolean).join(" "),...o,children:[n,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));ct.displayName="Label";const ye=s.forwardRef(({variant:e="rect",width:r,height:a,className:n,style:o,...i},l)=>t.jsx("div",{ref:l,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",n].filter(Boolean).join(" "),style:{width:typeof r=="number"?`${r}px`:r,height:typeof a=="number"?`${a}px`:a,...o},...i}));ye.displayName="Skeleton";const re=8,Gr=120;function Yr(e){const[r,a]=e.split("-");return{side:r,align:a??"center"}}function Kr(e,r,a,n,o,i){const l=e.width,c=e.height,d=r.width,h=r.height,f=e.left+o,y=e.top+i;let p=0,x=0;switch(a){case"top":p=y-h-re;break;case"bottom":p=y+c+re;break;case"left":x=f-d-re;break;case"right":x=f+l+re;break}if(a==="top"||a==="bottom")switch(n){case"start":x=f;break;case"center":x=f+l/2-d/2;break;case"end":x=f+l-d;break}else switch(n){case"start":p=y;break;case"center":p=y+c/2-h/2;break;case"end":p=y+c-h;break}return{top:p,left:x}}const dt=({trigger:e,children:r,open:a,onOpenChange:n,placement:o="bottom",closeOnOutside:i=!0,className:l})=>{const c=a!==void 0,[d,h]=s.useState(!1),[f,y]=s.useState(!1),[p,x]=s.useState(!1),[u,m]=s.useState({top:0,left:0}),_=c?a:d,g=s.useRef(null),N=s.useRef(null),b=s.useRef(null),L=s.useId(),{side:w,align:I}=Yr(o),A=s.useCallback(R=>{c||h(R),n==null||n(R)},[c,n]),T=s.useCallback(()=>A(!_),[_,A]),M=s.useCallback(()=>{y(!0),b.current=setTimeout(()=>{y(!1),x(!1),A(!1)},Gr)},[A]);s.useEffect(()=>{_?(b.current&&(clearTimeout(b.current),b.current=null),y(!1),x(!0)):p&&!f&&M()},[_]),s.useEffect(()=>{if(!p||!g.current||!N.current)return;const R=g.current.getBoundingClientRect(),j=N.current.getBoundingClientRect(),k=Kr(R,j,w,I,window.scrollX,window.scrollY);m(k)},[p,w,I]),s.useEffect(()=>{if(!p||!i)return;const R=j=>{N.current&&!N.current.contains(j.target)&&g.current&&!g.current.contains(j.target)&&M()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[p,i,M]),s.useEffect(()=>{if(!p)return;const R=j=>{j.key==="Escape"&&M()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[p,M]);const B=s.cloneElement(e,{ref:g,onClick:R=>{var j,k;T(),(k=(j=e.props).onClick)==null||k.call(j,R)},"aria-expanded":_,"aria-controls":L,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[B,p&&P.createPortal(t.jsx("div",{ref:N,id:L,role:"dialog","aria-modal":"false",className:v("vyre-popover",`vyre-popover--${w}`,f&&"vyre-popover--leaving",l),style:{top:u.top,left:u.left},children:r}),document.body)]})};dt.displayName="VyrePopover";const ae=s.createContext(null),ut=s.createContext(null),qr=120,mt=({trigger:e,children:r,placement:a="bottom-start",className:n})=>{const[o,i]=s.useState(!1),[l,c]=s.useState(!1),[d,h]=s.useState(!1),[f,y]=s.useState({top:0,left:0}),[p,x]=s.useState(-1),u=s.useRef(null),m=s.useRef(null),_=s.useRef(null),g=s.useId(),N=s.useCallback(()=>{var M;return Array.from(((M=m.current)==null?void 0:M.querySelectorAll("[role=menuitem]:not([aria-disabled=true]):not([disabled]),[role=menuitemcheckbox]:not([aria-disabled=true]):not([disabled]),[role=menuitemradio]:not([aria-disabled=true]):not([disabled])"))??[])},[]),b=s.useCallback(()=>{c(!0),_.current=setTimeout(()=>{var M;c(!1),h(!1),i(!1),x(-1),(M=u.current)==null||M.focus({preventScroll:!0})},qr)},[]),L=s.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),c(!1),i(!0),h(!0)},[]),w=s.useCallback(()=>{o?b():L()},[o,L,b]);s.useEffect(()=>{if(!d||!u.current)return;const M=u.current.getBoundingClientRect(),B=4,R=window.scrollX,j=window.scrollY;let k=0,D=0;a.startsWith("bottom")?(k=M.bottom+j+B,D=a==="bottom-start"?M.left+R:M.right+R):(k=M.top+j-B,D=a==="top-start"?M.left+R:M.right+R),y({top:k,left:D}),requestAnimationFrame(()=>{var V;(V=N()[0])==null||V.focus({preventScroll:!0}),x(0)})},[d,a,N]),s.useEffect(()=>{if(!d)return;const M=R=>{m.current&&!m.current.contains(R.target)&&u.current&&!u.current.contains(R.target)&&b()},B=R=>{var j,k,D;if(R.key==="Escape"){b();return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const E=N();if(!E.length)return;const V=R.key==="ArrowDown"?1:-1,X=(p+V+E.length)%E.length;(j=E[X])==null||j.focus({preventScroll:!0}),x(X)}if(R.key==="Home"&&((k=N()[0])==null||k.focus({preventScroll:!0}),x(0)),R.key==="End"){const E=N();(D=E[E.length-1])==null||D.focus({preventScroll:!0}),x(E.length-1)}};return document.addEventListener("mousedown",M),document.addEventListener("keydown",B),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",B)}},[d,p,b,N]);const I=s.cloneElement(e,{ref:u,onClick:M=>{var B,R;w(),(R=(B=e.props).onClick)==null||R.call(B,M)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":g}),A=a.endsWith("-end"),T=a.startsWith("top");return t.jsxs(ae.Provider,{value:{close:b},children:[I,d&&P.createPortal(t.jsx("div",{ref:m,id:g,role:"menu","aria-orientation":"vertical",className:v("vyre-dropdown",A&&"vyre-dropdown--end",T&&"vyre-dropdown--top",l&&"vyre-dropdown--leaving",n),style:{top:f.top,left:f.left,transform:A?"translateX(-100%)":void 0},children:r}),document.body)]})};mt.displayName="VyreDropdownMenu";const vt=({children:e,className:r})=>t.jsx("div",{className:v("vyre-dropdown__label",r),children:e});vt.displayName="VyreDropdownLabel";const ft=({children:e,onSelect:r,disabled:a=!1,variant:n="default",icon:o,shortcut:i,className:l})=>{const c=s.useContext(ae);return t.jsxs("button",{role:"menuitem",className:v("vyre-dropdown__item",n==="danger"&&"vyre-dropdown__item--danger",l),"aria-disabled":a||void 0,disabled:a,tabIndex:-1,onClick:()=>{a||(r==null||r(),c==null||c.close())},children:[o&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:o}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),i&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:i})]})};ft.displayName="VyreDropdownItem";const yt=({children:e,checked:r,onCheckedChange:a,disabled:n=!1,shortcut:o,className:i})=>{const l=s.useContext(ae);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":r,"aria-disabled":n||void 0,disabled:n,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{n||(a(!r),l==null||l.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:r&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),o&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:o})]})};yt.displayName="VyreDropdownCheckboxItem";const ht=({value:e,onValueChange:r,children:a})=>t.jsx(ut.Provider,{value:{value:e,onValueChange:r},children:t.jsx("div",{role:"group",children:a})});ht.displayName="VyreDropdownRadioGroup";const bt=({children:e,value:r,disabled:a=!1,className:n})=>{const o=s.useContext(ae),i=s.useContext(ut),l=(i==null?void 0:i.value)===r;return t.jsxs("button",{role:"menuitemradio","aria-checked":l,"aria-disabled":a||void 0,disabled:a,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--radio",n),onClick:()=>{a||(i==null||i.onValueChange(r),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:l&&t.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",children:t.jsx("circle",{cx:"4",cy:"4",r:"3",fill:"currentColor"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e})]})};bt.displayName="VyreDropdownRadioItem";const pt=({trigger:e,children:r,icon:a,placement:n="right",disabled:o=!1,className:i})=>{const[l,c]=s.useState(!1),[d,h]=s.useState({top:0,left:0}),f=s.useRef(null),y=s.useRef(null),p=s.useCallback(()=>{if(!f.current)return;const m=f.current.getBoundingClientRect(),_=window.scrollX,g=window.scrollY,N=2;h({top:m.top+g,left:n==="right"?m.right+_+N:m.left+_-N}),c(!0)},[n]),x=s.useCallback(()=>c(!1),[]),u=m=>{var g;const _=m.relatedTarget;(g=y.current)!=null&&g.contains(_)||x()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:f,role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:p,onMouseLeave:u,onFocus:p,children:[a&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:a}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),t.jsx("span",{className:"vyre-dropdown__item-chevron","aria-hidden":"true",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:n==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),l&&P.createPortal(t.jsx("div",{ref:y,role:"menu",className:v("vyre-dropdown vyre-dropdown--sub",n==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:d.top,left:n==="right"?d.left:void 0,right:n==="left"?`calc(100vw - ${d.left}px)`:void 0,transform:n==="left"?"translateX(-100%)":void 0},onMouseLeave:m=>{var g;const _=m.relatedTarget;(g=f.current)!=null&&g.contains(_)||x()},children:r}),document.body)]})};pt.displayName="VyreDropdownSub";const xt=({className:e})=>t.jsx("div",{role:"separator",className:v("vyre-dropdown__separator",e)});xt.displayName="VyreDropdownSeparator";const Ur=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M8 7v4M8 5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),zr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Xr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 6v3M8 11v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Zr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),_t={info:Ur,success:zr,warning:Xr,danger:Zr},gt=({variant:e="info",title:r,icon:a,onClose:n,children:o,className:i})=>{const l=_t[e];return t.jsxs("div",{role:"alert",className:v("vyre-alert",`vyre-alert--${e}`,i),children:[t.jsx("span",{className:"vyre-alert__icon","aria-hidden":"true",children:a??t.jsx(l,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[r&&t.jsx("p",{className:"vyre-alert__title",children:r}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),n&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:n,children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 3l8 8M11 3l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})};gt.displayName="VyreAlert";const Qr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),jt=({open:e,onOpenChange:r,title:a,description:n,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:c,onCancel:d,className:h})=>{const f=s.useRef(null),y=s.useRef(null),p=s.useRef(null),x=s.useCallback(()=>{d==null||d(),r(!1)},[d,r]),u=s.useCallback(()=>{c==null||c(),r(!1)},[c,r]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=f.current;if(!N)return;const b=Array.from(N.querySelectorAll(Qr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]);if(s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=b=>{b.key==="Escape"&&x()};return document.addEventListener("keydown",N),setTimeout(()=>{var b;return(b=p.current)==null?void 0:b.focus()},0),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keydown",N),document.body.style.overflow=g}},[e,m,x]),!e)return null;const _=_t[o];return P.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:g=>{g.target===y.current&&x()},role:"presentation",children:t.jsxs("div",{ref:f,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":n?"vyre-ad-desc":void 0,className:v("vyre-alert-dialog",`vyre-alert-dialog--${o}`,h),tabIndex:-1,children:[t.jsx("div",{className:"vyre-alert-dialog__icon-wrap",children:t.jsx("span",{className:v("vyre-alert-dialog__icon",`vyre-alert-dialog__icon--${o}`),children:t.jsx(_,{})})}),t.jsxs("div",{className:"vyre-alert-dialog__body",children:[t.jsx("h2",{id:"vyre-ad-title",className:"vyre-alert-dialog__title",children:a}),n&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:n})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:p,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:x,children:l}),t.jsx("button",{type:"button",className:v("vyre-btn vyre-btn--sm",o==="danger"&&"vyre-btn--danger",o==="warning"&&"vyre-btn--primary",o==="info"&&"vyre-btn--accent"),onClick:u,children:i})]})]})}),document.body)};jt.displayName="VyreAlertDialog";const Jr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),wt=s.forwardRef(({open:e,onClose:r,side:a="right",size:n="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(m=>{if(m.key!=="Tab")return;const _=p.current;if(!_)return;const g=Array.from(_.querySelectorAll(Jr));if(!g.length)return;const N=g[0],b=g[g.length-1];m.shiftKey&&document.activeElement===N?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),N.focus())},[]);return s.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=N=>{N.key==="Escape"&&r()};document.addEventListener("keydown",_);const g=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var N;return(N=p.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=g}}const m=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=p.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=m}},[e,u,i,r]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-sheet-backdrop",onClick:m=>{o&&m.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:m=>{p.current=m,typeof y=="function"?y(m):y&&(y.current=m)},role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,className:v("vyre-sheet",`vyre-sheet--${a}`,`vyre-sheet--${n}`,l),...f,children:c})}),document.body):null});wt.displayName="VyreSheet";const kt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__header",e),...a,children:r}));kt.displayName="VyreSheetHeader";const Nt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__body",e),...a,children:r}));Nt.displayName="VyreSheetBody";const Ct=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__footer",e),...a,children:r}));Ct.displayName="VyreSheetFooter";const Rt=({children:e,separator:r="/",className:a})=>{const n=s.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:v("vyre-breadcrumb",a),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:n.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<n.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:r})]},i))})})};Rt.displayName="VyreBreadcrumb";const Lt=({children:e,href:r,current:a=!1,className:n})=>a||!r?t.jsx("span",{className:v("vyre-breadcrumb__link vyre-breadcrumb__link--current",n),"aria-current":a?"page":void 0,children:e}):t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",n),children:e});Lt.displayName="VyreBreadcrumbItem";const Dt=({children:e,href:r,className:a})=>t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",a),children:e});Dt.displayName="VyreBreadcrumbLink";const St=({children:e="/",className:r})=>t.jsx("span",{className:v("vyre-breadcrumb__separator",r),"aria-hidden":"true",children:e});St.displayName="VyreBreadcrumbSeparator";function xe(e,r){return Array.from({length:r-e+1},(a,n)=>e+n)}function ea(e,r,a){const n=a*2+5;if(r<=n)return xe(1,r);const o=Math.max(e-a,2),i=Math.min(e+a,r-1),l=o>2,c=i<r-1,d=[1];return l&&d.push("..."),d.push(...xe(o,i)),c&&d.push("..."),d.push(r),d}const ta=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 2L4 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ra=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M5 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),aa=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M7 2L2 7l5 5M12 2L7 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),na=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l5 5-5 5M7 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Mt=({page:e,totalPages:r,onPageChange:a,siblings:n=1,showEdges:o=!0,showInfo:i=!1,totalItems:l,pageSize:c,className:d})=>{const h=ea(e,r,n),f=e>1,y=e<r,p=s.useMemo(()=>{if(!i)return null;if(l!=null&&c!=null){const u=(e-1)*c+1,m=Math.min(e*c,l);return`Showing ${u}–${m} of ${l}`}return`Page ${e} of ${r}`},[i,e,r,l,c]),x=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(1),disabled:!f,"aria-label":"First page",children:t.jsx(aa,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e-1),disabled:!f,"aria-label":"Previous page",children:t.jsx(ta,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:h.map((u,m)=>u==="..."?t.jsx("li",{children:t.jsx("span",{className:"vyre-pagination__dots","aria-hidden":"true",children:"···"})},`dots-${m}`):t.jsx("li",{children:t.jsx("button",{className:v("vyre-pagination__btn",u===e&&"vyre-pagination__btn--active"),onClick:()=>a(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(ra,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(r),disabled:!y,"aria-label":"Last page",children:t.jsx(na,{})})]});return i?t.jsxs("div",{className:v("vyre-pagination-row",d),children:[t.jsx("span",{className:"vyre-pagination__info",children:p}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:x})]}):t.jsx("nav",{"aria-label":"Pagination",className:v("vyre-pagination",d),children:x})};Mt.displayName="VyrePagination";const It=({children:e,striped:r=!1,bordered:a=!1,compact:n=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:v("vyre-table",r&&"vyre-table--striped",a&&"vyre-table--bordered",n&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});It.displayName="VyreTable";const Tt=s.forwardRef(({className:e,...r},a)=>t.jsx("thead",{ref:a,className:v("vyre-table__head",e),...r}));Tt.displayName="VyreTableHead";const Et=s.forwardRef(({className:e,...r},a)=>t.jsx("tbody",{ref:a,className:v("vyre-table__body",e),...r}));Et.displayName="VyreTableBody";const At=s.forwardRef(({className:e,selected:r,...a},n)=>t.jsx("tr",{ref:n,className:v("vyre-table__row",r&&"vyre-table__row--selected",e),"aria-selected":r,...a}));At.displayName="VyreTableRow";const sa=({dir:e})=>t.jsx("span",{className:"vyre-table__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v8M3 5l3-3 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="desc"?.3:1}),t.jsx("path",{d:"M3 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="asc"?.3:1})]})}),Bt=s.forwardRef(({className:e,sortable:r,sortDir:a=null,onSort:n,align:o="left",children:i,...l},c)=>r?t.jsx("th",{ref:c,className:v("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,a&&`vyre-table__th--sort-${a}`,e),"aria-sort":a==="asc"?"ascending":a==="desc"?"descending":"none",...l,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:n,type:"button",children:[i,t.jsx(sa,{dir:a})]})}):t.jsx("th",{ref:c,className:v("vyre-table__th",`vyre-table__th--${o}`,e),...l,children:i}));Bt.displayName="VyreTableHeader";const Vt=s.forwardRef(({className:e,align:r="left",...a},n)=>t.jsx("td",{ref:n,className:v("vyre-table__td",`vyre-table__td--${r}`,e),...a}));Vt.displayName="VyreTableCell";const $t=s.forwardRef(({className:e,...r},a)=>t.jsx("caption",{ref:a,className:v("vyre-table__caption",e),...r}));$t.displayName="VyreTableCaption";const Ft=s.createContext(null),ne=()=>{const e=s.useContext(Ft);if(!e)throw new Error("Command components must be used inside <Command>");return e};function oe(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function oa(e,r,a=[]){if(!e)return!0;const n=oe(e);return oe(r).includes(n)||a.some(o=>oe(o).includes(n))}let ia=0;function la(){return`cmd-${++ia}`}const he=s.forwardRef(({value:e,onValueChange:r,className:a,children:n},o)=>{const[i,l]=s.useState(""),[c,d]=s.useState(0),[h,f]=s.useState(0),y=e!==void 0?e:i,p=s.useCallback(b=>{l(b),r==null||r(b),d(0)},[r]),x=s.useRef(new Map),u=s.useRef(new Map),m=s.useCallback((b,L,w)=>{x.current.set(b,{el:L,disabled:w})},[]),_=s.useCallback(b=>{x.current.delete(b),u.current.delete(b)},[]),g=s.useCallback(b=>{var L;(L=u.current.get(b))==null||L()},[]),N=s.useMemo(()=>({search:y,setSearch:p,activeIndex:c,setActiveIndex:d,items:x,registerItem:m,unregisterItem:_,selectItem:g,onSelectRef:u,visibleCount:h,setVisibleCount:f}),[y,p,c,m,_,g,h]);return t.jsx(Ft.Provider,{value:N,children:t.jsx("div",{ref:o,className:v("vyre-command",a),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:n})})});he.displayName="VyreCommand";const Wt=s.forwardRef(({placeholder:e="Search...",className:r},a)=>{const{search:n,setSearch:o}=ne();return t.jsxs("div",{className:"vyre-command__input-wrapper",children:[t.jsx("svg",{className:"vyre-command__search-icon",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10 6.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM9.5 10.207l3.146 3.147",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),t.jsx("input",{ref:a,className:v("vyre-command__input",r),type:"text",placeholder:e,value:n,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),n&&t.jsx("button",{className:"vyre-command__clear",type:"button","aria-label":"Clear search",onClick:()=>o(""),children:t.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l9 9M11 2l-9 9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]})});Wt.displayName="VyreCommandInput";const Ht=s.forwardRef(({className:e,children:r},a)=>{const{activeIndex:n,setActiveIndex:o,items:i,selectItem:l}=ne(),c=s.useCallback(d=>{var f,y;const h=Array.from((i.current??new Map).entries()).filter(([,p])=>!p.disabled&&p.el.closest("[data-cmd-item]")!==null&&!p.el.hasAttribute("data-cmd-hidden"));if(d.key==="ArrowDown")d.preventDefault(),o(Math.min(n+1,h.length-1)),(f=h[Math.min(n+1,h.length-1)])==null||f[1].el.scrollIntoView({block:"nearest"});else if(d.key==="ArrowUp")d.preventDefault(),o(Math.max(n-1,0)),(y=h[Math.max(n-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(d.key==="Enter"){d.preventDefault();const[p]=h[n]??[];p&&l(p)}},[n,o,i,l]);return t.jsx("div",{ref:a,id:"vyre-command-list",role:"listbox",className:v("vyre-command__list",e),onKeyDown:c,children:r})});Ht.displayName="VyreCommandList";const Pt=({className:e,children:r})=>{const{search:a,visibleCount:n}=ne();return!a||n>0?null:t.jsx("div",{className:v("vyre-command__empty",e),role:"presentation",children:r??"No results found."})};Pt.displayName="VyreCommandEmpty";const Ot=({heading:e,className:r,children:a})=>t.jsxs("div",{className:v("vyre-command__group",r),role:"presentation",children:[e&&t.jsx("div",{className:"vyre-command__group-heading","aria-hidden":"true",children:e}),t.jsx("div",{role:"group","aria-label":e,children:a})]});Ot.displayName="VyreCommandGroup";const Gt=({onSelect:e,disabled:r=!1,keywords:a,className:n,children:o,icon:i,shortcut:l})=>{const{search:c,setActiveIndex:d,registerItem:h,unregisterItem:f,onSelectRef:y,setVisibleCount:p}=ne(),x=s.useMemo(()=>la(),[]),u=s.useRef(null),_=oa(c,typeof o=="string"?o:"",a);return s.useEffect(()=>(p(g=>g+(_?1:0)),()=>{p(g=>g-(_?1:0))}),[_,p]),s.useEffect(()=>{const g=u.current;if(!(!g||!_))return h(x,g,r),()=>f(x)},[x,r,_,h,f]),s.useEffect(()=>{var g;return e&&((g=y.current)==null||g.set(x,e)),()=>{var N;(N=y.current)==null||N.delete(x)}},[x,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":r||void 0,className:v("vyre-command__item",r&&"vyre-command__item--disabled",n),onClick:()=>{r||e==null||e()},onMouseEnter:()=>{!r&&u.current&&d(-1)},children:[i&&t.jsx("span",{className:"vyre-command__item-icon","aria-hidden":"true",children:i}),t.jsx("span",{className:"vyre-command__item-label",children:o}),l&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:l})]}):null};Gt.displayName="VyreCommandItem";const Yt=({className:e})=>t.jsx("div",{className:v("vyre-command__separator",e),role:"separator","aria-hidden":"true"});Yt.displayName="VyreCommandSeparator";const Kt=({open:e,onOpenChange:r,value:a,onValueChange:n,className:o,children:i})=>{const l=s.useRef(null);return s.useEffect(()=>{var h;if(!e)return;const c=document.activeElement,d=(h=l.current)==null?void 0:h.querySelector(".vyre-command__input");return d==null||d.focus(),()=>{c==null||c.focus({preventScroll:!0})}},[e]),s.useEffect(()=>{if(!e)return;const c=d=>{d.key==="Escape"&&r(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,r]),e?P.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:l,onClick:c=>{c.target===c.currentTarget&&r(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(he,{value:a,onValueChange:n,className:v("vyre-command--dialog",o),children:i})}),document.body):null};Kt.displayName="VyreCommandDialog";const qt=s.forwardRef(({orientation:e="horizontal",attached:r=!1,size:a,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,role:"group",className:v("vyre-btn-group",e==="vertical"&&"vyre-btn-group--vertical",r&&"vyre-btn-group--attached",n),"data-orientation":e,"data-size":a,...i,children:o}));qt.displayName="VyreButtonGroup";const be=s.forwardRef(({variant:e="default",size:r="md",onRemove:a,onClick:n,disabled:o=!1,className:i,children:l,...c},d)=>{const h=!!n&&!o;return t.jsxs("span",{ref:d,className:v("vyre-tag",`vyre-tag--${e}`,`vyre-tag--${r}`,h&&"vyre-tag--clickable",o&&"vyre-tag--disabled",i),"data-variant":e,"data-size":r,role:h?"button":void 0,tabIndex:h?0:void 0,"aria-disabled":o||void 0,onClick:h?n:void 0,onKeyDown:h?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),n==null||n())}:void 0,...c,children:[t.jsx("span",{className:"vyre-tag__label",children:l}),a&&t.jsx("button",{type:"button",className:"vyre-tag__remove","aria-label":"Remove",disabled:o,onClick:f=>{f.stopPropagation(),a()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})});be.displayName="VyreTag";const Ut=s.forwardRef(({value:e,onChange:r,placeholder:a="Add tag…",disabled:n=!1,max:o,size:i="md",className:l,style:c,"data-testid":d},h)=>{const[f,y]=s.useState(""),p=s.useRef(null),x=o!==void 0&&e.length>=o,u=n||x;function m(b){const L=b.trim();if(!L||e.includes(L)||x){y("");return}r([...e,L]),y("")}function _(b){n||r(e.filter((L,w)=>w!==b))}function g(b){if(b.key==="Enter"||b.key===","){b.preventDefault(),m(f);return}b.key==="Backspace"&&f===""&&e.length>0&&_(e.length-1)}function N(b){const L=b.target.value;if(L.includes(",")){const w=L.split(",");w.slice(0,-1).forEach(A=>m(A)),y(w[w.length-1])}else y(L)}return t.jsxs("div",{ref:h,className:v("vyre-tags-input",`vyre-tags-input--${i}`,n&&"vyre-tags-input--disabled",l),"data-testid":d,style:c,onClick:()=>{var b;return(b=p.current)==null?void 0:b.focus()},children:[e.map((b,L)=>t.jsx(be,{size:i,disabled:n,onRemove:n?void 0:()=>_(L),children:b},`${b}-${L}`)),t.jsx("input",{ref:p,type:"text",className:"vyre-tags-input__field",value:f,onChange:N,onKeyDown:g,placeholder:x?"":a,disabled:u,"aria-label":"Add tag"})]})});Ut.displayName="VyreTagsInput";const zt=s.forwardRef(({options:e,value:r,onChange:a,placeholder:n="Search…",disabled:o=!1,size:i="md",emptyText:l="No results",className:c,...d},h)=>{const[f,y]=s.useState(!1),[p,x]=s.useState(""),[u,m]=s.useState(-1),_=s.useRef(null),g=s.useRef(null),N=s.useRef(null),L=`${s.useId()}-listbox`,w=e.find(k=>k.value===r)??null,I=e.filter(k=>k.label.toLowerCase().includes(p.toLowerCase())),A=s.useCallback(()=>{y(!1),m(-1),x("")},[]),T=s.useCallback(k=>{var D;k.disabled||(a(k.value),A(),(D=_.current)==null||D.blur())},[a,A]);s.useEffect(()=>{if(!f)return;const k=D=>{const E=N.current;E&&!E.contains(D.target)&&A()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f,A]),s.useEffect(()=>{var D;if(!f||u<0)return;const k=(D=g.current)==null?void 0:D.children[u];k==null||k.scrollIntoView({block:"nearest"})},[u,f]),s.useEffect(()=>{m(I.length>0?0:-1)},[p]);function M(){o||(y(!0),x(""))}function B(k){x(k.target.value),f||y(!0)}function R(k){var D;switch(k.key){case"ArrowDown":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E+1;for(;V<I.length&&I[V].disabled;)V++;return V<I.length?V:E});break}case"ArrowUp":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E-1;for(;V>=0&&I[V].disabled;)V--;return V>=0?V:E});break}case"Enter":{k.preventDefault(),f&&u>=0&&I[u]&&T(I[u]);break}case"Escape":{A(),(D=_.current)==null||D.blur();break}}}const j=f?p:(w==null?void 0:w.label)??"";return t.jsxs("div",{ref:k=>{N.current=k,typeof h=="function"?h(k):h&&(h.current=k)},className:v("vyre-combobox",`vyre-combobox--${i}`,o&&"vyre-combobox--disabled",c),"data-open":f,...d,children:[t.jsx("input",{ref:_,type:"text",role:"combobox","aria-expanded":f,"aria-haspopup":"listbox","aria-controls":L,"aria-autocomplete":"list","aria-disabled":o,disabled:o,className:"vyre-combobox__input",placeholder:n,value:j,onFocus:M,onChange:B,onKeyDown:R}),t.jsx("span",{className:"vyre-combobox__chevron","aria-hidden":"true",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),f&&t.jsx("ul",{ref:g,id:L,role:"listbox",className:"vyre-combobox__dropdown","aria-label":"Options",children:I.length>0?I.map((k,D)=>t.jsx("li",{role:"option","aria-selected":k.value===r,"aria-disabled":k.disabled,"data-highlighted":D===u,className:v("vyre-combobox__option",D===u&&"vyre-combobox__option--highlighted",k.value===r&&"vyre-combobox__option--selected"),onMouseEnter:()=>!k.disabled&&m(D),onMouseDown:E=>{E.preventDefault(),T(k)},children:k.label},k.value)):t.jsx("li",{className:"vyre-combobox__empty",role:"presentation",children:l})})]})});zt.displayName="VyreCombobox";function ca({col:e,sortKey:r,sortDir:a}){const o=r===e.key?a:void 0;return t.jsx("span",{className:"vyre-data-grid__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v4M3.5 4.5L6 2l2.5 2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="desc"?.3:1}),t.jsx("path",{d:"M6 10V6M3.5 7.5L6 10l2.5-2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="asc"?.3:1})]})})}const da=5,Xt=s.forwardRef(({columns:e,rows:r,sortKey:a,sortDir:n,onSort:o,loading:i=!1,emptyText:l="No data",stickyHeader:c=!1,className:d,style:h,"data-testid":f},y)=>{function p(u){if(!u.sortable||!o)return;const m=a===u.key&&n==="asc"?"desc":"asc";o(u.key,m)}function x(u){return a!==u.key?"none":n==="asc"?"ascending":"descending"}return t.jsx("div",{ref:y,className:v("vyre-data-grid",c&&"vyre-data-grid--sticky-header",d),style:h,"data-testid":f,children:t.jsxs("table",{className:"vyre-data-grid__table",children:[t.jsx("thead",{className:"vyre-data-grid__thead",children:t.jsx("tr",{children:e.map(u=>t.jsx("th",{className:v("vyre-data-grid__th",u.sortable&&"vyre-data-grid__th--sortable",a===u.key&&`vyre-data-grid__th--sort-${n}`),style:u.width?{width:u.width}:void 0,"aria-sort":u.sortable?x(u):void 0,children:u.sortable?t.jsxs("button",{type:"button",className:"vyre-data-grid__sort-btn",onClick:()=>p(u),children:[u.label,t.jsx(ca,{col:u,sortKey:a,sortDir:n})]}):u.label},u.key))})}),t.jsx("tbody",{className:"vyre-data-grid__tbody",children:i?Array.from({length:da}).map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--skeleton",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:t.jsx(ye,{height:16})},_.key))},`skel-${m}`)):r.length===0?t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--empty",children:t.jsx("td",{className:"vyre-data-grid__td vyre-data-grid__empty",colSpan:e.length,children:l})}):r.map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:u[_.key]!=null?String(u[_.key]):""},_.key))},m))})]})})});Xt.displayName="VyreDataGrid";const Zt=s.forwardRef(({gap:e="md",wrap:r=!0,className:a,children:n,...o},i)=>t.jsx("div",{ref:i,className:v("vyre-tag-group",`vyre-tag-group--gap-${e}`,!r&&"vyre-tag-group--nowrap",a),role:"list",...o,children:n}));Zt.displayName="VyreTagGroup";function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function G(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Q(e,r){return z(e)<z(r)}function _e(e,r){return z(e)>z(r)}function ua(e,r){return new Date(e,r+1,0).getDate()}function ma(e,r,a){return(new Date(e,r,1).getDay()-a+7)%7}function Y(e,r){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function va(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const ge=Array.from({length:12},(e,r)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,r,1))),J=12,ee=s.forwardRef((e,r)=>{const{showTime:a=!1,minDate:n,maxDate:o,disabled:i,className:l,weekStartsOn:c=1,defaultMonth:d}=e,h=z(new Date),f=()=>{var C,S;return e.mode==="range"?((C=e.value)==null?void 0:C[0])??d??h:e.mode==="multiple"?((S=e.value)==null?void 0:S[0])??d??h:e.value??d??h},[y,p]=s.useState(()=>(f()??h).getFullYear()),[x,u]=s.useState(()=>(f()??h).getMonth()),[m,_]=s.useState("days"),[g,N]=s.useState(null),[b,L]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getHours():0}),[w,I]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getMinutes():0}),A=s.useMemo(()=>{const C=ua(y,x),S=ma(y,x,c);return{count:C,offset:S}},[y,x,c]),T=s.useMemo(()=>c===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[c]),M=s.useCallback(C=>{if(e.mode==="single")return!!e.value&&G(C,e.value);if(e.mode==="range"){const[S,$]=e.value??[null,null];return!!S&&G(C,S)||!!$&&G(C,$)}return e.mode==="multiple"?(e.value??[]).some(S=>G(C,S)):!1},[e]),B=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S,$]=e.value??[null,null],F=$??g;if(!S||!F)return!1;const K=Q(S,F)?S:F,q=Q(S,F)?F:S;return _e(C,K)&&Q(C,q)},[e,g]),R=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S]=e.value??[null,null];return!!S&&G(C,S)},[e]),j=s.useCallback(C=>{if(e.mode!=="range")return!1;const[,S]=e.value??[null,null];return!!S&&G(C,S)},[e]),k=s.useCallback(C=>!!(n&&Q(C,n)||o&&_e(C,o)||i!=null&&i(C)),[n,o,i]),D=s.useCallback(C=>{var $,F,K,q,Z,te;const S=new Date(y,x,C,b,w);if(!k(z(S))){if(e.mode==="single"||!e.mode)($=e.onChange)==null||$.call(e,S);else if(e.mode==="range"){const[H,U]=e.value??[null,null];!H||H&&U?(F=e.onChange)==null||F.call(e,[S,null]):Q(S,H)?(K=e.onChange)==null||K.call(e,[S,H]):(q=e.onChange)==null||q.call(e,[H,S])}else if(e.mode==="multiple"){const H=e.value??[],U=H.findIndex(pe=>G(pe,S));U>=0?(Z=e.onChange)==null||Z.call(e,H.filter((pe,Rr)=>Rr!==U)):(te=e.onChange)==null||te.call(e,[...H,S])}}},[y,x,b,w,e,k]),E=()=>{x===0?(u(11),p(C=>C-1)):u(C=>C-1)},V=()=>{x===11?(u(0),p(C=>C+1)):u(C=>C+1)},X=(C,S)=>{var $;if(L(C),I(S),e.mode==="single"&&e.value){const F=new Date(e.value);F.setHours(C,S),($=e.onChange)==null||$.call(e,F)}},Cr=Math.floor(y/J)*J;return t.jsxs("div",{ref:r,className:v("vyre-calendar",l),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:E,"aria-label":"Previous month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C-J),"aria-label":"Previous years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("div",{className:"vyre-calendar__header-center",children:[t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>_(m==="months"?"days":"months"),children:ge[x]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>_(m==="years"?"days":"years"),children:y})]}),m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:V,"aria-label":"Next month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C+J),"aria-label":"Next years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),m==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:ge.map((C,S)=>t.jsx("button",{className:v("vyre-calendar__month-cell",S===x&&"vyre-calendar__month-cell--active"),onClick:()=>{u(S),_("days")},children:C.slice(0,3)},C))}),m==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:J},(C,S)=>Cr+S).map(C=>t.jsx("button",{className:v("vyre-calendar__year-cell",C===y&&"vyre-calendar__year-cell--active"),onClick:()=>{p(C),_("days")},children:C},C))}),m==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[T.map(C=>t.jsx("div",{className:"vyre-calendar__weekday",children:C},C)),Array.from({length:A.offset}).map((C,S)=>t.jsx("div",{},`empty-${S}`)),Array.from({length:A.count},(C,S)=>S+1).map(C=>{const S=new Date(y,x,C),$=M(S),F=B(S),K=R(S),q=j(S),Z=k(S),te=G(S,h);return t.jsx("button",{className:v("vyre-calendar__day",te&&"vyre-calendar__day--today",$&&"vyre-calendar__day--selected",F&&"vyre-calendar__day--in-range",K&&"vyre-calendar__day--range-start",q&&"vyre-calendar__day--range-end",Z&&"vyre-calendar__day--disabled"),onClick:()=>D(C),onMouseEnter:()=>{if(e.mode==="range"){const[H,U]=e.value??[null,null];H&&!U&&N(S)}},onMouseLeave:()=>N(null),disabled:Z,"aria-selected":$,"aria-label":Y(S),children:C},C)})]}),a&&m==="days"&&t.jsxs("div",{className:"vyre-calendar__time",children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M7 4v3.5l2 1.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:23,value:b,onChange:C=>X(Number(C.target.value),w),"aria-label":"Hours"}),t.jsx("span",{className:"vyre-calendar__time-sep",children:":"}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:59,value:w,onChange:C=>X(b,Number(C.target.value)),"aria-label":"Minutes"})]})]})});ee.displayName="VyreCalendar";function fa(e){if(e.mode==="range"){const[n,o]=e.value??[null,null];return n?o?`${Y(n)} – ${Y(o)}`:Y(n):""}if(e.mode==="multiple"){const n=e.value??[];return n.length===0?"":n.length===1?Y(n[0]):`${n.length} dates selected`}const r=e.value,a=e.showTime;return r?a?`${Y(r)} ${va(r)}`:Y(r):""}const Qt=s.forwardRef(({placeholder:e="Pick a date",inputClassName:r,...a},n)=>{const[o,i]=s.useState(!1),l=s.useRef(null),c=s.useRef(null),[d,h]=s.useState({top:0,left:0,width:0}),f=fa(a),y=s.useCallback(()=>{if(!l.current)return;const u=l.current.getBoundingClientRect();h({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);s.useEffect(()=>{if(!o)return;y();const u=()=>y(),m=()=>y();return window.addEventListener("scroll",u,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",m)}},[o,y]),s.useEffect(()=>{if(!o)return;const u=_=>{var g,N;!((g=c.current)!=null&&g.contains(_.target))&&!((N=l.current)!=null&&N.contains(_.target))&&i(!1)},m=_=>{_.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",m)}},[o]);const p=a.mode!=="range"&&a.mode!=="multiple"&&!a.showTime,x=s.useMemo(()=>a.mode==="range"?{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),u[0]&&u[1]&&i(!1)}}:a.mode==="multiple"?a:{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),p&&i(!1)}},[a,p]);return t.jsxs("div",{ref:n,className:"vyre-datepicker",children:[t.jsxs("button",{ref:l,type:"button",className:v("vyre-datepicker__trigger",!f&&"vyre-datepicker__trigger--placeholder",r),onClick:()=>{y(),i(u=>!u)},"aria-expanded":o,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:f||e}),f&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var m,_,g;u.stopPropagation(),a.mode==="range"?(m=a.onChange)==null||m.call(a,[null,null]):a.mode==="multiple"?(_=a.onChange)==null||_.call(a,[]):(g=a.onChange)==null||g.call(a,null)},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),o&&P.createPortal(t.jsx("div",{ref:c,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:d.top,left:d.left,minWidth:d.width},children:t.jsx(ee,{...x})}),document.body)]})});Qt.displayName="VyreDatePicker";function O(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ie(e,r){const a=new Date(e);return a.setDate(a.getDate()+r),O(a)}function le(e){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}const ya=[{label:"Today",range:()=>{const e=O(new Date);return{from:e,to:e}}},{label:"Yesterday",range:()=>{const e=ie(new Date,-1);return{from:e,to:e}}},{label:"Last 7 days",range:()=>({from:ie(new Date,-6),to:O(new Date)})},{label:"Last 30 days",range:()=>({from:ie(new Date,-29),to:O(new Date)})},{label:"This month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth(),1)),to:O(new Date(e.getFullYear(),e.getMonth()+1,0))}}},{label:"Last month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth()-1,1)),to:O(new Date(e.getFullYear(),e.getMonth(),0))}}}],Jt=s.forwardRef(({value:e,onChange:r,placeholder:a="Pick a date range",numberOfMonths:n=2,presets:o=!1,minDate:i,maxDate:l,disabled:c,weekStartsOn:d=1,className:h,inputClassName:f},y)=>{const[p,x]=s.useState(!1),u=s.useRef(null),m=s.useRef(null),[_,g]=s.useState({top:0,left:0,width:0}),N=(e==null?void 0:e.from)??null,b=(e==null?void 0:e.to)??null,L=s.useMemo(()=>o===!0?ya:Array.isArray(o)?o:[],[o]),w=s.useMemo(()=>N?b?`${le(N)} – ${le(b)}`:le(N):"",[N,b]),I=s.useCallback(()=>{if(!u.current)return;const j=u.current.getBoundingClientRect();g({top:j.bottom+window.scrollY+6,left:j.left+window.scrollX,width:j.width})},[]);s.useEffect(()=>{if(!p)return;I();const j=()=>I(),k=()=>I();return window.addEventListener("scroll",j,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",k)}},[p,I]),s.useEffect(()=>{if(!p)return;const j=D=>{var E,V;!((E=m.current)!=null&&E.contains(D.target))&&!((V=u.current)!=null&&V.contains(D.target))&&x(!1)},k=D=>{D.key==="Escape"&&x(!1)};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",k)}},[p]);const A=s.useCallback(j=>{const k={from:j[0],to:j[1]};r==null||r(k),k.from&&k.to&&x(!1)},[r]),T=s.useCallback(j=>{r==null||r(j.range()),x(!1)},[r]),M=s.useCallback(()=>{r==null||r({from:null,to:null})},[r]),B=s.useMemo(()=>{const j=N??O(new Date);return new Date(j.getFullYear(),j.getMonth()+1,1)},[N]),R=[N,b];return t.jsxs("div",{ref:y,className:v("vyre-date-range-picker",h),children:[t.jsxs("button",{ref:u,type:"button",className:v("vyre-datepicker__trigger",!w&&"vyre-datepicker__trigger--placeholder",f),onClick:()=>{I(),x(j=>!j)},"aria-expanded":p,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:w||a}),w&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:j=>{j.stopPropagation(),M()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),p&&P.createPortal(t.jsxs("div",{ref:m,className:"vyre-date-range-picker__popover",role:"dialog","aria-label":"Date range picker",style:{top:_.top,left:_.left},children:[L.length>0&&t.jsx("div",{className:"vyre-date-range-picker__presets",children:L.map(j=>t.jsx("button",{type:"button",className:"vyre-date-range-picker__preset",onClick:()=>T(j),children:j.label},j.label))}),t.jsxs("div",{className:"vyre-date-range-picker__calendars",children:[t.jsx(ee,{mode:"range",value:R,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d}),n===2&&t.jsx(ee,{mode:"range",value:R,defaultMonth:B,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d},B.toISOString())]})]}),document.body)]})});Jt.displayName="VyreDateRangePicker";const er=s.forwardRef(({variant:e="default",size:r="md",clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-item",`vyre-item--${e}`,`vyre-item--${r}`,a&&"vyre-item--clickable",n),"data-variant":e,"data-size":r,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));er.displayName="VyreItem";const tr=s.forwardRef(({separated:e=!1,className:r,children:a,...n},o)=>t.jsx("div",{ref:o,role:"list",className:v("vyre-item-group",e&&"vyre-item-group--separated",r),...n,children:a}));tr.displayName="VyreItemGroup";const rr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__media",e),"aria-hidden":"true",...a,children:r}));rr.displayName="VyreItemMedia";const ar=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__content",e),...a,children:r}));ar.displayName="VyreItemContent";const nr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__title",e),...a,children:r}));nr.displayName="VyreItemTitle";const sr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-item__description",e),...a,children:r}));sr.displayName="VyreItemDescription";const or=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__actions",e),...a,children:r}));or.displayName="VyreItemActions";function ha(e,r,a,n){const o=e.find(l=>l.id===r.fromColumnId);if(!o)return e;const i=o.cards.find(l=>l.id===r.cardId);return i?e.map(l=>{if(l.id===r.fromColumnId&&l.id===a){const c=l.cards.filter(f=>f.id!==r.cardId),d=Math.max(0,Math.min(n,c.length)),h=[...c];return h.splice(d,0,i),{...l,cards:h}}if(l.id===r.fromColumnId)return{...l,cards:l.cards.filter(c=>c.id!==r.cardId)};if(l.id===a){const c=Math.max(0,Math.min(n,l.cards.length)),d=[...l.cards];return d.splice(c,0,i),{...l,cards:d}}return l}):e}const ir=s.forwardRef(({value:e,onChange:r,renderCard:a,onCardClick:n,className:o,...i},l)=>{const c=s.useRef(null),d=s.useRef(!1),[h,f]=s.useState(null),[y,p]=s.useState(null),[x,u]=s.useState(null),m=(b,L)=>{p(w=>w===b?w:b),u(w=>w===L?w:L)},_=(b,L)=>w=>{c.current={cardId:L,fromColumnId:b},d.current=!1,f(L),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",L)},g=()=>{c.current=null,f(null),p(null),u(null)},N=(b,L)=>{const w=c.current;if(!w)return;const I=ha(e,w,b,L);I!==e&&(d.current=!0,r(I))};return t.jsx("div",{ref:l,className:v("vyre-kanban",o),role:"list","aria-label":"Kanban board",...i,children:e.map(b=>{const L=y===b.id,w=b.color&&b.color!=="default"?b.color:void 0,I=L&&c.current&&x!==null?x:null,A=t.jsx("div",{className:"vyre-kanban__placeholder","aria-hidden":"true"});return t.jsxs("div",{role:"listitem","data-color":w,className:v("vyre-kanban__column",L&&"vyre-kanban__column--over"),onDragOver:T=>{c.current&&(T.preventDefault(),T.dataTransfer.dropEffect="move",m(b.id,b.cards.length))},onDragLeave:T=>{T.currentTarget.contains(T.relatedTarget)||(p(M=>M===b.id?null:M),u(null))},onDrop:T=>{T.preventDefault(),N(b.id,x??b.cards.length),g()},children:[t.jsxs("div",{className:"vyre-kanban__column-header",children:[t.jsx("span",{className:"vyre-kanban__column-title",children:b.title}),t.jsx("span",{className:"vyre-kanban__column-count",children:b.cards.length})]}),t.jsxs("div",{className:"vyre-kanban__cards",children:[b.cards.map((T,M)=>{const B=T.color&&T.color!=="default"?T.color:void 0;return t.jsxs(s.Fragment,{children:[I===M&&A,t.jsx(de,{variant:"outlined","data-color":B,className:v("vyre-kanban__card",h===T.id&&"vyre-kanban__card--dragging",n&&"vyre-kanban__card--clickable"),draggable:!0,role:n?"button":void 0,tabIndex:n?0:void 0,onDragStart:_(b.id,T.id),onDragEnd:g,onDragOver:R=>{if(!c.current)return;R.preventDefault(),R.stopPropagation();const j=R.currentTarget.getBoundingClientRect(),k=R.clientY-j.top>j.height/2;m(b.id,k?M+1:M)},onDrop:R=>{R.preventDefault(),R.stopPropagation(),N(b.id,x??M),g()},onClick:()=>{d.current||n==null||n(T,b)},onKeyDown:R=>{n&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),n(T,b))},children:t.jsx(ue,{children:a?a(T,b):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"vyre-kanban__card-title",children:T.title}),T.description&&t.jsx("div",{className:"vyre-kanban__card-desc",children:T.description})]})})})]},T.id)}),I===b.cards.length&&A,b.cards.length===0&&I===null&&t.jsx("div",{className:"vyre-kanban__empty",children:"Drop cards here"})]})]},b.id)})})});ir.displayName="VyreKanban";function je(e){if(e==null)return null;const r=e instanceof Date?e:new Date(e);return Number.isNaN(r.getTime())?null:r}function ce(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ba(e){const r=new Date,a=new Date;return a.setDate(r.getDate()-1),ce(e,r)?"Today":ce(e,a)?"Yesterday":new Intl.DateTimeFormat("default",{month:"short",day:"numeric",year:e.getFullYear()===r.getFullYear()?void 0:"numeric"}).format(e)}function pa(e){return new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"}).format(e)}const xa={sending:"Sending…",sent:"Sent",delivered:"Delivered",read:"Read"};function _a(){return t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M10 2H5a1.5 1.5 0 0 0-1.5 1.5v11A1.5 1.5 0 0 0 5 16h8a1.5 1.5 0 0 0 1.5-1.5V6.5L10 2z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),t.jsx("path",{d:"M10 2v4.5h4.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})]})}function ga({attachment:e}){const{kind:r,url:a,name:n,size:o}=e;return r==="image"?t.jsx("a",{className:"vyre-conversation__att vyre-conversation__att--image",href:a,target:"_blank",rel:"noopener noreferrer",children:t.jsx("img",{src:a,alt:n??"image attachment",loading:"lazy"})}):r==="audio"?t.jsx("audio",{className:"vyre-conversation__att vyre-conversation__att--audio",src:a,controls:!0,preload:"none"}):r==="video"?t.jsx("video",{className:"vyre-conversation__att vyre-conversation__att--video",src:a,controls:!0,preload:"none"}):t.jsxs("a",{className:"vyre-conversation__att vyre-conversation__att--file",href:a,target:"_blank",rel:"noopener noreferrer",download:n,children:[t.jsx("span",{className:"vyre-conversation__att-icon",children:t.jsx(_a,{})}),t.jsxs("span",{className:"vyre-conversation__att-info",children:[t.jsx("span",{className:"vyre-conversation__att-name",children:n??"Attachment"}),o&&t.jsx("span",{className:"vyre-conversation__att-size",children:o})]})]})}const lr=s.forwardRef(({value:e,currentUserId:r,composer:a=!1,onSend:n,placeholder:o="Write a message…",typing:i=!1,allowAttachments:l=!1,accept:c,renderMessage:d,renderComposer:h,className:f,...y},p)=>{const[x,u]=s.useState(""),[m,_]=s.useState([]),g=s.useRef(null),N=()=>{const w=x.trim();!w&&m.length===0||(n==null||n(w,m),u(""),_([]))},b=s.useMemo(()=>e.map((w,I)=>{const A=e[I-1],T=e[I+1],M=je(w.timestamp),B=A?je(A.timestamp):null,R=!!M&&(!B||!ce(M,B)),j=!A||A.authorId!==w.authorId||R,k=!T||T.authorId!==w.authorId,D=w.authorId===r;return{msg:w,date:M,showDaySeparator:R,isGroupStart:j,isGroupEnd:k,outgoing:D}}),[e,r]),L={value:x,setValue:u,files:m,setFiles:_,send:N};return t.jsxs("div",{ref:p,className:v("vyre-conversation",f),...y,children:[t.jsxs("div",{className:"vyre-conversation__thread",role:"log","aria-label":"Conversation","aria-live":"polite",children:[b.map(({msg:w,date:I,showDaySeparator:A,isGroupStart:T,isGroupEnd:M,outgoing:B})=>t.jsxs(s.Fragment,{children:[A&&I&&t.jsx("div",{className:"vyre-conversation__day",role:"separator",children:t.jsx("span",{children:ba(I)})}),t.jsxs("div",{className:v("vyre-conversation__row",B?"vyre-conversation__row--out":"vyre-conversation__row--in",M&&"vyre-conversation__row--group-end"),children:[t.jsx("div",{className:"vyre-conversation__avatar",children:!B&&M&&t.jsx(ve,{size:"sm",src:w.authorAvatar,fallback:(w.authorName??w.authorId).slice(0,1).toUpperCase(),alt:w.authorName??w.authorId})}),t.jsxs("div",{className:"vyre-conversation__stack",children:[!B&&T&&w.authorName&&t.jsx("span",{className:"vyre-conversation__author",children:w.authorName}),t.jsx("div",{className:"vyre-conversation__bubble",children:d?d(w,{outgoing:B,isGroupStart:T,isGroupEnd:M}):t.jsxs(t.Fragment,{children:[w.attachments&&w.attachments.length>0&&t.jsx("div",{className:"vyre-conversation__attachments",children:w.attachments.map((R,j)=>t.jsx(ga,{attachment:R},j))}),w.text]})}),M&&t.jsxs("span",{className:"vyre-conversation__meta",children:[I&&pa(I),B&&w.status&&t.jsxs("span",{className:v("vyre-conversation__status",`vyre-conversation__status--${w.status}`),children:[I?" · ":"",xa[w.status]]})]})]})]})]},w.id)),i&&t.jsxs("div",{className:"vyre-conversation__row vyre-conversation__row--in",children:[t.jsx("div",{className:"vyre-conversation__avatar"}),t.jsx("div",{className:"vyre-conversation__stack",children:t.jsxs("div",{className:"vyre-conversation__bubble vyre-conversation__bubble--typing",children:[t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),typeof i=="string"&&t.jsx("span",{className:"vyre-conversation__typing-label",children:i})]})})]})]}),h?h(L):a&&t.jsxs("form",{className:"vyre-conversation__composer",onSubmit:w=>{w.preventDefault(),N()},children:[l&&m.length>0&&t.jsx("div",{className:"vyre-conversation__staged",children:m.map((w,I)=>t.jsxs("span",{className:"vyre-conversation__chip",children:[t.jsx("span",{className:"vyre-conversation__chip-name",children:w.name}),t.jsx("button",{type:"button",className:"vyre-conversation__chip-remove","aria-label":`Remove ${w.name}`,onClick:()=>_(m.filter((A,T)=>T!==I)),children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]},I))}),t.jsxs("div",{className:"vyre-conversation__composer-row",children:[l&&t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:g,type:"file",multiple:!0,accept:c,className:"vyre-conversation__file-input",onChange:w=>{const I=Array.from(w.target.files??[]);I.length&&_([...m,...I]),w.target.value=""}}),t.jsx("button",{type:"button",className:"vyre-conversation__attach","aria-label":"Attach files",onClick:()=>{var w;return(w=g.current)==null?void 0:w.click()},children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13.5 6.5l-5.6 5.6a2.5 2.5 0 0 1-3.5-3.5l6-6a3.5 3.5 0 0 1 5 5l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsx("input",{className:"vyre-conversation__input",value:x,onChange:w=>u(w.target.value),placeholder:o,"aria-label":"Message"}),t.jsx("button",{type:"submit",className:"vyre-conversation__send",disabled:!x.trim()&&m.length===0,"aria-label":"Send message",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 8l12-5-4.5 12L7 9.5 2 8z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})})]})]})]})});lr.displayName="VyreConversation";const cr=s.forwardRef(({as:e="p",size:r="md",weight:a,color:n="default",truncate:o,mono:i,className:l,children:c,...d},h)=>t.jsx(e,{ref:h,className:v("vyre-text",r!=="md"&&`vyre-text--${r}`,a&&`vyre-text--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",l),...d,children:c}));cr.displayName="VyreText";const dr=s.forwardRef(({as:e="h2",size:r="md",weight:a="bold",color:n="default",truncate:o,className:i,children:l,...c},d)=>t.jsx(e,{ref:d,className:v("vyre-heading",`vyre-heading--${r}`,a!=="bold"&&`vyre-heading--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i),...c,children:l}));dr.displayName="VyreHeading";const ur=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-lead",e),...a,children:r}));ur.displayName="VyreLead";const mr=s.forwardRef(({block:e,className:r,children:a,...n},o)=>e?t.jsx("pre",{className:v("vyre-code-block",r),...n,children:t.jsx("code",{ref:o,children:a})}):t.jsx("code",{ref:o,className:v("vyre-code",r),...n,children:a}));mr.displayName="VyreCode";const vr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("blockquote",{ref:n,className:v("vyre-blockquote",e),...a,children:r}));vr.displayName="VyreBlockquote";const fr=s.createContext({collapsed:!1,toggleCollapsed:()=>{}}),se=()=>s.useContext(fr),yr=s.forwardRef(({defaultCollapsed:e=!1,collapsed:r,onCollapsedChange:a,className:n,children:o},i)=>{const[l,c]=s.useState(e),d=r!==void 0?r:l,h=s.useCallback(()=>{const f=!d;c(f),a==null||a(f)},[d,a]);return t.jsx(fr.Provider,{value:{collapsed:d,toggleCollapsed:h},children:t.jsx("div",{ref:i,className:v("vyre-app-layout",n),children:o})})});yr.displayName="VyreAppLayout";const hr=s.forwardRef(({variant:e="default",className:r,children:a},n)=>{const{collapsed:o}=se();return t.jsx("aside",{ref:n,className:v("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",r),"data-collapsed":o||void 0,children:a})});hr.displayName="VyreSidebar";const br=s.forwardRef(({logo:e,title:r,className:a,children:n},o)=>t.jsxs("div",{ref:o,className:v("vyre-sidebar__header",a),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),r&&t.jsx("span",{className:"vyre-sidebar__title",children:r}),n]}));br.displayName="VyreSidebarHeader";const pr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__content",e),children:r}));pr.displayName="VyreSidebarContent";const xr=s.forwardRef(({label:e,className:r,children:a},n)=>t.jsxs("div",{ref:n,className:v("vyre-sidebar__section",r),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),a]}));xr.displayName="VyreSidebarSection";const _r=({active:e,icon:r,badge:a,href:n,onClick:o,className:i,children:l})=>{const{collapsed:c}=se(),d=v("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),h=t.jsxs(t.Fragment,{children:[r&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:r}),t.jsx("span",{className:"vyre-sidebar__item-label",children:l}),a!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:a})]});return n?t.jsx("a",{href:n,className:d,"aria-current":e?"page":void 0,title:c?String(l):void 0,children:h}):t.jsx("button",{type:"button",className:d,onClick:o,"aria-pressed":e,title:c?String(l):void 0,children:h})};_r.displayName="VyreSidebarItem";const gr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__footer",e),children:r}));gr.displayName="VyreSidebarFooter";const jr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-app-shell",e),children:r}));jr.displayName="VyreAppShell";const wr=s.forwardRef(({className:e,children:r},a)=>t.jsx("header",{ref:a,className:v("vyre-app-bar",e),children:r}));wr.displayName="VyreAppBar";const ja=t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"4",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"7.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"10.5",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"})]}),kr=({className:e,icon:r,collapsedIcon:a})=>{const{collapsed:n,toggleCollapsed:o}=se(),i=r??ja,l=a??i;return t.jsx("button",{type:"button",className:v("vyre-sidebar-trigger",e),onClick:o,"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-expanded":!n,children:n?l:i})};kr.displayName="VyreSidebarTrigger";const Nr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-page-content",e),children:r}));Nr.displayName="VyrePageContent";exports.Accordion=Ze;exports.AccordionContent=et;exports.AccordionItem=Qe;exports.AccordionTrigger=Je;exports.Alert=gt;exports.AlertDialog=jt;exports.AppBar=wr;exports.AppLayout=yr;exports.AppShell=jr;exports.Avatar=ve;exports.Badge=ke;exports.Blockquote=vr;exports.Breadcrumb=Rt;exports.BreadcrumbItem=Lt;exports.BreadcrumbLink=Dt;exports.BreadcrumbSeparator=St;exports.Button=we;exports.ButtonGroup=qt;exports.Calendar=ee;exports.Card=de;exports.CardBody=ue;exports.CardFooter=Ce;exports.CardHeader=Ne;exports.Checkbox=tt;exports.Code=mr;exports.Combobox=zt;exports.Command=he;exports.CommandDialog=Kt;exports.CommandEmpty=Pt;exports.CommandGroup=Ot;exports.CommandInput=Wt;exports.CommandItem=Gt;exports.CommandList=Ht;exports.CommandSeparator=Yt;exports.Conversation=lr;exports.DataGrid=Xt;exports.DatePicker=Qt;exports.DateRangePicker=Jt;exports.DropdownCheckboxItem=yt;exports.DropdownItem=ft;exports.DropdownLabel=vt;exports.DropdownMenu=mt;exports.DropdownRadioGroup=ht;exports.DropdownRadioItem=bt;exports.DropdownSeparator=xt;exports.DropdownSub=pt;exports.Field=Re;exports.FieldDescription=De;exports.FieldError=Se;exports.FieldGroup=Me;exports.FieldLabel=Le;exports.FieldSet=Ie;exports.Heading=dr;exports.Input=Te;exports.Item=er;exports.ItemActions=or;exports.ItemContent=ar;exports.ItemDescription=sr;exports.ItemGroup=tr;exports.ItemMedia=rr;exports.ItemTitle=nr;exports.Kanban=ir;exports.Label=ct;exports.Lead=ur;exports.Modal=Ae;exports.ModalBody=Ve;exports.ModalFooter=$e;exports.ModalHeader=Be;exports.PageContent=Nr;exports.Pagination=Mt;exports.Popover=dt;exports.Progress=it;exports.Radio=fe;exports.RadioGroup=at;exports.RichTextEditor=nt;exports.Select=We;exports.Separator=lt;exports.Sheet=wt;exports.SheetBody=Nt;exports.SheetFooter=Ct;exports.SheetHeader=kt;exports.Sidebar=hr;exports.SidebarContent=pr;exports.SidebarFooter=gr;exports.SidebarHeader=br;exports.SidebarItem=_r;exports.SidebarSection=xr;exports.SidebarTrigger=kr;exports.Skeleton=ye;exports.Slider=ot;exports.Switch=st;exports.Tab=Ye;exports.TabList=Ge;exports.TabPanel=qe;exports.TabPanels=Ke;exports.Table=It;exports.TableBody=Et;exports.TableCaption=$t;exports.TableCell=Vt;exports.TableHead=Tt;exports.TableHeader=Bt;exports.TableRow=At;exports.Tabs=Oe;exports.Tag=be;exports.TagGroup=Zt;exports.TagsInput=Ut;exports.Text=cr;exports.Textarea=Ee;exports.ToastProvider=Ar;exports.Tooltip=Ue;exports.cn=v;exports.useAppLayout=se;exports.useToast=Br;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),G=require("react-dom");function b(...e){const r=[];for(const a of e)if(a){if(typeof a=="string")r.push(a);else if(Array.isArray(a)){const n=b(...a);n&&r.push(n)}else if(typeof a=="object")for(const[n,o]of Object.entries(a))o&&r.push(n)}return r.join(" ")}const ca={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},da={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},Ve=s.forwardRef(({variant:e="secondary",size:r="md",loading:a=!1,disabled:n,leftIcon:o,rightIcon:i,className:l,children:d,as:c="button",...f},p)=>{const y=n||a;return t.jsxs(c,{ref:p,className:b("vyre-btn",ca[e],da[r],a&&"vyre-btn--loading",l),disabled:c==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":r,...f,children:[a&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(ua,{})}),!a&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),d&&t.jsx("span",{className:"vyre-btn__label",children:d}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});Ve.displayName="VyreButton";function ua(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"vyre-spinner","aria-hidden":"true",children:t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"10"})})}const $e=s.forwardRef(({variant:e="default",dot:r=!1,className:a,children:n,...o},i)=>t.jsxs("span",{ref:i,className:b("vyre-badge",`vyre-badge--${e}`,a),"data-variant":e,...o,children:[r&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),n]}));$e.displayName="VyreBadge";const ve=s.forwardRef(({variant:e="default",hoverable:r=!1,clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:b("vyre-card",`vyre-card--${e}`,r&&"vyre-card--hoverable",a&&"vyre-card--clickable",n),"data-variant":e,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));ve.displayName="VyreCard";const Fe=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-card__header",e),...a,children:r}));Fe.displayName="VyreCardHeader";const fe=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-card__body",e),...a,children:r}));fe.displayName="VyreCardBody";const We=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-card__footer",e),...a,children:r}));We.displayName="VyreCardFooter";const ye=s.forwardRef(({label:e,hint:r,state:a="idle",required:n=!1,htmlFor:o,className:i,children:l,...d},c)=>t.jsxs("div",{ref:c,className:b("vyre-field",a!=="idle"&&`vyre-field--${a}`,i),"data-state":a,...d,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,n&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),l,r&&t.jsx("span",{className:"vyre-field__hint",role:a==="error"?"alert":void 0,children:r})]}));ye.displayName="VyreField";const Pe=s.forwardRef(({required:e=!1,className:r,children:a,...n},o)=>t.jsxs("label",{ref:o,className:b("vyre-field__label",r),...n,children:[a,e&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}));Pe.displayName="VyreFieldLabel";const He=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:b("vyre-field__description",e),...a,children:r}));He.displayName="VyreFieldDescription";const Ge=s.forwardRef(({className:e,children:r,...a},n)=>r?t.jsx("p",{ref:n,role:"alert",className:b("vyre-field__error",e),...a,children:r}):null);Ge.displayName="VyreFieldError";const Oe=s.forwardRef(({orientation:e="vertical",className:r,children:a,...n},o)=>t.jsx("div",{ref:o,className:b("vyre-field-group",`vyre-field-group--${e}`,r),...n,children:a}));Oe.displayName="VyreFieldGroup";const qe=s.forwardRef(({legend:e,className:r,children:a,...n},o)=>t.jsxs("fieldset",{ref:o,className:b("vyre-field-set",r),...n,children:[e&&t.jsx("legend",{className:"vyre-field-set__legend",children:e}),a]}));qe.displayName="VyreFieldSet";const Ke=s.forwardRef(({size:e="md",leftElement:r,rightElement:a,className:n,...o},i)=>r||a?t.jsxs("div",{className:b("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:r}),t.jsx("input",{ref:i,className:b("vyre-input",`vyre-input--${e}`,!!r&&"vyre-input--has-left",!!a&&"vyre-input--has-right",n),...o}),a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:a})]}):t.jsx("input",{ref:i,className:b("vyre-input",`vyre-input--${e}`,n),...o}));Ke.displayName="VyreInput";const Ye=s.forwardRef(({size:e="md",resize:r="vertical",className:a,style:n,...o},i)=>t.jsx("textarea",{ref:i,className:b("vyre-textarea",`vyre-textarea--${e}`,a),style:{resize:r,...n},...o}));Ye.displayName="VyreTextarea";const ma=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Ue=s.forwardRef(({open:e,onClose:r,size:a="md",closeOnBackdrop:n=!0,closeOnEsc:o=!0,initialFocus:i,className:l,children:d,"aria-label":c,"aria-labelledby":f,...p},y)=>{const h=s.useRef(null),m=s.useRef(null),u=s.useCallback(g=>{h.current=g,typeof y=="function"?y(g):y&&(y.current=g)},[y]),v=s.useCallback(g=>{if(g.key!=="Tab")return;const j=h.current;if(!j)return;const _=Array.from(j.querySelectorAll(ma));if(!_.length)return;const L=_[0],w=_[_.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]),x=s.useCallback(g=>{g.key==="Escape"&&o&&r()},[o,r]);return s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",x),document.addEventListener("keydown",v);const g=document.body.style.overflow;document.body.style.overflow="hidden";const j=setTimeout(()=>{var _;i!=null&&i.current?i.current.focus():(_=h.current)==null||_.focus()},0);return()=>{document.removeEventListener("keydown",x),document.removeEventListener("keydown",v),document.body.style.overflow=g,clearTimeout(j)}},[e,x,v,i]),e?G.createPortal(t.jsx("div",{ref:m,className:"vyre-modal-backdrop",onClick:g=>{n&&g.target===m.current&&r()},role:"presentation",children:t.jsx("div",{ref:u,className:b("vyre-modal",`vyre-modal--${a}`,l),role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":f,tabIndex:-1,...p,children:d})}),document.body):null});Ue.displayName="VyreModal";const ze=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-modal__header",e),...a,children:r}));ze.displayName="VyreModalHeader";const Xe=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-modal__body",e),...a,children:r}));Xe.displayName="VyreModalBody";const Ze=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-modal__footer",e),...a,children:r}));Ze.displayName="VyreModalFooter";const Qe=s.createContext(null);function va(e,r){switch(r.type){case"ADD":return[...e,r.payload];case"REMOVE":return e.filter(a=>a.id!==r.id);default:return e}}let fa=0;const ya=()=>`vyre-t-${++fa}`;function ha({children:e}){const[r,a]=s.useReducer(va,[]),n=s.useCallback(i=>{const l=ya();return a({type:"ADD",payload:{...i,id:l}}),l},[]),o=s.useCallback(i=>{a({type:"REMOVE",id:i})},[]);return t.jsxs(Qe.Provider,{value:{toast:n,dismiss:o},children:[e,typeof document<"u"&&G.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:r.map(i=>t.jsx(xa,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function pa(){const e=s.useContext(Qe);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function xa({title:e,description:r,variant:a="default",duration:n=4e3,onDismiss:o}){return s.useEffect(()=>{if(n===1/0)return;const i=setTimeout(o,n);return()=>clearTimeout(i)},[n,o]),t.jsxs("div",{className:b("vyre-toast",`vyre-toast--${a}`),role:"alert","data-variant":a,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),r&&t.jsx("p",{className:"vyre-toast__description",children:r})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx(ba,{})})]})}function ba(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Je=s.forwardRef(({options:e,value:r,defaultValue:a,onChange:n,placeholder:o="Select an option",disabled:i=!1,size:l="md",className:d,...c},f)=>{const p=r!==void 0,[y,h]=s.useState(a??""),m=p?r:y,[u,v]=s.useState(!1),[x,g]=s.useState(-1),j=s.useRef(null),_=s.useRef(null),w=`${s.useId()}-listbox`,M=e.find(C=>C.value===m),E=e.filter(C=>!C.disabled),S=s.useCallback(()=>{v(!1),g(-1)},[]),k=s.useCallback(C=>{var N;C.disabled||(p||h(C.value),n==null||n(C.value),S(),(N=j.current)==null||N.focus())},[p,n,S]);s.useEffect(()=>{if(!u)return;const C=N=>{const D=f==null?void 0:f.current;D&&!D.contains(N.target)&&S()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u,f,S]),s.useEffect(()=>{var N;if(!u||x<0)return;const C=(N=_.current)==null?void 0:N.children[x];C==null||C.scrollIntoView({block:"nearest"})},[x,u]);const I=C=>{switch(C.key){case"Enter":case" ":case"ArrowDown":{if(C.preventDefault(),!u){v(!0);const N=e.findIndex(D=>D.value===m);g(N>=0?N:0)}break}case"ArrowUp":{C.preventDefault(),u||(v(!0),g(e.length-1));break}case"Escape":{S();break}}},R=C=>{var N;switch(C.key){case"ArrowDown":{C.preventDefault(),g(D=>{let B=D+1;for(;B<e.length&&e[B].disabled;)B++;return B<e.length?B:D});break}case"ArrowUp":{C.preventDefault(),g(D=>{let B=D-1;for(;B>=0&&e[B].disabled;)B--;return B>=0?B:D});break}case"Enter":case" ":{C.preventDefault(),x>=0&&k(e[x]);break}case"Escape":case"Tab":{S(),(N=j.current)==null||N.focus();break}case"Home":{C.preventDefault();const D=e.findIndex(B=>!B.disabled);D>=0&&g(D);break}case"End":{C.preventDefault();const D=[...e].reverse().findIndex(B=>!B.disabled);D>=0&&g(e.length-1-D);break}}};return t.jsxs("div",{ref:f,className:b("vyre-select",`vyre-select--${l}`,d),"data-open":u,...c,children:[t.jsxs("button",{ref:j,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":w,"aria-disabled":i,disabled:i,onClick:()=>{i||v(C=>{if(!C){const N=e.findIndex(D=>D.value===m);g(N>=0?N:0)}return!C})},onKeyDown:I,children:[M?t.jsx("span",{className:"vyre-select__value",children:M.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(_a,{})]}),u&&t.jsxs("ul",{ref:_,id:w,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:R,children:[e.map((C,N)=>t.jsxs("li",{role:"option","aria-selected":C.value===m,"aria-disabled":C.disabled,"data-highlighted":N===x,className:"vyre-select__option",onMouseEnter:()=>!C.disabled&&g(N),onMouseDown:D=>{D.preventDefault(),k(C)},children:[C.label,C.value===m&&t.jsx(ga,{})]},C.value)),E.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});Je.displayName="VyreSelect";function _a(){return t.jsx("svg",{className:"vyre-select__chevron",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ga(){return t.jsx("svg",{className:"vyre-select__check",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const et=s.createContext(null);function tt(){const e=s.useContext(et);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const rt=s.forwardRef(({defaultValue:e="",value:r,onChange:a,className:n,children:o,...i},l)=>{const d=r!==void 0,[c,f]=s.useState(e),p=d?r:c,y=s.useId(),h=s.useCallback(m=>{d||f(m),a==null||a(m)},[d,a]);return t.jsx(et.Provider,{value:{value:p,onChange:h,baseId:y},children:t.jsx("div",{ref:l,className:b("vyre-tabs",n),...i,children:o})})});rt.displayName="VyreTabs";const at=s.forwardRef(({className:e,children:r,"aria-label":a,...n},o)=>{const i=s.useRef(null),l=d=>{var y;const c=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),f=c.findIndex(h=>h===document.activeElement);if(f<0)return;let p=f;if(d.key==="ArrowRight")p=(f+1)%c.length;else if(d.key==="ArrowLeft")p=(f-1+c.length)%c.length;else if(d.key==="Home")p=0;else if(d.key==="End")p=c.length-1;else return;d.preventDefault(),c[p].focus(),c[p].click()};return t.jsx("div",{ref:d=>{i.current=d,typeof o=="function"?o(d):o&&(o.current=d)},role:"tablist",className:b("vyre-tabs__list",e),"aria-label":a,onKeyDown:l,...n,children:r})});at.displayName="VyreTabList";const nt=s.forwardRef(({value:e,disabled:r=!1,className:a,children:n,...o},i)=>{const{value:l,onChange:d,baseId:c}=tt(),f=e===l;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${c}-tab-${e}`,"aria-controls":`${c}-panel-${e}`,"aria-selected":f,disabled:r,tabIndex:f?0:-1,className:b("vyre-tabs__tab",f&&"vyre-tabs__tab--active",a),"data-selected":f,onClick:()=>!r&&d(e),...o,children:n})});nt.displayName="VyreTab";const st=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-tabs__panels",e),...a,children:r}));st.displayName="VyreTabPanels";const ot=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i,baseId:l}=tt();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:b("vyre-tabs__panel",r),...n,children:a}):null});ot.displayName="VyreTabPanel";const ja=120,it=({content:e,placement:r="top",delay:a=300,children:n,className:o})=>{const[i,l]=s.useState("hidden"),d=s.useRef(null),c=s.useRef(null),f=s.useId(),p=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),d.current=setTimeout(()=>l("visible"),a)},[a]),y=s.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),l("leaving"),c.current=setTimeout(()=>l("hidden"),ja)},[]),h=s.Children.only(n),m=s.cloneElement(h,{onMouseEnter:u=>{var v,x;p(),(x=(v=h.props).onMouseEnter)==null||x.call(v,u)},onMouseLeave:u=>{var v,x;y(),(x=(v=h.props).onMouseLeave)==null||x.call(v,u)},onFocus:u=>{var v,x;l("visible"),(x=(v=h.props).onFocus)==null||x.call(v,u)},onBlur:u=>{var v,x;y(),(x=(v=h.props).onBlur)==null||x.call(v,u)},"aria-describedby":i!=="hidden"?f:void 0});return t.jsxs("span",{className:b("vyre-tooltip-wrapper",o),children:[m,i!=="hidden"&&t.jsxs("span",{id:f,role:"tooltip",className:b("vyre-tooltip",`vyre-tooltip--${r}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":r,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};it.displayName="VyreTooltip";const lt=s.createContext(null);function ct(){const e=s.useContext(lt);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const dt=s.forwardRef(({type:e="single",defaultValue:r,value:a,onValueChange:n,className:o,children:i,...l},d)=>{const c=m=>m===void 0?[]:Array.isArray(m)?m:[m],[f,p]=s.useState(c(r)),y=a!==void 0?c(a):f,h=s.useCallback(m=>{let u;e==="single"?u=y.includes(m)?[]:[m]:u=y.includes(m)?y.filter(v=>v!==m):[...y,m],a===void 0&&p(u),n==null||n(e==="single"?u[0]??"":u)},[e,y,a,n]);return t.jsx(lt.Provider,{value:{type:e,value:y,toggle:h},children:t.jsx("div",{ref:d,className:["vyre-accordion",o].filter(Boolean).join(" "),...l,children:i})})});dt.displayName="Accordion";const he=s.createContext(null),ut=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i}=ct(),l=i.includes(e);return t.jsx(he.Provider,{value:{itemValue:e,isOpen:l},children:t.jsx("div",{ref:o,"data-state":l?"open":"closed",className:["vyre-accordion__item",r].filter(Boolean).join(" "),...n,children:a})})});ut.displayName="AccordionItem";const mt=s.forwardRef(({className:e,children:r,...a},n)=>{const{toggle:o}=ct(),i=s.useContext(he);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:l,isOpen:d}=i;return t.jsxs("button",{ref:n,type:"button","aria-expanded":d,"data-state":d?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(l),...a,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:r}),t.jsx("svg",{className:"vyre-accordion__chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})});mt.displayName="AccordionTrigger";const vt=s.forwardRef(({className:e,children:r,...a},n)=>{const o=s.useContext(he);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:n,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...a,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:r})})});vt.displayName="AccordionContent";const pe=s.forwardRef(({src:e,alt:r="",fallback:a,size:n="md",status:o,className:i,...l},d)=>{var y;const[c,f]=s.useState(!1),p=e&&!c;return t.jsxs("span",{ref:d,"data-size":n,className:["vyre-avatar",i].filter(Boolean).join(" "),...l,children:[p?t.jsx("img",{src:e,alt:r,className:"vyre-avatar__img",onError:()=>f(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":r||a,children:a??((y=r==null?void 0:r.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});pe.displayName="Avatar";const ft=s.forwardRef(({checked:e,defaultChecked:r,indeterminate:a=!1,onCheckedChange:n,disabled:o,size:i="md",className:l,id:d,...c},f)=>{const p=s.useRef(null),y=f??p;return s.useEffect(()=>{y.current&&(y.current.indeterminate=a)},[a,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,l].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":a||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:d,checked:e,defaultChecked:r,disabled:o,className:"vyre-checkbox__input",onChange:h=>n==null?void 0:n(h.target.checked),...c}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:a?t.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1 1h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}):t.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:t.jsx("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});ft.displayName="Checkbox";const yt=s.createContext(null);let wa=0;const ht=s.forwardRef(({value:e,defaultValue:r,onChange:a,name:n,disabled:o=!1,size:i="md",orientation:l="vertical",options:d,className:c,children:f,...p},y)=>{const[h,m]=s.useState(r),u=e!==void 0,v=u?e:h,x=s.useMemo(()=>n??`vyre-radio-${++wa}`,[n]),g=s.useCallback(_=>{u||m(_),a==null||a(_)},[u,a]),j={name:x,value:v,onChange:g,groupDisabled:o,size:i};return t.jsx(yt.Provider,{value:j,children:t.jsx("div",{ref:y,role:"radiogroup","aria-orientation":l,className:b("vyre-radio-group",`vyre-radio-group--${l}`,c),"data-disabled":o||void 0,...p,children:d?d.map(_=>t.jsx(xe,{value:_.value,label:_.label,description:_.description,disabled:_.disabled},_.value)):f})})});ht.displayName="VyreRadioGroup";const xe=s.forwardRef(({value:e,label:r,description:a,disabled:n,className:o,id:i,...l},d)=>{const c=s.useContext(yt);if(!c)throw new Error("Radio must be used inside a <RadioGroup>.");const f=c.value===e,p=n||c.groupDisabled,y=i??`${c.name}-${e}`.replace(/\s+/g,"-");return t.jsxs("label",{className:b("vyre-radio",`vyre-radio--${c.size}`,p&&"vyre-radio--disabled",o),"data-checked":f||void 0,"data-disabled":p||void 0,htmlFor:y,children:[t.jsx("input",{ref:d,type:"radio",id:y,name:c.name,value:e,checked:f,disabled:p,className:"vyre-radio__input",onChange:()=>{var h;return(h=c.onChange)==null?void 0:h.call(c,e)},...l}),t.jsx("span",{className:"vyre-radio__control","aria-hidden":"true",children:t.jsx("span",{className:"vyre-radio__dot"})}),(r||a)&&t.jsxs("span",{className:"vyre-radio__content",children:[r&&t.jsx("span",{className:"vyre-radio__label",children:r}),a&&t.jsx("span",{className:"vyre-radio__description",children:a})]})]})});xe.displayName="VyreRadio";const Na=["bold","italic","underline","strike","h1","h2","h3","ul","ol","quote","code","link","clear"];function P(e,r){document.execCommand(e,!1,r)}const pt=s.forwardRef(({value:e,onChange:r,placeholder:a="Write something…",disabled:n=!1,readOnly:o=!1,toolbar:i=Na,minHeight:l="10rem",className:d,...c},f)=>{const p=s.useRef(null),y=!n&&!o;s.useEffect(()=>{const v=p.current;v&&v.innerHTML!==e&&(v.innerHTML=e)},[e]);const h=s.useCallback(()=>{p.current&&r(p.current.innerHTML)},[r]),m=s.useCallback(v=>{var x;y&&((x=p.current)==null||x.focus(),v(),h())},[y,h]),u={bold:{label:"Bold",icon:t.jsx("b",{children:"B"}),run:()=>P("bold")},italic:{label:"Italic",icon:t.jsx("i",{children:"I"}),run:()=>P("italic")},underline:{label:"Underline",icon:t.jsx("u",{children:"U"}),run:()=>P("underline")},strike:{label:"Strikethrough",icon:t.jsx("s",{children:"S"}),run:()=>P("strikeThrough")},h1:{label:"Heading 1",icon:t.jsx(t.Fragment,{children:"H1"}),run:()=>P("formatBlock","<h1>")},h2:{label:"Heading 2",icon:t.jsx(t.Fragment,{children:"H2"}),run:()=>P("formatBlock","<h2>")},h3:{label:"Heading 3",icon:t.jsx(t.Fragment,{children:"H3"}),run:()=>P("formatBlock","<h3>")},ul:{label:"Bullet list",icon:t.jsx(t.Fragment,{children:"•≡"}),run:()=>P("insertUnorderedList")},ol:{label:"Numbered list",icon:t.jsx(t.Fragment,{children:"1.≡"}),run:()=>P("insertOrderedList")},quote:{label:"Quote",icon:t.jsx(t.Fragment,{children:"“”"}),run:()=>P("formatBlock","<blockquote>")},code:{label:"Code block",icon:t.jsx(t.Fragment,{children:"</>"}),run:()=>P("formatBlock","<pre>")},link:{label:"Link",icon:t.jsx(t.Fragment,{children:"🔗"}),run:()=>{const v=window.prompt("Link URL");v&&P("createLink",v)}},clear:{label:"Clear formatting",icon:t.jsx(t.Fragment,{children:"⌫"}),run:()=>P("removeFormat")}};return t.jsxs("div",{ref:f,className:b("vyre-rte",n&&"vyre-rte--disabled",o&&"vyre-rte--readonly",d),...c,children:[!o&&t.jsx("div",{className:"vyre-rte__toolbar",role:"toolbar","aria-label":"Formatting",children:i.map(v=>{const x=u[v];return x?t.jsx("button",{type:"button",className:"vyre-rte__tool",title:x.label,"aria-label":x.label,disabled:!y,onMouseDown:g=>g.preventDefault(),onClick:()=>m(x.run),children:x.icon},v):null})}),t.jsx("div",{ref:p,className:"vyre-rte__content",contentEditable:y,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":a,"data-placeholder":a,style:{minHeight:l},onInput:h,onBlur:h})]})});pt.displayName="VyreRichTextEditor";const xt=s.forwardRef(({checked:e,defaultChecked:r=!1,onCheckedChange:a,disabled:n,size:o="md",className:i,...l},d)=>{const[c,f]=s.useState(r),p=e!==void 0?e:c,y=()=>{if(n)return;const h=!p;e===void 0&&f(h),a==null||a(h)};return t.jsx("button",{ref:d,type:"button",role:"switch","aria-checked":p,disabled:n,"data-checked":p||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...l,children:t.jsx("span",{className:"vyre-switch__thumb"})})});xt.displayName="Switch";const bt=s.forwardRef(({value:e,defaultValue:r=0,min:a=0,max:n=100,step:o=1,onValueChange:i,disabled:l,size:d="md",className:c,style:f,...p},y)=>{const[h,m]=s.useState(r),u=e!==void 0?e:h,v=(u-a)/(n-a)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${d}`,c].filter(Boolean).join(" "),"data-disabled":l||void 0,style:{"--vyre-slider-pct":`${v}%`,...f},children:[t.jsx("input",{ref:y,type:"range",min:a,max:n,step:o,value:u,disabled:l,className:"vyre-slider__input",onChange:x=>{const g=Number(x.target.value);e===void 0&&m(g),i==null||i(g)},...p}),t.jsxs("div",{className:"vyre-slider__track",children:[t.jsx("div",{className:"vyre-slider__fill",style:{width:`${v}%`}}),t.jsx("div",{className:"vyre-slider__thumb",style:{left:`${v}%`}})]})]})});bt.displayName="Slider";const _t=s.forwardRef(({value:e,max:r=100,indeterminate:a=!1,size:n="md",variant:o="default",className:i,...l},d)=>{const c=a?void 0:Math.min(100,Math.max(0,(e??0)/r*100));return t.jsx("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:e??0,"data-size":n,"data-variant":o,"data-indeterminate":a||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...l,children:t.jsx("div",{className:"vyre-progress__bar",style:c!==void 0?{width:`${c}%`}:void 0})})});_t.displayName="Progress";const gt=s.forwardRef(({orientation:e="horizontal",decorative:r=!0,className:a,...n},o)=>t.jsx("div",{ref:o,role:r?"none":"separator","aria-orientation":r?void 0:e,"data-orientation":e,className:["vyre-separator",a].filter(Boolean).join(" "),...n}));gt.displayName="Separator";const jt=s.forwardRef(({required:e,disabled:r,className:a,children:n,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":r||void 0,className:["vyre-label",a].filter(Boolean).join(" "),...o,children:[n,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));jt.displayName="Label";const be=s.forwardRef(({variant:e="rect",width:r,height:a,className:n,style:o,...i},l)=>t.jsx("div",{ref:l,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",n].filter(Boolean).join(" "),style:{width:typeof r=="number"?`${r}px`:r,height:typeof a=="number"?`${a}px`:a,...o},...i}));be.displayName="Skeleton";const ae=8,ka=120;function Ca(e){const[r,a]=e.split("-");return{side:r,align:a??"center"}}function Ra(e,r,a,n,o,i){const l=e.width,d=e.height,c=r.width,f=r.height,p=e.left+o,y=e.top+i;let h=0,m=0;switch(a){case"top":h=y-f-ae;break;case"bottom":h=y+d+ae;break;case"left":m=p-c-ae;break;case"right":m=p+l+ae;break}if(a==="top"||a==="bottom")switch(n){case"start":m=p;break;case"center":m=p+l/2-c/2;break;case"end":m=p+l-c;break}else switch(n){case"start":h=y;break;case"center":h=y+d/2-f/2;break;case"end":h=y+d-f;break}return{top:h,left:m}}const wt=({trigger:e,children:r,open:a,onOpenChange:n,placement:o="bottom",closeOnOutside:i=!0,className:l})=>{const d=a!==void 0,[c,f]=s.useState(!1),[p,y]=s.useState(!1),[h,m]=s.useState(!1),[u,v]=s.useState({top:0,left:0}),x=d?a:c,g=s.useRef(null),j=s.useRef(null),_=s.useRef(null),L=s.useId(),{side:w,align:M}=Ca(o),E=s.useCallback(R=>{d||f(R),n==null||n(R)},[d,n]),S=s.useCallback(()=>E(!x),[x,E]),k=s.useCallback(()=>{y(!0),_.current=setTimeout(()=>{y(!1),m(!1),E(!1)},ka)},[E]);s.useEffect(()=>{x?(_.current&&(clearTimeout(_.current),_.current=null),y(!1),m(!0)):h&&!p&&k()},[x]),s.useEffect(()=>{if(!h||!g.current||!j.current)return;const R=g.current.getBoundingClientRect(),C=j.current.getBoundingClientRect(),N=Ra(R,C,w,M,window.scrollX,window.scrollY);v(N)},[h,w,M]),s.useEffect(()=>{if(!h||!i)return;const R=C=>{j.current&&!j.current.contains(C.target)&&g.current&&!g.current.contains(C.target)&&k()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[h,i,k]),s.useEffect(()=>{if(!h)return;const R=C=>{C.key==="Escape"&&k()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[h,k]);const I=s.cloneElement(e,{ref:g,onClick:R=>{var C,N;S(),(N=(C=e.props).onClick)==null||N.call(C,R)},"aria-expanded":x,"aria-controls":L,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[I,h&&G.createPortal(t.jsx("div",{ref:j,id:L,role:"dialog","aria-modal":"false",className:b("vyre-popover",`vyre-popover--${w}`,p&&"vyre-popover--leaving",l),style:{top:u.top,left:u.left},children:r}),document.body)]})};wt.displayName="VyrePopover";const ne=s.createContext(null),Nt=s.createContext(null),Sa=120,kt=({trigger:e,children:r,placement:a="bottom-start",className:n})=>{const[o,i]=s.useState(!1),[l,d]=s.useState(!1),[c,f]=s.useState(!1),[p,y]=s.useState({top:0,left:0}),[h,m]=s.useState(-1),u=s.useRef(null),v=s.useRef(null),x=s.useRef(null),g=s.useId(),j=s.useCallback(()=>{var k;return Array.from(((k=v.current)==null?void 0:k.querySelectorAll("[role=menuitem]:not([aria-disabled=true]):not([disabled]),[role=menuitemcheckbox]:not([aria-disabled=true]):not([disabled]),[role=menuitemradio]:not([aria-disabled=true]):not([disabled])"))??[])},[]),_=s.useCallback(()=>{d(!0),x.current=setTimeout(()=>{var k;d(!1),f(!1),i(!1),m(-1),(k=u.current)==null||k.focus({preventScroll:!0})},Sa)},[]),L=s.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),d(!1),i(!0),f(!0)},[]),w=s.useCallback(()=>{o?_():L()},[o,L,_]);s.useEffect(()=>{if(!c||!u.current)return;const k=u.current.getBoundingClientRect(),I=4,R=window.scrollX,C=window.scrollY;let N=0,D=0;a.startsWith("bottom")?(N=k.bottom+C+I,D=a==="bottom-start"?k.left+R:k.right+R):(N=k.top+C-I,D=a==="top-start"?k.left+R:k.right+R),y({top:N,left:D}),requestAnimationFrame(()=>{var V;(V=j()[0])==null||V.focus({preventScroll:!0}),m(0)})},[c,a,j]),s.useEffect(()=>{if(!c)return;const k=R=>{v.current&&!v.current.contains(R.target)&&u.current&&!u.current.contains(R.target)&&_()},I=R=>{var C,N,D;if(R.key==="Escape"){_();return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const B=j();if(!B.length)return;const V=R.key==="ArrowDown"?1:-1,Z=(h+V+B.length)%B.length;(C=B[Z])==null||C.focus({preventScroll:!0}),m(Z)}if(R.key==="Home"&&((N=j()[0])==null||N.focus({preventScroll:!0}),m(0)),R.key==="End"){const B=j();(D=B[B.length-1])==null||D.focus({preventScroll:!0}),m(B.length-1)}};return document.addEventListener("mousedown",k),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",I)}},[c,h,_,j]);const M=s.cloneElement(e,{ref:u,onClick:k=>{var I,R;w(),(R=(I=e.props).onClick)==null||R.call(I,k)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":g}),E=a.endsWith("-end"),S=a.startsWith("top");return t.jsxs(ne.Provider,{value:{close:_},children:[M,c&&G.createPortal(t.jsx("div",{ref:v,id:g,role:"menu","aria-orientation":"vertical",className:b("vyre-dropdown",E&&"vyre-dropdown--end",S&&"vyre-dropdown--top",l&&"vyre-dropdown--leaving",n),style:{top:p.top,left:p.left,transform:E?"translateX(-100%)":void 0},children:r}),document.body)]})};kt.displayName="VyreDropdownMenu";const Ct=({children:e,className:r})=>t.jsx("div",{className:b("vyre-dropdown__label",r),children:e});Ct.displayName="VyreDropdownLabel";const Rt=({children:e,onSelect:r,disabled:a=!1,variant:n="default",icon:o,shortcut:i,className:l})=>{const d=s.useContext(ne);return t.jsxs("button",{role:"menuitem",className:b("vyre-dropdown__item",n==="danger"&&"vyre-dropdown__item--danger",l),"aria-disabled":a||void 0,disabled:a,tabIndex:-1,onClick:()=>{a||(r==null||r(),d==null||d.close())},children:[o&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:o}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),i&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:i})]})};Rt.displayName="VyreDropdownItem";const St=({children:e,checked:r,onCheckedChange:a,disabled:n=!1,shortcut:o,className:i})=>{const l=s.useContext(ne);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":r,"aria-disabled":n||void 0,disabled:n,tabIndex:-1,className:b("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{n||(a(!r),l==null||l.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:r&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),o&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:o})]})};St.displayName="VyreDropdownCheckboxItem";const Lt=({value:e,onValueChange:r,children:a})=>t.jsx(Nt.Provider,{value:{value:e,onValueChange:r},children:t.jsx("div",{role:"group",children:a})});Lt.displayName="VyreDropdownRadioGroup";const Dt=({children:e,value:r,disabled:a=!1,className:n})=>{const o=s.useContext(ne),i=s.useContext(Nt),l=(i==null?void 0:i.value)===r;return t.jsxs("button",{role:"menuitemradio","aria-checked":l,"aria-disabled":a||void 0,disabled:a,tabIndex:-1,className:b("vyre-dropdown__item vyre-dropdown__item--radio",n),onClick:()=>{a||(i==null||i.onValueChange(r),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:l&&t.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",children:t.jsx("circle",{cx:"4",cy:"4",r:"3",fill:"currentColor"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e})]})};Dt.displayName="VyreDropdownRadioItem";const It=({trigger:e,children:r,icon:a,placement:n="right",disabled:o=!1,className:i})=>{const[l,d]=s.useState(!1),[c,f]=s.useState({top:0,left:0}),p=s.useRef(null),y=s.useRef(null),h=s.useCallback(()=>{if(!p.current)return;const v=p.current.getBoundingClientRect(),x=window.scrollX,g=window.scrollY,j=2;f({top:v.top+g,left:n==="right"?v.right+x+j:v.left+x-j}),d(!0)},[n]),m=s.useCallback(()=>d(!1),[]),u=v=>{var g;const x=v.relatedTarget;(g=y.current)!=null&&g.contains(x)||m()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:p,role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:b("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:h,onMouseLeave:u,onFocus:h,children:[a&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:a}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),t.jsx("span",{className:"vyre-dropdown__item-chevron","aria-hidden":"true",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:n==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),l&&G.createPortal(t.jsx("div",{ref:y,role:"menu",className:b("vyre-dropdown vyre-dropdown--sub",n==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:c.top,left:n==="right"?c.left:void 0,right:n==="left"?`calc(100vw - ${c.left}px)`:void 0,transform:n==="left"?"translateX(-100%)":void 0},onMouseLeave:v=>{var g;const x=v.relatedTarget;(g=p.current)!=null&&g.contains(x)||m()},children:r}),document.body)]})};It.displayName="VyreDropdownSub";const Mt=({className:e})=>t.jsx("div",{role:"separator",className:b("vyre-dropdown__separator",e)});Mt.displayName="VyreDropdownSeparator";const La=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M8 7v4M8 5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Da=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ia=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 6v3M8 11v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ma=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Tt={info:La,success:Da,warning:Ia,danger:Ma},Et=({variant:e="info",title:r,icon:a,onClose:n,children:o,className:i})=>{const l=Tt[e];return t.jsxs("div",{role:"alert",className:b("vyre-alert",`vyre-alert--${e}`,i),children:[t.jsx("span",{className:"vyre-alert__icon","aria-hidden":"true",children:a??t.jsx(l,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[r&&t.jsx("p",{className:"vyre-alert__title",children:r}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),n&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:n,children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 3l8 8M11 3l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})};Et.displayName="VyreAlert";const Ta=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),At=({open:e,onOpenChange:r,title:a,description:n,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:d,onCancel:c,className:f})=>{const p=s.useRef(null),y=s.useRef(null),h=s.useRef(null),m=s.useCallback(()=>{c==null||c(),r(!1)},[c,r]),u=s.useCallback(()=>{d==null||d(),r(!1)},[d,r]),v=s.useCallback(g=>{if(g.key!=="Tab")return;const j=p.current;if(!j)return;const _=Array.from(j.querySelectorAll(Ta));if(!_.length)return;const L=_[0],w=_[_.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]);if(s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",v);const g=document.body.style.overflow;document.body.style.overflow="hidden";const j=_=>{_.key==="Escape"&&m()};return document.addEventListener("keydown",j),setTimeout(()=>{var _;return(_=h.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keydown",j),document.body.style.overflow=g}},[e,v,m]),!e)return null;const x=Tt[o];return G.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:g=>{g.target===y.current&&m()},role:"presentation",children:t.jsxs("div",{ref:p,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":n?"vyre-ad-desc":void 0,className:b("vyre-alert-dialog",`vyre-alert-dialog--${o}`,f),tabIndex:-1,children:[t.jsx("div",{className:"vyre-alert-dialog__icon-wrap",children:t.jsx("span",{className:b("vyre-alert-dialog__icon",`vyre-alert-dialog__icon--${o}`),children:t.jsx(x,{})})}),t.jsxs("div",{className:"vyre-alert-dialog__body",children:[t.jsx("h2",{id:"vyre-ad-title",className:"vyre-alert-dialog__title",children:a}),n&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:n})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:h,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:m,children:l}),t.jsx("button",{type:"button",className:b("vyre-btn vyre-btn--sm",o==="danger"&&"vyre-btn--danger",o==="warning"&&"vyre-btn--primary",o==="info"&&"vyre-btn--accent"),onClick:u,children:i})]})]})}),document.body)};At.displayName="VyreAlertDialog";const Ea=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Bt=s.forwardRef(({open:e,onClose:r,side:a="right",size:n="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:l,children:d,"aria-label":c,"aria-labelledby":f,...p},y)=>{const h=s.useRef(null),m=s.useRef(null),u=s.useCallback(v=>{if(v.key!=="Tab")return;const x=h.current;if(!x)return;const g=Array.from(x.querySelectorAll(Ea));if(!g.length)return;const j=g[0],_=g[g.length-1];v.shiftKey&&document.activeElement===j?(v.preventDefault(),_.focus()):!v.shiftKey&&document.activeElement===_&&(v.preventDefault(),j.focus())},[]);return s.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const x=j=>{j.key==="Escape"&&r()};document.addEventListener("keydown",x);const g=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var j;return(j=h.current)==null?void 0:j.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",x),document.body.style.overflow=g}}const v=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var x;return(x=h.current)==null?void 0:x.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=v}},[e,u,i,r]),e?G.createPortal(t.jsx("div",{ref:m,className:"vyre-sheet-backdrop",onClick:v=>{o&&v.target===m.current&&r()},role:"presentation",children:t.jsx("div",{ref:v=>{h.current=v,typeof y=="function"?y(v):y&&(y.current=v)},role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":f,tabIndex:-1,className:b("vyre-sheet",`vyre-sheet--${a}`,`vyre-sheet--${n}`,l),...p,children:d})}),document.body):null});Bt.displayName="VyreSheet";const Vt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-sheet__header",e),...a,children:r}));Vt.displayName="VyreSheetHeader";const $t=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-sheet__body",e),...a,children:r}));$t.displayName="VyreSheetBody";const Ft=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-sheet__footer",e),...a,children:r}));Ft.displayName="VyreSheetFooter";const Wt=({children:e,separator:r="/",className:a})=>{const n=s.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:b("vyre-breadcrumb",a),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:n.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<n.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:r})]},i))})})};Wt.displayName="VyreBreadcrumb";const Pt=({children:e,href:r,current:a=!1,className:n})=>a||!r?t.jsx("span",{className:b("vyre-breadcrumb__link vyre-breadcrumb__link--current",n),"aria-current":a?"page":void 0,children:e}):t.jsx("a",{href:r,className:b("vyre-breadcrumb__link",n),children:e});Pt.displayName="VyreBreadcrumbItem";const Ht=({children:e,href:r,className:a})=>t.jsx("a",{href:r,className:b("vyre-breadcrumb__link",a),children:e});Ht.displayName="VyreBreadcrumbLink";const Gt=({children:e="/",className:r})=>t.jsx("span",{className:b("vyre-breadcrumb__separator",r),"aria-hidden":"true",children:e});Gt.displayName="VyreBreadcrumbSeparator";function Le(e,r){return Array.from({length:r-e+1},(a,n)=>e+n)}function Aa(e,r,a){const n=a*2+5;if(r<=n)return Le(1,r);const o=Math.max(e-a,2),i=Math.min(e+a,r-1),l=o>2,d=i<r-1,c=[1];return l&&c.push("..."),c.push(...Le(o,i)),d&&c.push("..."),c.push(r),c}const Ba=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 2L4 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Va=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M5 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),$a=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M7 2L2 7l5 5M12 2L7 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Fa=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l5 5-5 5M7 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ot=({page:e,totalPages:r,onPageChange:a,siblings:n=1,showEdges:o=!0,showInfo:i=!1,totalItems:l,pageSize:d,className:c})=>{const f=Aa(e,r,n),p=e>1,y=e<r,h=s.useMemo(()=>{if(!i)return null;if(l!=null&&d!=null){const u=(e-1)*d+1,v=Math.min(e*d,l);return`Showing ${u}–${v} of ${l}`}return`Page ${e} of ${r}`},[i,e,r,l,d]),m=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(1),disabled:!p,"aria-label":"First page",children:t.jsx($a,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e-1),disabled:!p,"aria-label":"Previous page",children:t.jsx(Ba,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:f.map((u,v)=>u==="..."?t.jsx("li",{children:t.jsx("span",{className:"vyre-pagination__dots","aria-hidden":"true",children:"···"})},`dots-${v}`):t.jsx("li",{children:t.jsx("button",{className:b("vyre-pagination__btn",u===e&&"vyre-pagination__btn--active"),onClick:()=>a(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(Va,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(r),disabled:!y,"aria-label":"Last page",children:t.jsx(Fa,{})})]});return i?t.jsxs("div",{className:b("vyre-pagination-row",c),children:[t.jsx("span",{className:"vyre-pagination__info",children:h}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:m})]}):t.jsx("nav",{"aria-label":"Pagination",className:b("vyre-pagination",c),children:m})};Ot.displayName="VyrePagination";const qt=({children:e,striped:r=!1,bordered:a=!1,compact:n=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:b("vyre-table",r&&"vyre-table--striped",a&&"vyre-table--bordered",n&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});qt.displayName="VyreTable";const Kt=s.forwardRef(({className:e,...r},a)=>t.jsx("thead",{ref:a,className:b("vyre-table__head",e),...r}));Kt.displayName="VyreTableHead";const Yt=s.forwardRef(({className:e,...r},a)=>t.jsx("tbody",{ref:a,className:b("vyre-table__body",e),...r}));Yt.displayName="VyreTableBody";const Ut=s.forwardRef(({className:e,selected:r,...a},n)=>t.jsx("tr",{ref:n,className:b("vyre-table__row",r&&"vyre-table__row--selected",e),"aria-selected":r,...a}));Ut.displayName="VyreTableRow";const Wa=({dir:e})=>t.jsx("span",{className:"vyre-table__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v8M3 5l3-3 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="desc"?.3:1}),t.jsx("path",{d:"M3 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="asc"?.3:1})]})}),zt=s.forwardRef(({className:e,sortable:r,sortDir:a=null,onSort:n,align:o="left",children:i,...l},d)=>r?t.jsx("th",{ref:d,className:b("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,a&&`vyre-table__th--sort-${a}`,e),"aria-sort":a==="asc"?"ascending":a==="desc"?"descending":"none",...l,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:n,type:"button",children:[i,t.jsx(Wa,{dir:a})]})}):t.jsx("th",{ref:d,className:b("vyre-table__th",`vyre-table__th--${o}`,e),...l,children:i}));zt.displayName="VyreTableHeader";const Xt=s.forwardRef(({className:e,align:r="left",...a},n)=>t.jsx("td",{ref:n,className:b("vyre-table__td",`vyre-table__td--${r}`,e),...a}));Xt.displayName="VyreTableCell";const Zt=s.forwardRef(({className:e,...r},a)=>t.jsx("caption",{ref:a,className:b("vyre-table__caption",e),...r}));Zt.displayName="VyreTableCaption";const Qt=s.createContext(null),se=()=>{const e=s.useContext(Qt);if(!e)throw new Error("Command components must be used inside <Command>");return e};function ie(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function Pa(e,r,a=[]){if(!e)return!0;const n=ie(e);return ie(r).includes(n)||a.some(o=>ie(o).includes(n))}let Ha=0;function Ga(){return`cmd-${++Ha}`}const _e=s.forwardRef(({value:e,onValueChange:r,className:a,children:n},o)=>{const[i,l]=s.useState(""),[d,c]=s.useState(0),[f,p]=s.useState(0),y=e!==void 0?e:i,h=s.useCallback(_=>{l(_),r==null||r(_),c(0)},[r]),m=s.useRef(new Map),u=s.useRef(new Map),v=s.useCallback((_,L,w)=>{m.current.set(_,{el:L,disabled:w})},[]),x=s.useCallback(_=>{m.current.delete(_),u.current.delete(_)},[]),g=s.useCallback(_=>{var L;(L=u.current.get(_))==null||L()},[]),j=s.useMemo(()=>({search:y,setSearch:h,activeIndex:d,setActiveIndex:c,items:m,registerItem:v,unregisterItem:x,selectItem:g,onSelectRef:u,visibleCount:f,setVisibleCount:p}),[y,h,d,v,x,g,f]);return t.jsx(Qt.Provider,{value:j,children:t.jsx("div",{ref:o,className:b("vyre-command",a),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:n})})});_e.displayName="VyreCommand";const Jt=s.forwardRef(({placeholder:e="Search...",className:r},a)=>{const{search:n,setSearch:o}=se();return t.jsxs("div",{className:"vyre-command__input-wrapper",children:[t.jsx("svg",{className:"vyre-command__search-icon",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10 6.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM9.5 10.207l3.146 3.147",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),t.jsx("input",{ref:a,className:b("vyre-command__input",r),type:"text",placeholder:e,value:n,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),n&&t.jsx("button",{className:"vyre-command__clear",type:"button","aria-label":"Clear search",onClick:()=>o(""),children:t.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l9 9M11 2l-9 9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]})});Jt.displayName="VyreCommandInput";const er=s.forwardRef(({className:e,children:r},a)=>{const{activeIndex:n,setActiveIndex:o,items:i,selectItem:l}=se(),d=s.useCallback(c=>{var p,y;const f=Array.from((i.current??new Map).entries()).filter(([,h])=>!h.disabled&&h.el.closest("[data-cmd-item]")!==null&&!h.el.hasAttribute("data-cmd-hidden"));if(c.key==="ArrowDown")c.preventDefault(),o(Math.min(n+1,f.length-1)),(p=f[Math.min(n+1,f.length-1)])==null||p[1].el.scrollIntoView({block:"nearest"});else if(c.key==="ArrowUp")c.preventDefault(),o(Math.max(n-1,0)),(y=f[Math.max(n-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(c.key==="Enter"){c.preventDefault();const[h]=f[n]??[];h&&l(h)}},[n,o,i,l]);return t.jsx("div",{ref:a,id:"vyre-command-list",role:"listbox",className:b("vyre-command__list",e),onKeyDown:d,children:r})});er.displayName="VyreCommandList";const tr=({className:e,children:r})=>{const{search:a,visibleCount:n}=se();return!a||n>0?null:t.jsx("div",{className:b("vyre-command__empty",e),role:"presentation",children:r??"No results found."})};tr.displayName="VyreCommandEmpty";const rr=({heading:e,className:r,children:a})=>t.jsxs("div",{className:b("vyre-command__group",r),role:"presentation",children:[e&&t.jsx("div",{className:"vyre-command__group-heading","aria-hidden":"true",children:e}),t.jsx("div",{role:"group","aria-label":e,children:a})]});rr.displayName="VyreCommandGroup";const ar=({onSelect:e,disabled:r=!1,keywords:a,className:n,children:o,icon:i,shortcut:l})=>{const{search:d,setActiveIndex:c,registerItem:f,unregisterItem:p,onSelectRef:y,setVisibleCount:h}=se(),m=s.useMemo(()=>Ga(),[]),u=s.useRef(null),x=Pa(d,typeof o=="string"?o:"",a);return s.useEffect(()=>(h(g=>g+(x?1:0)),()=>{h(g=>g-(x?1:0))}),[x,h]),s.useEffect(()=>{const g=u.current;if(!(!g||!x))return f(m,g,r),()=>p(m)},[m,r,x,f,p]),s.useEffect(()=>{var g;return e&&((g=y.current)==null||g.set(m,e)),()=>{var j;(j=y.current)==null||j.delete(m)}},[m,e,y]),x?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":r||void 0,className:b("vyre-command__item",r&&"vyre-command__item--disabled",n),onClick:()=>{r||e==null||e()},onMouseEnter:()=>{!r&&u.current&&c(-1)},children:[i&&t.jsx("span",{className:"vyre-command__item-icon","aria-hidden":"true",children:i}),t.jsx("span",{className:"vyre-command__item-label",children:o}),l&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:l})]}):null};ar.displayName="VyreCommandItem";const nr=({className:e})=>t.jsx("div",{className:b("vyre-command__separator",e),role:"separator","aria-hidden":"true"});nr.displayName="VyreCommandSeparator";const sr=({open:e,onOpenChange:r,value:a,onValueChange:n,className:o,children:i})=>{const l=s.useRef(null);return s.useEffect(()=>{var f;if(!e)return;const d=document.activeElement,c=(f=l.current)==null?void 0:f.querySelector(".vyre-command__input");return c==null||c.focus(),()=>{d==null||d.focus({preventScroll:!0})}},[e]),s.useEffect(()=>{if(!e)return;const d=c=>{c.key==="Escape"&&r(!1)};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,r]),e?G.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:l,onClick:d=>{d.target===d.currentTarget&&r(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(_e,{value:a,onValueChange:n,className:b("vyre-command--dialog",o),children:i})}),document.body):null};sr.displayName="VyreCommandDialog";const or=s.forwardRef(({orientation:e="horizontal",attached:r=!1,size:a,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,role:"group",className:b("vyre-btn-group",e==="vertical"&&"vyre-btn-group--vertical",r&&"vyre-btn-group--attached",n),"data-orientation":e,"data-size":a,...i,children:o}));or.displayName="VyreButtonGroup";const ge=s.forwardRef(({variant:e="default",size:r="md",onRemove:a,onClick:n,disabled:o=!1,className:i,children:l,...d},c)=>{const f=!!n&&!o;return t.jsxs("span",{ref:c,className:b("vyre-tag",`vyre-tag--${e}`,`vyre-tag--${r}`,f&&"vyre-tag--clickable",o&&"vyre-tag--disabled",i),"data-variant":e,"data-size":r,role:f?"button":void 0,tabIndex:f?0:void 0,"aria-disabled":o||void 0,onClick:f?n:void 0,onKeyDown:f?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),n==null||n())}:void 0,...d,children:[t.jsx("span",{className:"vyre-tag__label",children:l}),a&&t.jsx("button",{type:"button",className:"vyre-tag__remove","aria-label":"Remove",disabled:o,onClick:p=>{p.stopPropagation(),a()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})});ge.displayName="VyreTag";const ir=s.forwardRef(({value:e,onChange:r,placeholder:a="Add tag…",disabled:n=!1,max:o,size:i="md",className:l,style:d,"data-testid":c},f)=>{const[p,y]=s.useState(""),h=s.useRef(null),m=o!==void 0&&e.length>=o,u=n||m;function v(_){const L=_.trim();if(!L||e.includes(L)||m){y("");return}r([...e,L]),y("")}function x(_){n||r(e.filter((L,w)=>w!==_))}function g(_){if(_.key==="Enter"||_.key===","){_.preventDefault(),v(p);return}_.key==="Backspace"&&p===""&&e.length>0&&x(e.length-1)}function j(_){const L=_.target.value;if(L.includes(",")){const w=L.split(",");w.slice(0,-1).forEach(E=>v(E)),y(w[w.length-1])}else y(L)}return t.jsxs("div",{ref:f,className:b("vyre-tags-input",`vyre-tags-input--${i}`,n&&"vyre-tags-input--disabled",l),"data-testid":c,style:d,onClick:()=>{var _;return(_=h.current)==null?void 0:_.focus()},children:[e.map((_,L)=>t.jsx(ge,{size:i,disabled:n,onRemove:n?void 0:()=>x(L),children:_},`${_}-${L}`)),t.jsx("input",{ref:h,type:"text",className:"vyre-tags-input__field",value:p,onChange:j,onKeyDown:g,placeholder:m?"":a,disabled:u,"aria-label":"Add tag"})]})});ir.displayName="VyreTagsInput";const lr=s.forwardRef(({options:e,value:r,onChange:a,placeholder:n="Search…",disabled:o=!1,size:i="md",emptyText:l="No results",className:d,...c},f)=>{const[p,y]=s.useState(!1),[h,m]=s.useState(""),[u,v]=s.useState(-1),x=s.useRef(null),g=s.useRef(null),j=s.useRef(null),L=`${s.useId()}-listbox`,w=e.find(N=>N.value===r)??null,M=e.filter(N=>N.label.toLowerCase().includes(h.toLowerCase())),E=s.useCallback(()=>{y(!1),v(-1),m("")},[]),S=s.useCallback(N=>{var D;N.disabled||(a(N.value),E(),(D=x.current)==null||D.blur())},[a,E]);s.useEffect(()=>{if(!p)return;const N=D=>{const B=j.current;B&&!B.contains(D.target)&&E()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[p,E]),s.useEffect(()=>{var D;if(!p||u<0)return;const N=(D=g.current)==null?void 0:D.children[u];N==null||N.scrollIntoView({block:"nearest"})},[u,p]),s.useEffect(()=>{v(M.length>0?0:-1)},[h]);function k(){o||(y(!0),m(""))}function I(N){m(N.target.value),p||y(!0)}function R(N){var D;switch(N.key){case"ArrowDown":{if(N.preventDefault(),!p){y(!0);return}v(B=>{let V=B+1;for(;V<M.length&&M[V].disabled;)V++;return V<M.length?V:B});break}case"ArrowUp":{if(N.preventDefault(),!p){y(!0);return}v(B=>{let V=B-1;for(;V>=0&&M[V].disabled;)V--;return V>=0?V:B});break}case"Enter":{N.preventDefault(),p&&u>=0&&M[u]&&S(M[u]);break}case"Escape":{E(),(D=x.current)==null||D.blur();break}}}const C=p?h:(w==null?void 0:w.label)??"";return t.jsxs("div",{ref:N=>{j.current=N,typeof f=="function"?f(N):f&&(f.current=N)},className:b("vyre-combobox",`vyre-combobox--${i}`,o&&"vyre-combobox--disabled",d),"data-open":p,...c,children:[t.jsx("input",{ref:x,type:"text",role:"combobox","aria-expanded":p,"aria-haspopup":"listbox","aria-controls":L,"aria-autocomplete":"list","aria-disabled":o,disabled:o,className:"vyre-combobox__input",placeholder:n,value:C,onFocus:k,onChange:I,onKeyDown:R}),t.jsx("span",{className:"vyre-combobox__chevron","aria-hidden":"true",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),p&&t.jsx("ul",{ref:g,id:L,role:"listbox",className:"vyre-combobox__dropdown","aria-label":"Options",children:M.length>0?M.map((N,D)=>t.jsx("li",{role:"option","aria-selected":N.value===r,"aria-disabled":N.disabled,"data-highlighted":D===u,className:b("vyre-combobox__option",D===u&&"vyre-combobox__option--highlighted",N.value===r&&"vyre-combobox__option--selected"),onMouseEnter:()=>!N.disabled&&v(D),onMouseDown:B=>{B.preventDefault(),S(N)},children:N.label},N.value)):t.jsx("li",{className:"vyre-combobox__empty",role:"presentation",children:l})})]})});lr.displayName="VyreCombobox";function Oa({col:e,sortKey:r,sortDir:a}){const o=r===e.key?a:void 0;return t.jsx("span",{className:"vyre-data-grid__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v4M3.5 4.5L6 2l2.5 2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="desc"?.3:1}),t.jsx("path",{d:"M6 10V6M3.5 7.5L6 10l2.5-2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="asc"?.3:1})]})})}const qa=5,cr=s.forwardRef(({columns:e,rows:r,sortKey:a,sortDir:n,onSort:o,loading:i=!1,emptyText:l="No data",stickyHeader:d=!1,className:c,style:f,"data-testid":p},y)=>{function h(u){if(!u.sortable||!o)return;const v=a===u.key&&n==="asc"?"desc":"asc";o(u.key,v)}function m(u){return a!==u.key?"none":n==="asc"?"ascending":"descending"}return t.jsx("div",{ref:y,className:b("vyre-data-grid",d&&"vyre-data-grid--sticky-header",c),style:f,"data-testid":p,children:t.jsxs("table",{className:"vyre-data-grid__table",children:[t.jsx("thead",{className:"vyre-data-grid__thead",children:t.jsx("tr",{children:e.map(u=>t.jsx("th",{className:b("vyre-data-grid__th",u.sortable&&"vyre-data-grid__th--sortable",a===u.key&&`vyre-data-grid__th--sort-${n}`),style:u.width?{width:u.width}:void 0,"aria-sort":u.sortable?m(u):void 0,children:u.sortable?t.jsxs("button",{type:"button",className:"vyre-data-grid__sort-btn",onClick:()=>h(u),children:[u.label,t.jsx(Oa,{col:u,sortKey:a,sortDir:n})]}):u.label},u.key))})}),t.jsx("tbody",{className:"vyre-data-grid__tbody",children:i?Array.from({length:qa}).map((u,v)=>t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--skeleton",children:e.map(x=>t.jsx("td",{className:"vyre-data-grid__td",children:t.jsx(be,{height:16})},x.key))},`skel-${v}`)):r.length===0?t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--empty",children:t.jsx("td",{className:"vyre-data-grid__td vyre-data-grid__empty",colSpan:e.length,children:l})}):r.map((u,v)=>t.jsx("tr",{className:"vyre-data-grid__row",children:e.map(x=>t.jsx("td",{className:"vyre-data-grid__td",children:u[x.key]!=null?String(u[x.key]):""},x.key))},v))})]})})});cr.displayName="VyreDataGrid";const dr=s.forwardRef(({gap:e="md",wrap:r=!0,className:a,children:n,...o},i)=>t.jsx("div",{ref:i,className:b("vyre-tag-group",`vyre-tag-group--gap-${e}`,!r&&"vyre-tag-group--nowrap",a),role:"list",...o,children:n}));dr.displayName="VyreTagGroup";function X(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function q(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function J(e,r){return X(e)<X(r)}function De(e,r){return X(e)>X(r)}function Ka(e,r){return new Date(e,r+1,0).getDate()}function Ya(e,r,a){return(new Date(e,r,1).getDay()-a+7)%7}function K(e,r){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function Ua(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const Ie=Array.from({length:12},(e,r)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,r,1))),ee=12,te=s.forwardRef((e,r)=>{const{showTime:a=!1,minDate:n,maxDate:o,disabled:i,className:l,weekStartsOn:d=1,defaultMonth:c}=e,f=X(new Date),p=()=>{var T,A;return e.mode==="range"?((T=e.value)==null?void 0:T[0])??c??f:e.mode==="multiple"?((A=e.value)==null?void 0:A[0])??c??f:e.value??c??f},[y,h]=s.useState(()=>(p()??f).getFullYear()),[m,u]=s.useState(()=>(p()??f).getMonth()),[v,x]=s.useState("days"),[g,j]=s.useState(null),[_,L]=s.useState(()=>{const T=e.mode==="single"?e.value:null;return T?T.getHours():0}),[w,M]=s.useState(()=>{const T=e.mode==="single"?e.value:null;return T?T.getMinutes():0}),E=s.useMemo(()=>{const T=Ka(y,m),A=Ya(y,m,d);return{count:T,offset:A}},[y,m,d]),S=s.useMemo(()=>d===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[d]),k=s.useCallback(T=>{if(e.mode==="single")return!!e.value&&q(T,e.value);if(e.mode==="range"){const[A,F]=e.value??[null,null];return!!A&&q(T,A)||!!F&&q(T,F)}return e.mode==="multiple"?(e.value??[]).some(A=>q(T,A)):!1},[e]),I=s.useCallback(T=>{if(e.mode!=="range")return!1;const[A,F]=e.value??[null,null],W=F??g;if(!A||!W)return!1;const Y=J(A,W)?A:W,U=J(A,W)?W:A;return De(T,Y)&&J(T,U)},[e,g]),R=s.useCallback(T=>{if(e.mode!=="range")return!1;const[A]=e.value??[null,null];return!!A&&q(T,A)},[e]),C=s.useCallback(T=>{if(e.mode!=="range")return!1;const[,A]=e.value??[null,null];return!!A&&q(T,A)},[e]),N=s.useCallback(T=>!!(n&&J(T,n)||o&&De(T,o)||i!=null&&i(T)),[n,o,i]),D=s.useCallback(T=>{var F,W,Y,U,Q,re;const A=new Date(y,m,T,_,w);if(!N(X(A))){if(e.mode==="single"||!e.mode)(F=e.onChange)==null||F.call(e,A);else if(e.mode==="range"){const[H,z]=e.value??[null,null];!H||H&&z?(W=e.onChange)==null||W.call(e,[A,null]):J(A,H)?(Y=e.onChange)==null||Y.call(e,[A,H]):(U=e.onChange)==null||U.call(e,[H,A])}else if(e.mode==="multiple"){const H=e.value??[],z=H.findIndex(Se=>q(Se,A));z>=0?(Q=e.onChange)==null||Q.call(e,H.filter((Se,la)=>la!==z)):(re=e.onChange)==null||re.call(e,[...H,A])}}},[y,m,_,w,e,N]),B=()=>{m===0?(u(11),h(T=>T-1)):u(T=>T-1)},V=()=>{m===11?(u(0),h(T=>T+1)):u(T=>T+1)},Z=(T,A)=>{var F;if(L(T),M(A),e.mode==="single"&&e.value){const W=new Date(e.value);W.setHours(T,A),(F=e.onChange)==null||F.call(e,W)}},ia=Math.floor(y/ee)*ee;return t.jsxs("div",{ref:r,className:b("vyre-calendar",l),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[v==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:B,"aria-label":"Previous month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),v==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>h(T=>T-ee),"aria-label":"Previous years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("div",{className:"vyre-calendar__header-center",children:[t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>x(v==="months"?"days":"months"),children:Ie[m]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>x(v==="years"?"days":"years"),children:y})]}),v==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:V,"aria-label":"Next month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),v==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>h(T=>T+ee),"aria-label":"Next years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),v==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:Ie.map((T,A)=>t.jsx("button",{className:b("vyre-calendar__month-cell",A===m&&"vyre-calendar__month-cell--active"),onClick:()=>{u(A),x("days")},children:T.slice(0,3)},T))}),v==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:ee},(T,A)=>ia+A).map(T=>t.jsx("button",{className:b("vyre-calendar__year-cell",T===y&&"vyre-calendar__year-cell--active"),onClick:()=>{h(T),x("days")},children:T},T))}),v==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[S.map(T=>t.jsx("div",{className:"vyre-calendar__weekday",children:T},T)),Array.from({length:E.offset}).map((T,A)=>t.jsx("div",{},`empty-${A}`)),Array.from({length:E.count},(T,A)=>A+1).map(T=>{const A=new Date(y,m,T),F=k(A),W=I(A),Y=R(A),U=C(A),Q=N(A),re=q(A,f);return t.jsx("button",{className:b("vyre-calendar__day",re&&"vyre-calendar__day--today",F&&"vyre-calendar__day--selected",W&&"vyre-calendar__day--in-range",Y&&"vyre-calendar__day--range-start",U&&"vyre-calendar__day--range-end",Q&&"vyre-calendar__day--disabled"),onClick:()=>D(T),onMouseEnter:()=>{if(e.mode==="range"){const[H,z]=e.value??[null,null];H&&!z&&j(A)}},onMouseLeave:()=>j(null),disabled:Q,"aria-selected":F,"aria-label":K(A),children:T},T)})]}),a&&v==="days"&&t.jsxs("div",{className:"vyre-calendar__time",children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M7 4v3.5l2 1.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:23,value:_,onChange:T=>Z(Number(T.target.value),w),"aria-label":"Hours"}),t.jsx("span",{className:"vyre-calendar__time-sep",children:":"}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:59,value:w,onChange:T=>Z(_,Number(T.target.value)),"aria-label":"Minutes"})]})]})});te.displayName="VyreCalendar";function za(e){if(e.mode==="range"){const[n,o]=e.value??[null,null];return n?o?`${K(n)} – ${K(o)}`:K(n):""}if(e.mode==="multiple"){const n=e.value??[];return n.length===0?"":n.length===1?K(n[0]):`${n.length} dates selected`}const r=e.value,a=e.showTime;return r?a?`${K(r)} ${Ua(r)}`:K(r):""}const ur=s.forwardRef(({placeholder:e="Pick a date",inputClassName:r,...a},n)=>{const[o,i]=s.useState(!1),l=s.useRef(null),d=s.useRef(null),[c,f]=s.useState({top:0,left:0,width:0}),p=za(a),y=s.useCallback(()=>{if(!l.current)return;const u=l.current.getBoundingClientRect();f({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);s.useEffect(()=>{if(!o)return;y();const u=()=>y(),v=()=>y();return window.addEventListener("scroll",u,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",v)}},[o,y]),s.useEffect(()=>{if(!o)return;const u=x=>{var g,j;!((g=d.current)!=null&&g.contains(x.target))&&!((j=l.current)!=null&&j.contains(x.target))&&i(!1)},v=x=>{x.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",v)}},[o]);const h=a.mode!=="range"&&a.mode!=="multiple"&&!a.showTime,m=s.useMemo(()=>a.mode==="range"?{...a,onChange:u=>{var v;(v=a.onChange)==null||v.call(a,u),u[0]&&u[1]&&i(!1)}}:a.mode==="multiple"?a:{...a,onChange:u=>{var v;(v=a.onChange)==null||v.call(a,u),h&&i(!1)}},[a,h]);return t.jsxs("div",{ref:n,className:"vyre-datepicker",children:[t.jsxs("button",{ref:l,type:"button",className:b("vyre-datepicker__trigger",!p&&"vyre-datepicker__trigger--placeholder",r),onClick:()=>{y(),i(u=>!u)},"aria-expanded":o,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:p||e}),p&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var v,x,g;u.stopPropagation(),a.mode==="range"?(v=a.onChange)==null||v.call(a,[null,null]):a.mode==="multiple"?(x=a.onChange)==null||x.call(a,[]):(g=a.onChange)==null||g.call(a,null)},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),o&&G.createPortal(t.jsx("div",{ref:d,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:c.top,left:c.left,minWidth:c.width},children:t.jsx(te,{...m})}),document.body)]})});ur.displayName="VyreDatePicker";function O(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function le(e,r){const a=new Date(e);return a.setDate(a.getDate()+r),O(a)}function ce(e){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}const Xa=[{label:"Today",range:()=>{const e=O(new Date);return{from:e,to:e}}},{label:"Yesterday",range:()=>{const e=le(new Date,-1);return{from:e,to:e}}},{label:"Last 7 days",range:()=>({from:le(new Date,-6),to:O(new Date)})},{label:"Last 30 days",range:()=>({from:le(new Date,-29),to:O(new Date)})},{label:"This month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth(),1)),to:O(new Date(e.getFullYear(),e.getMonth()+1,0))}}},{label:"Last month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth()-1,1)),to:O(new Date(e.getFullYear(),e.getMonth(),0))}}}],mr=s.forwardRef(({value:e,onChange:r,placeholder:a="Pick a date range",numberOfMonths:n=2,presets:o=!1,minDate:i,maxDate:l,disabled:d,weekStartsOn:c=1,className:f,inputClassName:p},y)=>{const[h,m]=s.useState(!1),u=s.useRef(null),v=s.useRef(null),[x,g]=s.useState({top:0,left:0,width:0}),j=(e==null?void 0:e.from)??null,_=(e==null?void 0:e.to)??null,L=s.useMemo(()=>o===!0?Xa:Array.isArray(o)?o:[],[o]),w=s.useMemo(()=>j?_?`${ce(j)} – ${ce(_)}`:ce(j):"",[j,_]),M=s.useCallback(()=>{if(!u.current)return;const C=u.current.getBoundingClientRect();g({top:C.bottom+window.scrollY+6,left:C.left+window.scrollX,width:C.width})},[]);s.useEffect(()=>{if(!h)return;M();const C=()=>M(),N=()=>M();return window.addEventListener("scroll",C,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",N)}},[h,M]),s.useEffect(()=>{if(!h)return;const C=D=>{var B,V;!((B=v.current)!=null&&B.contains(D.target))&&!((V=u.current)!=null&&V.contains(D.target))&&m(!1)},N=D=>{D.key==="Escape"&&m(!1)};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",N),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",N)}},[h]);const E=s.useCallback(C=>{const N={from:C[0],to:C[1]};r==null||r(N),N.from&&N.to&&m(!1)},[r]),S=s.useCallback(C=>{r==null||r(C.range()),m(!1)},[r]),k=s.useCallback(()=>{r==null||r({from:null,to:null})},[r]),I=s.useMemo(()=>{const C=j??O(new Date);return new Date(C.getFullYear(),C.getMonth()+1,1)},[j]),R=[j,_];return t.jsxs("div",{ref:y,className:b("vyre-date-range-picker",f),children:[t.jsxs("button",{ref:u,type:"button",className:b("vyre-datepicker__trigger",!w&&"vyre-datepicker__trigger--placeholder",p),onClick:()=>{M(),m(C=>!C)},"aria-expanded":h,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:w||a}),w&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:C=>{C.stopPropagation(),k()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),h&&G.createPortal(t.jsxs("div",{ref:v,className:"vyre-date-range-picker__popover",role:"dialog","aria-label":"Date range picker",style:{top:x.top,left:x.left},children:[L.length>0&&t.jsx("div",{className:"vyre-date-range-picker__presets",children:L.map(C=>t.jsx("button",{type:"button",className:"vyre-date-range-picker__preset",onClick:()=>S(C),children:C.label},C.label))}),t.jsxs("div",{className:"vyre-date-range-picker__calendars",children:[t.jsx(te,{mode:"range",value:R,onChange:E,minDate:i,maxDate:l,disabled:d,weekStartsOn:c}),n===2&&t.jsx(te,{mode:"range",value:R,defaultMonth:I,onChange:E,minDate:i,maxDate:l,disabled:d,weekStartsOn:c},I.toISOString())]})]}),document.body)]})});mr.displayName="VyreDateRangePicker";const vr=s.forwardRef(({variant:e="default",size:r="md",clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:b("vyre-item",`vyre-item--${e}`,`vyre-item--${r}`,a&&"vyre-item--clickable",n),"data-variant":e,"data-size":r,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));vr.displayName="VyreItem";const fr=s.forwardRef(({separated:e=!1,className:r,children:a,...n},o)=>t.jsx("div",{ref:o,role:"list",className:b("vyre-item-group",e&&"vyre-item-group--separated",r),...n,children:a}));fr.displayName="VyreItemGroup";const yr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-item__media",e),"aria-hidden":"true",...a,children:r}));yr.displayName="VyreItemMedia";const hr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-item__content",e),...a,children:r}));hr.displayName="VyreItemContent";const pr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-item__title",e),...a,children:r}));pr.displayName="VyreItemTitle";const xr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:b("vyre-item__description",e),...a,children:r}));xr.displayName="VyreItemDescription";const br=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:b("vyre-item__actions",e),...a,children:r}));br.displayName="VyreItemActions";function Za(e,r,a,n){const o=e.find(l=>l.id===r.fromColumnId);if(!o)return e;const i=o.cards.find(l=>l.id===r.cardId);return i?e.map(l=>{if(l.id===r.fromColumnId&&l.id===a){const d=l.cards.filter(p=>p.id!==r.cardId),c=Math.max(0,Math.min(n,d.length)),f=[...d];return f.splice(c,0,i),{...l,cards:f}}if(l.id===r.fromColumnId)return{...l,cards:l.cards.filter(d=>d.id!==r.cardId)};if(l.id===a){const d=Math.max(0,Math.min(n,l.cards.length)),c=[...l.cards];return c.splice(d,0,i),{...l,cards:c}}return l}):e}const _r=s.forwardRef(({value:e,onChange:r,renderCard:a,onCardClick:n,className:o,...i},l)=>{const d=s.useRef(null),c=s.useRef(!1),[f,p]=s.useState(null),[y,h]=s.useState(null),[m,u]=s.useState(null),v=(_,L)=>{h(w=>w===_?w:_),u(w=>w===L?w:L)},x=(_,L)=>w=>{d.current={cardId:L,fromColumnId:_},c.current=!1,p(L),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",L)},g=()=>{d.current=null,p(null),h(null),u(null)},j=(_,L)=>{const w=d.current;if(!w)return;const M=Za(e,w,_,L);M!==e&&(c.current=!0,r(M))};return t.jsx("div",{ref:l,className:b("vyre-kanban",o),role:"list","aria-label":"Kanban board",...i,children:e.map(_=>{const L=y===_.id,w=_.color&&_.color!=="default"?_.color:void 0,M=L&&d.current&&m!==null?m:null,E=t.jsx("div",{className:"vyre-kanban__placeholder","aria-hidden":"true"});return t.jsxs("div",{role:"listitem","data-color":w,className:b("vyre-kanban__column",L&&"vyre-kanban__column--over"),onDragOver:S=>{d.current&&(S.preventDefault(),S.dataTransfer.dropEffect="move",v(_.id,_.cards.length))},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||(h(k=>k===_.id?null:k),u(null))},onDrop:S=>{S.preventDefault(),j(_.id,m??_.cards.length),g()},children:[t.jsxs("div",{className:"vyre-kanban__column-header",children:[t.jsx("span",{className:"vyre-kanban__column-title",children:_.title}),t.jsx("span",{className:"vyre-kanban__column-count",children:_.cards.length})]}),t.jsxs("div",{className:"vyre-kanban__cards",children:[_.cards.map((S,k)=>{const I=S.color&&S.color!=="default"?S.color:void 0;return t.jsxs(s.Fragment,{children:[M===k&&E,t.jsx(ve,{variant:"outlined","data-color":I,className:b("vyre-kanban__card",f===S.id&&"vyre-kanban__card--dragging",n&&"vyre-kanban__card--clickable"),draggable:!0,role:n?"button":void 0,tabIndex:n?0:void 0,onDragStart:x(_.id,S.id),onDragEnd:g,onDragOver:R=>{if(!d.current)return;R.preventDefault(),R.stopPropagation();const C=R.currentTarget.getBoundingClientRect(),N=R.clientY-C.top>C.height/2;v(_.id,N?k+1:k)},onDrop:R=>{R.preventDefault(),R.stopPropagation(),j(_.id,m??k),g()},onClick:()=>{c.current||n==null||n(S,_)},onKeyDown:R=>{n&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),n(S,_))},children:t.jsx(fe,{children:a?a(S,_):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"vyre-kanban__card-title",children:S.title}),S.description&&t.jsx("div",{className:"vyre-kanban__card-desc",children:S.description})]})})})]},S.id)}),M===_.cards.length&&E,_.cards.length===0&&M===null&&t.jsx("div",{className:"vyre-kanban__empty",children:"Drop cards here"})]})]},_.id)})})});_r.displayName="VyreKanban";function Me(e){if(e==null)return null;const r=e instanceof Date?e:new Date(e);return Number.isNaN(r.getTime())?null:r}function me(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Qa(e){const r=new Date,a=new Date;return a.setDate(r.getDate()-1),me(e,r)?"Today":me(e,a)?"Yesterday":new Intl.DateTimeFormat("default",{month:"short",day:"numeric",year:e.getFullYear()===r.getFullYear()?void 0:"numeric"}).format(e)}function Ja(e){return new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"}).format(e)}const en={sending:"Sending…",sent:"Sent",delivered:"Delivered",read:"Read"};function tn(){return t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M10 2H5a1.5 1.5 0 0 0-1.5 1.5v11A1.5 1.5 0 0 0 5 16h8a1.5 1.5 0 0 0 1.5-1.5V6.5L10 2z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),t.jsx("path",{d:"M10 2v4.5h4.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})]})}function rn({attachment:e}){const{kind:r,url:a,name:n,size:o}=e;return r==="image"?t.jsx("a",{className:"vyre-conversation__att vyre-conversation__att--image",href:a,target:"_blank",rel:"noopener noreferrer",children:t.jsx("img",{src:a,alt:n??"image attachment",loading:"lazy"})}):r==="audio"?t.jsx("audio",{className:"vyre-conversation__att vyre-conversation__att--audio",src:a,controls:!0,preload:"none"}):r==="video"?t.jsx("video",{className:"vyre-conversation__att vyre-conversation__att--video",src:a,controls:!0,preload:"none"}):t.jsxs("a",{className:"vyre-conversation__att vyre-conversation__att--file",href:a,target:"_blank",rel:"noopener noreferrer",download:n,children:[t.jsx("span",{className:"vyre-conversation__att-icon",children:t.jsx(tn,{})}),t.jsxs("span",{className:"vyre-conversation__att-info",children:[t.jsx("span",{className:"vyre-conversation__att-name",children:n??"Attachment"}),o&&t.jsx("span",{className:"vyre-conversation__att-size",children:o})]})]})}const gr=s.forwardRef(({value:e,currentUserId:r,composer:a=!1,onSend:n,placeholder:o="Write a message…",typing:i=!1,allowAttachments:l=!1,accept:d,renderMessage:c,renderComposer:f,className:p,...y},h)=>{const[m,u]=s.useState(""),[v,x]=s.useState([]),g=s.useRef(null),j=()=>{const w=m.trim();!w&&v.length===0||(n==null||n(w,v),u(""),x([]))},_=s.useMemo(()=>e.map((w,M)=>{const E=e[M-1],S=e[M+1],k=Me(w.timestamp),I=E?Me(E.timestamp):null,R=!!k&&(!I||!me(k,I)),C=!E||E.authorId!==w.authorId||R,N=!S||S.authorId!==w.authorId,D=w.authorId===r;return{msg:w,date:k,showDaySeparator:R,isGroupStart:C,isGroupEnd:N,outgoing:D}}),[e,r]),L={value:m,setValue:u,files:v,setFiles:x,send:j};return t.jsxs("div",{ref:h,className:b("vyre-conversation",p),...y,children:[t.jsxs("div",{className:"vyre-conversation__thread",role:"log","aria-label":"Conversation","aria-live":"polite",children:[_.map(({msg:w,date:M,showDaySeparator:E,isGroupStart:S,isGroupEnd:k,outgoing:I})=>t.jsxs(s.Fragment,{children:[E&&M&&t.jsx("div",{className:"vyre-conversation__day",role:"separator",children:t.jsx("span",{children:Qa(M)})}),t.jsxs("div",{className:b("vyre-conversation__row",I?"vyre-conversation__row--out":"vyre-conversation__row--in",k&&"vyre-conversation__row--group-end"),children:[t.jsx("div",{className:"vyre-conversation__avatar",children:!I&&k&&t.jsx(pe,{size:"sm",src:w.authorAvatar,fallback:(w.authorName??w.authorId).slice(0,1).toUpperCase(),alt:w.authorName??w.authorId})}),t.jsxs("div",{className:"vyre-conversation__stack",children:[!I&&S&&w.authorName&&t.jsx("span",{className:"vyre-conversation__author",children:w.authorName}),t.jsx("div",{className:"vyre-conversation__bubble",children:c?c(w,{outgoing:I,isGroupStart:S,isGroupEnd:k}):t.jsxs(t.Fragment,{children:[w.attachments&&w.attachments.length>0&&t.jsx("div",{className:"vyre-conversation__attachments",children:w.attachments.map((R,C)=>t.jsx(rn,{attachment:R},C))}),w.text]})}),k&&t.jsxs("span",{className:"vyre-conversation__meta",children:[M&&Ja(M),I&&w.status&&t.jsxs("span",{className:b("vyre-conversation__status",`vyre-conversation__status--${w.status}`),children:[M?" · ":"",en[w.status]]})]})]})]})]},w.id)),i&&t.jsxs("div",{className:"vyre-conversation__row vyre-conversation__row--in",children:[t.jsx("div",{className:"vyre-conversation__avatar"}),t.jsx("div",{className:"vyre-conversation__stack",children:t.jsxs("div",{className:"vyre-conversation__bubble vyre-conversation__bubble--typing",children:[t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),typeof i=="string"&&t.jsx("span",{className:"vyre-conversation__typing-label",children:i})]})})]})]}),f?f(L):a&&t.jsxs("form",{className:"vyre-conversation__composer",onSubmit:w=>{w.preventDefault(),j()},children:[l&&v.length>0&&t.jsx("div",{className:"vyre-conversation__staged",children:v.map((w,M)=>t.jsxs("span",{className:"vyre-conversation__chip",children:[t.jsx("span",{className:"vyre-conversation__chip-name",children:w.name}),t.jsx("button",{type:"button",className:"vyre-conversation__chip-remove","aria-label":`Remove ${w.name}`,onClick:()=>x(v.filter((E,S)=>S!==M)),children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]},M))}),t.jsxs("div",{className:"vyre-conversation__composer-row",children:[l&&t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:g,type:"file",multiple:!0,accept:d,className:"vyre-conversation__file-input",onChange:w=>{const M=Array.from(w.target.files??[]);M.length&&x([...v,...M]),w.target.value=""}}),t.jsx("button",{type:"button",className:"vyre-conversation__attach","aria-label":"Attach files",onClick:()=>{var w;return(w=g.current)==null?void 0:w.click()},children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13.5 6.5l-5.6 5.6a2.5 2.5 0 0 1-3.5-3.5l6-6a3.5 3.5 0 0 1 5 5l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsx("input",{className:"vyre-conversation__input",value:m,onChange:w=>u(w.target.value),placeholder:o,"aria-label":"Message"}),t.jsx("button",{type:"submit",className:"vyre-conversation__send",disabled:!m.trim()&&v.length===0,"aria-label":"Send message",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 8l12-5-4.5 12L7 9.5 2 8z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})})]})]})]})});gr.displayName="VyreConversation";const jr=s.forwardRef(({as:e="p",size:r="md",weight:a,color:n="default",truncate:o,mono:i,className:l,children:d,...c},f)=>t.jsx(e,{ref:f,className:b("vyre-text",r!=="md"&&`vyre-text--${r}`,a&&`vyre-text--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",l),...c,children:d}));jr.displayName="VyreText";const wr=s.forwardRef(({as:e="h2",size:r="md",weight:a="bold",color:n="default",truncate:o,className:i,children:l,...d},c)=>t.jsx(e,{ref:c,className:b("vyre-heading",`vyre-heading--${r}`,a!=="bold"&&`vyre-heading--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i),...d,children:l}));wr.displayName="VyreHeading";const Nr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:b("vyre-lead",e),...a,children:r}));Nr.displayName="VyreLead";const kr=s.forwardRef(({block:e,className:r,children:a,...n},o)=>e?t.jsx("pre",{className:b("vyre-code-block",r),...n,children:t.jsx("code",{ref:o,children:a})}):t.jsx("code",{ref:o,className:b("vyre-code",r),...n,children:a}));kr.displayName="VyreCode";const Cr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("blockquote",{ref:n,className:b("vyre-blockquote",e),...a,children:r}));Cr.displayName="VyreBlockquote";const $=e=>e==null||e===!1?void 0:String(e),an={none:"var(--vyre-spacing-0)",xs:"var(--vyre-spacing-2)",sm:"var(--vyre-spacing-3)",md:"var(--vyre-spacing-4)",lg:"var(--vyre-spacing-6)",xl:"var(--vyre-spacing-8)","2xl":"var(--vyre-spacing-12)"},nn=e=>e==="auto"||e==="content"?e:e==="0"?"0":an[e],Rr=s.forwardRef(({as:e="div",direction:r="row",inline:a=!1,gap:n="md",rowGap:o,columnGap:i,align:l="stretch",justify:d="start",alignContent:c,alignSelf:f,wrap:p="nowrap",grow:y,shrink:h,basis:m,width:u,height:v,className:x,children:g,...j},_)=>{const L=e,{style:w,...M}=j;return t.jsx(L,{ref:_,className:b("vyre-stack",x),"data-inline":a?"":void 0,"data-w":u,"data-h":v,"data-direction":r,"data-gap":n,"data-row-gap":o,"data-column-gap":i,"data-align":l,"data-justify":d,"data-align-content":c,"data-align-self":f,"data-wrap":p===!0?"wrap":p===!1?"nowrap":p,...M,style:{...y!==void 0?{flexGrow:y}:null,...h!==void 0?{flexShrink:h}:null,...m!==void 0?{"--vyre-stack-basis":nn(m)}:null,...w},children:g})});Rr.displayName="VyreStack";const Sr=s.forwardRef(({as:e="div",columns:r=1,rows:a,flow:n,gap:o="md",rowGap:i,columnGap:l,align:d="stretch",justify:c,width:f,height:p,className:y,children:h,...m},u)=>{const v=e,x=r==="auto-fit",{style:g,...j}=m;return t.jsx(v,{ref:u,className:b("vyre-grid",y),"data-w":f,"data-h":p,"data-columns":x?"auto-fit":void 0,"data-rows":a!==void 0?"":void 0,"data-flow":n,"data-gap":o,"data-row-gap":i,"data-column-gap":l,"data-align":d,"data-justify":c,...j,style:{...x?null:{"--vyre-grid-columns":String(r)},...a!==void 0&&a!=="auto"?{"--vyre-grid-rows":String(a)}:null,...g},children:h})});Sr.displayName="VyreGrid";const Lr=s.forwardRef(({as:e="div",colSpan:r,rowSpan:a,colStart:n,rowStart:o,className:i,children:l,...d},c)=>{const f=e,{style:p,...y}=d;return t.jsx(f,{ref:c,className:b("vyre-grid-item",i),"data-col-span":$(r),"data-row-span":$(a),"data-col-start":$(n),"data-row-start":$(o),...y,style:{...r!==void 0?{"--vyre-grid-item-col-span":String(r)}:null,...a!==void 0?{"--vyre-grid-item-row-span":String(a)}:null,...n!==void 0?{"--vyre-grid-item-col-start":String(n)}:null,...o!==void 0?{"--vyre-grid-item-row-start":String(o)}:null,...p},children:l})});Lr.displayName="VyreGridItem";const Dr=s.forwardRef(({as:e="div",padding:r,paddingX:a,paddingY:n,paddingTop:o,paddingRight:i,paddingBottom:l,paddingLeft:d,margin:c,marginX:f,marginY:p,marginTop:y,marginRight:h,marginBottom:m,marginLeft:u,width:v,height:x,className:g,children:j,..._},L)=>{const w=e;return t.jsx(w,{ref:L,className:b("vyre-box",g),"data-w":$(v),"data-h":$(x),"data-p":$(r),"data-px":$(a),"data-py":$(n),"data-pt":$(o),"data-pr":$(i),"data-pb":$(l),"data-pl":$(d),"data-m":$(c),"data-mx":$(f),"data-my":$(p),"data-mt":$(y),"data-mr":$(h),"data-mb":$(m),"data-ml":$(u),..._,children:j})});Dr.displayName="VyreBox";const Ir=s.createContext(null),sn=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Te(e,r,a){if(!r)return null;const n=e==null||e===""||Array.isArray(e)&&e.length===0;if(r.required&&n)return typeof r.required=="string"?r.required:"This field is required";if(n)return r.validate?r.validate(e,a)??null:null;const o=typeof e=="string"?e:String(e);return r.minLength!==void 0&&o.length<r.minLength?`Must be at least ${r.minLength} characters`:r.maxLength!==void 0&&o.length>r.maxLength?`Must be at most ${r.maxLength} characters`:r.email&&!sn.test(o)?"Enter a valid email address":r.pattern&&!r.pattern.test(o)?"Invalid format":r.min!==void 0&&Number(e)<r.min?`Must be at least ${r.min}`:r.max!==void 0&&Number(e)>r.max?`Must be at most ${r.max}`:r.validate?r.validate(e,a)??null:null}const Mr=s.forwardRef(({values:e,defaultValues:r,onChange:a,onSubmit:n,onInvalid:o,className:i,children:l,...d},c)=>{const f=e!==void 0,[p,y]=s.useState(r??{}),h=f?e:p,m=s.useRef(h);m.current=h;const u=s.useRef(new Map),[v,x]=s.useState({}),[g,j]=s.useState(!1),_=s.useCallback((E,S)=>{const k={...m.current,[E]:S};f||y(k),a==null||a(k)},[f,a]),L=s.useCallback(()=>{const E={};return u.current.forEach((S,k)=>{const I=Te(m.current[k],S,m.current);I&&(E[k]=I)}),E},[]),w=s.useMemo(()=>({getValue:E=>m.current[E],setValue:_,registerField:(E,S)=>{u.current.set(E,S)},unregisterField:E=>{u.current.delete(E)},getError:E=>v[E],validateField:E=>{if(!g)return;const S=Te(m.current[E],u.current.get(E),m.current);x(k=>{const I={...k};return S?I[E]=S:delete I[E],I})},submitted:g}),[_,v,g]),M=E=>{E.preventDefault(),j(!0);const S=L();if(x(S),Object.keys(S).length>0){o==null||o(S);return}n==null||n(m.current)};return t.jsx(Ir.Provider,{value:w,children:t.jsx("form",{ref:c,noValidate:!0,className:b("vyre-form",i),onSubmit:M,...d,children:l})})});Mr.displayName="VyreForm";const Tr=({name:e,label:r,hint:a,rules:n,children:o,className:i})=>{const l=s.useContext(Ir);if(!l)throw new Error("FormField must be used inside a <Form>");s.useEffect(()=>(l.registerField(e,n),()=>l.unregisterField(e)));const d=l.getError(e),c=l.getValue(e),f=s.Children.only(o),p=s.cloneElement(f,{name:e,value:c??"",onChange:y=>{var m,u;const h=y&&typeof y=="object"&&"target"in y?y.target.value:y;l.setValue(e,h),queueMicrotask(()=>l.validateField(e)),(u=(m=f.props).onChange)==null||u.call(m,y)},onBlur:y=>{var h,m;l.validateField(e),(m=(h=f.props).onBlur)==null||m.call(h,y)}});return t.jsx(ye,{label:r,hint:d??a,state:d?"error":"idle",className:b("vyre-form-field",i),children:p})};Tr.displayName="VyreFormField";const Ee=(e,r,a)=>r!==void 0&&e<r?r:a!==void 0&&e>a?a:e,de=(e,r)=>{if(r===void 0)return e;const a=10**r;return Math.round(e*a)/a},Er=s.forwardRef(({value:e,defaultValue:r=null,onChange:a,min:n,max:o,step:i=1,precision:l,size:d="md",disabled:c=!1,readOnly:f=!1,className:p,onBlur:y,onKeyDown:h,...m},u)=>{const v=e!==void 0,[x,g]=s.useState(r),j=v?e:x,[_,L]=s.useState(j==null?"":String(j));s.useEffect(()=>{const N=j==null?"":String(j);L(D=>Number(D)===j&&D!==""?D:N)},[j]);const w=N=>{v||g(N),a==null||a(N)},M=N=>{const D=de(Ee(N,n,o),l);L(String(D)),w(D)},E=(N,D=1)=>{M((j??0)+N*i*D)},S=N=>{const D=N.target.value;if(L(D),D===""||D==="-"){w(null);return}const B=Number(D);Number.isNaN(B)||w(de(B,l))},k=N=>{if(j!=null){const D=de(Ee(j,n,o),l);D!==j?M(D):L(String(D))}else L("");y==null||y(N)},I=N=>{!c&&!f&&(N.key==="ArrowUp"?(N.preventDefault(),E(1,N.shiftKey?10:1)):N.key==="ArrowDown"&&(N.preventDefault(),E(-1,N.shiftKey?10:1))),h==null||h(N)},R=n!==void 0&&j!==null&&(j??0)<=n,C=o!==void 0&&j!==null&&(j??0)>=o;return t.jsxs("div",{className:b("vyre-number-input",`vyre-number-input--${d}`,c&&"vyre-number-input--disabled",p),"data-disabled":c?"":void 0,children:[t.jsx("button",{type:"button",className:"vyre-number-input__btn vyre-number-input__btn--dec","aria-label":"Decrease",tabIndex:-1,disabled:c||f||R,onClick:()=>E(-1),children:t.jsx("span",{"aria-hidden":"true",children:"−"})}),t.jsx("input",{ref:u,type:"text",inputMode:"decimal",role:"spinbutton","aria-valuenow":j??void 0,"aria-valuemin":n,"aria-valuemax":o,className:"vyre-number-input__field",value:_,disabled:c,readOnly:f,onChange:S,onBlur:k,onKeyDown:I,...m}),t.jsx("button",{type:"button",className:"vyre-number-input__btn vyre-number-input__btn--inc","aria-label":"Increase",tabIndex:-1,disabled:c||f||C,onClick:()=>E(1),children:t.jsx("span",{"aria-hidden":"true",children:"+"})})]})});Er.displayName="VyreNumberInput";const Ar=s.createContext(null),Br=s.forwardRef((e,r)=>{const{options:a,size:n="md",disabled:o=!1,orientation:i="horizontal",className:l,children:d,...c}=e,f=e.type==="multiple",h={isSelected:m=>f?Array.isArray(e.value)&&e.value.includes(m):e.value===m,toggle:m=>{var u,v;if(f){const x=Array.isArray(e.value)?e.value:[],g=x.includes(m)?x.filter(j=>j!==m):[...x,m];(u=e.onChange)==null||u.call(e,g)}else{const x=e.value===m?null:m;(v=e.onChange)==null||v.call(e,x)}},size:n,groupDisabled:o};return t.jsx(Ar.Provider,{value:h,children:t.jsx("div",{ref:r,role:f?"group":"radiogroup","aria-orientation":i,"data-orientation":i,className:b("vyre-toggle-group",`vyre-toggle-group--${n}`,o&&"vyre-toggle-group--disabled",l),...c,children:a?a.map(m=>t.jsx(je,{value:m.value,disabled:m.disabled,icon:m.icon,children:m.label??m.value},m.value)):d})})});Br.displayName="VyreToggleGroup";const je=s.forwardRef(({value:e,icon:r,disabled:a=!1,className:n,children:o,onClick:i,...l},d)=>{const c=s.useContext(Ar);if(!c)throw new Error("ToggleItem must be used inside a <ToggleGroup>");const f=c.isSelected(e),p=a||c.groupDisabled,y=h=>{var v,x,g;const m=Array.from(((v=h.currentTarget.parentElement)==null?void 0:v.querySelectorAll(".vyre-toggle-item:not(:disabled)"))??[]),u=m.indexOf(h.currentTarget);h.key==="ArrowRight"||h.key==="ArrowDown"?(h.preventDefault(),(x=m[(u+1)%m.length])==null||x.focus()):(h.key==="ArrowLeft"||h.key==="ArrowUp")&&(h.preventDefault(),(g=m[(u-1+m.length)%m.length])==null||g.focus())};return t.jsxs("button",{ref:d,type:"button","aria-pressed":f,"data-state":f?"on":"off",disabled:p,className:b("vyre-toggle-item",f&&"vyre-toggle-item--selected",n),onClick:h=>{c.toggle(e),i==null||i(h)},onKeyDown:y,...l,children:[r&&t.jsx("span",{className:"vyre-toggle-item__icon","aria-hidden":"true",children:r}),o]})});je.displayName="VyreToggleItem";const Vr=s.createContext(null);function we(e){const r=s.useContext(Vr);if(!r)throw new Error(`${e} must be used inside <Stepper>`);return r}const $r=s.forwardRef(({value:e,defaultValue:r=0,onChange:a,orientation:n="horizontal",clickable:o=!1,className:i,children:l,...d},c)=>{const f=e!==void 0,[p,y]=s.useState(r),h=f?e:p,m=s.useCallback(x=>{f||y(x),a==null||a(x)},[f,a]);let u=-1;const v=s.Children.map(l,x=>s.isValidElement(x)&&x.type===ke?(u+=1,s.cloneElement(x,{__index:u})):x);return t.jsx(Vr.Provider,{value:{active:h,setActive:m,orientation:n,clickable:o},children:t.jsx("div",{ref:c,className:b("vyre-stepper",`vyre-stepper--${n}`,i),"data-orientation":n,...d,children:v})})});$r.displayName="VyreStepper";const Fr=s.forwardRef(({className:e,children:r,...a},n)=>{const{orientation:o}=we("StepperNav");let i=-1;const l=s.Children.map(r,d=>s.isValidElement(d)&&d.type===Ne?(i+=1,s.cloneElement(d,{__index:i})):d);return t.jsx("div",{ref:n,role:"list","aria-orientation":o,className:b("vyre-stepper__nav",e),...a,children:l})});Fr.displayName="VyreStepperNav";const Ne=s.forwardRef(({label:e,description:r,icon:a,index:n,__index:o=0,className:i,...l},d)=>{const c=n??o,{active:f,setActive:p,clickable:y}=we("Step"),h=c<f?"completed":c===f?"current":"upcoming",m=y&&c<f,u=a??(h==="completed"?"✓":c+1);return t.jsxs("div",{ref:d,role:"listitem","aria-current":h==="current"?"step":void 0,"data-state":h,className:b("vyre-step",`vyre-step--${h}`,m&&"vyre-step--clickable",i),...l,children:[t.jsx("button",{type:"button",className:"vyre-step__indicator",disabled:!m,tabIndex:m?0:-1,"aria-label":typeof e=="string"?e:`Step ${c+1}`,onClick:()=>m&&p(c),children:t.jsx("span",{"aria-hidden":"true",children:u})}),(e||r)&&t.jsxs("span",{className:"vyre-step__text",children:[e&&t.jsx("span",{className:"vyre-step__label",children:e}),r&&t.jsx("span",{className:"vyre-step__description",children:r})]}),t.jsx("span",{className:"vyre-step__connector","aria-hidden":"true"})]})});Ne.displayName="VyreStep";const ke=({className:e,children:r,index:a,__index:n=0})=>{const{active:o}=we("StepPanel");return(a??n)!==o?null:t.jsx("div",{role:"tabpanel",className:b("vyre-step-panel",e),children:r})};ke.displayName="VyreStepPanel";const on=()=>t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M6 13l14-7 14 7v14l-14 7-14-7V13Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),t.jsx("path",{d:"M6 13l14 7 14-7M20 20v14",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})]}),ln=()=>t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"18",cy:"18",r:"11",stroke:"currentColor",strokeWidth:"2"}),t.jsx("path",{d:"M26 26l8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),cn=()=>t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M20 5L37 34H3L20 5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),t.jsx("path",{d:"M20 16v9M20 29v.5",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]}),dn={default:on,search:ln,error:cn},Wr=s.forwardRef(({title:e,description:r,variant:a="default",icon:n,size:o="md",className:i,children:l,...d},c)=>{const f=dn[a];return t.jsxs("div",{ref:c,role:"status","data-variant":a,className:b("vyre-empty-state",`vyre-empty-state--${o}`,i),...d,children:[t.jsx("span",{className:"vyre-empty-state__icon","aria-hidden":"true",children:n??t.jsx(f,{})}),t.jsx("span",{className:"vyre-empty-state__title",children:e}),r&&t.jsx("span",{className:"vyre-empty-state__description",children:r}),l&&t.jsx("div",{className:"vyre-empty-state__action",children:l})]})});Wr.displayName="VyreEmptyState";const un=e=>{if(e==null)return"flat";if(typeof e=="number")return e>0?"up":e<0?"down":"flat";const r=e.trim();if(r.startsWith("-")||r.startsWith("−"))return"down";if(r.startsWith("+"))return"up";const a=parseFloat(r.replace(/[^0-9.\-]/g,""));return Number.isNaN(a)?"flat":a>0?"up":a<0?"down":"flat"},mn=({direction:e})=>{if(e==="flat")return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 6h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})});const r=e==="up";return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:r?"M6 2.5L10 7H2L6 2.5Z":"M6 9.5L2 5h8L6 9.5Z",fill:"currentColor"})})},Pr=s.forwardRef(({label:e,value:r,delta:a,trend:n="neutral",deltaLabel:o,icon:i,size:l="md",className:d,...c},f)=>t.jsxs("div",{ref:f,className:b("vyre-stat",`vyre-stat--${l}`,d),...c,children:[i&&t.jsx("span",{className:"vyre-stat__icon","aria-hidden":"true",children:i}),t.jsxs("div",{className:"vyre-stat__body",children:[t.jsx("span",{className:"vyre-stat__label",children:e}),t.jsx("span",{className:"vyre-stat__value",children:r}),a!==void 0&&t.jsxs("span",{className:"vyre-stat__delta","data-trend":n,children:[t.jsx(mn,{direction:un(a)}),t.jsx("span",{className:"vyre-stat__delta-value",children:a}),o&&t.jsx("span",{className:"vyre-stat__delta-label",children:o})]})]})]}));Pr.displayName="VyreStat";const Hr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,role:"group",className:b("vyre-stat-group",e),...a,children:r}));Hr.displayName="VyreStatGroup";const Gr=s.forwardRef(({items:e,className:r,children:a,...n},o)=>t.jsx("ol",{ref:o,className:b("vyre-timeline",r),...n,children:e?e.map((i,l)=>t.jsx(Ce,{title:i.title,time:i.time,status:i.status,icon:i.icon,children:i.description},l)):a}));Gr.displayName="VyreTimeline";const Ce=s.forwardRef(({title:e,time:r,status:a="default",icon:n,className:o,children:i,...l},d)=>t.jsxs("li",{ref:d,className:b("vyre-timeline-item",o),"data-status":a,...l,children:[t.jsxs("span",{className:"vyre-timeline-item__marker","aria-hidden":"true",children:[n?t.jsx("span",{className:"vyre-timeline-item__icon",children:n}):t.jsx("span",{className:"vyre-timeline-item__dot"}),t.jsx("span",{className:"vyre-timeline-item__connector"})]}),t.jsxs("div",{className:"vyre-timeline-item__body",children:[t.jsxs("div",{className:"vyre-timeline-item__head",children:[t.jsx("span",{className:"vyre-timeline-item__title",children:e}),r!==void 0&&t.jsx("span",{className:"vyre-timeline-item__time",children:r})]}),i&&t.jsx("div",{className:"vyre-timeline-item__content",children:i})]})]}));Ce.displayName="VyreTimelineItem";const vn=({open:e})=>t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"vyre-tree__chevron","data-open":e?"":void 0,children:t.jsx("path",{d:"M4.5 3l3 3-3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Or=s.createContext(null),qr=s.forwardRef(({data:e,expandedIds:r,defaultExpandedIds:a=[],onExpandedChange:n,selectedId:o,defaultSelectedId:i=null,onSelect:l,className:d,...c},f)=>{const p=r!==void 0,y=o!==void 0,[h,m]=s.useState(a),[u,v]=s.useState(i),x=s.useMemo(()=>new Set(p?r:h),[p,r,h]),g=y?o:u,j=s.useCallback(L=>{const w=new Set(x);w.has(L)?w.delete(L):w.add(L);const M=[...w];p||m(M),n==null||n(M)},[x,p,n]),_=s.useCallback(L=>{y||v(L),l==null||l(L)},[y,l]);return t.jsx(Or.Provider,{value:{expanded:x,toggle:j,selectedId:g,select:_},children:t.jsx("ul",{ref:f,role:"tree",className:b("vyre-tree",d),...c,children:e.map(L=>t.jsx(Kr,{node:L,level:0},L.id))})})});qr.displayName="VyreTree";function Ae(e,r){var i;const a=e.closest(".vyre-tree");if(!a)return;const n=Array.from(a.querySelectorAll('.vyre-tree__row:not([aria-disabled="true"])')).filter(l=>l.offsetParent!==null),o=n.indexOf(e);(i=n[o+r])==null||i.focus()}const Kr=({node:e,level:r})=>{const a=s.useContext(Or),n=!!e.children&&e.children.length>0,o=a.expanded.has(e.id),i=a.selectedId===e.id,l=()=>{e.disabled||(n&&a.toggle(e.id),a.select(e.id))},d=c=>{switch(c.key){case"ArrowDown":c.preventDefault(),Ae(c.currentTarget,1);break;case"ArrowUp":c.preventDefault(),Ae(c.currentTarget,-1);break;case"ArrowRight":n&&!o&&(c.preventDefault(),a.toggle(e.id));break;case"ArrowLeft":n&&o&&(c.preventDefault(),a.toggle(e.id));break;case"Enter":case" ":c.preventDefault(),l();break}};return t.jsxs("li",{role:"treeitem","aria-expanded":n?o:void 0,"aria-selected":i,className:"vyre-tree__item",children:[t.jsxs("div",{role:"button",tabIndex:e.disabled?-1:0,"aria-disabled":e.disabled||void 0,"data-selected":i?"":void 0,className:"vyre-tree__row",style:{paddingLeft:`calc(${r} * var(--vyre-spacing-5))`},onClick:l,onKeyDown:d,children:[t.jsx("span",{className:"vyre-tree__chevron-slot",children:n?t.jsx(vn,{open:o}):null}),e.icon&&t.jsx("span",{className:"vyre-tree__icon","aria-hidden":"true",children:e.icon}),t.jsx("span",{className:"vyre-tree__label",children:e.label})]}),n&&o&&t.jsx("ul",{role:"group",className:"vyre-tree__group",children:e.children.map(c=>t.jsx(Kr,{node:c,level:r+1},c.id))})]})},ue=(e,r)=>r==="numeric"?e.replace(/[^0-9]/g,""):e.replace(/[^0-9a-zA-Z]/g,""),Yr=s.forwardRef(({value:e,defaultValue:r="",onChange:a,onComplete:n,length:o=6,type:i="numeric",mask:l=!1,size:d="md",disabled:c=!1,autoFocus:f=!1,name:p,onBlur:y,className:h},m)=>{const u=e!==void 0,[v,x]=s.useState(r),g=(u?e:v).slice(0,o),j=s.useRef([]),_=s.useRef(!1),L=k=>{const I=ue(k,i).slice(0,o);u||x(I),a==null||a(I);const R=I.length===o;R&&!_.current&&(n==null||n(I)),_.current=R},w=k=>{const I=j.current[Math.max(0,Math.min(k,o-1))];I==null||I.focus(),I==null||I.select()},M=(k,I)=>{const R=ue(I,i);if(!R)return;const C=g.split("");C[k]=R[R.length-1];const N=C.join("").slice(0,o);L(N),w(k+1)},E=(k,I)=>{if(I.key==="Backspace"){I.preventDefault();const R=g.split("");R[k]?(R[k]="",L(R.join(""))):k>0&&(R[k-1]="",L(R.join("")),w(k-1))}else I.key==="ArrowLeft"?(I.preventDefault(),w(k-1)):I.key==="ArrowRight"&&(I.preventDefault(),w(k+1))},S=(k,I)=>{I.preventDefault();const R=ue(I.clipboardData.getData("text"),i);if(!R)return;const C=g.split("");for(let D=0;D<R.length&&k+D<o;D++)C[k+D]=R[D];const N=C.join("").slice(0,o);L(N),w(Math.min(k+R.length,o-1))};return t.jsx("div",{ref:m,className:b("vyre-otp",`vyre-otp--${d}`,c&&"vyre-otp--disabled",h),role:"group","aria-label":"One-time code",children:Array.from({length:o}).map((k,I)=>t.jsx("input",{ref:R=>{j.current[I]=R},className:"vyre-otp__slot",type:l?"password":"text",inputMode:i==="numeric"?"numeric":"text",autoComplete:I===0?"one-time-code":"off",maxLength:1,disabled:c,autoFocus:f&&I===0,name:I===0?p:void 0,"aria-label":`Digit ${I+1}`,value:g[I]??"",onChange:R=>M(I,R.target.value),onKeyDown:R=>E(I,R),onPaste:R=>S(I,R),onFocus:R=>R.target.select(),onBlur:y},I))})});Yr.displayName="VyreOTPInput";const Re=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:b("vyre-carousel__slide",e),...a,children:r}));Re.displayName="VyreCarouselSlide";const Be=({dir:e})=>t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:e==="prev"?"M10 3L5 8l5 5":"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),Ur=s.forwardRef(({value:e,defaultValue:r=0,onChange:a,loop:n=!1,autoPlay:o=!1,interval:i=5e3,showArrows:l=!0,showIndicators:d=!0,className:c,children:f,"aria-label":p="Carousel",...y},h)=>{const m=s.Children.toArray(f).filter(S=>s.isValidElement(S)&&S.type===Re),u=m.length,v=e!==void 0,[x,g]=s.useState(r),j=Math.min(Math.max(v?e:x,0),Math.max(u-1,0)),_=s.useRef(null),[L,w]=s.useState(!1),M=s.useCallback(S=>{let k=S;k<0?k=n?u-1:0:k>u-1&&(k=n?0:u-1),v||g(k),a==null||a(k)},[u,n,v,a]);s.useEffect(()=>{const S=_.current;if(!S)return;const k=S.children[j];k&&S.scrollTo({left:k.offsetLeft-S.offsetLeft,behavior:"smooth"})},[j]),s.useEffect(()=>{if(!o||L||u<2)return;const S=window.setInterval(()=>M(j+1>u-1?n?0:j:j+1),i);return()=>window.clearInterval(S)},[o,L,u,j,i,n,M]);const E=S=>{S.key==="ArrowLeft"?(S.preventDefault(),M(j-1)):S.key==="ArrowRight"&&(S.preventDefault(),M(j+1))};return t.jsxs("div",{ref:h,className:b("vyre-carousel",c),role:"region","aria-roledescription":"carousel","aria-label":p,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),onFocusCapture:()=>w(!0),onBlurCapture:()=>w(!1),onKeyDown:E,...y,children:[t.jsxs("div",{className:"vyre-carousel__viewport",children:[t.jsx("div",{ref:_,className:"vyre-carousel__track",tabIndex:0,"aria-live":o?"off":"polite",children:m.map((S,k)=>t.jsx(s.Fragment,{children:s.cloneElement(S,{"aria-hidden":k!==j||void 0,"aria-label":`${k+1} of ${u}`})},k))}),l&&u>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"vyre-carousel__arrow vyre-carousel__arrow--prev","aria-label":"Previous slide",disabled:!n&&j===0,onClick:()=>M(j-1),children:t.jsx(Be,{dir:"prev"})}),t.jsx("button",{type:"button",className:"vyre-carousel__arrow vyre-carousel__arrow--next","aria-label":"Next slide",disabled:!n&&j===u-1,onClick:()=>M(j+1),children:t.jsx(Be,{dir:"next"})})]})]}),d&&u>1&&t.jsx("div",{className:"vyre-carousel__indicators",role:"tablist",children:m.map((S,k)=>t.jsx("button",{type:"button",role:"tab","aria-label":`Go to slide ${k+1}`,"aria-selected":k===j,"data-active":k===j?"":void 0,className:"vyre-carousel__dot",onClick:()=>M(k)},k))})]})});Ur.displayName="VyreCarousel";const zr=s.createContext({collapsed:!1,toggleCollapsed:()=>{}}),oe=()=>s.useContext(zr),Xr=s.forwardRef(({defaultCollapsed:e=!1,collapsed:r,onCollapsedChange:a,className:n,children:o},i)=>{const[l,d]=s.useState(e),c=r!==void 0?r:l,f=s.useCallback(()=>{const p=!c;d(p),a==null||a(p)},[c,a]);return t.jsx(zr.Provider,{value:{collapsed:c,toggleCollapsed:f},children:t.jsx("div",{ref:i,className:b("vyre-app-layout",n),children:o})})});Xr.displayName="VyreAppLayout";const Zr=s.forwardRef(({variant:e="default",className:r,children:a},n)=>{const{collapsed:o}=oe();return t.jsx("aside",{ref:n,className:b("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",r),"data-collapsed":o||void 0,children:a})});Zr.displayName="VyreSidebar";const Qr=s.forwardRef(({logo:e,title:r,className:a,children:n},o)=>t.jsxs("div",{ref:o,className:b("vyre-sidebar__header",a),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),r&&t.jsx("span",{className:"vyre-sidebar__title",children:r}),n]}));Qr.displayName="VyreSidebarHeader";const Jr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:b("vyre-sidebar__content",e),children:r}));Jr.displayName="VyreSidebarContent";const ea=s.forwardRef(({label:e,className:r,children:a},n)=>t.jsxs("div",{ref:n,className:b("vyre-sidebar__section",r),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),a]}));ea.displayName="VyreSidebarSection";const ta=({active:e,icon:r,badge:a,href:n,onClick:o,className:i,children:l})=>{const{collapsed:d}=oe(),c=b("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),f=t.jsxs(t.Fragment,{children:[r&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:r}),t.jsx("span",{className:"vyre-sidebar__item-label",children:l}),a!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:a})]});return n?t.jsx("a",{href:n,className:c,"aria-current":e?"page":void 0,title:d?String(l):void 0,children:f}):t.jsx("button",{type:"button",className:c,onClick:o,"aria-pressed":e,title:d?String(l):void 0,children:f})};ta.displayName="VyreSidebarItem";const ra=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:b("vyre-sidebar__footer",e),children:r}));ra.displayName="VyreSidebarFooter";const aa=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:b("vyre-app-shell",e),children:r}));aa.displayName="VyreAppShell";const na=s.forwardRef(({className:e,children:r},a)=>t.jsx("header",{ref:a,className:b("vyre-app-bar",e),children:r}));na.displayName="VyreAppBar";const fn=t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"4",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"7.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"10.5",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"})]}),sa=({className:e,icon:r,collapsedIcon:a})=>{const{collapsed:n,toggleCollapsed:o}=oe(),i=r??fn,l=a??i;return t.jsx("button",{type:"button",className:b("vyre-sidebar-trigger",e),onClick:o,"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-expanded":!n,children:n?l:i})};sa.displayName="VyreSidebarTrigger";const oa=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:b("vyre-page-content",e),children:r}));oa.displayName="VyrePageContent";exports.Accordion=dt;exports.AccordionContent=vt;exports.AccordionItem=ut;exports.AccordionTrigger=mt;exports.Alert=Et;exports.AlertDialog=At;exports.AppBar=na;exports.AppLayout=Xr;exports.AppShell=aa;exports.Avatar=pe;exports.Badge=$e;exports.Blockquote=Cr;exports.Box=Dr;exports.Breadcrumb=Wt;exports.BreadcrumbItem=Pt;exports.BreadcrumbLink=Ht;exports.BreadcrumbSeparator=Gt;exports.Button=Ve;exports.ButtonGroup=or;exports.Calendar=te;exports.Card=ve;exports.CardBody=fe;exports.CardFooter=We;exports.CardHeader=Fe;exports.Carousel=Ur;exports.CarouselSlide=Re;exports.Checkbox=ft;exports.Code=kr;exports.Combobox=lr;exports.Command=_e;exports.CommandDialog=sr;exports.CommandEmpty=tr;exports.CommandGroup=rr;exports.CommandInput=Jt;exports.CommandItem=ar;exports.CommandList=er;exports.CommandSeparator=nr;exports.Conversation=gr;exports.DataGrid=cr;exports.DatePicker=ur;exports.DateRangePicker=mr;exports.DropdownCheckboxItem=St;exports.DropdownItem=Rt;exports.DropdownLabel=Ct;exports.DropdownMenu=kt;exports.DropdownRadioGroup=Lt;exports.DropdownRadioItem=Dt;exports.DropdownSeparator=Mt;exports.DropdownSub=It;exports.EmptyState=Wr;exports.Field=ye;exports.FieldDescription=He;exports.FieldError=Ge;exports.FieldGroup=Oe;exports.FieldLabel=Pe;exports.FieldSet=qe;exports.Form=Mr;exports.FormField=Tr;exports.Grid=Sr;exports.GridItem=Lr;exports.Heading=wr;exports.Input=Ke;exports.Item=vr;exports.ItemActions=br;exports.ItemContent=hr;exports.ItemDescription=xr;exports.ItemGroup=fr;exports.ItemMedia=yr;exports.ItemTitle=pr;exports.Kanban=_r;exports.Label=jt;exports.Lead=Nr;exports.Modal=Ue;exports.ModalBody=Xe;exports.ModalFooter=Ze;exports.ModalHeader=ze;exports.NumberInput=Er;exports.OTPInput=Yr;exports.PageContent=oa;exports.Pagination=Ot;exports.Popover=wt;exports.Progress=_t;exports.Radio=xe;exports.RadioGroup=ht;exports.RichTextEditor=pt;exports.Select=Je;exports.Separator=gt;exports.Sheet=Bt;exports.SheetBody=$t;exports.SheetFooter=Ft;exports.SheetHeader=Vt;exports.Sidebar=Zr;exports.SidebarContent=Jr;exports.SidebarFooter=ra;exports.SidebarHeader=Qr;exports.SidebarItem=ta;exports.SidebarSection=ea;exports.SidebarTrigger=sa;exports.Skeleton=be;exports.Slider=bt;exports.Stack=Rr;exports.Stat=Pr;exports.StatGroup=Hr;exports.Step=Ne;exports.StepPanel=ke;exports.Stepper=$r;exports.StepperNav=Fr;exports.Switch=xt;exports.Tab=nt;exports.TabList=at;exports.TabPanel=ot;exports.TabPanels=st;exports.Table=qt;exports.TableBody=Yt;exports.TableCaption=Zt;exports.TableCell=Xt;exports.TableHead=Kt;exports.TableHeader=zt;exports.TableRow=Ut;exports.Tabs=rt;exports.Tag=ge;exports.TagGroup=dr;exports.TagsInput=ir;exports.Text=jr;exports.Textarea=Ye;exports.Timeline=Gr;exports.TimelineItem=Ce;exports.ToastProvider=ha;exports.ToggleGroup=Br;exports.ToggleItem=je;exports.Tooltip=it;exports.Tree=qr;exports.cn=b;exports.useAppLayout=oe;exports.useToast=pa;