@editora/ui-react 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/package.json +11 -3
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),V=require("@editora/ui-core");function Rt(w){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const r in w)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(w,r);Object.defineProperty(f,r,s.get?s:{enumerable:!0,get:()=>w[r]})}}return f.default=w,Object.freeze(f)}const K=Rt(e);function Ht(w){const{children:f,onClick:r,variant:s,size:n,icon:c,loading:m,block:l,headless:i,disabled:d,animation:v,theme:u,...y}=w,p=e.useRef(null),g=typeof window<"u"?e.useLayoutEffect:e.useEffect;e.useEffect(()=>{const b=p.current;if(!b)return;const E=t=>r&&r(t);return r&&b.addEventListener("click",E),()=>{r&&b.removeEventListener("click",E)}},[r]),g(()=>{const b=p.current;b&&(s?b.setAttribute("variant",s):b.removeAttribute("variant"),n?b.setAttribute("size",n):b.removeAttribute("size"),c?b.setAttribute("icon",c):b.removeAttribute("icon"),m?b.setAttribute("loading",""):b.removeAttribute("loading"),l?b.setAttribute("block",""):b.removeAttribute("block"),i?b.setAttribute("headless",""):b.removeAttribute("headless"),d?b.setAttribute("disabled",""):b.removeAttribute("disabled"),v?b.setAttribute("animation",v):b.removeAttribute("animation"),u&&u!=="default"?b.setAttribute("theme",u):b.removeAttribute("theme"))},[s,n,c,m,l,i,d,v,u]);const A={ref:p,...y,variant:s,size:n,icon:c,animation:v,theme:u&&u!=="default"?u:void 0,loading:m?"":void 0,block:l?"":void 0,headless:i?"":void 0,disabled:d?"":void 0};return e.createElement("ui-button",A,f)}const de=e.forwardRef(function({children:f,text:r,placement:s,open:n,disabled:c,headless:m,variant:l,size:i,tone:d,delay:v,closeDelay:u,trigger:y,offset:p,interactive:g,arrow:A,onOpen:b,onClose:E,onOpenChange:t,...o},h){const L=e.useRef(null);return e.useImperativeHandle(h,()=>L.current),e.useEffect(()=>{const H=L.current;if(!H)return;const a=()=>{b==null||b()},k=()=>{E==null||E()},R=P=>{const F=P.detail;F&&typeof F.open=="boolean"&&(t==null||t(F.open))};return H.addEventListener("open",a),H.addEventListener("close",k),H.addEventListener("change",R),()=>{H.removeEventListener("open",a),H.removeEventListener("close",k),H.removeEventListener("change",R)}},[b,E,t]),e.useEffect(()=>{const H=L.current;if(!H)return;const a=(R,P)=>{const F=H.getAttribute(R);if(P==null){F!=null&&H.removeAttribute(R);return}F!==P&&H.setAttribute(R,P)},k=(R,P)=>{P?a(R,""):a(R,null)};a("text",r||null),a("placement",s||null),k("open",n),k("disabled",c),k("headless",m),a("variant",l&&l!=="default"?l:null),a("size",i&&i!=="md"?i:null),a("tone",d&&d!=="default"?d:null),a("delay",typeof v=="number"&&Number.isFinite(v)?String(v):null),a("close-delay",typeof u=="number"&&Number.isFinite(u)?String(u):null),a("trigger",y||null),a("offset",typeof p=="number"&&Number.isFinite(p)?String(p):null),k("interactive",g),typeof A=="boolean"?a("arrow",A?"true":"false"):a("arrow",null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A]),e.createElement("ui-tooltip",{ref:L,...o},f)});de.displayName="Tooltip";function Nt(w){const{title:f,description:r,tone:s,variant:n,layout:c,dismissible:m,open:l,headless:i,onClose:d,children:v,...u}=w,y=e.useRef(null);return e.useEffect(()=>{const p=y.current;if(!p)return;const g=()=>d==null?void 0:d();return p.addEventListener("close",g),()=>p.removeEventListener("close",g)},[d]),e.useEffect(()=>{const p=y.current;p&&(f?p.setAttribute("title",f):p.removeAttribute("title"),r?p.setAttribute("description",r):p.removeAttribute("description"),s?p.setAttribute("tone",s):p.removeAttribute("tone"),n?p.setAttribute("variant",n):p.removeAttribute("variant"),c?p.setAttribute("layout",c):p.removeAttribute("layout"),m?p.setAttribute("dismissible",""):p.removeAttribute("dismissible"),i?p.setAttribute("headless",""):p.removeAttribute("headless"),typeof l=="boolean"&&(l?p.removeAttribute("hidden"):p.setAttribute("hidden","")))},[f,r,s,n,c,m,l,i]),e.createElement("ui-alert",{ref:y,...u},v)}const be=e.forwardRef(function({children:f,open:r,placement:s,variant:n,density:c,shape:m,elevation:l,tone:i,closeOnSelect:d,typeahead:v,onOpen:u,onClose:y,onChange:p,onSelect:g,...A},b){const E=e.useRef(null);return e.useImperativeHandle(b,()=>E.current),e.useEffect(()=>{const t=E.current;if(!t)return;const o=()=>u==null?void 0:u(),h=()=>y==null?void 0:y(),L=a=>{var R;const k=(R=a.detail)==null?void 0:R.open;typeof k=="boolean"&&(p==null||p(k))},H=a=>{g==null||g(a.detail||{})};return t.addEventListener("open",o),t.addEventListener("close",h),t.addEventListener("change",L),t.addEventListener("select",H),()=>{t.removeEventListener("open",o),t.removeEventListener("close",h),t.removeEventListener("change",L),t.removeEventListener("select",H)}},[u,y,p,g]),e.useEffect(()=>{const t=E.current;!t||r==null||(r?t.setAttribute("open",""):t.removeAttribute("open"))},[r]),e.useEffect(()=>{const t=E.current;t&&(s?t.setAttribute("placement",s):t.removeAttribute("placement"))},[s]),e.useEffect(()=>{const t=E.current;t&&(n&&n!=="default"?t.setAttribute("variant",n):t.removeAttribute("variant"))},[n]),e.useEffect(()=>{const t=E.current;t&&(c&&c!=="default"?t.setAttribute("density",c):t.removeAttribute("density"))},[c]),e.useEffect(()=>{const t=E.current;t&&(m&&m!=="default"?t.setAttribute("shape",m):t.removeAttribute("shape"))},[m]),e.useEffect(()=>{const t=E.current;t&&(l&&l!=="default"?t.setAttribute("elevation",l):t.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const t=E.current;t&&(i&&i!=="default"&&i!=="brand"?t.setAttribute("tone",i):t.removeAttribute("tone"))},[i]),e.useEffect(()=>{const t=E.current;if(t){if(d==null){t.removeAttribute("close-on-select");return}t.setAttribute("close-on-select",d?"true":"false")}},[d]),e.useEffect(()=>{const t=E.current;if(t){if(v==null){t.removeAttribute("typeahead");return}t.setAttribute("typeahead",v?"true":"false")}},[v]),e.createElement("ui-dropdown",{ref:E,...A},f)});be.displayName="Dropdown";const me=e.forwardRef(function(f,r){const{value:s,onChange:n,onInput:c,onDebouncedInput:m,onClear:l,clearable:i,debounce:d,validation:v,size:u,minlength:y,maxlength:p,readOnly:g,autofocus:A,disabled:b,counter:E,floatingLabel:t,type:o,name:h,required:L,pattern:H,inputMode:a,autoComplete:k,min:R,max:P,step:F,spellCheck:B,placeholder:T,headless:N,variant:I,tone:S,density:x,shape:D,color:q,radius:$,label:j,description:_,children:G,...Q}=f,M=e.useRef(null);return e.useImperativeHandle(r,()=>M.current),e.useEffect(()=>{const J=M.current;if(!J)return;const Z=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(c==null||c(z.value))},Y=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(n==null||n(z.value))},re=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(m==null||m(z.value))},ie=()=>{l==null||l()};return J.addEventListener("input",Z),J.addEventListener("change",Y),J.addEventListener("debounced-input",re),J.addEventListener("clear",ie),()=>{J.removeEventListener("input",Z),J.removeEventListener("change",Y),J.removeEventListener("debounced-input",re),J.removeEventListener("clear",ie)}},[n,c,m,l]),e.useEffect(()=>{const J=M.current;J&&(i?J.setAttribute("clearable",""):J.removeAttribute("clearable"),typeof d=="number"&&Number.isFinite(d)?J.setAttribute("debounce",String(d)):J.removeAttribute("debounce"),v&&v!=="none"?J.setAttribute("validation",v):J.removeAttribute("validation"),u&&u!=="md"&&u!=="2"?J.setAttribute("size",String(u)):J.removeAttribute("size"),typeof y=="number"?J.setAttribute("minlength",String(y)):J.removeAttribute("minlength"),typeof p=="number"?J.setAttribute("maxlength",String(p)):J.removeAttribute("maxlength"),g?J.setAttribute("readonly",""):J.removeAttribute("readonly"),A?J.setAttribute("autofocus",""):J.removeAttribute("autofocus"),b?J.setAttribute("disabled",""):J.removeAttribute("disabled"),E?J.setAttribute("counter",""):J.removeAttribute("counter"),t?J.setAttribute("floating-label",""):J.removeAttribute("floating-label"),o?J.setAttribute("type",o):J.removeAttribute("type"),h?J.setAttribute("name",h):J.removeAttribute("name"),L?J.setAttribute("required",""):J.removeAttribute("required"),H?J.setAttribute("pattern",H):J.removeAttribute("pattern"),a?J.setAttribute("inputmode",a):J.removeAttribute("inputmode"),k?J.setAttribute("autocomplete",k):J.removeAttribute("autocomplete"),R!=null&&R!==""?J.setAttribute("min",String(R)):J.removeAttribute("min"),P!=null&&P!==""?J.setAttribute("max",String(P)):J.removeAttribute("max"),F!=null&&F!==""?J.setAttribute("step",String(F)):J.removeAttribute("step"),typeof B=="boolean"?J.setAttribute("spellcheck",B?"true":"false"):J.removeAttribute("spellcheck"),T?J.setAttribute("placeholder",T):J.removeAttribute("placeholder"),N?J.setAttribute("headless",""):J.removeAttribute("headless"),I&&I!=="classic"?J.setAttribute("variant",I):J.removeAttribute("variant"),S&&S!=="default"?J.setAttribute("tone",S):J.removeAttribute("tone"),x&&x!=="default"?J.setAttribute("density",x):J.removeAttribute("density"),D&&D!=="default"?J.setAttribute("shape",D):J.removeAttribute("shape"),q?J.setAttribute("color",q):J.removeAttribute("color"),$?J.setAttribute("radius",String($)):J.removeAttribute("radius"),j?J.setAttribute("label",j):J.removeAttribute("label"),_?J.setAttribute("description",_):J.removeAttribute("description"))},[i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B,T,N,I,S,x,D,q,$,j,_]),e.createElement("ui-input",{ref:M,value:s??void 0,...Q},G)});me.displayName="Input";const ve=e.forwardRef(function({value:f,onChange:r,onInput:s,onDebouncedInput:n,onClear:c,clearable:m,debounce:l,validation:i,size:d,minlength:v,maxlength:u,rows:y,readOnly:p,autofocus:g,disabled:A,name:b,required:E,placeholder:t,resize:o,variant:h,color:L,radius:H,label:a,description:k,autosize:R,maxRows:P,showCount:F,density:B,tone:T,headless:N,children:I,...S},x){const D=e.useRef(null);return e.useImperativeHandle(x,()=>D.current),e.useEffect(()=>{const q=D.current;if(!q)return;const $=Q=>{const M=Q.detail;M&&(s==null||s(M.value))},j=Q=>{const M=Q.detail;M&&(r==null||r(M.value))},_=Q=>{const M=Q.detail;M&&(n==null||n(M.value))},G=()=>c==null?void 0:c();return q.addEventListener("input",$),q.addEventListener("change",j),q.addEventListener("debounced-input",_),q.addEventListener("clear",G),()=>{q.removeEventListener("input",$),q.removeEventListener("change",j),q.removeEventListener("debounced-input",_),q.removeEventListener("clear",G)}},[r,s,n,c]),e.useEffect(()=>{const q=D.current;if(!q)return;const $=(_,G)=>{const Q=q.getAttribute(_);if(G==null){Q!=null&&q.removeAttribute(_);return}Q!==G&&q.setAttribute(_,G)},j=(_,G)=>{G?$(_,""):$(_,null)};$("value",f!=null?String(f):null),j("clearable",m),j("readonly",p),j("autofocus",g),j("disabled",A),j("required",E),j("autosize",R),j("show-count",F),j("headless",N),$("debounce",typeof l=="number"&&Number.isFinite(l)?String(l):null),$("validation",i&&i!=="none"?i:null),$("size",d&&d!=="md"&&d!=="2"?String(d):null),$("minlength",typeof v=="number"?String(v):null),$("maxlength",typeof u=="number"?String(u):null),$("rows",typeof y=="number"?String(y):null),$("name",b||null),$("placeholder",t||null),$("resize",o||null),$("variant",h&&h!=="classic"?h:null),$("color",L||null),$("radius",H?String(H):null),$("label",a||null),$("description",k||null),$("max-rows",typeof P=="number"?String(P):null),$("density",B&&B!=="default"?B:null),$("tone",T&&T!=="brand"?T:null)},[f,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B,T,N]),e.createElement("ui-textarea",{ref:D,...S},I)});ve.displayName="Textarea";function kt(w){const{children:f,label:r,description:s,error:n,htmlFor:c,required:m,invalid:l,orientation:i,variant:d,tone:v,density:u,shape:y,labelWidth:p,headless:g,...A}=w,b=e.useRef(null);return e.useEffect(()=>{const E=b.current;E&&(r!=null&&r!==""?E.setAttribute("label",r):E.removeAttribute("label"),s!=null&&s!==""?E.setAttribute("description",s):E.removeAttribute("description"),n!=null&&n!==""?E.setAttribute("error",n):E.removeAttribute("error"),c?E.setAttribute("for",c):E.removeAttribute("for"),m?E.setAttribute("required",""):E.removeAttribute("required"),l?E.setAttribute("invalid",""):E.removeAttribute("invalid"),i&&i!=="vertical"?E.setAttribute("orientation",i):E.removeAttribute("orientation"),d&&d!=="default"?E.setAttribute("variant",d):E.removeAttribute("variant"),v&&v!=="default"?E.setAttribute("tone",v):E.removeAttribute("tone"),u&&u!=="default"?E.setAttribute("density",u):E.removeAttribute("density"),y&&y!=="default"?E.setAttribute("shape",y):E.removeAttribute("shape"),p?E.setAttribute("label-width",p):E.removeAttribute("label-width"),g?E.setAttribute("headless",""):E.removeAttribute("headless"))},[r,s,n,c,m,l,i,d,v,u,y,p,g]),e.createElement("ui-field",{ref:b,...A},f)}function Pt(w){const{value:f,onChange:r,onInput:s,onDebouncedInput:n,onSelect:c,onOpen:m,onClose:l,onClear:i,clearable:d,debounce:v,validation:u,size:y,maxlength:p,readOnly:g,autofocus:A,disabled:b,name:E,required:t,placeholder:o,variant:h,radius:L,label:H,description:a,emptyText:k,noFilter:R,allowCustom:P,children:F,...B}=w,T=e.useRef(null);return e.useEffect(()=>{const N=T.current;if(!N)return;const I=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.query;typeof G=="string"&&(s==null||s(G))},S=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.value;typeof G=="string"&&(r==null||r(G))},x=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.query;typeof G=="string"&&(n==null||n(G))},D=_=>{const G=_.detail;typeof(G==null?void 0:G.value)=="string"&&(c==null||c(G.value,G.label||G.value))},q=()=>m==null?void 0:m(),$=()=>l==null?void 0:l(),j=()=>i==null?void 0:i();return N.addEventListener("input",I),N.addEventListener("change",S),N.addEventListener("debounced-input",x),N.addEventListener("select",D),N.addEventListener("open",q),N.addEventListener("close",$),N.addEventListener("clear",j),()=>{N.removeEventListener("input",I),N.removeEventListener("change",S),N.removeEventListener("debounced-input",x),N.removeEventListener("select",D),N.removeEventListener("open",q),N.removeEventListener("close",$),N.removeEventListener("clear",j)}},[r,s,n,c,m,l,i]),e.useEffect(()=>{const N=T.current;N&&(d?N.setAttribute("clearable",""):N.removeAttribute("clearable"),typeof v=="number"&&Number.isFinite(v)?N.setAttribute("debounce",String(v)):N.removeAttribute("debounce"),u&&u!=="none"?N.setAttribute("validation",u):N.removeAttribute("validation"),y&&y!=="md"&&y!=="2"?N.setAttribute("size",String(y)):N.removeAttribute("size"),typeof p=="number"?N.setAttribute("maxlength",String(p)):N.removeAttribute("maxlength"),g?N.setAttribute("readonly",""):N.removeAttribute("readonly"),A?N.setAttribute("autofocus",""):N.removeAttribute("autofocus"),b?N.setAttribute("disabled",""):N.removeAttribute("disabled"),E?N.setAttribute("name",E):N.removeAttribute("name"),t?N.setAttribute("required",""):N.removeAttribute("required"),o?N.setAttribute("placeholder",o):N.removeAttribute("placeholder"),h?N.setAttribute("variant",h):N.removeAttribute("variant"),L?N.setAttribute("radius",String(L)):N.removeAttribute("radius"),H?N.setAttribute("label",H):N.removeAttribute("label"),a?N.setAttribute("description",a):N.removeAttribute("description"),k?N.setAttribute("empty-text",k):N.removeAttribute("empty-text"),R?N.setAttribute("no-filter",""):N.removeAttribute("no-filter"),P?N.setAttribute("allow-custom",""):N.removeAttribute("allow-custom"))},[d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P]),e.createElement("ui-combobox",{ref:T,value:f,...B},F)}function St(w){const{text:f,tone:r,variant:s,size:n,radius:c,pill:m,dot:l,removable:i,autoRemove:d,iconOnly:v,disabled:u,onRemove:y,children:p,...g}=w,A=e.useRef(null);return e.useEffect(()=>{const b=A.current;if(!b)return;const E=()=>y==null?void 0:y();return b.addEventListener("remove",E),()=>b.removeEventListener("remove",E)},[y]),e.useEffect(()=>{const b=A.current;b&&(f?b.setAttribute("text",f):b.removeAttribute("text"),r?b.setAttribute("tone",r):b.removeAttribute("tone"),s?b.setAttribute("variant",s):b.removeAttribute("variant"),n&&n!=="md"&&n!=="2"?b.setAttribute("size",n):b.removeAttribute("size"),c?b.setAttribute("radius",String(c)):b.removeAttribute("radius"),m?b.setAttribute("pill",""):b.removeAttribute("pill"),l?b.setAttribute("dot",""):b.removeAttribute("dot"),i?b.setAttribute("removable",""):b.removeAttribute("removable"),d?b.setAttribute("auto-remove",""):b.removeAttribute("auto-remove"),v?b.setAttribute("icon-only",""):b.removeAttribute("icon-only"),u?b.setAttribute("disabled",""):b.removeAttribute("disabled"))},[f,r,s,n,c,m,l,i,d,v,u]),e.createElement("ui-badge",{ref:A,...g},p)}function Ft(w){const{title:f,description:r,actionLabel:s,tone:n,compact:c,headless:m,onAction:l,children:i,...d}=w,v=e.useRef(null);return e.useEffect(()=>{const u=v.current;if(!u)return;const y=()=>l==null?void 0:l();return u.addEventListener("action",y),()=>u.removeEventListener("action",y)},[l]),e.useEffect(()=>{const u=v.current;u&&(f?u.setAttribute("title",f):u.removeAttribute("title"),r?u.setAttribute("description",r):u.removeAttribute("description"),s?u.setAttribute("action-label",s):u.removeAttribute("action-label"),n?u.setAttribute("tone",n):u.removeAttribute("tone"),c?u.setAttribute("compact",""):u.removeAttribute("compact"),m?u.setAttribute("headless",""):u.removeAttribute("headless"))},[f,r,s,n,c,m]),e.createElement("ui-empty-state",{ref:v,...d},i)}function Tt(w){const{sortable:f,selectable:r,multiSelect:s,striped:n,hover:c,compact:m,bordered:l,stickyHeader:i,loading:d,headless:v,emptyText:u,onSortChange:y,onRowSelect:p,children:g,...A}=w,b=e.useRef(null);return e.useEffect(()=>{const E=b.current;if(!E)return;const t=h=>{const L=h.detail;L&&(y==null||y(L))},o=h=>{const L=h.detail;L&&(p==null||p(L))};return E.addEventListener("sort-change",t),E.addEventListener("row-select",o),()=>{E.removeEventListener("sort-change",t),E.removeEventListener("row-select",o)}},[y,p]),e.createElement("ui-table",{ref:b,...A,...f?{sortable:""}:{},...r?{selectable:""}:{},...s?{"multi-select":""}:{},...n?{striped:""}:{},...c?{hover:""}:{},...m?{compact:""}:{},...l?{bordered:""}:{},...i?{"sticky-header":""}:{},...d?{loading:""}:{},...v?{headless:""}:{},...u?{"empty-text":u}:{}},g)}function xt(w){const{sortable:f,selectable:r,multiSelect:s,striped:n,hover:c,compact:m,bordered:l,stickyHeader:i,loading:d,headless:v,hideSummary:u,emptyText:y,page:p,pageSize:g,paginationId:A,filterQuery:b,filterColumn:E,filterRules:t,columnOrder:o,pinColumns:h,draggableColumns:L,resizableColumns:H,bulkActionsLabel:a,bulkClearLabel:k,virtualize:R,rowHeight:P,overscan:F,onSortChange:B,onRowSelect:T,onPageChange:N,onFilterChange:I,onColumnResize:S,onVirtualRangeChange:x,onColumnOrderChange:D,onBulkClear:q,children:$,...j}=w,_=e.useRef(null);e.useEffect(()=>{const M=_.current;if(!M)return;const J=W=>{const X=W.detail;X&&(B==null||B(X))},Z=W=>{const X=W.detail;X&&(T==null||T(X))},Y=W=>{const X=W.detail;X&&(N==null||N(X))},re=W=>{const X=W.detail;X&&(I==null||I(X))},ie=W=>{const X=W.detail;X&&(S==null||S(X))},C=W=>{const X=W.detail;X&&(x==null||x(X))},z=W=>{const X=W.detail;X&&(D==null||D(X))},le=W=>{const X=W.detail;X&&(q==null||q(X))};return M.addEventListener("sort-change",J),M.addEventListener("row-select",Z),M.addEventListener("page-change",Y),M.addEventListener("filter-change",re),M.addEventListener("column-resize",ie),M.addEventListener("virtual-range-change",C),M.addEventListener("column-order-change",z),M.addEventListener("bulk-clear",le),()=>{M.removeEventListener("sort-change",J),M.removeEventListener("row-select",Z),M.removeEventListener("page-change",Y),M.removeEventListener("filter-change",re),M.removeEventListener("column-resize",ie),M.removeEventListener("virtual-range-change",C),M.removeEventListener("column-order-change",z),M.removeEventListener("bulk-clear",le)}},[B,T,N,I,S,x,D,q]);const G=t&&t.length?(()=>{try{return JSON.stringify(t)}catch{return}})():void 0,Q=typeof h=="string"?h.trim()||void 0:h&&typeof h=="object"?(()=>{try{return JSON.stringify(h)}catch{return}})():void 0;return e.createElement("ui-data-table",{ref:_,...j,...f?{sortable:""}:{},...r?{selectable:""}:{},...s?{"multi-select":""}:{},...n?{striped:""}:{},...c?{hover:""}:{},...m?{compact:""}:{},...l?{bordered:""}:{},...i?{"sticky-header":""}:{},...d?{loading:""}:{},...v?{headless:""}:{},...u?{"hide-summary":""}:{},...y?{"empty-text":y}:{},...typeof p=="number"&&Number.isFinite(p)?{page:String(p)}:{},...typeof g=="number"&&Number.isFinite(g)?{"page-size":String(g)}:{},...A?{"pagination-id":A}:{},...typeof b=="string"?{"filter-query":b}:{},...typeof E=="number"&&Number.isFinite(E)?{"filter-column":String(E)}:typeof E=="string"&&E.trim()?{"filter-column":E}:{},...G?{filters:G}:{},...o?{"column-order":o}:{},...Q?{"pin-columns":Q}:{},...L?{"draggable-columns":""}:{},...H?{"resizable-columns":""}:{},...a?{"bulk-actions-label":a}:{},...k?{"bulk-clear-label":k}:{},...R?{virtualize:""}:{},...typeof P=="number"&&Number.isFinite(P)?{"row-height":String(P)}:{},...typeof F=="number"&&Number.isFinite(F)?{overscan:String(F)}:{}},$)}const Ae=e.forwardRef(function({data:f,values:r,labels:s,type:n,variant:c,title:m,subtitle:l,headless:i,children:d,...v},u){const y=e.useRef(null);return e.useImperativeHandle(u,()=>y.current),e.useEffect(()=>{const p=y.current;if(!p)return;const g=(b,E)=>{const t=p.getAttribute(b);if(E==null){t!=null&&p.removeAttribute(b);return}t!==E&&p.setAttribute(b,E)},A=(b,E)=>{E?g(b,""):g(b,null)};if(f&&f.length)try{g("data",JSON.stringify(f))}catch{g("data",null)}else g("data",null);r&&r.length?g("values",r.join(",")):g("values",null),s&&s.length?g("labels",s.join(",")):g("labels",null),g("type",n&&n!=="line"?n:null),g("variant",c&&c!=="default"?c:null),g("title",m||null),g("subtitle",l||null),A("headless",i)},[f,r,s,n,c,m,l,i]),e.createElement("ui-chart",{ref:y,...v},d)});Ae.displayName="Chart";const Ee=e.forwardRef(function({items:f,variant:r,headless:s,children:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=(u,y)=>{const p=i.getAttribute(u);if(y==null){p!=null&&i.removeAttribute(u);return}p!==y&&i.setAttribute(u,y)},v=(u,y)=>{y?d(u,""):d(u,null)};if(f&&f.length)try{d("items",JSON.stringify(f))}catch{d("items",null)}else d("items",null);d("variant",r&&r!=="default"?r:null),v("headless",s)},[f,r,s]),e.createElement("ui-timeline",{ref:l,...c},n)});Ee.displayName="Timeline";const pe=e.forwardRef(function({year:f,month:r,value:s,events:n,variant:c,selection:m,min:l,max:i,disabled:d,readOnly:v,locale:u,weekStart:y,outsideClick:p,eventsMax:g,eventsDisplay:A,maxSelections:b,size:E,headless:t,hideToday:o,showToday:h,onSelect:L,onChange:H,onCalendarChange:a,onValueChange:k,children:R,...P},F){const B=e.useRef(null);return e.useImperativeHandle(F,()=>B.current),e.useEffect(()=>{const T=B.current;if(!T)return;const N=S=>{const x=S.detail;x&&(L==null||L(x),H==null||H(x),k==null||k(x.value))},I=S=>{const x=S.detail;x&&(a==null||a(x))};return T.addEventListener("select",N),T.addEventListener("change",I),()=>{T.removeEventListener("select",N),T.removeEventListener("change",I)}},[L,H,a,k]),e.useEffect(()=>{const T=B.current;if(!T)return;const N=(S,x)=>{const D=T.getAttribute(S);if(x==null){D!=null&&T.removeAttribute(S);return}D!==x&&T.setAttribute(S,x)},I=(S,x)=>{x?T.hasAttribute(S)||T.setAttribute(S,""):T.hasAttribute(S)&&T.removeAttribute(S)};if(typeof f=="number"&&Number.isFinite(f)?N("year",String(f)):N("year",null),typeof r=="number"&&Number.isFinite(r)?N("month",String(r)):N("month",null),N("value",s||null),N("selection",m&&m!=="single"?m:null),N("min",l||null),N("max",i||null),N("locale",u||null),N("week-start",typeof y=="number"?String(y):null),N("outside-click",p&&p!=="navigate"?p:null),N("events-max",typeof g=="number"&&Number.isFinite(g)?String(g):null),N("events-display",A&&A!=="dots"?A:null),N("max-selections",typeof b=="number"&&Number.isFinite(b)?String(b):null),N("size",E&&E!=="md"?E:null),N("show-today",typeof h=="boolean"?h?"true":"false":null),I("disabled",d),I("readonly",v),I("hide-today",o),I("headless",t),n&&n.length)try{N("events",JSON.stringify(n))}catch{N("events",null)}else N("events",null);N("variant",c&&c!=="default"?c:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-calendar",{ref:B,...P},R)});pe.displayName="Calendar";const ye=e.forwardRef(function({value:f,format:r,alpha:s,disabled:n,readOnly:c,size:m,variant:l,mode:i,open:d,placeholder:v,presets:u,recent:y,maxRecent:p,persist:g,onInput:A,onChange:b,onValueChange:E,onOpen:t,onClose:o,onInvalid:h,children:L,...H},a){const k=e.useRef(null);e.useImperativeHandle(a,()=>k.current),e.useEffect(()=>{const P=k.current;if(!P)return;const F=N=>{const I=N.detail;I&&(A==null||A(I))},B=N=>{const I=N.detail;I&&(b==null||b(I),E==null||E(I.value))},T=N=>{const I=N.detail;I&&(h==null||h(I))};return P.addEventListener("input",F),P.addEventListener("change",B),P.addEventListener("open",t),P.addEventListener("close",o),P.addEventListener("invalid",T),()=>{P.removeEventListener("input",F),P.removeEventListener("change",B),P.removeEventListener("open",t),P.removeEventListener("close",o),P.removeEventListener("invalid",T)}},[A,b,E,t,o,h]),e.useEffect(()=>{const P=k.current;if(!P)return;const F=(T,N)=>{const I=P.getAttribute(T);N==null?I!=null&&P.removeAttribute(T):I!==N&&P.setAttribute(T,N)},B=(T,N)=>{N?F(T,""):F(T,null)};if(F("value",f??null),F("format",r&&r!=="hex"?r:null),B("alpha",s),B("disabled",n),B("readonly",c),F("size",m&&m!=="md"?m:null),F("variant",l&&l!=="default"?l:null),F("mode",i&&i!=="inline"?i:null),typeof d=="boolean"?B("open",d):F("open",null),F("placeholder",v??null),B("recent",y),F("max-recent",typeof p=="number"?String(p):null),B("persist",g),u&&u.length>0)try{F("presets",JSON.stringify(u))}catch{F("presets",null)}else F("presets",null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g]);const R={ref:k,...H};if(i&&i!=="inline"&&(R.mode=i),typeof d=="boolean"&&d&&(R.open=""),f!=null&&(R.value=f),r&&r!=="hex"&&(R.format=r),s&&(R.alpha=""),n&&(R.disabled=""),c&&(R.readonly=""),m&&m!=="md"&&(R.size=m),l&&l!=="default"&&(R.variant=l),v&&(R.placeholder=v),y&&(R.recent=""),typeof p=="number"&&(R["max-recent"]=String(p)),g&&(R.persist=""),u&&u.length>0)try{R.presets=JSON.stringify(u)}catch{}return e.createElement("ui-color-picker",R,L)});ye.displayName="ColorPicker";const Le=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,placeholder:u,label:y,hint:p,error:g,clearable:A,allowInput:b,closeOnSelect:E,outsideClick:t,disabled:o,readOnly:h,required:L,name:H,mode:a,events:k,eventsMax:R,eventsDisplay:P,format:F,displayFormat:B,onInput:T,onChange:N,onValueChange:I,onOpen:S,onClose:x,onInvalid:D,children:q,...$},j){const _=e.useRef(null);return e.useImperativeHandle(j,()=>_.current),e.useEffect(()=>{const G=_.current;if(!G)return;const Q=Z=>{const Y=Z.detail;Y&&(T==null||T(Y))},M=Z=>{const Y=Z.detail;Y&&(N==null||N(Y),I==null||I(Y.value))},J=Z=>{const Y=Z.detail;Y&&(D==null||D(Y))};return G.addEventListener("input",Q),G.addEventListener("change",M),G.addEventListener("open",S),G.addEventListener("close",x),G.addEventListener("invalid",J),()=>{G.removeEventListener("input",Q),G.removeEventListener("change",M),G.removeEventListener("open",S),G.removeEventListener("close",x),G.removeEventListener("invalid",J)}},[T,N,I,S,x,D]),e.useEffect(()=>{const G=_.current;if(!G)return;const Q=(J,Z)=>{const Y=G.getAttribute(J);Z==null?Y!=null&&G.removeAttribute(J):Y!==Z&&G.setAttribute(J,Z)},M=(J,Z)=>{Z?Q(J,""):Q(J,null)};if(Q("value",f??null),Q("default-value",r??null),typeof s=="boolean"?M("open",s):Q("open",null),M("default-open",n),Q("min",c??null),Q("max",m??null),Q("locale",l??null),Q("week-start",typeof i=="number"?String(i):null),Q("size",d&&d!=="md"?d:null),Q("variant",v&&v!=="default"?v:null),Q("placeholder",u??null),Q("label",y??null),Q("hint",p??null),Q("error",g??null),M("clearable",A),M("allow-input",b),M("close-on-select",E),Q("outside-click",t&&t!=="navigate"?t:null),M("disabled",o),M("readonly",h),M("required",L),Q("name",H??null),Q("mode",a&&a!=="popover"?a:null),Q("events-max",typeof R=="number"?String(R):null),Q("events-display",P&&P!=="dots"?P:null),Q("format",F&&F!=="locale"?F:null),Q("display-format",B??null),k!=null&&k.length)try{Q("events",JSON.stringify(k))}catch{Q("events",null)}else Q("events",null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B]),e.createElement("ui-date-picker",{ref:_,...$},q)});Le.displayName="DatePicker";const ge=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,rangeVariant:u,label:y,hint:p,error:g,allowSameDay:A,allowPartial:b,closeOnSelect:E,clearable:t,disabled:o,readOnly:h,required:L,name:H,nameStart:a,nameEnd:k,mode:R,onInput:P,onChange:F,onValueChange:B,onOpen:T,onClose:N,onInvalid:I,children:S,...x},D){const q=e.useRef(null);return e.useImperativeHandle(D,()=>q.current),e.useEffect(()=>{const $=q.current;if(!$)return;const j=Q=>{const M=Q.detail;M&&(P==null||P(M))},_=Q=>{const M=Q.detail;M&&(F==null||F(M),B==null||B(M.value?JSON.stringify(M.value):null))},G=Q=>{const M=Q.detail;M&&(I==null||I(M))};return $.addEventListener("input",j),$.addEventListener("change",_),$.addEventListener("open",T),$.addEventListener("close",N),$.addEventListener("invalid",G),()=>{$.removeEventListener("input",j),$.removeEventListener("change",_),$.removeEventListener("open",T),$.removeEventListener("close",N),$.removeEventListener("invalid",G)}},[P,F,B,T,N,I]),e.useEffect(()=>{const $=q.current;if(!$)return;const j=(G,Q)=>{const M=$.getAttribute(G);Q==null?M!=null&&$.removeAttribute(G):M!==Q&&$.setAttribute(G,Q)},_=(G,Q)=>{Q?j(G,""):j(G,null)};j("value",f??null),j("default-value",r??null),typeof s=="boolean"?_("open",s):j("open",null),_("default-open",n),j("min",c??null),j("max",m??null),j("locale",l??null),j("week-start",typeof i=="number"?String(i):null),j("size",d&&d!=="md"?d:null),j("variant",v&&v!=="default"?v:null),j("range-variant",u&&u!=="two-fields"?u:null),j("label",y??null),j("hint",p??null),j("error",g??null),_("allow-same-day",A),_("allow-partial",b),_("close-on-select",E),_("clearable",t),_("disabled",o),_("readonly",h),_("required",L),j("name",H??null),j("name-start",a??null),j("name-end",k??null),j("mode",R&&R!=="popover"?R:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R]),e.createElement("ui-date-range-picker",{ref:q,...x},S)});ge.displayName="DateRangePicker";const he=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,format:c,step:m,seconds:l,stepSeconds:i,min:d,max:v,disabled:u,readOnly:y,required:p,name:g,clearable:A,allowInput:b,mode:E,label:t,hint:o,error:h,locale:L,variant:H,onInput:a,onChange:k,onValueChange:R,onOpen:P,onClose:F,onInvalid:B,children:T,...N},I){const S=e.useRef(null);return e.useImperativeHandle(I,()=>S.current),e.useEffect(()=>{const x=S.current;if(!x)return;const D=j=>{const _=j.detail;_&&(a==null||a(_))},q=j=>{const _=j.detail;_&&(k==null||k(_),R==null||R(_.value))},$=j=>{const _=j.detail;_&&(B==null||B(_))};return x.addEventListener("input",D),x.addEventListener("change",q),x.addEventListener("open",P),x.addEventListener("close",F),x.addEventListener("invalid",$),()=>{x.removeEventListener("input",D),x.removeEventListener("change",q),x.removeEventListener("open",P),x.removeEventListener("close",F),x.removeEventListener("invalid",$)}},[a,k,R,P,F,B]),e.useEffect(()=>{const x=S.current;if(!x)return;const D=($,j)=>{const _=x.getAttribute($);j==null?_!=null&&x.removeAttribute($):_!==j&&x.setAttribute($,j)},q=($,j)=>{j?D($,""):D($,null)};D("value",f??null),D("default-value",r??null),typeof s=="boolean"?q("open",s):D("open",null),q("default-open",n),D("format",c&&c!=="24h"?c:null),D("step",typeof m=="number"?String(m):null),q("seconds",l),D("step-seconds",typeof i=="number"?String(i):null),D("min",d??null),D("max",v??null),q("disabled",u),q("readonly",y),q("required",p),D("name",g??null),q("clearable",A),q("allow-input",b),D("mode",E&&E!=="popover"?E:null),D("label",t??null),D("hint",o??null),D("error",h??null),D("locale",L??null),D("variant",H&&H!=="default"?H:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H]),e.createElement("ui-time-picker",{ref:S,...N},T)});he.displayName="TimePicker";const we=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,step:u,format:y,disabled:p,readOnly:g,required:A,name:b,closeOnSelect:E,clearable:t,allowInput:o,mode:h,label:L,hint:H,error:a,onInput:k,onChange:R,onValueChange:P,onOpen:F,onClose:B,onInvalid:T,children:N,...I},S){const x=e.useRef(null);return e.useImperativeHandle(S,()=>x.current),e.useEffect(()=>{const D=x.current;if(!D)return;const q=_=>{const G=_.detail;G&&(k==null||k(G))},$=_=>{const G=_.detail;G&&(R==null||R(G),P==null||P(G.value))},j=_=>{const G=_.detail;G&&(T==null||T(G))};return D.addEventListener("input",q),D.addEventListener("change",$),D.addEventListener("open",F),D.addEventListener("close",B),D.addEventListener("invalid",j),()=>{D.removeEventListener("input",q),D.removeEventListener("change",$),D.removeEventListener("open",F),D.removeEventListener("close",B),D.removeEventListener("invalid",j)}},[k,R,P,F,B,T]),e.useEffect(()=>{const D=x.current;if(!D)return;const q=(j,_)=>{const G=D.getAttribute(j);_==null?G!=null&&D.removeAttribute(j):G!==_&&D.setAttribute(j,_)},$=(j,_)=>{_?q(j,""):q(j,null)};q("value",f??null),q("default-value",r??null),typeof s=="boolean"?$("open",s):q("open",null),$("default-open",n),q("min",c??null),q("max",m??null),q("locale",l??null),q("week-start",typeof i=="number"?String(i):null),q("size",d&&d!=="md"?d:null),q("variant",v&&v!=="default"?v:null),q("step",typeof u=="number"?String(u):null),q("format",y&&y!=="24h"?y:null),$("disabled",p),$("readonly",g),$("required",A),q("name",b??null),$("close-on-select",E),$("clearable",t),$("allow-input",o),q("mode",h&&h!=="popover"?h:null),q("label",L??null),q("hint",H??null),q("error",a??null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a]),e.createElement("ui-date-time-picker",{ref:x,...I},N)});we.displayName="DateTimePicker";const Re=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,step:u,autoNormalize:y,allowPartial:p,disabled:g,readOnly:A,required:b,name:E,closeOnSelect:t,clearable:o,mode:h,label:L,hint:H,error:a,onInput:k,onChange:R,onValueChange:P,onOpen:F,onClose:B,onInvalid:T,children:N,...I},S){const x=e.useRef(null);return e.useImperativeHandle(S,()=>x.current),e.useEffect(()=>{const D=x.current;if(!D)return;const q=_=>{const G=_.detail;G&&(k==null||k(G))},$=_=>{const G=_.detail;G&&(R==null||R(G),P==null||P(G.value?JSON.stringify(G.value):null))},j=_=>{const G=_.detail;G&&(T==null||T(G))};return D.addEventListener("input",q),D.addEventListener("change",$),D.addEventListener("open",F),D.addEventListener("close",B),D.addEventListener("invalid",j),()=>{D.removeEventListener("input",q),D.removeEventListener("change",$),D.removeEventListener("open",F),D.removeEventListener("close",B),D.removeEventListener("invalid",j)}},[k,R,P,F,B,T]),e.useEffect(()=>{const D=x.current;if(!D)return;const q=(j,_)=>{const G=D.getAttribute(j);_==null?G!=null&&D.removeAttribute(j):G!==_&&D.setAttribute(j,_)},$=(j,_)=>{_?q(j,""):q(j,null)};q("value",f??null),q("default-value",r??null),typeof s=="boolean"?$("open",s):q("open",null),$("default-open",n),q("min",c??null),q("max",m??null),q("locale",l??null),q("week-start",typeof i=="number"?String(i):null),q("size",d&&d!=="md"?d:null),q("variant",v&&v!=="default"?v:null),q("step",typeof u=="number"?String(u):null),$("auto-normalize",y),$("allow-partial",p),$("disabled",g),$("readonly",A),$("required",b),q("name",E??null),$("close-on-select",t),$("clearable",o),q("mode",h&&h!=="popover"?h:null),q("label",L??null),q("hint",H??null),q("error",a??null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a]),e.createElement("ui-date-range-time-picker",{ref:x,...I},N)});Re.displayName="DateRangeTimePicker";const He=e.forwardRef(function({tasks:f,variant:r,headless:s,children:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=(u,y)=>{const p=i.getAttribute(u);if(y==null){p!=null&&i.removeAttribute(u);return}p!==y&&i.setAttribute(u,y)},v=(u,y)=>{y?d(u,""):d(u,null)};if(f&&f.length)try{d("tasks",JSON.stringify(f))}catch{d("tasks",null)}else d("tasks",null);d("variant",r&&r!=="default"?r:null),v("headless",s)},[f,r,s]),e.createElement("ui-gantt",{ref:l,...c},n)});He.displayName="Gantt";const Ne=e.forwardRef(function({steps:f,value:r,orientation:s,variant:n,size:c,clickable:m,linear:l,headless:i,onChange:d,onSelect:v,children:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=t=>{const o=t.detail;o&&(d==null||d(o))},E=t=>{const o=t.detail;o&&(v==null||v(o))};return A.addEventListener("change",b),A.addEventListener("select",E),()=>{A.removeEventListener("change",b),A.removeEventListener("select",E)}},[d,v]),e.useEffect(()=>{const A=g.current;if(!A)return;const b=(t,o)=>{const h=A.getAttribute(t);if(o==null){h!=null&&A.removeAttribute(t);return}h!==o&&A.setAttribute(t,o)},E=(t,o)=>{o?b(t,""):b(t,null)};if(f&&f.length)try{b("steps",JSON.stringify(f))}catch{b("steps",null)}else b("steps",null);b("value",r||null),b("orientation",s&&s!=="horizontal"?s:null),b("variant",n&&n!=="default"?n:null),b("size",c&&c!=="md"?c:null),E("clickable",m),E("linear",l),E("headless",i)},[f,r,s,n,c,m,l,i]),e.createElement("ui-stepper",{ref:g,...y},u)});Ne.displayName="Stepper";const ke=e.forwardRef(function({value:f,linear:r,showStepper:s,stepperPosition:n,hideControls:c,keepMounted:m,variant:l,headless:i,nextLabel:d,prevLabel:v,finishLabel:u,onBeforeChange:y,onChange:p,onStepChange:g,onComplete:A,children:b,...E},t){const o=e.useRef(null);return e.useImperativeHandle(t,()=>o.current),e.useEffect(()=>{const h=o.current;if(!h)return;const L=R=>{if(!y)return;const P=R.detail;y(P)===!1&&R.preventDefault()},H=R=>{const P=R.detail;P&&(p==null||p(P))},a=R=>{const P=R.detail;P&&(g==null||g(P))},k=R=>{const P=R.detail;P&&(A==null||A(P))};return h.addEventListener("before-change",L),h.addEventListener("change",H),h.addEventListener("step-change",a),h.addEventListener("complete",k),()=>{h.removeEventListener("before-change",L),h.removeEventListener("change",H),h.removeEventListener("step-change",a),h.removeEventListener("complete",k)}},[y,p,g,A]),e.useEffect(()=>{const h=o.current;if(!h)return;const L=(a,k)=>{const R=h.getAttribute(a);if(k==null){R!=null&&h.removeAttribute(a);return}R!==k&&h.setAttribute(a,k)},H=(a,k,R)=>{if(typeof k=="boolean"){k?L(a,""):L(a,null);return}R!==void 0&&(R?L(a,""):L(a,null))};L("value",f||null),H("linear",r),typeof s=="boolean"?L("show-stepper",s?"true":"false"):L("show-stepper",null),L("stepper-position",n&&n!=="top"?n:null),H("hide-controls",c),H("keep-mounted",m),L("variant",l&&l!=="default"?l:null),H("headless",i),L("next-label",d||null),L("prev-label",v||null),L("finish-label",u||null)},[f,r,s,n,c,m,l,i,d,v,u]),e.createElement("ui-wizard",{ref:o,...E},b)});ke.displayName="Wizard";const Pe=e.forwardRef(function({open:f,mode:r,orientation:s,variant:n,floating:c,placement:m,collapsible:l,label:i,headless:d,onSelect:v,onOpenChange:u,onToggle:y,children:p,...g},A){const b=e.useRef(null);return e.useImperativeHandle(A,()=>b.current),e.useEffect(()=>{const E=b.current;if(!E)return;const t=L=>{const H=L.detail;H&&(v==null||v(H))},o=L=>{var a;const H=(a=L.detail)==null?void 0:a.open;typeof H=="boolean"&&(u==null||u(H))},h=L=>{var a;const H=(a=L.detail)==null?void 0:a.open;typeof H=="boolean"&&(y==null||y(H))};return E.addEventListener("select",t),E.addEventListener("change",o),E.addEventListener("toggle",h),()=>{E.removeEventListener("select",t),E.removeEventListener("change",o),E.removeEventListener("toggle",h)}},[v,u,y]),e.useEffect(()=>{const E=b.current;if(!E)return;const t=(h,L)=>{const H=E.getAttribute(h);if(L==null){H!=null&&E.removeAttribute(h);return}H!==L&&E.setAttribute(h,L)},o=(h,L)=>{L?t(h,""):t(h,null)};typeof f=="boolean"?o("open",f):t("open",null),t("mode",r&&r!=="bar"?r:null),t("orientation",s&&s!=="horizontal"?s:null),t("variant",n&&n!=="default"?n:null),o("floating",c),t("placement",m&&m!=="bottom-right"?m:null),o("collapsible",l),t("label",i||null),o("headless",d)},[f,r,s,n,c,m,l,i,d]),e.createElement("ui-quick-actions",{ref:b,...g},p)});Pe.displayName="QuickActions";function Dt(w){const{selected:f,orientation:r,activation:s,loop:n,collapsible:c,headless:m,onChange:l,onSelect:i,children:d,...v}=w,u=e.useRef(null);return e.useEffect(()=>{const y=u.current;if(!y)return;const p=g=>{const A=g.detail;A&&(l==null||l(A),i==null||i(A.selected))};return y.addEventListener("change",p),()=>y.removeEventListener("change",p)},[l,i]),e.useEffect(()=>{const y=u.current;y&&(typeof f=="number"?y.setAttribute("selected",String(f)):y.removeAttribute("selected"),r?y.setAttribute("orientation",r):y.removeAttribute("orientation"),s?y.setAttribute("activation",s):y.removeAttribute("activation"),typeof n=="boolean"?y.setAttribute("loop",String(n)):y.removeAttribute("loop"),c?y.setAttribute("collapsible",""):y.removeAttribute("collapsible"),m?y.setAttribute("headless",""):y.removeAttribute("headless"))},[f,r,s,n,c,m]),e.createElement("ui-navigation-menu",{ref:u,...v},d)}function Bt(w){const{selected:f,open:r,loop:s,headless:n,orientation:c,placement:m,variant:l,density:i,shape:d,elevation:v,tone:u,closeOnSelect:y,typeahead:p,onChange:g,onOpen:A,onClose:b,onSelect:E,children:t,...o}=w,h=e.useRef(null);return e.useEffect(()=>{const L=h.current;if(!L)return;const H=P=>{const F=P.detail;F&&(g==null||g(F))},a=P=>{const F=P.detail;typeof(F==null?void 0:F.selected)=="number"?A==null||A(F.selected):A==null||A(-1)},k=()=>b==null?void 0:b(),R=P=>{const F=P.detail;F&&(E==null||E(F))};return L.addEventListener("change",H),L.addEventListener("open",a),L.addEventListener("close",k),L.addEventListener("select",R),()=>{L.removeEventListener("change",H),L.removeEventListener("open",a),L.removeEventListener("close",k),L.removeEventListener("select",R)}},[g,A,b,E]),e.useEffect(()=>{const L=h.current;L&&(typeof f=="number"?L.setAttribute("selected",String(f)):L.removeAttribute("selected"),typeof r=="boolean"&&r?L.setAttribute("open",""):L.removeAttribute("open"),typeof s=="boolean"?L.setAttribute("loop",String(s)):L.removeAttribute("loop"),n?L.setAttribute("headless",""):L.removeAttribute("headless"),c&&c!=="horizontal"?L.setAttribute("orientation",c):L.removeAttribute("orientation"),m?L.setAttribute("placement",m):L.removeAttribute("placement"),l&&l!=="default"?L.setAttribute("variant",l):L.removeAttribute("variant"),i&&i!=="default"?L.setAttribute("density",i):L.removeAttribute("density"),d&&d!=="default"?L.setAttribute("shape",d):L.removeAttribute("shape"),v&&v!=="default"?L.setAttribute("elevation",v):L.removeAttribute("elevation"),u&&u!=="default"&&u!=="brand"?L.setAttribute("tone",u):L.removeAttribute("tone"),y==null?L.removeAttribute("close-on-select"):L.setAttribute("close-on-select",y?"true":"false"),p==null?L.removeAttribute("typeahead"):L.setAttribute("typeahead",p?"true":"false"))},[f,r,s,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-menubar",{ref:h,...o},t)}const qt=typeof window<"u"?e.useLayoutEffect:e.useEffect,Se=e.forwardRef(function(f,r){const{open:s,title:n,description:c,closable:m,dismissible:l,closeOnOverlay:i,closeOnEsc:d,lockWhileLoading:v,roleType:u,size:y,state:p,initialFocus:g,submitText:A,cancelText:b,loadingText:E,dialogId:t,config:o,headless:h,onOpen:L,onClose:H,onRequestClose:a,onDialogOpen:k,onDialogSubmit:R,onDialogCancel:P,onDialogDismiss:F,onDialogClose:B,children:T,...N}=f,I=e.useRef(null);return e.useImperativeHandle(r,()=>I.current),e.useEffect(()=>{const S=I.current;if(!S)return;const x=()=>L==null?void 0:L(),D=()=>H==null?void 0:H(),q=M=>{const J=M.detail;J&&(a==null||a(J))},$=M=>k==null?void 0:k(M.detail),j=M=>R==null?void 0:R(M.detail),_=M=>P==null?void 0:P(M.detail),G=M=>F==null?void 0:F(M.detail),Q=M=>B==null?void 0:B(M.detail);return S.addEventListener("open",x),S.addEventListener("close",D),S.addEventListener("request-close",q),S.addEventListener("ui-open",$),S.addEventListener("ui-submit",j),S.addEventListener("ui-cancel",_),S.addEventListener("ui-dismiss",G),S.addEventListener("ui-close",Q),()=>{S.removeEventListener("open",x),S.removeEventListener("close",D),S.removeEventListener("request-close",q),S.removeEventListener("ui-open",$),S.removeEventListener("ui-submit",j),S.removeEventListener("ui-cancel",_),S.removeEventListener("ui-dismiss",G),S.removeEventListener("ui-close",Q)}},[L,H,a,k,R,P,F,B]),qt(()=>{const S=I.current;if(!S)return;typeof s=="boolean"&&(s?S.setAttribute("open",""):S.removeAttribute("open")),n?S.setAttribute("title",n):S.removeAttribute("title"),c?S.setAttribute("description",c):S.removeAttribute("description");const x=typeof l=="boolean"?l:m;typeof x=="boolean"?(S.setAttribute("dismissible",String(x)),S.setAttribute("closable",String(x))):(S.removeAttribute("dismissible"),S.removeAttribute("closable")),typeof i=="boolean"?(S.setAttribute("close-on-overlay",String(i)),S.setAttribute("close-on-backdrop",String(i))):(S.removeAttribute("close-on-overlay"),S.removeAttribute("close-on-backdrop")),typeof d=="boolean"?S.setAttribute("close-on-esc",String(d)):S.removeAttribute("close-on-esc"),typeof v=="boolean"?S.setAttribute("lock-while-loading",String(v)):S.removeAttribute("lock-while-loading"),u?S.setAttribute("role",u):S.removeAttribute("role"),y&&y!=="md"&&y!=="2"?S.setAttribute("size",y):S.removeAttribute("size"),p&&p!=="idle"?S.setAttribute("state",p):S.removeAttribute("state"),g?S.setAttribute("initial-focus",g):S.removeAttribute("initial-focus"),A?S.setAttribute("submit-text",A):S.removeAttribute("submit-text"),b?S.setAttribute("cancel-text",b):S.removeAttribute("cancel-text"),E?S.setAttribute("loading-text",E):S.removeAttribute("loading-text"),t&&(S.dialogId=t),o&&(S.config=o),h?S.setAttribute("headless",""):S.removeAttribute("headless")},[s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-dialog",{ref:I,...N},T)});Se.displayName="Dialog";const Fe=e.createContext(null);function $t({children:w,hostId:f="ui-dialog-react-host"}){const r=e.useRef(null);r.current||(r.current=V.createDialogManager()),e.useEffect(()=>{var c;if(typeof document>"u")return;let n=document.getElementById(f);return n||(n=document.createElement("div"),n.id=f,n.setAttribute("data-ui-dialog-react-host","true"),document.body.appendChild(n)),(c=r.current)==null||c.setContainer(n),()=>{var m;(m=r.current)==null||m.destroy("unmount"),r.current=null,n&&n.parentElement&&n.parentElement.removeChild(n)}},[f]);const s=e.useMemo(()=>({open:(n={})=>{var c;return((c=r.current)==null?void 0:c.open(n))??Promise.resolve({id:"",action:"dismiss"})},confirm:(n={})=>{var c;return((c=r.current)==null?void 0:c.confirm(n))??Promise.resolve({id:"",action:"dismiss"})}}),[]);return e.createElement(Fe.Provider,{value:s},w)}function Jt(){const w=e.useContext(Fe);if(!w)throw new Error("useDialog must be used within <DialogProvider>.");return w}const Te=e.forwardRef(function({children:f,onOpen:r,onClose:s,...n},c){const m=e.useRef(null);return e.useImperativeHandle(c,()=>m.current),e.useEffect(()=>{const l=m.current;if(!l)return;const i=()=>r==null?void 0:r(),d=()=>s==null?void 0:s();return l.addEventListener("open",i),l.addEventListener("close",d),()=>{l.removeEventListener("open",i),l.removeEventListener("close",d)}},[r,s]),e.createElement("ui-popover",{ref:m,...n},f)});Te.displayName="Popover";const xe=e.forwardRef(function({children:f,selected:r,value:s,orientation:n,activation:c,variant:m,size:l,tone:i,stretched:d,headless:v,onChange:u,onTabChange:y,...p},g){const A=e.useRef(null);return e.useImperativeHandle(g,()=>A.current),e.useEffect(()=>{const b=A.current;if(!b)return;const E=t=>{const o=t.detail;o&&(u==null||u(o.index),y==null||y(o))};return b.addEventListener("change",E),()=>{b.removeEventListener("change",E)}},[u,y]),e.useEffect(()=>{const b=A.current;if(!b)return;const E=(o,h)=>{const L=b.getAttribute(o);if(h==null){L!=null&&b.removeAttribute(o);return}L!==h&&b.setAttribute(o,h)},t=(o,h)=>{h?E(o,""):E(o,null)};E("selected",r!=null?String(r):null),E("value",s||null),E("orientation",n&&n!=="horizontal"?n:null),E("activation",c&&c!=="auto"?c:null),E("variant",m&&m!=="default"?m:null),E("size",l&&l!=="md"?l:null),E("tone",i&&i!=="brand"?i:null),t("stretched",d),t("headless",v)},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-tabs",{ref:A,...p},f)});xe.displayName="Tabs";const De=e.forwardRef(function({children:f,open:r,placement:s,variant:n,density:c,shape:m,elevation:l,tone:i,closeOnSelect:d,typeahead:v,onOpen:u,onClose:y,onChange:p,onSelect:g,onSelectDetail:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>u==null?void 0:u(),L=()=>y==null?void 0:y(),H=k=>{var P;const R=(P=k.detail)==null?void 0:P.open;typeof R=="boolean"&&(p==null||p(R))},a=k=>{const R=k.detail||{};A==null||A(R),typeof R.index=="number"&&(g==null||g(R.index))};return o.addEventListener("open",h),o.addEventListener("close",L),o.addEventListener("change",H),o.addEventListener("select",a),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L),o.removeEventListener("change",H),o.removeEventListener("select",a)}},[u,y,p,g,A]),e.useEffect(()=>{const o=t.current;!o||r==null||(r?o.setAttribute("open",""):o.removeAttribute("open"))},[r]),e.useEffect(()=>{const o=t.current;o&&(s?o.setAttribute("placement",s):o.removeAttribute("placement"))},[s]),e.useEffect(()=>{const o=t.current;o&&(n&&n!=="default"?o.setAttribute("variant",n):o.removeAttribute("variant"))},[n]),e.useEffect(()=>{const o=t.current;o&&(c&&c!=="default"?o.setAttribute("density",c):o.removeAttribute("density"))},[c]),e.useEffect(()=>{const o=t.current;o&&(m&&m!=="default"?o.setAttribute("shape",m):o.removeAttribute("shape"))},[m]),e.useEffect(()=>{const o=t.current;o&&(l&&l!=="default"?o.setAttribute("elevation",l):o.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const o=t.current;o&&(i&&i!=="default"&&i!=="brand"?o.setAttribute("tone",i):o.removeAttribute("tone"))},[i]),e.useEffect(()=>{const o=t.current;if(o){if(d==null){o.removeAttribute("close-on-select");return}o.setAttribute("close-on-select",d?"true":"false")}},[d]),e.useEffect(()=>{const o=t.current;if(o){if(v==null){o.removeAttribute("typeahead");return}o.setAttribute("typeahead",v?"true":"false")}},[v]),e.createElement("ui-menu",{ref:t,...b},f)});De.displayName="Menu";const Be=e.forwardRef(function({children:f,name:r,iconVariant:s,size:n,color:c,secondaryColor:m,variant:l,tone:i,shape:d,spin:v,pulse:u,badge:y,label:p,decorative:g,strokeWidth:A,absoluteStrokeWidth:b,strokeLinecap:E,strokeLinejoin:t,rotate:o,flip:h,rtl:L,...H},a){const k=e.useRef(null);return e.useImperativeHandle(a,()=>k.current),e.useEffect(()=>{const R=k.current;R&&(r?R.setAttribute("name",r):R.removeAttribute("name"),s?R.setAttribute("icon-variant",s):R.removeAttribute("icon-variant"),n!=null&&n!==""?R.setAttribute("size",String(n)):R.removeAttribute("size"),c?R.setAttribute("color",c):R.removeAttribute("color"),m?R.setAttribute("secondary-color",m):R.removeAttribute("secondary-color"),l&&l!=="default"?R.setAttribute("variant",l):R.removeAttribute("variant"),i&&i!=="default"?R.setAttribute("tone",i):R.removeAttribute("tone"),d&&d!=="default"?R.setAttribute("shape",d):R.removeAttribute("shape"),v?R.setAttribute("spin",""):R.removeAttribute("spin"),u?R.setAttribute("pulse",""):R.removeAttribute("pulse"),y?R.setAttribute("badge",""):R.removeAttribute("badge"),p?R.setAttribute("label",p):R.removeAttribute("label"),g?R.setAttribute("decorative",""):R.removeAttribute("decorative"),A!=null&&A!==""?R.setAttribute("stroke-width",String(A)):R.removeAttribute("stroke-width"),b?R.setAttribute("absolute-stroke-width",""):R.removeAttribute("absolute-stroke-width"),E?R.setAttribute("stroke-linecap",E):R.removeAttribute("stroke-linecap"),t?R.setAttribute("stroke-linejoin",t):R.removeAttribute("stroke-linejoin"),o!=null&&Number.isFinite(o)?R.setAttribute("rotate",String(o)):R.removeAttribute("rotate"),h?R.setAttribute("flip",h):R.removeAttribute("flip"),L?R.setAttribute("rtl",""):R.removeAttribute("rtl"))},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L]),e.createElement("ui-icon",{ref:k,...H},f)});Be.displayName="Icon";const se={default:"",success:"Success: ",error:"Error: ",warning:"Warning: ",info:"Info: "};function jt(w,f={}){return V.showToast(w,f)}const Gt={show(w,f={}){return V.showToast(w,f)},success(w,f={}){return V.showToast(`${se.success}${w}`,f)},error(w,f={}){return V.showToast(`${se.error}${w}`,f)},warning(w,f={}){return V.showToast(`${se.warning}${w}`,f)},info(w,f={}){return V.showToast(`${se.info}${w}`,f)}};function _t(){return null}const qe=e.forwardRef(function({children:f,headless:r,onShow:s,onHide:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=u=>{const y=u.detail;y&&(s==null||s(y))},v=u=>{const y=u.detail;y&&(n==null||n(y))};return i.addEventListener("show",d),i.addEventListener("hide",v),()=>{i.removeEventListener("show",d),i.removeEventListener("hide",v)}},[s,n]),e.useEffect(()=>{const i=l.current;i&&(r?i.setAttribute("headless",""):i.removeAttribute("headless"))},[r]),e.createElement("ui-toast",{ref:l,...c},f)});qe.displayName="Toast";function ee(w,f){if(typeof window>"u"||typeof customElements>"u"||customElements.get(w))return;const r=`__editora_warned_${w}`,s=window;s[r]||(s[r]=!0,console.warn(`[ui-react/${f}] ${w} is not registered. Import/register the matching web component before using this wrapper.`))}function Mt(w){const{children:f,anchorId:r,open:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-floating-toolbar","FloatingToolbar")},[]),e.useEffect(()=>{var l,i;const m=c.current;m&&(s&&r?(l=m.showForAnchorId)==null||l.call(m,r):(i=m.hide)==null||i.call(m))},[s,r]),e.createElement("ui-floating-toolbar",{ref:c,...n},f)}const $e=K.forwardRef(function({children:f,orientation:r,density:s,ariaLabel:n,...c},m){const l=K.useRef(null);return K.useImperativeHandle(m,()=>l.current),K.useEffect(()=>{ee("ui-block-controls","BlockControls")},[]),K.useEffect(()=>{const i=l.current;i&&(r?i.setAttribute("orientation",r):i.removeAttribute("orientation"),s?i.setAttribute("density",s):i.removeAttribute("density"),n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label"))},[r,s,n]),K.createElement("ui-block-controls",{ref:l,...c},f)});$e.displayName="BlockControls";function Qt(w){const{children:f,open:r,onSelect:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-command-palette","CommandPalette")},[]),e.useEffect(()=>{const m=c.current;if(!m)return;const l=i=>{var v;const d=(v=i.detail)==null?void 0:v.index;typeof d=="number"&&(s==null||s(d))};return m.addEventListener("select",l),r?m.setAttribute("open",""):m.removeAttribute("open"),()=>m.removeEventListener("select",l)},[r,s]),e.createElement("ui-command-palette",{ref:c,...n},f)}function It(w){const{items:f,anchorId:r,anchorPoint:s,open:n,variant:c,density:m,shape:l,elevation:i,tone:d,closeOnSelect:v,typeahead:u,children:y,onOpen:p,onClose:g,onChange:A,onSelect:b,...E}=w,t=e.useRef(null);e.useEffect(()=>{const H=t.current;if(!H)return;const a=()=>p==null?void 0:p(),k=()=>g==null?void 0:g(),R=F=>{var T;const B=(T=F.detail)==null?void 0:T.open;typeof B=="boolean"&&(A==null||A(B))},P=F=>{b==null||b(F.detail)};return H.addEventListener("open",a),H.addEventListener("close",k),H.addEventListener("change",R),H.addEventListener("select",P),()=>{H.removeEventListener("open",a),H.removeEventListener("close",k),H.removeEventListener("change",R),H.removeEventListener("select",P)}},[p,g,A,b]),e.useEffect(()=>{const H=t.current;if(!(!H||n==null)){if(!n){H.close?H.close():H.open=!1;return}if(s&&H.openAt){H.openAt(s);return}if(r){if(H.openForAnchorId){H.openForAnchorId(r);return}if(H.showForAnchorId){H.showForAnchorId(r);return}}H.open=!0}},[n,r,s]);const o=H=>H?H.map((a,k)=>{if(a.separator)return e.createElement("div",{key:k,className:"separator",role:"separator"});let R=null;a.icon&&(R=typeof a.icon=="string"?e.createElement("span",{className:"icon"},a.icon):a.icon);let P=null;return a.submenu&&(P=e.createElement("div",{className:"submenu"},o(a.submenu))),e.createElement("div",{key:k,className:"menuitem",role:"menuitem",tabIndex:a.disabled?-1:0,"aria-disabled":a.disabled?"true":void 0,"data-value":a.value,onClick:a.disabled?void 0:a.onClick},R,e.createElement("span",{className:"label"},a.label),a.submenu&&e.createElement("span",{className:"submenu-arrow"},"▶"),P)}):null,h=e.Children.count(y)>0,L=!!n&&!s&&!r;return e.createElement("ui-context-menu",{ref:t,...E,...L?{open:""}:{},...c&&c!=="default"?{variant:c}:{},...m&&m!=="default"?{density:m}:{},...l&&l!=="default"?{shape:l}:{},...i&&i!=="default"?{elevation:i}:{},...d&&d!=="default"&&d!=="brand"?{tone:d}:{},...v==null?{}:{"close-on-select":v?"true":"false"},...u==null?{}:{typeahead:u?"true":"false"}},h?y:e.createElement("div",{slot:"menu"},o(f)))}function Kt(w){const{children:f,anchorId:r,open:s,placement:n,offset:c,strategy:m,arrow:l,variant:i,tone:d,radius:v,size:u,closeOnOutside:y,closeOnEscape:p,onOpen:g,onClose:A,onOpenChange:b,...E}=w,t=e.useRef(null);return e.useEffect(()=>{ee("ui-selection-popup","SelectionPopup")},[]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>{g==null||g(),b==null||b(!0)},L=()=>{A==null||A(),b==null||b(!1)};return o.addEventListener("open",h),o.addEventListener("close",L),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L)}},[g,A,b]),e.useEffect(()=>{var H,a;const o=t.current;if(!o)return;const h=(k,R)=>{const P=o.getAttribute(k);if(R==null){P!=null&&o.removeAttribute(k);return}P!==R&&o.setAttribute(k,R)},L=(k,R,P=void 0)=>{if(R==null){P!==void 0&&h(k,P?null:"false");return}R?h(k,""):h(k,"false")};h("anchor-id",r??null),h("placement",n&&n!=="top"?n:null),h("offset",typeof c=="number"&&Number.isFinite(c)?String(c):null),h("strategy",m&&m!=="fixed"?m:null),h("variant",i&&i!=="default"?i:null),h("tone",d&&d!=="brand"?d:null),h("radius",v?String(v):null),h("size",u&&u!=="md"?u:null),L("arrow",l),L("close-on-outside",y,!0),L("close-on-escape",p,!0),s&&r?(H=o.openFor)==null||H.call(o,r):s?o.setAttribute("open",""):s===!1?(a=o.close)==null||a.call(o):o.removeAttribute("open")},[s,r,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-selection-popup",{ref:t,...E},f)}function Ut(w){const{children:f,open:r,position:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-plugin-panel","PluginPanel")},[]),e.useEffect(()=>{const m=c.current;m&&(r?m.setAttribute("open",""):m.removeAttribute("open"),s&&m.setAttribute("position",s))},[r,s]),e.createElement("ui-plugin-panel",{ref:c,...n},f)}const Je=e.forwardRef(function(f,r){const{children:s,onSubmit:n,onInvalid:c,onValidate:m,onAutosave:l,onDirtyChange:i,novalidate:d,autosave:v,autosaveDelay:u,guardUnsaved:y,variant:p,tone:g,density:A,shape:b,elevation:E,gap:t,headless:o,loading:h,...L}=f,H=e.useRef(null);return e.useImperativeHandle(r,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=T=>{const N=T.detail||{};n==null||n(N.values||{})},R=T=>{const N=T.detail||{};c==null||c(N.errors||{},N.values||{})},P=T=>{const N=T.detail||{};m==null||m({valid:!!N.valid,errors:N.errors||{}})},F=T=>{const N=T.detail||{};l==null||l(N.values||{})},B=T=>{const N=T.detail||{};i==null||i(!!N.dirty,N.values||{})};return a.addEventListener("submit",k),a.addEventListener("invalid",R),a.addEventListener("validate",P),a.addEventListener("autosave",F),a.addEventListener("dirty-change",B),()=>{a.removeEventListener("submit",k),a.removeEventListener("invalid",R),a.removeEventListener("validate",P),a.removeEventListener("autosave",F),a.removeEventListener("dirty-change",B)}},[n,c,m,l,i]),e.useEffect(()=>{const a=H.current;a&&(d?a.setAttribute("novalidate",""):a.removeAttribute("novalidate"),v?a.setAttribute("autosave",""):a.removeAttribute("autosave"),typeof u=="number"&&Number.isFinite(u)?a.setAttribute("autosave-delay",String(u)):a.removeAttribute("autosave-delay"),y?a.setAttribute("guard-unsaved",""):a.removeAttribute("guard-unsaved"),p&&p!=="default"?a.setAttribute("variant",p):a.removeAttribute("variant"),g&&g!=="default"?a.setAttribute("tone",g):a.removeAttribute("tone"),A&&A!=="default"?a.setAttribute("density",A):a.removeAttribute("density"),b&&b!=="default"?a.setAttribute("shape",b):a.removeAttribute("shape"),E&&E!=="default"?a.setAttribute("elevation",E):a.removeAttribute("elevation"),t?a.setAttribute("gap",t):a.removeAttribute("gap"),o?a.setAttribute("headless",""):a.removeAttribute("headless"),h?a.setAttribute("loading",""):a.removeAttribute("loading"))},[d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-form",{ref:H,...L},s)});Je.displayName="Form";function Xt(){const w=e.useRef(null),f=e.useCallback(async()=>{const l=w.current;return l?await l.submit():!1},[]),r=e.useCallback(async()=>{const l=w.current;return l?await l.validate():{valid:!0,errors:{}}},[]),s=e.useCallback(()=>{var i;const l=w.current;return l?(i=l.getValues)==null?void 0:i.call(l):{}},[]),n=e.useCallback(l=>{var d;const i=w.current;return(d=i==null?void 0:i.reset)==null?void 0:d.call(i,l)},[]),c=e.useCallback(()=>{var i;const l=w.current;return l?typeof l.isDirty=="function"?!!l.isDirty():((i=l.hasAttribute)==null?void 0:i.call(l,"dirty"))||!1:!1},[]),m=e.useCallback(l=>{var d;const i=w.current;return(d=i==null?void 0:i.markClean)==null?void 0:d.call(i,l)},[]);return{ref:w,submit:f,validate:r,getValues:s,reset:n,isDirty:c,markClean:m}}function Yt(w){const{placement:f="bottom",offset:r=8,open:s,onOpen:n,onClose:c,role:m="menu"}=w||{},l=e.useRef(null),i=e.useRef(null),d=e.useRef(null),[v,u]=e.useState({top:0,left:0,placement:f}),y=typeof s<"u",[p,g]=e.useState(!!s),A=y?s:p,b=S=>{y||g(S),S?n&&n():c&&c()},E=()=>b(!A),t=()=>b(!0),o=()=>b(!1),h=e.useCallback(()=>{const S=l.current,x=i.current;if(!S||!x)return;const D=V.computePosition(S,x,{placement:f,offset:r});u({top:Math.round(D.top),left:Math.round(D.left),placement:D.placement,arrow:D.x||D.y?{x:D.x,y:D.y}:void 0})},[f,r]);e.useEffect(()=>{if(!A)return;const S=l.current,x=i.current;if(!S||!x)return;h();const D=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>h())},q=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>h())};window.addEventListener("scroll",D,!0),window.addEventListener("resize",q);let $=null,j=null;try{typeof ResizeObserver<"u"&&($=new ResizeObserver(q),j=new ResizeObserver(q),$.observe(S),j.observe(x))}catch{$=j=null}return()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",q),$&&$.disconnect(),j&&j.disconnect(),d.current&&cancelAnimationFrame(d.current)}},[A,h]);const L=e.useCallback(S=>{l.current=S},[]),H=e.useCallback(S=>{i.current=S},[]),a=e.useRef(`floating-${Math.random().toString(36).slice(2,9)}`),k=()=>i.current?Array.from(i.current.querySelectorAll('[role="menuitem"], .item, [data-menu-item]')).filter(Boolean):[],R=S=>{const x=k();if(!x.length)return;const D=Math.max(0,Math.min(x.length-1,S));try{x[D].focus()}catch{}},P=()=>R(0),F=()=>{const S=k();S.length&&R(S.length-1)},B=()=>{const S=k(),x=S.findIndex(D=>D===document.activeElement);R(x<0?0:(x+1)%S.length)},T=()=>{const S=k(),x=S.findIndex(D=>D===document.activeElement);R(x<=0?S.length-1:x-1)};return{referenceRef:L,floatingRef:H,coords:v,update:h,open:A,setOpen:b,toggle:E,openPopup:t,closePopup:o,getReferenceProps:(S={})=>({ref:L,"aria-haspopup":m,"aria-controls":a.current,"aria-expanded":A?"true":"false",onClick:x=>{S.onClick&&S.onClick(x),E()},onKeyDown:x=>{S.onKeyDown&&S.onKeyDown(x),x.key==="ArrowDown"&&(x.preventDefault(),t(),setTimeout(()=>P(),0))},...S}),getFloatingProps:(S={})=>({id:a.current,ref:H,role:m,tabIndex:-1,style:{position:"absolute",top:`${v.top}px`,left:`${v.left}px`},hidden:!A,onKeyDown:x=>{S.onKeyDown&&S.onKeyDown(x),x.key==="Escape"?(x.preventDefault(),o()):x.key==="ArrowDown"?(x.preventDefault(),B()):x.key==="ArrowUp"?(x.preventDefault(),T()):x.key==="Home"?(x.preventDefault(),P()):x.key==="End"&&(x.preventDefault(),F())},...S}),focusFirstItem:P,focusLastItem:F,focusNext:B,focusPrev:T}}function U(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function Zt(w){const{children:f,className:r,variant:s,tone:n,elevation:c,radius:m,interactive:l,headless:i,p:d,px:v,py:u,pt:y,pr:p,pb:g,pl:A,m:b,mx:E,my:t,mt:o,mr:h,mb:L,ml:H,width:a,w:k,minWidth:R,minW:P,maxWidth:F,maxW:B,height:T,h:N,minHeight:I,minH:S,maxHeight:x,maxH:D,display:q,position:$,inset:j,top:_,right:G,bottom:Q,left:M,flexBasis:J,flexGrow:Z,flexShrink:Y,gridArea:re,gridColumn:ie,gridColumnStart:C,gridColumnEnd:z,gridRow:le,gridRowStart:W,gridRowEnd:X,align:yt,bg:Lt,color:gt,...ht}=w,wt={className:r,...ht,p:U(d),px:U(v),py:U(u),pt:U(y),pr:U(p),pb:U(g),pl:U(A),m:U(b),mx:U(E),my:U(t),mt:U(o),mr:U(h),mb:U(L),ml:U(H),width:U(a),w:U(k),minwidth:U(R??P),maxwidth:U(F??B),height:U(T),h:U(N),minheight:U(I??S),maxheight:U(x??D),display:U(q),position:U($),inset:U(j),top:U(_),right:U(G),bottom:U(Q),left:U(M),flexbasis:U(J),flexgrow:U(Z),flexshrink:U(Y),gridarea:U(re),gridcolumn:U(ie),gridcolumnstart:U(C),gridcolumnend:U(z),gridrow:U(le),gridrowstart:U(W),gridrowend:U(X),align:U(yt),bg:U(Lt),color:U(gt),variant:s&&s!=="default"?s:void 0,tone:n&&n!=="default"?n:void 0,elevation:c&&c!=="default"?c:void 0,radius:m&&m!=="default"?m:void 0,interactive:l?"":void 0,headless:i?"":void 0};return e.createElement("ui-box",wt,f)}function te(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function zt(w){const{children:f,className:r,direction:s,align:n,justify:c,wrap:m,gap:l,rowGap:i,columnGap:d,display:v,headless:u,...y}=w,p={className:r,...y,direction:te(s),align:te(n),justify:te(c),wrap:te(m),gap:te(l),rowgap:te(i),columngap:te(d),display:te(v),headless:u?"":void 0};return e.createElement("ui-flex",p,f)}function O(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function Wt(w){const{children:f,className:r,columns:s,rows:n,gap:c,rowGap:m,columnGap:l,autoFlow:i,autoRows:d,autoColumns:v,align:u,justify:y,place:p,alignContent:g,justifyContent:A,placeContent:b,display:E,headless:t,...o}=w,h={className:r,...o,columns:O(s),rows:O(n),gap:O(c),rowgap:O(m),columngap:O(l),autoflow:O(i),autorows:O(d),autocolumns:O(v),align:O(u),justify:O(y),place:O(p),aligncontent:O(g),justifycontent:O(A),placecontent:O(b),display:O(E),headless:t?"":void 0};return e.createElement("ui-grid",h,f)}const je=e.forwardRef(function({size:f="medium",variant:r="default",tone:s="neutral",radius:n="md",density:c="comfortable",inset:m,children:l,...i},d){const v=e.useRef(null);return e.useImperativeHandle(d,()=>v.current),e.useEffect(()=>{const u=v.current;if(!u)return;const y=(g,A)=>{const b=u.getAttribute(g);if(A==null){b!=null&&u.removeAttribute(g);return}b!==A&&u.setAttribute(g,A)},p=(g,A)=>{A?u.hasAttribute(g)||u.setAttribute(g,""):u.hasAttribute(g)&&u.removeAttribute(g)};y("size",f!=="medium"?f:null),y("variant",r!=="default"?r:null),y("tone",s!=="neutral"?s:null),y("radius",n!=="md"?n:null),y("density",c!=="comfortable"?c:null),p("inset",m)},[f,r,s,n,c,m]),e.createElement("ui-section",{ref:v,...i},l)});je.displayName="Section";function Ot(w){const{children:f,size:r="md",...s}=w;return e.createElement("ui-container",{size:r,...s},f)}const Ge=e.forwardRef(function({children:f,collapsed:r,collapsible:s,rail:n,position:c,value:m,items:l,variant:i,size:d,density:v,tone:u,showIcons:y,showBadges:p,headless:g,onSelect:A,onChange:b,onToggle:E,onCollapseChange:t,...o},h){const L=e.useRef(null);return e.useImperativeHandle(h,()=>L.current),e.useEffect(()=>{const H=L.current;if(!H)return;const a=F=>{const B=F.detail;B&&(A==null||A(B))},k=F=>{const B=F.detail;B&&(b==null||b(B))},R=F=>{var T;const B=(T=F.detail)==null?void 0:T.collapsed;typeof B=="boolean"&&(E==null||E(B))},P=F=>{var T;const B=(T=F.detail)==null?void 0:T.collapsed;typeof B=="boolean"&&(t==null||t(B))};return H.addEventListener("select",a),H.addEventListener("change",k),H.addEventListener("toggle",R),H.addEventListener("collapse-change",P),()=>{H.removeEventListener("select",a),H.removeEventListener("change",k),H.removeEventListener("toggle",R),H.removeEventListener("collapse-change",P)}},[A,b,E,t]),e.useEffect(()=>{const H=L.current;if(!H)return;const a=(R,P)=>{const F=H.getAttribute(R);if(P==null){F!=null&&H.removeAttribute(R);return}F!==P&&H.setAttribute(R,P)},k=(R,P,F)=>{if(P==null){F!==void 0&&F===!1&&a(R,null);return}P?a(R,""):a(R,null)};if(k("collapsed",r),k("collapsible",s),k("rail",n),k("headless",g),a("position",c&&c!=="left"?c:null),a("value",m!=null&&m!==""?String(m):null),l&&l.length)try{a("items",JSON.stringify(l))}catch{a("items",null)}else a("items",null);a("variant",i&&i!=="surface"?i:null),a("size",d&&d!=="md"?d:null),a("density",v&&v!=="default"?v:null),a("tone",u&&u!=="default"?u:null),typeof y=="boolean"?a("show-icons",y?"true":"false"):a("show-icons",null),typeof p=="boolean"?a("show-badges",p?"true":"false"):a("show-badges",null)},[r,s,n,g,c,m,l,i,d,v,u,y,p]),e.createElement("ui-sidebar",{ref:L,...o},f)});Ge.displayName="Sidebar";const _e=e.forwardRef(function({children:f,separator:r,maxItems:s,onSelect:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i||!n)return;const d=v=>{const u=v.detail;u&&n(u)};return i.addEventListener("select",d),()=>i.removeEventListener("select",d)},[n]),e.useEffect(()=>{const i=l.current;i&&(r!=null&&r!==""?i.setAttribute("separator",r):i.removeAttribute("separator"))},[r]),e.useEffect(()=>{const i=l.current;i&&(typeof s=="number"&&Number.isFinite(s)?i.setAttribute("max-items",String(s)):i.removeAttribute("max-items"))},[s]),e.createElement("ui-breadcrumb",{ref:l,...c},f)});_e.displayName="Breadcrumb";const Me=e.forwardRef(function({children:f,sticky:r,bordered:s,dense:n,showMenuButton:c,onMenuTrigger:m,...l},i){const d=e.useRef(null);return e.useImperativeHandle(i,()=>d.current),e.useEffect(()=>{const v=d.current;if(!v||!m)return;const u=()=>m();return v.addEventListener("menu-trigger",u),()=>v.removeEventListener("menu-trigger",u)},[m]),e.useEffect(()=>{const v=d.current;v&&(r?v.setAttribute("sticky",""):v.removeAttribute("sticky"))},[r]),e.useEffect(()=>{const v=d.current;v&&(s?v.setAttribute("bordered",""):v.removeAttribute("bordered"))},[s]),e.useEffect(()=>{const v=d.current;v&&(n?v.setAttribute("dense",""):v.removeAttribute("dense"))},[n]),e.useEffect(()=>{const v=d.current;v&&(c?v.setAttribute("show-menu-button",""):v.removeAttribute("show-menu-button"))},[c]),e.createElement("ui-app-header",{ref:d,...l},f)});Me.displayName="AppHeader";const Qe=e.forwardRef(function({children:f,open:r,side:s,variant:n,density:c,shape:m,elevation:l,tone:i,size:d,inset:v,dismissible:u,onOpen:y,onClose:p,onChange:g,...A},b){const E=e.useRef(null);return e.useImperativeHandle(b,()=>E.current),e.useEffect(()=>{const t=E.current;if(!t)return;const o=()=>y==null?void 0:y(),h=()=>p==null?void 0:p(),L=H=>{var k;const a=(k=H.detail)==null?void 0:k.open;typeof a=="boolean"&&(g==null||g(a))};return t.addEventListener("open",o),t.addEventListener("close",h),t.addEventListener("change",L),()=>{t.removeEventListener("open",o),t.removeEventListener("close",h),t.removeEventListener("change",L)}},[y,p,g]),e.useEffect(()=>{const t=E.current;t&&(r?t.setAttribute("open",""):t.removeAttribute("open"))},[r]),e.useEffect(()=>{const t=E.current;t&&(s?t.setAttribute("side",s):t.removeAttribute("side"))},[s]),e.useEffect(()=>{const t=E.current;t&&(u?t.setAttribute("dismissible",""):t.removeAttribute("dismissible"))},[u]),e.useEffect(()=>{const t=E.current;t&&(n&&n!=="default"?t.setAttribute("variant",n):t.removeAttribute("variant"))},[n]),e.useEffect(()=>{const t=E.current;t&&(c&&c!=="default"?t.setAttribute("density",c):t.removeAttribute("density"))},[c]),e.useEffect(()=>{const t=E.current;t&&(m&&m!=="default"?t.setAttribute("shape",m):t.removeAttribute("shape"))},[m]),e.useEffect(()=>{const t=E.current;t&&(l&&l!=="default"?t.setAttribute("elevation",l):t.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const t=E.current;t&&(i&&i!=="default"&&i!=="brand"?t.setAttribute("tone",i):t.removeAttribute("tone"))},[i]),e.useEffect(()=>{const t=E.current;t&&(d&&d!=="default"?t.setAttribute("size",d):t.removeAttribute("size"))},[d]),e.useEffect(()=>{const t=E.current;t&&(v?t.setAttribute("inset",""):t.removeAttribute("inset"))},[v]),e.createElement("ui-drawer",{ref:E,...A},f)});Qe.displayName="Drawer";const Ie=e.forwardRef(function({children:f,mode:r,variant:s,density:n,maxWidth:c,sidebarSide:m,collapsed:l,headless:i,sidebarWidth:d,asideWidth:v,onLayoutChange:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=()=>u==null?void 0:u();return A.addEventListener("layoutchange",b),()=>A.removeEventListener("layoutchange",b)},[u]),e.useEffect(()=>{const A=g.current;A&&(r&&r!=="dashboard"?A.setAttribute("mode",r):A.removeAttribute("mode"),s&&s!=="default"?A.setAttribute("variant",s):A.removeAttribute("variant"),n&&n!=="default"?A.setAttribute("density",n):A.removeAttribute("density"),c?A.setAttribute("max-width",c):A.removeAttribute("max-width"),m&&m!=="start"?A.setAttribute("sidebar-side",m):A.removeAttribute("sidebar-side"),l?A.setAttribute("collapsed",""):A.removeAttribute("collapsed"),i?A.setAttribute("headless",""):A.removeAttribute("headless"),d?A.setAttribute("sidebar-width",d):A.removeAttribute("sidebar-width"),v?A.setAttribute("aside-width",v):A.removeAttribute("aside-width"))},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-layout",{ref:g,...y},f)});Ie.displayName="Layout";const Ke=e.createContext(null);function Vt(){try{const w=getComputedStyle(document.documentElement),f=w.getPropertyValue("--ui-color-primary").trim();return f?{colors:{primary:f||void 0,text:w.getPropertyValue("--ui-color-text").trim()||void 0,background:w.getPropertyValue("--ui-color-background").trim()||void 0}}:{}}catch{return{}}}function Ct({tokens:w,children:f,storageKey:r="editora.theme.tokens"}){const s=()=>{if(typeof window<"u"&&r)try{const l=localStorage.getItem(r);if(l)return JSON.parse(l)}catch{}if(w&&Object.keys(w).length)return{...V.defaultTokens,...w};if(typeof window<"u"){const l=Vt();if(l.colors&&l.colors.primary)return{...V.defaultTokens,...l}}return{...V.defaultTokens,...w||{}}},[n,c]=e.useState(()=>s());e.useEffect(()=>{w&&Object.keys(w).length&&c(l=>({...l,...w}))},[w]),e.useEffect(()=>{V.applyTheme(n);try{V.registerThemeHost(document.documentElement)}catch{}if(typeof window<"u"&&r){const l=JSON.stringify(n);let i;const d=()=>{try{localStorage.setItem(r,l)}catch{}};return window.requestIdleCallback?i=window.requestIdleCallback(d,{timeout:1e3}):i=window.setTimeout(d,250),()=>{try{window.cancelIdleCallback&&i?window.cancelIdleCallback(i):i&&clearTimeout(i)}catch{}}}},[n,r]);const m=l=>c(l);return e.createElement(Ke.Provider,{value:{tokens:n,setTokens:m}},f)}function er(){const w=e.useContext(Ke);if(!w)throw new Error("useTheme must be used within ThemeProvider");return w}function ne(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function ue(w,f,r,s){const n=r&&r!==s?r:void 0;if(!n){w.removeAttribute(f);return}w.setAttribute(f,n)}const Ue=K.forwardRef(function({checked:f,disabled:r,indeterminate:s,loading:n,headless:c,invalid:m,density:l,preset:i,onCheckedChange:d,onChange:v,onInput:u,children:y,...p},g){const A=K.useRef(null);K.useImperativeHandle(g,()=>A.current);const b=typeof window<"u"?K.useLayoutEffect:K.useEffect;K.useEffect(()=>{ee("ui-checkbox","Checkbox")},[]),b(()=>{const t=A.current;t&&(ne(t,"checked",f),ne(t,"disabled",r),ne(t,"indeterminate",s),ne(t,"loading",n),ne(t,"headless",c),ne(t,"invalid",m),ue(t,"density",l,"default"),ue(t,"preset",i,"default"))},[f,r,s,n,c,m,l,i]),K.useEffect(()=>{const t=A.current;if(!t||!d&&!v&&!u)return;const o=L=>{var a;const H=L;u==null||u(H),typeof((a=H.detail)==null?void 0:a.checked)=="boolean"&&(d==null||d(H.detail.checked,H.detail))},h=L=>{const H=L;v==null||v(H)};return t.addEventListener("input",o),t.addEventListener("change",h),()=>{t.removeEventListener("input",o),t.removeEventListener("change",h)}},[d,v,u]);const E={ref:A,...p,checked:f?"":void 0,disabled:r?"":void 0,indeterminate:s?"":void 0,loading:n?"":void 0,headless:c?"":void 0,invalid:m?"":void 0,density:l&&l!=="default"?l:void 0,preset:i&&i!=="default"?i:void 0};return K.createElement("ui-checkbox",E,y)});Ue.displayName="Checkbox";const Xe=e.forwardRef(function({value:f,disabled:r,required:s,name:n,orientation:c,variant:m,size:l,tone:i,options:d,onValueChange:v,children:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=E=>{const t=E.detail;t&&(v==null||v(t))};return A.addEventListener("change",b),()=>A.removeEventListener("change",b)},[v]),e.useEffect(()=>{const A=g.current;if(!A)return;const b=(t,o)=>{const h=A.getAttribute(t);if(o==null){h!=null&&A.removeAttribute(t);return}h!==o&&A.setAttribute(t,o)},E=(t,o)=>{o?A.hasAttribute(t)||A.setAttribute(t,""):A.hasAttribute(t)&&A.removeAttribute(t)};b("value",f??null),E("disabled",r),E("required",s),b("name",n||null),b("orientation",c&&c!=="vertical"?c:null),b("variant",m&&m!=="default"?m:null),b("size",l&&l!=="md"?l:null),b("tone",i&&i!=="brand"?i:null),d&&d.length?b("options",JSON.stringify(d)):b("options",null)},[f,r,s,n,c,m,l,i,d]),e.createElement("ui-radio-group",{ref:g,...y},u)});Xe.displayName="RadioGroup";const Ye=e.forwardRef(function({children:f,checked:r,disabled:s,headless:n,loading:c,size:m,variant:l,tone:i,label:d,description:v,name:u,value:y,required:p,onInput:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(g==null||g(a))},L=H=>{const a=H.detail;a&&(A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("checked",r),L("disabled",s),L("headless",n),L("loading",c),L("required",p),h("size",m&&m!=="md"?m:null),h("variant",l&&l!=="default"?l:null),h("tone",i&&i!=="brand"?i:null),h("label",d||null),h("description",v||null),h("name",u||null),h("value",y||null)},[r,s,n,c,p,m,l,i,d,v,u,y]),e.createElement("ui-switch",{ref:t,...b},f)});Ye.displayName="Switch";const Ze=e.forwardRef(function({children:f,pressed:r,disabled:s,loading:n,headless:c,size:m,variant:l,tone:i,name:d,value:v,required:u,iconOn:y,iconOff:p,onInput:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(g==null||g(a))},L=H=>{const a=H.detail;a&&(A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("pressed",r),L("disabled",s),L("loading",n),L("headless",c),L("required",u),h("size",m&&m!=="md"?m:null),h("variant",l&&l!=="default"?l:null),h("tone",i&&i!=="brand"?i:null),h("name",d||null),h("value",v||null),h("icon-on",y||null),h("icon-off",p||null)},[r,s,n,c,u,m,l,i,d,v,y,p]),e.createElement("ui-toggle",{ref:t,...b},f)});Ze.displayName="Toggle";const ze=e.forwardRef(function({children:f,value:r,multiple:s,disabled:n,headless:c,orientation:m,variant:l,size:i,density:d,allowEmpty:v,required:u,activation:y,onInput:p,onChange:g,onValueChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(p==null||p(a),A==null||A(a))},L=H=>{const a=H.detail;a&&(g==null||g(a),A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[p,g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("multiple",s),L("disabled",n),L("headless",c),L("allow-empty",v),L("required",u),r==null?h("value",null):Array.isArray(r)?h("value",JSON.stringify(r)):h("value",String(r)),h("orientation",m&&m!=="horizontal"?m:null),h("variant",l&&l!=="default"?l:null),h("size",i&&i!=="md"?i:null),h("density",d&&d!=="default"?d:null),h("activation",y&&y!=="auto"?y:null)},[r,s,n,c,v,u,m,l,i,d,y]),e.createElement("ui-toggle-group",{ref:t,...b},f)});ze.displayName="ToggleGroup";function tr(w){if(w!=null){if(typeof w=="string")return w;if(!(!Number.isFinite(w)||w<=0))return Math.abs(w-16/9)<.01?"16/9":Math.abs(w-4/3)<.01?"4/3":Math.abs(w-1)<.01?"1/1":`${w}/1`}}const We=K.forwardRef(function({ratio:f,fit:r,children:s,...n},c){const m=K.useRef(null);return K.useImperativeHandle(c,()=>m.current),K.useEffect(()=>{ee("ui-aspect-ratio","AspectRatio")},[]),K.useEffect(()=>{const l=m.current;if(!l)return;const i=tr(f);i?l.setAttribute("ratio",i):l.removeAttribute("ratio"),r?l.setAttribute("fit",r):l.removeAttribute("fit")},[f,r]),K.createElement("ui-aspect-ratio",{ref:m,...n},s)});We.displayName="AspectRatio";function ce(w){const f=w.trim().split(/\s+/).filter(Boolean);return f.length===0?"?":f.length===1?f[0].slice(0,2).toUpperCase():`${f[0][0]||""}${f[1][0]||""}`.toUpperCase()}function rr(w){if(w!=null)return w==="lazy"||w==="eager"?w:w?"eager":"lazy"}function ir(w,f,r){return w&&w.trim()?w.trim().slice(0,2).toUpperCase():f&&f.trim()?ce(f):typeof r=="string"&&r.trim()?ce(r):"?"}const Oe=K.forwardRef(function({src:f,alt:r,initials:s,size:n,bg:c,color:m,radius:l,fontWeight:i,shape:d,status:v,ring:u,loading:y,children:p,...g},A){const b=K.useRef(null),E=K.useMemo(()=>ir(s,r,p),[s,r,p]);return K.useImperativeHandle(A,()=>b.current),K.useEffect(()=>{ee("ui-avatar","Avatar")},[]),K.useEffect(()=>{const t=b.current;if(!t)return;f?t.setAttribute("src",f):t.removeAttribute("src"),r?t.setAttribute("alt",r):t.removeAttribute("alt"),s?t.setAttribute("initials",s):t.removeAttribute("initials"),n!=null?t.setAttribute("size",String(n)):t.removeAttribute("size"),c?t.setAttribute("bg",c):t.removeAttribute("bg"),m?t.setAttribute("color",m):t.removeAttribute("color"),l?t.setAttribute("radius",l):t.removeAttribute("radius"),i!=null?t.setAttribute("fontweight",String(i)):t.removeAttribute("fontweight"),d?t.setAttribute("shape",d):t.removeAttribute("shape"),v?t.setAttribute("status",v):t.removeAttribute("status"),u==null?t.removeAttribute("ring"):u?t.setAttribute("ring",""):t.removeAttribute("ring");const o=rr(y);o?t.setAttribute("loading",o):t.removeAttribute("loading")},[f,r,s,n,c,m,l,i,d,v,u,y]),K.createElement("ui-avatar",{ref:b,...g},E)});Oe.displayName="Avatar";const Ve=e.forwardRef(function({present:f,headless:r,mode:s,size:n,variant:c,keepMounted:m,lazy:l,enterDuration:i,exitDuration:d,delay:v,onBeforeEnter:u,onEnter:y,onAfterEnter:p,onBeforeExit:g,onExit:A,onAfterExit:b,children:E,...t},o){const h=e.useRef(null);return e.useImperativeHandle(o,()=>h.current),e.useEffect(()=>{const L=h.current;if(!L)return;const H=T=>{const N=T.detail;return(N==null?void 0:N.state)||"hidden"},a=T=>u==null?void 0:u(H(T)),k=T=>y==null?void 0:y(H(T)),R=T=>p==null?void 0:p(H(T)),P=T=>g==null?void 0:g(H(T)),F=T=>A==null?void 0:A(H(T)),B=T=>b==null?void 0:b(H(T));return L.addEventListener("before-enter",a),L.addEventListener("enter",k),L.addEventListener("after-enter",R),L.addEventListener("before-exit",P),L.addEventListener("exit",F),L.addEventListener("after-exit",B),()=>{L.removeEventListener("before-enter",a),L.removeEventListener("enter",k),L.removeEventListener("after-enter",R),L.removeEventListener("before-exit",P),L.removeEventListener("exit",F),L.removeEventListener("after-exit",B)}},[u,y,p,g,A,b]),e.useEffect(()=>{const L=h.current;L&&(f?L.setAttribute("present",""):L.removeAttribute("present"),r?L.setAttribute("headless",""):L.removeAttribute("headless"),s&&s!=="fade"?L.setAttribute("mode",s):L.removeAttribute("mode"),n&&n!=="md"?L.setAttribute("size",n):L.removeAttribute("size"),c&&c!=="default"?L.setAttribute("variant",c):L.removeAttribute("variant"),m?L.setAttribute("keep-mounted",""):L.removeAttribute("keep-mounted"),l?L.setAttribute("lazy",""):L.removeAttribute("lazy"),typeof i=="number"?L.setAttribute("enter-duration",String(i)):L.removeAttribute("enter-duration"),typeof d=="number"?L.setAttribute("exit-duration",String(d)):L.removeAttribute("exit-duration"),typeof v=="number"?L.setAttribute("delay",String(v)):L.removeAttribute("delay"))},[f,r,s,n,c,m,l,i,d,v]),e.createElement("ui-presence",{ref:h,...t},E)});Ve.displayName="Presence";const Ce=e.forwardRef(function({value:f,buffer:r,max:s,min:n,indeterminate:c,striped:m,animated:l,showLabel:i,label:d,format:v,precision:u,size:y,variant:p,tone:g,shape:A,mode:b,onValueChange:E,onComplete:t,children:o,...h},L){const H=e.useRef(null);return e.useImperativeHandle(L,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=P=>{const F=P.detail;F&&(E==null||E(F))},R=P=>{const F=P.detail;F&&(t==null||t(F))};return a.addEventListener("change",k),a.addEventListener("complete",R),()=>{a.removeEventListener("change",k),a.removeEventListener("complete",R)}},[E,t]),e.useEffect(()=>{const a=H.current;if(!a)return;const k=(P,F)=>{const B=a.getAttribute(P);if(F==null){B!=null&&a.removeAttribute(P);return}B!==F&&a.setAttribute(P,F)},R=(P,F)=>{F?a.hasAttribute(P)||a.setAttribute(P,""):a.hasAttribute(P)&&a.removeAttribute(P)};k("value",f!=null?String(f):null),k("buffer",r!=null?String(r):null),k("max",s!=null?String(s):null),k("min",n!=null?String(n):null),R("indeterminate",c),R("striped",m),R("animated",l),R("show-label",i),k("label",d!=null&&d!==""?d:null),k("format",v!=null&&v!=="percent"?v:null),k("precision",u!=null?String(u):null),k("size",y&&y!=="md"?y:null),k("variant",p&&p!=="default"?p:null),k("tone",g&&g!=="brand"?g:null),k("shape",A&&A!=="pill"?A:null),k("mode",b&&b!=="line"?b:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b]),e.createElement("ui-progress",{ref:H,...h},o)});Ce.displayName="Progress";const et=e.forwardRef(function({target:f,headless:r,disabled:s,strategy:n,onMount:c,onUnmount:m,onSync:l,onTargetMissing:i,children:d,...v},u){const y=e.useRef(null);return e.useImperativeHandle(u,()=>y.current),e.useEffect(()=>{const p=y.current;if(!p)return;const g=t=>c==null?void 0:c(t.detail||{count:0}),A=t=>m==null?void 0:m(t.detail||{count:0}),b=t=>l==null?void 0:l(t.detail||{count:0}),E=t=>{const o=t.detail;o&&(i==null||i(o))};return p.addEventListener("mount",g),p.addEventListener("unmount",A),p.addEventListener("sync",b),p.addEventListener("target-missing",E),()=>{p.removeEventListener("mount",g),p.removeEventListener("unmount",A),p.removeEventListener("sync",b),p.removeEventListener("target-missing",E)}},[c,m,l,i]),e.useEffect(()=>{const p=y.current;p&&(f?p.setAttribute("target",f):p.removeAttribute("target"),n&&n!=="append"?p.setAttribute("strategy",n):p.removeAttribute("strategy"),r?p.setAttribute("headless",""):p.removeAttribute("headless"),s?p.setAttribute("disabled",""):p.removeAttribute("disabled"))},[f,n,r,s]),e.createElement("ui-portal",{ref:y,...v},d)});et.displayName="Portal";const tt=e.forwardRef(function({orientation:f,size:r,variant:s,tone:n,autoHide:c,shadows:m,onScrollChange:l,onReachStart:i,onReachEnd:d,children:v,...u},y){const p=e.useRef(null);return e.useImperativeHandle(y,()=>p.current),e.useEffect(()=>{const g=p.current;if(!g)return;const A=t=>{const o=t.detail;o&&(l==null||l(o))},b=()=>i==null?void 0:i(),E=()=>d==null?void 0:d();return g.addEventListener("scroll",A),g.addEventListener("reach-start",b),g.addEventListener("reach-end",E),()=>{g.removeEventListener("scroll",A),g.removeEventListener("reach-start",b),g.removeEventListener("reach-end",E)}},[l,i,d]),e.useEffect(()=>{const g=p.current;if(!g)return;const A=(E,t)=>{const o=g.getAttribute(E);if(t==null){o!=null&&g.removeAttribute(E);return}o!==t&&g.setAttribute(E,t)},b=(E,t)=>{const o=g.getAttribute(E);if(t==null){o!=null&&g.removeAttribute(E);return}const h=t?"true":"false";o!==h&&g.setAttribute(E,h)};A("orientation",f&&f!=="vertical"?f:null),A("size",r&&r!=="md"?r:null),A("variant",s&&s!=="default"?s:null),A("tone",n&&n!=="neutral"?n:null),b("auto-hide",c),b("shadows",m)},[f,r,s,n,c,m]),e.createElement("ui-scroll-area",{ref:p,...u},v)});tt.displayName="ScrollArea";const rt=K.forwardRef((w,f)=>K.createElement("ui-separator",{ref:f,...w}));rt.displayName="Separator";const it=e.forwardRef(function({children:f,name:r,fallback:s,required:n,inline:c,align:m,size:l,variant:i,tone:d,headless:v,onSlotChange:u,onMissing:y,onResolved:p,...g},A){const b=e.useRef(null);return e.useImperativeHandle(A,()=>b.current),e.useEffect(()=>{const E=b.current;if(!E)return;const t=L=>{const H=L.detail;H&&(u==null||u(H))},o=()=>y==null?void 0:y(),h=()=>p==null?void 0:p();return E.addEventListener("slotchange",t),E.addEventListener("missing",o),E.addEventListener("resolved",h),()=>{E.removeEventListener("slotchange",t),E.removeEventListener("missing",o),E.removeEventListener("resolved",h)}},[u,y,p]),e.useEffect(()=>{const E=b.current;if(!E)return;const t=(h,L)=>{const H=E.getAttribute(h);if(L==null){H!=null&&E.removeAttribute(h);return}H!==L&&E.setAttribute(h,L)},o=(h,L)=>{L?t(h,""):t(h,null)};t("name",r||null),t("fallback",s||null),o("required",n),typeof c=="boolean"?t("inline",c?"true":"false"):t("inline",null),t("align",m&&m!=="start"?m:null),t("size",l&&l!=="md"?l:null),t("variant",i&&i!=="plain"?i:null),t("tone",d&&d!=="brand"?d:null),o("headless",v)},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-slot",{ref:b,...g},f)});it.displayName="Slot";const nt=e.forwardRef(function({children:f,orientation:r,variant:s,size:n,density:c,wrap:m,loop:l,headless:i,...d},v){const u=e.useRef(null);return e.useImperativeHandle(v,()=>u.current),e.useEffect(()=>{const y=u.current;if(!y)return;const p=(A,b)=>{const E=y.getAttribute(A);if(b==null){E!=null&&y.removeAttribute(A);return}E!==b&&y.setAttribute(A,b)},g=(A,b)=>{b?p(A,""):p(A,null)};p("orientation",r&&r!=="horizontal"?r:null),p("variant",s&&s!=="default"?s:null),p("size",n&&n!=="md"?n:null),p("density",c&&c!=="default"?c:null),g("wrap",m),typeof l=="boolean"?g("loop",l):p("loop",null),g("headless",i)},[r,s,n,c,m,l,i]),e.createElement("ui-toolbar",{ref:u,...d},f)});nt.displayName="Toolbar";const lt=K.forwardRef((w,f)=>K.createElement("ui-visually-hidden",{ref:f,...w}));lt.displayName="VisuallyHidden";function oe(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function fe(w){var f;return(f=w.detail)==null?void 0:f.open}const st=K.forwardRef(function({header:f,open:r,headless:s,onToggle:n,onChangeOpen:c,children:m,...l},i){const d=K.useRef(null);K.useImperativeHandle(i,()=>d.current),K.useEffect(()=>{ee("ui-collapsible","Collapsible")},[]),K.useEffect(()=>{const u=d.current;u&&(oe(u,"open",r),oe(u,"headless",s))},[r,s]),K.useEffect(()=>{const u=d.current;if(!u||!n&&!c)return;const y=g=>{const A=fe(g);typeof A=="boolean"&&(n==null||n(A))},p=g=>{const A=fe(g);typeof A=="boolean"&&(c==null||c(A))};return u.addEventListener("toggle",y),u.addEventListener("change",p),()=>{u.removeEventListener("toggle",y),u.removeEventListener("change",p)}},[n,c]);let v=null;return f!=null&&(typeof f=="string"||typeof f=="number"?v=K.createElement("span",{slot:"header"},f):K.isValidElement(f)?v=K.cloneElement(f,{slot:"header"}):v=K.createElement("span",{slot:"header"},f)),K.createElement("ui-collapsible",{ref:d,...l},v,m)});st.displayName="Collapsible";const ut=K.forwardRef((w,f)=>K.createElement("ui-pagination",{ref:f,...w}));ut.displayName="Pagination";function nr(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function ae(w){var f;return(f=w.detail)==null?void 0:f.open}const ct=K.forwardRef(function({multiple:f,collapsible:r,open:s,onToggle:n,onChangeOpen:c,children:m,...l},i){const d=K.useRef(null);return K.useImperativeHandle(i,()=>d.current),K.useEffect(()=>{ee("ui-accordion","Accordion")},[]),K.useEffect(()=>{const v=d.current;v&&(nr(v,"multiple",f),r==null?v.removeAttribute("collapsible"):v.setAttribute("collapsible",String(!!r)),s==null?v.removeAttribute("open"):v.setAttribute("open",Array.isArray(s)?JSON.stringify(s):String(s)))},[f,r,s]),K.useEffect(()=>{const v=d.current;if(!v||!n&&!c)return;const u=p=>{const g=ae(p);g!=null&&(n==null||n(g))},y=p=>{const g=ae(p);g!=null&&(c==null||c(g))};return v.addEventListener("toggle",u),v.addEventListener("change",y),()=>{v.removeEventListener("toggle",u),v.removeEventListener("change",y)}},[n,c]),K.createElement("ui-accordion",{ref:d,...l},m)});ct.displayName="Accordion";const ot=K.forwardRef(function({disabled:f,children:r,...s},n){const c={ref:n,"data-ui-accordion-item":"",...s};return f&&(c.disabled=!0),K.createElement("div",c,r)});ot.displayName="AccordionItem";const ft=K.forwardRef(function({type:f,children:r,...s},n){return K.createElement("button",{ref:n,type:f||"button","data-ui-accordion-trigger":"",...s},r)});ft.displayName="AccordionTrigger";const at=K.forwardRef(function({children:f,...r},s){return K.createElement("div",{ref:s,"data-ui-accordion-panel":"",...r},f)});at.displayName="AccordionPanel";const dt=K.forwardRef((w,f)=>K.createElement("ui-direction-provider",{ref:f,...w}));dt.displayName="DirectionProvider";const bt=e.forwardRef(function({children:f,open:r,delay:s,closeDelay:n,placement:c,offset:m,variant:l,tone:i,density:d,shape:v,elevation:u,headless:y,onOpen:p,onClose:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>p==null?void 0:p(),L=()=>g==null?void 0:g(),H=a=>{var R;const k=(R=a.detail)==null?void 0:R.open;typeof k=="boolean"&&(A==null||A(k))};return o.addEventListener("open",h),o.addEventListener("close",L),o.addEventListener("change",H),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L),o.removeEventListener("change",H)}},[p,g,A]),e.useEffect(()=>{const o=t.current;!o||r==null||(r?o.setAttribute("open",""):o.removeAttribute("open"))},[r]),e.useEffect(()=>{const o=t.current;o&&(typeof s=="number"?o.setAttribute("delay",String(s)):o.removeAttribute("delay"),typeof n=="number"?o.setAttribute("close-delay",String(n)):o.removeAttribute("close-delay"),c?o.setAttribute("placement",c):o.removeAttribute("placement"),typeof m=="number"?o.setAttribute("offset",String(m)):o.removeAttribute("offset"),l&&l!=="default"?o.setAttribute("variant",l):o.removeAttribute("variant"),i&&i!=="default"?o.setAttribute("tone",i):o.removeAttribute("tone"),d&&d!=="default"?o.setAttribute("density",d):o.removeAttribute("density"),v&&v!=="default"?o.setAttribute("shape",v):o.removeAttribute("shape"),u&&u!=="default"?o.setAttribute("elevation",u):o.removeAttribute("elevation"),y?o.setAttribute("headless",""):o.removeAttribute("headless"))},[s,n,c,m,l,i,d,v,u,y]),e.createElement("ui-hover-card",{ref:t,...b},f)});bt.displayName="HoverCard";const mt=e.forwardRef(function({children:f,htmlFor:r,for:s,required:n,description:c,variant:m,tone:l,size:i,density:d,shape:v,disabled:u,headless:y,...p},g){const A=e.useRef(null);return e.useImperativeHandle(g,()=>A.current),e.useEffect(()=>{const b=A.current;if(!b)return;const E=r||s;E?b.setAttribute("for",E):b.removeAttribute("for"),n?b.setAttribute("required",""):b.removeAttribute("required"),c?b.setAttribute("description",c):b.removeAttribute("description"),m&&m!=="default"?b.setAttribute("variant",m):b.removeAttribute("variant"),l&&l!=="default"?b.setAttribute("tone",l):b.removeAttribute("tone"),i&&i!=="md"&&i!=="2"?b.setAttribute("size",i):b.removeAttribute("size"),d&&d!=="default"?b.setAttribute("density",d):b.removeAttribute("density"),v&&v!=="default"?b.setAttribute("shape",v):b.removeAttribute("shape"),u?b.setAttribute("disabled",""):b.removeAttribute("disabled"),y?b.setAttribute("headless",""):b.removeAttribute("headless")},[r,s,n,c,m,l,i,d,v,u,y]),e.createElement("ui-label",{ref:A,...p},f)});mt.displayName="Label";const lr=typeof window<"u"?e.useLayoutEffect:e.useEffect,vt=e.forwardRef(function({children:f,open:r,headless:s,dismissible:n,closeOnEsc:c,closeOnBackdrop:m,lockWhileLoading:l,roleType:i,size:d,state:v,initialFocus:u,dialogId:y,config:p,onOpen:g,onConfirm:A,onCancel:b,onDismiss:E,onClose:t,onChange:o,...h},L){const H=e.useRef(null);return e.useImperativeHandle(L,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=N=>g==null?void 0:g(N.detail),R=N=>A==null?void 0:A(N.detail),P=N=>b==null?void 0:b(N.detail),F=N=>E==null?void 0:E(N.detail),B=N=>t==null?void 0:t(N.detail),T=N=>o==null?void 0:o(N.detail);return a.addEventListener("ui-open",k),a.addEventListener("ui-confirm",R),a.addEventListener("ui-cancel",P),a.addEventListener("ui-dismiss",F),a.addEventListener("ui-close",B),a.addEventListener("ui-change",T),()=>{a.removeEventListener("ui-open",k),a.removeEventListener("ui-confirm",R),a.removeEventListener("ui-cancel",P),a.removeEventListener("ui-dismiss",F),a.removeEventListener("ui-close",B),a.removeEventListener("ui-change",T)}},[g,A,b,E,t,o]),lr(()=>{const a=H.current;a&&(typeof r=="boolean"&&(r?a.setAttribute("open",""):a.removeAttribute("open")),s?a.setAttribute("headless",""):a.removeAttribute("headless"),typeof n=="boolean"?a.setAttribute("dismissible",String(n)):a.removeAttribute("dismissible"),typeof c=="boolean"?a.setAttribute("close-on-esc",String(c)):a.removeAttribute("close-on-esc"),typeof m=="boolean"?a.setAttribute("close-on-backdrop",String(m)):a.removeAttribute("close-on-backdrop"),typeof l=="boolean"?a.setAttribute("lock-while-loading",String(l)):a.removeAttribute("lock-while-loading"),i?a.setAttribute("role",i):a.removeAttribute("role"),d&&d!=="md"?a.setAttribute("size",d):a.removeAttribute("size"),v&&v!=="idle"?a.setAttribute("state",v):a.removeAttribute("state"),u?a.setAttribute("initial-focus",u):a.removeAttribute("initial-focus"),y&&(a.dialogId=y),p&&(a.config=p))},[r,s,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-alert-dialog",{ref:H,...h},f)});vt.displayName="AlertDialog";const At=e.createContext(null);function sr({children:w,hostId:f="ui-alert-dialog-react-host"}){const r=e.useRef(null);r.current||(r.current=V.createAlertDialogManager()),e.useEffect(()=>{var c;if(typeof document>"u")return;let n=document.getElementById(f);return n||(n=document.createElement("div"),n.id=f,n.setAttribute("data-ui-alert-dialog-react-host","true"),document.body.appendChild(n)),(c=r.current)==null||c.setContainer(n),()=>{var m;(m=r.current)==null||m.destroy("unmount"),r.current=null,n&&n.parentElement&&n.parentElement.removeChild(n)}},[f]);const s=e.useMemo(()=>({alert:(n={})=>{var c;return((c=r.current)==null?void 0:c.alert(n))??Promise.resolve({id:"",action:"dismiss"})},confirm:(n={})=>{var c;return((c=r.current)==null?void 0:c.confirm(n))??Promise.resolve({id:"",action:"dismiss"})},prompt:(n={})=>{var c;return((c=r.current)==null?void 0:c.prompt(n))??Promise.resolve({id:"",action:"dismiss",value:""})}}),[]);return e.createElement(At.Provider,{value:s},w)}function ur(){const w=e.useContext(At);if(!w)throw new Error("useAlertDialog must be used within <AlertDialogProvider>.");return w}const Et=e.forwardRef(function({children:f,value:r,disabled:s,required:n,invalid:c,headless:m,placeholder:l,name:i,label:d,description:v,error:u,size:y,variant:p,tone:g,density:A,radius:b,validation:E,onChange:t,onInput:o,onValueChange:h,...L},H){const a=e.useRef(null);return e.useImperativeHandle(H,()=>a.current),e.useEffect(()=>{const k=a.current;if(!k)return;const R=B=>{var T,N;return((T=B.detail)==null?void 0:T.value)??((N=B.target)==null?void 0:N.value)??""},P=B=>{o==null||o(R(B))},F=B=>{const T=R(B);t==null||t(T),h==null||h(T)};return k.addEventListener("input",P),k.addEventListener("change",F),()=>{k.removeEventListener("input",P),k.removeEventListener("change",F)}},[t,o,h]),e.useEffect(()=>{const k=a.current;if(!k)return;const R=(F,B)=>{const T=k.getAttribute(F);if(B==null){T!=null&&k.removeAttribute(F);return}T!==B&&k.setAttribute(F,B)},P=(F,B)=>{B?k.hasAttribute(F)||k.setAttribute(F,""):k.hasAttribute(F)&&k.removeAttribute(F)};R("value",r!=null?String(r):null),P("disabled",s),P("required",n),P("headless",m),P("invalid",c),R("placeholder",l||null),R("name",i||null),R("label",d||null),R("description",v||null),R("error",u||null),R("size",y&&y!=="md"&&y!=="2"?y:null),R("variant",p&&p!=="classic"?p:null),R("tone",g&&g!=="default"?g:null),R("density",A&&A!=="default"?A:null),R("radius",b?String(b):null),R("validation",E&&E!=="none"?E:null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E]),e.createElement("ui-select",{ref:a,...L},f)});Et.displayName="Select";const pt=e.forwardRef(function({children:f,value:r,valueStart:s,valueEnd:n,min:c,max:m,step:l,range:i,disabled:d,headless:v,orientation:u,size:y,variant:p,tone:g,showValue:A,format:b,label:E,description:t,marks:o,name:h,nameStart:L,nameEnd:H,onInput:a,onChange:k,onValueChange:R,...P},F){const B=e.useRef(null);return e.useImperativeHandle(F,()=>B.current),e.useEffect(()=>{const T=B.current;if(!T)return;const N=S=>{const x=S.detail;x&&(a==null||a(Number(x.value)),R==null||R(x))},I=S=>{const x=S.detail;x&&(k==null||k(Number(x.value)),R==null||R(x))};return T.addEventListener("input",N),T.addEventListener("change",I),()=>{T.removeEventListener("input",N),T.removeEventListener("change",I)}},[a,k,R]),e.useEffect(()=>{const T=B.current;if(!T)return;const N=(S,x)=>{const D=T.getAttribute(S);if(x==null){D!=null&&T.removeAttribute(S);return}D!==x&&T.setAttribute(S,x)},I=(S,x,D)=>{if(x==null){D!==void 0&&D===!1&&N(S,null);return}x?N(S,""):N(S,null)};if(N("value",typeof r=="number"&&Number.isFinite(r)?String(r):null),N("value-start",typeof s=="number"&&Number.isFinite(s)?String(s):null),N("value-end",typeof n=="number"&&Number.isFinite(n)?String(n):null),N("min",typeof c=="number"&&Number.isFinite(c)?String(c):null),N("max",typeof m=="number"&&Number.isFinite(m)?String(m):null),N("step",typeof l=="number"&&Number.isFinite(l)?String(l):null),I("range",i),I("disabled",d),I("headless",v),N("orientation",u&&u!=="horizontal"?u:null),N("size",y&&y!=="md"?y:null),N("variant",p&&p!=="default"?p:null),N("tone",g&&g!=="brand"?g:null),typeof A=="boolean"?N("show-value",A?"true":"false"):N("show-value",null),N("format",b||null),N("label",E||null),N("description",t||null),N("name",h||null),N("name-start",L||null),N("name-end",H||null),o&&o.length)try{N("marks",JSON.stringify(o))}catch{N("marks",null)}else N("marks",null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H]),e.createElement("ui-slider",{ref:B,...P},f)});pt.displayName="Slider";function cr(w){const{count:f,width:r,height:s,radius:n,gap:c,variant:m,animated:l,headless:i,...d}=w,v=e.useRef(null);return e.useEffect(()=>{const u=v.current;u&&(typeof f=="number"&&Number.isFinite(f)?u.setAttribute("count",String(f)):u.removeAttribute("count"),r?u.setAttribute("width",r):u.removeAttribute("width"),s?u.setAttribute("height",s):u.removeAttribute("height"),n?u.setAttribute("radius",n):u.removeAttribute("radius"),c?u.setAttribute("gap",c):u.removeAttribute("gap"),m?u.setAttribute("variant",m):u.removeAttribute("variant"),l?u.setAttribute("animated",""):u.removeAttribute("animated"),i?u.setAttribute("headless",""):u.removeAttribute("headless"))},[f,r,s,n,c,m,l,i]),e.createElement("ui-skeleton",{ref:v,...d})}exports.Accordion=ct;exports.AccordionItem=ot;exports.AccordionPanel=at;exports.AccordionTrigger=ft;exports.Alert=Nt;exports.AlertDialog=vt;exports.AlertDialogProvider=sr;exports.AppHeader=Me;exports.AspectRatio=We;exports.Avatar=Oe;exports.Badge=St;exports.BlockControls=$e;exports.Box=Zt;exports.Breadcrumb=_e;exports.Button=Ht;exports.Calendar=pe;exports.Chart=Ae;exports.Checkbox=Ue;exports.Collapsible=st;exports.ColorPicker=ye;exports.Combobox=Pt;exports.CommandPalette=Qt;exports.Container=Ot;exports.ContextMenu=It;exports.DataTable=xt;exports.DatePicker=Le;exports.DateRangePicker=ge;exports.DateRangeTimePicker=Re;exports.DateTimePicker=we;exports.Dialog=Se;exports.DialogProvider=$t;exports.DirectionProvider=dt;exports.Drawer=Qe;exports.Dropdown=be;exports.EmptyState=Ft;exports.Field=kt;exports.Flex=zt;exports.FloatingToolbar=Mt;exports.Form=Je;exports.Gantt=He;exports.Grid=Wt;exports.HoverCard=bt;exports.Icon=Be;exports.Input=me;exports.Label=mt;exports.Layout=Ie;exports.Menu=De;exports.Menubar=Bt;exports.NavigationMenu=Dt;exports.Pagination=ut;exports.PluginPanel=Ut;exports.Popover=Te;exports.Portal=et;exports.Presence=Ve;exports.Progress=Ce;exports.QuickActions=Pe;exports.RadioGroup=Xe;exports.ScrollArea=tt;exports.Section=je;exports.Select=Et;exports.SelectionPopup=Kt;exports.Separator=rt;exports.Sidebar=Ge;exports.Skeleton=cr;exports.Slider=pt;exports.Slot=it;exports.Stepper=Ne;exports.Switch=Ye;exports.Table=Tt;exports.Tabs=xe;exports.Textarea=ve;exports.ThemeProvider=Ct;exports.TimePicker=he;exports.Timeline=Ee;exports.Toast=qe;exports.ToastAPI=_t;exports.Toggle=Ze;exports.ToggleGroup=ze;exports.Toolbar=nt;exports.Tooltip=de;exports.VisuallyHidden=lt;exports.Wizard=ke;exports.toast=jt;exports.toastApi=Gt;exports.useAlertDialog=ur;exports.useDialog=Jt;exports.useFloating=Yt;exports.useForm=Xt;exports.useTheme=er;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("react"),V=require("@editora/ui-core");function Rt(h){if(h&&h.__esModule)return h;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>h[t]})}}return o.default=h,Object.freeze(o)}const N=Rt(v);function Ht(h){const{children:o,onClick:t,variant:l,size:i,icon:s,loading:b,block:n,headless:r,disabled:a,animation:m,theme:u,...y}=h,p=v.useRef(null),g=typeof window<"u"?N.default.useLayoutEffect:N.default.useEffect;v.useEffect(()=>{const d=p.current;if(!d)return;const E=e=>t&&t(e);return t&&d.addEventListener("click",E),()=>{t&&d.removeEventListener("click",E)}},[t]),g(()=>{const d=p.current;d&&(l?d.setAttribute("variant",l):d.removeAttribute("variant"),i?d.setAttribute("size",i):d.removeAttribute("size"),s?d.setAttribute("icon",s):d.removeAttribute("icon"),b?d.setAttribute("loading",""):d.removeAttribute("loading"),n?d.setAttribute("block",""):d.removeAttribute("block"),r?d.setAttribute("headless",""):d.removeAttribute("headless"),a?d.setAttribute("disabled",""):d.removeAttribute("disabled"),m?d.setAttribute("animation",m):d.removeAttribute("animation"),u&&u!=="default"?d.setAttribute("theme",u):d.removeAttribute("theme"))},[l,i,s,b,n,r,a,m,u]);const A={ref:p,...y,variant:l,size:i,icon:s,animation:m,theme:u&&u!=="default"?u:void 0,loading:b?"":void 0,block:n?"":void 0,headless:r?"":void 0,disabled:a?"":void 0};return N.default.createElement("ui-button",A,o)}const de=N.default.forwardRef(function({children:o,text:t,placement:l,open:i,disabled:s,headless:b,variant:n,size:r,tone:a,delay:m,closeDelay:u,trigger:y,offset:p,interactive:g,arrow:A,onOpen:d,onClose:E,onOpenChange:e,...c},w){const L=v.useRef(null);return v.useImperativeHandle(w,()=>L.current),v.useEffect(()=>{const H=L.current;if(!H)return;const f=()=>{d==null||d()},P=()=>{E==null||E()},R=S=>{const T=S.detail;T&&typeof T.open=="boolean"&&(e==null||e(T.open))};return H.addEventListener("open",f),H.addEventListener("close",P),H.addEventListener("change",R),()=>{H.removeEventListener("open",f),H.removeEventListener("close",P),H.removeEventListener("change",R)}},[d,E,e]),v.useEffect(()=>{const H=L.current;if(!H)return;const f=(R,S)=>{const T=H.getAttribute(R);if(S==null){T!=null&&H.removeAttribute(R);return}T!==S&&H.setAttribute(R,S)},P=(R,S)=>{S?f(R,""):f(R,null)};f("text",t||null),f("placement",l||null),P("open",i),P("disabled",s),P("headless",b),f("variant",n&&n!=="default"?n:null),f("size",r&&r!=="md"?r:null),f("tone",a&&a!=="default"?a:null),f("delay",typeof m=="number"&&Number.isFinite(m)?String(m):null),f("close-delay",typeof u=="number"&&Number.isFinite(u)?String(u):null),f("trigger",y||null),f("offset",typeof p=="number"&&Number.isFinite(p)?String(p):null),P("interactive",g),typeof A=="boolean"?f("arrow",A?"true":"false"):f("arrow",null)},[t,l,i,s,b,n,r,a,m,u,y,p,g,A]),N.default.createElement("ui-tooltip",{ref:L,...c},o)});de.displayName="Tooltip";function Nt(h){const{title:o,description:t,tone:l,variant:i,layout:s,dismissible:b,open:n,headless:r,onClose:a,children:m,...u}=h,y=v.useRef(null);return v.useEffect(()=>{const p=y.current;if(!p)return;const g=()=>a==null?void 0:a();return p.addEventListener("close",g),()=>p.removeEventListener("close",g)},[a]),v.useEffect(()=>{const p=y.current;p&&(o?p.setAttribute("title",o):p.removeAttribute("title"),t?p.setAttribute("description",t):p.removeAttribute("description"),l?p.setAttribute("tone",l):p.removeAttribute("tone"),i?p.setAttribute("variant",i):p.removeAttribute("variant"),s?p.setAttribute("layout",s):p.removeAttribute("layout"),b?p.setAttribute("dismissible",""):p.removeAttribute("dismissible"),r?p.setAttribute("headless",""):p.removeAttribute("headless"),typeof n=="boolean"&&(n?p.removeAttribute("hidden"):p.setAttribute("hidden","")))},[o,t,l,i,s,b,n,r]),N.default.createElement("ui-alert",{ref:y,...u},m)}const be=N.default.forwardRef(function({children:o,open:t,placement:l,variant:i,density:s,shape:b,elevation:n,tone:r,closeOnSelect:a,typeahead:m,onOpen:u,onClose:y,onChange:p,onSelect:g,...A},d){const E=v.useRef(null);return N.default.useImperativeHandle(d,()=>E.current),v.useEffect(()=>{const e=E.current;if(!e)return;const c=()=>u==null?void 0:u(),w=()=>y==null?void 0:y(),L=f=>{var R;const P=(R=f.detail)==null?void 0:R.open;typeof P=="boolean"&&(p==null||p(P))},H=f=>{g==null||g(f.detail||{})};return e.addEventListener("open",c),e.addEventListener("close",w),e.addEventListener("change",L),e.addEventListener("select",H),()=>{e.removeEventListener("open",c),e.removeEventListener("close",w),e.removeEventListener("change",L),e.removeEventListener("select",H)}},[u,y,p,g]),v.useEffect(()=>{const e=E.current;!e||t==null||(t?e.setAttribute("open",""):e.removeAttribute("open"))},[t]),v.useEffect(()=>{const e=E.current;e&&(l?e.setAttribute("placement",l):e.removeAttribute("placement"))},[l]),v.useEffect(()=>{const e=E.current;e&&(i&&i!=="default"?e.setAttribute("variant",i):e.removeAttribute("variant"))},[i]),v.useEffect(()=>{const e=E.current;e&&(s&&s!=="default"?e.setAttribute("density",s):e.removeAttribute("density"))},[s]),v.useEffect(()=>{const e=E.current;e&&(b&&b!=="default"?e.setAttribute("shape",b):e.removeAttribute("shape"))},[b]),v.useEffect(()=>{const e=E.current;e&&(n&&n!=="default"?e.setAttribute("elevation",n):e.removeAttribute("elevation"))},[n]),v.useEffect(()=>{const e=E.current;e&&(r&&r!=="default"&&r!=="brand"?e.setAttribute("tone",r):e.removeAttribute("tone"))},[r]),v.useEffect(()=>{const e=E.current;if(e){if(a==null){e.removeAttribute("close-on-select");return}e.setAttribute("close-on-select",a?"true":"false")}},[a]),v.useEffect(()=>{const e=E.current;if(e){if(m==null){e.removeAttribute("typeahead");return}e.setAttribute("typeahead",m?"true":"false")}},[m]),N.default.createElement("ui-dropdown",{ref:E,...A},o)});be.displayName="Dropdown";const me=N.default.forwardRef(function(o,t){const{value:l,onChange:i,onInput:s,onDebouncedInput:b,onClear:n,clearable:r,debounce:a,validation:m,size:u,minlength:y,maxlength:p,readOnly:g,autofocus:A,disabled:d,counter:E,floatingLabel:e,type:c,name:w,required:L,pattern:H,inputMode:f,autoComplete:P,min:R,max:S,step:T,spellCheck:q,placeholder:x,headless:k,variant:K,tone:F,density:D,shape:B,color:$,radius:J,label:G,description:M,children:_,...I}=o,Q=v.useRef(null);return v.useImperativeHandle(t,()=>Q.current),v.useEffect(()=>{const j=Q.current;if(!j)return;const Z=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(s==null||s(z.value))},Y=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(i==null||i(z.value))},re=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(b==null||b(z.value))},ie=()=>{n==null||n()};return j.addEventListener("input",Z),j.addEventListener("change",Y),j.addEventListener("debounced-input",re),j.addEventListener("clear",ie),()=>{j.removeEventListener("input",Z),j.removeEventListener("change",Y),j.removeEventListener("debounced-input",re),j.removeEventListener("clear",ie)}},[i,s,b,n]),v.useEffect(()=>{const j=Q.current;j&&(r?j.setAttribute("clearable",""):j.removeAttribute("clearable"),typeof a=="number"&&Number.isFinite(a)?j.setAttribute("debounce",String(a)):j.removeAttribute("debounce"),m&&m!=="none"?j.setAttribute("validation",m):j.removeAttribute("validation"),u&&u!=="md"&&u!=="2"?j.setAttribute("size",String(u)):j.removeAttribute("size"),typeof y=="number"?j.setAttribute("minlength",String(y)):j.removeAttribute("minlength"),typeof p=="number"?j.setAttribute("maxlength",String(p)):j.removeAttribute("maxlength"),g?j.setAttribute("readonly",""):j.removeAttribute("readonly"),A?j.setAttribute("autofocus",""):j.removeAttribute("autofocus"),d?j.setAttribute("disabled",""):j.removeAttribute("disabled"),E?j.setAttribute("counter",""):j.removeAttribute("counter"),e?j.setAttribute("floating-label",""):j.removeAttribute("floating-label"),c?j.setAttribute("type",c):j.removeAttribute("type"),w?j.setAttribute("name",w):j.removeAttribute("name"),L?j.setAttribute("required",""):j.removeAttribute("required"),H?j.setAttribute("pattern",H):j.removeAttribute("pattern"),f?j.setAttribute("inputmode",f):j.removeAttribute("inputmode"),P?j.setAttribute("autocomplete",P):j.removeAttribute("autocomplete"),R!=null&&R!==""?j.setAttribute("min",String(R)):j.removeAttribute("min"),S!=null&&S!==""?j.setAttribute("max",String(S)):j.removeAttribute("max"),T!=null&&T!==""?j.setAttribute("step",String(T)):j.removeAttribute("step"),typeof q=="boolean"?j.setAttribute("spellcheck",q?"true":"false"):j.removeAttribute("spellcheck"),x?j.setAttribute("placeholder",x):j.removeAttribute("placeholder"),k?j.setAttribute("headless",""):j.removeAttribute("headless"),K&&K!=="classic"?j.setAttribute("variant",K):j.removeAttribute("variant"),F&&F!=="default"?j.setAttribute("tone",F):j.removeAttribute("tone"),D&&D!=="default"?j.setAttribute("density",D):j.removeAttribute("density"),B&&B!=="default"?j.setAttribute("shape",B):j.removeAttribute("shape"),$?j.setAttribute("color",$):j.removeAttribute("color"),J?j.setAttribute("radius",String(J)):j.removeAttribute("radius"),G?j.setAttribute("label",G):j.removeAttribute("label"),M?j.setAttribute("description",M):j.removeAttribute("description"))},[r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f,P,R,S,T,q,x,k,K,F,D,B,$,J,G,M]),N.default.createElement("ui-input",{ref:Q,value:l??void 0,...I},_)});me.displayName="Input";const ve=N.default.forwardRef(function({value:o,onChange:t,onInput:l,onDebouncedInput:i,onClear:s,clearable:b,debounce:n,validation:r,size:a,minlength:m,maxlength:u,rows:y,readOnly:p,autofocus:g,disabled:A,name:d,required:E,placeholder:e,resize:c,variant:w,color:L,radius:H,label:f,description:P,autosize:R,maxRows:S,showCount:T,density:q,tone:x,headless:k,children:K,...F},D){const B=v.useRef(null);return v.useImperativeHandle(D,()=>B.current),v.useEffect(()=>{const $=B.current;if(!$)return;const J=I=>{const Q=I.detail;Q&&(l==null||l(Q.value))},G=I=>{const Q=I.detail;Q&&(t==null||t(Q.value))},M=I=>{const Q=I.detail;Q&&(i==null||i(Q.value))},_=()=>s==null?void 0:s();return $.addEventListener("input",J),$.addEventListener("change",G),$.addEventListener("debounced-input",M),$.addEventListener("clear",_),()=>{$.removeEventListener("input",J),$.removeEventListener("change",G),$.removeEventListener("debounced-input",M),$.removeEventListener("clear",_)}},[t,l,i,s]),v.useEffect(()=>{const $=B.current;if(!$)return;const J=(M,_)=>{const I=$.getAttribute(M);if(_==null){I!=null&&$.removeAttribute(M);return}I!==_&&$.setAttribute(M,_)},G=(M,_)=>{_?J(M,""):J(M,null)};J("value",o!=null?String(o):null),G("clearable",b),G("readonly",p),G("autofocus",g),G("disabled",A),G("required",E),G("autosize",R),G("show-count",T),G("headless",k),J("debounce",typeof n=="number"&&Number.isFinite(n)?String(n):null),J("validation",r&&r!=="none"?r:null),J("size",a&&a!=="md"&&a!=="2"?String(a):null),J("minlength",typeof m=="number"?String(m):null),J("maxlength",typeof u=="number"?String(u):null),J("rows",typeof y=="number"?String(y):null),J("name",d||null),J("placeholder",e||null),J("resize",c||null),J("variant",w&&w!=="classic"?w:null),J("color",L||null),J("radius",H?String(H):null),J("label",f||null),J("description",P||null),J("max-rows",typeof S=="number"?String(S):null),J("density",q&&q!=="default"?q:null),J("tone",x&&x!=="brand"?x:null)},[o,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f,P,R,S,T,q,x,k]),N.default.createElement("ui-textarea",{ref:B,...F},K)});ve.displayName="Textarea";function kt(h){const{children:o,label:t,description:l,error:i,htmlFor:s,required:b,invalid:n,orientation:r,variant:a,tone:m,density:u,shape:y,labelWidth:p,headless:g,...A}=h,d=v.useRef(null);return v.useEffect(()=>{const E=d.current;E&&(t!=null&&t!==""?E.setAttribute("label",t):E.removeAttribute("label"),l!=null&&l!==""?E.setAttribute("description",l):E.removeAttribute("description"),i!=null&&i!==""?E.setAttribute("error",i):E.removeAttribute("error"),s?E.setAttribute("for",s):E.removeAttribute("for"),b?E.setAttribute("required",""):E.removeAttribute("required"),n?E.setAttribute("invalid",""):E.removeAttribute("invalid"),r&&r!=="vertical"?E.setAttribute("orientation",r):E.removeAttribute("orientation"),a&&a!=="default"?E.setAttribute("variant",a):E.removeAttribute("variant"),m&&m!=="default"?E.setAttribute("tone",m):E.removeAttribute("tone"),u&&u!=="default"?E.setAttribute("density",u):E.removeAttribute("density"),y&&y!=="default"?E.setAttribute("shape",y):E.removeAttribute("shape"),p?E.setAttribute("label-width",p):E.removeAttribute("label-width"),g?E.setAttribute("headless",""):E.removeAttribute("headless"))},[t,l,i,s,b,n,r,a,m,u,y,p,g]),N.default.createElement("ui-field",{ref:d,...A},o)}function Pt(h){const{value:o,onChange:t,onInput:l,onDebouncedInput:i,onSelect:s,onOpen:b,onClose:n,onClear:r,clearable:a,debounce:m,validation:u,size:y,maxlength:p,readOnly:g,autofocus:A,disabled:d,name:E,required:e,placeholder:c,variant:w,radius:L,label:H,description:f,emptyText:P,noFilter:R,allowCustom:S,children:T,...q}=h,x=v.useRef(null);return v.useEffect(()=>{const k=x.current;if(!k)return;const K=M=>{var I;const _=(I=M.detail)==null?void 0:I.query;typeof _=="string"&&(l==null||l(_))},F=M=>{var I;const _=(I=M.detail)==null?void 0:I.value;typeof _=="string"&&(t==null||t(_))},D=M=>{var I;const _=(I=M.detail)==null?void 0:I.query;typeof _=="string"&&(i==null||i(_))},B=M=>{const _=M.detail;typeof(_==null?void 0:_.value)=="string"&&(s==null||s(_.value,_.label||_.value))},$=()=>b==null?void 0:b(),J=()=>n==null?void 0:n(),G=()=>r==null?void 0:r();return k.addEventListener("input",K),k.addEventListener("change",F),k.addEventListener("debounced-input",D),k.addEventListener("select",B),k.addEventListener("open",$),k.addEventListener("close",J),k.addEventListener("clear",G),()=>{k.removeEventListener("input",K),k.removeEventListener("change",F),k.removeEventListener("debounced-input",D),k.removeEventListener("select",B),k.removeEventListener("open",$),k.removeEventListener("close",J),k.removeEventListener("clear",G)}},[t,l,i,s,b,n,r]),v.useEffect(()=>{const k=x.current;k&&(a?k.setAttribute("clearable",""):k.removeAttribute("clearable"),typeof m=="number"&&Number.isFinite(m)?k.setAttribute("debounce",String(m)):k.removeAttribute("debounce"),u&&u!=="none"?k.setAttribute("validation",u):k.removeAttribute("validation"),y&&y!=="md"&&y!=="2"?k.setAttribute("size",String(y)):k.removeAttribute("size"),typeof p=="number"?k.setAttribute("maxlength",String(p)):k.removeAttribute("maxlength"),g?k.setAttribute("readonly",""):k.removeAttribute("readonly"),A?k.setAttribute("autofocus",""):k.removeAttribute("autofocus"),d?k.setAttribute("disabled",""):k.removeAttribute("disabled"),E?k.setAttribute("name",E):k.removeAttribute("name"),e?k.setAttribute("required",""):k.removeAttribute("required"),c?k.setAttribute("placeholder",c):k.removeAttribute("placeholder"),w?k.setAttribute("variant",w):k.removeAttribute("variant"),L?k.setAttribute("radius",String(L)):k.removeAttribute("radius"),H?k.setAttribute("label",H):k.removeAttribute("label"),f?k.setAttribute("description",f):k.removeAttribute("description"),P?k.setAttribute("empty-text",P):k.removeAttribute("empty-text"),R?k.setAttribute("no-filter",""):k.removeAttribute("no-filter"),S?k.setAttribute("allow-custom",""):k.removeAttribute("allow-custom"))},[a,m,u,y,p,g,A,d,E,e,c,w,L,H,f,P,R,S]),N.default.createElement("ui-combobox",{ref:x,value:o,...q},T)}function St(h){const{text:o,tone:t,variant:l,size:i,radius:s,pill:b,dot:n,removable:r,autoRemove:a,iconOnly:m,disabled:u,onRemove:y,children:p,...g}=h,A=v.useRef(null);return v.useEffect(()=>{const d=A.current;if(!d)return;const E=()=>y==null?void 0:y();return d.addEventListener("remove",E),()=>d.removeEventListener("remove",E)},[y]),v.useEffect(()=>{const d=A.current;d&&(o?d.setAttribute("text",o):d.removeAttribute("text"),t?d.setAttribute("tone",t):d.removeAttribute("tone"),l?d.setAttribute("variant",l):d.removeAttribute("variant"),i&&i!=="md"&&i!=="2"?d.setAttribute("size",i):d.removeAttribute("size"),s?d.setAttribute("radius",String(s)):d.removeAttribute("radius"),b?d.setAttribute("pill",""):d.removeAttribute("pill"),n?d.setAttribute("dot",""):d.removeAttribute("dot"),r?d.setAttribute("removable",""):d.removeAttribute("removable"),a?d.setAttribute("auto-remove",""):d.removeAttribute("auto-remove"),m?d.setAttribute("icon-only",""):d.removeAttribute("icon-only"),u?d.setAttribute("disabled",""):d.removeAttribute("disabled"))},[o,t,l,i,s,b,n,r,a,m,u]),N.default.createElement("ui-badge",{ref:A,...g},p)}function Ft(h){const{title:o,description:t,actionLabel:l,tone:i,compact:s,headless:b,onAction:n,children:r,...a}=h,m=v.useRef(null);return v.useEffect(()=>{const u=m.current;if(!u)return;const y=()=>n==null?void 0:n();return u.addEventListener("action",y),()=>u.removeEventListener("action",y)},[n]),v.useEffect(()=>{const u=m.current;u&&(o?u.setAttribute("title",o):u.removeAttribute("title"),t?u.setAttribute("description",t):u.removeAttribute("description"),l?u.setAttribute("action-label",l):u.removeAttribute("action-label"),i?u.setAttribute("tone",i):u.removeAttribute("tone"),s?u.setAttribute("compact",""):u.removeAttribute("compact"),b?u.setAttribute("headless",""):u.removeAttribute("headless"))},[o,t,l,i,s,b]),N.default.createElement("ui-empty-state",{ref:m,...a},r)}function Tt(h){const{sortable:o,selectable:t,multiSelect:l,striped:i,hover:s,compact:b,bordered:n,stickyHeader:r,loading:a,headless:m,emptyText:u,onSortChange:y,onRowSelect:p,children:g,...A}=h,d=v.useRef(null);return v.useEffect(()=>{const E=d.current;if(!E)return;const e=w=>{const L=w.detail;L&&(y==null||y(L))},c=w=>{const L=w.detail;L&&(p==null||p(L))};return E.addEventListener("sort-change",e),E.addEventListener("row-select",c),()=>{E.removeEventListener("sort-change",e),E.removeEventListener("row-select",c)}},[y,p]),N.default.createElement("ui-table",{ref:d,...A,...o?{sortable:""}:{},...t?{selectable:""}:{},...l?{"multi-select":""}:{},...i?{striped:""}:{},...s?{hover:""}:{},...b?{compact:""}:{},...n?{bordered:""}:{},...r?{"sticky-header":""}:{},...a?{loading:""}:{},...m?{headless:""}:{},...u?{"empty-text":u}:{}},g)}function xt(h){const{sortable:o,selectable:t,multiSelect:l,striped:i,hover:s,compact:b,bordered:n,stickyHeader:r,loading:a,headless:m,hideSummary:u,emptyText:y,page:p,pageSize:g,paginationId:A,filterQuery:d,filterColumn:E,filterRules:e,columnOrder:c,pinColumns:w,draggableColumns:L,resizableColumns:H,bulkActionsLabel:f,bulkClearLabel:P,virtualize:R,rowHeight:S,overscan:T,onSortChange:q,onRowSelect:x,onPageChange:k,onFilterChange:K,onColumnResize:F,onVirtualRangeChange:D,onColumnOrderChange:B,onBulkClear:$,children:J,...G}=h,M=v.useRef(null);v.useEffect(()=>{const Q=M.current;if(!Q)return;const j=W=>{const X=W.detail;X&&(q==null||q(X))},Z=W=>{const X=W.detail;X&&(x==null||x(X))},Y=W=>{const X=W.detail;X&&(k==null||k(X))},re=W=>{const X=W.detail;X&&(K==null||K(X))},ie=W=>{const X=W.detail;X&&(F==null||F(X))},C=W=>{const X=W.detail;X&&(D==null||D(X))},z=W=>{const X=W.detail;X&&(B==null||B(X))},le=W=>{const X=W.detail;X&&($==null||$(X))};return Q.addEventListener("sort-change",j),Q.addEventListener("row-select",Z),Q.addEventListener("page-change",Y),Q.addEventListener("filter-change",re),Q.addEventListener("column-resize",ie),Q.addEventListener("virtual-range-change",C),Q.addEventListener("column-order-change",z),Q.addEventListener("bulk-clear",le),()=>{Q.removeEventListener("sort-change",j),Q.removeEventListener("row-select",Z),Q.removeEventListener("page-change",Y),Q.removeEventListener("filter-change",re),Q.removeEventListener("column-resize",ie),Q.removeEventListener("virtual-range-change",C),Q.removeEventListener("column-order-change",z),Q.removeEventListener("bulk-clear",le)}},[q,x,k,K,F,D,B,$]);const _=e&&e.length?(()=>{try{return JSON.stringify(e)}catch{return}})():void 0,I=typeof w=="string"?w.trim()||void 0:w&&typeof w=="object"?(()=>{try{return JSON.stringify(w)}catch{return}})():void 0;return N.default.createElement("ui-data-table",{ref:M,...G,...o?{sortable:""}:{},...t?{selectable:""}:{},...l?{"multi-select":""}:{},...i?{striped:""}:{},...s?{hover:""}:{},...b?{compact:""}:{},...n?{bordered:""}:{},...r?{"sticky-header":""}:{},...a?{loading:""}:{},...m?{headless:""}:{},...u?{"hide-summary":""}:{},...y?{"empty-text":y}:{},...typeof p=="number"&&Number.isFinite(p)?{page:String(p)}:{},...typeof g=="number"&&Number.isFinite(g)?{"page-size":String(g)}:{},...A?{"pagination-id":A}:{},...typeof d=="string"?{"filter-query":d}:{},...typeof E=="number"&&Number.isFinite(E)?{"filter-column":String(E)}:typeof E=="string"&&E.trim()?{"filter-column":E}:{},..._?{filters:_}:{},...c?{"column-order":c}:{},...I?{"pin-columns":I}:{},...L?{"draggable-columns":""}:{},...H?{"resizable-columns":""}:{},...f?{"bulk-actions-label":f}:{},...P?{"bulk-clear-label":P}:{},...R?{virtualize:""}:{},...typeof S=="number"&&Number.isFinite(S)?{"row-height":String(S)}:{},...typeof T=="number"&&Number.isFinite(T)?{overscan:String(T)}:{}},J)}const Ae=N.default.forwardRef(function({data:o,values:t,labels:l,type:i,variant:s,title:b,subtitle:n,headless:r,children:a,...m},u){const y=v.useRef(null);return v.useImperativeHandle(u,()=>y.current),v.useEffect(()=>{const p=y.current;if(!p)return;const g=(d,E)=>{const e=p.getAttribute(d);if(E==null){e!=null&&p.removeAttribute(d);return}e!==E&&p.setAttribute(d,E)},A=(d,E)=>{E?g(d,""):g(d,null)};if(o&&o.length)try{g("data",JSON.stringify(o))}catch{g("data",null)}else g("data",null);t&&t.length?g("values",t.join(",")):g("values",null),l&&l.length?g("labels",l.join(",")):g("labels",null),g("type",i&&i!=="line"?i:null),g("variant",s&&s!=="default"?s:null),g("title",b||null),g("subtitle",n||null),A("headless",r)},[o,t,l,i,s,b,n,r]),N.default.createElement("ui-chart",{ref:y,...m},a)});Ae.displayName="Chart";const Ee=N.default.forwardRef(function({items:o,variant:t,headless:l,children:i,...s},b){const n=v.useRef(null);return v.useImperativeHandle(b,()=>n.current),v.useEffect(()=>{const r=n.current;if(!r)return;const a=(u,y)=>{const p=r.getAttribute(u);if(y==null){p!=null&&r.removeAttribute(u);return}p!==y&&r.setAttribute(u,y)},m=(u,y)=>{y?a(u,""):a(u,null)};if(o&&o.length)try{a("items",JSON.stringify(o))}catch{a("items",null)}else a("items",null);a("variant",t&&t!=="default"?t:null),m("headless",l)},[o,t,l]),N.default.createElement("ui-timeline",{ref:n,...s},i)});Ee.displayName="Timeline";const pe=N.default.forwardRef(function({year:o,month:t,value:l,events:i,variant:s,selection:b,min:n,max:r,disabled:a,readOnly:m,locale:u,weekStart:y,outsideClick:p,eventsMax:g,eventsDisplay:A,maxSelections:d,size:E,headless:e,hideToday:c,showToday:w,onSelect:L,onChange:H,onCalendarChange:f,onValueChange:P,children:R,...S},T){const q=v.useRef(null);return v.useImperativeHandle(T,()=>q.current),v.useEffect(()=>{const x=q.current;if(!x)return;const k=F=>{const D=F.detail;D&&(L==null||L(D),H==null||H(D),P==null||P(D.value))},K=F=>{const D=F.detail;D&&(f==null||f(D))};return x.addEventListener("select",k),x.addEventListener("change",K),()=>{x.removeEventListener("select",k),x.removeEventListener("change",K)}},[L,H,f,P]),v.useEffect(()=>{const x=q.current;if(!x)return;const k=(F,D)=>{const B=x.getAttribute(F);if(D==null){B!=null&&x.removeAttribute(F);return}B!==D&&x.setAttribute(F,D)},K=(F,D)=>{D?x.hasAttribute(F)||x.setAttribute(F,""):x.hasAttribute(F)&&x.removeAttribute(F)};if(typeof o=="number"&&Number.isFinite(o)?k("year",String(o)):k("year",null),typeof t=="number"&&Number.isFinite(t)?k("month",String(t)):k("month",null),k("value",l||null),k("selection",b&&b!=="single"?b:null),k("min",n||null),k("max",r||null),k("locale",u||null),k("week-start",typeof y=="number"?String(y):null),k("outside-click",p&&p!=="navigate"?p:null),k("events-max",typeof g=="number"&&Number.isFinite(g)?String(g):null),k("events-display",A&&A!=="dots"?A:null),k("max-selections",typeof d=="number"&&Number.isFinite(d)?String(d):null),k("size",E&&E!=="md"?E:null),k("show-today",typeof w=="boolean"?w?"true":"false":null),K("disabled",a),K("readonly",m),K("hide-today",c),K("headless",e),i&&i.length)try{k("events",JSON.stringify(i))}catch{k("events",null)}else k("events",null);k("variant",s&&s!=="default"?s:null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w]),N.default.createElement("ui-calendar",{ref:q,...S},R)});pe.displayName="Calendar";const ye=N.default.forwardRef(function({value:o,format:t,alpha:l,disabled:i,readOnly:s,size:b,variant:n,mode:r,open:a,placeholder:m,presets:u,recent:y,maxRecent:p,persist:g,onInput:A,onChange:d,onValueChange:E,onOpen:e,onClose:c,onInvalid:w,children:L,...H},f){const P=v.useRef(null);v.useImperativeHandle(f,()=>P.current),v.useEffect(()=>{const S=P.current;if(!S)return;const T=k=>{const K=k.detail;K&&(A==null||A(K))},q=k=>{const K=k.detail;K&&(d==null||d(K),E==null||E(K.value))},x=k=>{const K=k.detail;K&&(w==null||w(K))};return S.addEventListener("input",T),S.addEventListener("change",q),S.addEventListener("open",e),S.addEventListener("close",c),S.addEventListener("invalid",x),()=>{S.removeEventListener("input",T),S.removeEventListener("change",q),S.removeEventListener("open",e),S.removeEventListener("close",c),S.removeEventListener("invalid",x)}},[A,d,E,e,c,w]),v.useEffect(()=>{const S=P.current;if(!S)return;const T=(x,k)=>{const K=S.getAttribute(x);k==null?K!=null&&S.removeAttribute(x):K!==k&&S.setAttribute(x,k)},q=(x,k)=>{k?T(x,""):T(x,null)};if(T("value",o??null),T("format",t&&t!=="hex"?t:null),q("alpha",l),q("disabled",i),q("readonly",s),T("size",b&&b!=="md"?b:null),T("variant",n&&n!=="default"?n:null),T("mode",r&&r!=="inline"?r:null),typeof a=="boolean"?q("open",a):T("open",null),T("placeholder",m??null),q("recent",y),T("max-recent",typeof p=="number"?String(p):null),q("persist",g),u&&u.length>0)try{T("presets",JSON.stringify(u))}catch{T("presets",null)}else T("presets",null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g]);const R={ref:P,...H};if(r&&r!=="inline"&&(R.mode=r),typeof a=="boolean"&&a&&(R.open=""),o!=null&&(R.value=o),t&&t!=="hex"&&(R.format=t),l&&(R.alpha=""),i&&(R.disabled=""),s&&(R.readonly=""),b&&b!=="md"&&(R.size=b),n&&n!=="default"&&(R.variant=n),m&&(R.placeholder=m),y&&(R.recent=""),typeof p=="number"&&(R["max-recent"]=String(p)),g&&(R.persist=""),u&&u.length>0)try{R.presets=JSON.stringify(u)}catch{}return N.default.createElement("ui-color-picker",R,L)});ye.displayName="ColorPicker";const Le=N.default.forwardRef(function({value:o,defaultValue:t,open:l,defaultOpen:i,min:s,max:b,locale:n,weekStart:r,size:a,variant:m,placeholder:u,label:y,hint:p,error:g,clearable:A,allowInput:d,closeOnSelect:E,outsideClick:e,disabled:c,readOnly:w,required:L,name:H,mode:f,events:P,eventsMax:R,eventsDisplay:S,format:T,displayFormat:q,onInput:x,onChange:k,onValueChange:K,onOpen:F,onClose:D,onInvalid:B,children:$,...J},G){const M=v.useRef(null);return v.useImperativeHandle(G,()=>M.current),v.useEffect(()=>{const _=M.current;if(!_)return;const I=Z=>{const Y=Z.detail;Y&&(x==null||x(Y))},Q=Z=>{const Y=Z.detail;Y&&(k==null||k(Y),K==null||K(Y.value))},j=Z=>{const Y=Z.detail;Y&&(B==null||B(Y))};return _.addEventListener("input",I),_.addEventListener("change",Q),_.addEventListener("open",F),_.addEventListener("close",D),_.addEventListener("invalid",j),()=>{_.removeEventListener("input",I),_.removeEventListener("change",Q),_.removeEventListener("open",F),_.removeEventListener("close",D),_.removeEventListener("invalid",j)}},[x,k,K,F,D,B]),v.useEffect(()=>{const _=M.current;if(!_)return;const I=(j,Z)=>{const Y=_.getAttribute(j);Z==null?Y!=null&&_.removeAttribute(j):Y!==Z&&_.setAttribute(j,Z)},Q=(j,Z)=>{Z?I(j,""):I(j,null)};if(I("value",o??null),I("default-value",t??null),typeof l=="boolean"?Q("open",l):I("open",null),Q("default-open",i),I("min",s??null),I("max",b??null),I("locale",n??null),I("week-start",typeof r=="number"?String(r):null),I("size",a&&a!=="md"?a:null),I("variant",m&&m!=="default"?m:null),I("placeholder",u??null),I("label",y??null),I("hint",p??null),I("error",g??null),Q("clearable",A),Q("allow-input",d),Q("close-on-select",E),I("outside-click",e&&e!=="navigate"?e:null),Q("disabled",c),Q("readonly",w),Q("required",L),I("name",H??null),I("mode",f&&f!=="popover"?f:null),I("events-max",typeof R=="number"?String(R):null),I("events-display",S&&S!=="dots"?S:null),I("format",T&&T!=="locale"?T:null),I("display-format",q??null),P!=null&&P.length)try{I("events",JSON.stringify(P))}catch{I("events",null)}else I("events",null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f,P,R,S,T,q]),N.default.createElement("ui-date-picker",{ref:M,...J},$)});Le.displayName="DatePicker";const ge=N.default.forwardRef(function({value:o,defaultValue:t,open:l,defaultOpen:i,min:s,max:b,locale:n,weekStart:r,size:a,variant:m,rangeVariant:u,label:y,hint:p,error:g,allowSameDay:A,allowPartial:d,closeOnSelect:E,clearable:e,disabled:c,readOnly:w,required:L,name:H,nameStart:f,nameEnd:P,mode:R,onInput:S,onChange:T,onValueChange:q,onOpen:x,onClose:k,onInvalid:K,children:F,...D},B){const $=v.useRef(null);return v.useImperativeHandle(B,()=>$.current),v.useEffect(()=>{const J=$.current;if(!J)return;const G=I=>{const Q=I.detail;Q&&(S==null||S(Q))},M=I=>{const Q=I.detail;Q&&(T==null||T(Q),q==null||q(Q.value?JSON.stringify(Q.value):null))},_=I=>{const Q=I.detail;Q&&(K==null||K(Q))};return J.addEventListener("input",G),J.addEventListener("change",M),J.addEventListener("open",x),J.addEventListener("close",k),J.addEventListener("invalid",_),()=>{J.removeEventListener("input",G),J.removeEventListener("change",M),J.removeEventListener("open",x),J.removeEventListener("close",k),J.removeEventListener("invalid",_)}},[S,T,q,x,k,K]),v.useEffect(()=>{const J=$.current;if(!J)return;const G=(_,I)=>{const Q=J.getAttribute(_);I==null?Q!=null&&J.removeAttribute(_):Q!==I&&J.setAttribute(_,I)},M=(_,I)=>{I?G(_,""):G(_,null)};G("value",o??null),G("default-value",t??null),typeof l=="boolean"?M("open",l):G("open",null),M("default-open",i),G("min",s??null),G("max",b??null),G("locale",n??null),G("week-start",typeof r=="number"?String(r):null),G("size",a&&a!=="md"?a:null),G("variant",m&&m!=="default"?m:null),G("range-variant",u&&u!=="two-fields"?u:null),G("label",y??null),G("hint",p??null),G("error",g??null),M("allow-same-day",A),M("allow-partial",d),M("close-on-select",E),M("clearable",e),M("disabled",c),M("readonly",w),M("required",L),G("name",H??null),G("name-start",f??null),G("name-end",P??null),G("mode",R&&R!=="popover"?R:null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f,P,R]),N.default.createElement("ui-date-range-picker",{ref:$,...D},F)});ge.displayName="DateRangePicker";const he=N.default.forwardRef(function({value:o,defaultValue:t,open:l,defaultOpen:i,format:s,step:b,seconds:n,stepSeconds:r,min:a,max:m,disabled:u,readOnly:y,required:p,name:g,clearable:A,allowInput:d,mode:E,label:e,hint:c,error:w,locale:L,variant:H,onInput:f,onChange:P,onValueChange:R,onOpen:S,onClose:T,onInvalid:q,children:x,...k},K){const F=v.useRef(null);return v.useImperativeHandle(K,()=>F.current),v.useEffect(()=>{const D=F.current;if(!D)return;const B=G=>{const M=G.detail;M&&(f==null||f(M))},$=G=>{const M=G.detail;M&&(P==null||P(M),R==null||R(M.value))},J=G=>{const M=G.detail;M&&(q==null||q(M))};return D.addEventListener("input",B),D.addEventListener("change",$),D.addEventListener("open",S),D.addEventListener("close",T),D.addEventListener("invalid",J),()=>{D.removeEventListener("input",B),D.removeEventListener("change",$),D.removeEventListener("open",S),D.removeEventListener("close",T),D.removeEventListener("invalid",J)}},[f,P,R,S,T,q]),v.useEffect(()=>{const D=F.current;if(!D)return;const B=(J,G)=>{const M=D.getAttribute(J);G==null?M!=null&&D.removeAttribute(J):M!==G&&D.setAttribute(J,G)},$=(J,G)=>{G?B(J,""):B(J,null)};B("value",o??null),B("default-value",t??null),typeof l=="boolean"?$("open",l):B("open",null),$("default-open",i),B("format",s&&s!=="24h"?s:null),B("step",typeof b=="number"?String(b):null),$("seconds",n),B("step-seconds",typeof r=="number"?String(r):null),B("min",a??null),B("max",m??null),$("disabled",u),$("readonly",y),$("required",p),B("name",g??null),$("clearable",A),$("allow-input",d),B("mode",E&&E!=="popover"?E:null),B("label",e??null),B("hint",c??null),B("error",w??null),B("locale",L??null),B("variant",H&&H!=="default"?H:null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H]),N.default.createElement("ui-time-picker",{ref:F,...k},x)});he.displayName="TimePicker";const we=N.default.forwardRef(function({value:o,defaultValue:t,open:l,defaultOpen:i,min:s,max:b,locale:n,weekStart:r,size:a,variant:m,step:u,format:y,disabled:p,readOnly:g,required:A,name:d,closeOnSelect:E,clearable:e,allowInput:c,mode:w,label:L,hint:H,error:f,onInput:P,onChange:R,onValueChange:S,onOpen:T,onClose:q,onInvalid:x,children:k,...K},F){const D=v.useRef(null);return v.useImperativeHandle(F,()=>D.current),v.useEffect(()=>{const B=D.current;if(!B)return;const $=M=>{const _=M.detail;_&&(P==null||P(_))},J=M=>{const _=M.detail;_&&(R==null||R(_),S==null||S(_.value))},G=M=>{const _=M.detail;_&&(x==null||x(_))};return B.addEventListener("input",$),B.addEventListener("change",J),B.addEventListener("open",T),B.addEventListener("close",q),B.addEventListener("invalid",G),()=>{B.removeEventListener("input",$),B.removeEventListener("change",J),B.removeEventListener("open",T),B.removeEventListener("close",q),B.removeEventListener("invalid",G)}},[P,R,S,T,q,x]),v.useEffect(()=>{const B=D.current;if(!B)return;const $=(G,M)=>{const _=B.getAttribute(G);M==null?_!=null&&B.removeAttribute(G):_!==M&&B.setAttribute(G,M)},J=(G,M)=>{M?$(G,""):$(G,null)};$("value",o??null),$("default-value",t??null),typeof l=="boolean"?J("open",l):$("open",null),J("default-open",i),$("min",s??null),$("max",b??null),$("locale",n??null),$("week-start",typeof r=="number"?String(r):null),$("size",a&&a!=="md"?a:null),$("variant",m&&m!=="default"?m:null),$("step",typeof u=="number"?String(u):null),$("format",y&&y!=="24h"?y:null),J("disabled",p),J("readonly",g),J("required",A),$("name",d??null),J("close-on-select",E),J("clearable",e),J("allow-input",c),$("mode",w&&w!=="popover"?w:null),$("label",L??null),$("hint",H??null),$("error",f??null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f]),N.default.createElement("ui-date-time-picker",{ref:D,...K},k)});we.displayName="DateTimePicker";const Re=N.default.forwardRef(function({value:o,defaultValue:t,open:l,defaultOpen:i,min:s,max:b,locale:n,weekStart:r,size:a,variant:m,step:u,autoNormalize:y,allowPartial:p,disabled:g,readOnly:A,required:d,name:E,closeOnSelect:e,clearable:c,mode:w,label:L,hint:H,error:f,onInput:P,onChange:R,onValueChange:S,onOpen:T,onClose:q,onInvalid:x,children:k,...K},F){const D=v.useRef(null);return v.useImperativeHandle(F,()=>D.current),v.useEffect(()=>{const B=D.current;if(!B)return;const $=M=>{const _=M.detail;_&&(P==null||P(_))},J=M=>{const _=M.detail;_&&(R==null||R(_),S==null||S(_.value?JSON.stringify(_.value):null))},G=M=>{const _=M.detail;_&&(x==null||x(_))};return B.addEventListener("input",$),B.addEventListener("change",J),B.addEventListener("open",T),B.addEventListener("close",q),B.addEventListener("invalid",G),()=>{B.removeEventListener("input",$),B.removeEventListener("change",J),B.removeEventListener("open",T),B.removeEventListener("close",q),B.removeEventListener("invalid",G)}},[P,R,S,T,q,x]),v.useEffect(()=>{const B=D.current;if(!B)return;const $=(G,M)=>{const _=B.getAttribute(G);M==null?_!=null&&B.removeAttribute(G):_!==M&&B.setAttribute(G,M)},J=(G,M)=>{M?$(G,""):$(G,null)};$("value",o??null),$("default-value",t??null),typeof l=="boolean"?J("open",l):$("open",null),J("default-open",i),$("min",s??null),$("max",b??null),$("locale",n??null),$("week-start",typeof r=="number"?String(r):null),$("size",a&&a!=="md"?a:null),$("variant",m&&m!=="default"?m:null),$("step",typeof u=="number"?String(u):null),J("auto-normalize",y),J("allow-partial",p),J("disabled",g),J("readonly",A),J("required",d),$("name",E??null),J("close-on-select",e),J("clearable",c),$("mode",w&&w!=="popover"?w:null),$("label",L??null),$("hint",H??null),$("error",f??null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H,f]),N.default.createElement("ui-date-range-time-picker",{ref:D,...K},k)});Re.displayName="DateRangeTimePicker";const He=N.default.forwardRef(function({tasks:o,variant:t,headless:l,children:i,...s},b){const n=v.useRef(null);return v.useImperativeHandle(b,()=>n.current),v.useEffect(()=>{const r=n.current;if(!r)return;const a=(u,y)=>{const p=r.getAttribute(u);if(y==null){p!=null&&r.removeAttribute(u);return}p!==y&&r.setAttribute(u,y)},m=(u,y)=>{y?a(u,""):a(u,null)};if(o&&o.length)try{a("tasks",JSON.stringify(o))}catch{a("tasks",null)}else a("tasks",null);a("variant",t&&t!=="default"?t:null),m("headless",l)},[o,t,l]),N.default.createElement("ui-gantt",{ref:n,...s},i)});He.displayName="Gantt";const Ne=N.default.forwardRef(function({steps:o,value:t,orientation:l,variant:i,size:s,clickable:b,linear:n,headless:r,onChange:a,onSelect:m,children:u,...y},p){const g=v.useRef(null);return v.useImperativeHandle(p,()=>g.current),v.useEffect(()=>{const A=g.current;if(!A)return;const d=e=>{const c=e.detail;c&&(a==null||a(c))},E=e=>{const c=e.detail;c&&(m==null||m(c))};return A.addEventListener("change",d),A.addEventListener("select",E),()=>{A.removeEventListener("change",d),A.removeEventListener("select",E)}},[a,m]),v.useEffect(()=>{const A=g.current;if(!A)return;const d=(e,c)=>{const w=A.getAttribute(e);if(c==null){w!=null&&A.removeAttribute(e);return}w!==c&&A.setAttribute(e,c)},E=(e,c)=>{c?d(e,""):d(e,null)};if(o&&o.length)try{d("steps",JSON.stringify(o))}catch{d("steps",null)}else d("steps",null);d("value",t||null),d("orientation",l&&l!=="horizontal"?l:null),d("variant",i&&i!=="default"?i:null),d("size",s&&s!=="md"?s:null),E("clickable",b),E("linear",n),E("headless",r)},[o,t,l,i,s,b,n,r]),N.default.createElement("ui-stepper",{ref:g,...y},u)});Ne.displayName="Stepper";const ke=N.default.forwardRef(function({value:o,linear:t,showStepper:l,stepperPosition:i,hideControls:s,keepMounted:b,variant:n,headless:r,nextLabel:a,prevLabel:m,finishLabel:u,onBeforeChange:y,onChange:p,onStepChange:g,onComplete:A,children:d,...E},e){const c=v.useRef(null);return v.useImperativeHandle(e,()=>c.current),v.useEffect(()=>{const w=c.current;if(!w)return;const L=R=>{if(!y)return;const S=R.detail;y(S)===!1&&R.preventDefault()},H=R=>{const S=R.detail;S&&(p==null||p(S))},f=R=>{const S=R.detail;S&&(g==null||g(S))},P=R=>{const S=R.detail;S&&(A==null||A(S))};return w.addEventListener("before-change",L),w.addEventListener("change",H),w.addEventListener("step-change",f),w.addEventListener("complete",P),()=>{w.removeEventListener("before-change",L),w.removeEventListener("change",H),w.removeEventListener("step-change",f),w.removeEventListener("complete",P)}},[y,p,g,A]),v.useEffect(()=>{const w=c.current;if(!w)return;const L=(f,P)=>{const R=w.getAttribute(f);if(P==null){R!=null&&w.removeAttribute(f);return}R!==P&&w.setAttribute(f,P)},H=(f,P,R)=>{if(typeof P=="boolean"){P?L(f,""):L(f,null);return}R!==void 0&&(R?L(f,""):L(f,null))};L("value",o||null),H("linear",t),typeof l=="boolean"?L("show-stepper",l?"true":"false"):L("show-stepper",null),L("stepper-position",i&&i!=="top"?i:null),H("hide-controls",s),H("keep-mounted",b),L("variant",n&&n!=="default"?n:null),H("headless",r),L("next-label",a||null),L("prev-label",m||null),L("finish-label",u||null)},[o,t,l,i,s,b,n,r,a,m,u]),N.default.createElement("ui-wizard",{ref:c,...E},d)});ke.displayName="Wizard";const Pe=N.default.forwardRef(function({open:o,mode:t,orientation:l,variant:i,floating:s,placement:b,collapsible:n,label:r,headless:a,onSelect:m,onOpenChange:u,onToggle:y,children:p,...g},A){const d=v.useRef(null);return v.useImperativeHandle(A,()=>d.current),v.useEffect(()=>{const E=d.current;if(!E)return;const e=L=>{const H=L.detail;H&&(m==null||m(H))},c=L=>{var f;const H=(f=L.detail)==null?void 0:f.open;typeof H=="boolean"&&(u==null||u(H))},w=L=>{var f;const H=(f=L.detail)==null?void 0:f.open;typeof H=="boolean"&&(y==null||y(H))};return E.addEventListener("select",e),E.addEventListener("change",c),E.addEventListener("toggle",w),()=>{E.removeEventListener("select",e),E.removeEventListener("change",c),E.removeEventListener("toggle",w)}},[m,u,y]),v.useEffect(()=>{const E=d.current;if(!E)return;const e=(w,L)=>{const H=E.getAttribute(w);if(L==null){H!=null&&E.removeAttribute(w);return}H!==L&&E.setAttribute(w,L)},c=(w,L)=>{L?e(w,""):e(w,null)};typeof o=="boolean"?c("open",o):e("open",null),e("mode",t&&t!=="bar"?t:null),e("orientation",l&&l!=="horizontal"?l:null),e("variant",i&&i!=="default"?i:null),c("floating",s),e("placement",b&&b!=="bottom-right"?b:null),c("collapsible",n),e("label",r||null),c("headless",a)},[o,t,l,i,s,b,n,r,a]),N.default.createElement("ui-quick-actions",{ref:d,...g},p)});Pe.displayName="QuickActions";function Dt(h){const{selected:o,orientation:t,activation:l,loop:i,collapsible:s,headless:b,onChange:n,onSelect:r,children:a,...m}=h,u=v.useRef(null);return v.useEffect(()=>{const y=u.current;if(!y)return;const p=g=>{const A=g.detail;A&&(n==null||n(A),r==null||r(A.selected))};return y.addEventListener("change",p),()=>y.removeEventListener("change",p)},[n,r]),v.useEffect(()=>{const y=u.current;y&&(typeof o=="number"?y.setAttribute("selected",String(o)):y.removeAttribute("selected"),t?y.setAttribute("orientation",t):y.removeAttribute("orientation"),l?y.setAttribute("activation",l):y.removeAttribute("activation"),typeof i=="boolean"?y.setAttribute("loop",String(i)):y.removeAttribute("loop"),s?y.setAttribute("collapsible",""):y.removeAttribute("collapsible"),b?y.setAttribute("headless",""):y.removeAttribute("headless"))},[o,t,l,i,s,b]),N.default.createElement("ui-navigation-menu",{ref:u,...m},a)}function Bt(h){const{selected:o,open:t,loop:l,headless:i,orientation:s,placement:b,variant:n,density:r,shape:a,elevation:m,tone:u,closeOnSelect:y,typeahead:p,onChange:g,onOpen:A,onClose:d,onSelect:E,children:e,...c}=h,w=v.useRef(null);return v.useEffect(()=>{const L=w.current;if(!L)return;const H=S=>{const T=S.detail;T&&(g==null||g(T))},f=S=>{const T=S.detail;typeof(T==null?void 0:T.selected)=="number"?A==null||A(T.selected):A==null||A(-1)},P=()=>d==null?void 0:d(),R=S=>{const T=S.detail;T&&(E==null||E(T))};return L.addEventListener("change",H),L.addEventListener("open",f),L.addEventListener("close",P),L.addEventListener("select",R),()=>{L.removeEventListener("change",H),L.removeEventListener("open",f),L.removeEventListener("close",P),L.removeEventListener("select",R)}},[g,A,d,E]),v.useEffect(()=>{const L=w.current;L&&(typeof o=="number"?L.setAttribute("selected",String(o)):L.removeAttribute("selected"),typeof t=="boolean"&&t?L.setAttribute("open",""):L.removeAttribute("open"),typeof l=="boolean"?L.setAttribute("loop",String(l)):L.removeAttribute("loop"),i?L.setAttribute("headless",""):L.removeAttribute("headless"),s&&s!=="horizontal"?L.setAttribute("orientation",s):L.removeAttribute("orientation"),b?L.setAttribute("placement",b):L.removeAttribute("placement"),n&&n!=="default"?L.setAttribute("variant",n):L.removeAttribute("variant"),r&&r!=="default"?L.setAttribute("density",r):L.removeAttribute("density"),a&&a!=="default"?L.setAttribute("shape",a):L.removeAttribute("shape"),m&&m!=="default"?L.setAttribute("elevation",m):L.removeAttribute("elevation"),u&&u!=="default"&&u!=="brand"?L.setAttribute("tone",u):L.removeAttribute("tone"),y==null?L.removeAttribute("close-on-select"):L.setAttribute("close-on-select",y?"true":"false"),p==null?L.removeAttribute("typeahead"):L.setAttribute("typeahead",p?"true":"false"))},[o,t,l,i,s,b,n,r,a,m,u,y,p]),N.default.createElement("ui-menubar",{ref:w,...c},e)}const qt=typeof window<"u"?N.default.useLayoutEffect:N.default.useEffect,Se=N.default.forwardRef(function(o,t){const{open:l,title:i,description:s,closable:b,dismissible:n,closeOnOverlay:r,closeOnEsc:a,lockWhileLoading:m,roleType:u,size:y,state:p,initialFocus:g,submitText:A,cancelText:d,loadingText:E,dialogId:e,config:c,headless:w,onOpen:L,onClose:H,onRequestClose:f,onDialogOpen:P,onDialogSubmit:R,onDialogCancel:S,onDialogDismiss:T,onDialogClose:q,children:x,...k}=o,K=v.useRef(null);return N.default.useImperativeHandle(t,()=>K.current),v.useEffect(()=>{const F=K.current;if(!F)return;const D=()=>L==null?void 0:L(),B=()=>H==null?void 0:H(),$=Q=>{const j=Q.detail;j&&(f==null||f(j))},J=Q=>P==null?void 0:P(Q.detail),G=Q=>R==null?void 0:R(Q.detail),M=Q=>S==null?void 0:S(Q.detail),_=Q=>T==null?void 0:T(Q.detail),I=Q=>q==null?void 0:q(Q.detail);return F.addEventListener("open",D),F.addEventListener("close",B),F.addEventListener("request-close",$),F.addEventListener("ui-open",J),F.addEventListener("ui-submit",G),F.addEventListener("ui-cancel",M),F.addEventListener("ui-dismiss",_),F.addEventListener("ui-close",I),()=>{F.removeEventListener("open",D),F.removeEventListener("close",B),F.removeEventListener("request-close",$),F.removeEventListener("ui-open",J),F.removeEventListener("ui-submit",G),F.removeEventListener("ui-cancel",M),F.removeEventListener("ui-dismiss",_),F.removeEventListener("ui-close",I)}},[L,H,f,P,R,S,T,q]),qt(()=>{const F=K.current;if(!F)return;typeof l=="boolean"&&(l?F.setAttribute("open",""):F.removeAttribute("open")),i?F.setAttribute("title",i):F.removeAttribute("title"),s?F.setAttribute("description",s):F.removeAttribute("description");const D=typeof n=="boolean"?n:b;typeof D=="boolean"?(F.setAttribute("dismissible",String(D)),F.setAttribute("closable",String(D))):(F.removeAttribute("dismissible"),F.removeAttribute("closable")),typeof r=="boolean"?(F.setAttribute("close-on-overlay",String(r)),F.setAttribute("close-on-backdrop",String(r))):(F.removeAttribute("close-on-overlay"),F.removeAttribute("close-on-backdrop")),typeof a=="boolean"?F.setAttribute("close-on-esc",String(a)):F.removeAttribute("close-on-esc"),typeof m=="boolean"?F.setAttribute("lock-while-loading",String(m)):F.removeAttribute("lock-while-loading"),u?F.setAttribute("role",u):F.removeAttribute("role"),y&&y!=="md"&&y!=="2"?F.setAttribute("size",y):F.removeAttribute("size"),p&&p!=="idle"?F.setAttribute("state",p):F.removeAttribute("state"),g?F.setAttribute("initial-focus",g):F.removeAttribute("initial-focus"),A?F.setAttribute("submit-text",A):F.removeAttribute("submit-text"),d?F.setAttribute("cancel-text",d):F.removeAttribute("cancel-text"),E?F.setAttribute("loading-text",E):F.removeAttribute("loading-text"),e&&(F.dialogId=e),c&&(F.config=c),w?F.setAttribute("headless",""):F.removeAttribute("headless")},[l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w]),N.default.createElement("ui-dialog",{ref:K,...k},x)});Se.displayName="Dialog";const Fe=v.createContext(null);function $t({children:h,hostId:o="ui-dialog-react-host"}){const t=v.useRef(null);t.current||(t.current=V.createDialogManager()),v.useEffect(()=>{var s;if(typeof document>"u")return;let i=document.getElementById(o);return i||(i=document.createElement("div"),i.id=o,i.setAttribute("data-ui-dialog-react-host","true"),document.body.appendChild(i)),(s=t.current)==null||s.setContainer(i),()=>{var b;(b=t.current)==null||b.destroy("unmount"),t.current=null,i&&i.parentElement&&i.parentElement.removeChild(i)}},[o]);const l=v.useMemo(()=>({open:(i={})=>{var s;return((s=t.current)==null?void 0:s.open(i))??Promise.resolve({id:"",action:"dismiss"})},confirm:(i={})=>{var s;return((s=t.current)==null?void 0:s.confirm(i))??Promise.resolve({id:"",action:"dismiss"})}}),[]);return N.default.createElement(Fe.Provider,{value:l},h)}function Jt(){const h=v.useContext(Fe);if(!h)throw new Error("useDialog must be used within <DialogProvider>.");return h}const Te=N.default.forwardRef(function({children:o,onOpen:t,onClose:l,...i},s){const b=v.useRef(null);return N.default.useImperativeHandle(s,()=>b.current),v.useEffect(()=>{const n=b.current;if(!n)return;const r=()=>t==null?void 0:t(),a=()=>l==null?void 0:l();return n.addEventListener("open",r),n.addEventListener("close",a),()=>{n.removeEventListener("open",r),n.removeEventListener("close",a)}},[t,l]),N.default.createElement("ui-popover",{ref:b,...i},o)});Te.displayName="Popover";const xe=N.default.forwardRef(function({children:o,selected:t,value:l,orientation:i,activation:s,variant:b,size:n,tone:r,stretched:a,headless:m,onChange:u,onTabChange:y,...p},g){const A=v.useRef(null);return v.useImperativeHandle(g,()=>A.current),v.useEffect(()=>{const d=A.current;if(!d)return;const E=e=>{const c=e.detail;c&&(u==null||u(c.index),y==null||y(c))};return d.addEventListener("change",E),()=>{d.removeEventListener("change",E)}},[u,y]),v.useEffect(()=>{const d=A.current;if(!d)return;const E=(c,w)=>{const L=d.getAttribute(c);if(w==null){L!=null&&d.removeAttribute(c);return}L!==w&&d.setAttribute(c,w)},e=(c,w)=>{w?E(c,""):E(c,null)};E("selected",t!=null?String(t):null),E("value",l||null),E("orientation",i&&i!=="horizontal"?i:null),E("activation",s&&s!=="auto"?s:null),E("variant",b&&b!=="default"?b:null),E("size",n&&n!=="md"?n:null),E("tone",r&&r!=="brand"?r:null),e("stretched",a),e("headless",m)},[t,l,i,s,b,n,r,a,m]),N.default.createElement("ui-tabs",{ref:A,...p},o)});xe.displayName="Tabs";const De=N.default.forwardRef(function({children:o,open:t,placement:l,variant:i,density:s,shape:b,elevation:n,tone:r,closeOnSelect:a,typeahead:m,onOpen:u,onClose:y,onChange:p,onSelect:g,onSelectDetail:A,...d},E){const e=v.useRef(null);return N.default.useImperativeHandle(E,()=>e.current),v.useEffect(()=>{const c=e.current;if(!c)return;const w=()=>u==null?void 0:u(),L=()=>y==null?void 0:y(),H=P=>{var S;const R=(S=P.detail)==null?void 0:S.open;typeof R=="boolean"&&(p==null||p(R))},f=P=>{const R=P.detail||{};A==null||A(R),typeof R.index=="number"&&(g==null||g(R.index))};return c.addEventListener("open",w),c.addEventListener("close",L),c.addEventListener("change",H),c.addEventListener("select",f),()=>{c.removeEventListener("open",w),c.removeEventListener("close",L),c.removeEventListener("change",H),c.removeEventListener("select",f)}},[u,y,p,g,A]),v.useEffect(()=>{const c=e.current;!c||t==null||(t?c.setAttribute("open",""):c.removeAttribute("open"))},[t]),v.useEffect(()=>{const c=e.current;c&&(l?c.setAttribute("placement",l):c.removeAttribute("placement"))},[l]),v.useEffect(()=>{const c=e.current;c&&(i&&i!=="default"?c.setAttribute("variant",i):c.removeAttribute("variant"))},[i]),v.useEffect(()=>{const c=e.current;c&&(s&&s!=="default"?c.setAttribute("density",s):c.removeAttribute("density"))},[s]),v.useEffect(()=>{const c=e.current;c&&(b&&b!=="default"?c.setAttribute("shape",b):c.removeAttribute("shape"))},[b]),v.useEffect(()=>{const c=e.current;c&&(n&&n!=="default"?c.setAttribute("elevation",n):c.removeAttribute("elevation"))},[n]),v.useEffect(()=>{const c=e.current;c&&(r&&r!=="default"&&r!=="brand"?c.setAttribute("tone",r):c.removeAttribute("tone"))},[r]),v.useEffect(()=>{const c=e.current;if(c){if(a==null){c.removeAttribute("close-on-select");return}c.setAttribute("close-on-select",a?"true":"false")}},[a]),v.useEffect(()=>{const c=e.current;if(c){if(m==null){c.removeAttribute("typeahead");return}c.setAttribute("typeahead",m?"true":"false")}},[m]),N.default.createElement("ui-menu",{ref:e,...d},o)});De.displayName="Menu";const Be=N.default.forwardRef(function({children:o,name:t,iconVariant:l,size:i,color:s,secondaryColor:b,variant:n,tone:r,shape:a,spin:m,pulse:u,badge:y,label:p,decorative:g,strokeWidth:A,absoluteStrokeWidth:d,strokeLinecap:E,strokeLinejoin:e,rotate:c,flip:w,rtl:L,...H},f){const P=v.useRef(null);return v.useImperativeHandle(f,()=>P.current),v.useEffect(()=>{const R=P.current;R&&(t?R.setAttribute("name",t):R.removeAttribute("name"),l?R.setAttribute("icon-variant",l):R.removeAttribute("icon-variant"),i!=null&&i!==""?R.setAttribute("size",String(i)):R.removeAttribute("size"),s?R.setAttribute("color",s):R.removeAttribute("color"),b?R.setAttribute("secondary-color",b):R.removeAttribute("secondary-color"),n&&n!=="default"?R.setAttribute("variant",n):R.removeAttribute("variant"),r&&r!=="default"?R.setAttribute("tone",r):R.removeAttribute("tone"),a&&a!=="default"?R.setAttribute("shape",a):R.removeAttribute("shape"),m?R.setAttribute("spin",""):R.removeAttribute("spin"),u?R.setAttribute("pulse",""):R.removeAttribute("pulse"),y?R.setAttribute("badge",""):R.removeAttribute("badge"),p?R.setAttribute("label",p):R.removeAttribute("label"),g?R.setAttribute("decorative",""):R.removeAttribute("decorative"),A!=null&&A!==""?R.setAttribute("stroke-width",String(A)):R.removeAttribute("stroke-width"),d?R.setAttribute("absolute-stroke-width",""):R.removeAttribute("absolute-stroke-width"),E?R.setAttribute("stroke-linecap",E):R.removeAttribute("stroke-linecap"),e?R.setAttribute("stroke-linejoin",e):R.removeAttribute("stroke-linejoin"),c!=null&&Number.isFinite(c)?R.setAttribute("rotate",String(c)):R.removeAttribute("rotate"),w?R.setAttribute("flip",w):R.removeAttribute("flip"),L?R.setAttribute("rtl",""):R.removeAttribute("rtl"))},[t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L]),N.default.createElement("ui-icon",{ref:P,...H},o)});Be.displayName="Icon";const ue={default:"",success:"Success: ",error:"Error: ",warning:"Warning: ",info:"Info: "};function jt(h,o={}){return V.showToast(h,o)}const Gt={show(h,o={}){return V.showToast(h,o)},success(h,o={}){return V.showToast(`${ue.success}${h}`,o)},error(h,o={}){return V.showToast(`${ue.error}${h}`,o)},warning(h,o={}){return V.showToast(`${ue.warning}${h}`,o)},info(h,o={}){return V.showToast(`${ue.info}${h}`,o)}};function _t(){return null}const qe=N.default.forwardRef(function({children:o,headless:t,onShow:l,onHide:i,...s},b){const n=v.useRef(null);return N.default.useImperativeHandle(b,()=>n.current),v.useEffect(()=>{const r=n.current;if(!r)return;const a=u=>{const y=u.detail;y&&(l==null||l(y))},m=u=>{const y=u.detail;y&&(i==null||i(y))};return r.addEventListener("show",a),r.addEventListener("hide",m),()=>{r.removeEventListener("show",a),r.removeEventListener("hide",m)}},[l,i]),v.useEffect(()=>{const r=n.current;r&&(t?r.setAttribute("headless",""):r.removeAttribute("headless"))},[t]),N.default.createElement("ui-toast",{ref:n,...s},o)});qe.displayName="Toast";function ee(h,o){if(typeof window>"u"||typeof customElements>"u"||customElements.get(h))return;const t=`__editora_warned_${h}`,l=window;l[t]||(l[t]=!0,console.warn(`[ui-react/${o}] ${h} is not registered. Import/register the matching web component before using this wrapper.`))}function Mt(h){const{children:o,anchorId:t,open:l,...i}=h,s=v.useRef(null);return v.useEffect(()=>{ee("ui-floating-toolbar","FloatingToolbar")},[]),v.useEffect(()=>{var n,r;const b=s.current;b&&(l&&t?(n=b.showForAnchorId)==null||n.call(b,t):(r=b.hide)==null||r.call(b))},[l,t]),N.default.createElement("ui-floating-toolbar",{ref:s,...i},o)}const $e=N.forwardRef(function({children:o,orientation:t,density:l,ariaLabel:i,...s},b){const n=N.useRef(null);return N.useImperativeHandle(b,()=>n.current),N.useEffect(()=>{ee("ui-block-controls","BlockControls")},[]),N.useEffect(()=>{const r=n.current;r&&(t?r.setAttribute("orientation",t):r.removeAttribute("orientation"),l?r.setAttribute("density",l):r.removeAttribute("density"),i?r.setAttribute("aria-label",i):r.removeAttribute("aria-label"))},[t,l,i]),N.createElement("ui-block-controls",{ref:n,...s},o)});$e.displayName="BlockControls";function Qt(h){const{children:o,open:t,onSelect:l,...i}=h,s=v.useRef(null);return v.useEffect(()=>{ee("ui-command-palette","CommandPalette")},[]),v.useEffect(()=>{const b=s.current;if(!b)return;const n=r=>{var m;const a=(m=r.detail)==null?void 0:m.index;typeof a=="number"&&(l==null||l(a))};return b.addEventListener("select",n),t?b.setAttribute("open",""):b.removeAttribute("open"),()=>b.removeEventListener("select",n)},[t,l]),N.default.createElement("ui-command-palette",{ref:s,...i},o)}function It(h){const{items:o,anchorId:t,anchorPoint:l,open:i,variant:s,density:b,shape:n,elevation:r,tone:a,closeOnSelect:m,typeahead:u,children:y,onOpen:p,onClose:g,onChange:A,onSelect:d,...E}=h,e=v.useRef(null);v.useEffect(()=>{const H=e.current;if(!H)return;const f=()=>p==null?void 0:p(),P=()=>g==null?void 0:g(),R=T=>{var x;const q=(x=T.detail)==null?void 0:x.open;typeof q=="boolean"&&(A==null||A(q))},S=T=>{d==null||d(T.detail)};return H.addEventListener("open",f),H.addEventListener("close",P),H.addEventListener("change",R),H.addEventListener("select",S),()=>{H.removeEventListener("open",f),H.removeEventListener("close",P),H.removeEventListener("change",R),H.removeEventListener("select",S)}},[p,g,A,d]),v.useEffect(()=>{const H=e.current;if(!(!H||i==null)){if(!i){H.close?H.close():H.open=!1;return}if(l&&H.openAt){H.openAt(l);return}if(t){if(H.openForAnchorId){H.openForAnchorId(t);return}if(H.showForAnchorId){H.showForAnchorId(t);return}}H.open=!0}},[i,t,l]);const c=H=>H?H.map((f,P)=>{if(f.separator)return N.default.createElement("div",{key:P,className:"separator",role:"separator"});let R=null;f.icon&&(R=typeof f.icon=="string"?N.default.createElement("span",{className:"icon"},f.icon):f.icon);let S=null;return f.submenu&&(S=N.default.createElement("div",{className:"submenu"},c(f.submenu))),N.default.createElement("div",{key:P,className:"menuitem",role:"menuitem",tabIndex:f.disabled?-1:0,"aria-disabled":f.disabled?"true":void 0,"data-value":f.value,onClick:f.disabled?void 0:f.onClick},R,N.default.createElement("span",{className:"label"},f.label),f.submenu&&N.default.createElement("span",{className:"submenu-arrow"},"▶"),S)}):null,w=N.default.Children.count(y)>0,L=!!i&&!l&&!t;return N.default.createElement("ui-context-menu",{ref:e,...E,...L?{open:""}:{},...s&&s!=="default"?{variant:s}:{},...b&&b!=="default"?{density:b}:{},...n&&n!=="default"?{shape:n}:{},...r&&r!=="default"?{elevation:r}:{},...a&&a!=="default"&&a!=="brand"?{tone:a}:{},...m==null?{}:{"close-on-select":m?"true":"false"},...u==null?{}:{typeahead:u?"true":"false"}},w?y:N.default.createElement("div",{slot:"menu"},c(o)))}function Kt(h){const{children:o,anchorId:t,open:l,placement:i,offset:s,strategy:b,arrow:n,variant:r,tone:a,radius:m,size:u,closeOnOutside:y,closeOnEscape:p,onOpen:g,onClose:A,onOpenChange:d,...E}=h,e=v.useRef(null);return v.useEffect(()=>{ee("ui-selection-popup","SelectionPopup")},[]),v.useEffect(()=>{const c=e.current;if(!c)return;const w=()=>{g==null||g(),d==null||d(!0)},L=()=>{A==null||A(),d==null||d(!1)};return c.addEventListener("open",w),c.addEventListener("close",L),()=>{c.removeEventListener("open",w),c.removeEventListener("close",L)}},[g,A,d]),v.useEffect(()=>{var H,f;const c=e.current;if(!c)return;const w=(P,R)=>{const S=c.getAttribute(P);if(R==null){S!=null&&c.removeAttribute(P);return}S!==R&&c.setAttribute(P,R)},L=(P,R,S=void 0)=>{if(R==null){S!==void 0&&w(P,S?null:"false");return}R?w(P,""):w(P,"false")};w("anchor-id",t??null),w("placement",i&&i!=="top"?i:null),w("offset",typeof s=="number"&&Number.isFinite(s)?String(s):null),w("strategy",b&&b!=="fixed"?b:null),w("variant",r&&r!=="default"?r:null),w("tone",a&&a!=="brand"?a:null),w("radius",m?String(m):null),w("size",u&&u!=="md"?u:null),L("arrow",n),L("close-on-outside",y,!0),L("close-on-escape",p,!0),l&&t?(H=c.openFor)==null||H.call(c,t):l?c.setAttribute("open",""):l===!1?(f=c.close)==null||f.call(c):c.removeAttribute("open")},[l,t,i,s,b,n,r,a,m,u,y,p]),N.default.createElement("ui-selection-popup",{ref:e,...E},o)}function Ut(h){const{children:o,open:t,position:l,...i}=h,s=v.useRef(null);return v.useEffect(()=>{ee("ui-plugin-panel","PluginPanel")},[]),v.useEffect(()=>{const b=s.current;b&&(t?b.setAttribute("open",""):b.removeAttribute("open"),l&&b.setAttribute("position",l))},[t,l]),N.default.createElement("ui-plugin-panel",{ref:s,...i},o)}const Je=N.default.forwardRef(function(o,t){const{children:l,onSubmit:i,onInvalid:s,onValidate:b,onAutosave:n,onDirtyChange:r,novalidate:a,autosave:m,autosaveDelay:u,guardUnsaved:y,variant:p,tone:g,density:A,shape:d,elevation:E,gap:e,headless:c,loading:w,...L}=o,H=v.useRef(null);return v.useImperativeHandle(t,()=>H.current),v.useEffect(()=>{const f=H.current;if(!f)return;const P=x=>{const k=x.detail||{};i==null||i(k.values||{})},R=x=>{const k=x.detail||{};s==null||s(k.errors||{},k.values||{})},S=x=>{const k=x.detail||{};b==null||b({valid:!!k.valid,errors:k.errors||{}})},T=x=>{const k=x.detail||{};n==null||n(k.values||{})},q=x=>{const k=x.detail||{};r==null||r(!!k.dirty,k.values||{})};return f.addEventListener("submit",P),f.addEventListener("invalid",R),f.addEventListener("validate",S),f.addEventListener("autosave",T),f.addEventListener("dirty-change",q),()=>{f.removeEventListener("submit",P),f.removeEventListener("invalid",R),f.removeEventListener("validate",S),f.removeEventListener("autosave",T),f.removeEventListener("dirty-change",q)}},[i,s,b,n,r]),v.useEffect(()=>{const f=H.current;f&&(a?f.setAttribute("novalidate",""):f.removeAttribute("novalidate"),m?f.setAttribute("autosave",""):f.removeAttribute("autosave"),typeof u=="number"&&Number.isFinite(u)?f.setAttribute("autosave-delay",String(u)):f.removeAttribute("autosave-delay"),y?f.setAttribute("guard-unsaved",""):f.removeAttribute("guard-unsaved"),p&&p!=="default"?f.setAttribute("variant",p):f.removeAttribute("variant"),g&&g!=="default"?f.setAttribute("tone",g):f.removeAttribute("tone"),A&&A!=="default"?f.setAttribute("density",A):f.removeAttribute("density"),d&&d!=="default"?f.setAttribute("shape",d):f.removeAttribute("shape"),E&&E!=="default"?f.setAttribute("elevation",E):f.removeAttribute("elevation"),e?f.setAttribute("gap",e):f.removeAttribute("gap"),c?f.setAttribute("headless",""):f.removeAttribute("headless"),w?f.setAttribute("loading",""):f.removeAttribute("loading"))},[a,m,u,y,p,g,A,d,E,e,c,w]),N.default.createElement("ui-form",{ref:H,...L},l)});Je.displayName="Form";function Xt(){const h=v.useRef(null),o=v.useCallback(async()=>{const n=h.current;return n?await n.submit():!1},[]),t=v.useCallback(async()=>{const n=h.current;return n?await n.validate():{valid:!0,errors:{}}},[]),l=v.useCallback(()=>{var r;const n=h.current;return n?(r=n.getValues)==null?void 0:r.call(n):{}},[]),i=v.useCallback(n=>{var a;const r=h.current;return(a=r==null?void 0:r.reset)==null?void 0:a.call(r,n)},[]),s=v.useCallback(()=>{var r;const n=h.current;return n?typeof n.isDirty=="function"?!!n.isDirty():((r=n.hasAttribute)==null?void 0:r.call(n,"dirty"))||!1:!1},[]),b=v.useCallback(n=>{var a;const r=h.current;return(a=r==null?void 0:r.markClean)==null?void 0:a.call(r,n)},[]);return{ref:h,submit:o,validate:t,getValues:l,reset:i,isDirty:s,markClean:b}}function Yt(h){const{placement:o="bottom",offset:t=8,open:l,onOpen:i,onClose:s,role:b="menu"}=h||{},n=v.useRef(null),r=v.useRef(null),a=v.useRef(null),[m,u]=v.useState({top:0,left:0,placement:o}),y=typeof l<"u",[p,g]=v.useState(!!l),A=y?l:p,d=F=>{y||g(F),F?i&&i():s&&s()},E=()=>d(!A),e=()=>d(!0),c=()=>d(!1),w=v.useCallback(()=>{const F=n.current,D=r.current;if(!F||!D)return;const B=V.computePosition(F,D,{placement:o,offset:t});u({top:Math.round(B.top),left:Math.round(B.left),placement:B.placement,arrow:B.x||B.y?{x:B.x,y:B.y}:void 0})},[o,t]);v.useEffect(()=>{if(!A)return;const F=n.current,D=r.current;if(!F||!D)return;w();const B=()=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>w())},$=()=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>w())};window.addEventListener("scroll",B,!0),window.addEventListener("resize",$);let J=null,G=null;try{typeof ResizeObserver<"u"&&(J=new ResizeObserver($),G=new ResizeObserver($),J.observe(F),G.observe(D))}catch{J=G=null}return()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",$),J&&J.disconnect(),G&&G.disconnect(),a.current&&cancelAnimationFrame(a.current)}},[A,w]);const L=v.useCallback(F=>{n.current=F},[]),H=v.useCallback(F=>{r.current=F},[]),f=v.useRef(`floating-${Math.random().toString(36).slice(2,9)}`),P=()=>r.current?Array.from(r.current.querySelectorAll('[role="menuitem"], .item, [data-menu-item]')).filter(Boolean):[],R=F=>{const D=P();if(!D.length)return;const B=Math.max(0,Math.min(D.length-1,F));try{D[B].focus()}catch{}},S=()=>R(0),T=()=>{const F=P();F.length&&R(F.length-1)},q=()=>{const F=P(),D=F.findIndex(B=>B===document.activeElement);R(D<0?0:(D+1)%F.length)},x=()=>{const F=P(),D=F.findIndex(B=>B===document.activeElement);R(D<=0?F.length-1:D-1)};return{referenceRef:L,floatingRef:H,coords:m,update:w,open:A,setOpen:d,toggle:E,openPopup:e,closePopup:c,getReferenceProps:(F={})=>({ref:L,"aria-haspopup":b,"aria-controls":f.current,"aria-expanded":A?"true":"false",onClick:D=>{F.onClick&&F.onClick(D),E()},onKeyDown:D=>{F.onKeyDown&&F.onKeyDown(D),D.key==="ArrowDown"&&(D.preventDefault(),e(),setTimeout(()=>S(),0))},...F}),getFloatingProps:(F={})=>({id:f.current,ref:H,role:b,tabIndex:-1,style:{position:"absolute",top:`${m.top}px`,left:`${m.left}px`},hidden:!A,onKeyDown:D=>{F.onKeyDown&&F.onKeyDown(D),D.key==="Escape"?(D.preventDefault(),c()):D.key==="ArrowDown"?(D.preventDefault(),q()):D.key==="ArrowUp"?(D.preventDefault(),x()):D.key==="Home"?(D.preventDefault(),S()):D.key==="End"&&(D.preventDefault(),T())},...F}),focusFirstItem:S,focusLastItem:T,focusNext:q,focusPrev:x}}function U(h){if(h!=null){if(typeof h=="object")try{return JSON.stringify(h)}catch{return}return String(h)}}function Zt(h){const{children:o,className:t,variant:l,tone:i,elevation:s,radius:b,interactive:n,headless:r,p:a,px:m,py:u,pt:y,pr:p,pb:g,pl:A,m:d,mx:E,my:e,mt:c,mr:w,mb:L,ml:H,width:f,w:P,minWidth:R,minW:S,maxWidth:T,maxW:q,height:x,h:k,minHeight:K,minH:F,maxHeight:D,maxH:B,display:$,position:J,inset:G,top:M,right:_,bottom:I,left:Q,flexBasis:j,flexGrow:Z,flexShrink:Y,gridArea:re,gridColumn:ie,gridColumnStart:C,gridColumnEnd:z,gridRow:le,gridRowStart:W,gridRowEnd:X,align:yt,bg:Lt,color:gt,...ht}=h,wt={className:t,...ht,p:U(a),px:U(m),py:U(u),pt:U(y),pr:U(p),pb:U(g),pl:U(A),m:U(d),mx:U(E),my:U(e),mt:U(c),mr:U(w),mb:U(L),ml:U(H),width:U(f),w:U(P),minwidth:U(R??S),maxwidth:U(T??q),height:U(x),h:U(k),minheight:U(K??F),maxheight:U(D??B),display:U($),position:U(J),inset:U(G),top:U(M),right:U(_),bottom:U(I),left:U(Q),flexbasis:U(j),flexgrow:U(Z),flexshrink:U(Y),gridarea:U(re),gridcolumn:U(ie),gridcolumnstart:U(C),gridcolumnend:U(z),gridrow:U(le),gridrowstart:U(W),gridrowend:U(X),align:U(yt),bg:U(Lt),color:U(gt),variant:l&&l!=="default"?l:void 0,tone:i&&i!=="default"?i:void 0,elevation:s&&s!=="default"?s:void 0,radius:b&&b!=="default"?b:void 0,interactive:n?"":void 0,headless:r?"":void 0};return N.default.createElement("ui-box",wt,o)}function te(h){if(h!=null){if(typeof h=="object")try{return JSON.stringify(h)}catch{return}return String(h)}}function zt(h){const{children:o,className:t,direction:l,align:i,justify:s,wrap:b,gap:n,rowGap:r,columnGap:a,display:m,headless:u,...y}=h,p={className:t,...y,direction:te(l),align:te(i),justify:te(s),wrap:te(b),gap:te(n),rowgap:te(r),columngap:te(a),display:te(m),headless:u?"":void 0};return N.default.createElement("ui-flex",p,o)}function O(h){if(h!=null){if(typeof h=="object")try{return JSON.stringify(h)}catch{return}return String(h)}}function Wt(h){const{children:o,className:t,columns:l,rows:i,gap:s,rowGap:b,columnGap:n,autoFlow:r,autoRows:a,autoColumns:m,align:u,justify:y,place:p,alignContent:g,justifyContent:A,placeContent:d,display:E,headless:e,...c}=h,w={className:t,...c,columns:O(l),rows:O(i),gap:O(s),rowgap:O(b),columngap:O(n),autoflow:O(r),autorows:O(a),autocolumns:O(m),align:O(u),justify:O(y),place:O(p),aligncontent:O(g),justifycontent:O(A),placecontent:O(d),display:O(E),headless:e?"":void 0};return N.default.createElement("ui-grid",w,o)}const je=N.default.forwardRef(function({size:o="medium",variant:t="default",tone:l="neutral",radius:i="md",density:s="comfortable",inset:b,children:n,...r},a){const m=v.useRef(null);return N.default.useImperativeHandle(a,()=>m.current),v.useEffect(()=>{const u=m.current;if(!u)return;const y=(g,A)=>{const d=u.getAttribute(g);if(A==null){d!=null&&u.removeAttribute(g);return}d!==A&&u.setAttribute(g,A)},p=(g,A)=>{A?u.hasAttribute(g)||u.setAttribute(g,""):u.hasAttribute(g)&&u.removeAttribute(g)};y("size",o!=="medium"?o:null),y("variant",t!=="default"?t:null),y("tone",l!=="neutral"?l:null),y("radius",i!=="md"?i:null),y("density",s!=="comfortable"?s:null),p("inset",b)},[o,t,l,i,s,b]),N.default.createElement("ui-section",{ref:m,...r},n)});je.displayName="Section";function Ot(h){const{children:o,size:t="md",...l}=h;return N.default.createElement("ui-container",{size:t,...l},o)}const Ge=N.default.forwardRef(function({children:o,collapsed:t,collapsible:l,rail:i,position:s,value:b,items:n,variant:r,size:a,density:m,tone:u,showIcons:y,showBadges:p,headless:g,onSelect:A,onChange:d,onToggle:E,onCollapseChange:e,...c},w){const L=v.useRef(null);return v.useImperativeHandle(w,()=>L.current),v.useEffect(()=>{const H=L.current;if(!H)return;const f=T=>{const q=T.detail;q&&(A==null||A(q))},P=T=>{const q=T.detail;q&&(d==null||d(q))},R=T=>{var x;const q=(x=T.detail)==null?void 0:x.collapsed;typeof q=="boolean"&&(E==null||E(q))},S=T=>{var x;const q=(x=T.detail)==null?void 0:x.collapsed;typeof q=="boolean"&&(e==null||e(q))};return H.addEventListener("select",f),H.addEventListener("change",P),H.addEventListener("toggle",R),H.addEventListener("collapse-change",S),()=>{H.removeEventListener("select",f),H.removeEventListener("change",P),H.removeEventListener("toggle",R),H.removeEventListener("collapse-change",S)}},[A,d,E,e]),v.useEffect(()=>{const H=L.current;if(!H)return;const f=(R,S)=>{const T=H.getAttribute(R);if(S==null){T!=null&&H.removeAttribute(R);return}T!==S&&H.setAttribute(R,S)},P=(R,S,T)=>{if(S==null){T!==void 0&&T===!1&&f(R,null);return}S?f(R,""):f(R,null)};if(P("collapsed",t),P("collapsible",l),P("rail",i),P("headless",g),f("position",s&&s!=="left"?s:null),f("value",b!=null&&b!==""?String(b):null),n&&n.length)try{f("items",JSON.stringify(n))}catch{f("items",null)}else f("items",null);f("variant",r&&r!=="surface"?r:null),f("size",a&&a!=="md"?a:null),f("density",m&&m!=="default"?m:null),f("tone",u&&u!=="default"?u:null),typeof y=="boolean"?f("show-icons",y?"true":"false"):f("show-icons",null),typeof p=="boolean"?f("show-badges",p?"true":"false"):f("show-badges",null)},[t,l,i,g,s,b,n,r,a,m,u,y,p]),N.default.createElement("ui-sidebar",{ref:L,...c},o)});Ge.displayName="Sidebar";const _e=N.default.forwardRef(function({children:o,separator:t,maxItems:l,onSelect:i,...s},b){const n=v.useRef(null);return v.useImperativeHandle(b,()=>n.current),v.useEffect(()=>{const r=n.current;if(!r||!i)return;const a=m=>{const u=m.detail;u&&i(u)};return r.addEventListener("select",a),()=>r.removeEventListener("select",a)},[i]),v.useEffect(()=>{const r=n.current;r&&(t!=null&&t!==""?r.setAttribute("separator",t):r.removeAttribute("separator"))},[t]),v.useEffect(()=>{const r=n.current;r&&(typeof l=="number"&&Number.isFinite(l)?r.setAttribute("max-items",String(l)):r.removeAttribute("max-items"))},[l]),N.default.createElement("ui-breadcrumb",{ref:n,...s},o)});_e.displayName="Breadcrumb";const Me=N.default.forwardRef(function({children:o,sticky:t,bordered:l,dense:i,showMenuButton:s,onMenuTrigger:b,...n},r){const a=v.useRef(null);return v.useImperativeHandle(r,()=>a.current),v.useEffect(()=>{const m=a.current;if(!m||!b)return;const u=()=>b();return m.addEventListener("menu-trigger",u),()=>m.removeEventListener("menu-trigger",u)},[b]),v.useEffect(()=>{const m=a.current;m&&(t?m.setAttribute("sticky",""):m.removeAttribute("sticky"))},[t]),v.useEffect(()=>{const m=a.current;m&&(l?m.setAttribute("bordered",""):m.removeAttribute("bordered"))},[l]),v.useEffect(()=>{const m=a.current;m&&(i?m.setAttribute("dense",""):m.removeAttribute("dense"))},[i]),v.useEffect(()=>{const m=a.current;m&&(s?m.setAttribute("show-menu-button",""):m.removeAttribute("show-menu-button"))},[s]),N.default.createElement("ui-app-header",{ref:a,...n},o)});Me.displayName="AppHeader";const Qe=N.default.forwardRef(function({children:o,open:t,side:l,variant:i,density:s,shape:b,elevation:n,tone:r,size:a,inset:m,dismissible:u,onOpen:y,onClose:p,onChange:g,...A},d){const E=v.useRef(null);return v.useImperativeHandle(d,()=>E.current),v.useEffect(()=>{const e=E.current;if(!e)return;const c=()=>y==null?void 0:y(),w=()=>p==null?void 0:p(),L=H=>{var P;const f=(P=H.detail)==null?void 0:P.open;typeof f=="boolean"&&(g==null||g(f))};return e.addEventListener("open",c),e.addEventListener("close",w),e.addEventListener("change",L),()=>{e.removeEventListener("open",c),e.removeEventListener("close",w),e.removeEventListener("change",L)}},[y,p,g]),v.useEffect(()=>{const e=E.current;e&&(t?e.setAttribute("open",""):e.removeAttribute("open"))},[t]),v.useEffect(()=>{const e=E.current;e&&(l?e.setAttribute("side",l):e.removeAttribute("side"))},[l]),v.useEffect(()=>{const e=E.current;e&&(u?e.setAttribute("dismissible",""):e.removeAttribute("dismissible"))},[u]),v.useEffect(()=>{const e=E.current;e&&(i&&i!=="default"?e.setAttribute("variant",i):e.removeAttribute("variant"))},[i]),v.useEffect(()=>{const e=E.current;e&&(s&&s!=="default"?e.setAttribute("density",s):e.removeAttribute("density"))},[s]),v.useEffect(()=>{const e=E.current;e&&(b&&b!=="default"?e.setAttribute("shape",b):e.removeAttribute("shape"))},[b]),v.useEffect(()=>{const e=E.current;e&&(n&&n!=="default"?e.setAttribute("elevation",n):e.removeAttribute("elevation"))},[n]),v.useEffect(()=>{const e=E.current;e&&(r&&r!=="default"&&r!=="brand"?e.setAttribute("tone",r):e.removeAttribute("tone"))},[r]),v.useEffect(()=>{const e=E.current;e&&(a&&a!=="default"?e.setAttribute("size",a):e.removeAttribute("size"))},[a]),v.useEffect(()=>{const e=E.current;e&&(m?e.setAttribute("inset",""):e.removeAttribute("inset"))},[m]),N.default.createElement("ui-drawer",{ref:E,...A},o)});Qe.displayName="Drawer";const Ie=N.default.forwardRef(function({children:o,mode:t,variant:l,density:i,maxWidth:s,sidebarSide:b,collapsed:n,headless:r,sidebarWidth:a,asideWidth:m,onLayoutChange:u,...y},p){const g=v.useRef(null);return N.default.useImperativeHandle(p,()=>g.current),v.useEffect(()=>{const A=g.current;if(!A)return;const d=()=>u==null?void 0:u();return A.addEventListener("layoutchange",d),()=>A.removeEventListener("layoutchange",d)},[u]),v.useEffect(()=>{const A=g.current;A&&(t&&t!=="dashboard"?A.setAttribute("mode",t):A.removeAttribute("mode"),l&&l!=="default"?A.setAttribute("variant",l):A.removeAttribute("variant"),i&&i!=="default"?A.setAttribute("density",i):A.removeAttribute("density"),s?A.setAttribute("max-width",s):A.removeAttribute("max-width"),b&&b!=="start"?A.setAttribute("sidebar-side",b):A.removeAttribute("sidebar-side"),n?A.setAttribute("collapsed",""):A.removeAttribute("collapsed"),r?A.setAttribute("headless",""):A.removeAttribute("headless"),a?A.setAttribute("sidebar-width",a):A.removeAttribute("sidebar-width"),m?A.setAttribute("aside-width",m):A.removeAttribute("aside-width"))},[t,l,i,s,b,n,r,a,m]),N.default.createElement("ui-layout",{ref:g,...y},o)});Ie.displayName="Layout";const Ke=v.createContext(null);function Vt(){try{const h=getComputedStyle(document.documentElement),o=h.getPropertyValue("--ui-color-primary").trim();return o?{colors:{primary:o||void 0,text:h.getPropertyValue("--ui-color-text").trim()||void 0,background:h.getPropertyValue("--ui-color-background").trim()||void 0}}:{}}catch{return{}}}function Ct({tokens:h,children:o,storageKey:t="editora.theme.tokens"}){const l=()=>{if(typeof window<"u"&&t)try{const n=localStorage.getItem(t);if(n)return JSON.parse(n)}catch{}if(h&&Object.keys(h).length)return{...V.defaultTokens,...h};if(typeof window<"u"){const n=Vt();if(n.colors&&n.colors.primary)return{...V.defaultTokens,...n}}return{...V.defaultTokens,...h||{}}},[i,s]=v.useState(()=>l());v.useEffect(()=>{h&&Object.keys(h).length&&s(n=>({...n,...h}))},[h]),v.useEffect(()=>{V.applyTheme(i);try{V.registerThemeHost(document.documentElement)}catch{}if(typeof window<"u"&&t){const n=JSON.stringify(i);let r;const a=()=>{try{localStorage.setItem(t,n)}catch{}};return window.requestIdleCallback?r=window.requestIdleCallback(a,{timeout:1e3}):r=window.setTimeout(a,250),()=>{try{window.cancelIdleCallback&&r?window.cancelIdleCallback(r):r&&clearTimeout(r)}catch{}}}},[i,t]);const b=n=>s(n);return N.default.createElement(Ke.Provider,{value:{tokens:i,setTokens:b}},o)}function er(){const h=v.useContext(Ke);if(!h)throw new Error("useTheme must be used within ThemeProvider");return h}function ne(h,o,t){if(t==null){h.removeAttribute(o);return}t?h.setAttribute(o,""):h.removeAttribute(o)}function se(h,o,t,l){const i=t&&t!==l?t:void 0;if(!i){h.removeAttribute(o);return}h.setAttribute(o,i)}const Ue=N.forwardRef(function({checked:o,disabled:t,indeterminate:l,loading:i,headless:s,invalid:b,density:n,preset:r,onCheckedChange:a,onChange:m,onInput:u,children:y,...p},g){const A=N.useRef(null);N.useImperativeHandle(g,()=>A.current);const d=typeof window<"u"?N.useLayoutEffect:N.useEffect;N.useEffect(()=>{ee("ui-checkbox","Checkbox")},[]),d(()=>{const e=A.current;e&&(ne(e,"checked",o),ne(e,"disabled",t),ne(e,"indeterminate",l),ne(e,"loading",i),ne(e,"headless",s),ne(e,"invalid",b),se(e,"density",n,"default"),se(e,"preset",r,"default"))},[o,t,l,i,s,b,n,r]),N.useEffect(()=>{const e=A.current;if(!e||!a&&!m&&!u)return;const c=L=>{var f;const H=L;u==null||u(H),typeof((f=H.detail)==null?void 0:f.checked)=="boolean"&&(a==null||a(H.detail.checked,H.detail))},w=L=>{const H=L;m==null||m(H)};return e.addEventListener("input",c),e.addEventListener("change",w),()=>{e.removeEventListener("input",c),e.removeEventListener("change",w)}},[a,m,u]);const E={ref:A,...p,checked:o?"":void 0,disabled:t?"":void 0,indeterminate:l?"":void 0,loading:i?"":void 0,headless:s?"":void 0,invalid:b?"":void 0,density:n&&n!=="default"?n:void 0,preset:r&&r!=="default"?r:void 0};return N.createElement("ui-checkbox",E,y)});Ue.displayName="Checkbox";const Xe=N.default.forwardRef(function({value:o,disabled:t,required:l,name:i,orientation:s,variant:b,size:n,tone:r,options:a,onValueChange:m,children:u,...y},p){const g=v.useRef(null);return N.default.useImperativeHandle(p,()=>g.current),v.useEffect(()=>{const A=g.current;if(!A)return;const d=E=>{const e=E.detail;e&&(m==null||m(e))};return A.addEventListener("change",d),()=>A.removeEventListener("change",d)},[m]),v.useEffect(()=>{const A=g.current;if(!A)return;const d=(e,c)=>{const w=A.getAttribute(e);if(c==null){w!=null&&A.removeAttribute(e);return}w!==c&&A.setAttribute(e,c)},E=(e,c)=>{c?A.hasAttribute(e)||A.setAttribute(e,""):A.hasAttribute(e)&&A.removeAttribute(e)};d("value",o??null),E("disabled",t),E("required",l),d("name",i||null),d("orientation",s&&s!=="vertical"?s:null),d("variant",b&&b!=="default"?b:null),d("size",n&&n!=="md"?n:null),d("tone",r&&r!=="brand"?r:null),a&&a.length?d("options",JSON.stringify(a)):d("options",null)},[o,t,l,i,s,b,n,r,a]),N.default.createElement("ui-radio-group",{ref:g,...y},u)});Xe.displayName="RadioGroup";const Ye=N.default.forwardRef(function({children:o,checked:t,disabled:l,headless:i,loading:s,size:b,variant:n,tone:r,label:a,description:m,name:u,value:y,required:p,onInput:g,onChange:A,...d},E){const e=v.useRef(null);return v.useImperativeHandle(E,()=>e.current),v.useEffect(()=>{const c=e.current;if(!c)return;const w=H=>{const f=H.detail;f&&(g==null||g(f))},L=H=>{const f=H.detail;f&&(A==null||A(f))};return c.addEventListener("input",w),c.addEventListener("change",L),()=>{c.removeEventListener("input",w),c.removeEventListener("change",L)}},[g,A]),v.useEffect(()=>{const c=e.current;if(!c)return;const w=(H,f)=>{const P=c.getAttribute(H);if(f==null){P!=null&&c.removeAttribute(H);return}P!==f&&c.setAttribute(H,f)},L=(H,f)=>{f?w(H,""):w(H,null)};L("checked",t),L("disabled",l),L("headless",i),L("loading",s),L("required",p),w("size",b&&b!=="md"?b:null),w("variant",n&&n!=="default"?n:null),w("tone",r&&r!=="brand"?r:null),w("label",a||null),w("description",m||null),w("name",u||null),w("value",y||null)},[t,l,i,s,p,b,n,r,a,m,u,y]),N.default.createElement("ui-switch",{ref:e,...d},o)});Ye.displayName="Switch";const Ze=N.default.forwardRef(function({children:o,pressed:t,disabled:l,loading:i,headless:s,size:b,variant:n,tone:r,name:a,value:m,required:u,iconOn:y,iconOff:p,onInput:g,onChange:A,...d},E){const e=v.useRef(null);return v.useImperativeHandle(E,()=>e.current),v.useEffect(()=>{const c=e.current;if(!c)return;const w=H=>{const f=H.detail;f&&(g==null||g(f))},L=H=>{const f=H.detail;f&&(A==null||A(f))};return c.addEventListener("input",w),c.addEventListener("change",L),()=>{c.removeEventListener("input",w),c.removeEventListener("change",L)}},[g,A]),v.useEffect(()=>{const c=e.current;if(!c)return;const w=(H,f)=>{const P=c.getAttribute(H);if(f==null){P!=null&&c.removeAttribute(H);return}P!==f&&c.setAttribute(H,f)},L=(H,f)=>{f?w(H,""):w(H,null)};L("pressed",t),L("disabled",l),L("loading",i),L("headless",s),L("required",u),w("size",b&&b!=="md"?b:null),w("variant",n&&n!=="default"?n:null),w("tone",r&&r!=="brand"?r:null),w("name",a||null),w("value",m||null),w("icon-on",y||null),w("icon-off",p||null)},[t,l,i,s,u,b,n,r,a,m,y,p]),N.default.createElement("ui-toggle",{ref:e,...d},o)});Ze.displayName="Toggle";const ze=N.default.forwardRef(function({children:o,value:t,multiple:l,disabled:i,headless:s,orientation:b,variant:n,size:r,density:a,allowEmpty:m,required:u,activation:y,onInput:p,onChange:g,onValueChange:A,...d},E){const e=v.useRef(null);return v.useImperativeHandle(E,()=>e.current),v.useEffect(()=>{const c=e.current;if(!c)return;const w=H=>{const f=H.detail;f&&(p==null||p(f),A==null||A(f))},L=H=>{const f=H.detail;f&&(g==null||g(f),A==null||A(f))};return c.addEventListener("input",w),c.addEventListener("change",L),()=>{c.removeEventListener("input",w),c.removeEventListener("change",L)}},[p,g,A]),v.useEffect(()=>{const c=e.current;if(!c)return;const w=(H,f)=>{const P=c.getAttribute(H);if(f==null){P!=null&&c.removeAttribute(H);return}P!==f&&c.setAttribute(H,f)},L=(H,f)=>{f?w(H,""):w(H,null)};L("multiple",l),L("disabled",i),L("headless",s),L("allow-empty",m),L("required",u),t==null?w("value",null):Array.isArray(t)?w("value",JSON.stringify(t)):w("value",String(t)),w("orientation",b&&b!=="horizontal"?b:null),w("variant",n&&n!=="default"?n:null),w("size",r&&r!=="md"?r:null),w("density",a&&a!=="default"?a:null),w("activation",y&&y!=="auto"?y:null)},[t,l,i,s,m,u,b,n,r,a,y]),N.default.createElement("ui-toggle-group",{ref:e,...d},o)});ze.displayName="ToggleGroup";function tr(h){if(h!=null){if(typeof h=="string")return h;if(!(!Number.isFinite(h)||h<=0))return Math.abs(h-16/9)<.01?"16/9":Math.abs(h-4/3)<.01?"4/3":Math.abs(h-1)<.01?"1/1":`${h}/1`}}const We=N.forwardRef(function({ratio:o,fit:t,children:l,...i},s){const b=N.useRef(null);return N.useImperativeHandle(s,()=>b.current),N.useEffect(()=>{ee("ui-aspect-ratio","AspectRatio")},[]),N.useEffect(()=>{const n=b.current;if(!n)return;const r=tr(o);r?n.setAttribute("ratio",r):n.removeAttribute("ratio"),t?n.setAttribute("fit",t):n.removeAttribute("fit")},[o,t]),N.createElement("ui-aspect-ratio",{ref:b,...i},l)});We.displayName="AspectRatio";function ce(h){const o=h.trim().split(/\s+/).filter(Boolean);return o.length===0?"?":o.length===1?o[0].slice(0,2).toUpperCase():`${o[0][0]||""}${o[1][0]||""}`.toUpperCase()}function rr(h){if(h!=null)return h==="lazy"||h==="eager"?h:h?"eager":"lazy"}function ir(h,o,t){return h&&h.trim()?h.trim().slice(0,2).toUpperCase():o&&o.trim()?ce(o):typeof t=="string"&&t.trim()?ce(t):"?"}const Oe=N.forwardRef(function({src:o,alt:t,initials:l,size:i,bg:s,color:b,radius:n,fontWeight:r,shape:a,status:m,ring:u,loading:y,children:p,...g},A){const d=N.useRef(null),E=N.useMemo(()=>ir(l,t,p),[l,t,p]);return N.useImperativeHandle(A,()=>d.current),N.useEffect(()=>{ee("ui-avatar","Avatar")},[]),N.useEffect(()=>{const e=d.current;if(!e)return;o?e.setAttribute("src",o):e.removeAttribute("src"),t?e.setAttribute("alt",t):e.removeAttribute("alt"),l?e.setAttribute("initials",l):e.removeAttribute("initials"),i!=null?e.setAttribute("size",String(i)):e.removeAttribute("size"),s?e.setAttribute("bg",s):e.removeAttribute("bg"),b?e.setAttribute("color",b):e.removeAttribute("color"),n?e.setAttribute("radius",n):e.removeAttribute("radius"),r!=null?e.setAttribute("fontweight",String(r)):e.removeAttribute("fontweight"),a?e.setAttribute("shape",a):e.removeAttribute("shape"),m?e.setAttribute("status",m):e.removeAttribute("status"),u==null?e.removeAttribute("ring"):u?e.setAttribute("ring",""):e.removeAttribute("ring");const c=rr(y);c?e.setAttribute("loading",c):e.removeAttribute("loading")},[o,t,l,i,s,b,n,r,a,m,u,y]),N.createElement("ui-avatar",{ref:d,...g},E)});Oe.displayName="Avatar";const Ve=N.default.forwardRef(function({present:o,headless:t,mode:l,size:i,variant:s,keepMounted:b,lazy:n,enterDuration:r,exitDuration:a,delay:m,onBeforeEnter:u,onEnter:y,onAfterEnter:p,onBeforeExit:g,onExit:A,onAfterExit:d,children:E,...e},c){const w=v.useRef(null);return N.default.useImperativeHandle(c,()=>w.current),v.useEffect(()=>{const L=w.current;if(!L)return;const H=x=>{const k=x.detail;return(k==null?void 0:k.state)||"hidden"},f=x=>u==null?void 0:u(H(x)),P=x=>y==null?void 0:y(H(x)),R=x=>p==null?void 0:p(H(x)),S=x=>g==null?void 0:g(H(x)),T=x=>A==null?void 0:A(H(x)),q=x=>d==null?void 0:d(H(x));return L.addEventListener("before-enter",f),L.addEventListener("enter",P),L.addEventListener("after-enter",R),L.addEventListener("before-exit",S),L.addEventListener("exit",T),L.addEventListener("after-exit",q),()=>{L.removeEventListener("before-enter",f),L.removeEventListener("enter",P),L.removeEventListener("after-enter",R),L.removeEventListener("before-exit",S),L.removeEventListener("exit",T),L.removeEventListener("after-exit",q)}},[u,y,p,g,A,d]),v.useEffect(()=>{const L=w.current;L&&(o?L.setAttribute("present",""):L.removeAttribute("present"),t?L.setAttribute("headless",""):L.removeAttribute("headless"),l&&l!=="fade"?L.setAttribute("mode",l):L.removeAttribute("mode"),i&&i!=="md"?L.setAttribute("size",i):L.removeAttribute("size"),s&&s!=="default"?L.setAttribute("variant",s):L.removeAttribute("variant"),b?L.setAttribute("keep-mounted",""):L.removeAttribute("keep-mounted"),n?L.setAttribute("lazy",""):L.removeAttribute("lazy"),typeof r=="number"?L.setAttribute("enter-duration",String(r)):L.removeAttribute("enter-duration"),typeof a=="number"?L.setAttribute("exit-duration",String(a)):L.removeAttribute("exit-duration"),typeof m=="number"?L.setAttribute("delay",String(m)):L.removeAttribute("delay"))},[o,t,l,i,s,b,n,r,a,m]),N.default.createElement("ui-presence",{ref:w,...e},E)});Ve.displayName="Presence";const Ce=N.default.forwardRef(function({value:o,buffer:t,max:l,min:i,indeterminate:s,striped:b,animated:n,showLabel:r,label:a,format:m,precision:u,size:y,variant:p,tone:g,shape:A,mode:d,onValueChange:E,onComplete:e,children:c,...w},L){const H=v.useRef(null);return N.default.useImperativeHandle(L,()=>H.current),v.useEffect(()=>{const f=H.current;if(!f)return;const P=S=>{const T=S.detail;T&&(E==null||E(T))},R=S=>{const T=S.detail;T&&(e==null||e(T))};return f.addEventListener("change",P),f.addEventListener("complete",R),()=>{f.removeEventListener("change",P),f.removeEventListener("complete",R)}},[E,e]),v.useEffect(()=>{const f=H.current;if(!f)return;const P=(S,T)=>{const q=f.getAttribute(S);if(T==null){q!=null&&f.removeAttribute(S);return}q!==T&&f.setAttribute(S,T)},R=(S,T)=>{T?f.hasAttribute(S)||f.setAttribute(S,""):f.hasAttribute(S)&&f.removeAttribute(S)};P("value",o!=null?String(o):null),P("buffer",t!=null?String(t):null),P("max",l!=null?String(l):null),P("min",i!=null?String(i):null),R("indeterminate",s),R("striped",b),R("animated",n),R("show-label",r),P("label",a!=null&&a!==""?a:null),P("format",m!=null&&m!=="percent"?m:null),P("precision",u!=null?String(u):null),P("size",y&&y!=="md"?y:null),P("variant",p&&p!=="default"?p:null),P("tone",g&&g!=="brand"?g:null),P("shape",A&&A!=="pill"?A:null),P("mode",d&&d!=="line"?d:null)},[o,t,l,i,s,b,n,r,a,m,u,y,p,g,A,d]),N.default.createElement("ui-progress",{ref:H,...w},c)});Ce.displayName="Progress";const et=N.default.forwardRef(function({target:o,headless:t,disabled:l,strategy:i,onMount:s,onUnmount:b,onSync:n,onTargetMissing:r,children:a,...m},u){const y=v.useRef(null);return N.default.useImperativeHandle(u,()=>y.current),v.useEffect(()=>{const p=y.current;if(!p)return;const g=e=>s==null?void 0:s(e.detail||{count:0}),A=e=>b==null?void 0:b(e.detail||{count:0}),d=e=>n==null?void 0:n(e.detail||{count:0}),E=e=>{const c=e.detail;c&&(r==null||r(c))};return p.addEventListener("mount",g),p.addEventListener("unmount",A),p.addEventListener("sync",d),p.addEventListener("target-missing",E),()=>{p.removeEventListener("mount",g),p.removeEventListener("unmount",A),p.removeEventListener("sync",d),p.removeEventListener("target-missing",E)}},[s,b,n,r]),v.useEffect(()=>{const p=y.current;p&&(o?p.setAttribute("target",o):p.removeAttribute("target"),i&&i!=="append"?p.setAttribute("strategy",i):p.removeAttribute("strategy"),t?p.setAttribute("headless",""):p.removeAttribute("headless"),l?p.setAttribute("disabled",""):p.removeAttribute("disabled"))},[o,i,t,l]),N.default.createElement("ui-portal",{ref:y,...m},a)});et.displayName="Portal";const tt=N.default.forwardRef(function({orientation:o,size:t,variant:l,tone:i,autoHide:s,shadows:b,onScrollChange:n,onReachStart:r,onReachEnd:a,children:m,...u},y){const p=v.useRef(null);return N.default.useImperativeHandle(y,()=>p.current),v.useEffect(()=>{const g=p.current;if(!g)return;const A=e=>{const c=e.detail;c&&(n==null||n(c))},d=()=>r==null?void 0:r(),E=()=>a==null?void 0:a();return g.addEventListener("scroll",A),g.addEventListener("reach-start",d),g.addEventListener("reach-end",E),()=>{g.removeEventListener("scroll",A),g.removeEventListener("reach-start",d),g.removeEventListener("reach-end",E)}},[n,r,a]),v.useEffect(()=>{const g=p.current;if(!g)return;const A=(E,e)=>{const c=g.getAttribute(E);if(e==null){c!=null&&g.removeAttribute(E);return}c!==e&&g.setAttribute(E,e)},d=(E,e)=>{const c=g.getAttribute(E);if(e==null){c!=null&&g.removeAttribute(E);return}const w=e?"true":"false";c!==w&&g.setAttribute(E,w)};A("orientation",o&&o!=="vertical"?o:null),A("size",t&&t!=="md"?t:null),A("variant",l&&l!=="default"?l:null),A("tone",i&&i!=="neutral"?i:null),d("auto-hide",s),d("shadows",b)},[o,t,l,i,s,b]),N.default.createElement("ui-scroll-area",{ref:p,...u},m)});tt.displayName="ScrollArea";const rt=N.forwardRef((h,o)=>N.createElement("ui-separator",{ref:o,...h}));rt.displayName="Separator";const it=N.default.forwardRef(function({children:o,name:t,fallback:l,required:i,inline:s,align:b,size:n,variant:r,tone:a,headless:m,onSlotChange:u,onMissing:y,onResolved:p,...g},A){const d=v.useRef(null);return v.useImperativeHandle(A,()=>d.current),v.useEffect(()=>{const E=d.current;if(!E)return;const e=L=>{const H=L.detail;H&&(u==null||u(H))},c=()=>y==null?void 0:y(),w=()=>p==null?void 0:p();return E.addEventListener("slotchange",e),E.addEventListener("missing",c),E.addEventListener("resolved",w),()=>{E.removeEventListener("slotchange",e),E.removeEventListener("missing",c),E.removeEventListener("resolved",w)}},[u,y,p]),v.useEffect(()=>{const E=d.current;if(!E)return;const e=(w,L)=>{const H=E.getAttribute(w);if(L==null){H!=null&&E.removeAttribute(w);return}H!==L&&E.setAttribute(w,L)},c=(w,L)=>{L?e(w,""):e(w,null)};e("name",t||null),e("fallback",l||null),c("required",i),typeof s=="boolean"?e("inline",s?"true":"false"):e("inline",null),e("align",b&&b!=="start"?b:null),e("size",n&&n!=="md"?n:null),e("variant",r&&r!=="plain"?r:null),e("tone",a&&a!=="brand"?a:null),c("headless",m)},[t,l,i,s,b,n,r,a,m]),N.default.createElement("ui-slot",{ref:d,...g},o)});it.displayName="Slot";const nt=N.default.forwardRef(function({children:o,orientation:t,variant:l,size:i,density:s,wrap:b,loop:n,headless:r,...a},m){const u=v.useRef(null);return v.useImperativeHandle(m,()=>u.current),v.useEffect(()=>{const y=u.current;if(!y)return;const p=(A,d)=>{const E=y.getAttribute(A);if(d==null){E!=null&&y.removeAttribute(A);return}E!==d&&y.setAttribute(A,d)},g=(A,d)=>{d?p(A,""):p(A,null)};p("orientation",t&&t!=="horizontal"?t:null),p("variant",l&&l!=="default"?l:null),p("size",i&&i!=="md"?i:null),p("density",s&&s!=="default"?s:null),g("wrap",b),typeof n=="boolean"?g("loop",n):p("loop",null),g("headless",r)},[t,l,i,s,b,n,r]),N.default.createElement("ui-toolbar",{ref:u,...a},o)});nt.displayName="Toolbar";const lt=N.forwardRef((h,o)=>N.createElement("ui-visually-hidden",{ref:o,...h}));lt.displayName="VisuallyHidden";function oe(h,o,t){if(t==null){h.removeAttribute(o);return}t?h.setAttribute(o,""):h.removeAttribute(o)}function fe(h){var o;return(o=h.detail)==null?void 0:o.open}const ut=N.forwardRef(function({header:o,open:t,headless:l,onToggle:i,onChangeOpen:s,children:b,...n},r){const a=N.useRef(null);N.useImperativeHandle(r,()=>a.current),N.useEffect(()=>{ee("ui-collapsible","Collapsible")},[]),N.useEffect(()=>{const u=a.current;u&&(oe(u,"open",t),oe(u,"headless",l))},[t,l]),N.useEffect(()=>{const u=a.current;if(!u||!i&&!s)return;const y=g=>{const A=fe(g);typeof A=="boolean"&&(i==null||i(A))},p=g=>{const A=fe(g);typeof A=="boolean"&&(s==null||s(A))};return u.addEventListener("toggle",y),u.addEventListener("change",p),()=>{u.removeEventListener("toggle",y),u.removeEventListener("change",p)}},[i,s]);let m=null;return o!=null&&(typeof o=="string"||typeof o=="number"?m=N.createElement("span",{slot:"header"},o):N.isValidElement(o)?m=N.cloneElement(o,{slot:"header"}):m=N.createElement("span",{slot:"header"},o)),N.createElement("ui-collapsible",{ref:a,...n},m,b)});ut.displayName="Collapsible";const st=N.forwardRef((h,o)=>N.createElement("ui-pagination",{ref:o,...h}));st.displayName="Pagination";function nr(h,o,t){if(t==null){h.removeAttribute(o);return}t?h.setAttribute(o,""):h.removeAttribute(o)}function ae(h){var o;return(o=h.detail)==null?void 0:o.open}const ct=N.forwardRef(function({multiple:o,collapsible:t,open:l,onToggle:i,onChangeOpen:s,children:b,...n},r){const a=N.useRef(null);return N.useImperativeHandle(r,()=>a.current),N.useEffect(()=>{ee("ui-accordion","Accordion")},[]),N.useEffect(()=>{const m=a.current;m&&(nr(m,"multiple",o),t==null?m.removeAttribute("collapsible"):m.setAttribute("collapsible",String(!!t)),l==null?m.removeAttribute("open"):m.setAttribute("open",Array.isArray(l)?JSON.stringify(l):String(l)))},[o,t,l]),N.useEffect(()=>{const m=a.current;if(!m||!i&&!s)return;const u=p=>{const g=ae(p);g!=null&&(i==null||i(g))},y=p=>{const g=ae(p);g!=null&&(s==null||s(g))};return m.addEventListener("toggle",u),m.addEventListener("change",y),()=>{m.removeEventListener("toggle",u),m.removeEventListener("change",y)}},[i,s]),N.createElement("ui-accordion",{ref:a,...n},b)});ct.displayName="Accordion";const ot=N.forwardRef(function({disabled:o,children:t,...l},i){const s={ref:i,"data-ui-accordion-item":"",...l};return o&&(s.disabled=!0),N.createElement("div",s,t)});ot.displayName="AccordionItem";const ft=N.forwardRef(function({type:o,children:t,...l},i){return N.createElement("button",{ref:i,type:o||"button","data-ui-accordion-trigger":"",...l},t)});ft.displayName="AccordionTrigger";const at=N.forwardRef(function({children:o,...t},l){return N.createElement("div",{ref:l,"data-ui-accordion-panel":"",...t},o)});at.displayName="AccordionPanel";const dt=N.forwardRef((h,o)=>N.createElement("ui-direction-provider",{ref:o,...h}));dt.displayName="DirectionProvider";const bt=N.default.forwardRef(function({children:o,open:t,delay:l,closeDelay:i,placement:s,offset:b,variant:n,tone:r,density:a,shape:m,elevation:u,headless:y,onOpen:p,onClose:g,onChange:A,...d},E){const e=v.useRef(null);return v.useImperativeHandle(E,()=>e.current),v.useEffect(()=>{const c=e.current;if(!c)return;const w=()=>p==null?void 0:p(),L=()=>g==null?void 0:g(),H=f=>{var R;const P=(R=f.detail)==null?void 0:R.open;typeof P=="boolean"&&(A==null||A(P))};return c.addEventListener("open",w),c.addEventListener("close",L),c.addEventListener("change",H),()=>{c.removeEventListener("open",w),c.removeEventListener("close",L),c.removeEventListener("change",H)}},[p,g,A]),v.useEffect(()=>{const c=e.current;!c||t==null||(t?c.setAttribute("open",""):c.removeAttribute("open"))},[t]),v.useEffect(()=>{const c=e.current;c&&(typeof l=="number"?c.setAttribute("delay",String(l)):c.removeAttribute("delay"),typeof i=="number"?c.setAttribute("close-delay",String(i)):c.removeAttribute("close-delay"),s?c.setAttribute("placement",s):c.removeAttribute("placement"),typeof b=="number"?c.setAttribute("offset",String(b)):c.removeAttribute("offset"),n&&n!=="default"?c.setAttribute("variant",n):c.removeAttribute("variant"),r&&r!=="default"?c.setAttribute("tone",r):c.removeAttribute("tone"),a&&a!=="default"?c.setAttribute("density",a):c.removeAttribute("density"),m&&m!=="default"?c.setAttribute("shape",m):c.removeAttribute("shape"),u&&u!=="default"?c.setAttribute("elevation",u):c.removeAttribute("elevation"),y?c.setAttribute("headless",""):c.removeAttribute("headless"))},[l,i,s,b,n,r,a,m,u,y]),N.default.createElement("ui-hover-card",{ref:e,...d},o)});bt.displayName="HoverCard";const mt=N.default.forwardRef(function({children:o,htmlFor:t,for:l,required:i,description:s,variant:b,tone:n,size:r,density:a,shape:m,disabled:u,headless:y,...p},g){const A=v.useRef(null);return v.useImperativeHandle(g,()=>A.current),v.useEffect(()=>{const d=A.current;if(!d)return;const E=t||l;E?d.setAttribute("for",E):d.removeAttribute("for"),i?d.setAttribute("required",""):d.removeAttribute("required"),s?d.setAttribute("description",s):d.removeAttribute("description"),b&&b!=="default"?d.setAttribute("variant",b):d.removeAttribute("variant"),n&&n!=="default"?d.setAttribute("tone",n):d.removeAttribute("tone"),r&&r!=="md"&&r!=="2"?d.setAttribute("size",r):d.removeAttribute("size"),a&&a!=="default"?d.setAttribute("density",a):d.removeAttribute("density"),m&&m!=="default"?d.setAttribute("shape",m):d.removeAttribute("shape"),u?d.setAttribute("disabled",""):d.removeAttribute("disabled"),y?d.setAttribute("headless",""):d.removeAttribute("headless")},[t,l,i,s,b,n,r,a,m,u,y]),N.default.createElement("ui-label",{ref:A,...p},o)});mt.displayName="Label";const lr=typeof window<"u"?N.default.useLayoutEffect:N.default.useEffect,vt=N.default.forwardRef(function({children:o,open:t,headless:l,dismissible:i,closeOnEsc:s,closeOnBackdrop:b,lockWhileLoading:n,roleType:r,size:a,state:m,initialFocus:u,dialogId:y,config:p,onOpen:g,onConfirm:A,onCancel:d,onDismiss:E,onClose:e,onChange:c,...w},L){const H=v.useRef(null);return N.default.useImperativeHandle(L,()=>H.current),v.useEffect(()=>{const f=H.current;if(!f)return;const P=k=>g==null?void 0:g(k.detail),R=k=>A==null?void 0:A(k.detail),S=k=>d==null?void 0:d(k.detail),T=k=>E==null?void 0:E(k.detail),q=k=>e==null?void 0:e(k.detail),x=k=>c==null?void 0:c(k.detail);return f.addEventListener("ui-open",P),f.addEventListener("ui-confirm",R),f.addEventListener("ui-cancel",S),f.addEventListener("ui-dismiss",T),f.addEventListener("ui-close",q),f.addEventListener("ui-change",x),()=>{f.removeEventListener("ui-open",P),f.removeEventListener("ui-confirm",R),f.removeEventListener("ui-cancel",S),f.removeEventListener("ui-dismiss",T),f.removeEventListener("ui-close",q),f.removeEventListener("ui-change",x)}},[g,A,d,E,e,c]),lr(()=>{const f=H.current;f&&(typeof t=="boolean"&&(t?f.setAttribute("open",""):f.removeAttribute("open")),l?f.setAttribute("headless",""):f.removeAttribute("headless"),typeof i=="boolean"?f.setAttribute("dismissible",String(i)):f.removeAttribute("dismissible"),typeof s=="boolean"?f.setAttribute("close-on-esc",String(s)):f.removeAttribute("close-on-esc"),typeof b=="boolean"?f.setAttribute("close-on-backdrop",String(b)):f.removeAttribute("close-on-backdrop"),typeof n=="boolean"?f.setAttribute("lock-while-loading",String(n)):f.removeAttribute("lock-while-loading"),r?f.setAttribute("role",r):f.removeAttribute("role"),a&&a!=="md"?f.setAttribute("size",a):f.removeAttribute("size"),m&&m!=="idle"?f.setAttribute("state",m):f.removeAttribute("state"),u?f.setAttribute("initial-focus",u):f.removeAttribute("initial-focus"),y&&(f.dialogId=y),p&&(f.config=p))},[t,l,i,s,b,n,r,a,m,u,y,p]),N.default.createElement("ui-alert-dialog",{ref:H,...w},o)});vt.displayName="AlertDialog";const At=v.createContext(null);function ur({children:h,hostId:o="ui-alert-dialog-react-host"}){const t=v.useRef(null);t.current||(t.current=V.createAlertDialogManager()),v.useEffect(()=>{var s;if(typeof document>"u")return;let i=document.getElementById(o);return i||(i=document.createElement("div"),i.id=o,i.setAttribute("data-ui-alert-dialog-react-host","true"),document.body.appendChild(i)),(s=t.current)==null||s.setContainer(i),()=>{var b;(b=t.current)==null||b.destroy("unmount"),t.current=null,i&&i.parentElement&&i.parentElement.removeChild(i)}},[o]);const l=v.useMemo(()=>({alert:(i={})=>{var s;return((s=t.current)==null?void 0:s.alert(i))??Promise.resolve({id:"",action:"dismiss"})},confirm:(i={})=>{var s;return((s=t.current)==null?void 0:s.confirm(i))??Promise.resolve({id:"",action:"dismiss"})},prompt:(i={})=>{var s;return((s=t.current)==null?void 0:s.prompt(i))??Promise.resolve({id:"",action:"dismiss",value:""})}}),[]);return N.default.createElement(At.Provider,{value:l},h)}function sr(){const h=v.useContext(At);if(!h)throw new Error("useAlertDialog must be used within <AlertDialogProvider>.");return h}const Et=N.default.forwardRef(function({children:o,value:t,disabled:l,required:i,invalid:s,headless:b,placeholder:n,name:r,label:a,description:m,error:u,size:y,variant:p,tone:g,density:A,radius:d,validation:E,onChange:e,onInput:c,onValueChange:w,...L},H){const f=v.useRef(null);return v.useImperativeHandle(H,()=>f.current),v.useEffect(()=>{const P=f.current;if(!P)return;const R=q=>{var x,k;return((x=q.detail)==null?void 0:x.value)??((k=q.target)==null?void 0:k.value)??""},S=q=>{c==null||c(R(q))},T=q=>{const x=R(q);e==null||e(x),w==null||w(x)};return P.addEventListener("input",S),P.addEventListener("change",T),()=>{P.removeEventListener("input",S),P.removeEventListener("change",T)}},[e,c,w]),v.useEffect(()=>{const P=f.current;if(!P)return;const R=(T,q)=>{const x=P.getAttribute(T);if(q==null){x!=null&&P.removeAttribute(T);return}x!==q&&P.setAttribute(T,q)},S=(T,q)=>{q?P.hasAttribute(T)||P.setAttribute(T,""):P.hasAttribute(T)&&P.removeAttribute(T)};R("value",t!=null?String(t):null),S("disabled",l),S("required",i),S("headless",b),S("invalid",s),R("placeholder",n||null),R("name",r||null),R("label",a||null),R("description",m||null),R("error",u||null),R("size",y&&y!=="md"&&y!=="2"?y:null),R("variant",p&&p!=="classic"?p:null),R("tone",g&&g!=="default"?g:null),R("density",A&&A!=="default"?A:null),R("radius",d?String(d):null),R("validation",E&&E!=="none"?E:null)},[t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E]),N.default.createElement("ui-select",{ref:f,...L},o)});Et.displayName="Select";const pt=N.default.forwardRef(function({children:o,value:t,valueStart:l,valueEnd:i,min:s,max:b,step:n,range:r,disabled:a,headless:m,orientation:u,size:y,variant:p,tone:g,showValue:A,format:d,label:E,description:e,marks:c,name:w,nameStart:L,nameEnd:H,onInput:f,onChange:P,onValueChange:R,...S},T){const q=v.useRef(null);return v.useImperativeHandle(T,()=>q.current),v.useEffect(()=>{const x=q.current;if(!x)return;const k=F=>{const D=F.detail;D&&(f==null||f(Number(D.value)),R==null||R(D))},K=F=>{const D=F.detail;D&&(P==null||P(Number(D.value)),R==null||R(D))};return x.addEventListener("input",k),x.addEventListener("change",K),()=>{x.removeEventListener("input",k),x.removeEventListener("change",K)}},[f,P,R]),v.useEffect(()=>{const x=q.current;if(!x)return;const k=(F,D)=>{const B=x.getAttribute(F);if(D==null){B!=null&&x.removeAttribute(F);return}B!==D&&x.setAttribute(F,D)},K=(F,D,B)=>{if(D==null){B!==void 0&&B===!1&&k(F,null);return}D?k(F,""):k(F,null)};if(k("value",typeof t=="number"&&Number.isFinite(t)?String(t):null),k("value-start",typeof l=="number"&&Number.isFinite(l)?String(l):null),k("value-end",typeof i=="number"&&Number.isFinite(i)?String(i):null),k("min",typeof s=="number"&&Number.isFinite(s)?String(s):null),k("max",typeof b=="number"&&Number.isFinite(b)?String(b):null),k("step",typeof n=="number"&&Number.isFinite(n)?String(n):null),K("range",r),K("disabled",a),K("headless",m),k("orientation",u&&u!=="horizontal"?u:null),k("size",y&&y!=="md"?y:null),k("variant",p&&p!=="default"?p:null),k("tone",g&&g!=="brand"?g:null),typeof A=="boolean"?k("show-value",A?"true":"false"):k("show-value",null),k("format",d||null),k("label",E||null),k("description",e||null),k("name",w||null),k("name-start",L||null),k("name-end",H||null),c&&c.length)try{k("marks",JSON.stringify(c))}catch{k("marks",null)}else k("marks",null)},[t,l,i,s,b,n,r,a,m,u,y,p,g,A,d,E,e,c,w,L,H]),N.default.createElement("ui-slider",{ref:q,...S},o)});pt.displayName="Slider";function cr(h){const{count:o,width:t,height:l,radius:i,gap:s,variant:b,animated:n,headless:r,...a}=h,m=v.useRef(null);return v.useEffect(()=>{const u=m.current;u&&(typeof o=="number"&&Number.isFinite(o)?u.setAttribute("count",String(o)):u.removeAttribute("count"),t?u.setAttribute("width",t):u.removeAttribute("width"),l?u.setAttribute("height",l):u.removeAttribute("height"),i?u.setAttribute("radius",i):u.removeAttribute("radius"),s?u.setAttribute("gap",s):u.removeAttribute("gap"),b?u.setAttribute("variant",b):u.removeAttribute("variant"),n?u.setAttribute("animated",""):u.removeAttribute("animated"),r?u.setAttribute("headless",""):u.removeAttribute("headless"))},[o,t,l,i,s,b,n,r]),N.default.createElement("ui-skeleton",{ref:m,...a})}exports.Accordion=ct;exports.AccordionItem=ot;exports.AccordionPanel=at;exports.AccordionTrigger=ft;exports.Alert=Nt;exports.AlertDialog=vt;exports.AlertDialogProvider=ur;exports.AppHeader=Me;exports.AspectRatio=We;exports.Avatar=Oe;exports.Badge=St;exports.BlockControls=$e;exports.Box=Zt;exports.Breadcrumb=_e;exports.Button=Ht;exports.Calendar=pe;exports.Chart=Ae;exports.Checkbox=Ue;exports.Collapsible=ut;exports.ColorPicker=ye;exports.Combobox=Pt;exports.CommandPalette=Qt;exports.Container=Ot;exports.ContextMenu=It;exports.DataTable=xt;exports.DatePicker=Le;exports.DateRangePicker=ge;exports.DateRangeTimePicker=Re;exports.DateTimePicker=we;exports.Dialog=Se;exports.DialogProvider=$t;exports.DirectionProvider=dt;exports.Drawer=Qe;exports.Dropdown=be;exports.EmptyState=Ft;exports.Field=kt;exports.Flex=zt;exports.FloatingToolbar=Mt;exports.Form=Je;exports.Gantt=He;exports.Grid=Wt;exports.HoverCard=bt;exports.Icon=Be;exports.Input=me;exports.Label=mt;exports.Layout=Ie;exports.Menu=De;exports.Menubar=Bt;exports.NavigationMenu=Dt;exports.Pagination=st;exports.PluginPanel=Ut;exports.Popover=Te;exports.Portal=et;exports.Presence=Ve;exports.Progress=Ce;exports.QuickActions=Pe;exports.RadioGroup=Xe;exports.ScrollArea=tt;exports.Section=je;exports.Select=Et;exports.SelectionPopup=Kt;exports.Separator=rt;exports.Sidebar=Ge;exports.Skeleton=cr;exports.Slider=pt;exports.Slot=it;exports.Stepper=Ne;exports.Switch=Ye;exports.Table=Tt;exports.Tabs=xe;exports.Textarea=ve;exports.ThemeProvider=Ct;exports.TimePicker=he;exports.Timeline=Ee;exports.Toast=qe;exports.ToastAPI=_t;exports.Toggle=Ze;exports.ToggleGroup=ze;exports.Toolbar=nt;exports.Tooltip=de;exports.VisuallyHidden=lt;exports.Wizard=ke;exports.toast=jt;exports.toastApi=Gt;exports.useAlertDialog=sr;exports.useDialog=Jt;exports.useFloating=Yt;exports.useForm=Xt;exports.useTheme=er;
package/package.json CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
2
  "name": "@editora/ui-react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "React wrappers and hooks for Web Components in the Editora UI ecosystem",
5
- "main": "dist/index.js",
5
+ "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "default": "./dist/index.esm.js"
14
+ }
15
+ },
8
16
  "files": [
9
17
  "dist"
10
18
  ],
@@ -26,7 +34,7 @@
26
34
  "react-dom": ">=16.8 <21"
27
35
  },
28
36
  "dependencies": {
29
- "@editora/ui-core": "^0.1.0"
37
+ "@editora/ui-core": "^0.1.2"
30
38
  },
31
39
  "keywords": [
32
40
  "editora",