@appforgeapps/uiforge 0.5.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 r=require("react/jsx-runtime"),i=require("react"),ft=({variant:e="primary",size:t="medium",children:s,className:n="",...a})=>{const f="uiforge-button",m=`${f}--${e}`,x=`${f}--${t}`,j=`${f} ${m} ${x} ${n}`.trim();return r.jsx("button",{className:j,...a,children:s})},xt=({columns:e,data:t,selectable:s=!1,selectedRows:n,getRowKey:a=(G,Z)=>Z,onSelectionChange:f,onCellEdit:m,actionButtons:x=[],searchable:j=!1,searchPlaceholder:W="Search...",onSearch:A,customFilter:F,pagination:h,onPageChange:E,onPageSizeChange:M,pageSizeOptions:q=[10,25,50,100],className:B="",loading:L=!1,emptyMessage:R="No data available"})=>{const[G,Z]=i.useState(new Set),[I,U]=i.useState(""),[k,O]=i.useState(null),[P,c]=i.useState(""),v=n??G,d=i.useMemo(()=>!j||!I?t:t.filter(o=>F?F(o,I):Object.values(o).some(_=>_==null?!1:String(_).toLowerCase().includes(I.toLowerCase()))),[t,I,j,F]),b=i.useMemo(()=>{if(!h||h.serverSide)return d;const o=h.currentPage*h.pageSize,_=o+h.pageSize;return d.slice(o,_)},[d,h]),H=i.useMemo(()=>h?h.serverSide&&h.totalItems!==void 0?Math.ceil(h.totalItems/h.pageSize):Math.ceil(d.length/h.pageSize):1,[h,d.length]),D=i.useCallback(()=>t.filter((o,_)=>{const w=a(o,_);return v.has(w)}),[t,v,a]),X=i.useCallback(o=>{const _=new Set;o&&b.forEach(w=>{const $=t.indexOf(w),se=a(w,$);_.add(se)}),n===void 0&&Z(_),f?.(_,o?b:[])},[b,t,a,f,n]),ee=i.useCallback((o,_,w)=>{const $=new Set(v);w?$.add(o):$.delete(o),n===void 0&&Z($);const se=t.filter((N,oe)=>{const ie=a(N,oe);return $.has(ie)});f?.($,se)},[v,t,a,f,n]),J=i.useCallback(o=>{U(o),A?.(o)},[A]),z=i.useCallback((o,_,w)=>{O({rowKey:o,columnKey:_}),c(w)},[]),te=i.useCallback((o,_,w)=>{m?.(o,_,P,w),O(null),c("")},[P,m]),l=i.useCallback(()=>{O(null),c("")},[]),S=i.useCallback(o=>{h&&E?.(o,h.pageSize)},[h,E]),p=i.useCallback(o=>{M?.(o),h&&E?.(0,o)},[M,E,h]),C=i.useMemo(()=>b.length===0?!1:b.every(o=>{const _=t.indexOf(o),w=a(o,_);return v.has(w)}),[b,v,t,a]),K=i.useMemo(()=>b.length===0?!1:b.some(_=>{const w=t.indexOf(_),$=a(_,w);return v.has($)})&&!C,[b,v,C,t,a]),g="uiforge-grid";return r.jsxs("div",{className:`${g} ${B}`.trim(),children:[(j||x.length>0)&&r.jsxs("div",{className:`${g}__toolbar`,children:[j&&r.jsx("div",{className:`${g}__search`,children:r.jsx("input",{type:"text",className:`${g}__search-input`,placeholder:W,value:I,onChange:o=>J(o.target.value),"aria-label":"Search"})}),x.length>0&&r.jsx("div",{className:`${g}__actions`,children:x.map((o,_)=>{const w=o.disabled||o.requiresSelection&&v.size===0;return r.jsx("button",{className:`${g}__action-button ${g}__action-button--${o.variant||"primary"}`,onClick:()=>o.onClick(D()),disabled:w,children:o.label},_)})})]}),r.jsx("div",{className:`${g}__table-container`,children:r.jsxs("table",{className:`${g}__table`,role:"table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[s&&r.jsx("th",{className:`${g}__header-cell ${g}__header-cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:C,ref:o=>{o&&(o.indeterminate=K)},onChange:o=>X(o.target.checked),"aria-label":"Select all rows"})}),e.map(o=>r.jsx("th",{className:`${g}__header-cell`,style:{width:o.width},children:o.header},o.key))]})}),r.jsx("tbody",{children:L?r.jsx("tr",{children:r.jsx("td",{colSpan:e.length+(s?1:0),className:`${g}__loading-cell`,children:"Loading..."})}):b.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:e.length+(s?1:0),className:`${g}__empty-cell`,children:R})}):b.map((o,_)=>{const w=t.indexOf(o),$=a(o,w),se=v.has($);return r.jsxs("tr",{className:`${g}__row ${se?`${g}__row--selected`:""}`,children:[s&&r.jsx("td",{className:`${g}__cell ${g}__cell--checkbox`,children:r.jsx("input",{type:"checkbox",checked:se,onChange:N=>ee($,o,N.target.checked),"aria-label":`Select row ${_+1}`})}),e.map(N=>{const oe=N.field?o[N.field]:void 0,ie=k?.rowKey===$&&k?.columnKey===N.key;return r.jsx("td",{className:`${g}__cell`,children:ie?r.jsxs("div",{className:`${g}__edit-cell`,children:[r.jsx("input",{type:"text",className:`${g}__edit-input`,value:String(P??""),onChange:ne=>c(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"?te($,N.key,o):ne.key==="Escape"&&l()},autoFocus:!0,"aria-label":`Edit ${N.header}`}),r.jsx("button",{className:`${g}__edit-button ${g}__edit-button--save`,onClick:()=>te($,N.key,o),"aria-label":"Save",children:"✓"}),r.jsx("button",{className:`${g}__edit-button ${g}__edit-button--cancel`,onClick:l,"aria-label":"Cancel",children:"✕"})]}):r.jsx("div",{className:`${g}__cell-content ${N.editable?`${g}__cell-content--editable`:""}`,onClick:()=>{N.editable&&z($,N.key,oe)},onKeyDown:ne=>{N.editable&&(ne.key==="Enter"||ne.key===" ")&&z($,N.key,oe)},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(oe,o,w):String(oe??"")})},N.key)})]},$)})})]})}),h&&H>1&&r.jsxs("div",{className:`${g}__pagination`,children:[r.jsx("div",{className:`${g}__pagination-info`,children:h.serverSide&&h.totalItems!==void 0?r.jsxs(r.Fragment,{children:["Showing ",h.currentPage*h.pageSize+1," to"," ",Math.min((h.currentPage+1)*h.pageSize,h.totalItems)," ","of ",h.totalItems," items"]}):r.jsxs(r.Fragment,{children:["Showing ",h.currentPage*h.pageSize+1," to"," ",Math.min((h.currentPage+1)*h.pageSize,d.length)," ","of ",d.length," items"]})}),r.jsxs("div",{className:`${g}__pagination-controls`,children:[r.jsx("button",{className:`${g}__pagination-button`,onClick:()=>S(h.currentPage-1),disabled:h.currentPage===0,"aria-label":"Previous page",children:"‹"}),Array.from({length:H},(o,_)=>_).map(o=>o===0||o===H-1||Math.abs(o-h.currentPage)<=1?r.jsx("button",{className:`${g}__pagination-button ${o===h.currentPage?`${g}__pagination-button--active`:""}`,onClick:()=>S(o),"aria-label":`Page ${o+1}`,"aria-current":o===h.currentPage?"page":void 0,children:o+1},o):o===h.currentPage-2||o===h.currentPage+2?r.jsx("span",{className:`${g}__pagination-ellipsis`,children:"..."},o):null),r.jsx("button",{className:`${g}__pagination-button`,onClick:()=>S(h.currentPage+1),disabled:h.currentPage>=H-1,"aria-label":"Next page",children:"›"})]}),r.jsxs("div",{className:`${g}__page-size`,children:[r.jsx("label",{htmlFor:"page-size-select",children:"Items per page:"}),r.jsx("select",{id:"page-size-select",className:`${g}__page-size-select`,value:h.pageSize,onChange:o=>p(Number(o.target.value)),children:q.map(o=>r.jsx("option",{value:o,children:o},o))})]})]})]})},gt=()=>`block-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,ue=(e="paragraph")=>({id:gt(),type:e,content:"",format:{}}),vt=({initialBlocks:e=[],onChange:t,placeholder:s="Start typing...",readOnly:n=!1,className:a="",maxHeight:f})=>{const[m,x]=i.useState(e.length>0?e:[ue()]),[j,W]=i.useState(null),[A,F]=i.useState(null),[h,E]=i.useState(!1),M=i.useRef(null);i.useEffect(()=>{t&&t(m)},[m,t]);const q=i.useCallback((c,v)=>{x(d=>d.map(b=>b.id===c?{...b,...v}:b))},[]),B=i.useCallback((c="paragraph",v)=>{const d=ue(c);x(b=>{if(!v)return[...b,d];const H=b.findIndex(X=>X.id===v),D=[...b];return D.splice(H+1,0,d),D}),W(d.id)},[]),L=i.useCallback(c=>{x(v=>{const d=v.filter(b=>b.id!==c);return d.length>0?d:[ue()]})},[]),R=i.useCallback((c,v)=>{x(d=>{const b=d.findIndex(ee=>ee.id===c),H=d.findIndex(ee=>ee.id===v);if(b===-1||H===-1)return d;const D=[...d],[X]=D.splice(b,1);return D.splice(H,0,X),D})},[]),G=i.useCallback((c,v)=>{n||(F(v),c.dataTransfer.effectAllowed="move")},[n]),Z=i.useCallback(c=>{c.preventDefault(),c.dataTransfer.dropEffect="move"},[]),I=i.useCallback((c,v)=>{c.preventDefault(),A&&A!==v&&R(A,v),F(null)},[A,R]),U=i.useCallback(()=>{F(null)},[]),k=i.useCallback(c=>{j&&x(v=>v.map(d=>{if(d.id===j){const b=d.format||{};return{...d,format:{...b,[c]:!b[c]}}}return d}))},[j]),O=i.useCallback((c,v)=>{q(c,{type:v})},[q]),P=i.useCallback((c,v)=>{if(!n){if((c.metaKey||c.ctrlKey)&&c.key==="b")c.preventDefault(),k("bold");else if((c.metaKey||c.ctrlKey)&&c.key==="i")c.preventDefault(),k("italic");else if((c.metaKey||c.ctrlKey)&&c.key==="u")c.preventDefault(),k("underline");else if(c.key==="Enter"&&!c.shiftKey){const d=m.find(b=>b.id===v);d&&d.type!=="code"&&(c.preventDefault(),B("paragraph",v))}else if(c.key==="Backspace"){const d=m.find(b=>b.id===v);d&&!d.content&&m.length>1&&(c.preventDefault(),L(v))}}},[n,m,k,B,L]);return r.jsxs("div",{className:`uiforge-blocks-editor ${a}`,ref:M,style:{maxHeight:f},children:[!n&&h&&j&&r.jsx(bt,{selectedBlock:m.find(c=>c.id===j),onFormatToggle:k,onBlockTypeChange:c=>O(j,c)}),r.jsx("div",{className:"uiforge-blocks-editor__content",children:m.map((c,v)=>r.jsx(yt,{block:c,isSelected:j===c.id,isDragging:A===c.id,readOnly:n,placeholder:v===0&&m.length===1?s:void 0,onSelect:()=>{W(c.id),E(!0)},onChange:d=>q(c.id,d),onDelete:()=>L(c.id),onDragStart:d=>G(d,c.id),onDragOver:Z,onDrop:d=>I(d,c.id),onDragEnd:U,onKeyDown:d=>P(d,c.id)},c.id))}),!n&&r.jsx(wt,{onAddBlock:B})]})},bt=({selectedBlock:e,onFormatToggle:t,onBlockTypeChange:s})=>{if(!e)return null;const n=e.format||{};return r.jsxs("div",{className:"uiforge-blocks-editor__toolbar",role:"toolbar","aria-label":"Text formatting",children:[r.jsx("div",{className:"uiforge-blocks-editor__toolbar-group",children:r.jsxs("select",{value:e.type,onChange:a=>s(a.target.value),className:"uiforge-blocks-editor__toolbar-select","aria-label":"Block type",children:[r.jsx("option",{value:"paragraph",children:"Paragraph"}),r.jsx("option",{value:"heading1",children:"Heading 1"}),r.jsx("option",{value:"heading2",children:"Heading 2"}),r.jsx("option",{value:"heading3",children:"Heading 3"}),r.jsx("option",{value:"list",children:"List"}),r.jsx("option",{value:"quote",children:"Quote"}),r.jsx("option",{value:"code",children:"Code"}),r.jsx("option",{value:"image",children:"Image"})]})}),r.jsx("div",{className:"uiforge-blocks-editor__toolbar-divider"}),r.jsxs("div",{className:"uiforge-blocks-editor__toolbar-group",children:[r.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.bold?"active":""}`,onClick:()=>t("bold"),title:"Bold (Ctrl+B)","aria-label":"Bold","aria-pressed":n.bold,children:r.jsx("strong",{children:"B"})}),r.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.italic?"active":""}`,onClick:()=>t("italic"),title:"Italic (Ctrl+I)","aria-label":"Italic","aria-pressed":n.italic,children:r.jsx("em",{children:"I"})}),r.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.underline?"active":""}`,onClick:()=>t("underline"),title:"Underline (Ctrl+U)","aria-label":"Underline","aria-pressed":n.underline,children:r.jsx("u",{children:"U"})}),r.jsx("button",{type:"button",className:`uiforge-blocks-editor__toolbar-button ${n.code?"active":""}`,onClick:()=>t("code"),title:"Inline Code","aria-label":"Code","aria-pressed":n.code,children:"</>"})]})]})},yt=({block:e,isSelected:t,isDragging:s,readOnly:n,placeholder:a,onSelect:f,onChange:m,onDelete:x,onDragStart:j,onDragOver:W,onDrop:A,onDragEnd:F,onKeyDown:h})=>{const E=["uiforge-blocks-editor__block",`uiforge-blocks-editor__block--${e.type}`,t?"uiforge-blocks-editor__block--selected":"",s?"uiforge-blocks-editor__block--dragging":""].filter(Boolean).join(" "),M=["uiforge-blocks-editor__block-text",e.format?.bold?"uiforge-blocks-editor__block-text--bold":"",e.format?.italic?"uiforge-blocks-editor__block-text--italic":"",e.format?.underline?"uiforge-blocks-editor__block-text--underline":"",e.format?.code?"uiforge-blocks-editor__block-text--code":""].filter(Boolean).join(" "),q=L=>{m({content:L.target.value})},B=()=>{const L={value:e.content,onChange:q,onFocus:f,onKeyDown:h,placeholder:a,readOnly:n,className:M};switch(e.type){case"heading1":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading1`,placeholder:a||"Heading 1"});case"heading2":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading2`,placeholder:a||"Heading 2"});case"heading3":return r.jsx("input",{...L,type:"text",className:`${M} uiforge-blocks-editor__heading3`,placeholder:a||"Heading 3"});case"code":return r.jsx("textarea",{...L,className:`${M} uiforge-blocks-editor__code`,placeholder:a||"Code block",rows:4});case"quote":return r.jsx("textarea",{...L,className:`${M} uiforge-blocks-editor__quote`,placeholder:a||"Quote",rows:2});case"image":return r.jsxs("div",{className:"uiforge-blocks-editor__image-block",children:[r.jsx("input",{type:"text",value:e.imageUrl||"",onChange:R=>m({imageUrl:R.target.value}),placeholder:"Image URL",className:"uiforge-blocks-editor__image-url",readOnly:n}),r.jsx("input",{type:"text",value:e.imageAlt||"",onChange:R=>m({imageAlt:R.target.value}),placeholder:"Alt text",className:"uiforge-blocks-editor__image-alt",readOnly:n}),e.imageUrl&&r.jsx("img",{src:e.imageUrl,alt:e.imageAlt||"Block image",className:"uiforge-blocks-editor__image-preview"})]});default:return r.jsx("textarea",{...L,className:`${M} uiforge-blocks-editor__paragraph`,placeholder:a||"Start typing...",rows:1,style:{minHeight:"1.5em"}})}};return r.jsxs("div",{className:E,draggable:!n,onDragStart:j,onDragOver:W,onDrop:A,onDragEnd:F,"data-block-id":e.id,children:[!n&&r.jsxs("div",{className:"uiforge-blocks-editor__block-controls",children:[r.jsx("button",{type:"button",className:"uiforge-blocks-editor__drag-handle",title:"Drag to reorder","aria-label":"Drag to reorder",children:"⋮⋮"}),r.jsx("button",{type:"button",className:"uiforge-blocks-editor__delete-button",onClick:x,title:"Delete block","aria-label":"Delete block",children:"×"})]}),r.jsx("div",{className:"uiforge-blocks-editor__block-content",children:B()})]})},wt=({onAddBlock:e})=>{const[t,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 r.jsxs("div",{className:"uiforge-blocks-editor__block-menu",children:[r.jsx("button",{type:"button",className:"uiforge-blocks-editor__add-button",onClick:()=>s(!t),"aria-label":"Add block","aria-expanded":t,children:"+ Add Block"}),t&&r.jsx("div",{className:"uiforge-blocks-editor__block-menu-dropdown",children:n.map(({type:a,label:f,icon:m})=>r.jsxs("button",{type:"button",className:"uiforge-blocks-editor__block-menu-item",onClick:()=>{e(a),s(!1)},children:[r.jsx("span",{className:"uiforge-blocks-editor__block-menu-icon",children:m}),r.jsx("span",{children:f})]},a))})]})};function he(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function jt(e){const t=e.trim(),s=["javascript:","data:","vbscript:","file:"],n=t.toLowerCase();for(const a of s)if(n.startsWith(a))return"";return t}function _t(e){return e.map(t=>{let s=he(t.content);switch(t.format?.bold&&(s=`<strong>${s}</strong>`),t.format?.italic&&(s=`<em>${s}</em>`),t.format?.underline&&(s=`<u>${s}</u>`),t.format?.code&&(s=`<code>${s}</code>`),t.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(t.content)}</code></pre>`;case"image":{const n=jt(t.imageUrl||""),a=he(t.imageAlt||"");return n?`<img src="${n}" alt="${a}" />`:""}case"list":return`<ul><li>${s}</li></ul>`;default:return`<p>${s}</p>`}}).join(`
2
- `)}function It(e){return e.map(t=>{let s=t.content;switch(t.format?.bold&&(s=`**${s}**`),t.format?.italic&&(s=`*${s}*`),t.format?.code&&(s=`\`${s}\``),t.type){case"heading1":return`# ${s}`;case"heading2":return`## ${s}`;case"heading3":return`### ${s}`;case"quote":return`> ${s}`;case"code":return`\`\`\`
3
- ${t.content}
4
- \`\`\``;case"image":return`![${t.imageAlt||""}](${t.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 kt(e){return JSON.stringify(e,null,2)}const $t=({options:e=[],value:t,onChange:s,onSearch:n,placeholder:a="Select an option...",disabled:f=!1,clearable:m=!1,className:x="",renderOption:j,renderValue:W,loading:A=!1,maxHeight:F="300px",debounceMs:h=300,searchable:E=!0,noOptionsMessage:M="No options found",ariaLabel:q,enableCache:B=!1,cacheTTL:L,refreshOnOpen:R=!1,onClearCache:G,onForceRefresh:Z})=>{const[I,U]=i.useState(!1),[k,O]=i.useState(""),[P,c]=i.useState([]),[v,d]=i.useState(0),[b,H]=i.useState(!1),D=i.useRef(null),X=i.useRef(null),ee=i.useRef(null),J=i.useRef(null),z=i.useRef(null),te=i.useRef(n),l=i.useRef(null),S=i.useRef(!1),p=i.useRef(new Map),C=i.useRef(B),K=i.useRef(L),g=i.useCallback((u,y=0)=>u.reduce((Q,V)=>{const Y={...V,level:y};return Q.push(Y),V.children&&V.children.length>0&&Q.push(...g(V.children,y+1)),Q},[]),[]),o=u=>typeof u=="string"&&(u.startsWith("http://")||u.startsWith("https://")||u.startsWith("data:")||u.startsWith("/")),_=i.useMemo(()=>g(P.length>0?P:e).find(y=>y.value===t)||null,[t,e,P,g]),w=i.useCallback((u,y)=>{if(!y.trim())return u;const Q=y.toLowerCase(),V=Y=>Y.reduce((re,ae)=>{const ce=ae.label.toLowerCase().includes(Q),le=ae.children?V(ae.children):[];return(ce||le.length>0)&&re.push({...ae,children:le.length>0?le:ae.children}),re},[]);return V(u)},[]);i.useEffect(()=>{te.current=n,z.current=null},[n]),i.useEffect(()=>{C.current=B},[B]),i.useEffect(()=>{K.current=L},[L]),i.useEffect(()=>{G&&G(()=>{p.current.clear()}),Z&&Z(()=>{if(!te.current)return;l.current&&l.current.abort(),l.current=new AbortController;const u=l.current.signal;H(!0),(async()=>{try{const y=Date.now(),Q=k,V=p.current.get(Q),Y=V&&(!K.current||y-V.timestamp<K.current);let re;C.current&&Y?re=V.data:(re=await(te.current?te.current(k,u):n?.(k,u)??[]),!u.aborted&&C.current&&p.current.set(Q,{data:re,timestamp:y})),u.aborted||(c(re),z.current=k)}catch(y){console.error(y),c([])}finally{H(!1)}})()})},[G,Z,k,n]),i.useEffect(()=>{if(n&&I){const u=z.current===k,y=!S.current&&I;return u&&!(R&&y)?void 0:(J.current&&clearTimeout(J.current),J.current=setTimeout(async()=>{l.current&&l.current.abort(),l.current=new AbortController;const V=l.current.signal;H(!0);try{let Y;const re=k,ae=p.current.get(re),ce=Date.now(),le=ae&&(!K.current||ce-ae.timestamp<K.current);if(C.current&&le?Y=ae.data:(Y=await(te.current?te.current(k,V):n(k,V)),!V.aborted&&C.current&&p.current.set(re,{data:Y,timestamp:ce})),V.aborted)return;c(Y),z.current=k}catch(Y){console.error("Error fetching options:",Y),c([])}finally{H(!1)}},h),()=>{J.current&&clearTimeout(J.current),l.current&&(l.current.abort(),l.current=null)})}else n||c(w(e,k));S.current=I},[k,I,e,h,w,R,n]),i.useEffect(()=>{n||c(e)},[e,n]),i.useEffect(()=>{const u=y=>{D.current&&!D.current.contains(y.target)&&(U(!1),O(""))};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const $=i.useMemo(()=>g(P.length>0?P:e).filter(y=>!y.disabled),[P,e,g]),se=i.useMemo(()=>g(P.length>0?P:e),[P,e,g]),N=i.useMemo(()=>{const u=new Map;return se.forEach(y=>{const Q=JSON.stringify({value:y.value,label:y.label}),V=$.findIndex(Y=>Y.value===y.value&&Y.label===y.label);u.set(Q,V)}),u},[se,$]),oe=u=>{if(!f)switch(u.key){case"ArrowDown":u.preventDefault(),I?d(y=>y<$.length-1?y+1:0):U(!0);break;case"ArrowUp":u.preventDefault(),I&&d(y=>y>0?y-1:$.length-1);break;case"Enter":u.preventDefault(),I&&$[v]?ie($[v]):U(!I);break;case"Escape":u.preventDefault(),U(!1),O("");break;case"Tab":I&&(U(!1),O(""));break}};i.useEffect(()=>{if(I&&ee.current){const u=ee.current.querySelector(`[data-index="${v}"]`);u&&typeof u.scrollIntoView=="function"&&u.scrollIntoView({block:"nearest"})}},[v,I]);const ie=u=>{u.disabled||(s?.(u.value,u),U(!1),O(""),d(0))},ne=u=>{u.stopPropagation(),s?.(null,null),O("")},dt=()=>{f||U(u=>{const y=!u;return y&&setTimeout(()=>X.current?.focus(),0),y})};i.useEffect(()=>{I||(z.current=null)},[I]);const ut=u=>{O(u.target.value),I||U(!0),d(0)},ht=u=>{const y=(u.level||0)*20;return r.jsxs("div",{className:"uiforge-combobox-option-content",style:{paddingLeft:`${y}px`},children:[u.icon&&r.jsx("span",{className:"uiforge-combobox-option-icon",children:o(u.icon)?r.jsx("img",{src:u.icon,alt:"",className:"uiforge-combobox-option-icon-img"}):u.icon}),r.jsx("span",{className:"uiforge-combobox-option-label",children:u.label})]})},mt=u=>u?r.jsxs("div",{className:"uiforge-combobox-value-content",children:[u.icon&&r.jsx("span",{className:"uiforge-combobox-value-icon",children:o(u.icon)?r.jsx("img",{src:u.icon,alt:"",className:"uiforge-combobox-value-icon-img"}):u.icon}),r.jsx("span",{className:"uiforge-combobox-value-label",children:u.label})]}):a,T="uiforge-combobox",pt=[T,I&&`${T}--open`,f&&`${T}--disabled`,x].filter(Boolean).join(" ");return r.jsxs("div",{ref:D,className:pt,onKeyDown:oe,role:"combobox","aria-expanded":I,"aria-haspopup":"listbox","aria-label":q,"aria-disabled":f,tabIndex:f?-1:0,children:[r.jsxs("div",{className:`${T}-control`,onClick:dt,children:[E&&I?r.jsx("input",{ref:X,type:"text",className:`${T}-input`,value:k,onChange:ut,placeholder:a,disabled:f,"aria-autocomplete":"list","aria-controls":`${T}-listbox`}):r.jsx("div",{className:`${T}-value`,children:W?W(_):mt(_)}),r.jsxs("div",{className:`${T}-indicators`,children:[m&&t!==null&&t!==void 0&&!f&&r.jsx("button",{type:"button",className:`${T}-clear`,onClick:ne,"aria-label":"Clear selection",tabIndex:-1,children:"×"}),r.jsx("span",{className:`${T}-arrow`,children:"▼"})]})]}),I&&r.jsx("div",{ref:ee,className:`${T}-dropdown`,style:{maxHeight:F},role:"listbox",id:`${T}-listbox`,children:A||b?r.jsx("div",{className:`${T}-loading`,children:"Loading..."}):$.length===0?r.jsx("div",{className:`${T}-no-options`,children:M}):se.map(u=>{const y=JSON.stringify({value:u.value,label:u.label}),Q=N.get(y)??-1,V=u.value===t,Y=Q===v,re=[`${T}-option`,V&&`${T}-option--selected`,Y&&`${T}-option--highlighted`,u.disabled&&`${T}-option--disabled`].filter(Boolean).join(" ");return r.jsx("div",{className:re,onClick:()=>ie(u),role:"option","aria-selected":V,"aria-disabled":u.disabled,"data-index":Q,children:j?j(u):ht(u)},y)})})]})},je=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),_e=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Ie=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("path",{d:"M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"}),r.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:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Ce=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Ne=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Me=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Le=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Se=({size:e=20,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:[r.jsx("path",{d:"M10 2L6 6M10 2L14 6M10 2V7.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),r.jsx("path",{d:"M10 18L6 14M10 18L14 14M10 18V12.5",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ae=({size:e=20,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 20 20",fill:"none",className:t,children:[r.jsx("path",{d:"M10 7.5L6 4M10 7.5L14 4M10 7.5V2",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("path",{d:"M3 10H17",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"1 2"}),r.jsx("path",{d:"M10 12.5L6 16M10 12.5L14 16M10 12.5V18",stroke:s,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ue=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Pe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Ve=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:s,strokeWidth:"1.5"}),r.jsx("path",{d:"M8 1C11.866 1 15 4.134 15 8C15 11.866 11.866 15 8 15",fill:s}),r.jsx("circle",{cx:"8",cy:"5",r:"2",fill:s==="currentColor"?"white":"#fff"}),r.jsx("circle",{cx:"8",cy:"11",r:"2",fill:s}),r.jsx("circle",{cx:"8",cy:"5",r:"0.5",fill:s}),r.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:s==="currentColor"?"white":"#fff"})]}),De=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),r.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"}),r.jsx("path",{d:"M4 9L2 10M12 9L14 10",strokeWidth:"1",stroke:s,fill:"none"})]}),Ee=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("circle",{cx:"8",cy:"2.5",r:"1.5"}),r.jsx("path",{d:"M8 4.5L6 8L4 14H6L7 10H9L10 14H12L10 8L8 4.5Z"}),r.jsx("path",{d:"M6 8L3 6M10 8L13 6",strokeWidth:"1.5",stroke:s,fill:"none"})]}),Be=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("rect",{x:"1",y:"6",width:"2",height:"4",rx:"0.5"}),r.jsx("rect",{x:"13",y:"6",width:"2",height:"4",rx:"0.5"}),r.jsx("rect",{x:"3",y:"5.5",width:"1",height:"5"}),r.jsx("rect",{x:"12",y:"5.5",width:"1",height:"5"}),r.jsx("rect",{x:"4",y:"7",width:"8",height:"2",rx:"0.5"})]}),Re=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("circle",{cx:"10",cy:"2.5",r:"1.5"}),r.jsx("path",{d:"M9 4.5L8 6L6 7L4 8L6 9L8 8L10 7L11 9L10 12L9 14H11L12 11L13 9L12 6L10 4.5H9Z"}),r.jsx("path",{d:"M6 14H4L5 11"})]}),Oe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",className:t,children:r.jsx("path",{d:"M2 8H5L6.5 5L8 11L9.5 8H14",stroke:s,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),He=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.jsx("circle",{cx:"7",cy:"3",r:"1.5"})]}),ze=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("rect",{x:"2",y:"2",width:"12",height:"3",rx:"0.5"}),r.jsx("rect",{x:"2",y:"6.5",width:"12",height:"3",rx:"0.5"}),r.jsx("rect",{x:"2",y:"11",width:"12",height:"3",rx:"0.5"}),r.jsx("circle",{cx:"4",cy:"3.5",r:"0.5"}),r.jsx("circle",{cx:"4",cy:"8",r:"0.5"}),r.jsx("circle",{cx:"4",cy:"12.5",r:"0.5"})]}),Te=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("ellipse",{cx:"8",cy:"3",rx:"5",ry:"2"}),r.jsx("path",{d:"M3 3V13C3 14.1 5.2 15 8 15C10.8 15 13 14.1 13 13V3"}),r.jsx("path",{d:"M3 8C3 9.1 5.2 10 8 10C10.8 10 13 9.1 13 8"})]}),We=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Fe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.jsx("path",{d:"M3 5.5L6 8L3 10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),r.jsx("line",{x1:"8",y1:"10.5",x2:"12",y2:"10.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),qe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("path",{d:"M4.75 7.5a3.25 3.25 0 116.5 0v3.75a3.25 3.25 0 01-6.5 0V7.5z"}),r.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"}),r.jsx("ellipse",{cx:"8",cy:"4",rx:"2.5",ry:"1.5"})]}),Ze=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),Ke=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.jsx("path",{d:"M2 12C2 12 0 14 0 16C2 16 4 14 4 14"})]}),Ye=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"0.5"}),r.jsx("path",{d:"M4 4L2 2M4 12L2 14M12 4L14 2M12 12L14 14",strokeWidth:"1.5",stroke:s,strokeLinecap:"round"}),r.jsx("rect",{x:"1",y:"1",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"13.5",y:"1",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"1",y:"13.5",width:"1.5",height:"1.5"}),r.jsx("rect",{x:"13.5",y:"13.5",width:"1.5",height:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1"})]}),Ge=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.jsx("ellipse",{cx:"6",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),r.jsx("ellipse",{cx:"10",cy:"5.5",rx:"1.5",ry:"2",fill:"white"}),r.jsx("circle",{cx:"6",cy:"5.5",r:"0.75",fill:s}),r.jsx("circle",{cx:"10",cy:"5.5",r:"0.75",fill:s})]}),Je=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("circle",{cx:"8",cy:"8",r:"5"}),r.jsx("ellipse",{cx:"8",cy:"8",rx:"8",ry:"2.5",fill:"none",stroke:s,strokeWidth:"1",opacity:"0.6"}),r.jsx("circle",{cx:"6",cy:"6",r:"1",opacity:"0.4",fill:s==="currentColor"?"white":"#fff"})]}),Qe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("path",{d:"M1 8L6 6L14 2L12 10L10 8L8 14H6L8 8L1 8Z"}),r.jsx("path",{d:"M10 8L12 10",strokeWidth:"1.5",stroke:s})]}),Xe=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),et=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("circle",{cx:"5",cy:"4",r:"2"}),r.jsx("circle",{cx:"11",cy:"4",r:"2"}),r.jsx("path",{d:"M1 14V12C1 10.5 2.5 9 5 9C7.5 9 9 10.5 9 12V14H1Z"}),r.jsx("path",{d:"M7 14V12C7 10.5 8.5 9 11 9C13.5 9 15 10.5 15 12V14H7Z"})]}),tt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.jsx("path",{d:"M10 0v3.5c0 .275.225.5.5.5H14",fill:s==="currentColor"?"white":"#fff"})]}),rt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),st=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),nt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),at=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.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"}),r.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"})]}),ot=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("path",{d:"M6 1h4v1H6V1zM5.5 3h5L13 13c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2L5.5 3z"}),r.jsx("circle",{cx:"7",cy:"8",r:"1",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"}),r.jsx("circle",{cx:"9",cy:"10",r:"0.75",fill:s==="currentColor"?"white":"#fff",opacity:"0.5"})]}),it=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("path",{d:"M8 0L0 3v5c0 5 3 7.5 8 8 5-.5 8-3 8-8V3L8 0z"}),r.jsx("path",{d:"M7 10L4.5 7.5l1-1L7 8l3.5-3.5 1 1L7 10z",fill:s==="currentColor"?"white":"#fff"})]}),lt=({size:e=16,className:t="",color:s="currentColor"})=>r.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:[r.jsx("rect",{x:"1",y:"1",width:"9",height:"11",rx:"1"}),r.jsx("line",{x1:"3",y1:"4",x2:"7",y2:"4",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),r.jsx("line",{x1:"3",y1:"6.5",x2:"7",y2:"6.5",stroke:s==="currentColor"?"white":"#fff",strokeWidth:"1"}),r.jsx("circle",{cx:"11",cy:"11",r:"3",fill:"none",stroke:s,strokeWidth:"1.5"}),r.jsx("line",{x1:"13",y1:"13",x2:"15.5",y2:"15.5",stroke:s,strokeWidth:"1.5",strokeLinecap:"round"})]}),ct=({size:e=16,className:t="",color:s="currentColor"})=>r.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:s,className:t,children:r.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"})}),xe={commit:je,pr:_e,issue:Ie,comment:ke,star:$e,fork:Ce,merge:Ne,release:Me,deploy:Le},ge={unfold:Se,fold:Ae,close:Ue,check:Pe},Ct={taichi:Ve,meditation:De,yoga:Ee},Nt={dumbbell:Be,running:Re,heartrate:Oe,strength:He},Mt={server:ze,database:Te,cloud:We,terminal:Fe,bug:qe,code:Ze},Lt={rocket:Ke,satellite:Ye,alien:Ge,planet:Je,telescope:Qe},St={chart:Xe,meeting:et,document:tt,calendar:rt,briefcase:st},At={gitbranch:nt,prdraft:at,testing:ot,deployment:it,review:lt,build:ct},Ut=e=>{const t=xe[e]||xe.commit;return r.jsx(t,{size:16})},me=(e,t=2)=>{if(e.length===0)return[];const s=[];let n=[],a=null;return e.forEach((f,m)=>{a===f.type?n.push(f):(n.length>=t&&a?s.push(we(n,a)):n.forEach(x=>{s.push({id:x.id.toString(),type:x.type,count:1,title:x.title,timestamp:new Date(x.timestamp),icon:x.icon,events:[x]})}),n=[f],a=f.type),m===e.length-1&&(n.length>=t&&a?s.push(we(n,a)):n.forEach(x=>{s.push({id:x.id.toString(),type:x.type,count:1,title:x.title,timestamp:new Date(x.timestamp),icon:x.icon,events:[x]})}))}),s},we=(e,t)=>{const s=e.reduce((m,x)=>{const j=x.metadata?.repository||"unknown";return m[j]||(m[j]=[]),m[j].push(x),m},{}),n=Object.entries(s),a=n.length>1;let f="";if(a)f=`Created ${e.length} ${pe(t)} in ${n.length} repositories`;else{const m=n[0][0];f=`Created ${e.length} ${pe(t)}${m!=="unknown"?` in ${m}`:""}`}return{id:`group-${t}-${e[0].id}`,type:t,count:e.length,title:f,timestamp:new Date(e[0].timestamp),icon:e[0].icon,events:e,children:a?n.map(([m,x])=>({id:`group-${t}-${m}`,type:t,count:x.length,title:`Created ${x.length} ${pe(t)} in ${m}`,timestamp:new Date(x[0].timestamp),icon:x[0].icon,events:x})):void 0}},pe=e=>({pr:"pull requests",issue:"issues",commit:"commits",comment:"comments",star:"stars",fork:"forks",merge:"merges",release:"releases",deploy:"deployments"})[e]||`${e}s`,fe=e=>{if(e.length===0)return[];const t=[];let s=null;return e.forEach((n,a)=>{if("type"in n&&n.type==="date-separator"){t.push(n);return}const m=n.timestamp,x=`${m.getFullYear()}-${m.getMonth()}`;if(x!==s){const j={id:`sep-${a}`,type:"date-separator",date:m,label:Pt(m)};t.push(j),s=x}t.push(n)}),t},Pt=e=>e.toLocaleDateString("en-US",{month:"long",year:"numeric"}),Vt=e=>{const t=typeof e=="string"?new Date(e):e,n=new Date().getTime()-t.getTime(),a=Math.floor(n/1e3),f=Math.floor(a/60),m=Math.floor(f/60),x=Math.floor(m/24);return a<60?"just now":f<60?`${f}m ago`:m<24?`${m}h ago`:x<30?`${x}d ago`:t.toLocaleDateString()},Dt=({events:e,theme:t="light",className:s="",showLoadMore:n=!0,loading:a=!1,onLoadMore:f,pagination:m,maxHeight:x,showMoreThreshold:j=100,initiallyExpandedAll:W=!1,emptyMessage:A="No activity to display",onToggleExpand:F,enableGrouping:h=!0,groupingThreshold:E=2,showDateSeparators:M=!0,showTimeline:q=!0,scale:B=1,renderIcon:L,renderEvent:R})=>{const[G,Z]=i.useState(()=>{const l=new Set;return(h?M?fe(me(e,E)):me(e,E):e.map(p=>({id:p.id.toString(),type:p.type,count:1,title:p.title,timestamp:new Date(p.timestamp),icon:p.icon,events:[p]}))).forEach(p=>{if("events"in p&&p.type!=="date-separator"){const C=p;(W||C.events.some(K=>K.initiallyExpanded))&&l.add(C.id),C.children&&C.children.forEach(K=>{(W||K.events.some(g=>g.initiallyExpanded))&&l.add(K.id)})}}),l}),[I,U]=i.useState(!1),k=i.useRef(null),O=i.useRef(null),P=i.useMemo(()=>{if(!h){const S=e.map(p=>({id:p.id.toString(),type:p.type,count:1,title:p.title,timestamp:new Date(p.timestamp),icon:p.icon,events:[p]}));return M?fe(S):S}const l=me(e,E);return M?fe(l):l},[e,h,E,M]),c=i.useCallback(()=>{if(!O.current||!n||!f)return;const{scrollTop:l,scrollHeight:S,clientHeight:p}=O.current,C=S-l-p;U(C<=j)},[n,f,j]);i.useEffect(()=>{const l=O.current;if(l)return l.addEventListener("scroll",c),c(),()=>{l.removeEventListener("scroll",c)}},[c]);const v=i.useCallback((l,S)=>{Z(p=>{const C=new Set(p),K=C.has(l);return K?C.delete(l):C.add(l),F?.(S,!K),C})},[F]),d=(l,S=!1)=>{const p=G.has(l.id),C=l.children&&l.children.length>0,K=l.count>1,g=l.count===1&&l.events[0]?.description,o=K||C||g,_=l.count===1&&l.events.length===1?l.events[0].id:l.id;return R&&l.count===1&&l.events.length===1?r.jsxs("div",{className:`activity-stream__item ${S?"activity-stream__item--child":""}`,"data-event-id":l.id,children:[q&&!S&&r.jsx("div",{className:"activity-stream__timeline-marker"}),R(l.events[0])]},l.id):r.jsxs("div",{className:`activity-stream__item ${S?"activity-stream__item--child":""}`,"data-event-id":l.id,children:[q&&!S&&r.jsx("div",{className:"activity-stream__timeline-marker"}),r.jsx("div",{className:"activity-stream__icon",children:L&&l.events.length===1?L(l.events[0]):l.icon||Ut(l.type)}),r.jsxs("div",{className:"activity-stream__content",children:[r.jsxs("div",{className:`activity-stream__header ${o?"activity-stream__header--clickable":""}`,onClick:()=>o&&v(l.id,_),onKeyDown:w=>{o&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),v(l.id,_))},role:o?"button":void 0,tabIndex:o?0:void 0,"aria-expanded":o?p:void 0,children:[r.jsx("div",{className:"activity-stream__title",children:l.title}),r.jsx("div",{className:"activity-stream__timestamp",children:Vt(l.timestamp)}),o&&r.jsx("div",{className:"activity-stream__toggle",children:p?r.jsx(ge.fold,{size:16}):r.jsx(ge.unfold,{size:16})})]}),p&&C&&l.children&&r.jsx("div",{className:"activity-stream__children",children:l.children.map(w=>d(w,!0))}),p&&!C&&l.events.length>1&&r.jsx("div",{className:"activity-stream__events-list",children:l.events.map(w=>R?r.jsx("div",{className:"activity-stream__event-item",children:R(w)},w.id):r.jsxs("div",{className:"activity-stream__event-item",children:[r.jsx("div",{className:"activity-stream__event-title",children:w.title}),w.description&&r.jsx("div",{className:"activity-stream__event-description",children:w.description})]},w.id))}),p&&l.count===1&&l.events[0].description&&r.jsx("div",{className:"activity-stream__description",children:l.events[0].description})]})]},l.id)},b=l=>r.jsxs("div",{className:"activity-stream__date-separator",children:[r.jsx("div",{className:"activity-stream__date-label",children:l.label}),r.jsx("div",{className:"activity-stream__date-line"})]},l.id),H=m?.hasMore!==void 0?m.hasMore:m?.totalItems!==void 0?e.length<m.totalItems:!0,D="activity-stream",X=`${D}--${t}`,ee=q?`${D}--with-timeline`:"";let J=`${D} ${X} ${ee} ${s}`.trim();B&&B<1&&(J=`${J} ${D}--compact`),B&&B>1&&(J=`${J} ${D}--spacious`);const z=x?{maxHeight:x}:void 0,te={"--activity-stream-scale":B};return r.jsx("div",{ref:k,className:J,"data-theme":t,children:r.jsxs("div",{ref:O,className:"activity-stream__container",style:{...z,...te},children:[P.length===0?r.jsx("div",{className:"activity-stream__empty",children:A}):r.jsx("div",{className:"activity-stream__items",children:P.map(l=>"type"in l&&l.type==="date-separator"?b(l):d(l))}),a&&r.jsxs("div",{className:"activity-stream__loading",children:[r.jsx("div",{className:"activity-stream__spinner"}),r.jsx("span",{children:"Loading..."})]}),n&&!a&&H&&f&&r.jsx("div",{className:`activity-stream__load-more ${I?"activity-stream__load-more--visible":""}`,onClick:f,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),f())},role:"button",tabIndex:0,"aria-label":"Load more activities",children:"Show more"})]})})},Et={name:"youtube",displayName:"YouTube",domains:["youtube.com","youtu.be","youtube-nocookie.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);return t.hostname.replace("www.","")==="youtu.be"?t.pathname.slice(1).split("?")[0]:t.searchParams.has("v")?t.searchParams.get("v"):t.pathname.startsWith("/embed/")||t.pathname.startsWith("/v/")?t.pathname.split("/")[2]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("mute","1"),t.loop&&(s.set("loop","1"),s.set("playlist",e)),t.startTime&&s.set("start",String(t.startTime)),t.controls===!1&&s.set("controls","0");const n="https://www.youtube.com",a=s.toString();return`${n}/embed/${e}${a?`?${a}`:""}`}},Bt={name:"vimeo",displayName:"Vimeo",domains:["vimeo.com"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="vimeo.com"&&s!=="player.vimeo.com")return null;if(t.pathname.startsWith("/video/"))return t.pathname.split("/")[2];const n=t.pathname.split("/").filter(Boolean);if(n.length>0){const a=n[0];if(/^\d+$/.test(a))return a}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("muted","1"),t.loop&&s.set("loop","1"),t.startTime&&s.set("t",`${t.startTime}s`),t.controls===!1&&s.set("controls","0");const n=s.toString();return`https://player.vimeo.com/video/${e}${n?`?${n}`:""}`}},Rt={name:"dailymotion",displayName:"Dailymotion",domains:["dailymotion.com","dai.ly"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s==="dai.ly")return t.pathname.slice(1).split("?")[0];if(s==="dailymotion.com"){if(t.pathname.startsWith("/video/"))return t.pathname.split("/")[2].split("_")[0];if(t.pathname.startsWith("/embed/video/"))return t.pathname.split("/")[3].split("?")[0]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1"),t.muted&&s.set("mute","1"),t.loop&&s.set("loop","1"),t.startTime&&s.set("start",String(t.startTime)),t.controls===!1&&s.set("controls","0");const n=s.toString();return`https://www.dailymotion.com/embed/video/${e}${n?`?${n}`:""}`}},Ot={name:"twitch",displayName:"Twitch",domains:["twitch.tv","clips.twitch.tv"],tier:"major",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")==="clips.twitch.tv")return`clip:${t.pathname.slice(1)}`;if(t.pathname.startsWith("/videos/"))return`video:${t.pathname.split("/")[2]}`;const n=t.pathname.match(/\/([^/]+)\/clip\/([^/?]+)/);return n?`clip:${n[2]}`:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams,n=typeof window<"u"?window.location.hostname:"localhost";s.set("parent",n),t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true");const a=s.toString();return e.startsWith("video:")?`https://player.twitch.tv/?video=${e.slice(6)}&${a}`:e.startsWith("clip:")?`https://clips.twitch.tv/embed?clip=${e.slice(5)}&${a}`:""}},Ht={name:"kick",displayName:"Kick",domains:["kick.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="kick.com")return null;const n=t.pathname.match(/\/video\/([a-zA-Z0-9-]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://player.kick.com/video/${e}`},zt={name:"rumble",displayName:"Rumble",domains:["rumble.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="rumble.com")return null;if(t.pathname.startsWith("/embed/"))return t.pathname.split("/")[2].split("?")[0];const n=t.pathname.match(/\/([a-z0-9]+)-/);return n?n[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","2");const n=s.toString();return`https://rumble.com/embed/${e}${n?`?${n}`:""}`}},Tt={name:"odysee",displayName:"Odysee",domains:["odysee.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="odysee.com")return null;const n=t.pathname.match(/\$\/embed\/(.+)/);if(n)return n[1];const a=t.pathname.slice(1);return a.startsWith("@")?a:null}catch{return null}},getEmbedUrl:e=>`https://odysee.com/$/embed/${e}`},Wt={name:"bitchute",displayName:"BitChute",domains:["bitchute.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="bitchute.com")return null;const n=t.pathname.match(/\/(video|embed)\/([a-zA-Z0-9]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:e=>`https://www.bitchute.com/embed/${e}/`},Ft={name:"vk",displayName:"VK Video",domains:["vk.com"],tier:"major",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="vk.com")return null;const n=t.searchParams.get("z");if(n&&n.startsWith("video"))return n.replace("video","");const a=t.pathname.match(/\/video(-?\d+_\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1");const n=e.split("_");if(n.length<2)return console.error("VK video ID must be in format OWNER_ID_VIDEO_ID"),"";const a=s.toString();return`https://vk.com/video_ext.php?oid=${n[0]}&id=${n[1]}${a?`&${a}`:""}`}},qt={name:"bilibili",displayName:"Bilibili",domains:["bilibili.com"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="bilibili.com"&&s!=="www.bilibili.com")return null;const n=t.pathname.match(/\/video\/((?:BV|av)[a-zA-Z0-9]+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","1");const n=s.toString();return`https://player.bilibili.com/player.html?bvid=${e}${n?`&${n}`:""}`}},Zt={name:"niconico",displayName:"Niconico",domains:["nicovideo.jp"],tier:"major",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="nicovideo.jp")return null;const n=t.pathname.match(/\/watch\/((?:sm|so|nm)\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://embed.nicovideo.jp/watch/${e}`},Kt={name:"wistia",displayName:"Wistia",domains:["wistia.com","wi.st","wistia.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(t.pathname.includes("/medias/")){const n=t.pathname.match(/\/medias\/([a-zA-Z0-9]+)/);if(n)return n[1]}if(s.includes("wistia")&&t.pathname.includes("/iframe/")){const n=t.pathname.match(/\/iframe\/([a-zA-Z0-9]+)/);if(n)return n[1]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoPlay","true"),t.muted&&s.set("muted","true");const n=s.toString();return`https://fast.wistia.net/embed/iframe/${e}${n?`?${n}`:""}`}},Yt={name:"brightcove",displayName:"Brightcove",domains:["brightcove.com","bcove.video"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.searchParams.get("videoId");if(s){const n=t.pathname.match(/\/(\d+)\//);if(n)return`${n[1]}:${s}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Brightcove video ID must be in format ACCOUNT_ID:VIDEO_ID"),"";const[s,...n]=t,a=n.join(":");return`https://players.brightcove.net/${s}/default_default/index.html?videoId=${a}`}},Gt={name:"kaltura",displayName:"Kaltura",domains:["kaltura.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.searchParams.get("entry_id")||t.searchParams.get("entryId");if(s){const n=t.pathname.match(/\/p\/(\d+)\//),a=t.pathname.match(/\/uiconf_id\/(\d+)/);if(n&&a)return`${n[1]}:${a[1]}:${s}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<3)return console.error("Kaltura video ID must be in format PARTNER_ID:UI_CONF_ID:ENTRY_ID"),"";const[s,n,a]=t;return`https://cdnapisec.kaltura.com/p/${s}/sp/${s}00/embedIframeJs/uiconf_id/${n}/partner_id/${s}?iframeembed=true&entry_id=${a}`}},Jt={name:"panopto",displayName:"Panopto",domains:["panopto.com"],tier:"professional",supportsAutoplay:!1,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname;if(s==="panopto.com"||s.endsWith(".panopto.com")){const a=t.searchParams.get("id");if(a)return`${s.split(".")[0]}:${a}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Panopto video ID must be in format SUBDOMAIN:SESSION_ID"),"";const[s,...n]=t,a=n.join(":");return`https://${s}.panopto.com/Panopto/Pages/Embed.aspx?id=${a}&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&captions=false&interactivity=all`}},Qt={name:"jwplayer",displayName:"JW Player",domains:["jwplayer.com","jwplatform.com","content.jwplatform.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const s=new URL(e).pathname.match(/\/players\/([a-zA-Z0-9]+-[a-zA-Z0-9]+)\.html/);return s?s[1]:null}catch{return null}},getEmbedUrl:e=>`https://content.jwplatform.com/players/${e}.html`},Xt={name:"cloudflare",displayName:"Cloudflare Stream",domains:["cloudflarestream.com","videodelivery.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname,n=s==="videodelivery.net"||s.endsWith(".videodelivery.net"),a=s==="cloudflarestream.com"||s.endsWith(".cloudflarestream.com");if(n||a){const f=t.pathname.match(/\/([a-zA-Z0-9]+)(?:\/|$)/);if(f)return f[1]}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true"),t.loop&&s.set("loop","true");const n=s.toString();return`https://iframe.videodelivery.net/${e}${n?`?${n}`:""}`}},er={name:"mux",displayName:"Mux",domains:["mux.com","stream.mux.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname==="stream.mux.com"){const n=t.pathname.slice(1).split(".")[0];if(n)return n}return null}catch{return null}},getEmbedUrl:(e,t={})=>{const s=new URLSearchParams;t.autoplay&&s.set("autoplay","true"),t.muted&&s.set("muted","true");const n=s.toString();return`https://stream.mux.com/${e}.m3u8${n?`?${n}`:""}`}},tr={name:"aws-ivs",displayName:"AWS IVS",domains:["ivs.aws","amazonaws.com"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);return t.hostname.includes(".channel.ivs.aws")?t.hostname.split(".")[0]:null}catch{return null}},getEmbedUrl:e=>`https://${e}.channel.ivs.aws/stream.m3u8`},rr={name:"azure-media",displayName:"Azure Media Services",domains:["azure.net","azureedge.net"],tier:"professional",supportsAutoplay:!0,supportsApi:!0,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.endsWith(".streaming.media.azure.net")){const s=t.pathname.split("/");if(s.length>=2)return`${t.hostname}:${s[1]}`}return null}catch{return null}},getEmbedUrl:e=>{const t=e.split(":");if(t.length<2)return console.error("Azure Media video ID must be in format HOSTNAME:ASSET_ID"),"";const[s,...n]=t,a=n.join(":");return`https://${s}/${a}/manifest`}},sr={name:"google-drive",displayName:"Google Drive",domains:["drive.google.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="drive.google.com")return null;const n=t.pathname.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(n)return n[1];const a=t.searchParams.get("id");return a||null}catch{return null}},getEmbedUrl:e=>`https://drive.google.com/file/d/${e}/preview`},nr={name:"dropbox",displayName:"Dropbox",domains:["dropbox.com"],tier:"cloud",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{return new URL(e).hostname.replace("www.","")!=="dropbox.com"?null:e}catch{return null}},getEmbedUrl:e=>{try{const t=new URL(e);return t.searchParams.delete("dl"),t.searchParams.set("raw","1"),t.toString()}catch{return e}}},ar={name:"facebook",displayName:"Facebook Video",domains:["facebook.com","fb.watch"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s==="fb.watch")return t.pathname.slice(1);if(s==="facebook.com"){const n=t.searchParams.get("v");if(n)return n;const a=t.pathname.match(/\/videos\/(\d+)/);if(a)return a[1]}return null}catch{return null}},getEmbedUrl:e=>`https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fwatch%2F%3Fv%3D${e}`},or={name:"instagram",displayName:"Instagram",domains:["instagram.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="instagram.com")return null;const n=t.pathname.match(/\/(p|reel|tv)\/([a-zA-Z0-9_-]+)/);return n?n[2]:null}catch{return null}},getEmbedUrl:e=>`https://www.instagram.com/p/${e}/embed/`},ir={name:"twitter",displayName:"X (Twitter)",domains:["twitter.com","x.com"],tier:"social",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e),s=t.hostname.replace("www.","");if(s!=="twitter.com"&&s!=="x.com")return null;const n=t.pathname.match(/\/status\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://platform.twitter.com/embed/Tweet.html?id=${e}`},lr={name:"pornhub",displayName:"Pornhub",domains:["pornhub.com"],tier:"adult",supportsAutoplay:!0,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="pornhub.com")return null;const n=t.searchParams.get("viewkey");if(n)return n;const a=t.pathname.match(/\/embed\/([a-zA-Z0-9]+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:e=>`https://www.pornhub.com/embed/${e}`},cr={name:"youporn",displayName:"YouPorn",domains:["youporn.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="youporn.com")return null;const n=t.pathname.match(/\/watch\/(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://www.youporn.com/embed/${e}`},dr={name:"redtube",displayName:"Redtube",domains:["redtube.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="redtube.com")return null;const n=t.searchParams.get("id");if(n)return n;const a=t.pathname.match(/\/(\d+)/);return a?a[1]:null}catch{return null}},getEmbedUrl:e=>`https://embed.redtube.com/?id=${e}`},ur={name:"xhamster",displayName:"XHamster",domains:["xhamster.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="xhamster.com")return null;const n=t.pathname.match(/\/videos\/[^/]+-(\d+)/);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://xhamster.com/xembed.php?video=${e}`},hr={name:"spankbang",displayName:"SpankBang",domains:["spankbang.com"],tier:"adult",supportsAutoplay:!1,supportsApi:!1,extractVideoId:e=>{try{const t=new URL(e);if(t.hostname.replace("www.","")!=="spankbang.com")return null;const n=t.pathname.match(/\/([a-zA-Z0-9]+)\/video\//);return n?n[1]:null}catch{return null}},getEmbedUrl:e=>`https://spankbang.com/${e}/embed/`},ve=[Et,Bt,Rt,Ot,Ht,zt,Tt,Wt,Ft,qt,Zt,Kt,Yt,Gt,Jt,Qt,Xt,er,tr,rr,sr,nr,ar,or,ir,lr,cr,dr,ur,hr],de=ve.reduce((e,t)=>(e[t.name]=t,e),{});function be(e){if(!e)return null;try{const s=new URL(e).hostname.toLowerCase().replace("www.","");for(const n of ve)for(const a of n.domains)if(s===a||s.endsWith(`.${a}`))return n;return null}catch{return null}}function ye(e){const t=be(e);if(!t)return null;const s=t.extractVideoId(e);return s?{provider:t,videoId:s}:null}function mr(e,t){const s=ye(e);return s?s.provider.getEmbedUrl(s.videoId,t):null}function pr(e){return be(e)?.tier==="adult"}const fr=()=>r.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:[r.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"white",fillOpacity:"0.9"}),r.jsx("path",{d:"M26 20L46 32L26 44V20Z",fill:"currentColor",style:{color:"#3b82f6"}})]}),xr=()=>r.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:[r.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"}),r.jsx("path",{d:"M8 7l5 3-5 3V7z"})]}),gr=({title:e,description:t,url:s,youtubeId:n,vimeoId:a,provider:f,videoId:m,autoplay:x=!1,muted:j=!1,loop:W=!1,startTime:A,controls:F=!0,thumbnailUrl:h,onPlay:E,onError:M,onReady:q,className:B="",overlayIcon:L,aspectRatio:R="16:9",width:G,height:Z,allowAdultContent:I=!1,fallback:U})=>{const[k,O]=i.useState(!1),[P,c]=i.useState(null),v=i.useRef(null),d=i.useMemo(()=>{if(f&&m){const p=de[f];if(p)return{provider:p,videoId:m,method:"explicit"}}if(s){const p=ye(s);if(p)return{...p,method:"url"}}if(n){const p=de.youtube;if(p)return{provider:p,videoId:n,method:"legacy"}}if(a){const p=de.vimeo;if(p)return{provider:p,videoId:a,method:"legacy"}}return null},[s,f,m,n,a]),b=i.useMemo(()=>d?d.provider.tier==="adult":!1,[d]),H=i.useMemo(()=>({autoplay:k?!0:x,muted:j,loop:W,startTime:A,controls:F}),[x,j,W,A,F,k]),D=i.useMemo(()=>{if(!d)return"";try{return d.provider.getEmbedUrl(d.videoId,H)}catch(p){return console.error("Error generating embed URL:",p),""}},[d,H]),X=i.useMemo(()=>{if(h)return h;if(d?.provider.name==="youtube")return`https://img.youtube.com/vi/${d.videoId}/maxresdefault.jpg`},[h,d]),ee=i.useCallback(()=>{d&&(O(!0),E&&E(d.videoId,d.provider.name),q&&q(d.videoId,d.provider.name))},[d,E,q]),J=i.useCallback(p=>{c(p),M&&d&&M(new Error(p),d.provider.name)},[M,d]);if(!d)return U?r.jsx(r.Fragment,{children:U}):(console.warn("UIForgeVideo: No valid video source provided"),null);if(b&&!I){const p="Adult content must be explicitly enabled with allowAdultContent prop";return U?r.jsx(r.Fragment,{children:U}):(console.warn(`UIForgeVideo: ${p}`),r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:p})})}))}if(P)return U?r.jsx(r.Fragment,{children:U}):r.jsx("div",{className:"uiforge-video",children:r.jsx("div",{className:"uiforge-video__error",children:r.jsx("p",{children:P})})});const z="uiforge-video",te=`${z} ${B}`.trim(),l={aspectRatio:R!=="auto"?R.replace(":","/"):void 0,width:G?typeof G=="number"?`${G}px`:G:void 0,height:Z?typeof Z=="number"?`${Z}px`:Z:void 0},S=e||`${d.provider.displayName} Video`;return r.jsxs("div",{className:te,children:[(e||t)&&r.jsxs("div",{className:`${z}__header`,children:[e&&r.jsx("h3",{className:`${z}__title`,children:e}),t&&r.jsx("p",{className:`${z}__description`,children:t})]}),r.jsx("div",{className:`${z}__player-container`,style:l,children:k?r.jsx("iframe",{ref:v,src:D,title:S,className:`${z}__iframe`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,onError:()=>J("Failed to load video")}):r.jsxs(r.Fragment,{children:[X&&r.jsx("img",{src:X,alt:S,className:`${z}__thumbnail`}),r.jsx("button",{className:`${z}__overlay`,onClick:ee,"aria-label":`Play video: ${S}`,type:"button",children:L||r.jsx(fr,{})})]})})]})},vr=({title:e,icon:t,className:s="",onClick:n})=>{const a="uiforge-video-preview",f=`${a} ${s}`.trim(),m=()=>{n&&n()},x=A=>{n&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},j=n?"button":"div",W=n?{type:"button",onClick:m,onKeyDown:x}:{};return r.jsxs(j,{className:f,...W,children:[r.jsx("div",{className:`${a}__icon-container`,children:t||r.jsx(xr,{})}),r.jsx("span",{className:`${a}__title`,children:e})]})};exports.ActivityIcons=xe;exports.AlienIcon=Ge;exports.BriefcaseIcon=st;exports.BugIcon=qe;exports.BuildIcon=ct;exports.BusinessIcons=St;exports.Button=ft;exports.CalendarIcon=rt;exports.ChartIcon=Xe;exports.CheckIcon=Pe;exports.CloseIcon=Ue;exports.CloudIcon=We;exports.CodeIcon=Ze;exports.CommentIcon=ke;exports.CommitIcon=je;exports.DatabaseIcon=Te;exports.DeployIcon=Le;exports.DeploymentIcon=it;exports.DevProcessIcons=At;exports.DocumentIcon=tt;exports.DumbbellIcon=Be;exports.FitnessIcons=Nt;exports.FoldIcon=Ae;exports.ForkIcon=Ce;exports.GitBranchIcon=nt;exports.HeartRateIcon=Oe;exports.IssueIcon=Ie;exports.MeditationIcon=De;exports.MeetingIcon=et;exports.MergeIcon=Ne;exports.PlanetIcon=Je;exports.PullRequestDraftIcon=at;exports.PullRequestIcon=_e;exports.ReleaseIcon=Me;exports.ReviewIcon=lt;exports.RocketIcon=Ke;exports.RunningIcon=Re;exports.SatelliteIcon=Ye;exports.ServerIcon=ze;exports.SpaceIcons=Lt;exports.StarIcon=$e;exports.StrengthIcon=He;exports.TaiChiIcon=Ve;exports.TechIcons=Mt;exports.TelescopeIcon=Qe;exports.TerminalIcon=Fe;exports.TestingIcon=ot;exports.UIForgeActivityStream=Dt;exports.UIForgeBlocksEditor=vt;exports.UIForgeComboBox=$t;exports.UIForgeGrid=xt;exports.UIForgeVideo=gr;exports.UIForgeVideoPreview=vr;exports.UIIcons=ge;exports.UnfoldIcon=Se;exports.WellnessIcons=Ct;exports.YogaIcon=Ee;exports.blocksToHTML=_t;exports.blocksToJSON=kt;exports.blocksToMarkdown=It;exports.detectProvider=be;exports.extractVideoId=ye;exports.getEmbedUrlFromVideoUrl=mr;exports.isAdultContent=pr;exports.providersByName=de;exports.videoProviders=ve;
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;