@appforgeapps/uiforge 0.1.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/uiforge.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),ht=({variant:t="primary",size:r="medium",children:s,className:n="",...h})=>{const m="uiforge-button",u=`${m}--${t}`,f=`${m}--${r}`,k=`${m} ${u} ${f} ${n}`.trim();return e.jsx("button",{className:k,...h,children:s})},ut=({columns:t,data:r,selectable:s=!1,selectedRows:n,getRowKey:h=(ee,J)=>J,onSelectionChange:m,onCellEdit:u,actionButtons:f=[],searchable:k=!1,searchPlaceholder:O="Search...",onSearch:D,customFilter:W,pagination:d,onPageChange:L,onPageSizeChange:S,pageSizeOptions:F=[10,25,50,100],className:V="",loading:C=!1,emptyMessage:E="No data available"})=>{const[ee,J]=i.useState(new Set),[w,K]=i.useState(""),[M,P]=i.useState(null),[A,a]=i.useState(""),v=n??ee,x=i.useMemo(()=>!k||!w?r:r.filter(l=>W?W(l,w):Object.values(l).some(_=>_==null?!1:String(_).toLowerCase().includes(w.toLowerCase()))),[r,w,k,W]),j=i.useMemo(()=>{if(!d||d.serverSide)return x;const l=d.currentPage*d.pageSize,_=l+d.pageSize;return x.slice(l,_)},[x,d]),q=i.useMemo(()=>d?d.serverSide&&d.totalItems!==void 0?Math.ceil(d.totalItems/d.pageSize):Math.ceil(x.length/d.pageSize):1,[d,x.length]),R=i.useCallback(()=>r.filter((l,_)=>{const y=h(l,_);return v.has(y)}),[r,v,h]),te=i.useCallback(l=>{const _=new Set;l&&j.forEach(y=>{const I=r.indexOf(y),re=h(y,I);_.add(re)}),n===void 0&&J(_),m?.(_,l?j:[])},[j,r,h,m,n]),Q=i.useCallback((l,_,y)=>{const I=new Set(v);y?I.add(l):I.delete(l),n===void 0&&J(I);const re=r.filter((N,ie)=>{const ce=h(N,ie);return I.has(ce)});m?.(I,re)},[v,r,h,m,n]),G=i.useCallback(l=>{K(l),D?.(l)},[D]),se=i.useCallback((l,_,y)=>{P({rowKey:l,columnKey:_}),a(y)},[]),X=i.useCallback((l,_,y)=>{u?.(l,_,A,y),P(null),a("")},[A,u]),c=i.useCallback(()=>{P(null),a("")},[]),H=i.useCallback(l=>{d&&L?.(l,d.pageSize)},[d,L]),b=i.useCallback(l=>{S?.(l),d&&L?.(0,l)},[S,L,d]),$=i.useMemo(()=>j.length===0?!1:j.every(l=>{const _=r.indexOf(l),y=h(l,_);return v.has(y)}),[j,v,r,h]),z=i.useMemo(()=>j.length===0?!1:j.some(_=>{const y=r.indexOf(_),I=h(_,y);return v.has(I)})&&!$,[j,v,$,r,h]),g="uiforge-grid";return e.jsxs("div",{className:`${g} ${V}`.trim(),children:[(k||f.length>0)&&e.jsxs("div",{className:`${g}__toolbar`,children:[k&&e.jsx("div",{className:`${g}__search`,children:e.jsx("input",{type:"text",className:`${g}__search-input`,placeholder:O,value:w,onChange:l=>G(l.target.value),"aria-label":"Search"})}),f.length>0&&e.jsx("div",{className:`${g}__actions`,children:f.map((l,_)=>{const y=l.disabled||l.requiresSelection&&v.size===0;return e.jsx("button",{className:`${g}__action-button ${g}__action-button--${l.variant||"primary"}`,onClick:()=>l.onClick(R()),disabled:y,children:l.label},_)})})]}),e.jsx("div",{className:`${g}__table-container`,children:e.jsxs("table",{className:`${g}__table`,role:"table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[s&&e.jsx("th",{className:`${g}__header-cell ${g}__header-cell--checkbox`,children:e.jsx("input",{type:"checkbox",checked:$,ref:l=>{l&&(l.indeterminate=z)},onChange:l=>te(l.target.checked),"aria-label":"Select all rows"})}),t.map(l=>e.jsx("th",{className:`${g}__header-cell`,style:{width:l.width},children:l.header},l.key))]})}),e.jsx("tbody",{children:C?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length+(s?1:0),className:`${g}__loading-cell`,children:"Loading..."})}):j.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length+(s?1:0),className:`${g}__empty-cell`,children:E})}):j.map((l,_)=>{const y=r.indexOf(l),I=h(l,y),re=v.has(I);return e.jsxs("tr",{className:`${g}__row ${re?`${g}__row--selected`:""}`,children:[s&&e.jsx("td",{className:`${g}__cell ${g}__cell--checkbox`,children:e.jsx("input",{type:"checkbox",checked:re,onChange:N=>Q(I,l,N.target.checked),"aria-label":`Select row ${_+1}`})}),t.map(N=>{const ie=N.field?l[N.field]:void 0,ce=M?.rowKey===I&&M?.columnKey===N.key;return e.jsx("td",{className:`${g}__cell`,children:ce?e.jsxs("div",{className:`${g}__edit-cell`,children:[e.jsx("input",{type:"text",className:`${g}__edit-input`,value:String(A??""),onChange:ne=>a(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"?X(I,N.key,l):ne.key==="Escape"&&c()},autoFocus:!0,"aria-label":`Edit ${N.header}`}),e.jsx("button",{className:`${g}__edit-button ${g}__edit-button--save`,onClick:()=>X(I,N.key,l),"aria-label":"Save",children:"✓"}),e.jsx("button",{className:`${g}__edit-button ${g}__edit-button--cancel`,onClick:c,"aria-label":"Cancel",children:"✕"})]}):e.jsx("div",{className:`${g}__cell-content ${N.editable?`${g}__cell-content--editable`:""}`,onClick:()=>{N.editable&&se(I,N.key,ie)},onKeyDown:ne=>{N.editable&&(ne.key==="Enter"||ne.key===" ")&&se(I,N.key,ie)},tabIndex:N.editable?0:void 0,role:N.editable?"button":void 0,"aria-label":N.editable?`Edit ${N.header}`:void 0,children:N.render?N.render(ie,l,y):String(ie??"")})},N.key)})]},I)})})]})}),d&&q>1&&e.jsxs("div",{className:`${g}__pagination`,children:[e.jsx("div",{className:`${g}__pagination-info`,children:d.serverSide&&d.totalItems!==void 0?e.jsxs(e.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,d.totalItems)," ","of ",d.totalItems," items"]}):e.jsxs(e.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,x.length)," ","of ",x.length," items"]})}),e.jsxs("div",{className:`${g}__pagination-controls`,children:[e.jsx("button",{className:`${g}__pagination-button`,onClick:()=>H(d.currentPage-1),disabled:d.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:q},(l,_)=>_).map(l=>l===0||l===q-1||Math.abs(l-d.currentPage)<=1?e.jsx("button",{className:`${g}__pagination-button ${l===d.currentPage?`${g}__pagination-button--active`:""}`,onClick:()=>H(l),"aria-label":`Page ${l+1}`,"aria-current":l===d.currentPage?"page":void 0,children:l+1},l):l===d.currentPage-2||l===d.currentPage+2?e.jsx("span",{className:`${g}__pagination-ellipsis`,children:"..."},l):null),e.jsx("button",{className:`${g}__pagination-button`,onClick:()=>H(d.currentPage+1),disabled:d.currentPage>=q-1,"aria-label":"Next page",children:"›"})]}),e.jsxs("div",{className:`${g}__page-size`,children:[e.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),e.jsx("select",{id:"page-size-select",className:`${g}__page-size-select`,value:d.pageSize,onChange:l=>b(Number(l.target.value)),children:F.map(l=>e.jsx("option",{value:l,children:l},l))})]})]})]})},ft=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,de=(t="paragraph")=>({id:ft(),type:t,content:"",format:{}}),xt=({initialBlocks:t=[],onChange:r,placeholder:s="Start typing...",readOnly:n=!1,className:h="",maxHeight:m})=>{const[u,f]=i.useState(t.length>0?t:[de()]),[k,O]=i.useState(null),[D,W]=i.useState(null),[d,L]=i.useState(!1),S=i.useRef(null);i.useEffect(()=>{r&&r(u)},[u,r]);const F=i.useCallback((a,v)=>{f(x=>x.map(j=>j.id===a?{...j,...v}:j))},[]),V=i.useCallback((a="paragraph",v)=>{const x=de(a);f(j=>{if(!v)return[...j,x];const q=j.findIndex(te=>te.id===v),R=[...j];return R.splice(q+1,0,x),R}),O(x.id)},[]),C=i.useCallback(a=>{f(v=>{const x=v.filter(j=>j.id!==a);return x.length>0?x:[de()]})},[]),E=i.useCallback((a,v)=>{f(x=>{const j=x.findIndex(Q=>Q.id===a),q=x.findIndex(Q=>Q.id===v);if(j===-1||q===-1)return x;const R=[...x],[te]=R.splice(j,1);return R.splice(q,0,te),R})},[]),ee=i.useCallback((a,v)=>{n||(W(v),a.dataTransfer.effectAllowed="move")},[n]),J=i.useCallback(a=>{a.preventDefault(),a.dataTransfer.dropEffect="move"},[]),w=i.useCallback((a,v)=>{a.preventDefault(),D&&D!==v&&E(D,v),W(null)},[D,E]),K=i.useCallback(()=>{W(null)},[]),M=i.useCallback(a=>{k&&f(v=>v.map(x=>{if(x.id===k){const j=x.format||{};return{...x,format:{...j,[a]:!j[a]}}}return x}))},[k]),P=i.useCallback((a,v)=>{F(a,{type:v})},[F]),A=i.useCallback((a,v)=>{if(!n){if((a.metaKey||a.ctrlKey)&&a.key==="b")a.preventDefault(),M("bold");else if((a.metaKey||a.ctrlKey)&&a.key==="i")a.preventDefault(),M("italic");else if((a.metaKey||a.ctrlKey)&&a.key==="u")a.preventDefault(),M("underline");else if(a.key==="Enter"&&!a.shiftKey){const x=u.find(j=>j.id===v);x&&x.type!=="code"&&(a.preventDefault(),V("paragraph",v))}else if(a.key==="Backspace"){const x=u.find(j=>j.id===v);x&&!x.content&&u.length>1&&(a.preventDefault(),C(v))}}},[n,u,M,V,C]);return e.jsxs("div",{className:`uiforge-blocks-editor ${h}`,ref:S,style:{maxHeight:m},children:[!n&&d&&k&&e.jsx(gt,{selectedBlock:u.find(a=>a.id===k),onFormatToggle:M,onBlockTypeChange:a=>P(k,a)}),e.jsx("div",{className:"uiforge-blocks-editor__content",children:u.map((a,v)=>e.jsx(mt,{block:a,isSelected:k===a.id,isDragging:D===a.id,readOnly:n,placeholder:v===0&&u.length===1?s:void 0,onSelect:()=>{O(a.id),L(!0)},onChange:x=>F(a.id,x),onDelete:()=>C(a.id),onDragStart:x=>ee(x,a.id),onDragOver:J,onDrop:x=>w(x,a.id),onDragEnd:K,onKeyDown:x=>A(x,a.id)},a.id))}),!n&&e.jsx(vt,{onAddBlock:V})]})},gt=({selectedBlock:t,onFormatToggle:r,onBlockTypeChange:s})=>{if(!t)return null;const n=t.format||{};return e.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[e.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:e.jsxs("select",{value:t.type,onChange:h=>s(h.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[e.jsx("option",{value:"paragraph",children:"Paragraph"}),e.jsx("option",{value:"heading1",children:"Heading 1"}),e.jsx("option",{value:"heading2",children:"Heading 2"}),e.jsx("option",{value:"heading3",children:"Heading 3"}),e.jsx("option",{value:"list",children:"List"}),e.jsx("option",{value:"quote",children:"Quote"}),e.jsx("option",{value:"code",children:"Code"}),e.jsx("option",{value:"image",children:"Image"})]})}),e.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),e.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[e.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>r("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:e.jsx("strong",{children:"B"})}),e.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>r("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:e.jsx("em",{children:"I"})}),e.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>r("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:e.jsx("u",{children:"U"})}),e.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>r("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},mt=({block:t,isSelected:r,isDragging:s,readOnly:n,placeholder:h,onSelect:m,onChange:u,onDelete:f,onDragStart:k,onDragOver:O,onDrop:D,onDragEnd:W,onKeyDown:d})=>{const L=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,r?"uiforge-blocks-editor__block--selected":"",s?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),S=["uiforge-blocks-editor__block-text",t.format?.bold?"uiforge-blocks-editor__block-text--bold":"",t.format?.italic?"uiforge-blocks-editor__block-text--italic":"",t.format?.underline?"uiforge-blocks-editor__block-text--underline":"",t.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),F=C=>{u({content:C.target.value})},V=()=>{const C={value:t.content,onChange:F,onFocus:m,onKeyDown:d,placeholder:h,readOnly:n,className:S};switch(t.type){case"heading1":return e.jsx("input",{...C,type:"text",className:`${S} uiforge-blocks-editor__heading1`,placeholder:h||"Heading 1"});case"heading2":return e.jsx("input",{...C,type:"text",className:`${S} uiforge-blocks-editor__heading2`,placeholder:h||"Heading 2"});case"heading3":return e.jsx("input",{...C,type:"text",className:`${S} uiforge-blocks-editor__heading3`,placeholder:h||"Heading 3"});case"code":return e.jsx("textarea",{...C,className:`${S} uiforge-blocks-editor__code`,placeholder:h||"Code block",rows:4});case"quote":return e.jsx("textarea",{...C,className:`${S} uiforge-blocks-editor__quote`,placeholder:h||"Quote",rows:2});case"image":return e.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[e.jsx("input",{type:"text",value:t.imageUrl||"",onChange:E=>u({imageUrl:E.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),e.jsx("input",{type:"text",value:t.imageAlt||"",onChange:E=>u({imageAlt:E.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&e.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return e.jsx("textarea",{...C,className:`${S} uiforge-blocks-editor__paragraph`,placeholder:h||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return e.jsxs("div",{className:L,draggable:!n,onDragStart:k,onDragOver:O,onDrop:D,onDragEnd:W,"data-block-id":t.id,children:[!n&&e.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[e.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),e.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:f,title:"Delete block","aria-label":"Delete block",children:"×"})]}),e.jsx("div",{className:"uiforge-blocks-editor__block-content",children:V()})]})},vt=({onAddBlock:t})=>{const[r,s]=i.useState(!1),n=[{type:"paragraph",label:"Paragraph",icon:"¶"},{type:"heading1",label:"Heading 1",icon:"H1"},{type:"heading2",label:"Heading 2",icon:"H2"},{type:"heading3",label:"Heading 3",icon:"H3"},{type:"list",label:"List",icon:"≡"},{type:"quote",label:"Quote",icon:'"'},{type:"code",label:"Code",icon:"</>"},{type:"image",label:"Image",icon:"🖼"}];return e.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[e.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>s(!r),"aria-label":"Add block","aria-expanded":r,children:"+ Add Block"}),r&&e.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:h,label:m,icon:u})=>e.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(h),s(!1)},children:[e.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:u}),e.jsx("span",{children:m})]},h))})]})};function he(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function pt(t){const r=t.trim(),s=["javascript:","data:","vbscript:","file:"],n=r.toLowerCase();for(const h of s)if(n.startsWith(h))return"";return r}function jt(t){return t.map(r=>{let s=he(r.content);switch(r.format?.bold&&(s=`<strong>${s}</strong>`),r.format?.italic&&(s=`<em>${s}</em>`),r.format?.underline&&(s=`<u>${s}</u>`),r.format?.code&&(s=`<code>${s}</code>`),r.type){case"heading1":return`<h1>${s}</h1>`;case"heading2":return`<h2>${s}</h2>`;case"heading3":return`<h3>${s}</h3>`;case"quote":return`<blockquote>${s}</blockquote>`;case"code":return`<pre><code>${he(r.content)}</code></pre>`;case"image":{const n=pt(r.imageUrl||""),h=he(r.imageAlt||"");return n?`<img src="${n}" alt="${h}" />`:""}case"list":return`<ul><li>${s}</li></ul>`;default:return`<p>${s}</p>`}}).join(`
2
- `)}function bt(t){return t.map(r=>{let s=r.content;switch(r.format?.bold&&(s=`**${s}**`),r.format?.italic&&(s=`*${s}*`),r.format?.code&&(s=`\`${s}\``),r.type){case"heading1":return`# ${s}`;case"heading2":return`## ${s}`;case"heading3":return`### ${s}`;case"quote":return`> ${s}`;case"code":return`\`\`\`
3
- ${r.content}
4
- \`\`\``;case"image":return`![${r.imageAlt||""}](${r.imageUrl||""})`;case"list":return`- ${s}`;default:return s}}).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),Ut=({variant:t="primary",size:e="medium",theme:r="light",density:n="default",children:a,className:f="",...l})=>{const c="uiforge-button",j=`${c}--${t}`,k=`${c}--${e}`,$=`${c}--${r}`,E=n==="condensed"?`${c}--condensed`:"",A=[c,j,k,$,E,f].filter(Boolean).join(" ");return s.jsx("button",{className:A,"data-theme":r,...l,children:a})},Ot=({isOpen:t,controlsId:e,ariaLabel:r="Toggle menu",className:n="",size:a="medium",...f})=>{const l="uiforge-hamburger-button",c=[l,`${l}--${a}`,t&&`${l}--open`,n].filter(Boolean).join(" ");return s.jsxs("button",{type:"button",className:c,"aria-expanded":t,"aria-controls":e,"aria-label":r,...f,children:[s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"}),s.jsx("span",{className:`${l}__bar`,"aria-hidden":"true"})]})},zt=({columns:t,data:e,theme:r="light",selectable:n=!1,selectedRows:a,getRowKey:f=(U,C)=>C,onSelectionChange:l,onCellEdit:c,actionButtons:j=[],searchable:k=!1,searchPlaceholder:$="Search...",onSearch:E,customFilter:A,pagination:d,onPageChange:w,onPageSizeChange:i,pageSizeOptions:u=[10,25,50,100],className:h="",loading:x=!1,emptyMessage:S="No data available"})=>{const[U,C]=o.useState(new Set),[y,M]=o.useState(""),[L,O]=o.useState(null),[R,W]=o.useState(""),v=a??U,N=o.useMemo(()=>!k||!y?e:e.filter(p=>A?A(p,y):Object.values(p).some(V=>V==null?!1:String(V).toLowerCase().includes(y.toLowerCase()))),[e,y,k,A]),_=o.useMemo(()=>{if(!d||d.serverSide)return N;const p=d.currentPage*d.pageSize,V=p+d.pageSize;return N.slice(p,V)},[N,d]),b=o.useMemo(()=>d?d.serverSide&&d.totalItems!==void 0?Math.ceil(d.totalItems/d.pageSize):Math.ceil(N.length/d.pageSize):1,[d,N.length]),re=o.useCallback(()=>e.filter((p,V)=>{const H=f(p,V);return v.has(H)}),[e,v,f]),Y=o.useCallback(p=>{const V=new Set;p&&_.forEach(H=>{const K=e.indexOf(H),ae=f(H,K);V.add(ae)}),a===void 0&&C(V),l?.(V,p?_:[])},[_,e,f,l,a]),te=o.useCallback((p,V,H)=>{const K=new Set(v);H?K.add(p):K.delete(p),a===void 0&&C(K);const ae=e.filter((q,de)=>{const he=f(q,de);return K.has(he)});l?.(K,ae)},[v,e,f,l,a]),X=o.useCallback(p=>{M(p),E?.(p)},[E]),ne=o.useCallback((p,V,H)=>{O({rowKey:p,columnKey:V}),W(H)},[]),se=o.useCallback((p,V,H)=>{c?.(p,V,R,H),O(null),W("")},[R,c]),T=o.useCallback(()=>{O(null),W("")},[]),oe=o.useCallback(p=>{d&&w?.(p,d.pageSize)},[d,w]),Z=o.useCallback(p=>{i?.(p),d&&w?.(0,p)},[i,w,d]),ee=o.useMemo(()=>_.length===0?!1:_.every(p=>{const V=e.indexOf(p),H=f(p,V);return v.has(H)}),[_,v,e,f]),le=o.useMemo(()=>_.length===0?!1:_.some(V=>{const H=e.indexOf(V),K=f(V,H);return v.has(K)})&&!ee,[_,v,ee,e,f]),I="uiforge-grid",F=`${I}--${r}`;return s.jsxs("div",{className:`${I} ${F} ${h}`.trim(),"data-theme":r,children:[(k||j.length>0)&&s.jsxs("div",{className:`${I}__toolbar`,children:[k&&s.jsx("div",{className:`${I}__search`,children:s.jsx("input",{type:"text",className:`${I}__search-input`,placeholder:$,value:y,onChange:p=>X(p.target.value),"aria-label":"Search"})}),j.length>0&&s.jsx("div",{className:`${I}__actions`,children:j.map((p,V)=>{const H=p.disabled||p.requiresSelection&&v.size===0;return s.jsx("button",{className:`${I}__action-button ${I}__action-button--${p.variant||"primary"}`,onClick:()=>p.onClick(re()),disabled:H,children:p.label},V)})})]}),s.jsx("div",{className:`${I}__table-container`,children:s.jsxs("table",{className:`${I}__table`,role:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[n&&s.jsx("th",{className:`${I}__header-cell ${I}__header-cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ee,ref:p=>{p&&(p.indeterminate=le)},onChange:p=>Y(p.target.checked),"aria-label":"Select all rows"})}),t.map(p=>s.jsx("th",{className:`${I}__header-cell`,style:{width:p.width},children:p.header},p.key))]})}),s.jsx("tbody",{children:x?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${I}__loading-cell`,children:"Loading..."})}):_.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length+(n?1:0),className:`${I}__empty-cell`,children:S})}):_.map((p,V)=>{const H=e.indexOf(p),K=f(p,H),ae=v.has(K);return s.jsxs("tr",{className:`${I}__row ${ae?`${I}__row--selected`:""}`,children:[n&&s.jsx("td",{className:`${I}__cell ${I}__cell--checkbox`,children:s.jsx("input",{type:"checkbox",checked:ae,onChange:q=>te(K,p,q.target.checked),"aria-label":`Select row ${V+1}`})}),t.map(q=>{const de=q.field?p[q.field]:void 0,he=L?.rowKey===K&&L?.columnKey===q.key;return s.jsx("td",{className:`${I}__cell`,children:he?s.jsxs("div",{className:`${I}__edit-cell`,children:[s.jsx("input",{type:"text",className:`${I}__edit-input`,value:String(R??""),onChange:ie=>W(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?se(K,q.key,p):ie.key==="Escape"&&T()},autoFocus:!0,"aria-label":`Edit ${q.header}`}),s.jsx("button",{className:`${I}__edit-button ${I}__edit-button--save`,onClick:()=>se(K,q.key,p),"aria-label":"Save",children:"✓"}),s.jsx("button",{className:`${I}__edit-button ${I}__edit-button--cancel`,onClick:T,"aria-label":"Cancel",children:"✕"})]}):s.jsx("div",{className:`${I}__cell-content ${q.editable?`${I}__cell-content--editable`:""}`,onClick:()=>{q.editable&&ne(K,q.key,de)},onKeyDown:ie=>{q.editable&&(ie.key==="Enter"||ie.key===" ")&&ne(K,q.key,de)},tabIndex:q.editable?0:void 0,role:q.editable?"button":void 0,"aria-label":q.editable?`Edit ${q.header}`:void 0,children:q.render?q.render(de,p,H):String(de??"")})},q.key)})]},K)})})]})}),d&&b>1&&s.jsxs("div",{className:`${I}__pagination`,children:[s.jsx("div",{className:`${I}__pagination-info`,children:d.serverSide&&d.totalItems!==void 0?s.jsxs(s.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,d.totalItems)," ","of ",d.totalItems," items"]}):s.jsxs(s.Fragment,{children:["Showing ",d.currentPage*d.pageSize+1," to"," ",Math.min((d.currentPage+1)*d.pageSize,N.length)," ","of ",N.length," items"]})}),s.jsxs("div",{className:`${I}__pagination-controls`,children:[s.jsx("button",{className:`${I}__pagination-button`,onClick:()=>oe(d.currentPage-1),disabled:d.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:b},(p,V)=>V).map(p=>p===0||p===b-1||Math.abs(p-d.currentPage)<=1?s.jsx("button",{className:`${I}__pagination-button ${p===d.currentPage?`${I}__pagination-button--active`:""}`,onClick:()=>oe(p),"aria-label":`Page ${p+1}`,"aria-current":p===d.currentPage?"page":void 0,children:p+1},p):p===d.currentPage-2||p===d.currentPage+2?s.jsx("span",{className:`${I}__pagination-ellipsis`,children:"..."},p):null),s.jsx("button",{className:`${I}__pagination-button`,onClick:()=>oe(d.currentPage+1),disabled:d.currentPage>=b-1,"aria-label":"Next page",children:"›"})]}),s.jsxs("div",{className:`${I}__page-size`,children:[s.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),s.jsx("select",{id:"page-size-select",className:`${I}__page-size-select`,value:d.pageSize,onChange:p=>Z(Number(p.target.value)),children:u.map(p=>s.jsx("option",{value:p,children:p},p))})]})]})]})},Rt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,_e=(t="paragraph")=>({id:Rt(),type:t,content:"",format:{}}),Vt=({initialBlocks:t=[],onChange:e,placeholder:r="Start typing...",readOnly:n=!1,theme:a="light",className:f="",maxHeight:l})=>{const[c,j]=o.useState(t.length>0?t:[_e()]),[k,$]=o.useState(null),[E,A]=o.useState(null),[d,w]=o.useState(!1),i=o.useRef(null);o.useEffect(()=>{e&&e(c)},[c,e]);const u=o.useCallback((v,N)=>{j(_=>_.map(b=>b.id===v?{...b,...N}:b))},[]),h=o.useCallback((v="paragraph",N)=>{const _=_e(v);j(b=>{if(!N)return[...b,_];const re=b.findIndex(te=>te.id===N),Y=[...b];return Y.splice(re+1,0,_),Y}),$(_.id)},[]),x=o.useCallback(v=>{j(N=>{const _=N.filter(b=>b.id!==v);return _.length>0?_:[_e()]})},[]),S=o.useCallback((v,N)=>{j(_=>{const b=_.findIndex(X=>X.id===v),re=_.findIndex(X=>X.id===N);if(b===-1||re===-1)return _;const Y=[..._],[te]=Y.splice(b,1);return Y.splice(re,0,te),Y})},[]),U=o.useCallback((v,N)=>{n||(A(N),v.dataTransfer.effectAllowed="move")},[n]),C=o.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),y=o.useCallback((v,N)=>{v.preventDefault(),E&&E!==N&&S(E,N),A(null)},[E,S]),M=o.useCallback(()=>{A(null)},[]),L=o.useCallback(v=>{k&&j(N=>N.map(_=>{if(_.id===k){const b=_.format||{};return{..._,format:{...b,[v]:!b[v]}}}return _}))},[k]),O=o.useCallback((v,N)=>{u(v,{type:N})},[u]),R=o.useCallback((v,N)=>{if(!n){if((v.metaKey||v.ctrlKey)&&v.key==="b")v.preventDefault(),L("bold");else if((v.metaKey||v.ctrlKey)&&v.key==="i")v.preventDefault(),L("italic");else if((v.metaKey||v.ctrlKey)&&v.key==="u")v.preventDefault(),L("underline");else if(v.key==="Enter"&&!v.shiftKey){const _=c.find(b=>b.id===N);_&&_.type!=="code"&&(v.preventDefault(),h("paragraph",N))}else if(v.key==="Backspace"){const _=c.find(b=>b.id===N);_&&!_.content&&c.length>1&&(v.preventDefault(),x(N))}}},[n,c,L,h,x]),W=`uiforge-blocks-editor--${a}`;return s.jsxs("div",{className:`uiforge-blocks-editor ${W} ${f}`,ref:i,style:{maxHeight:l},"data-theme":a,children:[!n&&d&&k&&s.jsx(Tt,{selectedBlock:c.find(v=>v.id===k),onFormatToggle:L,onBlockTypeChange:v=>O(k,v)}),s.jsx("div",{className:"uiforge-blocks-editor__content",children:c.map((v,N)=>s.jsx(Bt,{block:v,isSelected:k===v.id,isDragging:E===v.id,readOnly:n,placeholder:N===0&&c.length===1?r:void 0,onSelect:()=>{$(v.id),w(!0)},onChange:_=>u(v.id,_),onDelete:()=>x(v.id),onDragStart:_=>U(_,v.id),onDragOver:C,onDrop:_=>y(_,v.id),onDragEnd:M,onKeyDown:_=>R(_,v.id)},v.id))}),!n&&s.jsx(Ht,{onAddBlock:h})]})},Tt=({selectedBlock:t,onFormatToggle:e,onBlockTypeChange:r})=>{if(!t)return null;const n=t.format||{};return s.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[s.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:s.jsxs("select",{value:t.type,onChange:a=>r(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[s.jsx("option",{value:"paragraph",children:"Paragraph"}),s.jsx("option",{value:"heading1",children:"Heading 1"}),s.jsx("option",{value:"heading2",children:"Heading 2"}),s.jsx("option",{value:"heading3",children:"Heading 3"}),s.jsx("option",{value:"list",children:"List"}),s.jsx("option",{value:"quote",children:"Quote"}),s.jsx("option",{value:"code",children:"Code"}),s.jsx("option",{value:"image",children:"Image"})]})}),s.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),s.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>e("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:s.jsx("strong",{children:"B"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>e("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:s.jsx("em",{children:"I"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>e("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:s.jsx("u",{children:"U"})}),s.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>e("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},Bt=({block:t,isSelected:e,isDragging:r,readOnly:n,placeholder:a,onSelect:f,onChange:l,onDelete:c,onDragStart:j,onDragOver:k,onDrop:$,onDragEnd:E,onKeyDown:A})=>{const d=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${t.type}`,e?"uiforge-blocks-editor__block--selected":"",r?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),w=["uiforge-blocks-editor__block-text",t.format?.bold?"uiforge-blocks-editor__block-text--bold":"",t.format?.italic?"uiforge-blocks-editor__block-text--italic":"",t.format?.underline?"uiforge-blocks-editor__block-text--underline":"",t.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),i=h=>{l({content:h.target.value})},u=()=>{const h={value:t.content,onChange:i,onFocus:f,onKeyDown:A,placeholder:a,readOnly:n,className:w};switch(t.type){case"heading1":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return s.jsx("input",{...h,type:"text",className:`${w} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return s.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[s.jsx("input",{type:"text",value:t.imageUrl||"",onChange:x=>l({imageUrl:x.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),s.jsx("input",{type:"text",value:t.imageAlt||"",onChange:x=>l({imageAlt:x.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),t.imageUrl&&s.jsx("img",{src:t.imageUrl,alt:t.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return s.jsx("textarea",{...h,className:`${w} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return s.jsxs("div",{className:d,draggable:!n,onDragStart:j,onDragOver:k,onDrop:$,onDragEnd:E,"data-block-id":t.id,children:[!n&&s.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),s.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:c,title:"Delete block","aria-label":"Delete block",children:"×"})]}),s.jsx("div",{className:"uiforge-blocks-editor__block-content",children:u()})]})},Ht=({onAddBlock:t})=>{const[e,r]=o.useState(!1),n=[{type:"paragraph",label:"Paragraph",icon:"¶"},{type:"heading1",label:"Heading 1",icon:"H1"},{type:"heading2",label:"Heading 2",icon:"H2"},{type:"heading3",label:"Heading 3",icon:"H3"},{type:"list",label:"List",icon:"≡"},{type:"quote",label:"Quote",icon:'"'},{type:"code",label:"Code",icon:"</>"},{type:"image",label:"Image",icon:"🖼"}];return s.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[s.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>r(!e),"aria-label":"Add block","aria-expanded":e,children:"+ Add Block"}),e&&s.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:f,icon:l})=>s.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{t(a),r(!1)},children:[s.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:l}),s.jsx("span",{children:f})]},a))})]})};function Ie(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Wt(t){const e=t.trim(),r=["javascript:","data:","vbscript:","file:"],n=e.toLowerCase();for(const a of r)if(n.startsWith(a))return"";return e}function Ft(t){return t.map(e=>{let r=Ie(e.content);switch(e.format?.bold&&(r=`<strong>${r}</strong>`),e.format?.italic&&(r=`<em>${r}</em>`),e.format?.underline&&(r=`<u>${r}</u>`),e.format?.code&&(r=`<code>${r}</code>`),e.type){case"heading1":return`<h1>${r}</h1>`;case"heading2":return`<h2>${r}</h2>`;case"heading3":return`<h3>${r}</h3>`;case"quote":return`<blockquote>${r}</blockquote>`;case"code":return`<pre><code>${Ie(e.content)}</code></pre>`;case"image":{const n=Wt(e.imageUrl||""),a=Ie(e.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${r}</li></ul>`;default:return`<p>${r}</p>`}}).join(`
2
+ `)}function qt(t){return t.map(e=>{let r=e.content;switch(e.format?.bold&&(r=`**${r}**`),e.format?.italic&&(r=`*${r}*`),e.format?.code&&(r=`\`${r}\``),e.type){case"heading1":return`# ${r}`;case"heading2":return`## ${r}`;case"heading3":return`### ${r}`;case"quote":return`> ${r}`;case"code":return`\`\`\`
3
+ ${e.content}
4
+ \`\`\``;case"image":return`![${e.imageAlt||""}](${e.imageUrl||""})`;case"list":return`- ${r}`;default:return r}}).join(`
5
5
 
6
- `)}function yt(t){return JSON.stringify(t,null,2)}const _t=({options:t=[],value:r,onChange:s,onSearch:n,placeholder:h="Select an option...",disabled:m=!1,clearable:u=!1,className:f="",renderOption:k,renderValue:O,loading:D=!1,maxHeight:W="300px",debounceMs:d=300,searchable:L=!0,noOptionsMessage:S="No options found",ariaLabel:F,enableCache:V=!1,cacheTTL:C,refreshOnOpen:E=!1,onClearCache:ee,onForceRefresh:J})=>{const[w,K]=i.useState(!1),[M,P]=i.useState(""),[A,a]=i.useState([]),[v,x]=i.useState(0),[j,q]=i.useState(!1),R=i.useRef(null),te=i.useRef(null),Q=i.useRef(null),G=i.useRef(null),se=i.useRef(null),X=i.useRef(n),c=i.useRef(null),H=i.useRef(!1),b=i.useRef(new Map),$=i.useRef(V),z=i.useRef(C),g=i.useCallback((o,p=0)=>o.reduce((Z,B)=>{const U={...B,level:p};return Z.push(U),B.children&&B.children.length>0&&Z.push(...g(B.children,p+1)),Z},[]),[]),l=o=>typeof o=="string"&&(o.startsWith("http://")||o.startsWith("https://")||o.startsWith("data:")||o.startsWith("/")),_=i.useMemo(()=>g(A.length>0?A:t).find(p=>p.value===r)||null,[r,t,A,g]),y=i.useCallback((o,p)=>{if(!p.trim())return o;const Z=p.toLowerCase(),B=U=>U.reduce((Y,le)=>{const oe=le.label.toLowerCase().includes(Z),ae=le.children?B(le.children):[];return(oe||ae.length>0)&&Y.push({...le,children:ae.length>0?ae:le.children}),Y},[]);return B(o)},[]);i.useEffect(()=>{X.current=n,se.current=null},[n]),i.useEffect(()=>{$.current=V},[V]),i.useEffect(()=>{z.current=C},[C]),i.useEffect(()=>{ee&&ee(()=>{b.current.clear()}),J&&J(()=>{if(!X.current)return;c.current&&c.current.abort(),c.current=new AbortController;const o=c.current.signal;q(!0),(async()=>{try{const p=Date.now(),Z=M,B=b.current.get(Z),U=B&&(!z.current||p-B.timestamp<z.current);let Y;$.current&&U?Y=B.data:(Y=await(X.current?X.current(M,o):n?.(M,o)??[]),!o.aborted&&$.current&&b.current.set(Z,{data:Y,timestamp:p})),o.aborted||(a(Y),se.current=M)}catch(p){console.error(p),a([])}finally{q(!1)}})()})},[ee,J,M]),i.useEffect(()=>{if(n&&w){const o=se.current===M,p=!H.current&&w;return o&&!(E&&p)?void 0:(G.current&&clearTimeout(G.current),G.current=setTimeout(async()=>{c.current&&c.current.abort(),c.current=new AbortController;const B=c.current.signal;q(!0);try{let U;const Y=M,le=b.current.get(Y),oe=Date.now(),ae=le&&(!z.current||oe-le.timestamp<z.current);if($.current&&ae?U=le.data:(U=await(X.current?X.current(M,B):n(M,B)),!B.aborted&&$.current&&b.current.set(Y,{data:U,timestamp:oe})),B.aborted)return;a(U),se.current=M}catch(U){console.error("Error fetching options:",U),a([])}finally{q(!1)}},d),()=>{G.current&&clearTimeout(G.current),c.current&&(c.current.abort(),c.current=null)})}else n||a(y(t,M));H.current=w},[M,w,t,d,y,E]),i.useEffect(()=>{n||a(t)},[t,n]),i.useEffect(()=>{const o=p=>{R.current&&!R.current.contains(p.target)&&(K(!1),P(""))};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]);const I=i.useMemo(()=>g(A.length>0?A:t).filter(p=>!p.disabled),[A,t,g]),re=i.useMemo(()=>g(A.length>0?A:t),[A,t,g]),N=i.useMemo(()=>{const o=new Map;return re.forEach(p=>{const Z=JSON.stringify({value:p.value,label:p.label}),B=I.findIndex(U=>U.value===p.value&&U.label===p.label);o.set(Z,B)}),o},[re,I]),ie=o=>{if(!m)switch(o.key){case"ArrowDown":o.preventDefault(),w?x(p=>p<I.length-1?p+1:0):K(!0);break;case"ArrowUp":o.preventDefault(),w&&x(p=>p>0?p-1:I.length-1);break;case"Enter":o.preventDefault(),w&&I[v]?ce(I[v]):K(!w);break;case"Escape":o.preventDefault(),K(!1),P("");break;case"Tab":w&&(K(!1),P(""));break}};i.useEffect(()=>{if(w&&Q.current){const o=Q.current.querySelector(`[data-index="${v}"]`);o&&typeof o.scrollIntoView=="function"&&o.scrollIntoView({block:"nearest"})}},[v,w]);const ce=o=>{o.disabled||(s?.(o.value,o),K(!1),P(""),x(0))},ne=o=>{o.stopPropagation(),s?.(null,null),P("")},it=()=>{m||K(o=>{const p=!o;return p&&setTimeout(()=>te.current?.focus(),0),p})};i.useEffect(()=>{w||(se.current=null)},[w]);const ct=o=>{P(o.target.value),w||K(!0),x(0)},at=o=>{const p=(o.level||0)*20;return e.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${p}px`},children:[o.icon&&e.jsx("span",{className:"uiforge-combobox-option-icon",children:l(o.icon)?e.jsx("img",{src:o.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):o.icon}),e.jsx("span",{className:"uiforge-combobox-option-label",children:o.label})]})},ot=o=>o?e.jsxs("div",{className:"uiforge-combobox-value-content",children:[o.icon&&e.jsx("span",{className:"uiforge-combobox-value-icon",children:l(o.icon)?e.jsx("img",{src:o.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):o.icon}),e.jsx("span",{className:"uiforge-combobox-value-label",children:o.label})]}):h,T="uiforge-combobox",dt=[T,w&&`${T}--open`,m&&`${T}--disabled`,f].filter(Boolean).join(" ");return e.jsxs("div",{ref:R,className:dt,onKeyDown:ie,role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-label":F,"aria-disabled":m,tabIndex:m?-1:0,children:[e.jsxs("div",{className:`${T}-control`,onClick:it,children:[L&&w?e.jsx("input",{ref:te,type:"text",className:`${T}-input`,value:M,onChange:ct,placeholder:h,disabled:m,"aria-autocomplete":"list","aria-controls":`${T}-listbox`}):e.jsx("div",{className:`${T}-value`,children:O?O(_):ot(_)}),e.jsxs("div",{className:`${T}-indicators`,children:[u&&r!==null&&r!==void 0&&!m&&e.jsx("button",{type:"button",className:`${T}-clear`,onClick:ne,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),e.jsx("span",{className:`${T}-arrow`,children:"▼"})]})]}),w&&e.jsx("div",{ref:Q,className:`${T}-dropdown`,style:{maxHeight:W},role:"listbox",id:`${T}-listbox`,children:D||j?e.jsx("div",{className:`${T}-loading`,children:"Loading..."}):I.length===0?e.jsx("div",{className:`${T}-no-options`,children:S}):re.map(o=>{const p=JSON.stringify({value:o.value,label:o.label}),Z=N.get(p)??-1,B=o.value===r,U=Z===v,Y=[`${T}-option`,B&&`${T}-option--selected`,U&&`${T}-option--highlighted`,o.disabled&&`${T}-option--disabled`].filter(Boolean).join(" ");return e.jsx("div",{className:Y,onClick:()=>ce(o),role:"option","aria-selected":B,"aria-disabled":o.disabled,"data-index":Z,children:k?k(o):at(o)},p)})})]})},pe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5h-3.32zM8 5a3 3 0 100 6 3 3 0 000-6z"})}),je=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"})}),be=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),e.jsx("path",{d:"M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"})]}),ye=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0114.25 13H8.06l-2.573 2.573A1.458 1.458 0 013 14.543V13H1.75A1.75 1.75 0 010 11.25v-8.5zM1.75 2.5a.25.25 0 00-.25.25v8.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h6.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25H1.75z"})}),_e=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),ke=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Ce=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M5 3.254V3.25v.005a.75.75 0 110-.005v.004zm.45 1.9a2.25 2.25 0 10-1.95.218v5.256a2.25 2.25 0 101.5 0V7.123A5.735 5.735 0 009.25 9h1.378a2.251 2.251 0 100-1.5H9.25a4.25 4.25 0 01-3.8-2.346zM12.75 9a.75.75 0 100-1.5.75.75 0 000 1.5zm-8.5 4.5a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),we=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})}),Ie=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M4.53 4.75A.75.75 0 015 6.25h6a.75.75 0 00.53-1.28l-3-3a.75.75 0 00-1.06 0l-3 3zm.47 6.47a.75.75 0 01.53-.22h6a.75.75 0 01.53 1.28l-3 3a.75.75 0 01-1.06 0l-3-3a.75.75 0 01-.01-1.06h.01z"})}),$e=({size:t=20,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:r,children:[e.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),e.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Me=({size:t=20,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:r,children:[e.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),e.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ne=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})}),Le=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})}),Se=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:r,children:[e.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:s,strokeWidth:"1.5"}),e.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:s}),e.jsx("circle",{cx:"8",cy:"5",r:"2",fill:s==="currentColor"?"white":"#fff"}),e.jsx("circle",{cx:"8",cy:"11",r:"2",fill:s}),e.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:s}),e.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:s==="currentColor"?"white":"#fff"})]}),Be=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),e.jsx("path",{d:"M8 5C6.5 5 5 6 5 7.5V9C5 9 5.5 10 6 10.5L5 14H7L8 11L9 14H11L10 10.5C10.5 10 11 9 11 9V7.5C11 6 9.5 5 8 5Z"}),e.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:s,fill:"none"})]}),De=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),e.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),e.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:s,fill:"none"})]}),Ve=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),e.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),e.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),e.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),e.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),He=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),e.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),e.jsx("path",{d:"M6 14H4L5 11"})]}),Ee=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:r,children:e.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ae=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M4 8C4 6 5 4 7 4C8 4 8.5 4.5 8.5 5.5C8.5 6 8.8 6.5 9.5 6.5C10.5 6.5 11 7 11 8C11 9.5 10 11 8 12C6 13 4 12 4 10V8Z"}),e.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),Re=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),e.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),e.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),e.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),e.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),e.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),Te=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),e.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),e.jsx("path",{d:"M3 8C3 9.1 5.2 10 8 10C10.8 10 13 9.1 13 8"})]}),Pe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M4.5 10C2.5 10 1 8.5 1 6.5C1 4.5 2.5 3 4.5 3C4.6 3 4.7 3 4.8 3.05C5.3 1.8 6.5 1 8 1C10 1 11.5 2.5 11.5 4.5C11.5 4.6 11.5 4.7 11.5 4.8C12.9 5.1 14 6.3 14 7.75C14 9.5 12.5 11 10.75 11H4.5Z"})}),ze=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75z"}),e.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("line",{x1:"8",y1:"10.5",x2:"12",y2:"10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ue=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),e.jsx("path",{d:"M5.75 7.5c0-.69.56-1.25 1.25-1.25h2c.69 0 1.25.56 1.25 1.25M4 5.5L2 4M12 5.5L14 4M4 9H1M15 9H12M4 12L2 13.5M12 12L14 13.5",stroke:s,strokeWidth:"1.5",fill:"none"}),e.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),Oe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M5.28 3.72a.75.75 0 00-1.06 1.06L7.44 8l-3.22 3.22a.75.75 0 101.06 1.06l3.75-3.75a.75.75 0 000-1.06L5.28 3.72zM8.5 11.5a.75.75 0 000 1.5h5a.75.75 0 000-1.5h-5z"})}),We=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M8 0C6 0 4.5 2 3.5 5L1 7L4 8L5 11L7 8.5C9 7.5 11 6 13 3C14 2 15 0 16 0C16 0 14 2 13 3C11 5 9.5 6.5 8 7.5M10 4C10.552 4 11 3.552 11 3C11 2.448 10.552 2 10 2C9.448 2 9 2.448 9 3C9 3.552 9.448 4 10 4Z"}),e.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),Fe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),e.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:s,strokeLinecap:"round"}),e.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),e.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),e.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),e.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),e.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),qe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M8 1C4 1 2 3 2 6C2 8 2 10 3 11C3.5 11.5 4 12 5 12C5.5 12 6 11.5 6.5 10.5C7 9.5 7.5 9 8 9C8.5 9 9 9.5 9.5 10.5C10 11.5 10.5 12 11 12C12 12 12.5 11.5 13 11C14 10 14 8 14 6C14 3 12 1 8 1Z"}),e.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),e.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),e.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:s}),e.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:s})]}),Ke=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("circle",{cx:"8",cy:"8",r:"5"}),e.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:s,strokeWidth:"1",opacity:"0.6"}),e.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:s==="currentColor"?"white":"#fff"})]}),Ze=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),e.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:s})]}),Ge=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M1.5 13.5V2.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5zM5 13.5V5.5a.5.5 0 01.5-.5H6a.5.5 0 01.5.5v8a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5zM8.5 13.5V7.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v6a.5.5 0 01-.5.5H9a.5.5 0 01-.5-.5zM12 13.5V3.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v10a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5z"})}),Je=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("circle",{cx:"5",cy:"4",r:"2"}),e.jsx("circle",{cx:"11",cy:"4",r:"2"}),e.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),e.jsx("path",{d:"M7 14V12C7 10.5 8.5 9 11 9C13.5 9 15 10.5 15 12V14H7Z"})]}),Ye=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M3 1.75C3 .784 3.784 0 4.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0113.25 16h-8.5A1.75 1.75 0 013 14.25V1.75z"}),e.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:s==="currentColor"?"white":"#fff"})]}),Qe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"})}),Xe=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M6.75 0A1.75 1.75 0 005 1.75V3H1.75C.784 3 0 3.784 0 4.75v8.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H11V1.75A1.75 1.75 0 009.25 0h-2.5zM9.5 3V1.75a.25.25 0 00-.25-.25h-2.5a.25.25 0 00-.25.25V3h3z"})}),et=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),tt=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M3.25 1A2.25 2.25 0 011 3.25v9.5A2.25 2.25 0 013.25 15h9.5A2.25 2.25 0 0115 12.75v-9.5A2.25 2.25 0 0012.75 1h-9.5zM2.5 3.25a.75.75 0 01.75-.75h9.5a.75.75 0 01.75.75v9.5a.75.75 0 01-.75.75h-9.5a.75.75 0 01-.75-.75v-9.5z"}),e.jsx("path",{d:"M8 4a.75.75 0 01.75.75v2.5h2.5a.75.75 0 010 1.5h-2.5v2.5a.75.75 0 01-1.5 0v-2.5h-2.5a.75.75 0 010-1.5h2.5v-2.5A.75.75 0 018 4z"})]}),st=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),e.jsx("circle",{cx:"7",cy:"8",r:"1",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"}),e.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"})]}),rt=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),e.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:s==="currentColor"?"white":"#fff"})]}),nt=({size:t=16,className:r="",color:s="currentColor"})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:[e.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),e.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),e.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),e.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:s,strokeWidth:"1.5"}),e.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:s,strokeWidth:"1.5",strokeLinecap:"round"})]}),lt=({size:t=16,className:r="",color:s="currentColor"})=>e.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:s,className:r,children:e.jsx("path",{d:"M4.48 7.27c.26.26 1.28 1.33 1.28 1.33l.56-.58-.88-.91 1.69-1.8s-.76-.74-.43-.45c.32-1.19.03-2.51-.87-3.44C4.93.5 3.66.2 2.52.51l1.93 2-.51 1.96-1.89.52-1.93-2C-.19 4.17.1 5.48 1 6.4c.94.98 2.29 1.26 3.48.87zm6.44 1.94l-2.33 2.3 3.84 3.98c.31.33.73.49 1.14.49.41 0 .82-.16 1.14-.49.63-.65.63-1.7 0-2.35l-3.79-3.93zM16 2.53L13.55 0 6.33 7.46l.88.91-4.31 4.46-.99.53-1.39 2.27.35.37 2.2-1.44.51-1.02L7.9 9.08l.88.91L16 2.53z"})}),ge={commit:pe,pr:je,issue:be,comment:ye,star:_e,fork:ke,merge:Ce,release:we,deploy:Ie},me={unfold:$e,fold:Me,close:Ne,check:Le},kt={taichi:Se,meditation:Be,yoga:De},Ct={dumbbell:Ve,running:He,heartrate:Ee,strength:Ae},wt={server:Re,database:Te,cloud:Pe,terminal:ze,bug:Ue,code:Oe},It={rocket:We,satellite:Fe,alien:qe,planet:Ke,telescope:Ze},$t={chart:Ge,meeting:Je,document:Ye,calendar:Qe,briefcase:Xe},Mt={gitbranch:et,prdraft:tt,testing:st,deployment:rt,review:nt,build:lt},Nt=t=>{const r=ge[t]||ge.commit;return e.jsx(r,{size:16})},ue=(t,r=2)=>{if(t.length===0)return[];const s=[];let n=[],h=null;return t.forEach((m,u)=>{h===m.type?n.push(m):(n.length>=r&&h?s.push(ve(n,h)):n.forEach(f=>{s.push({id:f.id.toString(),type:f.type,count:1,title:f.title,timestamp:new Date(f.timestamp),icon:f.icon,events:[f]})}),n=[m],h=m.type),u===t.length-1&&(n.length>=r&&h?s.push(ve(n,h)):n.forEach(f=>{s.push({id:f.id.toString(),type:f.type,count:1,title:f.title,timestamp:new Date(f.timestamp),icon:f.icon,events:[f]})}))}),s},ve=(t,r)=>{const s=t.reduce((u,f)=>{const k=f.metadata?.repository||"unknown";return u[k]||(u[k]=[]),u[k].push(f),u},{}),n=Object.entries(s),h=n.length>1;let m="";if(h)m=`Created ${t.length} ${fe(r)} in ${n.length} repositories`;else{const u=n[0][0];m=`Created ${t.length} ${fe(r)}${u!=="unknown"?` in ${u}`:""}`}return{id:`group-${r}-${t[0].id}`,type:r,count:t.length,title:m,timestamp:new Date(t[0].timestamp),icon:t[0].icon,events:t,children:h?n.map(([u,f])=>({id:`group-${r}-${u}`,type:r,count:f.length,title:`Created ${f.length} ${fe(r)} in ${u}`,timestamp:new Date(f[0].timestamp),icon:f[0].icon,events:f})):void 0}},fe=t=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[t]||`${t}s`,xe=t=>{if(t.length===0)return[];const r=[];let s=null;return t.forEach((n,h)=>{if("type"in n&&n.type==="date-separator"){r.push(n);return}const u=n.timestamp,f=`${u.getFullYear()}-${u.getMonth()}`;if(f!==s){const k={id:`sep-${h}`,type:"date-separator",date:u,label:Lt(u)};r.push(k),s=f}r.push(n)}),r},Lt=t=>t.toLocaleDateString("en-US",{month:"long",year:"numeric"}),St=t=>{const r=typeof t=="string"?new Date(t):t,n=new Date().getTime()-r.getTime(),h=Math.floor(n/1e3),m=Math.floor(h/60),u=Math.floor(m/60),f=Math.floor(u/24);return h<60?"just now":m<60?`${m}m ago`:u<24?`${u}h ago`:f<30?`${f}d ago`:r.toLocaleDateString()},Bt=({events:t,theme:r="light",className:s="",showLoadMore:n=!0,loading:h=!1,onLoadMore:m,pagination:u,maxHeight:f,showMoreThreshold:k=100,initiallyExpandedAll:O=!1,emptyMessage:D="No activity to display",onToggleExpand:W,enableGrouping:d=!0,groupingThreshold:L=2,showDateSeparators:S=!0,showTimeline:F=!0,scale:V=1,renderIcon:C,renderEvent:E})=>{const[ee,J]=i.useState(()=>{const c=new Set;return(d?S?xe(ue(t,L)):ue(t,L):t.map(b=>({id:b.id.toString(),type:b.type,count:1,title:b.title,timestamp:new Date(b.timestamp),icon:b.icon,events:[b]}))).forEach(b=>{if("events"in b&&b.type!=="date-separator"){const $=b;(O||$.events.some(z=>z.initiallyExpanded))&&c.add($.id),$.children&&$.children.forEach(z=>{(O||z.events.some(g=>g.initiallyExpanded))&&c.add(z.id)})}}),c}),[w,K]=i.useState(!1),M=i.useRef(null),P=i.useRef(null),A=i.useMemo(()=>{if(!d){const H=t.map(b=>({id:b.id.toString(),type:b.type,count:1,title:b.title,timestamp:new Date(b.timestamp),icon:b.icon,events:[b]}));return S?xe(H):H}const c=ue(t,L);return S?xe(c):c},[t,d,L,S]),a=i.useCallback(()=>{if(!P.current||!n||!m)return;const{scrollTop:c,scrollHeight:H,clientHeight:b}=P.current,$=H-c-b;K($<=k)},[n,m,k]);i.useEffect(()=>{const c=P.current;if(c)return c.addEventListener("scroll",a),a(),()=>{c.removeEventListener("scroll",a)}},[a]);const v=i.useCallback((c,H)=>{J(b=>{const $=new Set(b),z=$.has(c);return z?$.delete(c):$.add(c),W?.(H,!z),$})},[W]),x=(c,H=!1)=>{const b=ee.has(c.id),$=c.children&&c.children.length>0,z=c.count>1,g=c.count===1&&c.events[0]?.description,l=z||$||g,_=c.count===1&&c.events.length===1?c.events[0].id:c.id;return E&&c.count===1&&c.events.length===1?e.jsxs("div",{className:`activity-stream__item ${H?"activity-stream__item--child":""}`,"data-event-id":c.id,children:[F&&!H&&e.jsx("div",{className:"activity-stream__timeline-marker"}),E(c.events[0])]},c.id):e.jsxs("div",{className:`activity-stream__item ${H?"activity-stream__item--child":""}`,"data-event-id":c.id,children:[F&&!H&&e.jsx("div",{className:"activity-stream__timeline-marker"}),e.jsx("div",{className:"activity-stream__icon",children:C&&c.events.length===1?C(c.events[0]):c.icon||Nt(c.type)}),e.jsxs("div",{className:"activity-stream__content",children:[e.jsxs("div",{className:`activity-stream__header ${l?"activity-stream__header--clickable":""}`,onClick:()=>l&&v(c.id,_),onKeyDown:y=>{l&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),v(c.id,_))},role:l?"button":void 0,tabIndex:l?0:void 0,"aria-expanded":l?b:void 0,children:[e.jsx("div",{className:"activity-stream__title",children:c.title}),e.jsx("div",{className:"activity-stream__timestamp",children:St(c.timestamp)}),l&&e.jsx("div",{className:"activity-stream__toggle",children:b?e.jsx(me.fold,{size:16}):e.jsx(me.unfold,{size:16})})]}),b&&$&&c.children&&e.jsx("div",{className:"activity-stream__children",children:c.children.map(y=>x(y,!0))}),b&&!$&&c.events.length>1&&e.jsx("div",{className:"activity-stream__events-list",children:c.events.map(y=>E?e.jsx("div",{className:"activity-stream__event-item",children:E(y)},y.id):e.jsxs("div",{className:"activity-stream__event-item",children:[e.jsx("div",{className:"activity-stream__event-title",children:y.title}),y.description&&e.jsx("div",{className:"activity-stream__event-description",children:y.description})]},y.id))}),b&&c.count===1&&c.events[0].description&&e.jsx("div",{className:"activity-stream__description",children:c.events[0].description})]})]},c.id)},j=c=>e.jsxs("div",{className:"activity-stream__date-separator",children:[e.jsx("div",{className:"activity-stream__date-label",children:c.label}),e.jsx("div",{className:"activity-stream__date-line"})]},c.id),q=u?.hasMore!==void 0?u.hasMore:u?.totalItems!==void 0?t.length<u.totalItems:!0,R="activity-stream",te=`${R}--${r}`,Q=F?`${R}--with-timeline`:"";let G=`${R} ${te} ${Q} ${s}`.trim();V&&V<1&&(G=`${G} ${R}--compact`),V&&V>1&&(G=`${G} ${R}--spacious`);const se=f?{maxHeight:f}:void 0,X={"--activity-stream-scale":V};return e.jsx("div",{ref:M,className:G,"data-theme":r,children:e.jsxs("div",{ref:P,className:"activity-stream__container",style:{...se,...X},children:[A.length===0?e.jsx("div",{className:"activity-stream__empty",children:D}):e.jsx("div",{className:"activity-stream__items",children:A.map(c=>"type"in c&&c.type==="date-separator"?j(c):x(c))}),h&&e.jsxs("div",{className:"activity-stream__loading",children:[e.jsx("div",{className:"activity-stream__spinner"}),e.jsx("span",{children:"Loading..."})]}),n&&!h&&q&&m&&e.jsx("div",{className:`activity-stream__load-more ${w?"activity-stream__load-more--visible":""}`,onClick:m,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),m())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})},Dt=()=>e.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video__play-icon",children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),e.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),Vt=()=>e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video-preview__icon",children:[e.jsx("path",{d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm2-1a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1V5a1 1 0 00-1-1H4z"}),e.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),Ht=({title:t,description:r,youtubeId:s,vimeoId:n,thumbnailUrl:h,onPlay:m,className:u="",overlayIcon:f,aspectRatio:k="16/9"})=>{const[O,D]=i.useState(!1),W=i.useRef(null),d=s?"youtube":n?"vimeo":null,L=s||n||"",S=i.useMemo(()=>!d||!L?"":d==="youtube"?`https://www.youtube.com/embed/${L}?autoplay=1&rel=0`:d==="vimeo"?`https://player.vimeo.com/video/${L}?autoplay=1`:"",[d,L]),F=i.useMemo(()=>{if(h)return h;if(d==="youtube"&&s)return`https://img.youtube.com/vi/${s}/maxresdefault.jpg`;if(d==="vimeo"&&n)return},[h,d,s,n]),V=i.useCallback(()=>{!d||!L||(D(!0),m&&m(L,d))},[d,L,m]);if(!s&&!n)return console.warn("UIForgeVideo: Either youtubeId or vimeoId must be provided"),null;const C="uiforge-video",E=`${C} ${u}`.trim();return e.jsxs("div",{className:E,children:[e.jsxs("div",{className:`${C}__header`,children:[e.jsx("h3",{className:`${C}__title`,children:t}),r&&e.jsx("p",{className:`${C}__description`,children:r})]}),e.jsx("div",{className:`${C}__player-container`,style:{aspectRatio:k},children:O?e.jsx("iframe",{ref:W,src:S,title:t,className:`${C}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):e.jsxs(e.Fragment,{children:[F&&e.jsx("img",{src:F,alt:t,className:`${C}__thumbnail`}),e.jsx("button",{className:`${C}__overlay`,onClick:V,"aria-label":`Play video: ${t}`,type:"button",children:f||e.jsx(Dt,{})})]})})]})},Et=({title:t,icon:r,className:s="",onClick:n})=>{const h="uiforge-video-preview",m=`${h} ${s}`.trim(),u=()=>{n&&n()},f=D=>{n&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),n())},k=n?"button":"div",O=n?{type:"button",onClick:u,onKeyDown:f}:{};return e.jsxs(k,{className:m,...O,children:[e.jsx("div",{className:`${h}__icon-container`,children:r||e.jsx(Vt,{})}),e.jsx("span",{className:`${h}__title`,children:t})]})};exports.ActivityIcons=ge;exports.AlienIcon=qe;exports.BriefcaseIcon=Xe;exports.BugIcon=Ue;exports.BuildIcon=lt;exports.BusinessIcons=$t;exports.Button=ht;exports.CalendarIcon=Qe;exports.ChartIcon=Ge;exports.CheckIcon=Le;exports.CloseIcon=Ne;exports.CloudIcon=Pe;exports.CodeIcon=Oe;exports.CommentIcon=ye;exports.CommitIcon=pe;exports.DatabaseIcon=Te;exports.DeployIcon=Ie;exports.DeploymentIcon=rt;exports.DevProcessIcons=Mt;exports.DocumentIcon=Ye;exports.DumbbellIcon=Ve;exports.FitnessIcons=Ct;exports.FoldIcon=Me;exports.ForkIcon=ke;exports.GitBranchIcon=et;exports.HeartRateIcon=Ee;exports.IssueIcon=be;exports.MeditationIcon=Be;exports.MeetingIcon=Je;exports.MergeIcon=Ce;exports.PlanetIcon=Ke;exports.PullRequestDraftIcon=tt;exports.PullRequestIcon=je;exports.ReleaseIcon=we;exports.ReviewIcon=nt;exports.RocketIcon=We;exports.RunningIcon=He;exports.SatelliteIcon=Fe;exports.ServerIcon=Re;exports.SpaceIcons=It;exports.StarIcon=_e;exports.StrengthIcon=Ae;exports.TaiChiIcon=Se;exports.TechIcons=wt;exports.TelescopeIcon=Ze;exports.TerminalIcon=ze;exports.TestingIcon=st;exports.UIForgeActivityStream=Bt;exports.UIForgeBlocksEditor=xt;exports.UIForgeComboBox=_t;exports.UIForgeGrid=ut;exports.UIForgeVideo=Ht;exports.UIForgeVideoPreview=Et;exports.UIIcons=me;exports.UnfoldIcon=$e;exports.WellnessIcons=kt;exports.YogaIcon=De;exports.blocksToHTML=jt;exports.blocksToJSON=yt;exports.blocksToMarkdown=bt;
6
+ `)}function Kt(t){return JSON.stringify(t,null,2)}const Zt=({options:t=[],value:e,onChange:r,onSearch:n,theme:a="light",placeholder:f="Select an option...",disabled:l=!1,clearable:c=!1,className:j="",renderOption:k,renderValue:$,loading:E=!1,maxHeight:A="300px",debounceMs:d=300,searchable:w=!0,noOptionsMessage:i="No options found",ariaLabel:u,enableCache:h=!1,cacheTTL:x,refreshOnOpen:S=!1,onClearCache:U,onForceRefresh:C})=>{const[y,M]=o.useState(!1),[L,O]=o.useState(""),[R,W]=o.useState([]),[v,N]=o.useState(0),[_,b]=o.useState(!1),re=o.useRef(null),Y=o.useRef(null),te=o.useRef(null),X=o.useRef(null),ne=o.useRef(null),se=o.useRef(n),T=o.useRef(null),oe=o.useRef(!1),Z=o.useRef(new Map),ee=o.useRef(h),le=o.useRef(x),I=o.useCallback((m,D=0)=>m.reduce((Q,G)=>{const B={...G,level:D};return Q.push(B),G.children&&G.children.length>0&&Q.push(...I(G.children,D+1)),Q},[]),[]),F=m=>typeof m=="string"&&(m.startsWith("http://")||m.startsWith("https://")||m.startsWith("data:")||m.startsWith("/")),p=o.useMemo(()=>I(R.length>0?R:t).find(D=>D.value===e)||null,[e,t,R,I]),V=o.useCallback((m,D)=>{if(!D.trim())return m;const Q=D.toLowerCase(),G=B=>B.reduce((ce,ue)=>{const xe=ue.label.toLowerCase().includes(Q),fe=ue.children?G(ue.children):[];return(xe||fe.length>0)&&ce.push({...ue,children:fe.length>0?fe:ue.children}),ce},[]);return G(m)},[]);o.useEffect(()=>{se.current=n,ne.current=null},[n]),o.useEffect(()=>{ee.current=h},[h]),o.useEffect(()=>{le.current=x},[x]),o.useEffect(()=>{U&&U(()=>{Z.current.clear()}),C&&C(()=>{if(!se.current)return;T.current&&T.current.abort(),T.current=new AbortController;const m=T.current.signal;b(!0),(async()=>{try{const D=Date.now(),Q=L,G=Z.current.get(Q),B=G&&(!le.current||D-G.timestamp<le.current);let ce;ee.current&&B?ce=G.data:(ce=await(se.current?se.current(L,m):n?.(L,m)??[]),!m.aborted&&ee.current&&Z.current.set(Q,{data:ce,timestamp:D})),m.aborted||(W(ce),ne.current=L)}catch(D){console.error(D),W([])}finally{b(!1)}})()})},[U,C,L,n]),o.useEffect(()=>{if(n&&y){const m=ne.current===L,D=!oe.current&&y;return m&&!(S&&D)?void 0:(X.current&&clearTimeout(X.current),X.current=setTimeout(async()=>{T.current&&T.current.abort(),T.current=new AbortController;const G=T.current.signal;b(!0);try{let B;const ce=L,ue=Z.current.get(ce),xe=Date.now(),fe=ue&&(!le.current||xe-ue.timestamp<le.current);if(ee.current&&fe?B=ue.data:(B=await(se.current?se.current(L,G):n(L,G)),!G.aborted&&ee.current&&Z.current.set(ce,{data:B,timestamp:xe})),G.aborted)return;W(B),ne.current=L}catch(B){console.error("Error fetching options:",B),W([])}finally{b(!1)}},d),()=>{X.current&&clearTimeout(X.current),T.current&&(T.current.abort(),T.current=null)})}else n||W(V(t,L));oe.current=y},[L,y,t,d,V,S,n]),o.useEffect(()=>{n||W(t)},[t,n]),o.useEffect(()=>{const m=D=>{re.current&&!re.current.contains(D.target)&&(M(!1),O(""))};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const H=o.useMemo(()=>I(R.length>0?R:t).filter(D=>!D.disabled),[R,t,I]),K=o.useMemo(()=>I(R.length>0?R:t),[R,t,I]),ae=o.useMemo(()=>{const m=new Map;return K.forEach(D=>{const Q=JSON.stringify({value:D.value,label:D.label}),G=H.findIndex(B=>B.value===D.value&&B.label===D.label);m.set(Q,G)}),m},[K,H]),q=m=>{if(!l)switch(m.key){case"ArrowDown":m.preventDefault(),y?N(D=>D<H.length-1?D+1:0):M(!0);break;case"ArrowUp":m.preventDefault(),y&&N(D=>D>0?D-1:H.length-1);break;case"Enter":m.preventDefault(),y&&H[v]?de(H[v]):M(!y);break;case"Escape":m.preventDefault(),M(!1),O("");break;case"Tab":y&&(M(!1),O(""));break}};o.useEffect(()=>{if(y&&te.current){const m=te.current.querySelector(`[data-index="${v}"]`);m&&typeof m.scrollIntoView=="function"&&m.scrollIntoView({block:"nearest"})}},[v,y]);const de=m=>{m.disabled||(r?.(m.value,m),M(!1),O(""),N(0))},he=m=>{m.stopPropagation(),r?.(null,null),O("")},ie=()=>{l||M(m=>{const D=!m;return D&&setTimeout(()=>Y.current?.focus(),0),D})};o.useEffect(()=>{y||(ne.current=null)},[y]);const je=m=>{O(m.target.value),y||M(!0),N(0)},ge=m=>{const D=(m.level||0)*20;return s.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${D}px`},children:[m.icon&&s.jsx("span",{className:"uiforge-combobox-option-icon",children:F(m.icon)?s.jsx("img",{src:m.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):m.icon}),s.jsx("span",{className:"uiforge-combobox-option-label",children:m.label})]})},g=m=>m?s.jsxs("div",{className:"uiforge-combobox-value-content",children:[m.icon&&s.jsx("span",{className:"uiforge-combobox-value-icon",children:F(m.icon)?s.jsx("img",{src:m.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):m.icon}),s.jsx("span",{className:"uiforge-combobox-value-label",children:m.label})]}):f,P="uiforge-combobox",z=`${P}--${a}`,J=[P,z,y&&`${P}--open`,l&&`${P}--disabled`,j].filter(Boolean).join(" ");return s.jsxs("div",{ref:re,className:J,onKeyDown:q,role:"combobox","aria-expanded":y,"aria-haspopup":"listbox","aria-label":u,"aria-disabled":l,tabIndex:l?-1:0,"data-theme":a,children:[s.jsxs("div",{className:`${P}-control`,onClick:ie,children:[w&&y?s.jsx("input",{ref:Y,type:"text",className:`${P}-input`,value:L,onChange:je,placeholder:f,disabled:l,"aria-autocomplete":"list","aria-controls":`${P}-listbox`}):s.jsx("div",{className:`${P}-value`,children:$?$(p):g(p)}),s.jsxs("div",{className:`${P}-indicators`,children:[c&&e!==null&&e!==void 0&&!l&&s.jsx("button",{type:"button",className:`${P}-clear`,onClick:he,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),s.jsx("span",{className:`${P}-arrow`,children:"▼"})]})]}),y&&s.jsx("div",{ref:te,className:`${P}-dropdown`,style:{maxHeight:A},role:"listbox",id:`${P}-listbox`,children:E||_?s.jsx("div",{className:`${P}-loading`,children:"Loading..."}):H.length===0?s.jsx("div",{className:`${P}-no-options`,children:i}):K.map(m=>{const D=JSON.stringify({value:m.value,label:m.label}),Q=ae.get(D)??-1,G=m.value===e,B=Q===v,ce=[`${P}-option`,G&&`${P}-option--selected`,B&&`${P}-option--highlighted`,m.disabled&&`${P}-option--disabled`].filter(Boolean).join(" ");return s.jsx("div",{className:ce,onClick:()=>de(m),role:"option","aria-selected":G,"aria-disabled":m.disabled,"data-index":Q,children:k?k(m):ge(m)},D)})})]})};function Me(){return Me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Me.apply(null,arguments)}function De(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Le(t,e){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Le(t,e)}function Gt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Le(t,e)}var Ue=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Yt(t,e){return!!(t===e||Ue(t)&&Ue(e))}function Jt(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!Yt(t[r],e[r]))return!1;return!0}function Ce(t,e){e===void 0&&(e=Jt);var r,n=[],a,f=!1;function l(){for(var c=[],j=0;j<arguments.length;j++)c[j]=arguments[j];return f&&r===this&&e(c,n)||(a=t.apply(this,c),f=!0,r=this,n=c),a}return l}var Qt=typeof performance=="object"&&typeof performance.now=="function",Oe=Qt?function(){return performance.now()}:function(){return Date.now()};function ze(t){cancelAnimationFrame(t.id)}function Xt(t,e){var r=Oe();function n(){Oe()-r>=e?t.call(null):a.id=requestAnimationFrame(n)}var a={id:requestAnimationFrame(n)};return a}var ke=-1;function Re(t){if(t===void 0&&(t=!1),ke===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),ke=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return ke}var me=null;function Ve(t){if(t===void 0&&(t=!1),me===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),a=n.style;return a.width="100px",a.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?me="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?me="negative":me="positive-ascending"),document.body.removeChild(e),me}return me}process.env.NODE_ENV;var er=150,tr=function(e,r){return e},ye=null,be=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(ye=new WeakSet,be=new WeakSet);function rr(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,a=t.getItemSize,f=t.getOffsetForIndexAndAlignment,l=t.getStartIndexForOffset,c=t.getStopIndexForStartIndex,j=t.initInstanceProps,k=t.shouldResetStyleCacheOnItemSizeChange,$=t.validateProps;return e=(function(E){Gt(A,E);function A(w){var i;return i=E.call(this,w)||this,i._instanceProps=j(i.props,De(i)),i._outerRef=void 0,i._resetIsScrollingTimeoutId=null,i.state={instance:De(i),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof i.props.initialScrollOffset=="number"?i.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},i._callOnItemsRendered=void 0,i._callOnItemsRendered=Ce(function(u,h,x,S){return i.props.onItemsRendered({overscanStartIndex:u,overscanStopIndex:h,visibleStartIndex:x,visibleStopIndex:S})}),i._callOnScroll=void 0,i._callOnScroll=Ce(function(u,h,x){return i.props.onScroll({scrollDirection:u,scrollOffset:h,scrollUpdateWasRequested:x})}),i._getItemStyle=void 0,i._getItemStyle=function(u){var h=i.props,x=h.direction,S=h.itemSize,U=h.layout,C=i._getItemStyleCache(k&&S,k&&U,k&&x),y;if(C.hasOwnProperty(u))y=C[u];else{var M=r(i.props,u,i._instanceProps),L=a(i.props,u,i._instanceProps),O=x==="horizontal"||U==="horizontal",R=x==="rtl",W=O?M:0;C[u]=y={position:"absolute",left:R?void 0:W,right:R?W:void 0,top:O?0:M,height:O?"100%":L,width:O?L:"100%"}}return y},i._getItemStyleCache=void 0,i._getItemStyleCache=Ce(function(u,h,x){return{}}),i._onScrollHorizontal=function(u){var h=u.currentTarget,x=h.clientWidth,S=h.scrollLeft,U=h.scrollWidth;i.setState(function(C){if(C.scrollOffset===S)return null;var y=i.props.direction,M=S;if(y==="rtl")switch(Ve()){case"negative":M=-S;break;case"positive-descending":M=U-x-S;break}return M=Math.max(0,Math.min(M,U-x)),{isScrolling:!0,scrollDirection:C.scrollOffset<M?"forward":"backward",scrollOffset:M,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._onScrollVertical=function(u){var h=u.currentTarget,x=h.clientHeight,S=h.scrollHeight,U=h.scrollTop;i.setState(function(C){if(C.scrollOffset===U)return null;var y=Math.max(0,Math.min(U,S-x));return{isScrolling:!0,scrollDirection:C.scrollOffset<y?"forward":"backward",scrollOffset:y,scrollUpdateWasRequested:!1}},i._resetIsScrollingDebounced)},i._outerRefSetter=function(u){var h=i.props.outerRef;i._outerRef=u,typeof h=="function"?h(u):h!=null&&typeof h=="object"&&h.hasOwnProperty("current")&&(h.current=u)},i._resetIsScrollingDebounced=function(){i._resetIsScrollingTimeoutId!==null&&ze(i._resetIsScrollingTimeoutId),i._resetIsScrollingTimeoutId=Xt(i._resetIsScrolling,er)},i._resetIsScrolling=function(){i._resetIsScrollingTimeoutId=null,i.setState({isScrolling:!1},function(){i._getItemStyleCache(-1,null)})},i}A.getDerivedStateFromProps=function(i,u){return sr(i,u),$(i),null};var d=A.prototype;return d.scrollTo=function(i){i=Math.max(0,i),this.setState(function(u){return u.scrollOffset===i?null:{scrollDirection:u.scrollOffset<i?"forward":"backward",scrollOffset:i,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(i,u){u===void 0&&(u="auto");var h=this.props,x=h.itemCount,S=h.layout,U=this.state.scrollOffset;i=Math.max(0,Math.min(i,x-1));var C=0;if(this._outerRef){var y=this._outerRef;S==="vertical"?C=y.scrollWidth>y.clientWidth?Re():0:C=y.scrollHeight>y.clientHeight?Re():0}this.scrollTo(f(this.props,i,u,U,this._instanceProps,C))},d.componentDidMount=function(){var i=this.props,u=i.direction,h=i.initialScrollOffset,x=i.layout;if(typeof h=="number"&&this._outerRef!=null){var S=this._outerRef;u==="horizontal"||x==="horizontal"?S.scrollLeft=h:S.scrollTop=h}this._callPropsCallbacks()},d.componentDidUpdate=function(){var i=this.props,u=i.direction,h=i.layout,x=this.state,S=x.scrollOffset,U=x.scrollUpdateWasRequested;if(U&&this._outerRef!=null){var C=this._outerRef;if(u==="horizontal"||h==="horizontal")if(u==="rtl")switch(Ve()){case"negative":C.scrollLeft=-S;break;case"positive-ascending":C.scrollLeft=S;break;default:var y=C.clientWidth,M=C.scrollWidth;C.scrollLeft=M-y-S;break}else C.scrollLeft=S;else C.scrollTop=S}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&ze(this._resetIsScrollingTimeoutId)},d.render=function(){var i=this.props,u=i.children,h=i.className,x=i.direction,S=i.height,U=i.innerRef,C=i.innerElementType,y=i.innerTagName,M=i.itemCount,L=i.itemData,O=i.itemKey,R=O===void 0?tr:O,W=i.layout,v=i.outerElementType,N=i.outerTagName,_=i.style,b=i.useIsScrolling,re=i.width,Y=this.state.isScrolling,te=x==="horizontal"||W==="horizontal",X=te?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),se=ne[0],T=ne[1],oe=[];if(M>0)for(var Z=se;Z<=T;Z++)oe.push(o.createElement(u,{data:L,key:R(Z,L),index:Z,isScrolling:b?Y:void 0,style:this._getItemStyle(Z)}));var ee=n(this.props,this._instanceProps);return o.createElement(v||N||"div",{className:h,onScroll:X,ref:this._outerRefSetter,style:Me({position:"relative",height:S,width:re,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},_)},o.createElement(C||y||"div",{children:oe,ref:U,style:{height:te?"100%":ee,pointerEvents:Y?"none":void 0,width:te?ee:"100%"}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var i=this.props.itemCount;if(i>0){var u=this._getRangeToRender(),h=u[0],x=u[1],S=u[2],U=u[3];this._callOnItemsRendered(h,x,S,U)}}if(typeof this.props.onScroll=="function"){var C=this.state,y=C.scrollDirection,M=C.scrollOffset,L=C.scrollUpdateWasRequested;this._callOnScroll(y,M,L)}},d._getRangeToRender=function(){var i=this.props,u=i.itemCount,h=i.overscanCount,x=this.state,S=x.isScrolling,U=x.scrollDirection,C=x.scrollOffset;if(u===0)return[0,0,0,0];var y=l(this.props,C,this._instanceProps),M=c(this.props,y,C,this._instanceProps),L=!S||U==="backward"?Math.max(1,h):1,O=!S||U==="forward"?Math.max(1,h):1;return[Math.max(0,y-L),Math.max(0,Math.min(u-1,M+O)),y,M]},A})(o.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var sr=function(e,r){var n=e.children,a=e.direction,f=e.height,l=e.layout,c=e.innerTagName,j=e.outerTagName,k=e.width,$=r.instance;if(process.env.NODE_ENV!=="production"){(c!=null||j!=null)&&be&&!be.has($)&&(be.add($),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var E=a==="horizontal"||l==="horizontal";switch(a){case"horizontal":case"vertical":ye&&!ye.has($)&&(ye.add($),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+a+'" was specified.'))}switch(l){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+l+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(E&&typeof k!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(k===null?"null":typeof k)+'" was specified.'));if(!E&&typeof f!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(f===null?"null":typeof f)+'" was specified.'))}},nr=rr({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,a,f,l){var c=e.direction,j=e.height,k=e.itemCount,$=e.itemSize,E=e.layout,A=e.width,d=c==="horizontal"||E==="horizontal",w=d?A:j,i=Math.max(0,k*$-w),u=Math.min(i,r*$),h=Math.max(0,r*$-w+$+l);switch(n==="smart"&&(a>=h-w&&a<=u+w?n="auto":n="center"),n){case"start":return u;case"end":return h;case"center":{var x=Math.round(h+(u-h)/2);return x<Math.ceil(w/2)?0:x>i+Math.floor(w/2)?i:x}case"auto":default:return a>=h&&a<=u?a:a<h?h:u}},getStartIndexForOffset:function(e,r){var n=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/a)))},getStopIndexForStartIndex:function(e,r,n){var a=e.direction,f=e.height,l=e.itemCount,c=e.itemSize,j=e.layout,k=e.width,$=a==="horizontal"||j==="horizontal",E=r*c,A=$?k:f,d=Math.ceil((A+n-E)/c);return Math.max(0,Math.min(l-1,r+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var r=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});const We=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.93 8.5a4.002 4.002 0 01-7.86 0H.75a.75.75 0 010-1.5h3.32a4.002 4.002 0 017.86 0h3.32a.75.75 0 010 1.5h-3.32zM8 5a3 3 0 100 6 3 3 0 000-6z"})}),Fe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"})}),qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),s.jsx("path",{d:"M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"})]}),Ke=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0114.25 13H8.06l-2.573 2.573A1.458 1.458 0 013 14.543V13H1.75A1.75 1.75 0 010 11.25v-8.5zM1.75 2.5a.25.25 0 00-.25.25v8.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h6.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25H1.75z"})}),Ze=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"})}),Ge=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Ye=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5 3.254V3.25v.005a.75.75 0 110-.005v.004zm.45 1.9a2.25 2.25 0 10-1.95.218v5.256a2.25 2.25 0 101.5 0V7.123A5.735 5.735 0 009.25 9h1.378a2.251 2.251 0 100-1.5H9.25a4.25 4.25 0 01-3.8-2.346zM12.75 9a.75.75 0 100-1.5.75.75 0 000 1.5zm-8.5 4.5a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),Je=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})}),Qe=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.53 4.75A.75.75 0 015 6.25h6a.75.75 0 00.53-1.28l-3-3a.75.75 0 00-1.06 0l-3 3zm.47 6.47a.75.75 0 01.53-.22h6a.75.75 0 01.53 1.28l-3 3a.75.75 0 01-1.06 0l-3-3a.75.75 0 01-.01-1.06h.01z"})}),Xe=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),et=({size:t=20,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",className:e,children:[s.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:"M3 10H17",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),s.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:r,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),tt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})}),rt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})}),st=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:r,strokeWidth:"1.5"}),s.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"2",fill:r==="currentColor"?"white":"#fff"}),s.jsx("circle",{cx:"8",cy:"11",r:"2",fill:r}),s.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:r}),s.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:r==="currentColor"?"white":"#fff"})]}),nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),s.jsx("path",{d:"M8 5C6.5 5 5 6 5 7.5V9C5 9 5.5 10 6 10.5L5 14H7L8 11L9 14H11L10 10.5C10.5 10 11 9 11 9V7.5C11 6 9.5 5 8 5Z"}),s.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:r,fill:"none"})]}),at=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),s.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:r,fill:"none"})]}),it=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),s.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),s.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),ot=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),s.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),s.jsx("path",{d:"M6 14H4L5 11"})]}),lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",className:e,children:s.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4 8C4 6 5 4 7 4C8 4 8.5 4.5 8.5 5.5C8.5 6 8.8 6.5 9.5 6.5C10.5 6.5 11 7 11 8C11 9.5 10 11 8 12C6 13 4 12 4 10V8Z"}),s.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),dt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),s.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),s.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),s.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),ut=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),s.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),s.jsx("path",{d:"M3 8C3 9.1 5.2 10 8 10C10.8 10 13 9.1 13 8"})]}),ht=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.5 10C2.5 10 1 8.5 1 6.5C1 4.5 2.5 3 4.5 3C4.6 3 4.7 3 4.8 3.05C5.3 1.8 6.5 1 8 1C10 1 11.5 2.5 11.5 4.5C11.5 4.6 11.5 4.7 11.5 4.8C12.9 5.1 14 6.3 14 7.75C14 9.5 12.5 11 10.75 11H4.5Z"})}),mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75z"}),s.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),s.jsx("line",{x1:"8",y1:"10.5",x2:"12",y2:"10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),ft=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),s.jsx("path",{d:"M5.75 7.5c0-.69.56-1.25 1.25-1.25h2c.69 0 1.25.56 1.25 1.25M4 5.5L2 4M12 5.5L14 4M4 9H1M15 9H12M4 12L2 13.5M12 12L14 13.5",stroke:r,strokeWidth:"1.5",fill:"none"}),s.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),pt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M5.28 3.72a.75.75 0 00-1.06 1.06L7.44 8l-3.22 3.22a.75.75 0 101.06 1.06l3.75-3.75a.75.75 0 000-1.06L5.28 3.72zM8.5 11.5a.75.75 0 000 1.5h5a.75.75 0 000-1.5h-5z"})}),vt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0C6 0 4.5 2 3.5 5L1 7L4 8L5 11L7 8.5C9 7.5 11 6 13 3C14 2 15 0 16 0C16 0 14 2 13 3C11 5 9.5 6.5 8 7.5M10 4C10.552 4 11 3.552 11 3C11 2.448 10.552 2 10 2C9.448 2 9 2.448 9 3C9 3.552 9.448 4 10 4Z"}),s.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),gt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),s.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:r,strokeLinecap:"round"}),s.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),s.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),xt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 1C4 1 2 3 2 6C2 8 2 10 3 11C3.5 11.5 4 12 5 12C5.5 12 6 11.5 6.5 10.5C7 9.5 7.5 9 8 9C8.5 9 9 9.5 9.5 10.5C10 11.5 10.5 12 11 12C12 12 12.5 11.5 13 11C14 10 14 8 14 6C14 3 12 1 8 1Z"}),s.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),s.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:r}),s.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:r})]}),yt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"8",cy:"8",r:"5"}),s.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:r,strokeWidth:"1",opacity:"0.6"}),s.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:r==="currentColor"?"white":"#fff"})]}),bt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),s.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:r})]}),wt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M1.5 13.5V2.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v11a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5zM5 13.5V5.5a.5.5 0 01.5-.5H6a.5.5 0 01.5.5v8a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5zM8.5 13.5V7.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v6a.5.5 0 01-.5.5H9a.5.5 0 01-.5-.5zM12 13.5V3.5a.5.5 0 01.5-.5h.5a.5.5 0 01.5.5v10a.5.5 0 01-.5.5h-.5a.5.5 0 01-.5-.5z"})}),jt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("circle",{cx:"5",cy:"4",r:"2"}),s.jsx("circle",{cx:"11",cy:"4",r:"2"}),s.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),s.jsx("path",{d:"M7 14V12C7 10.5 8.5 9 11 9C13.5 9 15 10.5 15 12V14H7Z"})]}),_t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3 1.75C3 .784 3.784 0 4.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0113.25 16h-8.5A1.75 1.75 0 013 14.25V1.75z"}),s.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:r==="currentColor"?"white":"#fff"})]}),It=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zM2.5 7.5v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"})}),Ct=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M6.75 0A1.75 1.75 0 005 1.75V3H1.75C.784 3 0 3.784 0 4.75v8.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H11V1.75A1.75 1.75 0 009.25 0h-2.5zM9.5 3V1.75a.25.25 0 00-.25-.25h-2.5a.25.25 0 00-.25.25V3h3z"})}),kt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"})}),$t=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M3.25 1A2.25 2.25 0 011 3.25v9.5A2.25 2.25 0 013.25 15h9.5A2.25 2.25 0 0115 12.75v-9.5A2.25 2.25 0 0012.75 1h-9.5zM2.5 3.25a.75.75 0 01.75-.75h9.5a.75.75 0 01.75.75v9.5a.75.75 0 01-.75.75h-9.5a.75.75 0 01-.75-.75v-9.5z"}),s.jsx("path",{d:"M8 4a.75.75 0 01.75.75v2.5h2.5a.75.75 0 010 1.5h-2.5v2.5a.75.75 0 01-1.5 0v-2.5h-2.5a.75.75 0 010-1.5h2.5v-2.5A.75.75 0 018 4z"})]}),St=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),s.jsx("circle",{cx:"7",cy:"8",r:"1",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"}),s.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:r==="currentColor"?"white":"#fff",opacity:"0.5"})]}),Nt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),s.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:r==="currentColor"?"white":"#fff"})]}),Mt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsxs("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:[s.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),s.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:r==="currentColor"?"white":"#fff",strokeWidth:"1"}),s.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:r,strokeWidth:"1.5"}),s.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round"})]}),Lt=({size:t=16,className:e="",color:r="currentColor"})=>s.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:r,className:e,children:s.jsx("path",{d:"M4.48 7.27c.26.26 1.28 1.33 1.28 1.33l.56-.58-.88-.91 1.69-1.8s-.76-.74-.43-.45c.32-1.19.03-2.51-.87-3.44C4.93.5 3.66.2 2.52.51l1.93 2-.51 1.96-1.89.52-1.93-2C-.19 4.17.1 5.48 1 6.4c.94.98 2.29 1.26 3.48.87zm6.44 1.94l-2.33 2.3 3.84 3.98c.31.33.73.49 1.14.49.41 0 .82-.16 1.14-.49.63-.65.63-1.7 0-2.35l-3.79-3.93zM16 2.53L13.55 0 6.33 7.46l.88.91-4.31 4.46-.99.53-1.39 2.27.35.37 2.2-1.44.51-1.02L7.9 9.08l.88.91L16 2.53z"})}),pe={commit:We,pr:Fe,issue:qe,comment:Ke,star:Ze,fork:Ge,merge:Ye,release:Je,deploy:Qe},ve={unfold:Xe,fold:et,close:tt,check:rt},ar={taichi:st,meditation:nt,yoga:at},ir={dumbbell:it,running:ot,heartrate:lt,strength:ct},or={server:dt,database:ut,cloud:ht,terminal:mt,bug:ft,code:pt},lr={rocket:vt,satellite:gt,alien:xt,planet:yt,telescope:bt},cr={chart:wt,meeting:jt,document:_t,calendar:It,briefcase:Ct},dr={gitbranch:kt,prdraft:$t,testing:St,deployment:Nt,review:Mt,build:Lt};function At(t,e=640){const[r,n]=o.useState(!1);return o.useEffect(()=>{const a=t?.current;if(!a)return;const f=()=>{const c=a.clientWidth;c>0&&n(c<e)};f();const l=new ResizeObserver(()=>{f()});return l.observe(a),()=>{l.disconnect()}},[t,e]),r}const Et=o.createContext({density:"comfortable",showMeta:!0}),Pt=({children:t,value:e})=>s.jsx(Et.Provider,{value:e,children:t});function Dt(){return o.useContext(Et)}const ur=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},hr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),l=Math.floor(f/60),c=Math.floor(l/24);return a<60?"just now":f<60?`${f}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},mr=({event:t,expanded:e=!1,onToggle:r,expandable:n,isChild:a=!1,showTimeline:f=!1,density:l,showMeta:c,renderIcon:j,className:k=""})=>{const $=Dt(),E=l??$.density,A=c??$.showMeta,d=n??!!t.description,w=()=>{d&&r&&r(t.id,!e)},i=x=>{d&&r&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),r(t.id,!e))},u=["uiforge-activity-item",`uiforge-activity-item--${E}`,a?"uiforge-activity-item--child":"",A?"":"uiforge-activity-item--hide-meta",k].filter(Boolean).join(" "),h=["uiforge-activity-item__header",d?"uiforge-activity-item__header--clickable":""].filter(Boolean).join(" ");return s.jsxs("div",{className:u,"data-event-id":t.id,"data-density":E,"data-show-meta":A,children:[f&&!a&&s.jsx("div",{className:"uiforge-activity-item__timeline-marker"}),s.jsx("div",{className:"uiforge-activity-item__icon",children:j?j(t):t.icon||ur(t.type)}),s.jsxs("div",{className:"uiforge-activity-item__content",children:[s.jsxs("div",{className:h,onClick:w,onKeyDown:i,role:d?"button":void 0,tabIndex:d?0:void 0,"aria-expanded":d?e:void 0,children:[s.jsx("div",{className:"uiforge-activity-item__title",children:t.title}),A&&s.jsx("div",{className:"uiforge-activity-item__timestamp",children:hr(t.timestamp)}),d&&s.jsx("div",{className:"uiforge-activity-item__toggle",children:e?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),e&&t.description&&A&&s.jsx("div",{className:"uiforge-activity-item__description",children:t.description})]})]})},Te=400,fr=t=>{const e=pe[t]||pe.commit;return s.jsx(e,{size:16})},$e=(t,e=2)=>{if(t.length===0)return[];const r=[];let n=[],a=null;return t.forEach((f,l)=>{a===f.type?n.push(f):(n.length>=e&&a?r.push(Be(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}),n=[f],a=f.type),l===t.length-1&&(n.length>=e&&a?r.push(Be(n,a)):n.forEach(c=>{r.push({id:c.id.toString(),type:c.type,count:1,title:c.title,timestamp:new Date(c.timestamp),icon:c.icon,events:[c]})}))}),r},Be=(t,e)=>{const r=t.reduce((l,c)=>{const j=c.metadata?.repository||"unknown";return l[j]||(l[j]=[]),l[j].push(c),l},{}),n=Object.entries(r),a=n.length>1;let f="";if(a)f=`Created ${t.length} ${Se(e)} in ${n.length} repositories`;else{const l=n[0][0];f=`Created ${t.length} ${Se(e)}${l!=="unknown"?` in ${l}`:""}`}return{id:`group-${e}-${t[0].id}`,type:e,count:t.length,title:f,timestamp:new Date(t[0].timestamp),icon:t[0].icon,events:t,children:a?n.map(([l,c])=>({id:`group-${e}-${l}`,type:e,count:c.length,title:`Created ${c.length} ${Se(e)} in ${l}`,timestamp:new Date(c[0].timestamp),icon:c[0].icon,events:c})):void 0}},Se=t=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[t]||`${t}s`,Ne=t=>{if(t.length===0)return[];const e=[];let r=null;return t.forEach((n,a)=>{if("type"in n&&n.type==="date-separator"){e.push(n);return}const l=n.timestamp,c=`${l.getFullYear()}-${l.getMonth()}`;if(c!==r){const j={id:`sep-${a}`,type:"date-separator",date:l,label:pr(l)};e.push(j),r=c}e.push(n)}),e},pr=t=>t.toLocaleDateString("en-US",{month:"long",year:"numeric"}),vr=t=>{const e=typeof t=="string"?new Date(t):t,n=new Date().getTime()-e.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),l=Math.floor(f/60),c=Math.floor(l/24);return a<60?"just now":f<60?`${f}m ago`:l<24?`${l}h ago`:c<30?`${c}d ago`:e.toLocaleDateString()},gr=({events:t,theme:e="light",className:r="",style:n,showLoadMore:a=!0,loading:f=!1,onLoadMore:l,pagination:c,maxHeight:j,showMoreThreshold:k=100,initiallyExpandedAll:$=!1,emptyMessage:E="No activity to display",onToggleExpand:A,enableGrouping:d=!0,groupingThreshold:w=2,showDateSeparators:i=!0,showTimeline:u=!0,scale:h,density:x="comfortable",responsive:S=!0,compactBreakpointPx:U=640,containerRef:C,showMeta:y,renderIcon:M,renderEvent:L,virtualization:O=!1,virtualItemHeight:R=48})=>{const[W,v]=o.useState(()=>{const g=new Set;return(d?i?Ne($e(t,w)):$e(t,w):t.map(z=>({id:z.id.toString(),type:z.type,count:1,title:z.title,timestamp:new Date(z.timestamp),icon:z.icon,events:[z]}))).forEach(z=>{if("events"in z&&z.type!=="date-separator"){const J=z;($||J.events.some(m=>m.initiallyExpanded))&&g.add(J.id),J.children&&J.children.forEach(m=>{($||m.events.some(D=>D.initiallyExpanded))&&g.add(m.id)})}}),g}),[N,_]=o.useState(!1),[b,re]=o.useState(Te),Y=o.useRef(null),te=C||Y,X=o.useRef(null),ne=o.useRef(null),se=At(S?te:null,U),T=o.useMemo(()=>S&&se&&x==="comfortable"?"compact":x,[S,se,x]),oe=o.useMemo(()=>y!==void 0?y:!0,[y]),Z=o.useMemo(()=>{if(!d){const P=t.map(z=>({id:z.id.toString(),type:z.type,count:1,title:z.title,timestamp:new Date(z.timestamp),icon:z.icon,events:[z]}));return i?Ne(P):P}const g=$e(t,w);return i?Ne(g):g},[t,d,w,i]),ee=o.useCallback(()=>{if(!X.current||!a||!l)return;const{scrollTop:g,scrollHeight:P,clientHeight:z}=X.current,J=P-g-z;_(J<=k)},[a,l,k]),le=o.useCallback(({scrollOffset:g})=>{if(!a||!l)return;const P=Z.length*R,z=b,J=P-g-z;_(J<=k)},[a,l,k,Z.length,R,b]);o.useEffect(()=>{if(!O||!Y.current)return;const g=()=>{const z=Y.current;if(z){let J=z.clientHeight||Te;if(j){const m=parseFloat(j);!isNaN(m)&&m>0&&(J=m)}re(J)}};g();const P=new ResizeObserver(g);return P.observe(Y.current),()=>{P.disconnect()}},[O,j]),o.useEffect(()=>{const g=X.current;if(g)return g.addEventListener("scroll",ee),ee(),()=>{g.removeEventListener("scroll",ee)}},[ee]);const I=o.useCallback((g,P)=>{v(z=>{const J=new Set(z),m=J.has(g);return m?J.delete(g):J.add(g),A?.(P,!m),J})},[A]),F=(g,P=!1)=>{const z=W.has(g.id),J=g.children&&g.children.length>0,m=g.count>1,D=g.count===1&&g.events[0]?.description,Q=m||J||D,G=g.count===1&&g.events.length===1?g.events[0].id:g.id;return L&&g.count===1&&g.events.length===1?s.jsxs("div",{className:`activity-stream__item ${P?"activity-stream__item--child":""}`,"data-event-id":g.id,children:[u&&!P&&s.jsx("div",{className:"activity-stream__timeline-marker"}),L(g.events[0])]},g.id):s.jsxs("div",{className:`activity-stream__item ${P?"activity-stream__item--child":""}`,"data-event-id":g.id,children:[u&&!P&&s.jsx("div",{className:"activity-stream__timeline-marker"}),s.jsx("div",{className:"activity-stream__icon",children:M&&g.events.length===1?M(g.events[0]):g.icon||fr(g.type)}),s.jsxs("div",{className:"activity-stream__content",children:[s.jsxs("div",{className:`activity-stream__header ${Q?"activity-stream__header--clickable":""}`,onClick:()=>Q&&I(g.id,G),onKeyDown:B=>{Q&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),I(g.id,G))},role:Q?"button":void 0,tabIndex:Q?0:void 0,"aria-expanded":Q?z:void 0,children:[s.jsx("div",{className:"activity-stream__title",children:g.title}),s.jsx("div",{className:"activity-stream__timestamp",children:vr(g.timestamp)}),Q&&s.jsx("div",{className:"activity-stream__toggle",children:z?s.jsx(ve.fold,{size:16}):s.jsx(ve.unfold,{size:16})})]}),z&&J&&g.children&&s.jsx("div",{className:"activity-stream__children",children:g.children.map(B=>F(B,!0))}),z&&!J&&g.events.length>1&&s.jsx("div",{className:"activity-stream__events-list",children:g.events.map(B=>L?s.jsx("div",{className:"activity-stream__event-item",children:L(B)},B.id):s.jsxs("div",{className:"activity-stream__event-item",children:[s.jsx("div",{className:"activity-stream__event-title",children:B.title}),B.description&&s.jsx("div",{className:"activity-stream__event-description",children:B.description})]},B.id))}),z&&g.count===1&&g.events[0].description&&s.jsx("div",{className:"activity-stream__description",children:g.events[0].description})]})]},g.id)},p=o.useCallback(g=>{if("type"in g&&g.type==="date-separator"){const P=g;return s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:P.label}),s.jsx("div",{className:"activity-stream__date-line"})]},P.id)}return F(g)},[W,u,M,L,I]),V=g=>s.jsxs("div",{className:"activity-stream__date-separator",children:[s.jsx("div",{className:"activity-stream__date-label",children:g.label}),s.jsx("div",{className:"activity-stream__date-line"})]},g.id),H=o.useCallback(({index:g,style:P})=>{const z=Z[g];return z?s.jsx("div",{style:P,className:"activity-stream__virtual-row",children:p(z)}):null},[Z,p]),K=c?.hasMore!==void 0?c.hasMore:c?.totalItems!==void 0?t.length<c.totalItems:!0,ae="activity-stream",q=`${ae}--${e}`,de=u?`${ae}--with-timeline`:"",he=`${ae}--${T}`;let ie=`${ae} ${q} ${de} ${he} ${r}`.trim();h!==void 0&&h<1&&(ie=`${ie} ${ae}--scale-compact`),h!==void 0&&h>1&&(ie=`${ie} ${ae}--scale-spacious`);const je=j?{maxHeight:j}:void 0,ge=h!==void 0?{"--activity-stream-scale":h}:{};return s.jsx(Pt,{value:{density:T,showMeta:oe},children:s.jsx("div",{ref:Y,className:`${ie}${O?" activity-stream--virtualized":""}`,"data-theme":e,"data-density":T,"data-show-meta":oe,"data-virtualized":O,style:n,children:O?s.jsxs("div",{className:"activity-stream__container activity-stream__container--virtualized",style:ge,children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:E}):s.jsx(nr,{ref:ne,className:"activity-stream__items activity-stream__items--virtualized",height:b,itemCount:Z.length,itemSize:R,width:"100%",onScroll:le,children:H}),f&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!f&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${N?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]}):s.jsxs("div",{ref:X,className:"activity-stream__container",style:{...je,...ge},children:[Z.length===0?s.jsx("div",{className:"activity-stream__empty",children:E}):s.jsx("div",{className:"activity-stream__items",children:Z.map(g=>"type"in g&&g.type==="date-separator"?V(g):F(g))}),f&&s.jsxs("div",{className:"activity-stream__loading",children:[s.jsx("div",{className:"activity-stream__spinner"}),s.jsx("span",{children:"Loading..."})]}),a&&!f&&K&&l&&s.jsx("div",{className:`activity-stream__load-more ${N?"activity-stream__load-more--visible":""}`,onClick:l,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})})},xr={name:"youtube",displayName:"YouTube",domains:["youtube.com","youtu.be","youtube-nocookie.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.replace("www.","")==="youtu.be"?e.pathname.slice(1).split("?")[0]:e.searchParams.has("v")?e.searchParams.get("v"):e.pathname.startsWith("/embed/")||e.pathname.startsWith("/v/")?e.pathname.split("/")[2]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&(r.set("loop","1"),r.set("playlist",t)),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n="https://www.youtube.com",a=r.toString();return`${n}/embed/${t}${a?`?${a}`:""}`}},yr={name:"vimeo",displayName:"Vimeo",domains:["vimeo.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="vimeo.com"&&r!=="player.vimeo.com")return null;if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2];const n=e.pathname.split("/").filter(Boolean);if(n.length>0){const a=n[0];if(/^\d+$/.test(a))return a}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("muted","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("t",`${e.startTime}s`),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://player.vimeo.com/video/${t}${n?`?${n}`:""}`}},br={name:"dailymotion",displayName:"Dailymotion",domains:["dailymotion.com","dai.ly"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="dai.ly")return e.pathname.slice(1).split("?")[0];if(r==="dailymotion.com"){if(e.pathname.startsWith("/video/"))return e.pathname.split("/")[2].split("_")[0];if(e.pathname.startsWith("/embed/video/"))return e.pathname.split("/")[3].split("?")[0]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1"),e.muted&&r.set("mute","1"),e.loop&&r.set("loop","1"),e.startTime&&r.set("start",String(e.startTime)),e.controls===!1&&r.set("controls","0");const n=r.toString();return`https://www.dailymotion.com/embed/video/${t}${n?`?${n}`:""}`}},wr={name:"twitch",displayName:"Twitch",domains:["twitch.tv","clips.twitch.tv"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")==="clips.twitch.tv")return`clip:${e.pathname.slice(1)}`;if(e.pathname.startsWith("/videos/"))return`video:${e.pathname.split("/")[2]}`;const n=e.pathname.match(/\/([^/]+)\/clip\/([^/?]+)/);return n?`clip:${n[2]}`:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";r.set("parent",n),e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const a=r.toString();return t.startsWith("video:")?`https://player.twitch.tv/?video=${t.slice(6)}&${a}`:t.startsWith("clip:")?`https://clips.twitch.tv/embed?clip=${t.slice(5)}&${a}`:""}},jr={name:"kick",displayName:"Kick",domains:["kick.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="kick.com")return null;const n=e.pathname.match(/\/video\/([a-zA-Z0-9-]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://player.kick.com/video/${t}`},_r={name:"rumble",displayName:"Rumble",domains:["rumble.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="rumble.com")return null;if(e.pathname.startsWith("/embed/"))return e.pathname.split("/")[2].split("?")[0];const n=e.pathname.match(/\/([a-z0-9]+)-/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","2");const n=r.toString();return`https://rumble.com/embed/${t}${n?`?${n}`:""}`}},Ir={name:"odysee",displayName:"Odysee",domains:["odysee.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="odysee.com")return null;const n=e.pathname.match(/\$\/embed\/(.+)/);if(n)return n[1];const a=e.pathname.slice(1);return a.startsWith("@")?a:null}catch{return null}},getEmbedUrl:t=>`https://odysee.com/$/embed/${t}`},Cr={name:"bitchute",displayName:"BitChute",domains:["bitchute.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="bitchute.com")return null;const n=e.pathname.match(/\/(video|embed)\/([a-zA-Z0-9]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.bitchute.com/embed/${t}/`},kr={name:"vk",displayName:"VK Video",domains:["vk.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="vk.com")return null;const n=e.searchParams.get("z");if(n&&n.startsWith("video"))return n.replace("video","");const a=e.pathname.match(/\/video(-?\d+_\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=t.split("_");if(n.length<2)return console.error("VK video ID must be in format OWNER_ID_VIDEO_ID"),"";const a=r.toString();return`https://vk.com/video_ext.php?oid=${n[0]}&id=${n[1]}${a?`&${a}`:""}`}},$r={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="bilibili.com"&&r!=="www.bilibili.com")return null;const n=e.pathname.match(/\/video\/((?:BV|av)[a-zA-Z0-9]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","1");const n=r.toString();return`https://player.bilibili.com/player.html?bvid=${t}${n?`&${n}`:""}`}},Sr={name:"niconico",displayName:"Niconico",domains:["nicovideo.jp"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="nicovideo.jp")return null;const n=e.pathname.match(/\/watch\/((?:sm|so|nm)\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.nicovideo.jp/watch/${t}`},Nr={name:"wistia",displayName:"Wistia",domains:["wistia.com","wi.st","wistia.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(e.pathname.includes("/medias/")){const n=e.pathname.match(/\/medias\/([a-zA-Z0-9]+)/);if(n)return n[1]}if(r.includes("wistia")&&e.pathname.includes("/iframe/")){const n=e.pathname.match(/\/iframe\/([a-zA-Z0-9]+)/);if(n)return n[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoPlay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://fast.wistia.net/embed/iframe/${t}${n?`?${n}`:""}`}},Mr={name:"brightcove",displayName:"Brightcove",domains:["brightcove.com","bcove.video"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("videoId");if(r){const n=e.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Brightcove video ID must be in format ACCOUNT_ID:VIDEO_ID"),"";const[r,...n]=e,a=n.join(":");return`https://players.brightcove.net/${r}/default_default/index.html?videoId=${a}`}},Lr={name:"kaltura",displayName:"Kaltura",domains:["kaltura.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.searchParams.get("entry_id")||e.searchParams.get("entryId");if(r){const n=e.pathname.match(/\/p\/(\d+)\//),a=e.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${r}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<3)return console.error("Kaltura video ID must be in format PARTNER_ID:UI_CONF_ID:ENTRY_ID"),"";const[r,n,a]=e;return`https://cdnapisec.kaltura.com/p/${r}/sp/${r}00/embedIframeJs/uiconf_id/${n}/partner_id/${r}?iframeembed=true&entry_id=${a}`}},Ar={name:"panopto",displayName:"Panopto",domains:["panopto.com"],tier:"professional",supportsAutoplay:!1,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname;if(r==="panopto.com"||r.endsWith(".panopto.com")){const a=e.searchParams.get("id");if(a)return`${r.split(".")[0]}:${a}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Panopto video ID must be in format SUBDOMAIN:SESSION_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}.panopto.com/Panopto/Pages/Embed.aspx?id=${a}&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&captions=false&interactivity=all`}},Er={name:"jwplayer",displayName:"JW Player",domains:["jwplayer.com","jwplatform.com","content.jwplatform.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const r=new URL(t).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return r?r[1]:null}catch{return null}},getEmbedUrl:t=>`https://content.jwplatform.com/players/${t}.html`},Pr={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname,n=r==="videodelivery.net"||r.endsWith(".videodelivery.net"),a=r==="cloudflarestream.com"||r.endsWith(".cloudflarestream.com");if(n||a){const f=e.pathname.match(/\/([a-zA-Z0-9]+)(?:\/|$)/);if(f)return f[1]}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true"),e.loop&&r.set("loop","true");const n=r.toString();return`https://iframe.videodelivery.net/${t}${n?`?${n}`:""}`}},Dr={name:"mux",displayName:"Mux",domains:["mux.com","stream.mux.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname==="stream.mux.com"){const n=e.pathname.slice(1).split(".")[0];if(n)return n}return null}catch{return null}},getEmbedUrl:(t,e={})=>{const r=new URLSearchParams;e.autoplay&&r.set("autoplay","true"),e.muted&&r.set("muted","true");const n=r.toString();return`https://stream.mux.com/${t}.m3u8${n?`?${n}`:""}`}},Ur={name:"aws-ivs",displayName:"AWS IVS",domains:["ivs.aws","amazonaws.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);return e.hostname.includes(".channel.ivs.aws")?e.hostname.split(".")[0]:null}catch{return null}},getEmbedUrl:t=>`https://${t}.channel.ivs.aws/stream.m3u8`},Or={name:"azure-media",displayName:"Azure Media Services",domains:["azure.net","azureedge.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.endsWith(".streaming.media.azure.net")){const r=e.pathname.split("/");if(r.length>=2)return`${e.hostname}:${r[1]}`}return null}catch{return null}},getEmbedUrl:t=>{const e=t.split(":");if(e.length<2)return console.error("Azure Media video ID must be in format HOSTNAME:ASSET_ID"),"";const[r,...n]=e,a=n.join(":");return`https://${r}/${a}/manifest`}},zr={name:"google-drive",displayName:"Google Drive",domains:["drive.google.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="drive.google.com")return null;const n=e.pathname.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(n)return n[1];const a=e.searchParams.get("id");return a||null}catch{return null}},getEmbedUrl:t=>`https://drive.google.com/file/d/${t}/preview`},Rr={name:"dropbox",displayName:"Dropbox",domains:["dropbox.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{return new URL(t).hostname.replace("www.","")!=="dropbox.com"?null:t}catch{return null}},getEmbedUrl:t=>{try{const e=new URL(t);return e.searchParams.delete("dl"),e.searchParams.set("raw","1"),e.toString()}catch{return t}}},Vr={name:"facebook",displayName:"Facebook Video",domains:["facebook.com","fb.watch"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r==="fb.watch")return e.pathname.slice(1);if(r==="facebook.com"){const n=e.searchParams.get("v");if(n)return n;const a=e.pathname.match(/\/videos\/(\d+)/);if(a)return a[1]}return null}catch{return null}},getEmbedUrl:t=>`https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D${t}`},Tr={name:"instagram",displayName:"Instagram",domains:["instagram.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="instagram.com")return null;const n=e.pathname.match(/\/(p|reel|tv)\/([a-zA-Z0-9_-]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:t=>`https://www.instagram.com/p/${t}/embed/`},Br={name:"twitter",displayName:"X (Twitter)",domains:["twitter.com","x.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t),r=e.hostname.replace("www.","");if(r!=="twitter.com"&&r!=="x.com")return null;const n=e.pathname.match(/\/status\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://platform.twitter.com/embed/Tweet.html?id=${t}`},Hr={name:"pornhub",displayName:"Pornhub",domains:["pornhub.com"],tier:"adult",supportsAutoplay:!0,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="pornhub.com")return null;const n=e.searchParams.get("viewkey");if(n)return n;const a=e.pathname.match(/\/embed\/([a-zA-Z0-9]+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.pornhub.com/embed/${t}`},Wr={name:"youporn",displayName:"YouPorn",domains:["youporn.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="youporn.com")return null;const n=e.pathname.match(/\/watch\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://www.youporn.com/embed/${t}`},Fr={name:"redtube",displayName:"Redtube",domains:["redtube.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="redtube.com")return null;const n=e.searchParams.get("id");if(n)return n;const a=e.pathname.match(/\/(\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:t=>`https://embed.redtube.com/?id=${t}`},qr={name:"xhamster",displayName:"XHamster",domains:["xhamster.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="xhamster.com")return null;const n=e.pathname.match(/\/videos\/[^/]+-(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://xhamster.com/xembed.php?video=${t}`},Kr={name:"spankbang",displayName:"SpankBang",domains:["spankbang.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:t=>{try{const e=new URL(t);if(e.hostname.replace("www.","")!=="spankbang.com")return null;const n=e.pathname.match(/\/([a-zA-Z0-9]+)\/video\//);return n?n[1]:null}catch{return null}},getEmbedUrl:t=>`https://spankbang.com/${t}/embed/`},Ae=[xr,yr,br,wr,jr,_r,Ir,Cr,kr,$r,Sr,Nr,Mr,Lr,Ar,Er,Pr,Dr,Ur,Or,zr,Rr,Vr,Tr,Br,Hr,Wr,Fr,qr,Kr],we=Ae.reduce((t,e)=>(t[e.name]=e,t),{});function Ee(t){if(!t)return null;try{const r=new URL(t).hostname.toLowerCase().replace("www.","");for(const n of Ae)for(const a of n.domains)if(r===a||r.endsWith(`.${a}`))return n;return null}catch{return null}}function Pe(t){const e=Ee(t);if(!e)return null;const r=e.extractVideoId(t);return r?{provider:e,videoId:r}:null}function Zr(t,e){const r=Pe(t);return r?r.provider.getEmbedUrl(r.videoId,e):null}function Gr(t){return Ee(t)?.tier==="adult"}const Yr=()=>s.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video__play-icon",children:[s.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),s.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),Jr=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",className:"uiforge-video-preview__icon",children:[s.jsx("path",{d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v10a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm2-1a1 1 0 00-1 1v10a1 1 0 001 1h12a1 1 0 001-1V5a1 1 0 00-1-1H4z"}),s.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),Qr=({title:t,description:e,url:r,youtubeId:n,vimeoId:a,provider:f,videoId:l,autoplay:c=!1,muted:j=!1,loop:k=!1,startTime:$,controls:E=!0,thumbnailUrl:A,onPlay:d,onError:w,onReady:i,className:u="",overlayIcon:h,aspectRatio:x="16:9",width:S,height:U,maxHeight:C,responsive:y=!1,hideHeader:M=!1,allowAdultContent:L=!1,fallback:O})=>{const[R,W]=o.useState(!1),[v,N]=o.useState(null),_=o.useRef(null),b=o.useMemo(()=>{if(f&&l){const F=we[f];if(F)return{provider:F,videoId:l,method:"explicit"}}if(r){const F=Pe(r);if(F)return{...F,method:"url"}}if(n){const F=we.youtube;if(F)return{provider:F,videoId:n,method:"legacy"}}if(a){const F=we.vimeo;if(F)return{provider:F,videoId:a,method:"legacy"}}return null},[r,f,l,n,a]),re=o.useMemo(()=>b?b.provider.tier==="adult":!1,[b]),Y=o.useMemo(()=>({autoplay:R?!0:c,muted:j,loop:k,startTime:$,controls:E}),[c,j,k,$,E,R]),te=o.useMemo(()=>{if(!b)return"";try{return b.provider.getEmbedUrl(b.videoId,Y)}catch(F){return console.error("Error generating embed URL:",F),""}},[b,Y]),X=o.useMemo(()=>{if(A)return A;if(b?.provider.name==="youtube")return`https://img.youtube.com/vi/${b.videoId}/maxresdefault.jpg`},[A,b]),ne=o.useCallback(()=>{b&&(W(!0),d&&d(b.videoId,b.provider.name),i&&i(b.videoId,b.provider.name))},[b,d,i]),se=o.useCallback(F=>{N(F),w&&b&&w(new Error(F),b.provider.name)},[w,b]);if(!b)return O?s.jsx(s.Fragment,{children:O}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(re&&!L){const F="Adult content must be explicitly enabled with allowAdultContent prop";return O?s.jsx(s.Fragment,{children:O}):(console.warn(`UIForgeVideo: ${F}`),s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:F})})}))}if(v)return O?s.jsx(s.Fragment,{children:O}):s.jsx("div",{className:"uiforge-video",children:s.jsx("div",{className:"uiforge-video__error",children:s.jsx("p",{children:v})})});const T="uiforge-video",oe=y?`${T}--responsive`:"",Z=`${T} ${oe} ${u}`.trim(),ee={aspectRatio:x!=="auto"?x.replace(":","/"):void 0,width:S?typeof S=="number"?`${S}px`:S:void 0,height:U?typeof U=="number"?`${U}px`:U:void 0,maxHeight:C?typeof C=="number"?`${C}px`:C:void 0},le=t||`${b.provider.displayName} Video`,I=!M&&(t||e);return s.jsxs("div",{className:Z,children:[I&&s.jsxs("div",{className:`${T}__header`,children:[t&&s.jsx("h3",{className:`${T}__title`,children:t}),e&&s.jsx("p",{className:`${T}__description`,children:e})]}),s.jsx("div",{className:`${T}__player-container`,style:ee,children:R?s.jsx("iframe",{ref:_,src:te,title:le,className:`${T}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onError:()=>se("Failed to load video")}):s.jsxs(s.Fragment,{children:[X&&s.jsx("img",{src:X,alt:le,className:`${T}__thumbnail`}),s.jsx("button",{className:`${T}__overlay`,onClick:ne,"aria-label":`Play video: ${le}`,type:"button",children:h||s.jsx(Yr,{})})]})})]})},Xr=({title:t,icon:e,className:r="",onClick:n})=>{const a="uiforge-video-preview",f=`${a} ${r}`.trim(),l=()=>{n&&n()},c=$=>{n&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),n())},j=n?"button":"div",k=n?{type:"button",onClick:l,onKeyDown:c}:{};return s.jsxs(j,{className:f,...k,children:[s.jsx("div",{className:`${a}__icon-container`,children:e||s.jsx(Jr,{})}),s.jsx("span",{className:`${a}__title`,children:t})]})},He=t=>{const e=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");return Array.from(t.querySelectorAll(e))},es=({id:t,variant:e="static",open:r=!0,onOpenChange:n,children:a,className:f="",ariaLabel:l="Sidebar navigation",width:c="280px",height:j="200px",position:k="left",showBackdrop:$=!0,closeOnBackdropClick:E=!0,closeOnEscape:A=!0,trapFocus:d=!0})=>{const w=o.useRef(null),i=o.useRef(null),u=e==="drawer"||e==="bottom",h=o.useCallback(()=>{E&&n&&n(!1)},[E,n]);o.useEffect(()=>{if(!u||!r||!A)return;const M=L=>{L.key==="Escape"&&(L.preventDefault(),n?.(!1))};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[u,r,A,n]),o.useEffect(()=>{if(!u||!r||!d)return;const M=w.current;if(!M)return;i.current=document.activeElement;const L=He(M);L.length>0?L[0].focus():M.focus();const O=R=>{if(R.key!=="Tab")return;const W=He(M);if(W.length===0)return;const v=W[0],N=W[W.length-1];R.shiftKey?document.activeElement===v&&(R.preventDefault(),N.focus()):document.activeElement===N&&(R.preventDefault(),v.focus())};return document.addEventListener("keydown",O),()=>{document.removeEventListener("keydown",O),i.current&&typeof i.current.focus=="function"&&i.current.focus()}},[u,r,d]),o.useEffect(()=>{if(!u||!r)return;const M=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=M}},[u,r]);const x="uiforge-sidebar",S=[x,`${x}--${e}`,`${x}--${k}`,u&&r&&`${x}--open`,u&&!r&&`${x}--closed`,f].filter(Boolean).join(" "),U={"--sidebar-width":c,"--sidebar-height":j},y=e==="static"?{role:"navigation","aria-label":l}:{role:"dialog","aria-modal":r,"aria-expanded":r,"aria-label":l,"aria-hidden":!r};return e==="static"?s.jsx("aside",{id:t,ref:w,className:S,style:U,...y,children:s.jsx("div",{className:`${x}__content`,children:a})}):s.jsxs(s.Fragment,{children:[$&&s.jsx("div",{className:`${x}__backdrop ${r?`${x}__backdrop--visible`:""}`,onClick:h,"aria-hidden":"true"}),s.jsx("aside",{id:t,ref:w,className:S,style:U,tabIndex:-1,...y,children:s.jsx("div",{className:`${x}__content`,children:a})})]})};function ts(t,e){const{sampleCount:r=3,min:n=3,max:a=15,approxItemHeight:f=120}=e??{},[l,c]=o.useState(n),j=o.useRef(n),k=o.useCallback(()=>{const $=t?.current;if(!$)return n;const E=$.clientHeight;if(E===0)return n;const A=Array.from($.children).filter(u=>u instanceof HTMLElement&&u.offsetHeight>0);let d=f;if(A.length>0){const u=Math.min(r,A.length);let h=0;for(let x=0;x<u;x++)h+=A[x].offsetHeight;d=h/u}const w=Math.floor(E/d);return Math.max(n,Math.min(a,w))},[t,r,n,a,f]);return o.useEffect(()=>{const $=t?.current;if(!$)return;const E=()=>{const w=k();w!==j.current&&(j.current=w,c(w))};E();let A;typeof ResizeObserver<"u"&&(A=new ResizeObserver(()=>{E()}),A.observe($));let d;return typeof MutationObserver<"u"&&(d=new MutationObserver(()=>{E()}),d.observe($,{childList:!0,subtree:!1})),()=>{A?.disconnect(),d?.disconnect()}},[t,k]),l}exports.ActivityIcons=pe;exports.ActivityItemProvider=Pt;exports.AlienIcon=xt;exports.BriefcaseIcon=Ct;exports.BugIcon=ft;exports.BuildIcon=Lt;exports.BusinessIcons=cr;exports.Button=Ut;exports.CalendarIcon=It;exports.ChartIcon=wt;exports.CheckIcon=rt;exports.CloseIcon=tt;exports.CloudIcon=ht;exports.CodeIcon=pt;exports.CommentIcon=Ke;exports.CommitIcon=We;exports.DatabaseIcon=ut;exports.DeployIcon=Qe;exports.DeploymentIcon=Nt;exports.DevProcessIcons=dr;exports.DocumentIcon=_t;exports.DumbbellIcon=it;exports.FitnessIcons=ir;exports.FoldIcon=et;exports.ForkIcon=Ge;exports.GitBranchIcon=kt;exports.HamburgerButton=Ot;exports.HeartRateIcon=lt;exports.IssueIcon=qe;exports.MeditationIcon=nt;exports.MeetingIcon=jt;exports.MergeIcon=Ye;exports.PlanetIcon=yt;exports.PullRequestDraftIcon=$t;exports.PullRequestIcon=Fe;exports.ReleaseIcon=Je;exports.ReviewIcon=Mt;exports.RocketIcon=vt;exports.RunningIcon=ot;exports.SatelliteIcon=gt;exports.ServerIcon=dt;exports.SpaceIcons=lr;exports.StarIcon=Ze;exports.StrengthIcon=ct;exports.TaiChiIcon=st;exports.TechIcons=or;exports.TelescopeIcon=bt;exports.TerminalIcon=mt;exports.TestingIcon=St;exports.UIForgeActivityItem=mr;exports.UIForgeActivityStream=gr;exports.UIForgeBlocksEditor=Vt;exports.UIForgeComboBox=Zt;exports.UIForgeGrid=zt;exports.UIForgeSidebar=es;exports.UIForgeVideo=Qr;exports.UIForgeVideoPreview=Xr;exports.UIIcons=ve;exports.UnfoldIcon=Xe;exports.WellnessIcons=ar;exports.YogaIcon=at;exports.blocksToHTML=Ft;exports.blocksToJSON=Kt;exports.blocksToMarkdown=qt;exports.detectProvider=Ee;exports.extractVideoId=Pe;exports.getEmbedUrlFromVideoUrl=Zr;exports.isAdultContent=Gr;exports.providersByName=we;exports.useActivityItemContext=Dt;exports.useDynamicPageCount=ts;exports.useResponsive=At;exports.videoProviders=Ae;