@asymmetric-effort/specifyjs 0.2.145 → 0.2.151
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/esm/components-barrel.js +1676 -1053
- package/dist/specifyjs-components.cjs.js +3 -3
- package/dist/specifyjs-components.esm.js +1676 -1053
- package/dist/types/components/data/board/src/Board.d.ts +28 -0
- package/dist/types/components/data/board/src/BoardReducer.d.ts +90 -0
- package/dist/types/components/data/board/src/Card.d.ts +24 -0
- package/dist/types/components/data/board/src/CardLink.d.ts +13 -0
- package/dist/types/components/data/board/src/Container.d.ts +17 -0
- package/dist/types/components/data/board/src/NamespaceValidator.d.ts +34 -0
- package/dist/types/components/data/board/src/index.d.ts +13 -0
- package/dist/types/components/data/board/src/types.d.ts +76 -0
- package/dist/types/demos/project-manager/src/Board.d.ts +10 -29
- package/dist/types/demos/project-manager/src/BoardState.d.ts +5 -76
- package/dist/types/demos/project-manager/src/Card.d.ts +11 -22
- package/dist/types/demos/project-manager/src/CardEditor.d.ts +2 -2
- package/dist/types/demos/project-manager/src/Connection.d.ts +6 -11
- package/dist/types/demos/project-manager/src/InterApp.d.ts +2 -2
- package/dist/types/demos/project-manager/src/index.d.ts +3 -2
- package/dist/types/demos/project-manager/src/types.d.ts +6 -38
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
"use strict";var ht=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var fs=Object.prototype.hasOwnProperty;var gs=(e,t,n)=>t in e?ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ms=(e,t)=>{for(var n in t)ht(e,n,{get:t[n],enumerable:!0})},hs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ps(t))!fs.call(e,i)&&i!==n&&ht(e,i,{get:()=>t[i],enumerable:!(r=us(t,i))||r.enumerable});return e};var bs=e=>hs(ht({},"__esModule",{value:!0}),e);var ze=(e,t,n)=>gs(e,typeof t!="symbol"?t+"":t,n);var Hd={};ms(Hd,{Accordion:()=>Go,Alert:()=>io,AnalogClock:()=>Gn,AppContextProvider:()=>Fe,Avatar:()=>Xn,Badge:()=>qn,BarGraph:()=>hr,BigNumber:()=>Mi,BlochSphere:()=>Ei,BoxPlot:()=>Pi,Breadcrumb:()=>Uo,BubbleChart:()=>$i,Button:()=>vi,CalendarHeatMap:()=>zi,Card:()=>Io,Carousel:()=>Ho,CartesianGraph2D:()=>kr,Checkbox:()=>po,ChordDiagram:()=>Ti,ColorPicker:()=>go,ColorWheel:()=>mo,ComplexGraph2D:()=>Pr,ContextMenu:()=>kt,DataGrid:()=>Qn,DatePicker:()=>xo,DecompositionTree:()=>Ai,DigitalClock:()=>eo,DiscreteCartesian2D:()=>ds,DragDropProvider:()=>lt,Drawer:()=>lr,Dropdown:()=>Xo,EmptyState:()=>so,FileUpload:()=>yo,FlexContainer:()=>Do,FlexItem:()=>zo,Footer:()=>Or,ForceGraph:()=>Wi,FormFieldWrapper:()=>he,FunnelChart:()=>Oi,GanttChart:()=>Yi,Gauge:()=>Gi,GoogleAnalytics:()=>Br,Grid:()=>To,GridItem:()=>Ao,HeatMap:()=>ji,Histogram:()=>Xi,HypercubeGraph:()=>Fr,IDE:()=>Rt,Image:()=>_o,LineGraph:()=>Dr,ListView:()=>to,LollipopChart:()=>qi,Matrix:()=>Ki,Menubar:()=>Ko,MessageBusProvider:()=>st,Modal:()=>cr,MultilineField:()=>So,NavWrapper:()=>Se,NumberSpinner:()=>vo,Pagination:()=>Jo,Panel:()=>Fo,Partition:()=>Zi,PieGraph:()=>zr,PivotTable:()=>Qi,PolarGraph2D:()=>Ar,Popover:()=>ur,ProgressBar:()=>ao,RadarChart:()=>es,RadioGroup:()=>wo,SankeyDiagram:()=>ts,ScrollContainer:()=>Wo,Select:()=>ko,Sidebar:()=>er,Skeleton:()=>lo,Slider:()=>Co,Spinner:()=>uo,Splitter:()=>Bo,Stepper:()=>tr,Sunburst:()=>ns,Tabs:()=>Oo,Tag:()=>no,TextEditor:()=>Mo,TextField:()=>Eo,ThreeDLayers:()=>Ci,TimePicker:()=>Po,ToastContainer:()=>Jt,Toggle:()=>Ro,Toolbar:()=>or,Tooltip:()=>fr,TradingDashboard:()=>Dt,TreeMap:()=>rs,TreeNav:()=>sr,TreeNode:()=>Ue,USStateMap:()=>Ui,US_STATE_PATHS:()=>ft,UnityApp:()=>xi,UnityDesktop:()=>bi,VectorField:()=>as,VideoPlayer:()=>Vo,VirtualScroll:()=>oo,VizWrapper:()=>Wr,WaterfallChart:()=>ls,WordCloud:()=>cs,WordProcessor:()=>Pt,applyGate:()=>$n,blochToCartesian:()=>nt,buildInputStyle:()=>Re,buildNavItemStyle:()=>Ge,buildRotationMatrix:()=>sn,cartesianToBloch:()=>At,computeBoxStats:()=>Dn,computeMandelbrotGrid:()=>Er,computeSlices:()=>nn,createToaster:()=>Zt,describeArc:()=>tn,generateEdges:()=>rn,generateHypercube:()=>ot,generatePalette:()=>Et,generateVertices:()=>on,numRotationAngles:()=>rt,projectTo2D:()=>ln,transformVec:()=>an,useAppId:()=>qe,useBarGraphScales:()=>Qt,useChannel:()=>at,useDragDrop:()=>He,useDraggable:()=>fn,useDropZone:()=>ct,useHover:()=>xe,useHypercube:()=>Nr,useLineGraphScales:()=>en,useMessageBus:()=>Ne,useToast:()=>pr});module.exports=bs(Hd);var bt=Symbol.for("spec.element"),xs=Symbol.for("spec.fragment"),Yd=Symbol.for("spec.portal"),Wn=Symbol.for("spec.provider"),Bn=Symbol.for("spec.consumer"),ys=Symbol.for("spec.forward_ref"),Ss=Symbol.for("spec.memo"),vs=Symbol.for("spec.lazy"),ws=Symbol.for("spec.suspense"),ks=Symbol.for("spec.strict_mode"),Cs=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:bt,type:e,props:s,key:r,ref:i}}function Pe(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Wn,_context:t},r={$$typeof:Bn,_context:t};return t.Provider=n,t.Consumer=r,t}var Ye=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};Ye.prototype.isSpecComponent=!0;var xt=class extends Ye{shouldComponentUpdate(t,n){return!Hn(this.props,t)||!Hn(this.state,n)}};xt.prototype.isPureSpecComponent=!0;function Hn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var _n=null;function Ae(){if(_n===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return _n}function j(e){return Ae().useState(e)}function ie(e,t){return Ae().useEffect(e,t)}function Ce(e){return Ae().useContext(e)}function Vt(e,t,n){return Ae().useReducer(e,t,n)}function v(e,t){return Ae().useCallback(e,t)}function X(e,t){return Ae().useMemo(e,t)}function oe(e){return Ae().useRef(e)}function pe(){return Ae().useId()}var Ve=Pe({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Yn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Es={pathname:Yn(),hash:typeof window<"u"?window.location.hash:""},Ps=new Set;function Rs(){Es={pathname:Yn(),hash:typeof window<"u"?window.location.hash:""};for(let e of Ps)e()}typeof window<"u"&&window.addEventListener("hashchange",Rs);var Mp=Pe({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function Vn(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function Bs(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var Ie={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function Gn(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=j(Vn(a));ie(()=>{let T=setInterval(()=>{u(Vn(a))},1e3);return()=>clearInterval(T)},[a]);let b=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),g=b%12*30+m*.5,f=m*6+c*.1,y=c*6,h=n/2,p=n/2,x=n/2-10,S=x-4,z=x-22,R=[];R.push(o("circle",{cx:String(h),cy:String(p),r:String(x),fill:Ie.face,stroke:Ie.border,"stroke-width":"3"}));for(let T=0;T<12;T++){let L=(T*30-90)*Math.PI/180,D=S-6;R.push(o("line",{x1:String(h+D*Math.cos(L)),y1:String(p+D*Math.sin(L)),x2:String(h+S*Math.cos(L)),y2:String(p+S*Math.sin(L)),stroke:Ie.border,"stroke-width":"2"}));let W=String(T===0?12:T);if(R.push(o("text",{x:String(h+z*Math.cos(L)),y:String(p+z*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ie.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},W)),t==="24h"){let A=x-38,k=String(T===0?0:T+12);R.push(o("text",{x:String(h+A*Math.cos(L)),y:String(p+A*Math.sin(L)),"text-anchor":"middle","dominant-baseline":"central",fill:Ie.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(T,P,L,D)=>{let W=(T-90)*Math.PI/180;return o("line",{x1:String(h),y1:String(p),x2:String(h+P*Math.cos(W)),y2:String(p+P*Math.sin(W)),stroke:D,"stroke-width":L,"stroke-linecap":"round"})};R.push(C(g,x*.5,"4",Ie.hand)),R.push(C(f,x*.75,"3",Ie.hand)),s&&R.push(C(y,x*.85,"1.5",Ie.second)),R.push(o("circle",{cx:String(h),cy:String(p),r:"4",fill:Ie.hand}));let F=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...R)];return r&&F.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ie.numbers}},Bs(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)}var Ut={xs:24,sm:32,md:40,lg:56,xl:80};function Os(e){return e==null?Ut.md:typeof e=="number"?e:Ut[e]??Ut.md}function Hs(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var Un=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function _s(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Un[Math.abs(t)%Un.length]}var jn={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function Ys(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function Xn(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,b]=j(!1),m=Os(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,g=a??_s(r),f=`${Math.round(m*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${m}px`,height:`${m}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},h;if(t&&!u)h=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>b(!0)});else{let z=Hs(r);h=o("span",{style:{fontSize:f,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},z)}let p=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":g},role:"img","aria-label":n??r??"avatar"},h);if(!l)return p;let x=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:jn[l]??jn.offline,border:"2px solid #fff",boxSizing:"border-box",...Ys(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},p,o("span",{style:S,"aria-label":l}))}var Vs={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},Gs={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function qn(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,b=r?{...Gs[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Vs[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},m=u?o("span",{style:b,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...b,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var Us={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},Kn={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},jt={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},js="6px 8px",Xs={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},qs={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ks={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},Be={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Zs={...Be,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Zn={...Be,opacity:"0.5",cursor:"default"},Jn={cursor:"pointer",width:"16px",height:"16px"};function Js(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Qn(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:b,onSelectionChange:m,striped:c=!1,bordered:g=!1,compact:f=!1,stickyHeader:y=!1}=e,[h,p]=j(0),[x,S]=j(void 0),[z,R]=j("asc"),[C,I]=j([]),[F,T]=j({}),P=i??h,L=a??x,D=l??z,W=b??C,A=X(()=>{let ee=Object.entries(F).filter(([,se])=>se.length>0);return ee.length===0?n:n.filter(se=>ee.every(([ae,K])=>String(se[ae]??"").toLowerCase().includes(K.toLowerCase())))},[n,F]),k=X(()=>{if(!L)return A;let ee=[...A];return ee.sort((se,ae)=>{let K=se[L],Z=ae[L];if(K==null&&Z==null)return 0;if(K==null)return 1;if(Z==null)return-1;if(typeof K=="number"&&typeof Z=="number")return D==="asc"?K-Z:Z-K;let le=String(K),de=String(Z),ce=le.localeCompare(de);return D==="asc"?ce:-ce}),ee},[A,L,D]),w=k.length,E=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice(P*r,(P+1)*r):k,N=v(ee=>{s?s(ee):p(ee)},[s]),$=v(ee=>{let se=L===ee&&D==="asc"?"desc":"asc";d?d(ee,se):(S(ee),R(se))},[L,D,d]),B=v(ee=>{let se=W.includes(ee)?W.filter(ae=>ae!==ee):[...W,ee];m?m(se):I(se)},[W,m]),H=v(()=>{let ee=M.map((K,Z)=>r?P*r+Z:Z),ae=ee.every(K=>W.includes(K))?W.filter(K=>!ee.includes(K)):[...new Set([...W,...ee])];m?m(ae):I(ae)},[M,W,r,P,m]),V=v((ee,se)=>{T(ae=>({...ae,[ee]:se})),N(0)},[N]),U=t.some(ee=>ee.filterable),J=f?js:jt.padding,ne=[];if(u){let ee=M.map((ae,K)=>r?P*r+K:K),se=ee.length>0&&ee.every(ae=>W.includes(ae));ne.push(o("th",{key:"__select_all",style:{...Kn,padding:J,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:se,onChange:H,style:Jn,"aria-label":"Select all rows"})))}for(let ee of t){let se={...Kn,padding:J,...ee.width?{width:ee.width}:{},...ee.sortable?{cursor:"pointer"}:{},...g?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},ae=[ee.header];ee.sortable&&ae.push(o("span",{style:Xs},Js(ee.key,L,D))),ne.push(o("th",{key:ee.key,style:se,onClick:ee.sortable?()=>$(ee.key):void 0,onKeyDown:ee.sortable?K=>{let Z=K.key;(Z==="Enter"||Z===" ")&&(K.preventDefault(),$(ee.key))}:void 0,tabIndex:ee.sortable?0:void 0,role:ee.sortable?"columnheader":void 0,"aria-sort":L===ee.key?D==="asc"?"ascending":"descending":void 0},...ae))}let te=null;if(U){let ee=[];u&&ee.push(o("th",{key:"__filter_spacer",style:{padding:J}}));for(let se of t)ee.push(o("th",{key:`filter_${se.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},se.filterable?o("input",{type:"text",placeholder:`Filter ${se.header}...`,style:qs,value:F[se.key]??"",onInput:ae=>V(se.key,ae.target.value),"aria-label":`Filter by ${se.header}`}):null));te=o("tr",{key:"__filter_row"},...ee)}let G=[];for(let ee=0;ee<M.length;ee++){let se=M[ee],ae=r?P*r+ee:ee,K=W.includes(ae),Z={};c&&ee%2===1&&(Z.backgroundColor="#f9fafb"),K&&(Z.backgroundColor="#eff6ff");let le=[];u&&le.push(o("td",{key:"__select",style:{padding:J,textAlign:"center",...jt,...g?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:K,onChange:()=>B(ae),style:Jn,"aria-label":`Select row ${ae+1}`})));for(let de of t){let ce=se[de.key],ue=de.render?de.render(ce,se):String(ce??"");le.push(o("td",{key:de.key,style:{...jt,padding:J,...g?{border:"1px solid #e5e7eb"}:{}}},ue))}G.push(o("tr",{key:String(ae),style:Z},...le))}let _=null;if(r){let ee=w===0?0:P*r+1,se=Math.min((P+1)*r,w),ae=[];ae.push(o("button",{key:"prev",style:P===0?Zn:Be,onClick:P>0?()=>N(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let K=7,Z=Math.max(0,P-Math.floor(K/2)),le=Math.min(E,Z+K);le-Z<K&&(Z=Math.max(0,le-K)),Z>0&&(ae.push(o("button",{key:"p0",style:Be,onClick:()=>N(0)},"1")),Z>1&&ae.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let de=Z;de<le;de++)ae.push(o("button",{key:`p${de}`,style:de===P?Zs:Be,onClick:de!==P?()=>N(de):void 0,"aria-current":de===P?"page":void 0},String(de+1)));le<E&&(le<E-1&&ae.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),ae.push(o("button",{key:`p${E-1}`,style:Be,onClick:()=>N(E-1)},String(E)))),ae.push(o("button",{key:"next",style:P>=E-1?Zn:Be,onClick:P<E-1?()=>N(P+1):void 0,disabled:P>=E-1,"aria-label":"Next page"},"Next \u2192")),_=o("div",{style:Ks},o("span",null,`Showing ${ee}\u2013${se} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...ae))}let O={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...Us,...g?{border:"1px solid #e5e7eb"}:{}},q=o("thead",null,o("tr",null,...ne),te),Q=o("tbody",null,...G),re=o("table",{style:Y,role:"grid","aria-rowcount":String(w)},q,Q);return o("div",{style:O},re,_)}function Oe(e){return e<10?`0${e}`:String(e)}function Qs(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function ea(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Oe(e.getMonth()+1)}/${Oe(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Oe(e.getMonth()+1)}-${Oe(e.getDate())}`}var ta={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},na={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},oa={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},ra={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function eo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=j(new Date);ie(()=>{let p=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(p)},[]);let{hours:u,minutes:b,seconds:m}=Qs(l,s),c,g=null;t==="12h"?(g=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${Oe(c)}:${Oe(b)}`;i&&(f+=`:${Oe(m)}`);let y=[f];g!=null&&y.push(o("span",{style:oa},g));let h=[o("span",{style:na},...y)];return n&&h.push(o("span",{style:ra},ea(l,r,s))),o("div",{style:ta,...a?{class:a}:{}},...h)}var ia={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},sa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},aa={borderBottom:"1px solid var(--color-border, #e5e7eb)"},la={cursor:"pointer",transition:"background-color 0.15s ease"},ca={backgroundColor:"var(--color-bg-muted, #eff6ff)"},da={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},yt={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function to(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:b}=e;if(t.length===0)return o("div",null,u?o("div",{style:yt},u):null,o("div",{style:da},d),b?o("div",{style:{...yt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null);let m=[];for(let c=0;c<t.length;c++){let g=t[c],f=r(g,c),y=a===c,h=c===t.length-1,p={...sa,...s?la:{},...y?ca:{},...i&&!h?aa:{}};m.push(o("li",{key:f,style:p,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let S=x.key;(S==="Enter"||S===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(g,c)))}return o("div",null,u?o("div",{style:yt},u):null,o("ul",{style:ia,role:l?"listbox":"list"},...m),b?o("div",{style:{...yt,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},b):null)}function ua(e){return e??"#3b82f6"}function pa(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var fa={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function ga(e,t,n,r,i){let s=fa[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:pa(e,.12),color:e,border:"none"};default:return a}}var ma={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function no(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,b=ua(n),m=ga(b,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:ma,onClick:g=>{g.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:m,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?g=>{let f=g.key;(f==="Enter"||f===" ")&&(g.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ha={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function oo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=j(0),d=oe(null),u=t.length*r,b=parseInt(s,10)||400,m=Math.ceil(b/r),c=Math.max(0,Math.floor(a/r)-i),g=Math.min(t.length,Math.floor(a/r)+m+i),f=v(h=>{let p=h.target;l(p.scrollTop)},[]),y=[];for(let h=c;h<g;h++)y.push(o("div",{key:String(h),style:{position:"absolute",top:`${h*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[h],h)));return o("div",{ref:d,style:{...ha,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var ro={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function io(e){let[t,n]=j(!0),r=e.type??"info",i=e.variant??"subtle",s=ro[r]??ro.info,a=e.icon??s.icon,l=e.message??e.children,d=X(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function so(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function ao(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=pe().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let g=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(g/10)),y=(g-f)/2,h=2*Math.PI*y,p=e.indeterminate?h*.75:h-r/100*h,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(g),height:String(g),viewBox:`0 0 ${g} ${g}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(g/2),cy:String(g/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(g/2),cy:String(g/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(h),"stroke-dashoffset":String(p),"stroke-linecap":"round",transform:`rotate(-90 ${g/2} ${g/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",b=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",m={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=X(()=>{let g={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(g.position="absolute",g.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,g.backgroundColor=i):(g.width=`${r}%`,g.backgroundColor=i),e.animated&&!e.indeterminate&&(g.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${ba(i)} 50%, ${i} 100%)`,g.backgroundSize="200% 100%",g.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),g},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||b?o("style",null,u+b):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:m},o("div",{style:c})))}function ba(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function lo(e){let t=e.variant??"text",n=e.animated!==!1,r=pe().replace(/[^a-zA-Z0-9_-]/g,""),i=X(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let b=u===l-1&&l>1;d.push(o("div",{key:String(u),style:Xt({width:b?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Xt({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Xt({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Xt(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var xa={sm:16,md:24,lg:40},co={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function uo(e){let t=typeof e.size=="number"?e.size:xa[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=co[e.speed??"normal"]??co.normal,s=e.label??"Loading",l=pe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,b=X(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,b),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function he(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Re(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var ya={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function po(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,b=oe(null);ie(()=>{b.current&&(b.current.indeterminate=a)},[a]);let m=v(()=>{l||i(!r)},[l,r,i]),c=v(F=>{l||(F.key===" "||F.key==="Enter")&&(F.preventDefault(),i(!r))},[l,r,i]),g=ya[u],f=`${g.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",h=r||a?"#3b82f6":"#ffffff",p={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:h,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${g.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,z={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},R=o("input",{ref:b,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:p},S),I=s?o("span",{style:{fontSize:g.fontSize,color:"#374151"}},s):null;return o(he,{error:d,htmlFor:n},o("div",{style:z,onClick:m,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},R,C,I))}var Sa=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function fo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function St(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function go(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Sa,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[b,m]=j(!1),[c,g]=j(r),f=oe(null);ie(()=>{g(r)},[r]),ie(()=>{let T=P=>{f.current&&!f.current.contains(P.target)&&m(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);let y=v(T=>{d||i(St(T))},[d,i]),h=v(T=>{let P=T.target.value;g(P);let L=P.startsWith("#")?P:`#${P}`;fo(L)&&i(St(L))},[i]),p=v(()=>{fo(c.startsWith("#")?c:`#${c}`)||g(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},z={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},R={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(T=>{let P=St(T)===St(r);return o("div",{key:T,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:T,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(T),onKeyDown:D=>{let W=D.key;(W==="Enter"||W===" ")&&(D.preventDefault(),y(T))},role:"button",tabIndex:d?-1:0,title:T,"aria-label":`Select color ${T}`})}),I=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:h,onBlur:p,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,F=b?o("div",{style:z},o("div",{style:R},...C),I):null;return o(he,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>m(!b),onKeyDown:d?void 0:T=>{let P=T.key;(P==="Enter"||P===" ")&&(T.preventDefault(),m(!b))},role:"button",tabIndex:d?-1:0,"aria-expanded":b?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),F))}function mo(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,b]=j(r),m=oe(null),c=v(((...h)=>{let x=h[0].target.value;b(x),i?.(x)}),[i]),g={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},f={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(he,{label:d,htmlFor:n},o("div",{style:g},o("div",{style:f},o("input",{id:n,ref:m,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var ho=["January","February","March","April","May","June","July","August","September","October","November","December"],va=["Su","Mo","Tu","We","Th","Fr","Sa"];function qt(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function wa(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function bo(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ka(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function xo(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:b,error:m}=e,c=X(()=>qt(r),[r]),g=X(()=>qt(a),[a]),f=X(()=>qt(l),[l]),[y,h]=j(!1),[p,x]=j(()=>c?c.getFullYear():new Date().getFullYear()),[S,z]=j(()=>c?c.getMonth():new Date().getMonth()),R=oe(null),C=X(()=>new Date,[]);ie(()=>{let $=B=>{R.current&&!R.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let I=v(()=>{z($=>$===0?(x(B=>B-1),11):$-1)},[]),F=v(()=>{z($=>$===11?(x(B=>B+1),0):$+1)},[]),T=v($=>{let B=new Date(p,S,$);g&&B<g||f&&B>f||(i(ka(B)),h(!1))},[p,S,i,g,f]),P=c?wa(c,s):"",L=X(()=>{let $=new Date(p,S,1).getDay(),B=new Date(p,S+1,0).getDate(),H=[],V=[];for(let U=0;U<$;U++)V.push(null);for(let U=1;U<=B;U++)V.push(U),V.length===7&&(H.push(V),V=[]);for(;V.length>0&&V.length<7;)V.push(null);return V.length&&H.push(V),H},[p,S]),D={...Re({},{focused:y,error:!!m}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},W={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},A={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},k={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},E=va.map($=>o("div",{key:$,style:{padding:"4px"}},$)),M=L.map(($,B)=>{let H=$.map((V,U)=>{if(V===null)return o("div",{key:`empty-${B}-${U}`,style:{padding:"4px"}});let J=new Date(p,S,V),ne=bo(J,C),te=c?bo(J,c):!1,G=g&&J<g||f&&J>f,_={padding:"4px",textAlign:"center",cursor:G?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ne?"700":"400",backgroundColor:te?"#3b82f6":"transparent",color:te?"#ffffff":G?"#d1d5db":ne?"#3b82f6":"#1f2937",border:ne&&!te?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${V}`,style:_,onClick:G?void 0:()=>T(V),onKeyDown:G?void 0:O=>{let Y=O.key;(Y==="Enter"||Y===" ")&&(O.preventDefault(),T(V))},role:G?void 0:"button",tabIndex:G?void 0:0,"aria-label":`${ho[S]} ${V}, ${p}`,"aria-disabled":G?"true":void 0},String(V))});return o("div",{key:`row-${B}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...H)}),N=y?o("div",{style:W},o("div",{style:A},o("button",{type:"button",style:k,onClick:I},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ho[S]} ${p}`),o("button",{type:"button",style:k,onClick:F},"\u25B6")),o("div",{style:w},...E),...M):null;return o(he,{label:b,error:m,disabled:d,htmlFor:n},o("div",{ref:R,style:{position:"relative"}},o("div",{id:n,style:D,onClick:d?void 0:()=>h(!y),onKeyDown:d?void 0:$=>{let B=$.key;(B==="Enter"||B===" ")&&($.preventDefault(),h(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),N))}function Kt(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function yo(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[b,m]=j([]),[c,g]=j(!1),[f,y]=j(""),h=oe(null),p=v(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${Kt(a)}`);continue}w.push(M)}let E=s?[...b,...w]:w.slice(0,1);m(E),r(E)},[b,s,a,r]),x=v(k=>{if(k.preventDefault(),k.stopPropagation(),g(!1),l)return;let w=k.dataTransfer;if(!w)return;let E=Array.from(w.files);p(E)},[l,p]),S=v(k=>{k.preventDefault(),k.stopPropagation(),l||g(!0)},[l]),z=v(k=>{k.preventDefault(),k.stopPropagation(),g(!1)},[]),R=v(k=>{let w=k.target;w.files&&(p(Array.from(w.files)),w.value="")},[p]),C=v(k=>{let w=b.filter((E,M)=>M!==k);m(w),r(w)},[b,r]),I=v(()=>{l||h.current&&h.current.click()},[l]),F={border:`2px dashed ${c?"#3b82f6":f?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},T={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},L={fontSize:"12px",color:"#9ca3af"},D=o("input",{id:n,ref:h,type:"file",accept:i,multiple:s,onChange:R,disabled:l,style:{display:"none"},tabIndex:-1}),W=o("div",{style:F,onClick:I,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),I())},onDrop:x,onDragOver:S,onDragLeave:z,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:T},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:L},i):null,a?o("div",{style:L},`Max size: ${Kt(a)}`):null),A=b.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...b.map((k,w)=>{let E={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},M={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:E},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},k.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Kt(k.size))),o("button",{type:"button",style:M,onClick:N=>{N.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(he,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,D,W,A))}function So(e){let[t,n]=j(!1),[r,i]=j((e.value??e.defaultValue??"").length),s=pe().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Re(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=v(c=>{let g=c.target,f=g.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(g.style.height="auto",g.style.height=`${g.scrollHeight}px`)},[e.onChange,e.autoResize]),b=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),m=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(he,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},b,m)}function vo(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:b,label:m,error:c}=e,[g,f]=j(!1),y=v(w=>{let E=w;return s!==void 0&&E<s&&(E=s),a!==void 0&&E>a&&(E=a),E},[s,a]),h=v(()=>{d||i(y(r+l))},[d,r,l,y,i]),p=v(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=v(w=>{let E=w.target.value;if(E===""||E==="-")return;let M=parseFloat(E);isNaN(M)||i(y(M))},[y,i]),S=v(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),h()):w.key==="ArrowDown"&&(w.preventDefault(),p()))},[d,h,p]),z=s===void 0||r>s,R=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":g?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...g&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},I=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),F={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},T={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:I(z),onClick:p,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),L=u?o("span",{style:T},u):null,D=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:F,"aria-label":m||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),W=b?o("span",{style:T},b):null,A=o("button",{type:"button",style:I(R),onClick:h,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[P];return L&&k.push(L),k.push(D),W&&k.push(W),k.push(A),o(he,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function wo(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:b}=e,m=v(y=>{d||s(y)},[d,s]),c=v(y=>{if(d)return;let h=r.filter(S=>!S.disabled);if(h.length===0)return;let p=h.findIndex(S=>S.value===i),x=p;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=p<h.length-1?p+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=p>0?p-1:h.length-1;else return;s(h[x].value)},[d,r,i,s]),g={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,h)=>{let p=y.value===i,x=d||!!y.disabled,S=`${n}-opt-${h}`,z={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":p?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},R={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:p?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:C,onClick:x?void 0:I=>{I.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:p,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:z},o("div",{style:R})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(he,{label:b,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:g,role:"radiogroup","aria-label":b,onKeyDown:c,tabIndex:d?-1:0},...f))}function ko(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:b=!1,error:m,label:c,helpText:g}=e,[f,y]=j(!1),[h,p]=j(""),[x,S]=j(-1),z=oe(null),R=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!h)return r;let $=h.toLowerCase();return r.filter(B=>B.label.toLowerCase().includes($))},[r,h,l]),I=X(()=>{let $={},B=[];for(let H of C)H.group?($[H.group]||($[H.group]=[]),$[H.group].push(H)):B.push(H);return{groups:$,ungrouped:B}},[C]),F=X(()=>R.length===0?"":R.map(B=>r.find(H=>H.value===B)).filter(Boolean).map(B=>B.label).join(", "),[R,r]);ie(()=>{let $=B=>{let H=B.target;z.current&&!z.current.contains(H)&&(y(!1),p(""))};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let T=v($=>{if(d){let B=R.includes($)?R.filter(H=>H!==$):[...R,$];s(B)}else s($),y(!1),p("")},[d,R,s]),P=v($=>{$.stopPropagation(),s(d?[]:"")},[d,s]),L=v($=>{if(b)return;let B=$.key;if(!f&&(B==="Enter"||B===" "||B==="ArrowDown")){$.preventDefault(),y(!0),S(0);return}if(f){if(B==="Escape"){y(!1),p("");return}if(B==="ArrowDown")$.preventDefault(),S(H=>Math.min(H+1,C.length-1));else if(B==="ArrowUp")$.preventDefault(),S(H=>Math.max(H-1,0));else if(B==="Enter"&&x>=0&&x<C.length){$.preventDefault();let H=C[x];H.disabled||T(H.value)}}},[b,f,x,C,T]),D={...Re({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:b?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},W={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},A=($,B)=>{let H=R.includes($.value),V=B===x,U={padding:"8px 12px",cursor:$.disabled?"not-allowed":"pointer",backgroundColor:V?"#f3f4f6":H?"#eff6ff":"transparent",color:$.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:$.value,style:U,onClick:$.disabled?void 0:()=>T($.value),onMouseEnter:()=>S(B),role:"option","aria-selected":H?"true":"false","aria-disabled":$.disabled?"true":void 0},d&&H?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,$.label)},k=()=>{let $=[],B=0,{groups:H,ungrouped:V}=I;for(let U of V)$.push(A(U,B++));for(let U of Object.keys(H)){$.push(o("div",{key:`group-${U}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},U));for(let J of H[U])$.push(A(J,B++))}return $.length===0&&$.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),$},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),E=o("div",{style:D,id:n,onClick:b?void 0:()=>{y(!f),S(-1)},onKeyDown:L,tabIndex:b?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:F?"#1f2937":"#9ca3af"}},F||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&R.length>0?o("span",{onClick:P,onKeyDown:$=>{let B=$.key;(B==="Enter"||B===" ")&&($.preventDefault(),$.stopPropagation(),P($))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),M=l&&f?o("input",{type:"text",value:h,onInput:$=>{p($.target.value),S(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,N=f?o("div",{style:W,role:"listbox"},M,...k()):null;return o(he,{label:c,error:m,helpText:g,disabled:b,htmlFor:n},o("div",{ref:z,style:{position:"relative"}},E,N))}function Co(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:b=!1,marks:m,range:c=!1,label:g,error:f}=e,y=oe(null),h=oe(i);h.current=i;let[p,x]=j(null),S=X(()=>{if(c&&Array.isArray(r))return r;let B=typeof r=="number"?r:0;return[B,B]},[r,c]),z=oe(S);z.current=S;let R=B=>{let H=Math.round((B-s)/l)*l+s;return Math.max(s,Math.min(a,H))},C=B=>(B-s)/(a-s)*100,I=v(B=>{if(!y.current)return s;let H=y.current.getBoundingClientRect(),V=Math.max(0,Math.min(1,(B.clientX-H.left)/H.width));return R(s+V*(a-s))},[s,a,l]),F=v(B=>H=>{b||(H.preventDefault(),x(B))},[b]),T=v(B=>{if(b)return;let H=I(B);if(c){let V=Math.abs(H-S[0]),U=Math.abs(H-S[1]);V<=U?i([R(H),S[1]]):i([S[0],R(H)])}else i(R(H))},[b,I,c,S,i,s,a,l]);ie(()=>{if(!p)return;let B=V=>{let U=I(V),J=z.current,ne=h.current;p==="single"?ne(R(U)):p==="start"?ne([Math.min(R(U),J[1]),J[1]]):p==="end"&&ne([J[0],Math.max(J[0],R(U))])},H=()=>x(null);return document.addEventListener("mousemove",B),document.addEventListener("mouseup",H),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",H)}},[p,I,s,a,l]);let P=v(B=>{if(b)return;let H=0;if(B.key==="ArrowRight"||B.key==="ArrowUp")H=l;else if(B.key==="ArrowLeft"||B.key==="ArrowDown")H=-l;else return;B.preventDefault(),c||i(R((typeof r=="number"?r:0)+H))},[b,l,c,r,i,s,a]),L={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:b?"not-allowed":"pointer"},D=c?C(S[0]):0,W=C(c?S[1]:S[0]),A={position:"absolute",top:"0",left:`${D}%`,width:`${W-D}%`,height:"100%",backgroundColor:b?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=B=>g?B==="start"?`${g} minimum`:B==="end"?`${g} maximum`:g:B==="start"?"Minimum value":B==="end"?"Maximum value":"Value",w=(B,H,V)=>{let U={position:"absolute",top:"50%",left:`${B}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${b?"#9ca3af":"#3b82f6"}`,cursor:b?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},J={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:H==="single"||H==="start"?n:void 0,style:U,onMouseDown:F(H),role:"slider","aria-valuenow":String(V),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(H),tabIndex:b?-1:0,onKeyDown:P},d?o("div",{style:J},String(V)):null)},E=[];if(u)for(let B=s;B<=a;B+=l)E.push(o("div",{key:`tick-${B}`,style:{position:"absolute",top:"10px",left:`${C(B)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let B of m)M.push(o("div",{key:`mark-${B.value}`,style:{position:"absolute",top:"18px",left:`${C(B.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},B.label));let N={paddingTop:d?"28px":"8px",paddingBottom:m||u?"28px":"8px",opacity:b?"0.6":"1"},$=[];return c?($.push(w(C(S[0]),"start",S[0])),$.push(w(C(S[1]),"end",S[1]))):$.push(w(C(S[0]),"single",S[0])),o(he,{label:g,error:f,htmlFor:n},o("div",{style:N},o("div",{ref:y,style:L,role:"presentation",onClick:T},o("div",{style:A}),...$,...E,...M)))}var Ca=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Ma={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Mo(e){let[t,n]=j(!1),r=oe(null),i=pe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Ca,l=e.toolbarStyle??{},d=e.editorStyle??{};ie(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=v((f,y)=>{if(!(e.disabled||e.readOnly)){if(f==="createLink"){let h=prompt("Enter URL:");if(!h)return;document.execCommand(f,!1,h)}else y&&f==="formatBlock"?document.execCommand(f,!1,`<${y}>`):document.execCommand(f,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),b=v(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=v(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(f=>{let y=Ma[f];return y?o("button",{key:f,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:f==="bold"?"700":f==="italic"?"400":"500",fontStyle:f==="italic"?"italic":"normal",textDecoration:f==="underline"?"underline":f==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),g=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:b});return o(he,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,g))}function Eo(e){let[t,n]=j(!1),r=pe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Re(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let b=u.target.value;e.onInput&&e.onInput(b),e.onChange&&e.onChange(b)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(he,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Ea=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function Le(e){return String(e).padStart(2,"0")}function Pa(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function Po(e){let t=pe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:b=!1,timezone:m,showTimezone:c=!1,timezones:g=Ea,onTimezoneChange:f}=e,[y,h]=j(!1),p=X(()=>Pa(r),[r]),x=s==="12h",S=p.hour>=12,z=x?p.hour%12||12:p.hour,R=v((_,O,Y)=>{let q=Math.max(0,Math.min(23,_)),Q=Math.max(0,Math.min(59,O)),re=Math.max(0,Math.min(59,Y??0));i(b?`${Le(q)}:${Le(Q)}:${Le(re)}`:`${Le(q)}:${Le(Q)}`)},[i,b]),C=v(_=>{let O=parseInt(_.target.value,10)||0;x&&(O=O%12,S&&(O+=12)),R(O,p.minute,p.second)},[x,S,p.minute,p.second,R]),I=v(_=>{let O=parseInt(_.target.value,10)||0;R(p.hour,O,p.second)},[p.hour,p.second,R]),F=v(_=>{let O=parseInt(_.target.value,10)||0;R(p.hour,p.minute,O)},[p.hour,p.minute,R]),T=v(()=>{if(l)return;let _=S?p.hour-12:p.hour+12;R(_,p.minute,p.second)},[l,S,p.hour,p.minute,p.second,R]),P=v(_=>{l||R(p.hour+_,p.minute,p.second)},[l,p.hour,p.minute,p.second,R]),L=v(_=>{l||R(p.hour,p.minute+_*a,p.second)},[l,p.hour,p.minute,p.second,a,R]),D=v(_=>{l||R(p.hour,p.minute,p.second+_)},[l,p.hour,p.minute,p.second,R]),W=v(_=>{let O=_.target.value;f&&f(O)},[f]),A={display:"inline-flex",alignItems:"center",gap:"4px",...Re({},{focused:y,error:!!u})},k={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},E={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},M={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},N=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(z),onChange:C,style:E,disabled:l,"aria-label":"Hour",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:l},"\u25BC")),$=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),B=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>L(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(p.minute),onChange:I,style:E,disabled:l,"aria-label":"Minute",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>L(-1),disabled:l},"\u25BC")),H=b?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,V=b?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>D(1),disabled:l},"\u25B2"),o("input",{type:"text",value:Le(p.second),onChange:F,style:E,disabled:l,"aria-label":"Second",onFocus:()=>h(!0),onBlur:()=>h(!1)}),o("button",{type:"button",style:w,onClick:()=>D(-1),disabled:l},"\u25BC")):null,U=x?o("button",{type:"button",style:M,onClick:T,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,J={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ne=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,te=c?o("select",{style:J,value:m??g[0],onChange:W,disabled:l,"aria-label":"Timezone"},...g.map(_=>o("option",{key:_,value:_},_))):null,G=[N,$,B];return H&&G.push(H),V&&G.push(V),U&&G.push(U),ne&&G.push(ne),te&&G.push(te),o(he,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:A},...G))}var Ra={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function Ro(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=Ra[a],b=v(()=>{s||n(!t)},[s,t,n]),m=v(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?u.trackW-u.thumbSize-u.offset:u.offset,f={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},h=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,p=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:b,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[h,p]:[p,h]).filter(Boolean))}var $o={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function Io(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let b={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(b.border="1px solid #e5e7eb"),b.boxShadow=$o[n]??$o.sm,e.hoverable&&(b.cursor="pointer"),{...b,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Do(e){let t=X(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function zo(e){let t=X(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function To(e){let t=X(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Ao(e){let t=X(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Lo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function Fo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=j(!!e.defaultCollapsed),s=oe(null),[a,l]=j("auto");ie(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=v(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=v(y=>{if(!e.collapsible)return;let h=y.key;(h==="Enter"||h===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),b=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Lo[n]??Lo.none,{...y,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},g={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:b},o("div",{className:"panel__header",style:m,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?g:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function No(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function $a(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Wo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=oe(null),[s,a]=j(!0),[l,d]=j(!1),[u,b]=j(!0),[m,c]=j(!1),g=v(()=>{let x=i.current;if(!x)return;let S=2;a(x.scrollTop<=S),d(x.scrollTop+x.clientHeight>=x.scrollHeight-S),b(x.scrollLeft<=S),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-S)},[]);ie(()=>{g()},[g]);let f=v(()=>{r&&g()},[r,g]),y=X(()=>{let x={position:"relative",overflowX:No(t,"x"),overflowY:No(t,"y"),...$a(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),h=[];if(r){let x=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";x&&!s&&h.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&h.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&h.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!m&&h.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let p={...y};return h.length>0&&(p.boxShadow=h.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:p,ref:i,onScroll:f},e.children)}function Bo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=j(e.initialSplit??50),l=oe(null),d=oe(!1),u=v(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);ie(()=>{let y=p=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),S=n?x.width:x.height,z=n?p.clientX-x.left:p.clientY-x.top;if(S<=0)return;let R=i/S*100,C=e.maxSize?e.maxSize/S*100:100-R,I=z/S*100;I=Math.max(R,Math.min(C,I)),a(I)},h=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",h),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",h)}},[n,i,e.maxSize]);let b=X(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},g={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},f=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:b,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:g,onMouseDown:u,onKeyDown:y=>{let h=y.key,p=2;n&&(h==="ArrowLeft"||h==="ArrowRight")?(y.preventDefault(),a(x=>{let S=h==="ArrowRight"?p:-p;return Math.max(5,Math.min(95,x+S))})):!n&&(h==="ArrowUp"||h==="ArrowDown")&&(y.preventDefault(),a(x=>{let S=h==="ArrowDown"?p:-p;return Math.max(5,Math.min(95,x+S))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},f[1]??null))}function Oo(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(p=>!p.disabled)?.id??"",[i,s]=j(e.activeTab??r),a=e.activeTab??i,l=oe(null),d=v(p=>{s(p),e.onChange&&e.onChange(p)},[e.onChange]),u=v(p=>{let x=e.tabs.filter(F=>!F.disabled),S=x.findIndex(F=>F.id===a);if(S===-1)return;let z=t==="left"||t==="right",R=z?"ArrowUp":"ArrowLeft",C=z?"ArrowDown":"ArrowRight",I=-1;if(p.key===R?I=S>0?S-1:x.length-1:p.key===C?I=S<x.length-1?S+1:0:p.key==="Home"?I=0:p.key==="End"&&(I=x.length-1),I>=0){p.preventDefault(),d(x[I].id);let F=l.current;if(F){let P=F.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[I])];P&&P.focus()}}},[e.tabs,a,t,d]),b=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:b?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[b,m,e.style]),g={display:"flex",flexDirection:b?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!b?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&b?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},f={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(p=>p.id===a),h=e.tabs.map(p=>{let x=p.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?b?t==="left"?(S.borderRight=x?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=x?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",x&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=x?"#3b82f6":"transparent",S.color=x?"#ffffff":"#6b7280"),o("button",{key:p.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${p.id}`,"aria-disabled":p.disabled?"true":void 0,id:`tab-${p.id}`,tabIndex:x?"0":"-1",style:S,onClick:p.disabled?void 0:()=>d(p.id),onKeyDown:u},p.icon?o("span",{className:"tabs__tab-icon"},p.icon):null,p.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":b?"vertical":"horizontal",style:g,ref:l},...h),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function Ho(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=pe().replace(/[^a-zA-Z0-9_-]/g,""),[u,b]=j(0),m=oe(null),c=oe(null),g=v(C=>{let I=C;r?I=(C%n+n)%n:I=Math.max(0,Math.min(C,n-1)),b(I),e.onChange&&e.onChange(I)},[n,r,e.onChange]),f=v(()=>g(u+1),[u,g]),y=v(()=>g(u-1),[u,g]);ie(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),ie(()=>{let C=F=>{F.key==="ArrowLeft"?y():F.key==="ArrowRight"&&f()},I=c.current;if(I)return I.addEventListener("keydown",C),()=>I.removeEventListener("keydown",C)},[f,y]);let h=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",p={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=X(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((C,I)=>{let F=a==="fade"?{position:I===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:I===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(I),style:F},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),R=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,I)=>o("button",{key:String(I),"aria-label":`Go to slide ${I+1}`,onclick:()=>g(I),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:I===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:p,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let I=C.clientX-m.current;I>50?y():I<-50&&f(),m.current=null}},h?o("style",null,h):null,o("div",{style:x},...z),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...S,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:f,style:{...S,right:"8px"}},"\u203A"):null,R)}function _o(e){let[t,n]=j("loading"),r=oe(null),i=pe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;ie(()=>{n("loading")},[e.src]);let d=X(()=>{let g={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(g.width=a),l&&(g.height=l),e.borderRadius&&(g.borderRadius=e.borderRadius),g},[a,l,e.borderRadius]),u=X(()=>{let g={display:"block",width:"100%",height:"100%"};return e.objectFit&&(g.objectFit=e.objectFit),t==="loading"&&(g.opacity="0",g.position="absolute"),t==="error"&&(g.display="none"),g},[e.objectFit,t]),b=null;if(t==="loading")if(e.placeholder==="skeleton"){let g=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;b=o("div",null,o("style",null,g),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?b=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(b=e.placeholder);let m=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?m=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):m=e.fallback);let c=o("div",{style:d},b,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Yo(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function Vo(e){let t=e.controls!==!1,n=oe(null),r=pe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=j(!1),[a,l]=j(0),[d,u]=j(0),[b,m]=j(e.muted?0:1),[c,g]=j(!!e.muted),[f,y]=j(!0),h=typeof e.width=="number"?`${e.width}px`:e.width??"100%",p=typeof e.height=="number"?`${e.height}px`:e.height??"auto";ie(()=>{let T=n.current;if(!T)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},L=()=>{s(!1),e.onPause&&e.onPause()},D=()=>{s(!1),e.onEnded&&e.onEnded()},W=()=>{l(T.currentTime),u(T.duration),e.onTimeUpdate&&e.onTimeUpdate(T.currentTime,T.duration)},A=()=>{u(T.duration)};return T.addEventListener("play",P),T.addEventListener("pause",L),T.addEventListener("ended",D),T.addEventListener("timeupdate",W),T.addEventListener("loadedmetadata",A),()=>{T.removeEventListener("play",P),T.removeEventListener("pause",L),T.removeEventListener("ended",D),T.removeEventListener("timeupdate",W),T.removeEventListener("loadedmetadata",A)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=v(()=>{let T=n.current;T&&(T.paused?T.play():T.pause())},[]),S=v(T=>{let P=n.current;if(!P||!isFinite(P.duration))return;let L=T.currentTarget.getBoundingClientRect(),D=Math.max(0,Math.min(1,(T.clientX-L.left)/L.width));P.currentTime=D*P.duration},[]),z=v(T=>{let P=n.current,L=parseFloat(T.target.value);P&&(P.volume=L,P.muted=L===0,m(L),g(L===0))},[]),R=v(()=>{let T=n.current;T&&T.requestFullscreen&&T.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:h,height:p,display:"block"}});let C=d>0?a/d*100:0,I={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},F=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:f?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:I},i?"\u23F8":"\u25B6"),o("div",{onclick:S,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Yo(a)} / ${Yo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:b),oninput:z,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:R,style:I},"\u26F6"));return o("div",{style:{position:"relative",width:h,height:p,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),F)}function Se(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=oe(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=v(d=>{if(!r)return;let u=d,b=s.current;if(!b)return;let m=Array.from(b.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let g=t==="vertical",f=g?"ArrowDown":"ArrowRight",y=g?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let h=m[c+1];h&&h.focus()}else if(u.key===y){u.preventDefault();let h=m[c-1];h&&h.focus()}else u.key==="Home"?(u.preventDefault(),m[0]?.focus()):u.key==="End"&&(u.preventDefault(),m[m.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function Ge(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function xe(){let[e,t]=j(!1);return{hover:e,onMouseEnter:v(()=>t(!0),[]),onMouseLeave:v(()=>t(!1),[])}}function Ia(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:b}=xe(),m=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:m?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:m?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:m?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let g=v(S=>{let z=S;m||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),r())},[m,r]),f=v(()=>{m||r()},[m,r]),h=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),p=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[h,p]:[p,h];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":m?"true":void 0,"data-section-id":t.id,tabIndex:m?-1:0,style:c,onClick:f,onKeyDown:g,onMouseEnter:u,onMouseLeave:b},...x)}function Da(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function Go(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:b=!0,onChange:m}=e,[c,g]=j(()=>n??[]),f=v(h=>{g(p=>{let x=p.includes(h),S;return x?S=p.filter(z=>z!==h):r?S=[...p,h]:S=[h],m&&m(S),S})},[r,m]),y=X(()=>t.map(h=>{let p=c.includes(h.id),x=o(Ia,{key:`header-${h.id}`,section:h,expanded:p,onToggle:()=>f(h.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(Da,{key:`content-${h.id}`,section:h,expanded:p,contentStyle:s,animated:b});return o("div",{key:h.id,"data-accordion-section":h.id,style:{width:"100%"}},x,S)}),[t,c,i,s,l,d,u,b,f]);return o(Se,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var za={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Uo(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=j(!1),l=za[i],d=v(()=>{a(!0)},[]),u=t,b=!1;if(r&&r>1&&t.length>r&&!s){b=!0;let f=1,y=r-1;u=[...t.slice(0,f),{label:"..."},...t.slice(t.length-y)]}let m=f=>typeof f=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},f):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},f),c=(f,y,h)=>{let p=y===h.length-1,x=b&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),x?S.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):p?S.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},f.label)):f.href?S.push(o("a",{href:f.href,onClick:f.onClick?z=>{z.preventDefault(),f.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},f.label)):f.onClick?S.push(o("button",{type:"button",onClick:f.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},f.label)):S.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},f.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...S)},g=u.map((f,y)=>c(f,y,u));return o(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...g))}function jo(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=xe(),[d,u]=j(!1),b=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=t.disabled===!0,g={...Ge(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=v(()=>{if(!m){if(b){u(z=>!z);return}t.onClick&&t.onClick(),r&&i()}},[m,b,t,r,i]),y=v(()=>{a(),b&&u(!0)},[b,a]),h=v(()=>{l(),b&&u(!1)},[b,l]),p=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=b?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=b&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(Se,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(z=>o(jo,{key:z.id,item:z,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:h},o("button",{type:"button",role:"menuitem",style:g,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":b||void 0,"aria-expanded":b?String(d):void 0},p,x),S)}function Xo(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,b]=j(!1),m=oe(null),c=v(()=>{b(z=>!z)},[]),g=v(()=>{b(!1)},[]);ie(()=>{if(!u)return;let z=R=>{let C=m.current;C&&!C.contains(R.target)&&b(!1)};return document.addEventListener("click",z,!0),()=>{document.removeEventListener("click",z,!0)}},[u]),ie(()=>{if(!u)return;let z=R=>{R.key==="Escape"&&b(!1)};return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[u]);let f={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:f,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),h=typeof d=="number"?`${d}px`:d,p={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:h,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:p},o(Se,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(z=>o(jo,{key:z.id,item:z,itemStyle:s,closeOnSelect:l,onClose:g})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function qo(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),[l,d]=j(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let b=t.disabled===!0,m=v(()=>{if(!b){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[b,u,t,n]),c=v(()=>{s(),u&&d(!0)},[u,s]),g=v(()=>{a(),u&&d(!1)},[u,a]),f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:b?"default":"pointer",backgroundColor:!b&&i?"#f3f4f6":"transparent",color:b?"#9ca3af":"#1f2937",opacity:b?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),h=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,p=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,S)=>o(qo,{key:String(S),item:x,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:g},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:b||void 0,tabIndex:-1,"aria-disabled":b||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,h),p)}function Ta(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=xe(),b=oe(null),m=v(()=>{r?a():s(n)},[r,n,s,a]),c=v(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),g={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},f=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,h)=>o(qo,{key:String(h),item:y,onClose:a,index:h})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:b,type:"button",role:"menuitem",style:g,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Ko(e){let{menus:t}=e,[n,r]=j(null),i=oe(null),s=v(d=>{r(d)},[]),a=v(()=>{r(null)},[]);ie(()=>{if(n===null)return;let d=u=>{let b=i.current;b&&!b.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),ie(()=>{let d=i.current;if(!d)return;let u=b=>{let m=b;if(m.key==="Escape"){r(null);return}if(m.key==="ArrowRight"){m.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(m.key==="ArrowLeft"){m.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(m.key==="ArrowDown"&&n!==null){m.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let g=c.querySelector('[role="menuitem"]');g&&g.focus()}return}m.key==="Enter"||m.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Ta,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function vt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Aa(e,t,n){let r=n*2+5;if(e<=r)return vt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...vt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...vt(e-n*2-2,e)]:[1,"ellipsis",...vt(i,s),"ellipsis",e]}var wt={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},La={...wt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Zo={...wt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Fa={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Jo(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),b=Math.min(Math.max(1,r),u),m=v(h=>{!d&&h>=1&&h<=u&&h!==b&&i(h)},[d,u,b,i]),c=(h,p,x)=>{let S=d||p<1||p>u||p===b;return o("button",{type:"button",onClick:()=>m(p),disabled:S||void 0,"aria-label":x,style:S?Zo:wt},h)},g=Aa(u,b,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",b-1,"Go to previous page"));for(let h of g)if(h==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:Fa},"..."));else{let p=h===b;y.push(o("button",{key:String(h),type:"button",onClick:()=>m(h),disabled:d||void 0,"aria-label":`Page ${h}`,"aria-current":p?"page":void 0,style:d?Zo:p?La:wt},String(h)))}return l&&y.push(c("\u203A",b+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(Se,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function Qo(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=xe(),[u,b]=j(!1),m=t.children&&t.children.length>0,c=t.id===r,g=v(()=>{m&&!n&&b(I=>!I),i&&i(t.id)},[m,n,i,t.id]),f=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${f}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},h=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,p=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,S=!n&&m?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,z=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,R=o("button",{type:"button",style:y,onClick:g,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},h,p,x,S,z),C=!n&&m&&u?t.children.map(I=>o(Qo,{key:I.id,item:I,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},R,C?o("div",{role:"group"},...C):null)}function er(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,b=t.map(m=>o(Qo,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(Se,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...b)}var Ee={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function tr(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,b=v(h=>{s&&i&&i(h)},[s,i]),m=h=>h<n?"completed":h===n?"active":"pending",c=(h,p,x)=>{let S=a==="dot"?u:d,z={width:`${S}px`,height:`${S}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...z,backgroundColor:Ee.completedBg,color:Ee.completedText,border:`2px solid ${Ee.completed}`}},a==="circle"?p.icon||"\u2713":null):x==="active"?o("div",{style:{...z,backgroundColor:"#ffffff",color:Ee.activeText,border:`2px solid ${Ee.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?p.icon||String(h+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ee.active}})):o("div",{style:{...z,backgroundColor:"#ffffff",color:Ee.pendingText,border:`2px solid ${Ee.pending}`}},a==="circle"?p.icon||String(h+1):null)},g=h=>{if(h>=t.length-1)return null;let x=h<n?Ee.lineCompleted:Ee.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},f=(h,p)=>{let x=m(p),S=x==="active",z=x==="completed",R=c(p,h,x),C={fontSize:"13px",fontWeight:S?"600":"400",color:S||z?Ee.labelActive:Ee.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},I={fontSize:"11px",color:Ee.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},F=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},h.label),h.description?o("span",{style:I},h.description):null),T=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},R,F):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},R,F);return o(s?"button":"div",{key:String(p),onClick:s?()=>b(p):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":S?"step":void 0},T)},y=[];return t.forEach((h,p)=>{y.push(f(h,p));let x=g(p);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var nr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function Na(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=xe(),l=nr[n],d=t.disabled===!0,u=t.type==="toggle",[b,m]=j(!1),c=u?t.active===!0:b,g=v(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=v(()=>{!d&&!u&&m(!0)},[d,u]),y=v(()=>{u||m(!1)},[u]),h=v(()=>{a(),u||m(!1)},[u,a]),p={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,z=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:p,onClick:g,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:h,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,S,z)}function or(e){let{items:t,size:n="md",variant:r="flat"}=e,i=nr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(Na,{key:a.id,item:a,size:n,variant:r}));return o(Se,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var Ue=class e{constructor(t,n){ze(this,"id");ze(this,"label");ze(this,"children");ze(this,"expanded");ze(this,"icon");ze(this,"metadata");ze(this,"parent");ze(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function rr(e){e.expanded=!0;for(let t of e.children)rr(t)}function ir(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)ir(n,t);return t}function Wa(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function Ba(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:b,onClick:m,focusedId:c}=e,g=xe(),f=oe(null),y=c===t.id;ie(()=>{y&&f.current&&f.current.focus()},[y]);let h=t.isLeaf(),p=t.depth,x=[];for(let I=0;I<p;I++){let F=t;for(let P=0;P<p-I;P++)F=F?F.parent:null;let T=F?!Wa(F):!1;x.push(o("span",{key:`connector-${I}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...T?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=p>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,z=h?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:I=>{I.stopPropagation(),b(t)}},t.expanded?a:l),R=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=Ge(d,{hover:g.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":h?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":p+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onClick:()=>m(t)},...x,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},z,R))}function sr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:b="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:g,renderNode:f}=e,[y,h]=j(()=>{let T=Ue.fromData(t);return a&&rr(T),T}),[p,x]=j(t.id),S=X(()=>ir(y),[y]),z=v(()=>{h(T=>{let P=Object.create(Object.getPrototypeOf(T));return Object.assign(P,T),P})},[]),R=v(T=>{T.toggle(),T.expanded?r?.(T):i?.(T),z()},[r,i,z]),C=v(T=>{x(T.id),n?.(T)},[n]),I=v(T=>{let P=T;if(!p)return;let L=S.findIndex(W=>W.id===p);if(L===-1)return;let D=S[L];switch(P.key){case"ArrowDown":{P.preventDefault();let W=S[L+1];W&&x(W.id);break}case"ArrowUp":{P.preventDefault();let W=S[L-1];W&&x(W.id);break}case"ArrowRight":{P.preventDefault(),D.isLeaf()||(D.expanded?D.children.length>0&&x(D.children[0].id):R(D));break}case"ArrowLeft":{P.preventDefault(),!D.isLeaf()&&D.expanded?R(D):D.parent&&x(D.parent.id);break}case"Enter":{P.preventDefault(),C(D);break}case" ":{P.preventDefault(),D.isLeaf()||R(D);break}case"Home":{P.preventDefault(),S.length>0&&x(S[0].id);break}case"End":{P.preventDefault(),S.length>0&&x(S[S.length-1].id);break}}},[p,S,R,C]),F=S.map(T=>o(Ba,{key:T.id,node:T,isSelected:T.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:b,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:R,onClick:C,focusedId:p}));return o(Se,{role:"tree",ariaLabel:"Tree navigation",styling:g,keyboardNav:!1},o("div",{onKeyDown:I,style:{outline:"none"}},...F))}function ar(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=j(-1),[l,d]=j(null),u=oe(null);ie(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,h=t.map((p,x)=>({item:p,i:x})).filter(({item:p})=>!p.divider);if(y.key==="ArrowDown")y.preventDefault(),a(p=>{let S=(h.findIndex(({i:z})=>z===p)+1)%h.length;return h[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(p=>{let x=h.findIndex(({i:z})=>z===p),S=x<=0?h.length-1:x-1;return h[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let p=t[s];p.children?d(s):!p.disabled&&p.onClick&&(p.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let g=u.current;return()=>g.removeEventListener("keydown",c)},[t,s,i,r]);let b={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},m=t.map((c,g)=>{if(c.divider)return o("div",{key:`divider-${g}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===g,y=!!c.disabled,h=!!(c.children&&c.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:f&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(g),d(h?g:null)},S=()=>{if(!y){if(h){d(g);return}c.onClick&&c.onClick(),r()}},z=[];c.icon&&z.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),z.push(o("span",{style:{flex:"1"}},c.label??"")),h&&z.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let R=[o("div",{key:`item-${g}`,style:p,onMouseEnter:x,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...z)];return h&&l===g&&R.push(o(ar,{key:`submenu-${g}`,items:c.children,position:{x:n.x+178,y:n.y+g*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${g}`,style:{position:"relative"}},...R)});return o("div",{ref:u,style:b,tabIndex:-1,role:"menu"},...m)}function kt(e){let{items:t,children:n}=e,[r,i]=j(null),s=v(u=>{u.preventDefault();let b=u;i({x:b.clientX,y:b.clientY})},[]),a=v(()=>{i(null)},[]);ie(()=>{if(!r)return;let u=m=>{a()},b=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(b),document.removeEventListener("mousedown",u)}},[r,a]),ie(()=>{if(!r)return;let u=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(ar,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Oa(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function Ha(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function lr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[b,m]=j(!1),[c,g]=j(!1),f=oe(null),y=s?"drawer-title":void 0;if(ie(()=>{if(t)m(!0),requestAnimationFrame(()=>g(!0));else{g(!1);let T=setTimeout(()=>m(!1),300);return()=>clearTimeout(T)}},[t]),ie(()=>{if(!t||!d)return;let T=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[t,d,n]),ie(()=>{if(!t)return;let T=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=T}},[t]),ie(()=>{t&&f.current&&f.current.focus()},[t]),!b)return null;let h={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},p={...Ha(r,i),transform:Oa(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},S={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},z={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},R={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},I=[];s&&I.push(o("div",{style:x},o("h3",{id:y,style:S},s),o("button",{type:"button",style:z,onClick:n,"aria-label":"Close drawer"},"\xD7"))),I.push(o("div",{style:R},u));let F=[];return a&&F.push(o("div",{style:h,onClick:C})),F.push(o("div",{ref:f,style:p,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...I)),o("div",null,...F)}var _a={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function cr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,b=oe(null);if(ie(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),ie(()=>{if(!t||!a)return;let C=I=>{I.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),ie(()=>{t&&b.current&&b.current.focus()},[t]),!t)return null;let m={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:_a[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},f={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},h={padding:"24px",overflow:"auto",flex:"1"},p={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},S=[],z=r?"modal-title":void 0;r?S.push(o("h2",{id:z,style:f},r)):S.push(o("span",null)),d&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let R=[o("div",{style:g},...S),o("div",{style:h},u)];return l&&R.push(o("div",{style:p},l)),o("div",{style:m,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":z},o("div",{ref:b,style:c,tabIndex:-1,role:"document"},...R))}var dr=8;function Ya(e,t){let n=t+dr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function Va(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${dr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function ur(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[b,m]=j(!1),c=u?r:b,g=oe(null),f=v(()=>{u?d&&d(!r):m(z=>!z)},[u,r,d]);ie(()=>{if(!c||!l)return;let z=R=>{g.current&&!g.current.contains(R.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},h={...Ya(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},p=[n];a&&p.push(o("div",{style:Va(i)}));let x=v(z=>{let R=z.key;(R==="Enter"||R===" ")&&(z.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:h},...p)),o("div",{ref:g,style:y},...S)}var Ga=0;function Ua(){return`toast-${++Ga}-${Date.now()}`}function Zt(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let b=Ua();return n=[{id:b,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),b}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var ja={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function Xa(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function qa(e){let{item:t,onDismiss:n}=e,r=ja[t.type];ie(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Jt(e){let{toaster:t}=e,[,n]=j(0);ie(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=Xa(t.config.position);ie(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
|
|
2
|
+
"use strict";var kt=Object.defineProperty;var ks=Object.getOwnPropertyDescriptor;var Cs=Object.getOwnPropertyNames;var Ms=Object.prototype.hasOwnProperty;var Es=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rs=(e,t)=>{for(var n in t)kt(e,n,{get:t[n],enumerable:!0})},Ps=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Cs(t))!Ms.call(e,i)&&i!==n&&kt(e,i,{get:()=>t[i],enumerable:!(r=ks(t,i))||r.enumerable});return e};var Is=e=>Ps(kt({},"__esModule",{value:!0}),e);var Be=(e,t,n)=>Es(e,typeof t!="symbol"?t+"":t,n);var ou={};Rs(ou,{Accordion:()=>tr,Alert:()=>ho,AnalogClock:()=>to,AppContextProvider:()=>_e,Avatar:()=>ro,Badge:()=>io,BarGraph:()=>Er,BigNumber:()=>Fi,BlochSphere:()=>Ni,BoxPlot:()=>Wi,Breadcrumb:()=>nr,BubbleChart:()=>Oi,Button:()=>Di,CalendarHeatMap:()=>Vi,Card:()=>_o,Carousel:()=>Zo,CartesianGraph2D:()=>Dr,Checkbox:()=>wo,ChordDiagram:()=>Ui,ColorPicker:()=>Co,ColorWheel:()=>Mo,ComplexGraph2D:()=>Fr,ContextMenu:()=>$t,DataGrid:()=>co,DatePicker:()=>Po,DecompositionTree:()=>ji,DigitalClock:()=>uo,DiscreteCartesian2D:()=>ws,DragDropProvider:()=>gt,Drawer:()=>xr,Dropdown:()=>rr,EmptyState:()=>bo,FileUpload:()=>Io,FlexContainer:()=>Oo,FlexItem:()=>Ho,Footer:()=>Kr,ForceGraph:()=>Ki,FormFieldWrapper:()=>xe,FunnelChart:()=>Ji,GanttChart:()=>ts,Gauge:()=>os,GoogleAnalytics:()=>qr,Grid:()=>Yo,GridItem:()=>Vo,HeatMap:()=>is,Histogram:()=>ss,HypercubeGraph:()=>jr,IDE:()=>Lt,Image:()=>Jo,LineGraph:()=>Or,ListView:()=>po,LollipopChart:()=>as,Matrix:()=>ls,Menubar:()=>sr,MessageBusProvider:()=>ft,Modal:()=>yr,MultilineField:()=>$o,NavWrapper:()=>ke,NumberSpinner:()=>To,Pagination:()=>lr,Panel:()=>jo,Partition:()=>cs,PieGraph:()=>Hr,PivotTable:()=>us,PolarGraph2D:()=>Vr,Popover:()=>vr,ProgressBar:()=>xo,RadarChart:()=>ps,RadioGroup:()=>zo,SankeyDiagram:()=>fs,ScrollContainer:()=>Xo,Select:()=>Do,Sidebar:()=>dr,Skeleton:()=>yo,Slider:()=>Ao,Spinner:()=>vo,Splitter:()=>qo,Stepper:()=>ur,Sunburst:()=>ms,Tabs:()=>Ko,Tag:()=>fo,TextEditor:()=>Lo,TextField:()=>Bo,ThreeDLayers:()=>Bi,TimePicker:()=>Fo,ToastContainer:()=>ln,Toggle:()=>No,Toolbar:()=>fr,Tooltip:()=>kr,TradingDashboard:()=>Nt,TreeMap:()=>hs,TreeNav:()=>hr,TreeNode:()=>et,USStateMap:()=>rs,US_STATE_PATHS:()=>vt,UnityApp:()=>$i,UnityDesktop:()=>Ii,VectorField:()=>ys,VideoPlayer:()=>er,VirtualScroll:()=>mo,VizWrapper:()=>Xr,WaterfallChart:()=>Ss,WordCloud:()=>vs,WordProcessor:()=>At,applyGate:()=>Wn,blochToCartesian:()=>lt,buildInputStyle:()=>Te,buildNavItemStyle:()=>Qe,buildRotationMatrix:()=>gn,cartesianToBloch:()=>Ut,computeBoxStats:()=>On,computeMandelbrotGrid:()=>Br,computeSlices:()=>pn,createToaster:()=>an,describeArc:()=>un,generateEdges:()=>mn,generateHypercube:()=>dt,generatePalette:()=>Dt,generateVertices:()=>fn,numRotationAngles:()=>ut,projectTo2D:()=>bn,transformVec:()=>hn,useAppId:()=>ot,useBarGraphScales:()=>cn,useChannel:()=>mt,useDragDrop:()=>Xe,useDraggable:()=>wn,useDropZone:()=>ht,useHover:()=>Se,useHypercube:()=>Gr,useLineGraphScales:()=>dn,useMessageBus:()=>Oe,useToast:()=>wr});module.exports=Is(ou);var Ct=Symbol.for("spec.element"),$s=Symbol.for("spec.fragment"),iu=Symbol.for("spec.portal"),Xn=Symbol.for("spec.provider"),qn=Symbol.for("spec.consumer"),Ts=Symbol.for("spec.forward_ref"),zs=Symbol.for("spec.memo"),Ds=Symbol.for("spec.lazy"),As=Symbol.for("spec.suspense"),Ls=Symbol.for("spec.strict_mode"),Bs=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let a in t)Object.prototype.hasOwnProperty.call(t,a)&&a!=="key"&&a!=="ref"&&a!=="__proto__"&&a!=="constructor"&&a!=="prototype"&&(s[a]=t[a])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let a=e.defaultProps;for(let l of Object.keys(a))l!=="__proto__"&&l!=="constructor"&&s[l]===void 0&&(s[l]=a[l])}return{$$typeof:Ct,type:e,props:s,key:r,ref:i}}function $e(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Xn,_context:t},r={$$typeof:qn,_context:t};return t.Provider=n,t.Consumer=r,t}var Ze=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};Ze.prototype.isSpecComponent=!0;var Mt=class extends Ze{shouldComponentUpdate(t,n){return!Zn(this.props,t)||!Zn(this.state,n)}};Mt.prototype.isPureSpecComponent=!0;function Zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let a of n)if(!Object.prototype.hasOwnProperty.call(s,a)||!Object.is(i[a],s[a]))return!1;return!0}var Jn=null;function Ne(){if(Jn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return Jn}function G(e){return Ne().useState(e)}function se(e,t){return Ne().useEffect(e,t)}function Re(e){return Ne().useContext(e)}function Qt(e,t,n){return Ne().useReducer(e,t,n)}function w(e,t){return Ne().useCallback(e,t)}function q(e,t){return Ne().useMemo(e,t)}function ne(e){return Ne().useRef(e)}function ge(){return Ne().useId()}var Je=$e({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Qn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Ns={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""},Ws=new Set;function _s(){Ns={pathname:Qn(),hash:typeof window<"u"?window.location.hash:""};for(let e of Ws)e()}typeof window<"u"&&window.addEventListener("hashchange",_s);var Op=$e({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function eo(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function Zs(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${s}/${a}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),a=String(i).padStart(2,"0");return`${n}-${s}-${a}`}}}var Ae={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function to(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=G(eo(a));se(()=>{let z=setInterval(()=>{u(eo(a))},1e3);return()=>clearInterval(z)},[a]);let g=d.getHours(),h=d.getMinutes(),c=d.getSeconds(),f=g%12*30+h*.5,p=h*6+c*.1,y=c*6,b=n/2,m=n/2,x=n/2-10,v=x-4,D=x-22,T=[];T.push(o("circle",{cx:String(b),cy:String(m),r:String(x),fill:Ae.face,stroke:Ae.border,"stroke-width":"3"}));for(let z=0;z<12;z++){let B=(z*30-90)*Math.PI/180,I=v-6;T.push(o("line",{x1:String(b+I*Math.cos(B)),y1:String(m+I*Math.sin(B)),x2:String(b+v*Math.cos(B)),y2:String(m+v*Math.sin(B)),stroke:Ae.border,"stroke-width":"2"}));let N=String(z===0?12:z);if(T.push(o("text",{x:String(b+D*Math.cos(B)),y:String(m+D*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ae.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let L=x-38,M=String(z===0?0:z+12);T.push(o("text",{x:String(b+L*Math.cos(B)),y:String(m+L*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ae.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},M))}}let C=(z,P,B,I)=>{let N=(z-90)*Math.PI/180;return o("line",{x1:String(b),y1:String(m),x2:String(b+P*Math.cos(N)),y2:String(m+P*Math.sin(N)),stroke:I,"stroke-width":B,"stroke-linecap":"round"})};T.push(C(f,x*.5,"4",Ae.hand)),T.push(C(p,x*.75,"3",Ae.hand)),s&&T.push(C(y,x*.85,"1.5",Ae.second)),T.push(o("circle",{cx:String(b),cy:String(m),r:"4",fill:Ae.hand}));let A=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...T)];return r&&A.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ae.numbers}},Zs(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...A)}var tn={xs:24,sm:32,md:40,lg:56,xl:80};function Js(e){return e==null?tn.md:typeof e=="number"?e:tn[e]??tn.md}function Qs(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var no=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function ea(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return no[Math.abs(t)%no.length]}var oo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ta(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function ro(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,g]=G(!1),h=Js(i),c=s==="circle"?"50%":`${Math.round(h*.15)}px`,f=a??ea(r),p=`${Math.round(h*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${h}px`,height:`${h}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},b;if(t&&!u)b=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>g(!0)});else{let D=Qs(r);b=o("span",{style:{fontSize:p,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},D)}let m=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":f},role:"img","aria-label":n??r??"avatar"},b);if(!l)return m;let x=Math.max(8,Math.round(h*.25)),v={position:"absolute",width:`${x}px`,height:`${x}px`,borderRadius:"50%",backgroundColor:oo[l]??oo.offline,border:"2px solid #fff",boxSizing:"border-box",...ta(d,x)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${h}px`,height:`${h}px`,flexShrink:"0"}},m,o("span",{style:v,"aria-label":l}))}var na={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},oa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function io(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:a="solid",children:l}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,g=r?{...oa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...na[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...a==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},h=u?o("span",{style:g,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return h??o("span",null);let c={...g,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},l,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var ra={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},so={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},nn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ia="6px 8px",sa={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},aa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},la={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},je={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ca={...je,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},ao={...je,opacity:"0.5",cursor:"default"},lo={cursor:"pointer",width:"16px",height:"16px"};function da(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function co(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:g,onSelectionChange:h,striped:c=!1,bordered:f=!1,compact:p=!1,stickyHeader:y=!1}=e,[b,m]=G(0),[x,v]=G(void 0),[D,T]=G("asc"),[C,$]=G([]),[A,z]=G({}),P=i??b,B=a??x,I=l??D,N=g??C,L=q(()=>{let ee=Object.entries(A).filter(([,te])=>te.length>0);return ee.length===0?n:n.filter(te=>ee.every(([le,ce])=>String(te[le]??"").toLowerCase().includes(ce.toLowerCase())))},[n,A]),M=q(()=>{if(!B)return L;let ee=[...L];return ee.sort((te,le)=>{let ce=te[B],oe=le[B];if(ce==null&&oe==null)return 0;if(ce==null)return 1;if(oe==null)return-1;if(typeof ce=="number"&&typeof oe=="number")return I==="asc"?ce-oe:oe-ce;let ue=String(ce),re=String(oe),ie=ue.localeCompare(re);return I==="asc"?ie:-ie}),ee},[L,B,I]),S=M.length,k=r?Math.max(1,Math.ceil(S/r)):1,E=r?M.slice(P*r,(P+1)*r):M,F=w(ee=>{s?s(ee):m(ee)},[s]),R=w(ee=>{let te=B===ee&&I==="asc"?"desc":"asc";d?d(ee,te):(v(ee),T(te))},[B,I,d]),W=w(ee=>{let te=N.includes(ee)?N.filter(le=>le!==ee):[...N,ee];h?h(te):$(te)},[N,h]),_=w(()=>{let ee=E.map((ce,oe)=>r?P*r+oe:oe),le=ee.every(ce=>N.includes(ce))?N.filter(ce=>!ee.includes(ce)):[...new Set([...N,...ee])];h?h(le):$(le)},[E,N,r,P,h]),O=w((ee,te)=>{z(le=>({...le,[ee]:te})),F(0)},[F]),H=t.some(ee=>ee.filterable),X=p?ia:nn.padding,J=[];if(u){let ee=E.map((le,ce)=>r?P*r+ce:ce),te=ee.length>0&&ee.every(le=>N.includes(le));J.push(o("th",{key:"__select_all",style:{...so,padding:X,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:te,onChange:_,style:lo,"aria-label":"Select all rows"})))}for(let ee of t){let te={...so,padding:X,...ee.width?{width:ee.width}:{},...ee.sortable?{cursor:"pointer"}:{},...f?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[ee.header];ee.sortable&&le.push(o("span",{style:sa},da(ee.key,B,I))),J.push(o("th",{key:ee.key,style:te,onClick:ee.sortable?()=>R(ee.key):void 0,onKeyDown:ee.sortable?ce=>{let oe=ce.key;(oe==="Enter"||oe===" ")&&(ce.preventDefault(),R(ee.key))}:void 0,tabIndex:ee.sortable?0:void 0,role:ee.sortable?"columnheader":void 0,"aria-sort":B===ee.key?I==="asc"?"ascending":"descending":void 0},...le))}let K=null;if(H){let ee=[];u&&ee.push(o("th",{key:"__filter_spacer",style:{padding:X}}));for(let te of t)ee.push(o("th",{key:`filter_${te.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},te.filterable?o("input",{type:"text",placeholder:`Filter ${te.header}...`,style:aa,value:A[te.key]??"",onInput:le=>O(te.key,le.target.value),"aria-label":`Filter by ${te.header}`}):null));K=o("tr",{key:"__filter_row"},...ee)}let U=[];for(let ee=0;ee<E.length;ee++){let te=E[ee],le=r?P*r+ee:ee,ce=N.includes(le),oe={};c&&ee%2===1&&(oe.backgroundColor="#f9fafb"),ce&&(oe.backgroundColor="#eff6ff");let ue=[];u&&ue.push(o("td",{key:"__select",style:{padding:X,textAlign:"center",...nn,...f?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:ce,onChange:()=>W(le),style:lo,"aria-label":`Select row ${le+1}`})));for(let re of t){let ie=te[re.key],de=re.render?re.render(ie,te):String(ie??"");ue.push(o("td",{key:re.key,style:{...nn,padding:X,...f?{border:"1px solid #e5e7eb"}:{}}},de))}U.push(o("tr",{key:String(le),style:oe},...ue))}let j=null;if(r){let ee=S===0?0:P*r+1,te=Math.min((P+1)*r,S),le=[];le.push(o("button",{key:"prev",style:P===0?ao:je,onClick:P>0?()=>F(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let ce=7,oe=Math.max(0,P-Math.floor(ce/2)),ue=Math.min(k,oe+ce);ue-oe<ce&&(oe=Math.max(0,ue-ce)),oe>0&&(le.push(o("button",{key:"p0",style:je,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let re=oe;re<ue;re++)le.push(o("button",{key:`p${re}`,style:re===P?ca:je,onClick:re!==P?()=>F(re):void 0,"aria-current":re===P?"page":void 0},String(re+1)));ue<k&&(ue<k-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${k-1}`,style:je,onClick:()=>F(k-1)},String(k)))),le.push(o("button",{key:"next",style:P>=k-1?ao:je,onClick:P<k-1?()=>F(P+1):void 0,disabled:P>=k-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:la},o("span",null,`Showing ${ee}\u2013${te} of ${S}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let V={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},Y={...ra,...f?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...J),K),Q=o("tbody",null,...U),ae=o("table",{style:Y,role:"grid","aria-rowcount":String(S)},Z,Q);return o("div",{style:V},ae,j)}function Ge(e){return e<10?`0${e}`:String(e)}function ua(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(a=>a.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function pa(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=a=>i.find(l=>l.type===a)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Ge(e.getMonth()+1)}/${Ge(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Ge(e.getMonth()+1)}-${Ge(e.getDate())}`}var fa={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},ma={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},ga={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},ha={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function uo(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=G(new Date);se(()=>{let m=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(m)},[]);let{hours:u,minutes:g,seconds:h}=ua(l,s),c,f=null;t==="12h"?(f=u>=12?"PM":"AM",c=u%12||12):c=u;let p=`${Ge(c)}:${Ge(g)}`;i&&(p+=`:${Ge(h)}`);let y=[p];f!=null&&y.push(o("span",{style:ga},f));let b=[o("span",{style:ma},...y)];return n&&b.push(o("span",{style:ha},pa(l,r,s))),o("div",{style:fa,...a?{class:a}:{}},...b)}var ba={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},xa={padding:"10px 14px",color:"var(--color-text, #1f2937)"},ya={borderBottom:"1px solid var(--color-border, #e5e7eb)"},Sa={cursor:"pointer",transition:"background-color 0.15s ease"},va={backgroundColor:"var(--color-bg-muted, #eff6ff)"},wa={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Et={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function po(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:a,onSelect:l,emptyMessage:d="No items",header:u,footer:g}=e;if(t.length===0)return o("div",null,u?o("div",{style:Et},u):null,o("div",{style:wa},d),g?o("div",{style:{...Et,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},g):null);let h=[];for(let c=0;c<t.length;c++){let f=t[c],p=r(f,c),y=a===c,b=c===t.length-1,m={...xa,...s?Sa:{},...y?va:{},...i&&!b?ya:{}};h.push(o("li",{key:p,style:m,onClick:l?()=>l(c):void 0,onKeyDown:l?x=>{let v=x.key;(v==="Enter"||v===" ")&&(x.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(f,c)))}return o("div",null,u?o("div",{style:Et},u):null,o("ul",{style:ba,role:l?"listbox":"list"},...h),g?o("div",{style:{...Et,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},g):null)}function ka(e){return e??"#3b82f6"}function Ca(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var Ma={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function Ea(e,t,n,r,i){let s=Ma[n],a={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...a,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...a,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...a,backgroundColor:Ca(e,.12),color:e,border:"none"};default:return a}}var Ra={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function fo(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:a,icon:l,onClick:d,disabled:u=!1}=e,g=ka(n),h=Ea(g,r,i,!!d,u),c=[];return l&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},l)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Ra,onClick:f=>{f.stopPropagation(),!u&&a&&a()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:h,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?f=>{let p=f.key;(p==="Enter"||p===" ")&&(f.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Pa={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function mo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=G(0),d=ne(null),u=t.length*r,g=parseInt(s,10)||400,h=Math.ceil(g/r),c=Math.max(0,Math.floor(a/r)-i),f=Math.min(t.length,Math.floor(a/r)+h+i),p=w(b=>{let m=b.target;l(m.scrollTop)},[]),y=[];for(let b=c;b<f;b++)y.push(o("div",{key:String(b),style:{position:"absolute",top:`${b*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[b],b)));return o("div",{ref:d,style:{...Pa,height:s},onScroll:p},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var go={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function ho(e){let[t,n]=G(!0),r=e.type??"info",i=e.variant??"subtle",s=go[r]??go.info,a=e.icon??s.icon,l=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},a),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:l?"4px":"0"}},e.title):null,l?o("div",null,l):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function bo(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function xo(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",a=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),l=e.variant??"bar",d=ge().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let f=typeof e.size=="number"?e.size:48,p=Math.max(2,Math.round(f/10)),y=(f-p)/2,b=2*Math.PI*y,m=e.indeterminate?b*.75:b-r/100*b,x=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},x?o("style",null,x):null,o("svg",{width:String(f),height:String(f),viewBox:`0 0 ${f} ${f}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(p)}),o("circle",{cx:String(f/2),cy:String(f/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(p),"stroke-dasharray":String(b),"stroke-dashoffset":String(m),"stroke-linecap":"round",transform:`rotate(-90 ${f/2} ${f/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",g=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:s,borderRadius:a,overflow:"hidden",position:"relative"},c=q(()=>{let f={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(f.position="absolute",f.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,f.backgroundColor=i):(f.width=`${r}%`,f.backgroundColor=i),e.animated&&!e.indeterminate&&(f.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${Ia(i)} 50%, ${i} 100%)`,f.backgroundSize="200% 100%",f.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),f},[r,i,a,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||g?o("style",null,u+g):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:c})))}function Ia(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function yo(e){let t=e.variant??"text",n=e.animated!==!1,r=ge().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let l=e.lines??1,d=[];for(let u=0;u<l;u++){let g=u===l-1&&l>1;d.push(o("div",{key:String(u),style:on({width:g?"75%":s??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<l-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let l=s??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:on({width:l,height:l,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:on({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function on(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var $a={sm:16,md:24,lg:40},So={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function vo(e){let t=typeof e.size=="number"?e.size:$a[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=So[e.speed??"normal"]??So.normal,s=e.label??"Loading",l=ge().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,g=q(()=>`@keyframes liq-rotate-${l}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[l]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,g),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${l} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function xe(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Te(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var Ta={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function wo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:a=!1,disabled:l=!1,error:d,size:u="md"}=e,g=ne(null);se(()=>{g.current&&(g.current.indeterminate=a)},[a]);let h=w(()=>{l||i(!r)},[l,r,i]),c=w(A=>{l||(A.key===" "||A.key==="Enter")&&(A.preventDefault(),i(!r))},[l,r,i]),f=Ta[u],p=`${f.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",b=r||a?"#3b82f6":"#ffffff",m={width:p,height:p,minWidth:p,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:b,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},x={color:"#ffffff",fontSize:`${f.icon}px`,lineHeight:"1",fontWeight:"700"},v=a?o("span",{style:x},"\u2014"):r?o("span",{style:x},"\u2713"):null,D={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},T=o("input",{ref:g,type:"checkbox",id:n,checked:r,disabled:l,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),C=o("div",{style:m},v),$=s?o("span",{style:{fontSize:f.fontSize,color:"#374151"}},s):null;return o(xe,{error:d,htmlFor:n},o("div",{style:D,onClick:h,onKeyDown:c,tabIndex:l?-1:0,role:"checkbox","aria-checked":a?"mixed":r?"true":"false","aria-disabled":l?"true":void 0,"aria-label":s},T,C,$))}var za=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function ko(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function Rt(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Co(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=za,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[g,h]=G(!1),[c,f]=G(r),p=ne(null);se(()=>{f(r)},[r]),se(()=>{let z=P=>{p.current&&!p.current.contains(P.target)&&h(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);let y=w(z=>{d||i(Rt(z))},[d,i]),b=w(z=>{let P=z.target.value;f(P);let B=P.startsWith("#")?P:`#${P}`;ko(B)&&i(Rt(B))},[i]),m=w(()=>{ko(c.startsWith("#")?c:`#${c}`)||f(r)},[c,r]),x={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},v={display:"flex",alignItems:"center",gap:"8px"},D={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},T={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(z=>{let P=Rt(z)===Rt(r);return o("div",{key:z,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:z,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(z),onKeyDown:I=>{let N=I.key;(N==="Enter"||N===" ")&&(I.preventDefault(),y(z))},role:"button",tabIndex:d?-1:0,title:z,"aria-label":`Select color ${z}`})}),$=a?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:b,onBlur:m,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,A=g?o("div",{style:D},o("div",{style:T},...C),$):null;return o(xe,{label:u,disabled:d,htmlFor:n},o("div",{ref:p,style:{position:"relative"}},o("div",{style:v,onClick:d?void 0:()=>h(!g),onKeyDown:d?void 0:z=>{let P=z.key;(P==="Enter"||P===" ")&&(z.preventDefault(),h(!g))},role:"button",tabIndex:d?-1:0,"aria-expanded":g?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:x}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),A))}function Mo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:a=!0,disabled:l=!1,label:d}=e,[u,g]=G(r),h=ne(null),c=w(((...b)=>{let x=b[0].target.value;g(x),i?.(x)}),[i]),f={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},p={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:l?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(xe,{label:d,htmlFor:n},o("div",{style:f},o("div",{style:p},o("input",{id:n,ref:h,type:"color",value:u,onInput:c,disabled:l,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:l?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),a?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var Eo=["January","February","March","April","May","June","July","August","September","October","November","December"],Da=["Su","Mo","Tu","We","Th","Fr","Sa"];function rn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Aa(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function Ro(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function La(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Po(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:a,maxDate:l,disabled:d=!1,placeholder:u="Select date...",label:g,error:h}=e,c=q(()=>rn(r),[r]),f=q(()=>rn(a),[a]),p=q(()=>rn(l),[l]),[y,b]=G(!1),[m,x]=G(()=>c?c.getFullYear():new Date().getFullYear()),[v,D]=G(()=>c?c.getMonth():new Date().getMonth()),T=ne(null),C=q(()=>new Date,[]);se(()=>{let R=W=>{T.current&&!T.current.contains(W.target)&&b(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let $=w(()=>{D(R=>R===0?(x(W=>W-1),11):R-1)},[]),A=w(()=>{D(R=>R===11?(x(W=>W+1),0):R+1)},[]),z=w(R=>{let W=new Date(m,v,R);f&&W<f||p&&W>p||(i(La(W)),b(!1))},[m,v,i,f,p]),P=c?Aa(c,s):"",B=q(()=>{let R=new Date(m,v,1).getDay(),W=new Date(m,v+1,0).getDate(),_=[],O=[];for(let H=0;H<R;H++)O.push(null);for(let H=1;H<=W;H++)O.push(H),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[m,v]),I={...Te({},{focused:y,error:!!h}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},L={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},M={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},S={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},k=Da.map(R=>o("div",{key:R,style:{padding:"4px"}},R)),E=B.map((R,W)=>{let _=R.map((O,H)=>{if(O===null)return o("div",{key:`empty-${W}-${H}`,style:{padding:"4px"}});let X=new Date(m,v,O),J=Ro(X,C),K=c?Ro(X,c):!1,U=f&&X<f||p&&X>p,j={padding:"4px",textAlign:"center",cursor:U?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:J?"700":"400",backgroundColor:K?"#3b82f6":"transparent",color:K?"#ffffff":U?"#d1d5db":J?"#3b82f6":"#1f2937",border:J&&!K?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:j,onClick:U?void 0:()=>z(O),onKeyDown:U?void 0:V=>{let Y=V.key;(Y==="Enter"||Y===" ")&&(V.preventDefault(),z(O))},role:U?void 0:"button",tabIndex:U?void 0:0,"aria-label":`${Eo[v]} ${O}, ${m}`,"aria-disabled":U?"true":void 0},String(O))});return o("div",{key:`row-${W}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},..._)}),F=y?o("div",{style:N},o("div",{style:L},o("button",{type:"button",style:M,onClick:$},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Eo[v]} ${m}`),o("button",{type:"button",style:M,onClick:A},"\u25B6")),o("div",{style:S},...k),...E):null;return o(xe,{label:g,error:h,disabled:d,htmlFor:n},o("div",{ref:T,style:{position:"relative"}},o("div",{id:n,style:I,onClick:d?void 0:()=>b(!y),onKeyDown:d?void 0:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),b(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function sn(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function Io(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:a,disabled:l=!1,label:d,helpText:u}=e,[g,h]=G([]),[c,f]=G(!1),[p,y]=G(""),b=ne(null),m=w(M=>{y("");let S=[];for(let E of M){if(a&&E.size>a){y(`File "${E.name}" exceeds maximum size of ${sn(a)}`);continue}S.push(E)}let k=s?[...g,...S]:S.slice(0,1);h(k),r(k)},[g,s,a,r]),x=w(M=>{if(M.preventDefault(),M.stopPropagation(),f(!1),l)return;let S=M.dataTransfer;if(!S)return;let k=Array.from(S.files);m(k)},[l,m]),v=w(M=>{M.preventDefault(),M.stopPropagation(),l||f(!0)},[l]),D=w(M=>{M.preventDefault(),M.stopPropagation(),f(!1)},[]),T=w(M=>{let S=M.target;S.files&&(m(Array.from(S.files)),S.value="")},[m]),C=w(M=>{let S=g.filter((k,E)=>E!==M);h(S),r(S)},[g,r]),$=w(()=>{l||b.current&&b.current.click()},[l]),A={border:`2px dashed ${c?"#3b82f6":p?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:l?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:l?"0.6":"1"},z={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},I=o("input",{id:n,ref:b,type:"file",accept:i,multiple:s,onChange:T,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:A,onClick:$,onKeyDown:M=>{let S=M.key;(S==="Enter"||S===" ")&&(M.preventDefault(),$())},onDrop:x,onDragOver:v,onDragLeave:D,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:z},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:B},i):null,a?o("div",{style:B},`Max size: ${sn(a)}`):null),L=g.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...g.map((M,S)=>{let k={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},E={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${S}`,style:k},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},M.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},sn(M.size))),o("button",{type:"button",style:E,onClick:F=>{F.stopPropagation(),C(S)},"aria-label":`Remove ${M.name}`},"\u2715"))})):null;return o(xe,{label:d,helpText:u,error:p||void 0,disabled:l,htmlFor:n},o("div",null,I,N,L))}function $o(e){let[t,n]=G(!1),[r,i]=G((e.value??e.defaultValue??"").length),s=ge().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...Te(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=w(c=>{let f=c.target,p=f.value;i(p.length),e.onChange&&e.onChange(p),e.autoResize&&(f.style.height="auto",f.style.height=`${f.scrollHeight}px`)},[e.onChange,e.autoResize]),g=o("textarea",{id:a,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),h=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(xe,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},g,h)}function To(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:a,step:l=1,disabled:d=!1,prefix:u,suffix:g,label:h,error:c}=e,[f,p]=G(!1),y=w(S=>{let k=S;return s!==void 0&&k<s&&(k=s),a!==void 0&&k>a&&(k=a),k},[s,a]),b=w(()=>{d||i(y(r+l))},[d,r,l,y,i]),m=w(()=>{d||i(y(r-l))},[d,r,l,y,i]),x=w(S=>{let k=S.target.value;if(k===""||k==="-")return;let E=parseFloat(k);isNaN(E)||i(y(E))},[y,i]),v=w(S=>{d||(S.key==="ArrowUp"?(S.preventDefault(),b()):S.key==="ArrowDown"&&(S.preventDefault(),m()))},[d,b,m]),D=s===void 0||r>s,T=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":f?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...f&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},$=S=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!S?"not-allowed":"pointer",color:d||!S?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),A={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},z={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:$(D),onClick:m,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:z},u):null,I=o("input",{id:n,type:"text",value:String(r),onInput:x,onKeyDown:v,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:d,style:A,"aria-label":h||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":a!==void 0?String(a):void 0}),N=g?o("span",{style:z},g):null,L=o("button",{type:"button",style:$(T),onClick:b,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),M=[P];return B&&M.push(B),M.push(I),N&&M.push(N),M.push(L),o(xe,{label:h,error:c,disabled:d,htmlFor:n},o("div",{style:C},...M))}function zo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:a,direction:l="vertical",disabled:d=!1,error:u,label:g}=e,h=w(y=>{d||s(y)},[d,s]),c=w(y=>{if(d)return;let b=r.filter(v=>!v.disabled);if(b.length===0)return;let m=b.findIndex(v=>v.value===i),x=m;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),x=m<b.length-1?m+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),x=m>0?m-1:b.length-1;else return;s(b[x].value)},[d,r,i,s]),f={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},p=r.map((y,b)=>{let m=y.value===i,x=d||!!y.disabled,v=`${n}-opt-${b}`,D={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":m?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},T={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:m?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:x?"not-allowed":"pointer",opacity:x?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:v,style:C,onClick:x?void 0:$=>{$.preventDefault(),h(y.value)}},o("input",{type:"radio",id:v,name:a,value:y.value,checked:m,disabled:x,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:D},o("div",{style:T})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(xe,{label:g,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:f,role:"radiogroup","aria-label":g,onKeyDown:c,tabIndex:d?-1:0},...p))}function Do(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:a="Select...",searchable:l=!1,multiple:d=!1,clearable:u=!1,disabled:g=!1,error:h,label:c,helpText:f}=e,[p,y]=G(!1),[b,m]=G(""),[x,v]=G(-1),D=ne(null),T=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=q(()=>{if(!l||!b)return r;let R=b.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(R))},[r,b,l]),$=q(()=>{let R={},W=[];for(let _ of C)_.group?(R[_.group]||(R[_.group]=[]),R[_.group].push(_)):W.push(_);return{groups:R,ungrouped:W}},[C]),A=q(()=>T.length===0?"":T.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[T,r]);se(()=>{let R=W=>{let _=W.target;D.current&&!D.current.contains(_)&&(y(!1),m(""))};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let z=w(R=>{if(d){let W=T.includes(R)?T.filter(_=>_!==R):[...T,R];s(W)}else s(R),y(!1),m("")},[d,T,s]),P=w(R=>{R.stopPropagation(),s(d?[]:"")},[d,s]),B=w(R=>{if(g)return;let W=R.key;if(!p&&(W==="Enter"||W===" "||W==="ArrowDown")){R.preventDefault(),y(!0),v(0);return}if(p){if(W==="Escape"){y(!1),m("");return}if(W==="ArrowDown")R.preventDefault(),v(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")R.preventDefault(),v(_=>Math.max(_-1,0));else if(W==="Enter"&&x>=0&&x<C.length){R.preventDefault();let _=C[x];_.disabled||z(_.value)}}},[g,p,x,C,z]),I={...Te({},{focused:p,error:!!h}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:g?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},N={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},L=(R,W)=>{let _=T.includes(R.value),O=W===x,H={padding:"8px 12px",cursor:R.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:R.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:R.value,style:H,onClick:R.disabled?void 0:()=>z(R.value),onMouseEnter:()=>v(W),role:"option","aria-selected":_?"true":"false","aria-disabled":R.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,R.label)},M=()=>{let R=[],W=0,{groups:_,ungrouped:O}=$;for(let H of O)R.push(L(H,W++));for(let H of Object.keys(_)){R.push(o("div",{key:`group-${H}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},H));for(let X of _[H])R.push(L(X,W++))}return R.length===0&&R.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),R},S=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:p?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),k=o("div",{style:I,id:n,onClick:g?void 0:()=>{y(!p),v(-1)},onKeyDown:B,tabIndex:g?-1:0,role:"combobox","aria-expanded":p?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:A?"#1f2937":"#9ca3af"}},A||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&T.length>0?o("span",{onClick:P,onKeyDown:R=>{let W=R.key;(W==="Enter"||W===" ")&&(R.preventDefault(),R.stopPropagation(),P(R))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,S)),E=l&&p?o("input",{type:"text",value:b,onInput:R=>{m(R.target.value),v(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,F=p?o("div",{style:N,role:"listbox"},E,...M()):null;return o(xe,{label:c,error:h,helpText:f,disabled:g,htmlFor:n},o("div",{ref:D,style:{position:"relative"}},k,F))}function Ao(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:a=100,step:l=1,showValue:d=!1,showTicks:u=!1,disabled:g=!1,marks:h,range:c=!1,label:f,error:p}=e,y=ne(null),b=ne(i);b.current=i;let[m,x]=G(null),v=q(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),D=ne(v);D.current=v;let T=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,$=w(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return T(s+O*(a-s))},[s,a,l]),A=w(W=>_=>{g||(_.preventDefault(),x(W))},[g]),z=w(W=>{if(g)return;let _=$(W);if(c){let O=Math.abs(_-v[0]),H=Math.abs(_-v[1]);O<=H?i([T(_),v[1]]):i([v[0],T(_)])}else i(T(_))},[g,$,c,v,i,s,a,l]);se(()=>{if(!m)return;let W=O=>{let H=$(O),X=D.current,J=b.current;m==="single"?J(T(H)):m==="start"?J([Math.min(T(H),X[1]),X[1]]):m==="end"&&J([X[0],Math.max(X[0],T(H))])},_=()=>x(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[m,$,s,a,l]);let P=w(W=>{if(g)return;let _=0;if(W.key==="ArrowRight"||W.key==="ArrowUp")_=l;else if(W.key==="ArrowLeft"||W.key==="ArrowDown")_=-l;else return;W.preventDefault(),c||i(T((typeof r=="number"?r:0)+_))},[g,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:g?"not-allowed":"pointer"},I=c?C(v[0]):0,N=C(c?v[1]:v[0]),L={position:"absolute",top:"0",left:`${I}%`,width:`${N-I}%`,height:"100%",backgroundColor:g?"#9ca3af":"#3b82f6",borderRadius:"3px"},M=W=>f?W==="start"?`${f} minimum`:W==="end"?`${f} maximum`:f:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",S=(W,_,O)=>{let H={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${g?"#9ca3af":"#3b82f6"}`,cursor:g?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},X={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:_==="single"||_==="start"?n:void 0,style:H,onMouseDown:A(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":M(_),tabIndex:g?-1:0,onKeyDown:P},d?o("div",{style:X},String(O)):null)},k=[];if(u)for(let W=s;W<=a;W+=l)k.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let E=[];if(h)for(let W of h)E.push(o("div",{key:`mark-${W.value}`,style:{position:"absolute",top:"18px",left:`${C(W.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},W.label));let F={paddingTop:d?"28px":"8px",paddingBottom:h||u?"28px":"8px",opacity:g?"0.6":"1"},R=[];return c?(R.push(S(C(v[0]),"start",v[0])),R.push(S(C(v[1]),"end",v[1]))):R.push(S(C(v[0]),"single",v[0])),o(xe,{label:f,error:p,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:z},o("div",{style:L}),...R,...k,...E)))}var Ba=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Fa={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function Lo(e){let[t,n]=G(!1),r=ne(null),i=ge().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??Ba,l=e.toolbarStyle??{},d=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=w((p,y)=>{if(!(e.disabled||e.readOnly)){if(p==="createLink"){let b=prompt("Enter URL:");if(!b)return;document.execCommand(p,!1,b)}else y&&p==="formatBlock"?document.execCommand(p,!1,`<${y}>`):document.execCommand(p,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),g=w(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),h=w(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:l.backgroundColor??"#f9fafb",borderBottom:l.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...a.map(p=>{let y=Fa[p];return y?o("button",{key:p,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:l.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:l.buttonSize??"13px",fontWeight:p==="bold"?"700":p==="italic"?"400":"500",fontStyle:p==="italic"?"italic":"normal",textDecoration:p==="underline"?"underline":p==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),f=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:h,onInput:g});return o(xe,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,f))}function Bo(e){let[t,n]=G(!1),r=ge().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Te(e.inputStyle??{},{focused:t,error:!!e.error}),a=!!(e.prefix||e.suffix),l=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:a?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let g=u.target.value;e.onInput&&e.onInput(g),e.onChange&&e.onChange(g)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=a?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,l,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):l;return o(xe,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Na=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function We(e){return String(e).padStart(2,"0")}function Wa(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function Fo(e){let t=ge().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:a=1,disabled:l=!1,label:d,error:u,showSeconds:g=!1,timezone:h,showTimezone:c=!1,timezones:f=Na,onTimezoneChange:p}=e,[y,b]=G(!1),m=q(()=>Wa(r),[r]),x=s==="12h",v=m.hour>=12,D=x?m.hour%12||12:m.hour,T=w((j,V,Y)=>{let Z=Math.max(0,Math.min(23,j)),Q=Math.max(0,Math.min(59,V)),ae=Math.max(0,Math.min(59,Y??0));i(g?`${We(Z)}:${We(Q)}:${We(ae)}`:`${We(Z)}:${We(Q)}`)},[i,g]),C=w(j=>{let V=parseInt(j.target.value,10)||0;x&&(V=V%12,v&&(V+=12)),T(V,m.minute,m.second)},[x,v,m.minute,m.second,T]),$=w(j=>{let V=parseInt(j.target.value,10)||0;T(m.hour,V,m.second)},[m.hour,m.second,T]),A=w(j=>{let V=parseInt(j.target.value,10)||0;T(m.hour,m.minute,V)},[m.hour,m.minute,T]),z=w(()=>{if(l)return;let j=v?m.hour-12:m.hour+12;T(j,m.minute,m.second)},[l,v,m.hour,m.minute,m.second,T]),P=w(j=>{l||T(m.hour+j,m.minute,m.second)},[l,m.hour,m.minute,m.second,T]),B=w(j=>{l||T(m.hour,m.minute+j*a,m.second)},[l,m.hour,m.minute,m.second,a,T]),I=w(j=>{l||T(m.hour,m.minute,m.second+j)},[l,m.hour,m.minute,m.second,T]),N=w(j=>{let V=j.target.value;p&&p(V)},[p]),L={display:"inline-flex",alignItems:"center",gap:"4px",...Te({},{focused:y,error:!!u})},M={display:"flex",flexDirection:"column",alignItems:"center"},S={background:"none",border:"none",cursor:l?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},k={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},E={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},F=o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>P(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(D),onChange:C,style:k,disabled:l,"aria-label":"Hour",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>P(-1),disabled:l},"\u25BC")),R=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(m.minute),onChange:$,style:k,disabled:l,"aria-label":"Minute",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>B(-1),disabled:l},"\u25BC")),_=g?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=g?o("div",{style:M},o("button",{type:"button",style:S,onClick:()=>I(1),disabled:l},"\u25B2"),o("input",{type:"text",value:We(m.second),onChange:A,style:k,disabled:l,"aria-label":"Second",onFocus:()=>b(!0),onBlur:()=>b(!1)}),o("button",{type:"button",style:S,onClick:()=>I(-1),disabled:l},"\u25BC")):null,H=x?o("button",{type:"button",style:E,onClick:z,disabled:l,"aria-label":"Toggle AM/PM"},v?"PM":"AM"):null,X={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},J=h&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},h):null,K=c?o("select",{style:X,value:h??f[0],onChange:N,disabled:l,"aria-label":"Timezone"},...f.map(j=>o("option",{key:j,value:j},j))):null,U=[F,R,W];return _&&U.push(_),O&&U.push(O),H&&U.push(H),J&&U.push(J),K&&U.push(K),o(xe,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:L},...U))}var _a={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function No(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:a="md",onColor:l="#3b82f6",offColor:d="#d1d5db"}=e,u=_a[a],g=w(()=>{s||n(!t)},[s,t,n]),h=w(v=>{s||(v.key===" "||v.key==="Enter")&&(v.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?l:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},f=t?u.trackW-u.thumbSize-u.offset:u.offset,p={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${f}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},b=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,m=o("div",{style:c},o("div",{style:p}));return o("div",{style:y,onClick:g,onKeyDown:h,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[b,m]:[m,b]).filter(Boolean))}var Wo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function _o(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let g={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(g.border="1px solid #e5e7eb"),g.boxShadow=Wo[n]??Wo.sm,e.hoverable&&(g.cursor="pointer"),{...g,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},l={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:l},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function Oo(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function Ho(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function Yo(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function Vo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var Uo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function jo(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=G(!!e.defaultCollapsed),s=ne(null),[a,l]=G("auto");se(()=>{if(!e.collapsible)return;let y=s.current;y&&l(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=w(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=w(y=>{if(!e.collapsible)return;let b=y.key;(b==="Enter"||b===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),g=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=Uo[n]??Uo.none,{...y,...e.style??{}}},[t,n,e.style]),h={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},f={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},p={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:g},o("div",{className:"panel__header",style:h,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?f:{},ref:s},o("div",{className:"panel__body",style:p},e.children)))}function Go(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Oa(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function Xo(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=G(!0),[l,d]=G(!1),[u,g]=G(!0),[h,c]=G(!1),f=w(()=>{let x=i.current;if(!x)return;let v=2;a(x.scrollTop<=v),d(x.scrollTop+x.clientHeight>=x.scrollHeight-v),g(x.scrollLeft<=v),c(x.scrollLeft+x.clientWidth>=x.scrollWidth-v)},[]);se(()=>{f()},[f]);let p=w(()=>{r&&f()},[r,f]),y=q(()=>{let x={position:"relative",overflowX:Go(t,"x"),overflowY:Go(t,"y"),...Oa(n)};return e.maxHeight&&(x.maxHeight=e.maxHeight),e.maxWidth&&(x.maxWidth=e.maxWidth),e.padding&&(x.padding=e.padding),{...x,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),b=[];if(r){let x=t==="vertical"||t==="both",v=t==="horizontal"||t==="both";x&&!s&&b.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),x&&!l&&b.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),v&&!u&&b.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),v&&!h&&b.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let m={...y};return b.length>0&&(m.boxShadow=b.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:m,ref:i,onScroll:p},e.children)}function qo(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=G(e.initialSplit??50),l=ne(null),d=ne(!1),u=w(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=m=>{if(!d.current||!l.current)return;let x=l.current.getBoundingClientRect(),v=n?x.width:x.height,D=n?m.clientX-x.left:m.clientY-x.top;if(v<=0)return;let T=i/v*100,C=e.maxSize?e.maxSize/v*100:100-T,$=D/v*100;$=Math.max(T,Math.min(C,$)),a($)},b=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",b)}},[n,i,e.maxSize]);let g=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),h=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},f={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},p=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:g,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:h},p[0]??null),o("div",{className:"splitter__divider",style:f,onMouseDown:u,onKeyDown:y=>{let b=y.key,m=2;n&&(b==="ArrowLeft"||b==="ArrowRight")?(y.preventDefault(),a(x=>{let v=b==="ArrowRight"?m:-m;return Math.max(5,Math.min(95,x+v))})):!n&&(b==="ArrowUp"||b==="ArrowDown")&&(y.preventDefault(),a(x=>{let v=b==="ArrowDown"?m:-m;return Math.max(5,Math.min(95,x+v))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},p[1]??null))}function Ko(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(m=>!m.disabled)?.id??"",[i,s]=G(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=w(m=>{s(m),e.onChange&&e.onChange(m)},[e.onChange]),u=w(m=>{let x=e.tabs.filter(A=>!A.disabled),v=x.findIndex(A=>A.id===a);if(v===-1)return;let D=t==="left"||t==="right",T=D?"ArrowUp":"ArrowLeft",C=D?"ArrowDown":"ArrowRight",$=-1;if(m.key===T?$=v>0?v-1:x.length-1:m.key===C?$=v<x.length-1?v+1:0:m.key==="Home"?$=0:m.key==="End"&&($=x.length-1),$>=0){m.preventDefault(),d(x[$].id);let A=l.current;if(A){let P=A.querySelectorAll('[role="tab"]')[e.tabs.indexOf(x[$])];P&&P.focus()}}},[e.tabs,a,t,d]),g=t==="left"||t==="right",h=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:g?h?"row-reverse":"row":h?"column-reverse":"column",width:"100%",...e.style??{}}),[g,h,e.style]),f={display:"flex",flexDirection:g?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!g?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&g?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},p={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(m=>m.id===a),b=e.tabs.map(m=>{let x=m.id===a,v={padding:"8px 16px",border:"none",background:"none",cursor:m.disabled?"not-allowed":"pointer",opacity:m.disabled?"0.5":"1",fontSize:"14px",fontWeight:x?"600":"400",color:x?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?g?t==="left"?(v.borderRight=x?"2px solid #3b82f6":"2px solid transparent",v.marginRight="-2px"):(v.borderLeft=x?"2px solid #3b82f6":"2px solid transparent",v.marginLeft="-2px"):(v.borderBottom=x?"2px solid #3b82f6":"2px solid transparent",v.marginBottom="-2px"):n==="card"?(v.backgroundColor=x?"#ffffff":"transparent",v.borderRadius="6px 6px 0 0",x&&(v.border="1px solid #e5e7eb",v.borderBottom="1px solid #ffffff")):n==="pill"&&(v.borderRadius="9999px",v.backgroundColor=x?"#3b82f6":"transparent",v.color=x?"#ffffff":"#6b7280"),o("button",{key:m.id,role:"tab","aria-selected":String(x),"aria-controls":`tabpanel-${m.id}`,"aria-disabled":m.disabled?"true":void 0,id:`tab-${m.id}`,tabIndex:x?"0":"-1",style:v,onClick:m.disabled?void 0:()=>d(m.id),onKeyDown:u},m.icon?o("span",{className:"tabs__tab-icon"},m.icon):null,m.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":g?"vertical":"horizontal",style:f,ref:l},...b),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:p,tabIndex:"0"},y?y.content:null))}function Zo(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,a=e.animation??"slide",l=e.interval??5e3,d=ge().replace(/[^a-zA-Z0-9_-]/g,""),[u,g]=G(0),h=ne(null),c=ne(null),f=w(C=>{let $=C;r?$=(C%n+n)%n:$=Math.max(0,Math.min(C,n-1)),g($),e.onChange&&e.onChange($)},[n,r,e.onChange]),p=w(()=>f(u+1),[u,f]),y=w(()=>f(u-1),[u,f]);se(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(p,l);return()=>clearInterval(C)},[e.autoPlay,l,p,n]),se(()=>{let C=A=>{A.key==="ArrowLeft"?y():A.key==="ArrowRight"&&p()},$=c.current;if($)return $.addEventListener("keydown",C),()=>$.removeEventListener("keydown",C)},[p,y]);let b=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",m={position:"relative",overflow:"hidden",width:"100%",outline:"none"},x=q(()=>a==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,a]),v={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},D=t.map((C,$)=>{let A=a==="fade"?{position:$===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:$===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String($),style:A},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),T=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,$)=>o("button",{key:String($),"aria-label":`Go to slide ${$+1}`,onclick:()=>f($),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:$===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:m,onpointerdown:C=>{h.current=C.clientX},onpointerup:C=>{if(h.current==null)return;let $=C.clientX-h.current;$>50?y():$<-50&&p(),h.current=null}},b?o("style",null,b):null,o("div",{style:x},...D),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...v,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:p,style:{...v,right:"8px"}},"\u203A"):null,T)}function Jo(e){let[t,n]=G("loading"),r=ne(null),i=ge().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,a=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;se(()=>{n("loading")},[e.src]);let d=q(()=>{let f={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(f.width=a),l&&(f.height=l),e.borderRadius&&(f.borderRadius=e.borderRadius),f},[a,l,e.borderRadius]),u=q(()=>{let f={display:"block",width:"100%",height:"100%"};return e.objectFit&&(f.objectFit=e.objectFit),t==="loading"&&(f.opacity="0",f.position="absolute"),t==="error"&&(f.display="none"),f},[e.objectFit,t]),g=null;if(t==="loading")if(e.placeholder==="skeleton"){let f=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;g=o("div",null,o("style",null,f),o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?g=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(g=e.placeholder);let h=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?h=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):h=e.fallback);let c=o("div",{style:d},g,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),h);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function Qo(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function er(e){let t=e.controls!==!1,n=ne(null),r=ge().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=G(!1),[a,l]=G(0),[d,u]=G(0),[g,h]=G(e.muted?0:1),[c,f]=G(!!e.muted),[p,y]=G(!0),b=typeof e.width=="number"?`${e.width}px`:e.width??"100%",m=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let z=n.current;if(!z)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},I=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(z.currentTime),u(z.duration),e.onTimeUpdate&&e.onTimeUpdate(z.currentTime,z.duration)},L=()=>{u(z.duration)};return z.addEventListener("play",P),z.addEventListener("pause",B),z.addEventListener("ended",I),z.addEventListener("timeupdate",N),z.addEventListener("loadedmetadata",L),()=>{z.removeEventListener("play",P),z.removeEventListener("pause",B),z.removeEventListener("ended",I),z.removeEventListener("timeupdate",N),z.removeEventListener("loadedmetadata",L)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let x=w(()=>{let z=n.current;z&&(z.paused?z.play():z.pause())},[]),v=w(z=>{let P=n.current;if(!P||!isFinite(P.duration))return;let B=z.currentTarget.getBoundingClientRect(),I=Math.max(0,Math.min(1,(z.clientX-B.left)/B.width));P.currentTime=I*P.duration},[]),D=w(z=>{let P=n.current,B=parseFloat(z.target.value);P&&(P.volume=B,P.muted=B===0,h(B),f(B===0))},[]),T=w(()=>{let z=n.current;z&&z.requestFullscreen&&z.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:b,height:m,display:"block"}});let C=d>0?a/d*100:0,$={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},A=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:p?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:x,style:$},i?"\u23F8":"\u25B6"),o("div",{onclick:v,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${Qo(a)} / ${Qo(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:g),oninput:D,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:T,style:$},"\u26F6"));return o("div",{style:{position:"relative",width:b,height:m,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:x,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)}function ke(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ne(null),a={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},l=w(d=>{if(!r)return;let u=d,g=s.current;if(!g)return;let h=Array.from(g.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=h.indexOf(document.activeElement);if(c<0)return;let f=t==="vertical",p=f?"ArrowDown":"ArrowRight",y=f?"ArrowUp":"ArrowLeft";if(u.key===p){u.preventDefault();let b=h[c+1];b&&b.focus()}else if(u.key===y){u.preventDefault();let b=h[c-1];b&&b.focus()}else u.key==="Home"?(u.preventDefault(),h[0]?.focus()):u.key==="End"&&(u.preventDefault(),h[h.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:l},e.children)}function Qe(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function Se(){let[e,t]=G(!1);return{hover:e,onMouseEnter:w(()=>t(!0),[]),onMouseLeave:w(()=>t(!1),[])}}function Ha(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:g}=Se(),h=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:h?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:h?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:h?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};l==="left"&&(c.flexDirection="row");let f=w(v=>{let D=v;h||(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),r())},[h,r]),p=w(()=>{h||r()},[h,r]),b=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:l==="right"?"auto":"0",marginRight:l==="left"?"8px":"0",paddingLeft:l==="right"?"8px":"0"}},n?a:s),m=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,x=l==="left"?[b,m]:[m,b];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":h?"true":void 0,"data-section-id":t.id,tabIndex:h?-1:0,style:c,onClick:p,onKeyDown:f,onMouseEnter:u,onMouseLeave:g},...x)}function Ya(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:a},t.content))}function tr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:g=!0,onChange:h}=e,[c,f]=G(()=>n??[]),p=w(b=>{f(m=>{let x=m.includes(b),v;return x?v=m.filter(D=>D!==b):r?v=[...m,b]:v=[b],h&&h(v),v})},[r,h]),y=q(()=>t.map(b=>{let m=c.includes(b.id),x=o(Ha,{key:`header-${b.id}`,section:b,expanded:m,onToggle:()=>p(b.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),v=o(Ya,{key:`content-${b.id}`,section:b,expanded:m,contentStyle:s,animated:g});return o("div",{key:b.id,"data-accordion-section":b.id,style:{width:"100%"}},x,v)}),[t,c,i,s,l,d,u,g,p]);return o(ke,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var Va={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function nr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=G(!1),l=Va[i],d=w(()=>{a(!0)},[]),u=t,g=!1;if(r&&r>1&&t.length>r&&!s){g=!0;let p=1,y=r-1;u=[...t.slice(0,p),{label:"..."},...t.slice(t.length-y)]}let h=p=>typeof p=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},p):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},p),c=(p,y,b)=>{let m=y===b.length-1,x=g&&p.label==="..."&&y===1,v=[];return y>0&&v.push(h(n)),x?v.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:l.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):m?v.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:l.fontSize}},p.label)):p.href?v.push(o("a",{href:p.href,onClick:p.onClick?D=>{D.preventDefault(),p.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:l.fontSize}},p.label)):p.onClick?v.push(o("button",{type:"button",onClick:p.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:l.fontSize,fontFamily:"inherit"}},p.label)):v.push(o("span",{style:{color:"#6b7280",fontSize:l.fontSize}},p.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...v)},f=u.map((p,y)=>c(p,y,u));return o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:l.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...f))}function or(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Se(),[d,u]=G(!1),g=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,f={...Qe(n,{hover:!h&&s,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},p=w(()=>{if(!h){if(g){u(D=>!D);return}t.onClick&&t.onClick(),r&&i()}},[h,g,t,r,i]),y=w(()=>{a(),g&&u(!0)},[g,a]),b=w(()=>{l(),g&&u(!1)},[g,l]),m=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),x=g?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,v=g&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(ke,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(D=>o(or,{key:D.id,item:D,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:b},o("button",{type:"button",role:"menuitem",style:f,onClick:p,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":g||void 0,"aria-expanded":g?String(d):void 0},m,x),v)}function rr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,g]=G(!1),h=ne(null),c=w(()=>{g(D=>!D)},[]),f=w(()=>{g(!1)},[]);se(()=>{if(!u)return;let D=T=>{let C=h.current;C&&!C.contains(T.target)&&g(!1)};return document.addEventListener("click",D,!0),()=>{document.removeEventListener("click",D,!0)}},[u]),se(()=>{if(!u)return;let D=T=>{T.key==="Escape"&&g(!1)};return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[u]);let p={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:p,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),b=typeof d=="number"?`${d}px`:d,m={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},x={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:b,backgroundColor:"#ffffff",...i??{}},v=u?o("div",{style:m},o(ke,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:x},...n.map(D=>o(or,{key:D.id,item:D,itemStyle:s,closeOnSelect:l,onClose:f})))):null;return o("div",{ref:h,style:{position:"relative",display:"inline-block"}},y,v)}function ir(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Se(),[l,d]=G(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let g=t.disabled===!0,h=w(()=>{if(!g){if(u){d(x=>!x);return}t.onClick&&t.onClick(),n()}},[g,u,t,n]),c=w(()=>{s(),u&&d(!0)},[u,s]),f=w(()=>{a(),u&&d(!1)},[u,a]),p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:g?"default":"pointer",backgroundColor:!g&&i?"#f3f4f6":"transparent",color:g?"#9ca3af":"#1f2937",opacity:g?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,m=u&&l?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((x,v)=>o(ir,{key:String(v),item:x,onClose:n,index:v})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:f},o("button",{type:"button",role:"menuitem",style:p,onClick:h,disabled:g||void 0,tabIndex:-1,"aria-disabled":g||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,b),m)}function Ua(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Se(),g=ne(null),h=w(()=>{r?a():s(n)},[r,n,s,a]),c=w(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),f={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":l?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},p=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,b)=>o(ir,{key:String(b),item:y,onClose:a,index:b})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:g,type:"button",role:"menuitem",style:f,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),p)}function sr(e){let{menus:t}=e,[n,r]=G(null),i=ne(null),s=w(d=>{r(d)},[]),a=w(()=>{r(null)},[]);se(()=>{if(n===null)return;let d=u=>{let g=i.current;g&&!g.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),se(()=>{let d=i.current;if(!d)return;let u=g=>{let h=g;if(h.key==="Escape"){r(null);return}if(h.key==="ArrowRight"){h.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(h.key==="ArrowLeft"){h.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(h.key==="ArrowDown"&&n!==null){h.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let f=c.querySelector('[role="menuitem"]');f&&f.focus()}return}h.key==="Enter"||h.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let l=t.map((d,u)=>o(Ua,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:a}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...l)}function Pt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ja(e,t,n){let r=n*2+5;if(e<=r)return Pt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),a=i>2,l=s<e-1;return!a&&l?[...Pt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Pt(e-n*2-2,e)]:[1,"ellipsis",...Pt(i,s),"ellipsis",e]}var It={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},Ga={...It,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},ar={...It,color:"#9ca3af",cursor:"default",opacity:"0.5"},Xa={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function lr(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:a=!0,showPrevNext:l=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),g=Math.min(Math.max(1,r),u),h=w(b=>{!d&&b>=1&&b<=u&&b!==g&&i(b)},[d,u,g,i]),c=(b,m,x)=>{let v=d||m<1||m>u||m===g;return o("button",{type:"button",onClick:()=>h(m),disabled:v||void 0,"aria-label":x,style:v?ar:It},b)},f=ja(u,g,s),p=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",g-1,"Go to previous page"));for(let b of f)if(b==="ellipsis")y.push(o("span",{key:`ellipsis-${p++}`,style:Xa},"..."));else{let m=b===g;y.push(o("button",{key:String(b),type:"button",onClick:()=>h(b),disabled:d||void 0,"aria-label":`Page ${b}`,"aria-current":m?"page":void 0,style:d?ar:m?Ga:It},String(b)))}return l&&y.push(c("\u203A",g+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function cr(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Se(),[u,g]=G(!1),h=t.children&&t.children.length>0,c=t.id===r,f=w(()=>{h&&!n&&g($=>!$),i&&i(t.id)},[h,n,i,t.id]),p=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${p}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":a?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},b=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,m=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),x=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,v=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,D=n&&a?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,T=o("button",{type:"button",style:y,onClick:f,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},b,m,x,v,D),C=!n&&h&&u?t.children.map($=>o(cr,{key:$.id,item:$,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},T,C?o("div",{role:"group"},...C):null)}function dr(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:a="240px",collapsedWidth:l="56px"}=e,d=n?typeof l=="number"?`${l}px`:l:typeof a=="number"?`${a}px`:a,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,g=t.map(h=>o(cr,{key:h.id,item:h,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(ke,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...g)}var Ie={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function ur(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:a="circle"}=e,l=r==="horizontal",d=a==="circle"?32:12,u=a==="dot"?12:32,g=w(b=>{s&&i&&i(b)},[s,i]),h=b=>b<n?"completed":b===n?"active":"pending",c=(b,m,x)=>{let v=a==="dot"?u:d,D={width:`${v}px`,height:`${v}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return x==="completed"?o("div",{style:{...D,backgroundColor:Ie.completedBg,color:Ie.completedText,border:`2px solid ${Ie.completed}`}},a==="circle"?m.icon||"\u2713":null):x==="active"?o("div",{style:{...D,backgroundColor:"#ffffff",color:Ie.activeText,border:`2px solid ${Ie.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?m.icon||String(b+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ie.active}})):o("div",{style:{...D,backgroundColor:"#ffffff",color:Ie.pendingText,border:`2px solid ${Ie.pending}`}},a==="circle"?m.icon||String(b+1):null)},f=b=>{if(b>=t.length-1)return null;let x=b<n?Ie.lineCompleted:Ie.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:x,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:x,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},p=(b,m)=>{let x=h(m),v=x==="active",D=x==="completed",T=c(m,b,x),C={fontSize:"13px",fontWeight:v?"600":"400",color:v||D?Ie.labelActive:Ie.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},$={fontSize:"11px",color:Ie.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},A=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},b.label),b.description?o("span",{style:$},b.description):null),z=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},T,A):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},T,A);return o(s?"button":"div",{key:String(m),onClick:s?()=>g(m):void 0,style:{display:"flex",flexDirection:l?"column":"row",alignItems:l?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":v?"step":void 0},z)},y=[];return t.forEach((b,m)=>{y.push(p(b,m));let x=f(m);x&&y.push(x)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var pr={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function qa(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Se(),l=pr[n],d=t.disabled===!0,u=t.type==="toggle",[g,h]=G(!1),c=u?t.active===!0:g,f=w(()=>{!d&&t.onClick&&t.onClick()},[d,t]),p=w(()=>{!d&&!u&&h(!0)},[d,u]),y=w(()=>{u||h(!1)},[u]),b=w(()=>{a(),u||h(!1)},[u,a]),m={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:l.height,padding:l.padding,fontSize:l.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},x=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,v=t.label?o("span",null,t.label):null,D=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:m,onClick:f,onMouseDown:p,onMouseUp:y,onMouseEnter:s,onMouseLeave:b,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},x,v,D)}function fr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=pr[n],s=t.map(a=>a.type==="separator"?o("div",{key:a.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):a.type==="spacer"?o("div",{key:a.id,style:{flex:"1"},"aria-hidden":"true"}):o(qa,{key:a.id,item:a,size:n,variant:r}));return o(ke,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var et=class e{constructor(t,n){Be(this,"id");Be(this,"label");Be(this,"children");Be(this,"expanded");Be(this,"icon");Be(this,"metadata");Be(this,"parent");Be(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function mr(e){e.expanded=!0;for(let t of e.children)mr(t)}function gr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)gr(n,t);return t}function Ka(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function Za(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:g,onClick:h,focusedId:c}=e,f=Se(),p=ne(null),y=c===t.id;se(()=>{y&&p.current&&p.current.focus()},[y]);let b=t.isLeaf(),m=t.depth,x=[];for(let $=0;$<m;$++){let A=t;for(let P=0;P<m-$;P++)A=A?A.parent:null;let z=A?!Ka(A):!1;x.push(o("span",{key:`connector-${$}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...z?{borderLeft:`${s}px solid ${i}`}:{}}}))}let v=m>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,D=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:$=>{$.stopPropagation(),g(t)}},t.expanded?a:l),T=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),C=Qe(d,{hover:f.hover,active:n});return o("div",{ref:p,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":m+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onClick:()=>h(t)},...x,v,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},D,T))}function hr(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:a=!1,lineColor:l="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:g="\u2212",iconCollapsed:h="+",nodeStyle:c={},wrapperStyle:f,renderNode:p}=e,[y,b]=G(()=>{let z=et.fromData(t);return a&&mr(z),z}),[m,x]=G(t.id),v=q(()=>gr(y),[y]),D=w(()=>{b(z=>{let P=Object.create(Object.getPrototypeOf(z));return Object.assign(P,z),P})},[]),T=w(z=>{z.toggle(),z.expanded?r?.(z):i?.(z),D()},[r,i,D]),C=w(z=>{x(z.id),n?.(z)},[n]),$=w(z=>{let P=z;if(!m)return;let B=v.findIndex(N=>N.id===m);if(B===-1)return;let I=v[B];switch(P.key){case"ArrowDown":{P.preventDefault();let N=v[B+1];N&&x(N.id);break}case"ArrowUp":{P.preventDefault();let N=v[B-1];N&&x(N.id);break}case"ArrowRight":{P.preventDefault(),I.isLeaf()||(I.expanded?I.children.length>0&&x(I.children[0].id):T(I));break}case"ArrowLeft":{P.preventDefault(),!I.isLeaf()&&I.expanded?T(I):I.parent&&x(I.parent.id);break}case"Enter":{P.preventDefault(),C(I);break}case" ":{P.preventDefault(),I.isLeaf()||T(I);break}case"Home":{P.preventDefault(),v.length>0&&x(v[0].id);break}case"End":{P.preventDefault(),v.length>0&&x(v[v.length-1].id);break}}},[m,v,T,C]),A=v.map(z=>o(Za,{key:z.id,node:z,isSelected:z.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:g,iconCollapsed:h,nodeStyle:c,renderNode:p,onToggle:T,onClick:C,focusedId:m}));return o(ke,{role:"tree",ariaLabel:"Tree navigation",styling:f,keyboardNav:!1},o("div",{onKeyDown:$,style:{outline:"none"}},...A))}function br(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=G(-1),[l,d]=G(null),u=ne(null);se(()=>{if(!u.current)return;u.current.focus();let c=p=>{let y=p,b=t.map((m,x)=>({item:m,i:x})).filter(({item:m})=>!m.divider);if(y.key==="ArrowDown")y.preventDefault(),a(m=>{let v=(b.findIndex(({i:D})=>D===m)+1)%b.length;return b[v].i});else if(y.key==="ArrowUp")y.preventDefault(),a(m=>{let x=b.findIndex(({i:D})=>D===m),v=x<=0?b.length-1:x-1;return b[v].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let m=t[s];m.children?d(s):!m.disabled&&m.onClick&&(m.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let f=u.current;return()=>f.removeEventListener("keydown",c)},[t,s,i,r]);let g={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},h=t.map((c,f)=>{if(c.divider)return o("div",{key:`divider-${f}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let p=s===f,y=!!c.disabled,b=!!(c.children&&c.children.length>0),m={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:p&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},x=()=>{a(f),d(b?f:null)},v=()=>{if(!y){if(b){d(f);return}c.onClick&&c.onClick(),r()}},D=[];c.icon&&D.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),D.push(o("span",{style:{flex:"1"}},c.label??"")),b&&D.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let T=[o("div",{key:`item-${f}`,style:m,onMouseEnter:x,onClick:v,role:"menuitem","aria-disabled":y?"true":void 0},...D)];return b&&l===f&&T.push(o(br,{key:`submenu-${f}`,items:c.children,position:{x:n.x+178,y:n.y+f*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${f}`,style:{position:"relative"}},...T)});return o("div",{ref:u,style:g,tabIndex:-1,role:"menu"},...h)}function $t(e){let{items:t,children:n}=e,[r,i]=G(null),s=w(u=>{u.preventDefault();let g=u;i({x:g.clientX,y:g.clientY})},[]),a=w(()=>{i(null)},[]);se(()=>{if(!r)return;let u=h=>{a()},g=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(g),document.removeEventListener("mousedown",u)}},[r,a]),se(()=>{if(!r)return;let u=g=>{g.key==="Escape"&&a()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,a]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(br,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Ja(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function Qa(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function xr(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:a=!0,closeOnOverlay:l=!0,closeOnEscape:d=!0,children:u}=e,[g,h]=G(!1),[c,f]=G(!1),p=ne(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)h(!0),requestAnimationFrame(()=>f(!0));else{f(!1);let z=setTimeout(()=>h(!1),300);return()=>clearTimeout(z)}},[t]),se(()=>{if(!t||!d)return;let z=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[t,d,n]),se(()=>{if(!t)return;let z=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=z}},[t]),se(()=>{t&&p.current&&p.current.focus()},[t]),!g)return null;let b={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},m={...Qa(r,i),transform:Ja(r,c),transition:"transform 0.3s ease"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},v={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},D={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},T={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},$=[];s&&$.push(o("div",{style:x},o("h3",{id:y,style:v},s),o("button",{type:"button",style:D,onClick:n,"aria-label":"Close drawer"},"\xD7"))),$.push(o("div",{style:T},u));let A=[];return a&&A.push(o("div",{style:b,onClick:C})),A.push(o("div",{ref:p,style:m,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...$)),o("div",null,...A)}var el={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function yr(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:a=!0,footer:l,showCloseButton:d=!0,children:u}=e,g=ne(null);if(se(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),se(()=>{if(!t||!a)return;let C=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),se(()=>{t&&g.current&&g.current.focus()},[t]),!t)return null;let h={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:el[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},f={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},p={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},b={padding:"24px",overflow:"auto",flex:"1"},m={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},x=C=>{s&&C.target===C.currentTarget&&n()},v=[],D=r?"modal-title":void 0;r?v.push(o("h2",{id:D,style:p},r)):v.push(o("span",null)),d&&v.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let T=[o("div",{style:f},...v),o("div",{style:b},u)];return l&&T.push(o("div",{style:m},l)),o("div",{style:h,onClick:x,"aria-modal":"true",role:"dialog","aria-labelledby":D},o("div",{ref:g,style:c,tabIndex:-1,role:"document"},...T))}var Sr=8;function tl(e,t){let n=t+Sr;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function nl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Sr}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function vr(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:a=!1,closeOnClickOutside:l=!0,onOpenChange:d}=e,u=r!==void 0,[g,h]=G(!1),c=u?r:g,f=ne(null),p=w(()=>{u?d&&d(!r):h(D=>!D)},[u,r,d]);se(()=>{if(!c||!l)return;let D=T=>{f.current&&!f.current.contains(T.target)&&(u?d&&d(!1):h(!1))};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},b={...tl(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},m=[n];a&&m.push(o("div",{style:nl(i)}));let x=w(D=>{let T=D.key;(T==="Enter"||T===" ")&&(D.preventDefault(),p())},[p]),v=[o("div",{onClick:p,onKeyDown:x,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&v.push(o("div",{style:b},...m)),o("div",{ref:f,style:y},...v)}var ol=0;function rl(){return`toast-${++ol}-${Date.now()}`}function an(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let g=rl();return n=[{id:g,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),g}function a(d){n=n.filter(u=>u.id!==d),i()}function l(){n=[],i()}return{toast:s,dismiss:a,dismissAll:l,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var il={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function sl(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),a=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),a&&(t.left="50%",t.transform="translateX(-50%)"),t}function al(e){let{item:t,onDismiss:n}=e,r=il[t.type];se(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},a={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:a,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function ln(e){let{toaster:t}=e,[,n]=G(0);se(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=sl(t.config.position);se(()=>{let l="specifyjs-toast-keyframes";if(document.getElementById(l))return;let d=document.createElement("style");return d.id=l,d.textContent=`
|
|
3
3
|
@keyframes specifyjs-toast-slide-in {
|
|
4
4
|
from { opacity: 0; transform: translateY(-12px); }
|
|
5
5
|
to { opacity: 1; transform: translateY(0); }
|
|
6
6
|
}
|
|
7
|
-
`,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=v(l=>t.dismiss(l),[t]),a=r.map(l=>o(qa,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function pr(e={}){let t=oe(null);t.current||(t.current=Zt(e));let n=t.current,r=v(()=>o(Jt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Ka=6,Za=8;function Ja(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Za;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function Qa(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Ka}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function fr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=j(!1),[d,u]=j(null),b=oe(null),m=oe(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,g=v(()=>{m.current=setTimeout(()=>{if(b.current){let x=b.current.getBoundingClientRect();u(Ja(x,n))}l(!0)},r)},[r,n]),f=v(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);ie(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},h={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},p=[o("div",{ref:b,style:y,onMouseEnter:g,onMouseLeave:f,onFocus:g,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&p.push(o("div",{id:c,style:h,role:"tooltip"},t,o("div",{style:Qa(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...p)}function Qt(e,t,n,r,i){return X(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function el(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function tl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function nl(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var gr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function mr(e,t){return t||gr[e%gr.length]}function hr(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:b="#e5e7eb",title:m,padding:c=50,animate:g=!1,stacked:f,grouped:y=!1}=e,h=i==="vertical",p=n-c*2,x=r-c*2,S=h?x:p,z=h?p:x,R=f!==void 0&&f.length>0,C=X(()=>R?nl(f):[],[R,f]),I=R?f.length:t.length,F=X(()=>el(t,f,y),[t,f,y]),T=F>0?F:1,P=Qt(I,T,S,z,a),L=v(()=>{if(!u)return[];let V=tl(T),U=[];for(let J=V;J<=T;J+=V){let ne=P.valueScale(J);if(h){let te=c+x-ne;U.push(o("line",{key:`grid-${J}`,x1:String(c),y1:String(te),x2:String(c+p),y2:String(te),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${J}`,x:String(c-6),y:String(te+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(J)))}else{let te=c+ne;U.push(o("line",{key:`grid-${J}`,x1:String(te),y1:String(c),x2:String(te),y2:String(c+x),stroke:b,"stroke-width":"1","stroke-dasharray":"4 2"})),U.push(o("text",{key:`grid-label-${J}`,x:String(te),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(J)))}}return U},[u,T,P,h,c,p,x,b]),D=v(()=>{let V=[];return h?(V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+p),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),V},[h,c,p,x]),W=v(()=>{let V=[];for(let U=0;U<t.length;U++){let J=t[U],ne=P.valueScale(J.value),te=P.categoryScale(U),G=J.color??s,_,O,Y=String(J.value);if(h){let q=c+te,Q=c+x-ne;_={x:String(q),y:String(Q),width:String(P.barThickness),height:String(ne),rx:String(l),ry:String(l),fill:G},O={x:String(q+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let q=c+te,Q=c;_={x:String(Q),y:String(q),width:String(ne),height:String(P.barThickness),rx:String(l),ry:String(l),fill:G},O={x:String(Q+ne+6),y:String(q+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(g&&(_.style=h?`animation: barGrow 0.6s ease-out ${U*.05}s both`:`animation: barGrow 0.6s ease-out ${U*.05}s both`),V.push(o("rect",{key:`bar-${U}`,..._})),d&&V.push(o("text",{key:`val-${U}`,...O},Y)),h){let q=c+te+P.barThickness/2,Q=c+x+16;V.push(o("text",{key:`cat-${U}`,x:String(q),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${q}, ${Q})`},J.label))}else V.push(o("text",{key:`cat-${U}`,x:String(c-6),y:String(c+te+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return V},[t,P,s,l,d,g,h,c,x]),A=v(()=>{if(!f)return[];let V=[];for(let U=0;U<f.length;U++){let J=f[U],ne=P.categoryScale(U),te=0;for(let G=0;G<J.values.length;G++){let _=J.values[G],O=P.valueScale(_.value),Y=P.valueScale(te),q=mr(G,_.color);if(h){let Q=c+ne,re=c+x-Y-O;V.push(o("rect",{key:`sbar-${U}-${G}`,x:String(Q),y:String(re),width:String(P.barThickness),height:String(O),rx:G===J.values.length-1?String(l):"0",ry:G===J.values.length-1?String(l):"0",fill:q,...g?{style:`animation: barGrow 0.6s ease-out ${(U*J.values.length+G)*.03}s both`}:{}})),d&&O>14&&V.push(o("text",{key:`sval-${U}-${G}`,x:String(Q+P.barThickness/2),y:String(re+O/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(_.value)))}else{let Q=c+Y,re=c+ne;V.push(o("rect",{key:`sbar-${U}-${G}`,x:String(Q),y:String(re),width:String(O),height:String(P.barThickness),rx:G===J.values.length-1?String(l):"0",ry:G===J.values.length-1?String(l):"0",fill:q,...g?{style:`animation: barGrow 0.6s ease-out ${(U*J.values.length+G)*.03}s both`}:{}})),d&&O>20&&V.push(o("text",{key:`sval-${U}-${G}`,x:String(Q+O/2),y:String(re+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(_.value)))}te+=_.value}if(d){let G=P.valueScale(te);h?V.push(o("text",{key:`stotal-${U}`,x:String(c+ne+P.barThickness/2),y:String(c+x-G-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(te))):V.push(o("text",{key:`stotal-${U}`,x:String(c+G+6),y:String(c+ne+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(te)))}if(h){let G=c+ne+P.barThickness/2,_=c+x+16;V.push(o("text",{key:`scat-${U}`,x:String(G),y:String(_),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${_})`},J.label))}else V.push(o("text",{key:`scat-${U}`,x:String(c-6),y:String(c+ne+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return V},[f,P,l,d,g,h,c,x]),k=v(()=>{if(!f)return[];let V=C.length,U=[];for(let J=0;J<f.length;J++){let ne=f[J],te=P.categoryScale(J),G=2,_=Math.max(1,(P.barThickness-G*(V-1))/V);for(let O=0;O<ne.values.length;O++){let Y=ne.values[O],q=C.indexOf(Y.category),Q=q*(_+G),re=P.valueScale(Y.value),ee=mr(q>=0?q:O,Y.color);if(h){let se=c+te+Q,ae=c+x-re;U.push(o("rect",{key:`gbar-${J}-${O}`,x:String(se),y:String(ae),width:String(_),height:String(re),rx:String(l),ry:String(l),fill:ee,...g?{style:`animation: barGrow 0.6s ease-out ${(J*V+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${J}-${O}`,x:String(se+_/2),y:String(ae-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let se=c,ae=c+te+Q;U.push(o("rect",{key:`gbar-${J}-${O}`,x:String(se),y:String(ae),width:String(re),height:String(_),rx:String(l),ry:String(l),fill:ee,...g?{style:`animation: barGrow 0.6s ease-out ${(J*V+O)*.04}s both`}:{}})),d&&U.push(o("text",{key:`gval-${J}-${O}`,x:String(se+re+4),y:String(ae+_/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(h){let O=c+te+P.barThickness/2,Y=c+x+16;U.push(o("text",{key:`gcat-${J}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${Y})`},ne.label))}else U.push(o("text",{key:`gcat-${J}`,x:String(c-6),y:String(c+te+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ne.label))}return U},[f,C,P,l,d,g,h,c,x]),w=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),E=v(()=>g?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},h?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[g,h]),M=L(),N=D(),$=w(),B=E(),H;return R&&y?H=k():R?H=A():H=W(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...B,...$,...M,...N,...H)}function je(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function Ct(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function Mt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let b=t[u],m=e(b);isFinite(m)&&a.push({input:b,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),br(l)};return br(l),()=>{i=!0}}function br(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function ol(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function xr(e,t){let n=t-e;if(n<=0)return[e];let r=ol(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function yr(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var me=40,Sr=1.1,vr=.01,wr=1e6;function kr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:b=!0,showAxes:m=!0,pointRadius:c=3,pointColor:g="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:h="#94a3b8",onPointClick:p,onPointDoubleClick:x,onPointContextMenu:S,onPointHover:z}=e,[R,C]=j(d[0]),[I,F]=j(d[1]),[T,P]=j(u[0]),[L,D]=j(u[1]),W=oe(!1),A=oe(null),k=v(Y=>me+(Y-R)/(I-R)*(t-2*me),[R,I,t]),w=v(Y=>n-me-(Y-T)/(L-T)*(n-2*me),[T,L,n]),E=v(Y=>R+(Y-me)/(t-2*me)*(I-R),[R,I,t]),M=v(Y=>T+(n-me-Y)/(n-2*me)*(L-T),[T,L,n]),N=v(Y=>{let q=Y;W.current=!0,A.current={mx:q.clientX,my:q.clientY,x0:R,x1:I,y0:T,y1:L}},[R,I,T,L]),$=v(Y=>{if(!W.current||!A.current)return;let q=Y,Q=A.current,re=q.clientX-Q.mx,ee=q.clientY-Q.my,se=re/(t-2*me)*(Q.x1-Q.x0),ae=ee/(n-2*me)*(Q.y1-Q.y0);C(Q.x0-se),F(Q.x1-se),P(Q.y0+ae),D(Q.y1+ae)},[t,n]),B=v(()=>{W.current=!1,A.current=null},[]),H=v(Y=>{let q=Y;q.preventDefault();let Q=q.currentTarget.getBoundingClientRect(),re=q.clientX-Q.left,ee=q.clientY-Q.top,se=E(re),ae=M(ee),K=q.deltaY>0?Sr:1/Sr,Z=(I-R)*K,le=(L-T)*K;if(Z<vr||le<vr||Z>wr||le>wr)return;let de=(se-R)/(I-R),ce=(ae-T)/(L-T);C(se-de*Z),F(se+(1-de)*Z),P(ae-ce*le),D(ae+(1-ce)*le)},[R,I,T,L,E,M]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),b){let Y=xr(R,I),q=xr(T,L);for(let Q=0;Q<Y.length;Q++){let re=k(Y[Q]);V.push(o("line",{x1:re,y1:me,x2:re,y2:n-me,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),V.push(o("text",{x:re,y:n-me+14,"text-anchor":"end","font-size":10,fill:h,transform:`rotate(-45, ${re}, ${n-me+14})`,key:`lx-${Q}`},yr(Y[Q])))}for(let Q=0;Q<q.length;Q++){let re=w(q[Q]);V.push(o("line",{x1:me,y1:re,x2:t-me,y2:re,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),V.push(o("text",{x:me-6,y:re+3,"text-anchor":"end","font-size":10,fill:h,key:`ly-${Q}`},yr(q[Q])))}}if(m){let Y=Math.max(me,Math.min(t-me,k(0))),q=Math.max(me,Math.min(n-me,w(0)));V.push(o("line",{x1:me,y1:q,x2:t-me,y2:q,stroke:h,"stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:Y,y1:me,x2:Y,y2:n-me,stroke:h,"stroke-width":1,key:"y-axis"}))}let U=X(()=>{if(!i||!l)return[];let Y=a??(I-R)/s,q=je({start:R,end:I,step:Y});return Ct(i,q)},[i,R,I,a,s,l]),[J,ne]=j([]),te=oe(null);ie(()=>{if(!i||l){ne([]);return}let Y=a??(I-R)/s,q=je({start:R,end:I,step:Y});return te.current&&te.current(),te.current=Mt(i,q,200,Q=>{ne([...Q])}),()=>{te.current&&te.current()}},[i,R,I,a,s,l]);let G=l?U:J;if(G.length>0){let Y=[];for(let q=0;q<G.length;q++){let Q=G[q],re=k(Q.input),ee=w(Q.output);Y.push(`${Y.length===0?"M":"L"}${re},${ee}`)}V.push(o("path",{d:Y.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let _=(Y,q,Q,re)=>{if(q)return ee=>q({x:re.x,y:re.y,index:Q,event:ee})};for(let Y=0;Y<r.length;Y++){let q=r[Y],Q=k(q.x),re=w(q.y),ee={cx:Q,cy:re,r:c,fill:g,cursor:"pointer",key:`pt-${Y}`};p&&(ee.onClick=_("click",p,Y,q)),x&&(ee.onDblClick=_("dblclick",x,Y,q)),S&&(ee.onContextMenu=_("contextmenu",S,Y,q)),z&&(ee.onMouseOver=_("mouseover",z,Y,q)),V.push(o("circle",ee))}let O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:me,y:me,width:t-2*me,height:n-2*me})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:N,onMouseMove:$,onMouseUp:B,onMouseLeave:B,onWheel:H},O,...V)}function Mr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Cr(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,b=0,m=0,c=0;return i<60?(b=l,m=d):i<120?(b=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(b=d,c=l):(b=l,c=d),[Math.floor((b+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function Er(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Mr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let b=0;b<e;b++){let m=n[0]+b/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function Pr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Mr,data:d,resolution:u=2,onPointClick:b,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:g}=e;if(d){let M=d.length,N=M>0?d[0].length:0,$=N>0?t/N:1,B=M>0?n/M:1,H=[];for(let V=0;V<M;V++){let U=d[V];for(let J=0;J<N;J++){let ne=U[J]??0,[te,G,_]=Cr(ne,s,a);H.push(o("rect",{key:`${V}-${J}`,x:String(J*$),y:String(V*B),width:String(Math.ceil($)),height:String(Math.ceil(B)),fill:`rgb(${te},${G},${_})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...H)}let[f,y]=j(r[0]),[h,p]=j(r[1]),[x,S]=j(i[0]),[z,R]=j(i[1]),C=oe(null),I=oe(!1),F=oe(null),T=v((M,N)=>{let $=f+M/t*(h-f),B=z-N/n*(z-x);return{re:$,im:B}},[f,h,x,z,t,n]);ie(()=>{let M=C.current;if(!M)return;let N=M.getContext("2d");if(!N)return;let $=N.createImageData(t,n),B=$.data;for(let H=0;H<n;H++)for(let V=0;V<t;V++){let{re:U,im:J}=T(V,H),ne=l(U,J,s),[te,G,_]=Cr(ne,s,a),O=(H*t+V)*4;B[O]=te,B[O+1]=G,B[O+2]=_,B[O+3]=255}N.putImageData($,0,0)},[f,h,x,z,t,n,s,a,l,T]);let P=v(M=>{let N=M.target.getBoundingClientRect(),$=M.clientX-N.left,B=M.clientY-N.top,{re:H,im:V}=T($,B),U=l(H,V,s);return{re:H,im:V,iterations:U,event:M}},[T,l,s]),L=v(M=>{I.current=!0,F.current={x:M.clientX,y:M.clientY,rMin:f,rMax:h,iMin:x,iMax:z}},[f,h,x,z]),D=v(M=>{if(m&&m(P(M)),!I.current||!F.current)return;let N=F.current,$=M.clientX-N.x,B=M.clientY-N.y,H=(N.rMax-N.rMin)/t,V=(N.iMax-N.iMin)/n;y(N.rMin-$*H),p(N.rMax-$*H),S(N.iMin+B*V),R(N.iMax+B*V)},[t,n,m,P]),W=v(()=>{I.current=!1},[]),A=v(M=>{M.preventDefault();let N=M.deltaY>0?1.15:1/1.15,$=M.target.getBoundingClientRect(),B=M.clientX-$.left,H=M.clientY-$.top,{re:V,im:U}=T(B,H);y(V+(f-V)*N),p(V+(h-V)*N),S(U+(x-U)*N),R(U+(z-U)*N)},[T,f,h,x,z]),k=v(M=>{b&&b(P(M))},[b,P]),w=v(M=>{c&&c(P(M))},[c,P]),E=v(M=>{M.preventDefault(),g&&g(P(M))},[g,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:L,onMouseMove:D,onMouseUp:W,onMouseLeave:W,onWheel:A,onClick:k,onDblClick:w,onContextMenu:E})}function Rr(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function rl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,b=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,g=Rr(i,s,c),f=Rr(a,l,c);return{xScale:b,yScale:m,xTicks:g,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function en(e,t,n,r){return X(()=>rl(e,t,n,r),[e,t,n,r])}function $r(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Ir(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function Dr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:b=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:g,yLabel:f,title:y,padding:h=50,animate:p=!1,multiLine:x}=e,S=X(()=>{let L=[...t];if(x)for(let D of x)L.push(...D.data);return L},[t,x]),z=en(S,n,r,h),{xScale:R,yScale:C,xTicks:I,yTicks:F}=z,T=[];if(T.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),b){for(let L=0;L<I.length;L++){let D=R(I[L]);T.push(o("line",{x1:D,y1:h,x2:D,y2:r-h,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${L}`}))}for(let L=0;L<F.length;L++){let D=C(F[L]);T.push(o("line",{x1:h,y1:D,x2:n-h,y2:D,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${L}`}))}}T.push(o("line",{x1:h,y1:r-h,x2:n-h,y2:r-h,stroke:"#374151","stroke-width":1,key:"x-axis"})),T.push(o("line",{x1:h,y1:h,x2:h,y2:r-h,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let L=0;L<I.length;L++){let D=R(I[L]);T.push(o("line",{x1:D,y1:r-h,x2:D,y2:r-h+5,stroke:"#374151",key:`xtick-${L}`})),T.push(o("text",{x:D,y:r-h+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${D}, ${r-h+18})`,key:`xlabel-${L}`},$r(I[L])))}for(let L=0;L<F.length;L++){let D=C(F[L]);T.push(o("line",{x1:h-5,y1:D,x2:h,y2:D,stroke:"#374151",key:`ytick-${L}`})),T.push(o("text",{x:h-10,y:D+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${L}`},$r(F[L])))}function P(L,D,W,A,k,w,E,M,N,$){if(L.length===0)return;let B=[...L].sort((U,J)=>U.x-J.x);if(A){let U=C(z.yMin),J=B.map(_=>`${R(_.x)},${C(_.y)}`).join(" "),ne=R(B[0].x),te=R(B[B.length-1].x),G=`${ne},${U} ${J} ${te},${U}`;T.push(o("polygon",{points:G,fill:k,key:`${$}-area`}))}let V={points:B.map(U=>`${R(U.x)},${C(U.y)}`).join(" "),fill:"none",stroke:D,"stroke-width":W,"stroke-linejoin":"round","stroke-linecap":"round",key:`${$}-line`};if(p?(V["stroke-dasharray"]="1000",V["stroke-dashoffset"]="1000",T.push(o("polyline",V,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):T.push(o("polyline",V)),w)for(let U=0;U<B.length;U++){let J=R(B[U].x),ne=C(B[U].y),te=B[U].shape??N,G=B[U].radius??M,_=`${$}-pt-${U}`;if(p){let O=Ir(te,J,ne,G,E,_,{opacity:0});T.push(o("g",{key:`${_}-g`},O,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else T.push(Ir(te,J,ne,G,E,_))}}if(P(t,i,s,m,c,u,l,a,d,"primary"),x)for(let L=0;L<x.length;L++){let D=x[L];P(D.data,D.color,s,!1,"transparent",u,D.color,D.pointRadius??a,D.pointShape??d,`series-${L}`)}if(x&&x.length>0){let L=[],D=[{color:i,label:"Primary"},...x.map((H,V)=>({color:H.color,label:H.label??`Series ${V+1}`}))],W=h+10,A=16,k=22,w=7.2,E=14,M=6,N=n-h*2-20,$=0,B=0;for(let H=0;H<D.length;H++){let V=D[H].label.length*w,U=E+M+V;$>0&&$+U>N&&($=0,B+=k);let J=W+$,ne=h-30-B;L.push(o("rect",{x:J,y:ne,width:E,height:14,fill:D[H].color,rx:2,key:`legend-rect-${H}`})),L.push(o("text",{x:J+E+M,y:ne+12,"font-size":12,fill:"#374151",key:`legend-text-${H}`},D[H].label)),$+=U+A}T.push(o("g",{key:"legend"},...L))}return g&&T.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),f&&T.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},f)),y&&T.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...T)}function il(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function sl(e,t){let n=t??il(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function Xe(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function tn(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=Xe(e,t,r,a),u=Xe(e,t,r,l),b=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=Xe(e,t,n,l),c=Xe(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${b} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${b} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function nn(e,t){let n=t?.padAngle??0,r=sl(e,t?.colors),i=e.reduce((u,b)=>u+b.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let b=e[u],m=b.value/i*a,c=d+n/2,g=c+m;l.push({label:b.label,value:b.value,startAngle:c,endAngle:g,percentage:b.value/i*100,color:r[u]}),d=g+n/2}return l}function zr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:b,centerLabel:m,colors:c,strokeColor:g="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,h=d&&u==="right"?140:0,p=b?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-h,z=r-p-x,R=S/2,C=p+z/2,I=Math.min(S,z)/2-10,F=e.outerRadius??I,T=X(()=>nn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];b&&P.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},b));for(let L=0;L<T.length;L++){let D=T[L],W=tn(R,C,i,F,D.startAngle,D.endAngle);if(P.push(o("path",{key:`slice-${L}`,d:W,fill:D.color,stroke:g,strokeWidth:f})),a||l){let A=(D.startAngle+D.endAngle)/2,k=D.percentage<5,w=k?F+14:i+(F-i)*.65,E=Xe(R,C,w,A-Math.PI/2),M=k?y:"#fff",N=k?11:12,$=[];if(a&&$.push(D.label),l&&$.push(`${D.percentage.toFixed(1)}%`),k){let B=Xe(R,C,F+2,A-Math.PI/2);P.push(o("line",{key:`connector-${L}`,x1:B.x,y1:B.y,x2:E.x,y2:E.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${L}`,x:E.x,y:E.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N,fill:M,pointerEvents:"none"},D.label)),l&&P.push(o("text",{key:`value-${L}`,x:E.x,y:E.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:N-1,fill:M,pointerEvents:"none"},`${D.percentage.toFixed(1)}%`))}}if(m&&i>0&&P.push(o("text",{key:"center-label",x:R,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let L=[];if(u==="right"){let D=S+10,W=p+20;for(let A=0;A<T.length;A++){let k=T[A],w=W+A*22;L.push(o("circle",{key:`legend-dot-${A}`,cx:D+6,cy:w,r:6,fill:k.color})),L.push(o("text",{key:`legend-text-${A}`,x:D+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let D=r-x+10;for(let W=0;W<T.length;W++){let A=T[W],k=W%2,w=Math.floor(W/2),E=k*(n/2)+10,M=D+w*22;L.push(o("circle",{key:`legend-dot-${W}`,cx:E+6,cy:M,r:6,fill:A.color})),L.push(o("text",{key:`legend-text-${W}`,x:E+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${A.label} (${A.percentage.toFixed(1)}%)`))}}P.push(...L)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Tr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Ar(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:b=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:g,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:h}=e,[p,x]=j(r[1]),[S,z]=j(0),[R,C]=j(0),[I,F]=j(null),T=t/2+S,P=n/2+R,D=Math.min(t,n)/2-30,W=D/p,A=X(()=>{let G=Math.max(1,Math.ceil(p)),_=[],O=p/G;for(let Y=1;Y<=G;Y++)_.push(O*Y);return _},[p]),k=X(()=>{let G=[];for(let _=0;_<360;_+=30)G.push(_*Math.PI/180);return G},[]),w=X(()=>{if(!i||!l)return[];let G=a??2*Math.PI/s,_=je({start:0,end:2*Math.PI,step:G});return Ct(i,_)},[i,s,a,l]),[E,M]=j([]),N=oe(null);ie(()=>{if(!i||l){M([]);return}let G=a??2*Math.PI/s,_=je({start:0,end:2*Math.PI,step:G});return N.current&&N.current(),N.current=Mt(i,_,200,O=>{M([...O])}),()=>{N.current&&N.current()}},[i,s,a,l]);let $=l?w:E,B=X(()=>{if($.length===0)return"";let G=[];for(let _=0;_<$.length;_++){let O=$[_],Y=O.output;if(Y<0||!isFinite(Y))continue;let{x:q,y:Q}=Tr(Y,O.input,T,P,W);G.push(`${G.length===0?"M":"L"}${q.toFixed(2)},${Q.toFixed(2)}`)}return G.join(" ")},[$,T,P,W]),H=v(G=>{F({x:G.clientX,y:G.clientY,px:S,py:R})},[S,R]),V=v(G=>{I&&(z(I.px+(G.clientX-I.x)),C(I.py+(G.clientY-I.y)))},[I]),U=v(()=>{F(null)},[]),J=v(G=>{G.preventDefault();let _=G.deltaY>0?1.15:1/1.15;x(Math.max(.1,p*_))},[p]),ne=v((G,_,O)=>{if(G)return Y=>G({r:_.r,theta:_.theta,index:O,event:Y})},[]),te=[];if(te.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let G=0;G<A.length;G++){let _=A[G]*W;te.push(o("circle",{cx:T,cy:P,r:_,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${G}`})),te.push(o("text",{x:T+_+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${G}`},A[G].toFixed(1)))}for(let G=0;G<k.length;G++){let _=k[G],O=A[A.length-1]*W,Y=T+O*Math.cos(_),q=P-O*Math.sin(_);te.push(o("line",{x1:T,y1:P,x2:Y,y2:q,stroke:"#e5e7eb","stroke-width":1,key:`al-${G}`}));let Q=Math.round(_*180/Math.PI),re=T+(O+14)*Math.cos(_),ee=P-(O+14)*Math.sin(_);te.push(o("text",{x:re,y:ee+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${G}`},`${Q}\xB0`))}}te.push(o("line",{x1:T-D,y1:P,x2:T+D,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),te.push(o("line",{x1:T,y1:P-D,x2:T,y2:P+D,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),B&&te.push(o("path",{d:B,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let G=0;G<d.length;G++){let _=d[G],{x:O,y:Y}=Tr(_.r,_.theta,T,P,W);te.push(o("circle",{cx:O,cy:Y,r:b,fill:m,key:`pt-${G}`,style:{cursor:"pointer"},onClick:ne(g,_,G),onDblClick:ne(f,_,G),onContextMenu:ne(y,_,G),onMouseEnter:ne(h,_,G)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:I?"grabbing":"grab"},onMouseDown:H,onMouseMove:V,onMouseUp:U,onMouseLeave:U,onWheel:J},...te)}function on(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function rn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function sn(e,t){let n=Lr(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=ll(n,al(e,i,s,a))}r++}return n}function Lr(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function al(e,t,n,r){let i=Lr(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function ll(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function an(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function ln(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function ot(e,t=[],n=.3,r=1){let i=on(e),s=rn(e),a=sn(e,t);return{vertices:i.map((d,u)=>{let b=an(a,d),m=ln(b,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function rt(e){return e*(e-1)/2}function Et(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function Fr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,b=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=rt(t),g=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Et(g):e.vertexColors,[g,e.vertexColors]),[y,h]=j(()=>{let M=[];for(let N=0;N<c;N++)M.push(0);return M}),[p,x]=j(!1),S=oe({x:0,y:0}),z=oe([]),R=oe(0);ie(()=>{if(d===0)return;let M=!0,N=()=>{M&&(h($=>{let B=$.slice();for(let H=0;H<B.length;H++)B[H]=(B[H]??0)+d*(1+H*.3);return B}),R.current=requestAnimationFrame(N))};return R.current=requestAnimationFrame(N),()=>{M=!1,cancelAnimationFrame(R.current)}},[d]);let C=X(()=>ot(t,y,l,m),[t,y,l,m]),I=n/2,F=r/2,T=X(()=>C.edges.map(M=>{let N=C.vertices[M.source],$=C.vertices[M.target],B=(N.depth+$.depth)/2;return{...M,avgDepth:B,sv:N,tv:$}}).sort((M,N)=>M.avgDepth-N.avgDepth),[C]),P=X(()=>C.vertices.slice().sort((M,N)=>M.depth-N.depth),[C]),L=v(M=>{let N=M;x(!0),S.current={x:N.clientX,y:N.clientY},z.current=y.slice()},[y]),D=v(M=>{if(!p)return;let N=M,$=(N.clientX-S.current.x)*.01,B=(N.clientY-S.current.y)*.01;h(()=>{let H=z.current.slice();return H.length>0&&(H[0]=(H[0]??0)+$),H.length>1&&(H[1]=(H[1]??0)+B),H})},[p]),W=v(()=>{x(!1)},[]),A=M=>{let N=(M+2)/4;return .3+.7*Math.max(0,Math.min(1,N))},k=M=>{let N=(M+2)/4;return .6+.4*Math.max(0,Math.min(1,N))},w=T.map((M,N)=>{let $=A(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String(I+M.sv.x),y1:String(F+M.sv.y),x2:String(I+M.tv.x),y2:String(F+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String($),"stroke-linecap":"round"})}),E=P.map(M=>{let N=i*k(M.depth),$=f[M.id%f.length]??"#3b82f6",B=[o("circle",{key:`v-${M.id}-circle`,cx:String(I+M.x),cy:String(F+M.y),r:String(N),fill:$,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&B.push(o("text",{key:`v-${M.id}-label`,x:String(I+M.x),y:String(F+M.y+N+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),B});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:b,cursor:p?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:D,onMouseUp:W,onMouseLeave:W},...w,...E.flat())}function Nr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=rt(t),[a,l]=j(()=>new Array(s).fill(0));return ie(()=>{if(n===0)return;let u=!0,b=0,m=()=>{u&&(l(c=>c.map((g,f)=>g+n*(1+f*.3))),b=requestAnimationFrame(m))};return b=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(b)}},[n]),{data:X(()=>ot(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Wr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:cl(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?ul(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,b=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=dl(d,b,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function cl(e,t){return"column"}function dl(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function ul(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},pl(n),o("span",null,n.label))))}function pl(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function fl(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function gl(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Br(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return ie(()=>{if(n||typeof window>"u")return;fl(t),gl();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Or(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:b,ariaLabel:m="Site footer"}=e;return o("footer",{className:b,role:"contentinfo","aria-label":m,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Yr=Pe({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),ml={width:600,height:400},hl={x:30,y:30},bl={top:0,left:0,width:1920,height:1080},cn=1e3;function Hr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function dn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function _r(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function un(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function pn(e){let t=e.workspaceBounds??bl,n=e.defaultWindowSize??ml,r=e.cascadeOffset??hl,[i,s]=j([]),a=v(((...L)=>{let D=L[0];s(W=>{if(W.find(B=>B.id===D.id)){let H=un(W)+1,V=W.map(U=>U.id===D.id?{...U,focused:!0,zIndex:H,windowState:U.windowState==="minimized"?"normal":U.windowState}:{...U,focused:!1});return H>cn&&(V=dn(V)),V}let k=D.size??n,w=D.position??Hr(W.length,r,t,k),M=un(W)+1,N={id:D.id,title:D.title,icon:D.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:D.appProps},$=W.map(B=>({...B,focused:!1}));return $.push(N),M>cn&&($=dn($)),e.onWindowOpen&&e.onWindowOpen(D.id),e.onFocusChange&&e.onFocusChange(D.id),$})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=v(((...L)=>{let D=L[0];S(W=>{if(W[D]){let A={...W};return delete A[D],A}return W}),R(W=>{if(W.has(D)){let A=new Map(W);return A.delete(D),A}return W}),s(W=>{let A=W.find(w=>w.id===D);if(!A)return W;let k=W.filter(w=>w.id!==D);if(A.focused&&k.length>0){let w=_r(k,D);if(w){let E=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(D),e.onFocusChange&&e.onFocusChange(w.id),E}}return e.onWindowClose&&e.onWindowClose(D),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=v(((...L)=>{let D=L[0];s(W=>{if(!W.find(M=>M.id===D))return W;let w=un(W)+1,E=W.map(M=>M.id===D?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>cn&&(E=dn(E)),e.onFocusChange&&e.onFocusChange(D),E})}),[e.onFocusChange]),u=v(((...L)=>{let D=L[0];s(W=>{let A=W.find(w=>w.id===D);if(!A)return W;let k=W.map(w=>w.id===D?{...w,windowState:"minimized",focused:!1}:w);if(A.focused){let w=_r(k,D);w?(k=k.map(E=>({...E,focused:E.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),b=v(((...L)=>{let D=L[0];s(W=>W.map(A=>A.id===D?{...A,windowState:"maximized"}:A))}),[]),m=v(((...L)=>{let D=L[0];s(W=>W.map(A=>A.id===D?{...A,windowState:"normal"}:A))}),[]),c=v(((...L)=>{let D=L[0],W=L[1];s(A=>A.map(k=>k.id===D?{...k,position:W}:k))}),[]),g=v(((...L)=>{let D=L[0],W=L[1];s(A=>A.map(k=>k.id===D?{...k,size:W}:k))}),[]),f=v(((...L)=>{s(D=>{let W=D.filter(w=>w.windowState!=="minimized");if(W.length===0)return D;let A=W.length,k=new Map;if(A===1)k.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(A===2){let w=Math.floor(t.width/2);k.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(W[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(A===3){let w=Math.floor(t.width/2),E=Math.floor(t.height/2);k.set(W[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(W[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:E}}),k.set(W[2].id,{position:{x:t.left+w,y:t.top+E},size:{width:t.width-w,height:t.height-E}})}else{let w=Math.ceil(Math.sqrt(A)),E=Math.ceil(A/w),M=Math.floor(t.width/w),N=Math.floor(t.height/E);for(let $=0;$<W.length;$++){let B=Math.floor($/w),H=$%w;k.set(W[$].id,{position:{x:t.left+H*M,y:t.top+B*N},size:{width:M,height:N}})}}return D.map(w=>{let E=k.get(w.id);return E?{...w,position:E.position,size:E.size,windowState:"normal"}:w})})}),[t]),y=v(((...L)=>{s(D=>{let W=D.filter(w=>w.windowState!=="minimized");if(W.length===0)return D;let A=[...W].sort((w,E)=>w.zIndex-E.zIndex),k=new Map;for(let w=0;w<A.length;w++){let E=Hr(w,r,t,A[w].size);k.set(A[w].id,{position:E,zIndex:w+1})}return D.map(w=>{let E=k.get(w.id);return E?{...w,position:E.position,zIndex:E.zIndex,windowState:"normal"}:w})})}),[r,t]),h=v(((...L)=>{s(D=>{let W=D.map(A=>({...A,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),W})}),[e.onFocusChange]),p=X(()=>{let L=i.find(D=>D.focused);return L?L.id:null},[i]),[x,S]=j({}),[z,R]=j(new Map),C=v(((...L)=>{let D=L[0],W=L[1];S(A=>({...A,[D]:W}))}),[]),I=v(((...L)=>{let D=L[0];S(W=>{let A={...W};return delete A[D],A})}),[]),F=X(()=>p&&x[p]?x[p]:null,[p,x]),T=v(((...L)=>{let D=L[0],W=L[1];R(A=>{let k=new Map(A),w=k.get(D);return k.set(D,{...w,...W}),k})}),[]),P=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:b,restoreWindow:m,moveWindow:c,resizeWindow:g,tileWindows:f,cascadeWindows:y,minimizeAll:h,focusedWindowId:p,setMenuBar:C,clearMenuBar:I,activeMenuBar:F,signalDock:T,dockSignals:z}),[i,a,l,d,u,b,m,c,g,f,y,h,p,C,I,F,T,z]);return o(Yr.Provider,{value:P},e.children)}function it(){return Ce(Yr)}var Vr=Pe({appId:""});function Fe(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o(Vr.Provider,{value:t},e.children)}function qe(){return Ce(Vr).appId}var Gr=Pe({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function st(e){let t=oe([]),n=oe([]),r=v(((...l)=>{let d=l[0],u=l[1],b=l[2],m=l[3]||"",c={channel:d,from:m,to:b||null,payload:u,timestamp:Date.now()},g=t.current;for(let y=0;y<g.length;y++){let h=g[y];h.channel===d&&(c.to&&h.appId!==c.to||!c.to&&h.appId===m||h.handler(c))}let f=n.current;for(let y=0;y<f.length;y++)f[y].handler(c)}),[]),i=v(((...l)=>{let d=l[0],u=l[1],b=l[2]||"",m={channel:d,handler:u,appId:b};return t.current=[...t.current,m],()=>{t.current=t.current.filter(c=>c!==m)}}),[]),s=v(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(b=>b!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(Gr.Provider,{value:a},e.children)}function Ne(){let e=Ce(Gr),t=qe(),n=v(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=v(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return X(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function at(e,t){let n=Ne(),r=oe(t);r.current=t,ie(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var Ur=Pe({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function lt(e){let[t,n]=j(null),[r,i]=j({x:0,y:0}),s=oe(new Map),a=oe(null),l=t!==null,d=v(((...g)=>{let f=g[0];n(f)}),[]),u=v(((...g)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),b=v(((...g)=>{let f=g[0],y=g[1];return s.current=new Map(s.current),s.current.set(f,y),()=>{s.current=new Map(s.current),s.current.delete(f),a.current===f&&(a.current=null)}}),[]);ie(()=>{if(!l)return;let g=h=>{let p=h;i({x:p.clientX,y:p.clientY});let x=document.elementFromPoint(p.clientX,p.clientY);if(!x)return;let S=null,z=s.current;z.forEach((C,I)=>{let F=document.querySelector(`[data-dropzone-id="${I}"]`);F&&F.contains(x)&&(S=I)});let R=a.current;if(S!==R){if(R){let C=z.get(R);C&&C.onDragLeave&&C.onDragLeave()}if(S){let C=z.get(S);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=S}},f=h=>{let p=a.current;if(p&&t){let x=s.current.get(p);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=h=>{h.key==="Escape"&&u()};return document.addEventListener("mousemove",g),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:b,currentDrag:t,isDragging:l}),[d,u,b,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(Ur.Provider,{value:m},e.children,c)}function He(){return Ce(Ur)}function fn(e,t){let n=He(),r=qe(),i=oe(t);i.current=t;let s=v(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return X(()=>({onMouseDown:s,isDragging:a}),[s,a])}function ct(e){let t=He(),[n,r]=j(!1),i=oe(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=oe(e);s.current=e,ie(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return X(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var xl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gn(e){return e<10?"0"+String(e):String(e)}function Sl(e,t,n){let r=e.getHours(),i=gn(e.getMinutes()),s=gn(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=gn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function vl(e){let t=xl[e.getDay()],n=yl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function wl(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),a=v(()=>{n()},[n]),l=v(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function kl(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=j(new Date);ie(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>Sl(i,t,n),[i,t,n]),l=X(()=>vl(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Cl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),s=v(()=>{t.onClick&&t.onClick()},[t]),a=v(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Ml(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=v(()=>{t.onClick(),n()},[t,n]),l=v(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function El(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=xe(),[a,l]=j(!1),d=oe(null),u=v(()=>{l(h=>!h)},[]),b=v(()=>{l(!1)},[]),m=v(h=>{let p=h;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),l(x=>!x)),p.key==="Escape"&&l(!1)},[]);ie(()=>{if(!a)return;let h=p=>{let x=d.current;x&&!x.contains(p.target)&&l(!1)};return document.addEventListener("click",h,!0),()=>{document.removeEventListener("click",h,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},g=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),f=o("span",{style:c,"aria-hidden":"true"},g),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((h,p)=>o(Ml,{key:String(p),item:h,onClose:b}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:m,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},f,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Pl(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=xe(),[s,a]=j(!1),l=oe(null),d=v(()=>{a(c=>!c)},[]),u=v(()=>{a(!1)},[]),b=v(c=>{let g=c;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),a(f=>!f)),g.key==="Escape"&&a(!1)},[]);ie(()=>{if(!s)return;let c=g=>{let f=l.current;f&&!f.contains(g.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let m=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,g)=>c.divider?o("div",{key:"div-"+String(g),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(g),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:b,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),m)}function mn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:b=28,children:m}=e,c=String(b)+"px",g=[];if(n&&g.push(o(wl,{key:"activities",label:n.label,onClick:n.onClick})),t&&g.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let S=0;S<r.menus.length;S++)g.push(o(Pl,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...g),y=[];y.push(o(kl,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let h=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),p=[];if(l&&l.length>0){let S=l.map(z=>o(Cl,{key:z.id,indicator:z}));p.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}d&&p.push(o(El,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...p);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},f,h,x)}function Rl(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var jr=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function $l(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return jr[Math.abs(t)%jr.length]}function Il(e){return e>99?"99+":String(e)}function Dl(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function zl(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function Tl(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function Al(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=j(!1),u=t.disabled??!1,b=v(()=>{u||d(!0)},[u]),m=v(()=>{d(!1)},[]),c=v(()=>{!u&&s&&s(t.id)},[u,s,t.id]),g=v(R=>{if(!u&&a){let C=R;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=Rl(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:f,height:f,objectFit:"contain",display:"block"}}):o("span",{style:{width:f,height:f,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:$l(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),h=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Il(t.badge)):null,p=t.active?o("span",{style:{...Tl(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,S=l?o("div",{role:"tooltip",style:{position:"absolute",...zl(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,z={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:z,"aria-label":Dl(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:g,onMouseEnter:b,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,h,p,x,S)}function hn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[b,m]=j(!s),c=oe(null),g=v(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),m(!0))},[s]),f=v(()=>{s&&(c.current=setTimeout(()=>{m(!1)},300))},[s]),y=v(z=>{let R=z,C=R.target,I=C.closest('[role="toolbar"]');if(!I)return;let F=Array.from(I.querySelectorAll("button[data-dock-item-id]")),T=F.indexOf(C);if(T<0)return;let P=n==="vertical",L=P?"ArrowDown":"ArrowRight",D=P?"ArrowUp":"ArrowLeft";if(R.key===L){R.preventDefault();let W=F[T+1];W&&W.focus()}else if(R.key===D){R.preventDefault();let W=F[T-1];W&&W.focus()}else R.key==="Home"?(R.preventDefault(),F[0]?.focus()):R.key==="End"?(R.preventDefault(),F[F.length-1]?.focus()):(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),C.click())},[n]),h=n==="vertical",p={display:"flex",flexDirection:h?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!b&&(r==="left"?(p.transform="translateX(-100%)",p.opacity="0"):r==="right"?(p.transform="translateX(100%)",p.opacity="0"):r==="top"?(p.transform="translateY(-100%)",p.opacity="0"):r==="bottom"&&(p.transform="translateY(100%)",p.opacity="0"));let x=[];for(let z=0;z<t.length;z++){if(a&&z===t.length-1&&t.length>1){let R=h?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${z}`,style:R,"aria-hidden":"true",role:"separator"}))}x.push(o(Al,{key:t[z].id,item:t[z],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=s&&!b?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:p,onMouseEnter:g,onMouseLeave:f,onKeyDown:y},S,...x,u??null)}var Ll="#2c001e";function bn(e){let{backgroundColor:t=Ll,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,b=v(p=>{let x=p;x.target===x.currentTarget&&a&&a()},[a]),m=v(p=>{let x=p;x.target===x.currentTarget&&l&&l()},[l]),c=X(()=>{let p={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return p.backgroundColor=t,n&&(p.background=n),r&&i>=1&&(p.backgroundImage=`url(${r})`,p.backgroundSize="cover",p.backgroundPosition="center"),p},[t,n,r,i]),g=X(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),f={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];g&&y.push(o("div",{className:"desktop-background__image-overlay",style:g,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let h=o("div",{className:"desktop-background",style:c,onClick:b,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(kt,{items:s},h):h}var Fl={width:200,height:150},Nl={x:50,y:50},Wl={width:400,height:300},ye=8,xn=20,Bl={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function dt(e){let{id:t,title:n,icon:r,defaultPosition:i=Nl,defaultSize:s=Wl,minSize:a=Fl,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:b="normal",focused:m=!0,zIndex:c,onClose:g,onMinimize:f,onMaximize:y,onFocus:h,onMove:p,onResize:x,children:S}=e,[z,R]=j(i.x),[C,I]=j(i.y),[F,T]=j(s.width),[P,L]=j(s.height),[D,W]=j(!1),[A,k]=j(!1),[w,E]=j(null),M=oe(null),N=oe(null),$=oe(null),B=v((Z,le)=>{let de=Math.max(Z,a.width),ce=Math.max(le,a.height);return l&&(de=Math.min(de,l.width),ce=Math.min(ce,l.height)),{width:de,height:ce}},[a,l]),H=v(()=>{let Z=$.current;return Z&&Z.parentElement?{width:Z.parentElement.clientWidth,height:Z.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=v((Z,le,de,ce)=>{let ue=H(),fe=Math.max(0,Math.min(Z,ue.width-de)),ge=Math.max(0,Math.min(le,ue.height-ce));return{x:fe,y:ge}},[H]),U=v(Z=>{if(!u||b==="maximized")return;let le=Z;le.target.closest("button")||(le.preventDefault(),M.current={startMouseX:le.clientX,startMouseY:le.clientY,startPosX:z,startPosY:C},W(!0))},[u,b,z,C]),J=v(Z=>{Z.target.closest("button")||y&&y()},[y]);ie(()=>{if(!D)return;let Z=de=>{let ce=de,ue=M.current;if(!ue)return;let fe=ce.clientX-ue.startMouseX,ge=ce.clientY-ue.startMouseY,be=ue.startPosX+fe,ke=ue.startPosY+ge,Me=H();be=Math.max(0,Math.min(be,Me.width-F)),ke=Math.max(0,Math.min(ke,Me.height-P)),R(be),I(ke),ce.clientX<=xn?E("left"):ce.clientX>=Me.width-xn?E("right"):ce.clientY<=xn?E("top"):E(null)},le=de=>{let ce=de;W(!1);let ue=H();if(w==="left"){R(0),I(0),T(Math.floor(ue.width/2)),L(ue.height),E(null),p&&p({x:0,y:0}),x&&x({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let ge=Math.floor(ue.width/2);R(ge),I(0),T(ge),L(ue.height),E(null),p&&p({x:ge,y:0}),x&&x({width:ge,height:ue.height});return}if(w==="top"){E(null),y&&y();return}E(null);let fe=M.current;if(fe&&p){let ge=ce.clientX-fe.startMouseX,be=ce.clientY-fe.startMouseY,ke=fe.startPosX+ge,Me=fe.startPosY+be;ke=Math.max(0,Math.min(ke,ue.width-F)),Me=Math.max(0,Math.min(Me,ue.height-P)),p({x:ke,y:Me})}M.current=null};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",le)}},[D,w,F,P,H,p,x,y]);let ne=v(Z=>le=>{if(!d||b!=="normal")return;let de=le;de.preventDefault(),de.stopPropagation(),N.current={direction:Z,startMouseX:de.clientX,startMouseY:de.clientY,startPosX:z,startPosY:C,startWidth:F,startHeight:P},k(!0)},[d,b,z,C,F,P]);ie(()=>{if(!A)return;let Z=de=>{let ce=de,ue=N.current;if(!ue)return;let fe=ce.clientX-ue.startMouseX,ge=ce.clientY-ue.startMouseY,be=ue.direction,ke=ue.startWidth,Me=ue.startHeight,_t=ue.startPosX,Yt=ue.startPosY;be.includes("e")&&(ke=ue.startWidth+fe),be.includes("w")&&(ke=ue.startWidth-fe,_t=ue.startPosX+fe),be.includes("s")&&(Me=ue.startHeight+ge),be.includes("n")&&(Me=ue.startHeight-ge,Yt=ue.startPosY+ge);let mt=B(ke,Me);be.includes("w")&&(_t=ue.startPosX+(ue.startWidth-mt.width)),be.includes("n")&&(Yt=ue.startPosY+(ue.startHeight-mt.height)),T(mt.width),L(mt.height),R(_t),I(Yt)},le=()=>{k(!1),x&&x({width:F,height:P}),N.current=null};return document.addEventListener("mousemove",Z),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",le)}},[A,F,P,B,x]),ie(()=>{if(!m||!g)return;let Z=le=>{le.key==="Escape"&&g()};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[m,g]);let te=v(Z=>{h&&h()},[h]);if(b==="minimized")return null;let G=b==="maximized",_=X(()=>{let Z={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:G?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:G?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return G?(Z.top="0",Z.left="0",Z.width="100%",Z.height="100%"):(Z.top=`${C}px`,Z.left=`${z}px`,Z.width=`${F}px`,Z.height=`${P}px`),c!==void 0&&(Z.zIndex=String(c)),D&&(Z.cursor="grabbing",Z.userSelect="none"),Z},[G,z,C,F,P,c,m,D]),O=X(()=>{let Z={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!G?"grab":"default",opacity:m?"1":"0.6"};return D&&(Z.cursor="grabbing"),Z},[m,u,G,D]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},q={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let re=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...q,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:Z=>{Z.stopPropagation(),f&&f()}}),o("button",{type:"button","aria-label":G?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...q,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:Z=>{Z.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...q,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:Z=>{Z.stopPropagation(),g&&g()}}));Q.push(re);let ee=[];if(d&&!G){let Z=["n","s","e","w","ne","nw","se","sw"];for(let le=0;le<Z.length;le++){let de=Z[le],ce={position:"absolute",zIndex:"1"};de==="n"?(ce.top="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):de==="s"?(ce.bottom="0",ce.left=`${ye}px`,ce.right=`${ye}px`,ce.height=`${ye}px`):de==="e"?(ce.top=`${ye}px`,ce.right="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):de==="w"?(ce.top=`${ye}px`,ce.left="0",ce.bottom=`${ye}px`,ce.width=`${ye}px`):de==="ne"?(ce.top="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="nw"?(ce.top="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="se"?(ce.bottom="0",ce.right="0",ce.width=`${ye}px`,ce.height=`${ye}px`):de==="sw"&&(ce.bottom="0",ce.left="0",ce.width=`${ye}px`,ce.height=`${ye}px`),ce.cursor=Bl[de],ee.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${de}`,style:ce,onMouseDown:ne(de)}))}}let se=null;if(w){let Z={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};w==="left"?(Z.top="0",Z.left="0",Z.width="50%",Z.height="100%"):w==="right"?(Z.top="0",Z.right="0",Z.width="50%",Z.height="100%"):w==="top"&&(Z.top="0",Z.left="0",Z.width="100%",Z.height="100%"),se=o("div",{className:"draggable-window__snap-preview",style:Z})}let ae=[];for(let Z=0;Z<ee.length;Z++)ae.push(ee[Z]);ae.push(o("div",{className:"draggable-window__title-bar",style:O,onMouseDown:U,onDblClick:J,role:"toolbar","aria-label":`${n} window controls`},...Q)),ae.push(o("div",{className:"draggable-window__body",style:Y},S));let K=[o("div",{ref:$,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${b}`,style:_,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:te},...ae)];return se&&K.push(se),K.length===1?K[0]:o("div",{style:{display:"contents"}},...K)}var Ol=["File","Edit","View","Insert","Format","Tools","Help"],Xr={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},Hl=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],_l=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Yl=["1","2","3","4","5","6","7"],Vl={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Gl(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function qr(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function Pt(e){let[t,n]=j(!1),[r,i]=j(!1),[s,a]=j(!1),[l,d]=j(-1),[u,b]=j(""),[m,c]=j(-1),[g,f]=j(0),[y,h]=j("3"),p=oe(null),x=v(()=>{document.execCommand("bold",!1),n(Y=>!Y),p.current&&p.current.focus()},[]),S=v(()=>{document.execCommand("italic",!1),i(Y=>!Y),p.current&&p.current.focus()},[]),z=v(()=>{document.execCommand("underline",!1),a(Y=>!Y),p.current&&p.current.focus()},[]),R={bold:x,italic:S,underline:z},C={bold:t,italic:r,underline:s},I=v(Y=>{document.execCommand(Y,!1),p.current&&p.current.focus()},[]),F=v(Y=>{document.execCommand("fontSize",!1,Y),h(Y),p.current&&p.current.focus()},[]),T=v(Y=>{c(q=>q===Y?-1:Y)},[]),P=v(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":p.current&&(p.current.innerHTML="",f(0));break;default:break}c(-1),p.current&&p.current.focus()},[]),L=v(()=>{if(p.current){let Y=p.current.textContent??"";f(qr(Y))}},[]),D=v(()=>{c(-1)},[]),W=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),A={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},k={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},E={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},M={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},N={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},$=X(()=>Gl(),[]),B=e.content??"Start typing...",H=qr(B),V=g>0?g:H;function U(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let J={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ne={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function te(Y,q){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...q??{}}}let G={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},_={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},O=Ol.map((Y,q)=>{let Q=[Y];return m===q&&Xr[Y]&&Q.push(o("div",{key:"dropdown",style:J,className:"word-processor__menu-dropdown"},...Xr[Y].map((re,ee)=>o("button",{key:String(ee),style:ne,onClick:se=>{se.stopPropagation(),P(re.action)},role:"menuitem"},re.label)))),o("button",{key:String(q),style:U(q),role:"menuitem","aria-label":Y,onClick:()=>T(q),onMouseEnter:()=>{d(q)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:W},o("div",{className:"word-processor__menu-bar",style:A,role:"menubar"},...O),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:G,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Hl.map(Y=>o("button",{key:Y.id,style:te(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:R[Y.id],onMouseEnter:()=>b(Y.id),onMouseLeave:()=>b("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:_,"aria-label":"Font size",value:y,onChange:Y=>{let q=Y.target;F(q.value)}},...Yl.map(Y=>o("option",{key:Y,value:Y},Vl[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},..._l.map((Y,q)=>o("button",{key:String(q),style:te(`align-${q}`),title:Y.label,"aria-label":Y.label,onClick:()=>I(Y.command),onMouseEnter:()=>b(`align-${q}`),onMouseLeave:()=>b("")},Y.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...$),o("main",{className:"word-processor__document-area",style:E,onClick:D},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:p,onInput:L,suppressContentEditableWarning:!0},B)),o("div",{className:"word-processor__status-bar",style:N},o("span",null,"Page 1 of 1"),o("span",null,`${V} words`),o("span",null,"100%")))}var Ul=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Kr={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},Zr=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],Sn={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},Jr=Sn["App.ts"],jl=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),Xl=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Qr="#569cd6",ql="#ce9178",Kl="#4ec9b0",Zl="#6a9955",Jl="#dcdcaa",yn="#d4d4d4",Ql="#d4d4d4",ec="#b5cea8";function tc(e){if(!e.trim())return[{text:"\xA0",color:yn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:Zl});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:ql}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:ec}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=yn;jl.has(i)?l=Qr:Xl.has(i)?l=Kl:a?l=Jl:(i==="true"||i==="false")&&(l=Qr),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:yn}),n=r;continue}t.push({text:e[n],color:Ql}),n++}return t}function Rt(e){let[t,n]=j("App.ts"),[r,i]=j({src:!0,components:!0,hooks:!0}),[s,a]=j(-1),[l,d]=j(Jr.length),u=oe(null),b=v(O=>{n(O);let Y=Sn[O];Y&&d(Y.length)},[]),m=v(O=>{i(Y=>{let q={},Q=Object.keys(Y);for(let re=0;re<Q.length;re++)q[Q[re]]=Y[Q[re]];return q[O]=!Y[O],q})},[]),c=v(O=>{a(Y=>Y===O?-1:O)},[]),g=v(O=>{switch(O){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),f=v(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
|
|
8
|
-
`);d(Math.max(Y.length,1))}},[]),y=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),h={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},p={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},S={...x,backgroundColor:"rgba(255,255,255,0.1)"},z={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},R={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},I={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},F={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},T={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(O,Y,q)=>({padding:"3px 8px",paddingLeft:`${12+O*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:q?"rgba(255,255,255,0.08)":"transparent"}),L={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},D={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},W={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},A={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},k={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},E={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},M={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},N={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},$=8,B=30,H=Sn[t]??Jr,V=H.map((O,Y)=>{let q=tc(O),Q=[],re=0;for(let ee of q)Q.push(o("span",{key:String(re++),style:{color:ee.color}},ee.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),U=Math.max(l,H.length),J=[];for(let O=0;O<U;O++)J.push(o("div",{key:String(O)},String(O+1)));let ne=O=>{if(!O.parent)return!0;if(!r[O.parent])return!1;let Y=Zr.find(q=>q.name===O.parent&&q.isFolder);return Y?ne(Y):!0},te=Ul.map((O,Y)=>{let q=[O],Q=s===Y;return Q&&Kr[O]&&q.push(o("div",{key:"dropdown",style:z,className:"ide__menu-dropdown"},...Kr[O].map((re,ee)=>o("button",{key:String(ee),style:R,onClick:se=>{se.stopPropagation(),g(re.action)},role:"menuitem"},re.label)))),o("button",{key:String(Y),style:Q?S:x,role:"menuitem","aria-label":O,onClick:()=>c(Y)},...q)}),_=Zr.map((O,Y)=>{if(!ne(O))return null;let q=!O.isFolder&&O.name===t,Q=O.isFolder?r[O.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:P(O.indent,O.isFolder,q),onClick:O.isFolder?()=>m(O.name):()=>b(O.name)},Q,O.name)}).filter(O=>O!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:h},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:p,role:"menubar"},...te),o("div",{style:C},o("nav",{className:"ide__sidebar",style:I,"aria-label":"File explorer"},o("div",{style:T},"Explorer"),..._),o("div",{style:F}),o("div",{style:L},o("div",{style:D},o("button",{style:W,"aria-label":t},t)),o("div",{style:A},o("div",{style:k,"aria-hidden":"true"},...J),o("code",{style:w,contentEditable:"true",ref:u,onInput:f,suppressContentEditableWarning:!0},...V))),o("div",{className:"ide__minimap",style:E,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${$}px`,left:"0",right:"0",height:`${B}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...H.map((O,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:O.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,O.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:M},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:N},"\u2387 main"),o("span",{style:N},"0 errors"),o("span",{style:N},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:N},"Ln 1, Col 1"),o("span",{style:N},"UTF-8"),o("span",{style:N},"TypeScript"))))}var nc=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],ei=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],ti=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],ni=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],oc=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],rc=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],oi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],ri=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],ii=["09:30","10:00","10:30","11:00","11:30","12:00"];function ic(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function ut(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function $e(e){return e.toFixed(2)}var Ke={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},Ze={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},$t={width:"100%",borderCollapse:"collapse",fontSize:"12px"},ve={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},we={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},It={cursor:"default",transition:"background-color 0.1s"};function sc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,b)=>{let m=b/(e.length-1)*40,c=14-(u-i)/a*14;return`${m.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function ac(e,t){let u=Math.min(...e),b=Math.max(...e),m=b-u||1,c=310/(e.length-1),g=e.map((C,I)=>{let F=40+I*c,T=15+(1-(C-u)/m)*120;return{x:F,y:T}}),f=g.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+g.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${g[g.length-1].x.toFixed(1)},135 Z`,h=[];for(let C=1;C<e.length;C++){let I=e[C]>=e[C-1]?"#00c853":"#ff1744";h.push(o("line",{key:String(C),x1:String(g[C-1].x.toFixed(1)),y1:String(g[C-1].y.toFixed(1)),x2:String(g[C].x.toFixed(1)),y2:String(g[C].y.toFixed(1)),stroke:I,strokeWidth:"2",strokeLinecap:"round"}))}let p=[];for(let C=0;C<5;C++){let I=15+C/4*120,F=b-C/4*m;p.push(o("line",{key:`g${C}`,x1:String(40),y1:String(I.toFixed(1)),x2:String(350),y2:String(I.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),p.push(o("text",{key:`yl${C}`,x:String(36),y:String((I+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},$e(F)))}let x=[],S=Math.min(ii.length,e.length),z=(e.length-1)/(S-1);for(let C=0;C<S;C++){let F=40+Math.round(C*z)*c;x.push(o("text",{key:`tl${C}`,x:String(F.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},ii[C]))}let R="chartGrad";return o("div",{style:Ke},o("div",{style:Ze},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${$e(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:R,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${R})`}),...p,...x,...h,o("line",{x1:String(40),y1:String((15+(1-(t-u)/m)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/m)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function lc(){let e=Math.max(...ei.map(t=>t.qty),...ti.map(t=>t.qty));return o("div",{style:Ke},o("div",{style:Ze},"Order Book"),o("table",{style:$t},o("thead",null,o("tr",null,o("th",{style:ve},"Bid Price"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Ask Price"),o("th",{style:ve},"Qty"))),o("tbody",null,...ei.map((t,n)=>{let r=ti[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:It},o("td",{style:{...we,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},$e(t.price)),o("td",{style:{...we,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},ut(t.qty)),o("td",{style:{...we,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?$e(r.price):""),o("td",{style:{...we,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?ut(r.qty):""))}))))}function cc(e){return o("div",{style:Ke},o("div",{style:Ze},"Watchlist"),o("table",{style:$t},o("thead",null,o("tr",null,o("th",{style:ve},"Symbol"),o("th",{style:ve},"Price"),o("th",{style:ve},"Chg%"),o("th",{style:ve},"Volume"))),o("tbody",null,...nc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:It},o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},t.symbol,sc(t.spark,i)),o("td",{style:{...we,fontFamily:"monospace"}},$e(r)),o("td",{style:{...we,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${$e(t.change)}%`),o("td",{style:{...we,fontFamily:"monospace",color:"#8888aa"}},ic(t.volume)))}))))}function dc(){let e=ni.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ke},o("div",{style:Ze},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${$e(e)}`)),o("table",{style:$t},o("thead",null,o("tr",null,o("th",{style:ve},"Symbol"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Avg"),o("th",{style:ve},"P&L"))),o("tbody",null,...ni.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...It,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...we,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...we,fontFamily:"monospace"}},$e(n.avgPrice)),o("td",{style:{...we,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${$e(n.pnl)}`))}))))}function uc(){return o("div",{style:Ke},o("div",{style:Ze},"Recent Trades"),o("table",{style:$t},o("thead",null,o("tr",null,o("th",{style:ve},"Time"),o("th",{style:ve},"Sym"),o("th",{style:ve},"Side"),o("th",{style:ve},"Qty"),o("th",{style:ve},"Price"))),o("tbody",null,...oc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:It},o("td",{style:{...we,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...we,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...we,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...we,fontFamily:"monospace"}},ut(e.qty)),o("td",{style:{...we,fontFamily:"monospace"}},$e(e.price)))}))))}function pc(){let e=Math.max(...oi.map(n=>n.volume),...ri.map(n=>n.volume)),t="16px";return o("div",{style:Ke},o("div",{style:Ze},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...oi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},$e(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},ut(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...ri.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},$e(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},ut(n.volume))))))}function Dt(e){let[t,n]=j(0),[r,i]=j("--:--:--"),[s,a]=j(!0);ie(()=>{let g=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(g)},[]),ie(()=>{let g=()=>{let y=new Date,h=String(y.getHours()).padStart(2,"0"),p=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${h}:${p}:${x}`)};g();let f=setInterval(g,1e3);return()=>clearInterval(f)},[]),ie(()=>{let g=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(g)},[]);let l=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},b={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},m=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:b},ac(rc,m),lc(),cc(t),dc(),uc(),pc()))}var Je=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function vn(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:b,onGridToggle:m,onSearch:c}=e,[g,f]=j(""),y=v(I=>{let F=I.target.value;f(F),c(F)},[c]),h={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},p={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...p,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},S={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},z={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},R={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=Je.map(I=>{let F=I===r,T=I===i,P=()=>{F&&b?b(T?null:I):u(I)},L="1px solid rgba(0,0,0,0.15)";return T?L="3px solid #ef4444":F&&(L="2px solid #3b82f6"),o("button",{key:I,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:I,border:L,cursor:"pointer",padding:"0",flexShrink:"0",opacity:T?"1":i?"0.5":"1"},onClick:P,"aria-label":T?`Clear color filter ${I}`:`Select color ${I}`,"data-testid":`color-swatch-${I}`})});return o("div",{className:"board-toolbar",style:h,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:p,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:z}),o("button",{style:p,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:S,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:p,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:z}),...C,o("div",{style:z}),o("button",{style:n?x:p,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:z}),o("input",{type:"text",placeholder:"Search cards...",value:g,onInput:y,style:R,"data-testid":"search-input","aria-label":"Search cards"}))}var si={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},fc=Je,gc=[{label:"Low",value:"low"},{label:"Medium",value:"medium"},{label:"High",value:"high"},{label:"Critical",value:"critical"}];function wn(e){let{card:t,selected:n,onSelect:r,onMove:i,onResize:s,onDelete:a,onDoubleClick:l,onDragStart:d,onDuplicate:u,onChangeColor:b,onChangePriority:m,onAnchorDragStart:c}=e,[g,f]=j(!1),[y,h]=j(null),[p,x]=j(!1),[S,z]=j(!1),R=oe(null),C=oe(null),I=oe(null),F=oe(null),T=t.priority?si[t.priority]||"#94a3b8":"transparent",P=v(K=>{let Z=K;Z.preventDefault(),Z.stopPropagation(),h({x:Z.clientX,y:Z.clientY}),x(!1),z(!1)},[]),L=v(()=>{h(null),x(!1),z(!1)},[]);ie(()=>{if(!y)return;let K=()=>{L()},Z=setTimeout(()=>{document.addEventListener("click",K),document.addEventListener("contextmenu",K)},0);return()=>{clearTimeout(Z),document.removeEventListener("click",K),document.removeEventListener("contextmenu",K)}},[y,L]);let D=v(K=>{K.stopPropagation(),L(),u&&u(t.id)},[t.id,u,L]),W=v(K=>{K.stopPropagation(),L(),a(t.id)},[t.id,a,L]),A=v(()=>{x(!0),z(!1)},[]),k=v(()=>{z(!0),x(!1)},[]),w=v(K=>{L(),b&&b(t.id,K)},[t.id,b,L]),E=v(K=>{L(),m&&m(t.id,K)},[t.id,m,L]),M=v((K,Z)=>{let le=Z;if(le.preventDefault(),le.stopPropagation(),c){let de=t.position.x+t.size.width/2,ce=t.position.y+t.size.height/2,ue=de,fe=ce;K==="top"?(ue=de,fe=t.position.y):K==="bottom"?(ue=de,fe=t.position.y+t.size.height):K==="left"?(ue=t.position.x,fe=ce):K==="right"&&(ue=t.position.x+t.size.width,fe=ce),c(t.id,K,ue,fe)}},[t.id,t.position,t.size,c]),N=v(K=>{let Z=K,le=Z.target;if(le.dataset&&(le.dataset.role==="delete"||le.dataset.role==="resize"||le.dataset.role==="anchor"))return;Z.preventDefault(),Z.stopPropagation(),r(t.id),R.current={x:Z.clientX,y:Z.clientY,cardX:t.position.x,cardY:t.position.y};let de=ue=>{let fe=ue;if(!R.current)return;let ge=fe.clientX-R.current.x,be=fe.clientY-R.current.y;i(t.id,{x:R.current.cardX+ge,y:R.current.cardY+be})},ce=()=>{R.current=null,document.removeEventListener("mousemove",de),document.removeEventListener("mouseup",ce)};document.addEventListener("mousemove",de),document.addEventListener("mouseup",ce),d&&d(t.id,K)},[t.id,t.position.x,t.position.y,r,i,d]),$=v(K=>{let Z=K;Z.preventDefault(),Z.stopPropagation(),C.current={x:Z.clientX,y:Z.clientY,w:t.size.width,h:t.size.height};let le=ce=>{let ue=ce;if(!C.current)return;let fe=ue.clientX-C.current.x,ge=ue.clientY-C.current.y,be=Math.max(120,C.current.w+fe),ke=Math.max(80,C.current.h+ge);s(t.id,{width:be,height:ke})},de=()=>{C.current=null,document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",de)};document.addEventListener("mousemove",le),document.addEventListener("mouseup",de)},[t.id,t.size.width,t.size.height,s]),B=v(K=>{K.preventDefault(),K.stopPropagation(),l(t.id)},[t.id,l]),H=v(K=>{K.preventDefault(),K.stopPropagation(),a(t.id)},[t.id,a]),V={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:"6px",borderLeft:`4px solid ${T}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease"},U={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},J={fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},ne={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:g?"block":"none",border:"none",padding:"0"},te={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},G=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((K,Z)=>o("span",{key:String(Z),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},K))):null,_={position:"absolute",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #ffffff",cursor:"crosshair",display:g?"block":"none",zIndex:"10",boxSizing:"border-box"},O={..._,top:"-5px",left:"50%",transform:"translateX(-50%)"},Y={..._,top:"50%",right:"-5px",transform:"translateY(-50%)"},q={..._,bottom:"-5px",left:"50%",transform:"translateX(-50%)"},Q={..._,top:"50%",left:"-5px",transform:"translateY(-50%)"},re={position:"fixed",left:y?`${y.x}px`:"0",top:y?`${y.y}px`:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},ee={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},se={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},ae=y?o("div",{ref:F,className:"card-context-menu",style:re,"data-testid":`context-menu-${t.id}`,role:"menu","aria-label":"Card context menu"},o("div",{style:ee,onClick:D,role:"menuitem","data-testid":`context-menu-duplicate-${t.id}`},"Duplicate"),o("div",{style:ee,onClick:W,role:"menuitem","data-testid":`context-menu-delete-${t.id}`},"Delete"),o("div",{style:{...ee,position:"relative"},onMouseEnter:A,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-color-${t.id}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),p?o("div",{style:se,role:"menu","data-testid":`context-submenu-color-${t.id}`},...fc.map(K=>o("div",{key:K,style:{...ee,gap:"8px"},onClick:Z=>{Z.stopPropagation(),w(K)},role:"menuitem","data-testid":`context-color-${K}`},o("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:K,border:"1px solid rgba(0,0,0,0.15)",display:"inline-block",flexShrink:"0"}}),K===t.color?"\u2713":""))):null),o("div",{style:{...ee,position:"relative"},onMouseEnter:k,role:"menuitem","aria-haspopup":"true","data-testid":`context-menu-priority-${t.id}`},"Set Priority",o("span",{style:{marginLeft:"8px"}},"\u25B6"),S?o("div",{style:se,role:"menu","data-testid":`context-submenu-priority-${t.id}`},...gc.map(K=>o("div",{key:K.value,style:{...ee,gap:"8px"},onClick:Z=>{Z.stopPropagation(),E(K.value)},role:"menuitem","data-testid":`context-priority-${K.value}`},o("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:si[K.value]||"#94a3b8",display:"inline-block",flexShrink:"0"}}),K.label,K.value===t.priority?" \u2713":""))):null)):null;return o("div",{ref:I,className:"board-card",style:V,onMouseDown:N,onDblClick:B,onContextMenu:P,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),"data-card-id":t.id,"data-testid":`card-${t.id}`,role:"button","aria-label":`Card: ${t.title}`,tabIndex:0},o("div",{style:U},t.title||"Untitled"),o("div",{style:J},t.description||""),G,o("button",{style:ne,"data-role":"delete","data-testid":`card-delete-${t.id}`,onClick:H,"aria-label":`Delete ${t.title}`,tabIndex:-1},"\xD7"),o("div",{style:te,"data-role":"resize",onMouseDown:$,"aria-label":"Resize card"}),o("div",{style:O,"data-role":"anchor","data-anchor":"top","data-testid":`anchor-top-${t.id}`,onMouseDown:K=>M("top",K),"aria-label":"Connection anchor top"}),o("div",{style:Y,"data-role":"anchor","data-anchor":"right","data-testid":`anchor-right-${t.id}`,onMouseDown:K=>M("right",K),"aria-label":"Connection anchor right"}),o("div",{style:q,"data-role":"anchor","data-anchor":"bottom","data-testid":`anchor-bottom-${t.id}`,onMouseDown:K=>M("bottom",K),"aria-label":"Connection anchor bottom"}),o("div",{style:Q,"data-role":"anchor","data-anchor":"left","data-testid":`anchor-left-${t.id}`,onMouseDown:K=>M("left",K),"aria-label":"Connection anchor left"}),ae)}function kn(e){let{card:t,onSave:n,onClose:r}=e,[i,s]=j(t.title),[a,l]=j(t.description),d=oe(null),u=oe(null);ie(()=>{d.current&&(d.current.focus(),d.current.select())},[]);let b=v(()=>{n(t.id,{title:i,description:a}),r()},[t.id,i,a,n,r]),m=v(R=>{R.key==="Escape"&&b()},[b]),c=v(R=>{R.target===u.current&&b()},[b]),g=v(R=>{s(R.target.value)},[]),f=v(R=>{l(R.target.value)},[]),y=v(R=>{let C=R;if(C.key==="Tab"){C.preventDefault();let I=C.target.parentElement?.querySelector("textarea");I&&I.focus()}C.key==="Escape"&&b()},[b]),h={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"},p={backgroundColor:t.color||"#fef9c3",borderRadius:"8px",padding:"16px",width:`${Math.max(t.size.width,200)}px`,boxShadow:"0 8px 24px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",gap:"8px"},x={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"14px",fontWeight:"600",backgroundColor:"rgba(255,255,255,0.7)",color:"#1a1a1a",outline:"none",width:"100%",boxSizing:"border-box"},S={border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",padding:"6px 8px",fontSize:"12px",backgroundColor:"rgba(255,255,255,0.7)",color:"#333",outline:"none",resize:"vertical",minHeight:"60px",width:"100%",boxSizing:"border-box",fontFamily:"inherit"},z={padding:"6px 14px",border:"none",borderRadius:"4px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"12px",fontWeight:"600",alignSelf:"flex-end"};return o("div",{ref:u,className:"card-editor-overlay",style:h,onClick:c,onKeyDown:m,"data-testid":"card-editor-overlay"},o("div",{style:p,"data-testid":"card-editor",role:"dialog","aria-label":`Edit card: ${t.title}`},o("input",{ref:d,type:"text",value:i,onInput:g,onKeyDown:y,style:x,placeholder:"Card title","data-testid":"card-editor-title","aria-label":"Card title"}),o("textarea",{value:a,onInput:f,onKeyDown:m,style:S,placeholder:"Description...","data-testid":"card-editor-description","aria-label":"Card description"}),o("button",{style:z,onClick:b,"data-testid":"card-editor-save"},"Done")))}function ai(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}function mc(e){switch(e){case"dashed":return"8,4";case"dotted":return"2,4";default:return"none"}}function Cn(e){let{connections:t,cards:n,selectedConnectionId:r,onSelectConnection:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let m=0;m<n.length;m++)l.set(n[m].id,n[m]);let d=v(m=>{i(m)},[i]),u=[];for(let m=0;m<t.length;m++){let c=t[m],g=l.get(c.fromCardId),f=l.get(c.toCardId);if(!g||!f)continue;let y=ai(g),h=ai(f),p=c.id===r,x=p?"#3b82f6":"#94a3b8",S=mc(c.style);if(u.push(o("line",{key:`hit-${c.id}`,x1:String(y.x),y1:String(y.y),x2:String(h.x),y2:String(h.y),stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(c.id),"data-testid":`connection-hit-${c.id}`})),u.push(o("line",{key:c.id,x1:String(y.x),y1:String(y.y),x2:String(h.x),y2:String(h.y),stroke:x,"stroke-width":p?"3":"2","stroke-dasharray":S,"pointer-events":"none","data-testid":`connection-${c.id}`})),c.label){let z=(y.x+h.x)/2,R=(y.y+h.y)/2;u.push(o("text",{key:`label-${c.id}`,x:String(z),y:String(R-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none"},c.label))}}return o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(s),height:String(a),className:"connections-overlay","data-testid":"connections-overlay",role:"img","aria-label":"Card connections"},o("g",{style:{pointerEvents:"auto"}},...u))}var Qe=20,et=5e3;function ci(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Mn(e,t,n,r){let i=r??40;if(e.length===0)return{panX:0,panY:0,zoom:1};let s=1/0,a=1/0,l=-1/0,d=-1/0;for(let h=0;h<e.length;h++){let p=e[h];p.position.x<s&&(s=p.position.x),p.position.y<a&&(a=p.position.y);let x=p.position.x+p.size.width,S=p.position.y+p.size.height;x>l&&(l=x),S>d&&(d=S)}let u=l-s+i*2,b=d-a+i*2,m=t/u,c=n/b,g=Math.max(.25,Math.min(4,Math.min(m,c))),f=-s*g+(t-(l-s)*g)/2,y=-a*g+(n-(d-a)*g)/2;return{panX:f,panY:y,zoom:g}}var li=0;function hc(){return li++,`conn-${Date.now()}-${li}`}function En(e){let{state:t,dispatch:n,searchQuery:r,gridEnabled:i,selectedCardId:s,onSelectCard:a,colorFilter:l}=e,{cards:d,connections:u,viewport:b}=t,[m,c]=j(null),[g,f]=j(null),y=oe(null),h=oe(!1),p=oe(null),[x,S]=j(null),z=oe(x);z.current=x;let R=v(_=>{let O=_;if(O.target.closest(".board-card"))return;let q=O.button===1,Q=O.button===0&&O.shiftKey;q||Q?(O.preventDefault(),h.current=!0,p.current={x:O.clientX,y:O.clientY,panX:b.panX,panY:b.panY}):O.button===0&&(a(null),f(null))},[b.panX,b.panY,a]);ie(()=>{let _=Y=>{if(!h.current||!p.current)return;let q=Y,Q=q.clientX-p.current.x,re=q.clientY-p.current.y;n({type:"PAN",panX:p.current.panX+Q,panY:p.current.panY+re})},O=()=>{h.current=!1,p.current=null};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)}},[n]);let C=v(_=>{let O=_;if(!O.ctrlKey)return;O.preventDefault();let Y=O.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:b.zoom+Y})},[b.zoom,n]);ie(()=>{let _=O=>{let Y=O;(Y.key==="Delete"||Y.key==="Backspace")&&(g?(n({type:"REMOVE_CONNECTION",connectionId:g}),f(null)):s&&(n({type:"REMOVE_CARD",cardId:s}),a(null)))};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[g,s,n,a]);let I=v(_=>{a(_),f(null)},[a]),F=v((_,O)=>{let Y=O;i&&(Y={x:Math.round(O.x/Qe)*Qe,y:Math.round(O.y/Qe)*Qe}),n({type:"MOVE_CARD",cardId:_,position:Y})},[n,i]),T=v((_,O)=>{n({type:"RESIZE_CARD",cardId:_,size:O})},[n]),P=v(_=>{n({type:"REMOVE_CARD",cardId:_}),s===_&&a(null)},[n,s,a]),L=v(_=>{c(_)},[]),D=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:O})},[n]),W=v(()=>{c(null)},[]),A=v(_=>{f(_),a(null)},[a]),k=v(_=>{n({type:"REMOVE_CONNECTION",connectionId:_}),f(null)},[n]),w=v(_=>{let O=`card-${Date.now()}-dup`;n({type:"DUPLICATE_CARD",cardId:_,newId:O})},[n]),E=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:{color:O}})},[n]),M=v((_,O)=>{n({type:"UPDATE_CARD",cardId:_,updates:{priority:O}})},[n]),N=v((_,O,Y,q)=>{S({fromCardId:_,fromAnchor:O,fromX:Y,fromY:q,toX:Y,toY:q})},[]);ie(()=>{if(!z.current)return;let _=Y=>{let q=Y;if(!z.current)return;let Q=ci(q.clientX,q.clientY,b);S(re=>re?{...re,toX:Q.x,toY:Q.y}:null)},O=Y=>{let q=Y;if(!z.current)return;let Q=z.current,re=q.target,ee=re.closest?re.closest("[data-anchor]"):null,se=re.closest?re.closest("[data-card-id]"):null;if(ee&&se){let ae=se.getAttribute("data-card-id");ae&&ae!==Q.fromCardId&&n({type:"ADD_CONNECTION",connection:{id:hc(),fromCardId:Q.fromCardId,toCardId:ae}})}S(null)};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)}},[x,b,n]);let $=r.toLowerCase(),B=$?d.filter(_=>_.title.toLowerCase().includes($)):d,H=new Set;if($)for(let _=0;_<d.length;_++)d[_].title.toLowerCase().includes($)||H.add(d[_].id);if(l)for(let _=0;_<d.length;_++)d[_].color!==l&&H.add(d[_].id);let V={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:h.current?"grabbing":"default",backgroundImage:"radial-gradient(circle, #d1d5db 1px, transparent 1px)",backgroundSize:`${Qe}px ${Qe}px`},U={transform:`translate(${b.panX}px, ${b.panY}px) scale(${b.zoom})`,transformOrigin:"0 0",position:"relative",width:`${et}px`,height:`${et}px`},J=d.map(_=>{let O=H.has(_.id),Y=o(wn,{key:_.id,card:_,selected:_.id===s,onSelect:I,onMove:F,onResize:T,onDelete:P,onDoubleClick:L,onDuplicate:w,onChangeColor:E,onChangePriority:M,onAnchorDragStart:N});return O?o("div",{key:`dim-${_.id}`,style:{opacity:"0.3"}},Y):Y}),ne=m?d.find(_=>_.id===m):null,te=ne?o(kn,{card:ne,onSave:D,onClose:W}):null,G=x?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"5"},width:String(et),height:String(et),"data-testid":"connection-drag-line"},o("line",{x1:String(x.fromX),y1:String(x.fromY),x2:String(x.toX),y2:String(x.toY),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6,4","pointer-events":"none"})):null;return o("div",{ref:y,className:"board-canvas",style:V,onMouseDown:R,onWheel:C,"data-testid":"board-canvas",role:"application","aria-label":"Project board canvas",tabIndex:0},o("div",{className:"board-canvas__inner",style:U,"data-testid":"board-canvas-inner"},o(Cn,{connections:u,cards:d,selectedConnectionId:g,onSelectConnection:A,onDeleteConnection:k,canvasWidth:et,canvasHeight:et}),G,...J),te)}var di=50,zt={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}};function ui(e,t){switch(t.type){case"ADD_CARD":return{...e,cards:[...e.cards,t.card]};case"REMOVE_CARD":return{...e,cards:e.cards.filter(n=>n.id!==t.cardId),connections:e.connections.filter(n=>n.fromCardId!==t.cardId&&n.toCardId!==t.cardId)};case"MOVE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,position:t.position,updatedAt:Date.now()}:n)};case"RESIZE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,size:t.size,updatedAt:Date.now()}:n)};case"UPDATE_CARD":return{...e,cards:e.cards.map(n=>n.id===t.cardId?{...n,...t.updates,updatedAt:Date.now()}:n)};case"DUPLICATE_CARD":{let n=e.cards.find(s=>s.id===t.cardId);if(!n)return e;let r=t.offset||{x:20,y:20},i={...n,id:t.newId,position:{x:n.position.x+r.x,y:n.position.y+r.y},createdAt:Date.now(),updatedAt:Date.now()};return{...e,cards:[...e.cards,i]}}case"ADD_CONNECTION":return{...e,connections:[...e.connections,t.connection]};case"REMOVE_CONNECTION":return{...e,connections:e.connections.filter(n=>n.id!==t.connectionId)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;default:return e}}function bc(e){return e.type==="PAN"||e.type==="ZOOM"}function pi(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=ui(e.present,t.action);if(n===e.present)return e;if(bc(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>di&&r.splice(0,r.length-di),{past:r,present:n,future:[]}}default:return e}}function Pn(e,t){let n={past:[],present:zt,future:[]},[r,i]=Vt(pi,n),s=v(m=>{i({type:"BOARD_ACTION",action:m})},[i]),a=v(()=>{i({type:"UNDO"})},[i]),l=v(()=>{i({type:"REDO"})},[i]),d=oe(!1);ie(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{s({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,s]);let u=oe(null),b=oe(r.present);return b.current=r.present,ie(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,b.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,r.present]),{state:r.present,dispatch:s,undo:a,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0}}var fi={cards:[],connections:[],viewport:{panX:0,panY:0,zoom:1}},pt=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):fi}catch{return fi}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Rn(e){let{cards:t,onCardDropped:n,children:r}=e,i=Ne(),s=oe([]);ie(()=>{let u=s.current,b=new Set(u.map(c=>c.id)),m=new Set(t.map(c=>c.id));for(let c of t)b.has(c.id)||i.publish("project-board",{event:"card-created",card:c});for(let c of u)m.has(c.id)||i.publish("project-board",{event:"card-deleted",cardId:c.id});for(let c of t)if(b.has(c.id)){let g=u.find(f=>f.id===c.id);g&&g.updatedAt!==c.updatedAt&&i.publish("project-board",{event:"card-updated",card:c})}s.current=t},[t,i]);let a=v(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let b=u.data;n(String(b.title||"Dropped Item"),String(b.description||""))}},[n]),{isOver:l}=ct({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var gi=0;function mi(){return gi++,`card-${Date.now()}-${gi}`}var xc=new pt,yc=[{id:"sample-1",title:"Auth API",description:"Design the auth flow",color:"#3b82f6",position:{x:50,y:50},size:{width:180,height:120},priority:"high",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-2",title:"Dashboard",description:"Build the main dashboard",color:"#22c55e",position:{x:300,y:80},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-3",title:"Deploy",description:"Set up CI pipeline",color:"#f59e0b",position:{x:150,y:250},size:{width:180,height:120},priority:"low",createdAt:Date.now(),updatedAt:Date.now()},{id:"sample-4",title:"Docs",description:"Write API reference",color:"#a855f7",position:{x:400,y:280},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()}],Sc={cards:yc,connections:[{id:"sample-conn-1",fromCardId:"sample-1",toCardId:"sample-2"}],viewport:{panX:0,panY:0,zoom:1}};function vc(e){return e.cards.length===0&&e.connections.length===0}function hi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Pn(xc,t),[d,u]=j(Je[0]),[b,m]=j(!1),[c,g]=j(""),[f,y]=j(null),[h,p]=j(null),x=oe(!1);ie(()=>{!x.current&&vc(n)?(x.current=!0,r({type:"SET_BOARD",state:Sc})):n.cards.length>0&&(x.current=!0)},[n,r]);let S=v(()=>{let E=(-n.viewport.panX+300)/n.viewport.zoom,M=(-n.viewport.panY+200)/n.viewport.zoom,N={id:mi(),title:"New Card",description:"",color:d,position:{x:Math.round(E),y:Math.round(M)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:N})},[n.viewport,d,r]),z=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),R=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),C=v(()=>{r({type:"ZOOM",zoom:1})},[r]),I=v(()=>{m(E=>!E)},[]),F=v(E=>{g(E)},[]),T=v(E=>{y(E)},[]),P=v(E=>{p(E)},[]),L=v(()=>{r({type:"SET_BOARD",state:zt}),y(null)},[r]),D=v(()=>{let E=JSON.stringify(n,null,2),M=new Blob([E],{type:"application/json"}),N=URL.createObjectURL(M),$=document.createElement("a");$.href=N,$.download=`board-${t}.json`,$.style.display="none",document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(N)},[n,t]),W=v(()=>{f&&(r({type:"REMOVE_CARD",cardId:f}),y(null))},[f,r]),A=v(()=>{if(n.cards.length===0)return;let N=Mn(n.cards,800,600);r({type:"PAN",panX:N.panX,panY:N.panY}),r({type:"ZOOM",zoom:N.zoom})},[n.cards,r]);ie(()=>{let E={menus:[{label:"File",items:[{label:"New Board",onClick:L},{label:"Export JSON",onClick:D},{divider:!0}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Delete Selected",onClick:W}]},{label:"View",items:[{label:"Zoom In",onClick:z},{label:"Zoom Out",onClick:R},{label:"Fit All",onClick:A},{divider:!0},{label:"Toggle Grid",onClick:I}]}]}},[L,D,i,s,a,l,W,z,R,A,I]),ie(()=>{let E=M=>{let N=M;N.ctrlKey&&N.key==="z"?(N.preventDefault(),i()):N.ctrlKey&&N.key==="y"&&(N.preventDefault(),s())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[i,s]);let k={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},w=v((E,M)=>{let N=(-n.viewport.panX+300)/n.viewport.zoom,$=(-n.viewport.panY+200)/n.viewport.zoom,B={id:mi(),title:E,description:M,color:d,position:{x:Math.round(N),y:Math.round($)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_CARD",card:B})},[n.viewport,d,r]);return o("div",{className:"project-manager-app",style:k,"data-testid":"project-manager-app"},o(vn,{zoom:n.viewport.zoom,gridEnabled:b,selectedColor:d,colorFilter:h,onNewCard:S,onZoomIn:z,onZoomOut:R,onZoomReset:C,onColorSelect:u,onColorFilter:P,onGridToggle:I,onSearch:F}),o(Rn,{cards:n.cards,onCardDropped:w},o(En,{state:n,dispatch:r,searchQuery:c,gridEnabled:b,selectedCardId:f,onSelectCard:T,colorFilter:h})))}var wc=28,kc=5e3;function Cc(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Mc(){let e=Ne(),t=oe(!1);return ie(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function Ec(){let[e,t]=j([]),n=He();at("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=v(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Pc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o(Fe,{appId:"files"},o(Ec,null));case"Terminal":return o(Fe,{appId:"terminal"},o(Mc,null));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(n=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},n)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(n=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},n)));case"Word Processor":return o(Pt,null);case"IDE":return o(Rt,null);case"Trading":return o(Dt,null);case"Project Board":return o(hi,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Rc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=it(),d=l.activeMenuBar,u=l.dockSignals,[b,m]=j([]),[c,g]=j([]),[f,y]=j(!1),[h,p]=j(!1),[x,S]=j(null),[z,R]=j({x:0,y:0}),[C,I]=j(null),F=v(()=>{y(K=>!K)},[]),T=v(K=>{g(Z=>Z.filter(le=>le.id!==K))},[]);ie(()=>{if(c.length===0)return;let K=c[0],Z=Date.now()-K.timestamp,le=Math.max(0,kc-Z),de=setTimeout(()=>{g(ce=>ce.filter(ue=>ue.id!==K.id))},le);return()=>clearTimeout(de)},[c]);let P=oe(t);P.current=t;let L=oe(r);L.current=r;let D=v(K=>{m(Z=>{if(Z.find(ge=>ge.id===K)){let ge=Math.max(...Z.map(be=>be.zIndex))+1;return Z.map(be=>be.id===K?{...be,focused:!0,zIndex:ge,windowState:be.windowState==="minimized"?"normal":be.windowState}:{...be,focused:!1})}let ce=P.current.find(ge=>ge.id===K);if(!ce)return Z;let ue=Z.length>0?Math.max(...Z.map(ge=>ge.zIndex))+1:1,fe={id:ce.id,title:ce.label,icon:ce.icon,x:60+Z.length*30,y:40+Z.length*30,width:600,height:400,zIndex:ue,focused:!0,windowState:"normal"};return[...Z.map(ge=>({...ge,focused:!1})),fe]}),K==="files"&&l.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),K==="terminal"&&l.signalDock("terminal",{badge:3}),L.current&&L.current(K)},[l]),W=t.map(K=>{let Z=b.some(ce=>ce.id===K.id),le=u.get(K.id),de={id:K.id,icon:K.icon,label:le?.tooltip||K.label,active:Z};return le&&(le.badge!=null&&(de.badge=le.badge>0?le.badge:void 0),le.progress!=null&&(de.progress=le.progress>0?le.progress:void 0),le.urgent&&(de.urgent=!0)),de}),A=b.find(K=>K.focused),k=A?A.title:void 0,w=v(()=>{p(!0)},[]),E=v(()=>{p(!1)},[]),M=v((K,Z)=>{S(K),R(Z)},[]),N=v(()=>{S(null)},[]),$=v(()=>{},[]),B=v(()=>{i&&i()},[i]),H=[];n&&(H.push({label:n.name,icon:void 0,onClick:$,divider:!1}),H.push({label:"",icon:void 0,onClick:$,divider:!0})),H.push({label:"Lock",icon:void 0,onClick:w,divider:!1}),H.push({label:"Logout",icon:void 0,onClick:B,divider:!1});let V=X(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),U={display:"flex",flex:"1",overflow:"hidden"},J={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},ne={width:"100%",height:"100%",position:"relative"},te=o(mn,{activeAppName:k,activitiesButton:{label:"Activities",onClick:F},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:H.length>0?H:void 0,height:wc}),G=o(hn,{items:W,orientation:"vertical",position:"left",iconSize:36,onItemClick:D,onItemContextMenu:M}),_=o(Cc,{toasts:c,onDismiss:T}),O=b.filter(K=>K.windowState!=="minimized").map(K=>o(dt,{key:K.id,id:K.id,title:K.title,icon:K.icon,defaultPosition:{x:K.x,y:K.y},defaultSize:{width:K.width,height:K.height},zIndex:K.zIndex,focused:K.focused,windowState:K.windowState,onClose:()=>{m(Z=>Z.filter(le=>le.id!==K.id))},onFocus:()=>{m(Z=>{let le=Math.max(...Z.map(de=>de.zIndex))+1;return Z.map(de=>de.id===K.id?{...de,focused:!0,zIndex:le}:{...de,focused:!1})})},onMinimize:()=>{m(Z=>Z.map(le=>le.id===K.id?{...le,windowState:"minimized"}:le))},onMaximize:()=>{m(Z=>Z.map(le=>le.id===K.id?{...le,windowState:le.windowState==="maximized"?"normal":"maximized"}:le))}},Pc(K.title))),Y=[];a&&Y.push(a),Y.push(...O),Y.push(_);let q=o(bn,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:ne},...Y)),Q=f?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:F},...t.map(K=>o("button",{key:K.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:Z=>{Z.stopPropagation(),y(!1),D(K.id)}},o("span",{style:{fontSize:"32px",display:"block"}},K.icon),o("span",null,K.label)))):null,re=h?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:E},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,ee=x?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:N},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${z.y}px`,left:`${z.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:K=>K.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(K=>K.id===x)?.label||x),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{I(x),S(null)},role:"menuitem"},"About"))):null,se=C?t.find(K=>K.id===C):null,ae=se?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>I(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:K=>K.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},se.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>I(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:V,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},te),o("div",{style:U},o("div",{className:"unity-desktop__dock",style:J},G),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},q,Q)),ee,ae,re)}function bi(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(pn,{onWindowOpen:r},o(st,null,o(lt,null,o(Rc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function xi(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:b,onDeactivate:m,children:c}=e,g=it(),f=X(()=>g.windows.find(I=>I.id===t),[g.windows,t]);ie(()=>(u?g.setMenuBar(t,u):g.clearMenuBar(t),()=>{g.clearMenuBar(t)}),[u,t,g]);let y=oe(!1),h=f?f.focused:!1;ie(()=>{let I=y.current;y.current=h,h&&!I?b&&b():!h&&I&&m&&m()},[h,b,m]);let p=v(()=>{g.closeWindow(t),d&&d()},[g,t,d]),x=v(()=>{g.focusWindow(t)},[g,t]),S=v(I=>{g.moveWindow(t,I)},[g,t]),z=v(I=>{g.resizeWindow(t,I)},[g,t]),R=v(()=>{g.minimizeWindow(t)},[g,t]),C=v(()=>{f&&f.windowState==="maximized"?g.restoreWindow(t):g.maximizeWindow(t)},[g,t,f]);return f?o(Fe,{appId:t},o(dt,{id:t,title:n,icon:r,defaultPosition:f.position,defaultSize:f.size,minSize:a,resizable:l,windowState:f.windowState,focused:f.focused,zIndex:f.zIndex,onClose:p,onFocus:x,onMove:S,onResize:z,onMinimize:R,onMaximize:C,children:c})):(g.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var yi={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Si={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function vi(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:b,active:m=!1}=e,c=X(()=>{let g=yi[i]??yi.md,f=Si[r]??Si.secondary,y={padding:g.padding,fontSize:g.fontSize,borderRadius:g.borderRadius,border:`1px solid ${f.border}`,backgroundColor:m?"#3b82f6":f.bg,color:m?"white":f.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,m,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":b,"aria-pressed":m?"true":void 0},t)}var $c=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],tt=Math.PI/180;function Ic(e,t,n,r,i,s,a,l,d,u){let b=Math.cos(r*tt),m=Math.sin(r*tt),c=Math.cos(i*tt),g=Math.sin(i*tt),f=Math.cos(s*tt),y=Math.sin(s*tt),h=e*f-t*y,p=e*y+t*f,x=h*c-p*g,S=h*g+p*c,z=n,R=x,C=S*b-z*m,I=S*m+z*b,F=1+a*.001*I,T=l+R*u*F,P=d-C*u*F;return{sx:T,sy:P,depth:I}}function wi(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function ki(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Ci(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:b=2,colorScale:m=$c,gridColor:c="#94a3b8",title:g}=e,f=X(()=>{let A=0,k=0,w=0;for(let E=0;E<t.length;E++){let M=t[E],N=M.data.length;N>A&&(A=N);for(let $=0;$<N;$++){let B=M.data[$].length;B>k&&(k=B);for(let H=0;H<B;H++){let V=Math.abs(M.data[$][H]??0);V>w&&(w=V)}}}return{maxRows:Math.max(A,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=X(()=>{let A=f.maxHeight+(t.length-1)*b+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+A*A),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,b,n,r]),h=n/2,p=r/2,x=v((A,k,w)=>Ic(A,k,w,s,a,l,i,h,p,y),[s,a,l,i,h,p,y]),S=v(()=>{if(!u)return[];let A=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,E=f.maxRows/2,M=x(-w,-E,0),N=x(w,-E,0);A.push(o("line",{key:"axis-x",x1:String(M.sx),y1:String(M.sy),x2:String(N.sx),y2:String(N.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-x-label",x:String(N.sx+8),y:String(N.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let $=x(-w,E,0);A.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.sy),x2:String($.sx),y2:String($.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-y-label",x:String($.sx-12),y:String($.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let B=f.maxHeight+(t.length-1)*b,H=x(-w,-E,B);return A.push(o("line",{key:"axis-z",x1:String(M.sx),y1:String(M.sy),x2:String(H.sx),y2:String(H.sy),stroke:"#374151","stroke-width":"1.5"})),A.push(o("text",{key:"axis-z-label",x:String(H.sx-4),y:String(H.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),A},[u,f,t.length,b,x]),z=v(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2,E=[];for(let M=0;M<t.length;M++){let N=t[M],$=N.color??m[M%m.length],B=N.opacity??.7,H=M*b,V=N.data.length;for(let U=0;U<V-1;U++){let J=N.data[U],ne=N.data[U+1],te=Math.min(J.length,ne.length);for(let G=0;G<te-1;G++){let _=G-k,O=G+1-k,Y=U-w,q=U+1-w,Q=(J[G]??0)+H,re=(J[G+1]??0)+H,ee=(ne[G]??0)+H,se=(ne[G+1]??0)+H,ae=x(_,Y,Q),K=x(O,Y,re),Z=x(_,q,ee),le=x(O,q,se),de=(ae.depth+K.depth+Z.depth+le.depth)/4,ce=`${ae.sx},${ae.sy} ${K.sx},${K.sy} ${le.sx},${le.sy} ${Z.sx},${Z.sy}`;E.push({points:ce,fill:wi($,B),stroke:ki($,.7),strokeWidth:"0.5",depth:de,key:`quad-${M}-${U}-${G}`})}}if(V===1||V>0&&N.data[0].length===1)for(let U=0;U<V;U++){let J=N.data[U];for(let ne=0;ne<J.length;ne++){let te=ne-k,G=U-w,_=(J[ne]??0)+H,O=x(te,G,_),Y=3,q=`${O.sx},${O.sy-Y} ${O.sx+Y},${O.sy} ${O.sx},${O.sy+Y} ${O.sx-Y},${O.sy}`;E.push({points:q,fill:wi($,B),stroke:ki($,.7),strokeWidth:"0.5",depth:O.depth,key:`point-${M}-${U}-${ne}`})}}}E.sort((M,N)=>M.depth-N.depth);for(let M=0;M<E.length;M++){let N=E[M];A.push(o("polygon",{key:N.key,points:N.points,fill:N.fill,stroke:N.stroke,"stroke-width":N.strokeWidth,"stroke-linejoin":"round"}))}return A},[t,f,b,m,x]),R=v(()=>{let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let E=0;E<=f.maxRows;E++){let M=E-w,N=x(-k,M,0),$=x(k,M,0);A.push(o("line",{key:`base-h-${E}`,x1:String(N.sx),y1:String(N.sy),x2:String($.sx),y2:String($.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let E=0;E<=f.maxCols;E++){let M=E-k,N=x(M,-w,0),$=x(M,w,0);A.push(o("line",{key:`base-v-${E}`,x1:String(N.sx),y1:String(N.sy),x2:String($.sx),y2:String($.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return A},[f,c,x]),C=v(()=>{if(!d)return[];let A=[],k=f.maxCols/2,w=f.maxRows/2;for(let E=0;E<t.length;E++){let M=t[E],N=E*b,$=0,B=0;for(let J=0;J<M.data.length;J++){let ne=M.data[J];for(let te=0;te<ne.length;te++)$+=ne[te]??0,B++}let H=B>0?$/B:0,V=x(k+1,0,H+N),U=M.color??m[E%m.length];A.push(o("text",{key:`layer-label-${E}`,x:String(V.sx+8),y:String(V.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:U},M.label))}return A},[d,t,f,b,m,x]),F=v(()=>g?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n])(),T=R(),P=S(),L=z(),D=C(),W=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...F,...W,...T,...P,...L,...D)}function Dc(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function zc(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Mi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:b="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:g="#ffffff"}=e,f=X(()=>Dc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),h=l!=null&&l.length>1,p=n!=null&&n.length>0,x=y&&s>=0?m:c,S=20,z=p?u*.38:u*.45,R=Math.min(d*.15,48),C=R*.55,I=z+R*.4+8,F=p?I+22:z+R*.4+22,T=h?Math.min(u*.22,36):0,P=u-S-T,L=d-S*2,D=v(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:g,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,g]),W=v(()=>{let V=[],U=r+f+i;return V.push(o("text",{key:"value",x:String(d/2),y:String(z),"text-anchor":"middle","dominant-baseline":"central","font-size":String(R),"font-weight":"bold","font-family":"sans-serif",fill:b,"aria-label":`Value: ${U}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,f,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),V},[d,z,R,C,f,r,i,b]),A=v(()=>p?[o("text",{key:"label",x:String(d/2),y:String(I),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[p,d,I,n]),k=v(()=>{if(!y)return[];let V=[],U=s,J=U>=0,ne=8,te=zc(U),G=(J?"+":"-")+te+(a?" "+a:""),_=d/2-40,O=F;if(J){let Y=`${_},${O} ${_-ne/2},${O+ne} ${_+ne/2},${O+ne}`;V.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${_},${O+ne} ${_-ne/2},${O} ${_+ne/2},${O}`;V.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return V.push(o("text",{key:"trend-text",x:String(_+ne+4),y:String(O+ne*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${G}`},G)),V},[y,s,a,x,d,F]),w=v(()=>{if(!h)return[];let V=[],U=l,J=[];for(let Q of U)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&J.push(Q);if(J.length<2)return[];let ne=1/0,te=-1/0;for(let Q of J)Q<ne&&(ne=Q),Q>te&&(te=Q);ne===te&&(ne-=1,te+=1);let G=te-ne,_=L/(J.length-1),O="";for(let Q=0;Q<J.length;Q++){let re=S+Q*_,ee=P+T-(J[Q]-ne)/G*T;Q===0?O+=`M ${re} ${ee}`:O+=` L ${re} ${ee}`}let Y=S+(J.length-1)*_,q=O+` L ${Y} ${P+T} L ${S} ${P+T} Z`;return V.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),V.push(o("path",{key:"spark-fill",d:q,fill:"url(#sparkGrad)"})),V.push(o("path",{key:"spark-line",d:O,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),V},[h,l,L,P,T,S]),E=D(),M=W(),N=A(),$=k(),B=w(),H=`${r}${f}${i}${p?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":H,style:{fontFamily:"sans-serif"}},...E,...B,...M,...N,...$)}var Tt=Math.PI/180;function Tc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Tt),u=Math.sin(r*Tt),b=Math.cos(i*Tt),m=Math.sin(i*Tt),c=e*b+n*m,g=-e*m+n*b,f=t*d-g*u,y=t*u+g*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function nt(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function At(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function We(e,t,n){let{x:r,y:i,z:s}=nt(e),a=Math.cos(n),l=Math.sin(n),d,u,b;return t==="x"?(d=r,u=i*a-s*l,b=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,b=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,b=s),At(d,u,b)}function $n(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return We(e,"x",Math.PI);case"Y":return We(e,"y",Math.PI);case"Z":return We(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=nt(e);return At(s,-i,r)}case"S":return We(e,"z",Math.PI/2);case"T":return We(e,"z",Math.PI/4);case"Rx":return We(e,"x",n);case"Ry":return We(e,"y",n);case"Rz":return We(e,"z",n)}}function Ei(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:b=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:g=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:h="#cbd5e1",vectorColor:p="#3b82f6",backgroundColor:x,sphereRadius:S=130,title:z,onStateChange:R}=e,[C,I]=j(t??{theta:0,phi:0}),[F,T]=j(s),[P,L]=j(a),[D,W]=j(l),A=oe([]),k=oe(!1),w=oe(null),E=oe(null);ie(()=>{t&&I(t)},[t?.theta,t?.phi]);let M=oe(0);ie(()=>{if(!n||n.length===0)return;M.current=0;let _=0,O=()=>{M.current>=n.length||(I(Y=>{let q=$n(Y,n[M.current]);return M.current++,R&&R(q),q}),_=requestAnimationFrame(O))};return _=requestAnimationFrame(O),()=>cancelAnimationFrame(_)},[n]),ie(()=>{let _=nt(C);A.current.push(_),A.current.length>f&&A.current.splice(0,A.current.length-f)},[C.theta,C.phi]);let N=S*D,$=r/2,B=i/2,H=v((_,O,Y)=>Tc(_,O,Y,P,F,$,B,N),[P,F,$,B,N]),V=v(_=>{if(!d)return;let O=_;k.current=!0,w.current={mx:O.clientX,my:O.clientY,rx:P,ry:F}},[d,P,F]),U=v(_=>{if(!k.current||!w.current)return;let O=_,Y=w.current;T(Y.ry+(O.clientX-Y.mx)*.5),L(Y.rx-(O.clientY-Y.my)*.5)},[]),J=v(()=>{k.current=!1},[]),ne=v(_=>{if(!u)return;let O=_;O.preventDefault(),W(Y=>Math.max(.5,Math.min(3,Y*(O.deltaY>0?.95:1.05))))},[u]),te=[];if(x&&te.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),z&&te.push(o("text",{key:"title",x:String($),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},z)),c){let O=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(Math.cos(re),Math.sin(re),0);O.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"eq",d:O.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(Math.cos(re),0,Math.sin(re));Y.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}));let q=[];for(let Q=0;Q<=60;Q++){let re=Q/60*2*Math.PI,ee=H(0,Math.cos(re),Math.sin(re));q.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}te.push(o("path",{key:"yz",d:q.join(" "),fill:"none",stroke:h,"stroke-width":"0.8",opacity:"0.4"}))}let G=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let _ of G){let O=H(_.dir[0]*1.15,_.dir[1]*1.15,_.dir[2]*1.15),Y=H(-_.dir[0]*1.15,-_.dir[1]*1.15,-_.dir[2]*1.15),q=H(0,0,0);te.push(o("line",{key:`axis-${_.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(O.sx),y2:String(O.sy),stroke:_.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){let _=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let O of _){let Y=H(O.pos[0],O.pos[1],O.pos[2]);te.push(o("text",{key:`lbl-${O.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},O.text))}}if(g&&A.current.length>1){let _=A.current,O=[];for(let Y=0;Y<_.length;Y++){let q=_[Y],Q=H(q.x,q.y,q.z);O.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}te.push(o("path",{key:"trail",d:O.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(b){let _=nt(C),O=H(0,0,0),Y=H(_.x,_.y,_.z);te.push(o("line",{key:"vec-line",x1:String(O.sx),y1:String(O.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:p,"stroke-width":"2.5","stroke-linecap":"round"})),te.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:p,stroke:"#fff","stroke-width":"1.5"}));let q=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);te.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${q}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:E,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":z??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?V:void 0,onMouseMove:d?U:void 0,onMouseUp:d?J:void 0,onMouseLeave:d?J:void 0,onWheel:u?ne:void 0},...te)}function Ac(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function In(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function Dn(e){let t=Ac(e);if(t.length===0)return null;let n=In(t,25),r=In(t,50),i=In(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let g of t)if(g>=a){d=g;break}let u=t[t.length-1];for(let g=t.length-1;g>=0;g--)if(t[g]<=l){u=t[g];break}let b=0;for(let g of t)b+=g;let m=b/t.length,c=[];for(let g of t)(g<a||g>l)&&c.push(g);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:m,outliers:c,min:t[0],max:t[t.length-1]}}function Lc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Pi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:b,padding:m=60}=e,c=i==="vertical",g=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],h=X(()=>{let w=[];for(let E of t)w.push(Dn(E.values));return w},[t]),p=X(()=>{let w=1/0,E=-1/0;for(let $ of h){if($===null)continue;let B=s&&$.outliers.length>0?Math.min($.whiskerLow,$.outliers[0]):$.whiskerLow,H=s&&$.outliers.length>0?Math.max($.whiskerHigh,$.outliers[$.outliers.length-1]):$.whiskerHigh;B<w&&(w=B),H>E&&(E=H)}isFinite(w)||(w=0,E=1);let M=E-w,N=M>0?M*.05:.5;return{min:w-N,max:E+N}},[h,s]),x=c?f:g,S=c?g:f,z=t.length>0?t.length:1,R=S/z,C=R*Math.min(Math.max(d,.1),.95),I=v(w=>{let E=p.max-p.min;return E===0?x/2:(w-p.min)/E*x},[p,x]),F=v(()=>{if(!u)return[];let w=[],E=p.max-p.min,M=Lc(E),N=Math.ceil(p.min/M)*M;for(let $=N;$<=p.max;$+=M){let B=I($),H=String(Math.round($*1e3)/1e3);if(c){let V=m+f-B;w.push(o("line",{key:`grid-${$}`,x1:String(m),y1:String(V),x2:String(m+g),y2:String(V),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${$}`,x:String(m-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}else{let V=m+B;w.push(o("line",{key:`grid-${$}`,x1:String(V),y1:String(m),x2:String(V),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${$}`,x:String(V),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},H))}}return w},[u,p,I,c,m,g,f]),T=v(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(m),y1:String(c?m:m+f),x2:String(m),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(m),y1:String(m+f),x2:String(m+g),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,g,f,c]),P=v(()=>{let w=[];for(let E=0;E<t.length;E++){let M=h[E];if(M===null)continue;let N=t[E],$=N.color??y[E%y.length],B=R*E+R/2,H=C/2;if(c){let V=m+f-I(M.q1),U=m+f-I(M.q3),J=m+f-I(M.median),ne=m+f-I(M.whiskerLow),te=m+f-I(M.whiskerHigh),G=m+B;w.push(o("line",{key:`wl-${E}`,x1:String(G),y1:String(V),x2:String(G),y2:String(ne),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${E}`,x1:String(G-H*.4),y1:String(ne),x2:String(G+H*.4),y2:String(ne),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${E}`,x1:String(G),y1:String(U),x2:String(G),y2:String(te),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${E}`,x1:String(G-H*.4),y1:String(te),x2:String(G+H*.4),y2:String(te),stroke:l,"stroke-width":"1.5"}));let _=Math.min(V,U),O=Math.abs(V-U);if(w.push(o("rect",{key:`box-${E}`,x:String(G-H),y:String(_),width:String(C),height:String(Math.max(O,1)),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${E}`,x1:String(G-H),y1:String(J),x2:String(G+H),y2:String(J),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+f-I(M.mean);w.push(o("circle",{key:`mean-${E}`,cx:String(G),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<M.outliers.length;Y++){let q=m+f-I(M.outliers[Y]);w.push(o("circle",{key:`out-${E}-${Y}`,cx:String(G),cy:String(q),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${E}`,x:String(G),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}else{let V=m+I(M.q1),U=m+I(M.q3),J=m+I(M.median),ne=m+I(M.whiskerLow),te=m+I(M.whiskerHigh),G=m+B;w.push(o("line",{key:`wl-${E}`,x1:String(V),y1:String(G),x2:String(ne),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${E}`,x1:String(ne),y1:String(G-H*.4),x2:String(ne),y2:String(G+H*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${E}`,x1:String(U),y1:String(G),x2:String(te),y2:String(G),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${E}`,x1:String(te),y1:String(G-H*.4),x2:String(te),y2:String(G+H*.4),stroke:l,"stroke-width":"1.5"}));let _=Math.min(V,U),O=Math.abs(U-V);if(w.push(o("rect",{key:`box-${E}`,x:String(_),y:String(G-H),width:String(Math.max(O,1)),height:String(C),fill:$,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${N.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${E}`,x1:String(J),y1:String(G-H),x2:String(J),y2:String(G+H),stroke:"#fff","stroke-width":"2.5"})),a){let Y=m+I(M.mean);w.push(o("circle",{key:`mean-${E}`,cx:String(Y),cy:String(G),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<M.outliers.length;Y++){let q=m+I(M.outliers[Y]);w.push(o("circle",{key:`out-${E}-${Y}`,cx:String(q),cy:String(G),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[Y]}`}))}w.push(o("text",{key:`cat-${E}`,x:String(m-6),y:String(G+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},N.label))}}return w},[t,h,I,c,m,g,f,R,C,l,s,a,y]),L=v(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n,m]),D=F(),W=T(),A=P(),k=L();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Box plot",style:{fontFamily:"sans-serif"}},...k,...D,...W,...A)}function Ri(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Fc(e,t,n){return e<t?t:e>n?n:e}function zn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function $i(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:b=4,defaultColor:m="#3b82f6",opacity:c=.7,title:g,padding:f=60}=e,y=X(()=>{let A=[];for(let k=0;k<t.length;k++){let w=t[k];zn(w.x)&&zn(w.y)&&zn(w.r)&&A.push(w)}return A},[t]),h=n-f*2,p=r-f*2,x=X(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let A=1/0,k=-1/0,w=1/0,E=-1/0,M=1/0,N=-1/0;for(let $ of y)$.x<A&&(A=$.x),$.x>k&&(k=$.x),$.y<w&&(w=$.y),$.y>E&&(E=$.y),$.r<M&&(M=$.r),$.r>N&&(N=$.r);return A===k&&(A-=1,k+=1),w===E&&(w-=1,E+=1),M===N&&(M=0,N=N>0?N:1),{xMin:A,xMax:k,yMin:w,yMax:E,rMin:M,rMax:N}},[y]),S=v(A=>{let k=x.xMax-x.xMin;return f+(A-x.xMin)/k*h},[x,f,h]),z=v(A=>{let k=x.yMax-x.yMin;return f+p-(A-x.yMin)/k*p},[x,f,p]),R=v(A=>{let k=x.rMax-x.rMin;if(k===0)return(b+u)/2;let w=(A-x.rMin)/k;return b+w*(u-b)},[x,b,u]),C=v(()=>{if(!a)return[];let A=[],k=Ri(x.xMax-x.xMin),w=Math.ceil(x.xMin/k)*k;for(let N=w;N<=x.xMax;N+=k){let $=S(N);A.push(o("line",{key:`grid-x-${N}`,x1:String($),y1:String(f),x2:String($),y2:String(f+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-xlabel-${N}`,x:String($),y:String(f+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}let E=Ri(x.yMax-x.yMin),M=Math.ceil(x.yMin/E)*E;for(let N=M;N<=x.yMax;N+=E){let $=z(N);A.push(o("line",{key:`grid-y-${N}`,x1:String(f),y1:String($),x2:String(f+h),y2:String($),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),A.push(o("text",{key:`grid-ylabel-${N}`,x:String(f-6),y:String($+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(N*1e3)/1e3)))}return A},[a,x,S,z,f,h,p]),I=v(()=>{if(!l)return[];let A=[];return A.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+p),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+p),x2:String(f+h),y2:String(f+p),stroke:"#374151","stroke-width":"1.5"})),i&&A.push(o("text",{key:"x-label",x:String(f+h/2),y:String(f+p+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&A.push(o("text",{key:"y-label",x:String(f-40),y:String(f+p/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+p/2})`},s)),A},[l,f,h,p,i,s]),F=v(()=>{let A=[];for(let k=0;k<y.length;k++){let w=y[k],E=S(w.x),M=z(w.y),N=Fc(R(w.r),b,u),$=w.color??m;A.push(o("circle",{key:`bubble-${k}`,cx:String(E),cy:String(M),r:String(N),fill:$,opacity:String(c),stroke:$,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&A.push(o("text",{key:`label-${k}`,x:String(E),y:String(M-N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return A},[y,S,z,R,m,c,d,b,u]),T=v(()=>g?[o("text",{key:"title",x:String(n/2),y:String(f/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,f]),P=C(),L=I(),D=F(),W=T();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Bubble chart",style:{fontFamily:"sans-serif"}},...W,...P,...L,...D)}var Nc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Bc(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Ii(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Di(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Oc(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Hc(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Di(t[i]),l=Di(t[i+1]);return Oc(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var _c=["#9be9a8","#40c463","#30a14e","#216e39"];function zi(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=_c,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:b}=e,{dateMap:m,startDate:c,endDate:g,maxVal:f}=X(()=>{let D=new Map,W=0,A=null,k=null;for(let M of t){let N=Bc(M.date);if(isNaN(N.getTime()))continue;let $=Ii(N);D.set($,(D.get($)??0)+M.value);let B=D.get($);B>W&&(W=B),(A===null||N<A)&&(A=N),(k===null||N>k)&&(k=N)}if(A===null||k===null){let M=new Date;A=new Date(M.getFullYear(),0,1),k=new Date(M.getFullYear(),11,31)}let w=new Date(A);w.setDate(w.getDate()-w.getDay());let E=new Date(k);return E.setDate(E.getDate()+(6-E.getDay())),{dateMap:D,startDate:w,endDate:E,maxVal:W>0?W:1}},[t]),y=d?30:0,h=l?16:0,p=b?28:0,x=y+10,S=p+h+4,z=v(()=>{let D=[],W=new Date(c),A=0;for(;W<=g;){let k=W.getDay();k===0&&W>c&&A++;let w=Ii(W),E=m.get(w),M=E!==void 0&&E>0?Hc(E/f,i):u,N=x+A*(s+a),$=S+k*(s+a);D.push(o("rect",{key:`day-${w}`,x:String(N),y:String($),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${E??0}`})),W.setDate(W.getDate()+1)}return D},[c,g,m,f,i,u,s,a,x,S]),R=v(()=>{if(!l)return[];let D=[],W=new Date(c),A=0,k=-1;for(;W<=g;){let w=W.getDay();w===0&&W>c&&A++;let E=W.getMonth();if(E!==k&&w===0){k=E;let M=x+A*(s+a);D.push(o("text",{key:`month-${A}`,x:String(M),y:String(p+h-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Nc[E]))}W.setDate(W.getDate()+1)}return D},[l,c,g,s,a,x,p,h]),C=v(()=>{if(!d)return[];let D=[],W=[1,3,5];for(let A of W){let k=S+A*(s+a)+s/2;D.push(o("text",{key:`day-label-${A}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Wc[A]))}return D},[d,s,a,S,y]),I=v(()=>b?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let F=I(),T=R(),P=C(),L=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Calendar heat map",style:{fontFamily:"sans-serif"}},...F,...T,...P,...L)}var Yc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Te(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Vc(e,t,n,r,i,s){let a=Te(e,t,n,i),l=Te(e,t,n,s),d=Te(e,t,r,i),u=Te(e,t,r,s),m=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${m} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${m} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function Gc(e,t,n,r,i,s,a){let l=Te(e,t,n,r),d=Te(e,t,n,i),u=Te(e,t,n,s),b=Te(e,t,n,a),m=i-r,c=a-s,g=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${g} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${b.x} ${b.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function Uc(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let g=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;g+=Math.max(0,y)}s.push(g),a+=g}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),g=[],f=0;for(let y=0;y<i;y++)g.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:f,endAngle:f+c,value:0}),f+=c+r;return{groups:g,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let g=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+g,value:s[c]}),u+=g+r}let b=[];for(let c=0;c<i;c++)b.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let g=c;g<i;g++){let f=Math.max(0,e[c]?.[g]??0),y=c===g?0:Math.max(0,e[g]?.[c]??0);if(f===0&&y===0)continue;let h=f+y,p=s[c]>0?f/a*l:0,x=b[c],S=x+p;b[c]=S;let z=s[g]>0?f/a*l:0,R=b[g],C=R+z;if(b[g]=C,c===g){f>0&&m.push({sourceIndex:c,targetIndex:g,sourceStartAngle:x,sourceEndAngle:S,targetStartAngle:R,targetEndAngle:C,value:f,color:d[c].color});continue}let I=s[g]>0?y/a*l:0,T=b[g]+I;b[g]=T;let P=s[c]>0?y/a*l:0,D=b[c]+P;b[c]=D,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:g,sourceStartAngle:x,sourceEndAngle:Math.max(S,x+.001),targetStartAngle:R,targetEndAngle:Math.max(C,R+.001),value:h,color:d[c].color})}return{groups:d,chords:m}}function Ti(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Yc,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:b=.9,title:m}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,g=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,b)),h=f+16,p=X(()=>Uc(t,n,s,a),[t,n,s,a]),x=v(()=>{let F=[];for(let T=0;T<p.groups.length;T++){let P=p.groups[T];if(P.endAngle-P.startAngle<.001)continue;let D=Vc(c,g,f,y,P.startAngle,P.endAngle);if(F.push(o("path",{key:`arc-${T}`,d:D,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let W=(P.startAngle+P.endAngle)/2,A=Te(c,g,h,W),E=((W-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=E?"start":"end",N=W*180/Math.PI-90;E||(N+=180);let $=d?`${P.label} (${P.value})`:P.label;F.push(o("text",{key:`label-${T}`,x:String(A.x),y:String(A.y),"text-anchor":M,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${N}, ${A.x}, ${A.y})`,"dominant-baseline":"central","pointer-events":"none"},$))}}return F},[p,c,g,f,y,h,l,d]),S=v(()=>{let F=[];for(let T=0;T<p.chords.length;T++){let P=p.chords[T],L=Gc(c,g,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);F.push(o("path",{key:`ribbon-${T}`,d:L,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return F},[p,c,g,y,u]),z=v(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r]),R=S(),C=x(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Chord diagram",style:{fontFamily:"sans-serif"}},...I,...R,...C)}var jc=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Xc(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],b=[];for(let m=0;m<u.length;m++)b.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:b});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function qc(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function Kc(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=Xc(e);if(d.length===0)return[];let b=qc(d),m=t-s*2,c=n-s*2,g=a==="horizontal",f=u+1,y=g?f>1?(m-r)/u:0:f>1?(c-i)/u:0,h=new Array(d.length),p=b[0],x=g?c:m,S=p>0?x/p:x,z=new Array(d.length);z[0]=[0,p];let R=[0],C=0;for(;C<R.length;){let I=R[C];C++;let F=d[I],[T,P]=z[I],L=(T+P)/2,D=s+F.depth*y,W=s+(L-.5)*S,A=g?D:W,k=g?W:D,w=F.node.color??l[F.depth%l.length];h[I]={id:F.id,label:F.node.label,value:F.node.value!==void 0?String(F.node.value):"",color:w,depth:F.depth,x:A,y:k,parentId:F.parentId,childCount:F.childIndices.length,subtreeLeafCount:b[I]};let E=T;for(let M of F.childIndices)if(M<d.length){let N=b[M],$=E+N;z[M]=[E,$],E=$,R.push(M)}}return h}function Ai(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:b=jc,title:m,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let g=i==="horizontal",f=X(()=>Kc(t,n,r,s,a,c,i,b),[t,n,r,s,a,c,i,b]),y=X(()=>{let C=new Map;for(let I=0;I<f.length;I++){let F=f[I];C.set(F.id,F)}return C},[f]),h=v(()=>{if(!d)return[];let C=[];for(let I=0;I<f.length;I++){let F=f[I];if(F.parentId===null)continue;let T=y.get(F.parentId);if(!T)continue;let P,L,D,W;g?(P=T.x+s,L=T.y+a/2,D=F.x,W=F.y+a/2):(P=T.x+s/2,L=T.y+a,D=F.x+s/2,W=F.y);let A=(P+D)/2,k=(L+W)/2,w;g?w=`M ${P} ${L} C ${A} ${L}, ${A} ${W}, ${D} ${W}`:w=`M ${P} ${L} C ${P} ${k}, ${D} ${k}, ${D} ${W}`,C.push(o("path",{key:`conn-${I}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,g,s,a,d,u]),p=v(()=>{let C=[];for(let I=0;I<f.length;I++){let F=f[I];C.push(o("rect",{key:`node-rect-${F.id}`,x:String(F.x),y:String(F.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:F.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":F.value?`${F.label}: ${F.value}`:F.label}));let T=l&&F.value?F.y+a/2-2:F.y+a/2+4;C.push(o("text",{key:`node-label-${F.id}`,x:String(F.x+s/2),y:String(T),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},F.label)),l&&F.value&&C.push(o("text",{key:`node-value-${F.id}`,x:String(F.x+s/2),y:String(F.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},F.value))}return C},[f,s,a,l]),x=v(()=>m?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n]),S=h(),z=p(),R=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...R,...S,...z)}var Li=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zc(e){return Li[e%Li.length]}function Fi(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],b=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??Zc(d),x:u.x??r+s*Math.cos(b),y:u.y??i+s*Math.sin(b),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Ni(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let b=Math.sqrt(u),m=l/b,c=d/b,g=n-b;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*g,a.y+=c*g):a.fixed?(i.x-=m*g,i.y-=c*g):(i.x-=m*g*.5,i.y-=c*g*.5,a.x+=m*g*.5,a.y+=c*g*.5);let f=i.vx-a.vx,y=i.vy-a.vy,h=f*m+y*c;h<=0||(i.fixed?(a.vx+=h*m,a.vy+=h*c):a.fixed?(i.vx-=h*m,i.vy-=h*c):(i.vx-=h*m,i.vy-=h*c,a.vx+=h*m,a.vy+=h*c))}}}function Jc(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let b=new Map;for(let x=0;x<u;x++)b.set(e[x].id,x);let m=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let S=e[x];for(let z=x+1;z<u;z++){let R=e[z],C=S.x-R.x,I=S.y-R.y,F=C*C+I*I;F<1&&(F=1);let T=Math.sqrt(F),P=i/F,L=C/T*P,D=I/T*P;m[x]+=L,c[x]+=D,m[z]-=L,c[z]-=D}}for(let x=0;x<t.length;x++){let S=t[x],z=b.get(S.source),R=b.get(S.target);if(z===void 0||R===void 0)continue;let C=e[z],I=e[R],F=I.x-C.x,T=I.y-C.y,P=Math.sqrt(F*F+T*T);if(P<.1)continue;let L=S.weight??1,D=P-l,W=s*D*L,A=F/P*W,k=T/P*W;m[z]+=A,c[z]+=k,m[R]-=A,c[R]-=k}let g=n/2,f=r/2,y=.001;for(let x=0;x<u;x++){let S=e[x];m[x]+=(g-S.x)*y,c[x]+=(f-S.y)*y}let h=20,p=[];for(let x=0;x<u;x++){let S=e[x];if(S.fixed){p.push({...S,vx:0,vy:0});continue}let z=(S.vx+m[x])*a,R=(S.vy+c[x])*a,C=Math.sqrt(z*z+R*R),I=10;C>I&&(z=z/C*I,R=R/C*I);let F=S.x+z,T=S.y+R;F=Math.max(h,Math.min(n-h,F)),T=Math.max(h,Math.min(r-h,T)),p.push({...S,x:F,y:T,vx:z,vy:R})}return Ni(p,d),p}function Qc(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Wi(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:b=300,attractionForce:m=.01,damping:c=.9,edgeLength:g=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:h,customForce:p,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty force-directed graph"},h?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let S=oe(Fi(t,r,i)),[z,R]=j(0),C=oe(!0),I=oe(!1),F=oe(n);F.current=n;let T=oe(p);T.current=p;let P=oe(null),L=oe({repulsionForce:b,attractionForce:m,damping:c,edgeLength:g,width:r,height:i,nodeRadius:s,solidNodes:l});L.current={repulsionForce:b,attractionForce:m,damping:c,edgeLength:g,width:r,height:i,nodeRadius:s,solidNodes:l};let D=oe(new Map);ie(()=>{S.current=Fi(t,r,i),I.current=!1,C.current=!0,D.current=new Map,R(re=>re+1)},[t.length]),ie(()=>{let re=0,ee=()=>{if(!C.current)return;let se=L.current,ae=T.current,K;if(ae?(K=ae(S.current,F.current,se.width,se.height,P.current),se.solidNodes&&Ni(K,se.nodeRadius)):K=Jc(S.current,F.current,se.width,se.height,se.repulsionForce,se.attractionForce,se.damping,se.edgeLength,se.nodeRadius),S.current=K,x)for(let Z=0;Z<x.length;Z++){let le=x[Z],de=K.find(fe=>fe.id===le.nodeId);if(!de)continue;let ce=D.current.get(le.nodeId);ce||(ce=[],D.current.set(le.nodeId,ce)),ce.push({x:de.x,y:de.y});let ue=le.maxPoints??200;ce.length>ue&&ce.splice(0,ce.length-ue)}if(!ae&&Qc(K)<.01){I.current=!0,R(Z=>Z+1);return}R(Z=>Z+1),re=requestAnimationFrame(ee)};return re=requestAnimationFrame(ee),()=>{C.current=!1,cancelAnimationFrame(re)}},[]);let W=S.current,A=v(re=>{S.current=S.current.map(ee=>ee.id===re?{...ee,fixed:!ee.fixed,vx:0,vy:0}:ee),I.current&&(I.current=!1,C.current=!0,R(ee=>ee+1))},[]),k=oe(null),w=oe(null),E=v(re=>{let ee=re,se=w.current;if(!se)return{x:ee.clientX,y:ee.clientY};let ae=se.getBoundingClientRect(),K=r/ae.width,Z=i/ae.height;return{x:(ee.clientX-ae.left)*K,y:(ee.clientY-ae.top)*Z}},[r,i]),M=oe(!1),N=v((re,ee)=>{ee.stopPropagation(),k.current=re;let se=S.current.find(ae=>ae.id===re);M.current=se?.fixed??!1,S.current=S.current.map(ae=>ae.id===re?{...ae,fixed:!0,vx:0,vy:0}:ae)},[]),$=v(re=>{let ee=E(re);if(P.current={x:ee.x,y:ee.y},!k.current)return;let se=k.current,ae=20;S.current=S.current.map(K=>K.id===se?{...K,x:Math.max(ae,Math.min(r-ae,ee.x)),y:Math.max(ae,Math.min(i-ae,ee.y))}:K),I.current&&(I.current=!1,C.current=!0),R(K=>K+1)},[r,i,E]),B=v(()=>{let re=k.current;re&&(S.current=S.current.map(ee=>ee.id===re?{...ee,fixed:M.current}:ee)),k.current=null},[]),H=v(()=>{k.current=null,P.current=null},[]),V=X(()=>{let re=new Map;for(let ee=0;ee<W.length;ee++)re.set(W[ee].id,W[ee]);return re},[z]),U=v(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:f})))]:[],[u,s,f]),J=v(()=>{let re=[];for(let ee=0;ee<n.length;ee++){let se=n[ee],ae=V.get(se.source),K=V.get(se.target);if(!ae||!K||se.weight!==void 0&&se.weight<=0)continue;let Z=se.weight?Math.max(.5,Math.min(6,y*se.weight)):y,le={key:`edge-${ee}`,x1:String(ae.x),y1:String(ae.y),x2:String(K.x),y2:String(K.y),stroke:se.color??f,"stroke-width":String(Z),"stroke-opacity":"0.6"};u&&(le["marker-end"]="url(#arrowhead)"),re.push(o("line",le))}return re},[z,f,y,u]),ne=v(()=>{let re=[];for(let ee=0;ee<W.length;ee++){let se=W[ee];re.push(o("circle",{key:`node-${se.id}`,cx:String(se.x),cy:String(se.y),r:String(s),fill:se.color,stroke:se.fixed?"#0f172a":"#fff","stroke-width":se.fixed?"3":String(a),style:{cursor:k.current===se.id?"grabbing":"grab"},onMouseDown:ae=>N(se.id,ae),onDblClick:()=>A(se.id),role:"button",tabIndex:0,"aria-label":`Node: ${se.label}${se.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&re.push(o("text",{key:`label-${se.id}`,x:String(se.x),y:String(se.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},se.label))}return re},[z,s,d,A]),te=v(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),G=v(()=>{if(!x||x.length===0)return[];let re=[];for(let ee=0;ee<x.length;ee++){let se=x[ee],ae=D.current.get(se.nodeId);if(!ae||ae.length<2)continue;let K=[];for(let Z=0;Z<ae.length;Z++){let le=ae[Z];K.push(`${Z===0?"M":"L"}${le.x.toFixed(1)},${le.y.toFixed(1)}`)}re.push(o("path",{key:`trail-${se.nodeId}`,d:K.join(" "),fill:"none",stroke:se.color??"#3b82f6","stroke-width":String(se.width??1),opacity:String(se.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return re},[z,x]),_=U(),O=G(),Y=J(),q=ne(),Q=te();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:$,onMouseUp:B,onMouseLeave:H},..._,...Q,...O,...Y,...q)}var Bi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Oi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=Bi,title:b}=e,m=i==="vertical",c=b?30:0,g=120,f=X(()=>{let F=0;for(let T=0;T<t.length;T++)t[T].value>F&&(F=t[T].value);return F>0?F:1},[t]),y=v(F=>f===0?0:Math.max(.05,F/f),[f]),h=v((F,T)=>T||(u[F%u.length]??Bi[0]),[u]),p=v(()=>{if(t.length===0)return[];let F=[],T=40,P=n-T*2-g,L=r-c-T*2,D=d*(t.length-1),W=Math.max(1,(L-D)/t.length),A=T+P/2;for(let k=0;k<t.length;k++){let w=t[k],E=k<t.length-1?t[k+1]:null,M=h(k,w.color),N=y(w.value),$=E!==null?y(E.value):N*.6,B=P/2*N,H=P/2*$,V=c+T+k*(W+d),U=A-B,J=A+B,ne=A+H,te=A-H,G=`${U},${V} ${J},${V} ${ne},${V+W} ${te},${V+W}`;F.push(o("polygon",{key:`section-${k}`,points:G,fill:M,stroke:"#fff","stroke-width":"1"}));let _=T+P+12,O=V+W/2;if(s&&F.push(o("text",{key:`label-${k}`,x:String(_),y:String(O-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let Y="";if(a&&(Y=String(w.value)),l&&t.length>0){let q=t[0].value,Q=q>0?Math.round(w.value/q*100):0;Y+=a?` (${Q}%)`:`${Q}%`}F.push(o("text",{key:`value-${k}`,x:String(_),y:String(O+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return F},[t,n,r,c,d,s,a,l,h,y,g]),x=v(()=>{if(t.length===0)return[];let F=[],T=40,P=n-T*2,D=r-c-T*2-40,W=d*(t.length-1),A=Math.max(1,(P-W)/t.length),k=c+T+D/2;for(let w=0;w<t.length;w++){let E=t[w],M=w<t.length-1?t[w+1]:null,N=h(w,E.color),$=y(E.value),B=M!==null?y(M.value):$*.6,H=D/2*$,V=D/2*B,U=T+w*(A+d),J=k-H,ne=k-V,te=k+V,G=k+H,_=`${U},${J} ${U+A},${ne} ${U+A},${te} ${U},${G}`;F.push(o("polygon",{key:`section-${w}`,points:_,fill:N,stroke:"#fff","stroke-width":"1"}));let O=U+A/2,Y=c+T+D+14;if(s&&F.push(o("text",{key:`label-${w}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},E.label)),a||l){let q="";if(a&&(q=String(E.value)),l&&t.length>0){let Q=t[0].value,re=Q>0?Math.round(E.value/Q*100):0;q+=a?` (${re}%)`:`${re}%`}F.push(o("text",{key:`value-${w}`,x:String(O),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},q))}}return F},[t,n,r,c,d,s,a,l,h,y]),S=v(()=>b?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,n]),z=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),R=S(),C=m?p():x(),I=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Funnel chart",style:{fontFamily:"sans-serif"}},...R,...C,...I)}var Hi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function _i(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ed(e,t){return t||Hi[e%Hi.length]}function Yi(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:b,padding:m=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,g=X(()=>{let L=1/0,D=-1/0;for(let W of t){W.start<L&&(L=W.start);let A=W.start+W.duration;A>D&&(D=A)}return L===1/0&&(L=0,D=1),{min:L,max:D,range:D-L}},[t]),f=X(()=>{let L=t.slice();return L.sort((D,W)=>D.group!==W.group?(D.group??"").localeCompare(W.group??""):D.start-W.start),L},[t]),y=r??m*2+f.length*(i+s)+s+20,h=n-m-c-m,p=m+(b?20:0),x=v(L=>g.range===0?c+m:c+m+(L-g.min)/g.range*h,[g,h,c,m]),S=v(()=>{if(!a)return[];let L=[],D=_i(g.range),W=Math.ceil(g.min/D)*D,A=p+f.length*(i+s)+s;for(let k=W;k<=g.max;k+=D){let w=x(k);L.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(p),x2:String(w),y2:String(A),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return L},[a,g,p,f.length,i,s,x]),z=v(()=>{let L=[],D=_i(g.range),W=Math.ceil(g.min/D)*D,A=p-8;for(let k=W;k<=g.max;k+=D){let w=x(k);L.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(A),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return L.push(o("text",{key:"time-unit",x:String(n-m),y:String(A),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),L},[g,p,x,u,n,m]),R=v(()=>{let L=[],D="";for(let W=0;W<f.length;W++){let A=f[W],k=p+W*(i+s)+s,w=x(A.start),E=Math.max(2,x(A.start+A.duration)-w),M=ed(W,A.color);A.group&&A.group!==D&&(D=A.group,l&&L.push(o("text",{key:`group-${W}`,x:String(m),y:String(k+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},A.group))),L.push(o("rect",{key:`bar-${A.id}`,x:String(w),y:String(k),width:String(E),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${A.label}: start ${A.start}, duration ${A.duration}`})),l&&L.push(o("text",{key:`label-${A.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},A.label.length>16?A.label.substring(0,14)+"..":A.label)),d&&E>30&&L.push(o("text",{key:`prog-${A.id}`,x:String(w+E/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${A.start}-${A.start+A.duration}`))}return L},[f,p,i,s,x,l,d,c,m]),C=v(()=>b?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},b)]:[],[b,n,m]),I=S(),F=z(),T=R(),P=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...I,...F,...T)}var td=Math.PI/180;function nd(e){return e*td}function De(e,t,n,r){let i=nd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Vi(e,t,n,r,i){let s=De(e,t,n,i),a=De(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function od(e,t,n){return e<t?t:e>n?n:e}function _e(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function Gi(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:b=!0,showTicks:m=!0,tickCount:c=10,label:g,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:h="#374151",backgroundColor:p="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,z=isFinite(t)&&!isNaN(t)?od(t,x,S):x,R=(u?24:0)+(g?18:0),C=i/2,I=(s-R)*.6,F=Math.min(i/2,(s-R)*.55)-d/2-10,T=F-d,P=F-d/2,L=l-a,D=v(G=>{let _=S-x;if(_===0)return a;let O=(G-x)/_;return a+O*L},[x,S,a,L]),W=v(()=>{let G=Vi(C,I,P,a,l);return[o("path",{key:"bg-arc",d:G,fill:"none",stroke:p,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,I,P,a,l,p,d]),A=v(()=>{if(y.length===0)return[];let G=[],_=L/y.length;for(let O=0;O<y.length;O++){let Y=a+O*_,q=Y+_,Q=Vi(C,I,P,Y,q);G.push(o("path",{key:`seg-${O}`,d:Q,fill:"none",stroke:y[O],"stroke-width":String(d),"stroke-linecap":O===0||O===y.length-1?"round":"butt",opacity:"0.85"}))}return G},[y,L,a,C,I,P,d]),k=v(()=>{if(!m||c<=0)return[];let G=[],_=Math.max(1,Math.min(c,100));for(let O=0;O<=_;O++){let Y=O/_,q=a+Y*L,Q=O%2===0,re=Q?10:6,ee=De(C,I,F+4,q),se=De(C,I,F+4+re,q);if(G.push(o("line",{key:`tick-${O}`,x1:String(ee.x),y1:String(ee.y),x2:String(se.x),y2:String(se.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let ae=x+Y*(S-x),K=De(C,I,F+4+re+12,q);G.push(o("text",{key:`tick-label-${O}`,x:String(K.x),y:String(K.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(ae)))}}return G},[m,c,a,L,C,I,F,x,S]),w=v(()=>{let G=[],_=D(z),O=T-8,Y=De(C,I,O,_),q=6,Q=_+90,re=_-90,ee=De(C,I,q,Q),se=De(C,I,q,re);return G.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${ee.x},${ee.y} ${se.x},${se.y}`,fill:h,stroke:"none"})),G.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(I),r:"8",fill:h,stroke:"#fff","stroke-width":"2"})),G},[z,D,C,I,T,h]),E=v(()=>{if(!u)return[];let G=[],_=_e(z),O=_+(f?" "+f:""),Y=I+P+20;return G.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${O}`},_,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),G},[u,z,f,C,I,P]),M=v(()=>{if(!g)return[];let G=I+P+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(G),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},g)]},[g,C,I,P,u]),N=v(()=>{if(!b)return[];let G=[],_=De(C,I,P,a),O=De(C,I,P,l);return G.push(o("text",{key:"min-label",x:String(_.x-4),y:String(_.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(x))),G.push(o("text",{key:"max-label",x:String(O.x+4),y:String(O.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},_e(S))),G},[b,C,I,P,a,l,x,S]),$=W(),B=A(),H=k(),V=w(),U=E(),J=M(),ne=N(),te=`Gauge: ${_e(z)}${f?" "+f:""}, range ${_e(x)} to ${_e(S)}${g?", "+g:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(z),"aria-valuemin":String(x),"aria-valuemax":String(S),"aria-label":te,style:{fontFamily:"sans-serif"}},...$,...B,...H,...V,...U,...J,...ne)}var ft={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,.1 -.9,-1.1 z m 2.5,.3 1.3,-.1 -.1,1 -1.1,.6 z m .3,2.2 3.4,-.1 .2,1.1 -1.3,.1 -.3,-.5 -.8,.6 -.4,-.6 -.9,-.2 z m 166.3,7.6 2.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.8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function Ui(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:b="Map of the United States"}=e,m=X(()=>Object.keys(ft),[]),c=v(p=>{l&&l(p)},[l]),g=v((p,x)=>{let S=x.currentTarget;S&&S.setAttribute("fill",u),d&&d(p)},[d,u]),f=v((p,x)=>{let S=x.currentTarget;if(S){let z=r[p]??i;S.setAttribute("fill",z)}d&&d(null)},[d,r,i]),y=X(()=>{let p=[];for(let x=0;x<m.length;x++){let S=m[x],z=ft[S],R=r[S]??i,C={key:`state-${S}`,d:z.path,fill:R,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":z.name,style:{cursor:l?"pointer":"default"}};if(l){let F=S;C.onClick=()=>c(F),C.onKeyDown=T=>{(T.key==="Enter"||T.key===" ")&&c(F)},C.tabindex=0,C.role="button",C["aria-label"]=z.name}let I=S;C.onMouseOver=F=>g(I,F),C.onMouseOut=F=>f(I,F),p.push(o("path",C))}return p},[m,r,i,s,a,l,c,g,f]),h=o("title",{key:"map-title"},b);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b,style:{fontFamily:"sans-serif"}},h,...y)}function Tn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function rd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function id(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Tn(t[i]),l=Tn(t[i+1]);return rd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function sd(e){let{r:t,g:n,b:r}=Tn(e);return(.299*t+.587*n+.114*r)/255}var ad=["#3b82f6","#fbbf24","#ef4444"];function ji(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=ad,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:b="#fff",cellBorderWidth:m=1,title:c,padding:g=60}=e,f=t.length,y=X(()=>{let k=0;for(let w of t)w.length>k&&(k=w.length);return k},[t]),{minVal:h,maxVal:p}=X(()=>{let k=l??1/0,w=d??-1/0;for(let E of t)for(let M of E)l===void 0&&M<k&&(k=M),d===void 0&&M>w&&(w=M);return k===1/0&&(k=0),w===-1/0&&(w=1),k===w&&(w=k+1),{minVal:k,maxVal:w}},[t,l,d]),x=c?30:0,S=n?g:20,z=r?g:20,R=i-S-20,C=s-x-z-20,I=y>0?R/y:0,F=f>0?C/f:0,T=v(()=>{let k=[];for(let w=0;w<f;w++){let E=t[w];for(let M=0;M<y;M++){let N=M<E.length?E[M]:0,$=(N-h)/(p-h),B=id($,a),H=S+M*I,V=x+20+w*F;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(H),y:String(V),width:String(I),height:String(F),fill:B,stroke:b,"stroke-width":String(m)})),u){let U=sd(B)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(H+I/2),y:String(V+F/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,I*.3,F*.4)),"font-family":"sans-serif",fill:U},String(Math.round(N*100)/100)))}}}return k},[t,f,y,h,p,a,I,F,S,x,u,b,m]),P=v(()=>{let k=[];if(n)for(let w=0;w<f;w++){let E=w<n.length?n[w]:"",M=x+20+w*F+F/2;k.push(o("text",{key:`row-label-${w}`,x:String(S-8),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}if(r)for(let w=0;w<y;w++){let E=w<r.length?r[w]:"",M=S+w*I+I/2,N=x+20+f*F+16;k.push(o("text",{key:`col-label-${w}`,x:String(M),y:String(N),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},E))}return k},[n,r,f,y,I,F,S,x]),L=v(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(f===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let D=L(),W=T(),A=P();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...D,...W,...A)}function ld(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function cd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function An(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Xi(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:b,yLabel:m,padding:c=60}=e,g=Math.max(1,Math.round(n)),f=X(()=>ld(t,g),[t,g]),y=X(()=>{let D=0;for(let W=0;W<f.length;W++)f[W].count>D&&(D=f[W].count);return D>0?D:1},[f]),h=r-c*2,p=i-c*2,x=v(()=>{if(!l)return[];let D=cd(y),W=[];for(let A=D;A<=y;A+=D){let k=c+p-A/y*p;W.push(o("line",{key:`grid-${A}`,x1:String(c),y1:String(k),x2:String(c+h),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),W.push(o("text",{key:`grid-label-${A}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(A)))}return W},[l,y,c,h,p]),S=v(()=>{let D=[];return D.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),D.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+p),x2:String(c+h),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"})),D},[c,h,p]),z=v(()=>{if(f.length===0)return[];let D=[],W=a*(f.length-1),A=Math.max(1,(h-W)/f.length);for(let k=0;k<f.length;k++){let w=f[k],E=w.count/y*p,M=c+k*(A+a),N=c+p-E;if(D.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(N),width:String(A),height:String(E),fill:s})),d&&w.count>0&&D.push(o("text",{key:`val-${k}`,x:String(M+A/2),y:String(N-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),f.length<=15||k%2===0||k===f.length-1){let B=(f.length===1,An(w.min));D.push(o("text",{key:`xlabel-${k}`,x:String(M+A/2),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},B))}}if(f.length>0){let k=f[f.length-1],w=c+h;D.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+p+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},An(k.max)))}return D},[f,y,a,s,d,c,h,p]),R=v(()=>{let D=[];return u&&D.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),b&&D.push(o("text",{key:"x-label",x:String(c+h/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},b)),m&&D.push(o("text",{key:"y-label",x:String(14),y:String(c+p/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+p/2})`},m)),D},[u,b,m,r,i,c,h,p]),C=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),I=x(),F=S(),T=z(),P=R(),L=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...P,...I,...F,...T,...L)}function dd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function qi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:b=!0,title:m,padding:c=60}=e,g=i==="vertical",f=g?30:0,y=n-c*2,h=r-c*2-f,p=g?h:y,x=g?y:h,S=X(()=>{let k=0;for(let w=0;w<t.length;w++)t[w].value>k&&(k=t[w].value);return k>0?k:1},[t]),z=X(()=>t.length===0?0:x/t.length,[t.length,x]),R=v(()=>{if(!u)return[];let k=dd(S),w=[];for(let E=k;E<=S;E+=k){let M=E/S*p;if(g){let N=c+h-M;w.push(o("line",{key:`grid-${E}`,x1:String(c),y1:String(N),x2:String(c+y),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${E}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(E)))}else{let N=c+M;w.push(o("line",{key:`grid-${E}`,x1:String(N),y1:String(c),x2:String(N),y2:String(c+h),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${E}`,x:String(N),y:String(c+h+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(E)))}}return w},[u,S,g,c,y,h,p]),C=v(()=>{let k=[];return g?k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})):k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+h),x2:String(c+y),y2:String(c+h),stroke:"#374151","stroke-width":"1.5"})),k},[g,c,y,h]),I=v(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let E=t[w],M=E.value/S*p,N=z*w+z/2,$=E.color??d;if(g){let B=c+N,H=c+h,V=c+h-M;k.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(H),x2:String(B),y2:String(V),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(B),cy:String(V),r:String(l),fill:$})),b&&k.push(o("text",{key:`val-${w}`,x:String(B),y:String(V-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.value)));let U=B,J=c+h+16;k.push(o("text",{key:`cat-${w}`,x:String(U),y:String(J),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${J})`},E.label))}else{let B=c+N,H=c,V=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(H),y1:String(B),x2:String(V),y2:String(B),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(V),cy:String(B),r:String(l),fill:$})),b&&k.push(o("text",{key:`val-${w}`,x:String(V+l+4),y:String(B+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(E.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},E.label))}}return k},[t,S,z,d,l,s,a,b,g,c,y,h,p]),F=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),T=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),P=R(),L=C(),D=I(),W=F(),A=T();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Lollipop chart",style:{fontFamily:"sans-serif"}},...W,...P,...L,...D,...A)}function Ln(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function ud(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function pd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Ln(t[i]),l=Ln(t[i+1]);return ud(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function fd(e){let{r:t,g:n,b:r}=Ln(e);return(.299*t+.587*n+.114*r)/255}var gd=["#f0f9ff","#3b82f6","#1e3a8a"];function Ki(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=gd,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:b="#e5e7eb",title:m,padding:c=70,symmetric:g=!1}=e,f=r??n,y=i??n,h=t.length,p=X(()=>{let $=0;for(let B of t)B.length>$&&($=B.length);return $},[t]),x=X(()=>{if(!g||h===0)return t;let $=[],B=Math.max(h,p);for(let H=0;H<B;H++){let V=[];for(let U=0;U<B;U++){let J=t[H],ne=J&&U<J.length?J[U]:0,te=t[U],G=te&&H<te.length?te[H]:0;ne!==0?V.push(ne):V.push(G)}$.push(V)}return $},[t,g,h,p]),S=x.length,z=X(()=>{let $=0;for(let B of x)B.length>$&&($=B.length);return $},[x]),{minVal:R,maxVal:C}=X(()=>{let $=1/0,B=-1/0;for(let H of x)for(let V of H)V<$&&($=V),V>B&&(B=V);return $===1/0&&($=0),B===-1/0&&(B=1),$===B&&(B=$+1),{minVal:$,maxVal:B}},[x]),I=m?30:0,F=f?c:20,T=y?c:20,P=s-F-20,L=a-I-T-20,D=z>0?P/z:0,W=S>0?L/S:0,A=v(()=>{let $=[];for(let B=0;B<S;B++){let H=x[B];for(let V=0;V<z;V++){let U=V<H.length?H[V]:0,J=(U-R)/(C-R),ne=pd(J,l),te=F+V*D,G=I+20+B*W,_=B===V,O=_&&u?"currentColor":b,Y=_&&u?"2":"1";if($.push(o("rect",{key:`cell-${B}-${V}`,x:String(te),y:String(G),width:String(D),height:String(W),fill:ne,stroke:O,"stroke-width":Y})),d){let q=fd(ne)>.5?"#111827":"#ffffff",Q=Math.min(12,D*.3,W*.35);$.push(o("text",{key:`val-${B}-${V}`,x:String(te+D/2),y:String(G+W/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":_&&u?"bold":"normal","font-family":"sans-serif",fill:q},String(Math.round(U*100)/100)))}}}return $},[x,S,z,R,C,l,D,W,F,I,d,u,b]),k=v(()=>{let $=[];if(f)for(let B=0;B<S;B++){let H=B<f.length?f[B]:"",V=I+20+B*W+W/2;$.push(o("text",{key:`row-label-${B}`,x:String(F-8),y:String(V),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}if(y)for(let B=0;B<z;B++){let H=B<y.length?y[B]:"",V=F+B*D+D/2,U=I+20+S*W+12;$.push(o("text",{key:`col-label-${B}`,x:String(V),y:String(U),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},H))}return $},[f,y,S,z,D,W,F,I]),w=v(()=>m?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,s]);if(S===0||z===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let E=w(),M=A(),N=k();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Matrix visualization",style:{fontFamily:"sans-serif"}},...E,...M,...N)}var md=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Lt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function hd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function bd(e,t,n,r,i,s,a){let l=[];if(Lt(e)<=0)return l;let b=hd(e)+1,m=s==="horizontal",c=m?i/b:r/b,g=[];for(g.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});g.length>0;){let f=g.shift(),{node:y,depth:h,spanStart:p,spanEnd:x,colorIndex:S}=f,z=Lt(y);if(z<=0)continue;let R=x-p,C,I,F,T;if(m?(C=p,I=n+h*c,F=R,T=c):(C=t+h*c,I=p,F=c,T=R),l.push({x:C,y:I,w:F,h:T,label:y.label,value:z,color:y.color??a[S%a.length],depth:h}),y.children&&y.children.length>0){let P=p;for(let L=0;L<y.children.length;L++){let D=y.children[L],W=Lt(D);if(W<=0)continue;let A=W/z*R;g.push({node:D,depth:h+1,spanStart:P,spanEnd:P+A,colorIndex:h===0?L:S}),P+=A}}}return l}function Zi(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=md,borderColor:d="#ffffff",borderWidth:u=1,title:b,padding:m=10}=e,c=b?30:0,g=m,f=m+c,y=n-m*2,h=r-m*2-c;if(X(()=>Lt(t),[t])<=0||y<=0||h<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=X(()=>bd(t,g,f,y,h,i,l),[t,g,f,y,h,i,l]),S=[];b&&S.push(o("text",{key:"title",x:String(n/2),y:String(m+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let z=0;z<x.length;z++){let R=x[z];if(S.push(o("rect",{key:`cell-${z}`,x:String(R.x),y:String(R.y),width:String(Math.max(0,R.w)),height:String(Math.max(0,R.h)),fill:R.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${R.label}: ${R.value}`})),s&&R.w>20&&R.h>14){let C=Math.floor(R.w/7),I=R.label.length>C?R.label.substring(0,Math.max(1,C-2))+"..":R.label;S.push(o("text",{key:`label-${z}`,x:String(R.x+R.w/2),y:String(R.y+R.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},I))}a&&R.w>30&&R.h>28&&S.push(o("text",{key:`value-${z}`,x:String(R.x+R.w/2),y:String(R.y+R.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(R.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function Fn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Ji(e,t){let n=new Set;for(let i of e)n.add(Fn(i,t));let r=Array.from(n);return r.sort(),r}function Ft(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function Nt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function xd(e,t,n,r,i){let s=Ji(e,t),a=Ji(e,n),l=new Map;for(let g of e){let f=Fn(g,t),y=Fn(g,n),h=`${f}::${y}`;l.has(h)||l.set(h,[]);let p=l.get(h),x=0;for(let S of r){let z=g[S];if(typeof z=="number")x+=z;else if(typeof z=="string"){let R=parseFloat(z);isNaN(R)||(x+=R)}}p.push(x)}let d=new Map;for(let[g,f]of l)d.set(g,Ft(f,i));let u=new Map;for(let g of s){let f=[];for(let y of a){let h=d.get(`${g}::${y}`);h!==void 0&&f.push(h)}u.set(g,Ft(f,i==="count"?"sum":i))}let b=new Map;for(let g of a){let f=[];for(let y of s){let h=d.get(`${y}::${g}`);h!==void 0&&f.push(h)}b.set(g,Ft(f,i==="count"?"sum":i))}let m=[];for(let g of u.values())m.push(g);let c=Ft(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:b,grandTotal:c}}function Qi(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:b="#3b82f6",cellPadding:m=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=X(()=>xd(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:g,colKeys:f,cells:y,rowTotals:h,colTotals:p,grandTotal:x}=c,S=u?30:0,z=f.length+(d?1:0),R=g.length+(d?1:0),C=1+z,I=1+R,F=Math.max(40,(a-m*2)/C),T=Math.max(20,Math.min(36,(l-S-m*2)/I)),P=F*C,L=T*I,D=Math.max(0,(a-P)/2),W=S+Math.max(0,(l-S-L)/2),A=[];u&&A.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),A.push(o("rect",{key:"header-row-bg",x:String(D),y:String(W),width:String(P),height:String(T),fill:b})),A.push(o("rect",{key:"header-col-bg",x:String(D),y:String(W+T),width:String(F),height:String(T*R),fill:b,opacity:"0.85"})),A.push(o("text",{key:"corner",x:String(D+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let k=0;k<f.length;k++){let w=D+(k+1)*F,E=Math.floor(F/7),M=f[k],N=M.length>E?M.substring(0,Math.max(1,E-2))+"..":M;A.push(o("text",{key:`ch-${k}`,x:String(w+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N))}d&&A.push(o("text",{key:"ch-total",x:String(D+(f.length+1)*F+F/2),y:String(W+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<g.length;k++){let w=g[k],E=W+(k+1)*T;k%2===0&&A.push(o("rect",{key:`row-bg-${k}`,x:String(D+F),y:String(E),width:String(F*z),height:String(T),fill:"#f9fafb"}));let M=Math.floor(F/7),N=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;A.push(o("text",{key:`rh-${k}`,x:String(D+F/2),y:String(E+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},N));for(let $=0;$<f.length;$++){let B=f[$],H=`${w}::${B}`,V=y.get(H),U=D+($+1)*F;A.push(o("rect",{key:`border-${k}-${$}`,x:String(U),y:String(E),width:String(F),height:String(T),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),A.push(o("text",{key:`cell-${k}-${$}`,x:String(U+F/2),y:String(E+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},V!==void 0?Nt(V):"-"))}if(d){let $=D+(f.length+1)*F,B=h.get(w)??0;A.push(o("rect",{key:`rt-bg-${k}`,x:String($),y:String(E),width:String(F),height:String(T),fill:"#eff6ff"})),A.push(o("text",{key:`rt-${k}`,x:String($+F/2),y:String(E+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Nt(B)))}}if(d){let k=W+(g.length+1)*T;A.push(o("rect",{key:"total-row-bg",x:String(D),y:String(k),width:String(P),height:String(T),fill:"#eff6ff"})),A.push(o("text",{key:"total-label",x:String(D+F/2),y:String(k+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let E=0;E<f.length;E++){let M=f[E],N=p.get(M)??0,$=D+(E+1)*F;A.push(o("text",{key:`ct-${E}`,x:String($+F/2),y:String(k+T/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Nt(N)))}let w=D+(f.length+1)*F;A.push(o("text",{key:"grand-total",x:String(w+F/2),y:String(k+T/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Nt(x)))}return A.push(o("rect",{key:"outer-border",x:String(D),y:String(W),width:String(P),height:String(L),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...A)}function Wt(e,t){return Math.PI*2*e/t-Math.PI/2}function Bt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function es(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:b="#d1d5db",title:m}=e,c=t.length,g=m?30:0,f=d&&n.length>0?30:0,y=60,h=Math.min((r-y*2)/2,(i-y*2-g-f)/2),p=r/2,x=y+g+h,S=X(()=>{let A=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){A.push(w);continue}let E=0;for(let M of n){let N=M.values[k];N!==void 0&&N>E&&(E=N)}A.push(E>0?E:1)}return A},[t,n,c]),z=v(()=>{if(c<3)return[];let A=[];for(let k=1;k<=s;k++){let w=h*k/s,E=[];for(let M=0;M<c;M++){let N=Wt(M,c),$=Bt(p,x,w,N);E.push(`${$.x},${$.y}`)}A.push(o("polygon",{key:`ring-${k}`,points:E.join(" "),fill:"none",stroke:b,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Wt(k,c),E=Bt(p,x,h,w);A.push(o("line",{key:`spoke-${k}`,x1:String(p),y1:String(x),x2:String(E.x),y2:String(E.y),stroke:b,"stroke-width":"0.75"}))}return A},[c,s,h,p,x,b]),R=v(()=>{if(!a||c<3)return[];let A=[],k=16;for(let w=0;w<c;w++){let E=Wt(w,c),M=Bt(p,x,h+k,E),N="middle";M.x<p-5?N="end":M.x>p+5&&(N="start");let $=Math.abs(M.y-x)<5?"0.35em":M.y<x?"0em":"0.7em";A.push(o("text",{key:`label-${w}`,x:String(M.x),y:String(M.y),"text-anchor":N,dy:$,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return A},[a,c,t,h,p,x]),C=v(()=>{if(c<3||n.length===0)return[];let A=[];for(let k=0;k<n.length;k++){let w=n[k],E=[],M=[],N=[];for(let $=0;$<c;$++){let B=w.values[$]??0,H=S[$],V=Math.min(B/H,1),U=h*V,J=Wt($,c),ne=Bt(p,x,U,J);E.push(`${ne.x},${ne.y}`),u&&M.push(o("circle",{key:`dot-${k}-${$}`,cx:String(ne.x),cy:String(ne.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&N.push(o("text",{key:`val-${k}-${$}`,x:String(ne.x),y:String(ne.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(B*100)/100)))}A.push(o("polygon",{key:`series-fill-${k}`,points:E.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),A.push(o("polygon",{key:`series-line-${k}`,points:E.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let $ of M)A.push($);for(let $ of N)A.push($)}return A},[c,n,S,h,p,x,u,l]),I=v(()=>{if(!d||n.length===0)return[];let A=[],k=x+h+40,w=100,E=n.length*w,M=p-E/2;for(let N=0;N<n.length;N++){let $=n[N],B=M+N*w;A.push(o("rect",{key:`legend-swatch-${N}`,x:String(B),y:String(k),width:"12",height:"12",rx:"2",fill:$.color})),A.push(o("text",{key:`legend-text-${N}`,x:String(B+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},$.label))}return A},[d,n,p,x,h]),F=v(()=>m?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},m)]:[],[m,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let T=z(),P=R(),L=C(),D=I(),W=F();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Radar chart",style:{fontFamily:"sans-serif"}},...W,...T,...P,...L,...D)}var yd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Sd(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let b of u){let m=n.get(b),c=d+1;(m===void 0||c>m)&&n.set(b,c),s.includes(b)||s.push(b)}}for(let l of e)n.has(l)||n.set(l,0);return n}function vd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,b=t.filter(P=>P.value>0),m=e.map(P=>P.id),c=Sd(m,b),g=new Map,f=new Map;for(let P of m)g.set(P,0),f.set(P,0);for(let P of b)f.set(P.source,(f.get(P.source)??0)+P.value),g.set(P.target,(g.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let h=new Map;for(let P=0;P<=y;P++)h.set(P,[]);for(let[P,L]of c)h.get(L).push(P);let p=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)p.set(P,a+P*x);let S=new Map;for(let P=0;P<e.length;P++)S.set(e[P].id,e[P]);let z=[],R=new Map;for(let P=0;P<=y;P++){let L=h.get(P);if(L.length===0)continue;let D=0;for(let w of L){let E=g.get(w)??0,M=f.get(w)??0;D+=Math.max(E,M,1)}let W=u-s*(L.length-1),A=D>0?W/D:1,k=a;for(let w=0;w<L.length;w++){let E=L[w],M=S.get(E),N=g.get(E)??0,$=f.get(E)??0,B=Math.max(N,$,1),H=Math.max(4,B*A),V=e.findIndex(J=>J.id===E),U={id:E,label:M.label,color:M.color??l[V%l.length],column:P,x:p.get(P),y:k,height:H,totalIn:N,totalOut:$,totalValue:B};z.push(U),R.set(E,U),k+=H+s}}let C=new Map,I=new Map;for(let P of m)C.set(P,0),I.set(P,0);let F=[...b].sort((P,L)=>L.value-P.value),T=[];for(let P of F){let L=R.get(P.source),D=R.get(P.target);if(!L||!D)continue;let W=L.totalOut||1,A=D.totalIn||1,k=P.value/W*L.height,w=P.value/A*D.height,E=Math.max(1,(k+w)/2),M=C.get(P.source),N=I.get(P.target),$=L.y+M+k/2,B=D.y+N+w/2;C.set(P.source,M+k),I.set(P.target,N+w);let H=S.get(P.source);T.push({source:P.source,target:P.target,value:P.value,color:P.color??H?.color??L.color,sourceY:$,targetY:B,width:E})}return{layoutNodes:z,layoutLinks:T}}function ts(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:b=yd,title:m,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let g=X(()=>vd(t,n,r,i,s,a,c,b),[t,n,r,i,s,a,c,b]),f=v(()=>{let z=[];for(let R=0;R<g.layoutLinks.length;R++){let C=g.layoutLinks[R],I=g.layoutNodes.find(W=>W.id===C.source),F=g.layoutNodes.find(W=>W.id===C.target);if(!I||!F)continue;let T=I.x+s,P=F.x,L=(T+P)/2,D=`M ${T} ${C.sourceY} C ${L} ${C.sourceY}, ${L} ${C.targetY}, ${P} ${C.targetY}`;z.push(o("path",{key:`link-${R}`,d:D,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&z.push(o("text",{key:`link-val-${R}`,x:String(L),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return z},[g,s,u,d]),y=v(()=>{let z=[];for(let R=0;R<g.layoutNodes.length;R++){let C=g.layoutNodes[R];if(z.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let I=g.layoutNodes.reduce((A,k)=>Math.max(A,k.column),0),F=C.column===I,T=F?C.x+s+6:C.x-6,P=F?"start":"end",L=C.column===0,D=L?C.x-6:T,W=L?"end":P;z.push(o("text",{key:`label-${C.id}`,x:String(D),y:String(C.y+C.height/2+4),"text-anchor":W,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return z},[g,s,l]),h=v(()=>m?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r,c]),p=f(),x=y(),S=h();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Sankey diagram",style:{fontFamily:"sans-serif"}},...S,...p,...x)}var wd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Nn=2*Math.PI;function gt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function kd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Cd(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,b=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),g=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),h=e+n*Math.cos(d),p=t+n*Math.sin(d);if(a>=Nn-.001){let x=d+Math.PI,S=e+r*Math.cos(x),z=t+r*Math.sin(x),R=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${b} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${z}`,`A ${r} ${r} 0 1 1 ${b} ${m}`,`L ${h} ${p}`,`A ${n} ${n} 0 1 0 ${R} ${C}`,`A ${n} ${n} 0 1 0 ${h} ${p}`,"Z"].join(" ")}return[`M ${b} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${g}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${h} ${p}`,"Z"].join(" ")}function Md(e,t,n,r){let i=[],s=gt(e);if(s<=0)return i;let a=kd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let b=0;b<e.children.length;b++){let m=e.children[b],c=gt(m);if(c<=0)continue;let g=c/s*Nn;d.push({node:m,startAngle:u,endAngle:u+g,depth:0,colorIndex:b}),u+=g}}else return i.push({startAngle:0,endAngle:Nn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:b,startAngle:m,endAngle:c,depth:g,colorIndex:f}=u,y=gt(b);if(y<=0)continue;let h=t+g*l,p=h+l;if(i.push({startAngle:m,endAngle:c,innerR:h,outerR:p,label:b.label,value:y,color:b.color??r[f%r.length],depth:g}),b.children&&b.children.length>0){let x=m,S=c-m;for(let z=0;z<b.children.length;z++){let R=b.children[z],C=gt(R);if(C<=0)continue;let I=C/y*S;d.push({node:R,startAngle:x,endAngle:x+I,depth:g+1,colorIndex:f}),x+=I}}}return i}function ns(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=wd,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,b=n/2,m=r/2,c=u?20:0,g=Math.min(b,m-c)-10;if(X(()=>gt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(b),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>Md(t,i,g,a),[t,i,g,a]),h=[];u&&h.push(o("text",{key:"title",x:String(b),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let p=m+c/2;for(let x=0;x<y.length;x++){let S=y[x],z=Cd(b,p,S.innerR,S.outerR,S.startAngle,S.endAngle);if(h.push(o("path",{key:`arc-${x}`,d:z,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let R=S.endAngle-S.startAngle,C=S.startAngle+R/2-Math.PI/2,I=(S.innerR+S.outerR)/2,F=S.outerR-S.innerR,T=R*I;if(T>20&&F>14){let P=b+I*Math.cos(C),L=p+I*Math.sin(C),D=Math.floor(Math.min(T,F)/7),W=S.label.length>D?S.label.substring(0,Math.max(1,D-1))+"..":S.label;h.push(o("text",{key:`label-${x}`,x:String(P),y:String(L+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},W))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...h)}var Ed=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ot(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function os(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function Pd(e,t,n,r,i,s){let a=[],l=[],d=Ot(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],b=r*i,m=[];for(let c=0;c<u.length;c++){let g=u[c],f=Ot(g);f<=0||m.push({label:g.label,value:f,area:f/d*b,color:g.color??s[c%s.length],node:g})}for(m.sort((c,g)=>g.area-c.area),l.push({nodes:m,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:g,rect:f,depth:y}=c;if(g.length===0)continue;let h={...f},p=0;for(;p<g.length&&h.w>0&&h.h>0;){let x=h.w>=h.h,S=x?h.h:h.w,z=[],R=[];z.push(g[p]),R.push(g[p].area),p++;let C=os(R,S);for(;p<g.length;){let P=[...R,g[p].area],L=os(P,S);if(L>C)break;z.push(g[p]),R.push(g[p].area),C=L,p++}let I=0;for(let P of R)I+=P;let F=S>0?I/S:0,T=0;for(let P=0;P<z.length;P++){let L=z[P],D=F>0?L.area/F:0,W,A,k,w;if(x?(W=h.x,A=h.y+T,k=F,w=D):(W=h.x+T,A=h.y,k=D,w=F),a.push({x:W,y:A,w:k,h:w,label:L.label,value:L.value,color:L.color,depth:y}),L.node.children&&L.node.children.length>0){let M=W+2,N=A+2+14,$=k-4,B=w-4-14;if($>4&&B>4){let H=[],V=L.value,U=$*B;for(let J=0;J<L.node.children.length;J++){let ne=L.node.children[J],te=Ot(ne);te<=0||H.push({label:ne.label,value:te,area:te/V*U,color:ne.color??s[(J+y+1)%s.length],node:ne})}H.sort((J,ne)=>ne.area-J.area),l.push({nodes:H,rect:{x:M,y:N,w:$,h:B},depth:y+1})}}T+=D}x?h={x:h.x+F,y:h.y,w:h.w-F,h:h.h}:h={x:h.x,y:h.y+F,w:h.w,h:h.h-F}}}return a}function rs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Ed,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:b}=e,m=b?30:0,c=u,g=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>Ot(t),[t])<=0||f<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let p=X(()=>Pd(t,c,g,f,y,a),[t,c,g,f,y,a]),x=[];b&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b));for(let S=0;S<p.length;S++){let z=p[S];if(x.push(o("rect",{key:`cell-${S}`,x:String(z.x),y:String(z.y),width:String(Math.max(0,z.w)),height:String(Math.max(0,z.h)),fill:z.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${z.label}: ${z.value}`})),i&&z.w>20&&z.h>14){let R=Math.floor(z.w/7),C=z.label.length>R?z.label.substring(0,Math.max(1,R-2))+"..":z.label;x.push(o("text",{key:`label-${S}`,x:String(z.x+4),y:String(z.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&z.w>30&&z.h>28&&x.push(o("text",{key:`value-${S}`,x:String(z.x+4),y:String(z.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(z.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function is(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Rd(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function ss(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=is(t[s]),u=is(t[a]);return Rd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Ht(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function $d(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let b=Math.max(2,Math.min(50,r)),m=d/(b-1),c=u/(b-1);if(n){let f=[];for(let x=0;x<b;x++)for(let S=0;S<b;S++)f.push({x:i+S*m,y:a+x*c});let h=n(f,{gridSize:b,xMin:i,xMax:s,yMin:a,yMax:l}),p=[];for(let x=0;x<f.length;x++){let S=f[x],z=h[x]??{dx:0,dy:0},R=Math.sqrt(z.dx*z.dx+z.dy*z.dy);p.push({x:S.x,y:S.y,dx:z.dx,dy:z.dy,magnitude:R})}return p}if(!t)return[];let g=[];for(let f=0;f<b;f++)for(let y=0;y<b;y++){let h=i+y*m,p=a+f*c,x=t(h,p),S=Math.sqrt(x.dx*x.dx+x.dy*x.dy);g.push({x:h,y:p,dx:x.dx,dy:x.dy,magnitude:S})}return g}function Id(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:b,yMax:m,xSpan:c,ySpan:g,showGrid:f,showAxes:y,colorByMagnitude:h,colorScale:p,arrowColor:x,arrowWidth:S,effectiveArrowScale:z,maxMagnitude:R,title:C,tickFontSize:I}=i,F=L=>s+(L-d)/c*a,T=L=>s+(m-L)/g*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),f){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${I}px sans-serif`,e.fillStyle="#6b7280";let L=Ht(c,10),D=Math.ceil(d/L)*L;for(let k=D;k<=u;k+=L){let w=F(k);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(k*100)/100),w,s+l+4)}let W=Ht(g,10),A=Math.ceil(b/W)*W;for(let k=A;k<=m;k+=W){let w=T(k);e.beginPath(),e.moveTo(s,w),e.lineTo(s+a,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(k*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=S,b<=0&&m>=0){let L=T(0);e.beginPath(),e.moveTo(s,L),e.lineTo(s+a,L),e.stroke()}if(d<=0&&u>=0){let L=F(0);e.beginPath(),e.moveTo(L,s),e.lineTo(L,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let L=0;L<r.length;L++){let D=r[L],W=D.magnitude??Math.sqrt(D.dx*D.dx+D.dy*D.dy);if(W<1e-10)continue;let A=F(D.x),k=T(D.y),w=D.dx*z,E=-D.dy*z,M=A+w,N=k+E,$;if(h){let H=W/R;$=ss(H,p)}else $=x;e.save(),e.strokeStyle=$,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(A,k),e.lineTo(M,N),e.stroke();let B=Math.sqrt(w*w+E*E);if(B>2){let H=w/B,V=E/B,U=-V,J=H,ne=Math.min(P,B*.4),te=M-H*ne+U*ne*.5,G=N-V*ne+J*ne*.5,_=M-H*ne-U*ne*.5,O=N-V*ne-J*ne*.5;e.fillStyle=$,e.beginPath(),e.moveTo(M,N),e.lineTo(te,G),e.lineTo(_,O),e.closePath(),e.fill()}e.restore()}}function as(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:b=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:g=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:h=10,arrowWidth:p=1.5,renderer:x="svg",useGPU:S=!1,computeWorker:z}=e,R=Math.max(2,Math.min(50,s)),C=r-y*2,I=i-y*2,F=a[0],T=a[1],P=l[0],L=l[1],D=T-F,W=L-P,A=X(()=>te=>y+(te-F)/D*C,[y,F,D,C]),k=X(()=>te=>y+(L-te)/W*I,[y,L,W,I]),w=X(()=>$d(t,n,z,R,F,T,P,L,D,W),[t,n,z,R,F,T,P,L,D,W]),E=X(()=>{let te=0;for(let G=0;G<w.length;G++){let _=w[G],O=_.magnitude??Math.sqrt(_.dx*_.dx+_.dy*_.dy);O>te&&(te=O)}return te>0?te:1},[w]),M=X(()=>Math.min(C,I)/Math.max(R,2)/(2*E)*d,[C,I,R,E,d]);if(x==="canvas"){let te=oe(null),G=oe(0);return ie(()=>{let _=te.current;if(!_)return;let O=_.getContext("2d");if(O)return G.current&&cancelAnimationFrame(G.current),G.current=requestAnimationFrame(()=>{Id(O,r,i,w,{padding:y,chartWidth:C,chartHeight:I,xMin:F,xMax:T,yMin:P,yMax:L,xSpan:D,ySpan:W,showGrid:b,showAxes:m,colorByMagnitude:c,colorScale:g,arrowColor:u,arrowWidth:p,effectiveArrowScale:M,maxMagnitude:E,title:f,tickFontSize:h})}),()=>{G.current&&cancelAnimationFrame(G.current)}},[w,r,i,y,C,I,F,T,P,L,D,W,b,m,c,g,u,p,M,E,f,h]),o("canvas",{ref:te,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let N=v(()=>{if(!b)return[];let te=[],G=Ht(D,10),_=Math.ceil(F/G)*G;for(let q=_;q<=T;q+=G){let Q=A(q);te.push(o("line",{key:`gridv-${q}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+I),stroke:"#e5e7eb","stroke-width":"0.5"})),te.push(o("text",{key:`xtick-${q}`,x:String(Q),y:String(y+I+16),"text-anchor":"middle","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(q*100)/100)))}let O=Ht(W,10),Y=Math.ceil(P/O)*O;for(let q=Y;q<=L;q+=O){let Q=k(q);te.push(o("line",{key:`gridh-${q}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),te.push(o("text",{key:`ytick-${q}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(h),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(q*100)/100)))}return te},[b,F,T,P,L,D,W,A,k,y,C,I]),$=v(()=>{if(!m)return[];let te=[];if(P<=0&&L>=0){let G=k(0);te.push(o("line",{key:"axis-x",x1:String(y),y1:String(G),x2:String(y+C),y2:String(G),stroke:"#374151","stroke-width":String(p)}))}if(F<=0&&T>=0){let G=A(0);te.push(o("line",{key:"axis-y",x1:String(G),y1:String(y),x2:String(G),y2:String(y+I),stroke:"#374151","stroke-width":String(p)}))}return te.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),te},[m,F,T,P,L,A,k,y,C,I]),B=v(()=>{let te=[];for(let _=0;_<w.length;_++){let O=w[_],Y=O.magnitude??Math.sqrt(O.dx*O.dx+O.dy*O.dy);if(Y<1e-10)continue;let q=A(O.x),Q=k(O.y),re=O.dx*M,ee=-O.dy*M,se=q+re,ae=Q+ee,K;if(c){let le=Y/E;K=ss(le,g)}else K=u;te.push(o("line",{key:`arrow-line-${_}`,x1:String(q),y1:String(Q),x2:String(se),y2:String(ae),stroke:K,"stroke-width":String(p),"stroke-linecap":"round"}));let Z=Math.sqrt(re*re+ee*ee);if(Z>2){let le=re/Z,de=ee/Z,ce=-de,ue=le,fe=Math.min(4,Z*.4),ge=se-le*fe+ce*fe*.5,be=ae-de*fe+ue*fe*.5,ke=se-le*fe-ce*fe*.5,Me=ae-de*fe-ue*fe*.5;te.push(o("polygon",{key:`arrow-head-${_}`,points:`${se},${ae} ${ge},${be} ${ke},${Me}`,fill:K}))}}return te},[w,A,k,M,c,E,g,u]),H=v(()=>f?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,r,y]),V=N(),U=$(),J=B(),ne=H();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif"}},...ne,...V,...U,...J)}function Dd(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function zd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ls(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:b=!0,title:m,padding:c=60}=e,g=n-c*2,f=r-c*2,y=X(()=>Dd(t),[t]),{minVal:h,maxVal:p}=X(()=>{let E=0,M=0;for(let N=0;N<y.length;N++){let $=y[N];$.start<E&&(E=$.start),$.end<E&&(E=$.end),$.start>M&&(M=$.start),$.end>M&&(M=$.end)}return E===M&&(M=E+1),{minVal:E,maxVal:M}},[y]),x=p-h,S=v(E=>c+f-(E-h)/x*f,[c,f,h,x]),z=X(()=>y.length===0?0:g/y.length,[y.length,g]),R=6,C=Math.max(1,z-R),I=v(()=>{if(!u)return[];let E=zd(x),M=[],N=Math.ceil(h/E)*E;for(let $=N;$<=p;$+=E){let B=S($);M.push(o("line",{key:`grid-${$}`,x1:String(c),y1:String(B),x2:String(c+g),y2:String(B),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${$}`,x:String(c-8),y:String(B+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String($)))}return M},[u,x,h,p,S,c,g]),F=v(()=>{let E=[];E.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"}));let M=h<=0&&p>=0?S(0):c+f;return E.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+g),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),E},[c,g,f,h,p,S]),T=v(()=>{if(y.length===0)return[];let E=[];for(let M=0;M<y.length;M++){let N=y[M],$=c+M*z+R/2,B=Math.max(N.start,N.end),H=Math.min(N.start,N.end),V=S(B),U=S(H),J=Math.max(0,U-V),ne;if(N.type==="total"?ne=a:N.type==="decrease"?ne=s:ne=i,E.push(o("rect",{key:`bar-${M}`,x:String($),y:String(V),width:String(C),height:String(J),fill:ne,rx:"2",ry:"2"})),d){let te=N.type==="decrease"||N.value<0?U+14:V-4,G=N.type==="total"?String(N.value):(N.value>=0?"+":"")+String(N.value);E.push(o("text",{key:`val-${M}`,x:String($+C/2),y:String(te),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},G))}if(E.push(o("text",{key:`cat-${M}`,x:String($+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},N.label)),b&&M<y.length-1){let te=y[M+1],G=S(N.end),_=c+(M+1)*z+R/2;te.type!=="total"&&E.push(o("line",{key:`conn-${M}`,x1:String($+C),y1:String(G),x2:String(_),y2:String(G),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return E},[y,z,C,S,i,s,a,l,d,b,c,f]),P=v(()=>m?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,n,c]),L=v(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),D=I(),W=F(),A=T(),k=P(),w=L();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...D,...W,...A,...w)}var Td=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Ad=[0,-45,45,90];function Ld(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),b=Math.abs(Math.sin(d)),m=a*u+l*b,c=a*b+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function Fd(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function Nd(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Wd(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function cs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=Td,rotations:d=Ad,padding:u=4,spiral:b="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,I)=>({...C,originalIndex:I})).filter(C=>C.text.length>0&&C.weight>0).sort((C,I)=>I.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,p=f[0].weight-y;function x(C){if(p===0)return(i+s)/2;let I=(C-y)/p;return i+I*(s-i)}let S=[],z=n/2,R=r/2;for(let C=0;C<f.length;C++){let I=f[C],F=x(I.weight),T=d[Wd(I.text)%d.length],P=I.color??l[C%l.length],L=!1,D=500,W=b==="archimedean"?4:5;for(let A=0;A<D;A++){let k,w;if(b==="archimedean"){let H=A*.1,V=W*H;k=V*Math.cos(H),w=V*Math.sin(H)}else{let H=Math.floor(A/4)+1,V=A%4,U=(A%4===0?0:A)*W;switch(V){case 0:k=H*W*4,w=U;break;case 1:k=-U,w=H*W*4;break;case 2:k=-H*W*4,w=-U;break;default:k=U,w=-H*W*4;break}}let E=z+k,M=R+w,N=Ld(I.text,F,T,E,M),$={x:N.x-u,y:N.y-u,w:N.w+u*2,h:N.h+u*2};if(!Nd($,n,r))continue;let B=!1;for(let H of S)if(Fd($,H.bbox)){B=!0;break}if(!B){S.push({text:I.text,x:E,y:M,fontSize:F,rotation:T,color:P,bbox:$}),L=!0;break}}}return S},[t,n,r,i,s,l,d,u,b]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let g=[];m&&g.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},m));for(let f=0;f<c.length;f++){let y=c[f],h=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;g.push(o("text",{key:`word-${f}`,transform:h,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Word cloud",style:{fontFamily:a}},...g)}var Bd={0:"#1e293b",1:"#3b82f6"},Od="#666";function ds(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:b="#0f172a",padding:m=10,onCellClick:c,onCellHover:g,title:f}=e,y=n??Bd,h=t.length,p=X(()=>{let E=0;for(let M=0;M<t.length;M++){let N=t[M];N!==void 0&&N.length>E&&(E=N.length)}return E},[t]),x=u?20:0,S=f?24:0,z=X(()=>{let E=r-m*2-x,M=i-m*2-x-S;if(h===0||p===0)return{cellWidth:0,cellHeight:0};let N=Math.max(0,(E-s*(p-1))/p),$=Math.max(0,(M-s*(h-1))/h);return{cellWidth:N,cellHeight:$}},[r,i,m,h,p,s,x,S]),R=v(E=>{let M=y[E];return M!==void 0?M:Od},[y]),C=v(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b}),[r,i,b]),I=v(()=>f?[o("text",{key:"title",x:String(r/2),y:String(m+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},f)]:[],[f,r,m]),F=v(()=>{if(!l||h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=p*E+(p-1)*s,H=h*M+(h-1)*s,V=[];for(let U=0;U<=p;U++){let J=N+U*(E+s)-s/2;V.push(o("line",{key:`vgrid-${U}`,x1:String(J),y1:String($-s/2),x2:String(J),y2:String($+H+s/2),stroke:d,"stroke-width":"0.5"}))}for(let U=0;U<=h;U++){let J=$+U*(M+s)-s/2;V.push(o("line",{key:`hgrid-${U}`,x1:String(N-s/2),y1:String(J),x2:String(N+B+s/2),y2:String(J),stroke:d,"stroke-width":"0.5"}))}return V},[l,h,p,z,m,x,S,s,d]),T=v(()=>{if(!u||h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=[];for(let H=0;H<p;H++){let V=N+H*(E+s)+E/2,U=$-6;B.push(o("text",{key:`col-idx-${H}`,x:String(V),y:String(U),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}for(let H=0;H<h;H++){let V=N-6,U=$+H*(M+s)+M/2+3;B.push(o("text",{key:`row-idx-${H}`,x:String(V),y:String(U),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(H)))}return B},[u,h,p,z,m,x,S,s]),P=v(()=>{if(h===0||p===0)return[];let{cellWidth:E,cellHeight:M}=z,N=m+x,$=m+x+S,B=[];for(let H=0;H<h;H++){let V=t[H];if(V!==void 0)for(let U=0;U<p;U++){let J=U<V.length?V[U]:0,ne=N+U*(E+s),te=$+H*(M+s),G=R(J),_={key:`cell-${H}-${U}`,x:String(ne),y:String(te),width:String(E),height:String(M),fill:G,rx:String(a),ry:String(a)};if(c){let O=H,Y=U,q=J;_.onClick=()=>c(O,Y,q),_.role="button",_.tabIndex=0}if(g){let O=H,Y=U,q=J;_.onMouseEnter=()=>g(O,Y,q)}B.push(o("rect",_))}}return B},[h,p,t,z,m,x,S,s,a,R,c,g]),L=C(),D=I(),W=F(),A=T(),k=P(),w=f?`${f} \u2014 ${h}x${p} discrete grid`:`${h}x${p} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},L,...D,...W,...A,...k)}
|
|
7
|
+
`,document.head.appendChild(d),()=>{let u=document.getElementById(l);u&&u.remove()}},[]);let s=w(l=>t.dismiss(l),[t]),a=r.map(l=>o(al,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function wr(e={}){let t=ne(null);t.current||(t.current=an(e));let n=t.current,r=w(()=>o(ln,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var ll=6,cl=8;function dl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=cl;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function ul(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${ll}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function kr(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=G(!1),[d,u]=G(null),g=ne(null),h=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,f=w(()=>{h.current=setTimeout(()=>{if(g.current){let x=g.current.getBoundingClientRect();u(dl(x,n))}l(!0)},r)},[r,n]),p=w(()=>{h.current&&(clearTimeout(h.current),h.current=null),l(!1)},[]);se(()=>()=>{h.current&&clearTimeout(h.current)},[]);let y={display:"inline-block"},b={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},m=[o("div",{ref:g,style:y,onMouseEnter:f,onMouseLeave:p,onFocus:f,onBlur:p,"aria-describedby":a?c:void 0},s)];return a&&d&&m.push(o("div",{id:c,style:b,role:"tooltip"},t,o("div",{style:ul(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...m)}function cn(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function pl(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let a of t)for(let l of a.values)l.value>s&&(s=l.value);return s}let i=0;for(let s of t){let a=0;for(let l of s.values)a+=l.value;a>i&&(i=a)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function fl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ml(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Cr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mr(e,t){return t||Cr[e%Cr.length]}function Er(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:a=8,barRadius:l=4,showValues:d=!0,showGrid:u=!0,gridColor:g="#e5e7eb",title:h,padding:c=50,animate:f=!1,stacked:p,grouped:y=!1}=e,b=i==="vertical",m=n-c*2,x=r-c*2,v=b?x:m,D=b?m:x,T=p!==void 0&&p.length>0,C=q(()=>T?ml(p):[],[T,p]),$=T?p.length:t.length,A=q(()=>pl(t,p,y),[t,p,y]),z=A>0?A:1,P=cn($,z,v,D,a),B=w(()=>{if(!u)return[];let O=fl(z),H=[];for(let X=O;X<=z;X+=O){let J=P.valueScale(X);if(b){let K=c+x-J;H.push(o("line",{key:`grid-${X}`,x1:String(c),y1:String(K),x2:String(c+m),y2:String(K),stroke:g,"stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${X}`,x:String(c-6),y:String(K+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}else{let K=c+J;H.push(o("line",{key:`grid-${X}`,x1:String(K),y1:String(c),x2:String(K),y2:String(c+x),stroke:g,"stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${X}`,x:String(K),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(X)))}}return H},[u,z,P,b,c,m,x,g]),I=w(()=>{let O=[];return b?(O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+m),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),O.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"}))),O},[b,c,m,x]),N=w(()=>{let O=[];for(let H=0;H<t.length;H++){let X=t[H],J=P.valueScale(X.value),K=P.categoryScale(H),U=X.color??s,j,V,Y=String(X.value);if(b){let Z=c+K,Q=c+x-J;j={x:String(Z),y:String(Q),width:String(P.barThickness),height:String(J),rx:String(l),ry:String(l),fill:U},V={x:String(Z+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+K,Q=c;j={x:String(Q),y:String(Z),width:String(J),height:String(P.barThickness),rx:String(l),ry:String(l),fill:U},V={x:String(Q+J+6),y:String(Z+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(f&&(j.style=b?`animation: barGrow 0.6s ease-out ${H*.05}s both`:`animation: barGrow 0.6s ease-out ${H*.05}s both`),O.push(o("rect",{key:`bar-${H}`,...j})),d&&O.push(o("text",{key:`val-${H}`,...V},Y)),b){let Z=c+K+P.barThickness/2,Q=c+x+16;O.push(o("text",{key:`cat-${H}`,x:String(Z),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${Q})`},X.label))}else O.push(o("text",{key:`cat-${H}`,x:String(c-6),y:String(c+K+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[t,P,s,l,d,f,b,c,x]),L=w(()=>{if(!p)return[];let O=[];for(let H=0;H<p.length;H++){let X=p[H],J=P.categoryScale(H),K=0;for(let U=0;U<X.values.length;U++){let j=X.values[U],V=P.valueScale(j.value),Y=P.valueScale(K),Z=Mr(U,j.color);if(b){let Q=c+J,ae=c+x-Y-V;O.push(o("rect",{key:`sbar-${H}-${U}`,x:String(Q),y:String(ae),width:String(P.barThickness),height:String(V),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:Z,...f?{style:`animation: barGrow 0.6s ease-out ${(H*X.values.length+U)*.03}s both`}:{}})),d&&V>14&&O.push(o("text",{key:`sval-${H}-${U}`,x:String(Q+P.barThickness/2),y:String(ae+V/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let Q=c+Y,ae=c+J;O.push(o("rect",{key:`sbar-${H}-${U}`,x:String(Q),y:String(ae),width:String(V),height:String(P.barThickness),rx:U===X.values.length-1?String(l):"0",ry:U===X.values.length-1?String(l):"0",fill:Z,...f?{style:`animation: barGrow 0.6s ease-out ${(H*X.values.length+U)*.03}s both`}:{}})),d&&V>20&&O.push(o("text",{key:`sval-${H}-${U}`,x:String(Q+V/2),y:String(ae+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}K+=j.value}if(d){let U=P.valueScale(K);b?O.push(o("text",{key:`stotal-${H}`,x:String(c+J+P.barThickness/2),y:String(c+x-U-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(K))):O.push(o("text",{key:`stotal-${H}`,x:String(c+U+6),y:String(c+J+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(K)))}if(b){let U=c+J+P.barThickness/2,j=c+x+16;O.push(o("text",{key:`scat-${H}`,x:String(U),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${U}, ${j})`},X.label))}else O.push(o("text",{key:`scat-${H}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},X.label))}return O},[p,P,l,d,f,b,c,x]),M=w(()=>{if(!p)return[];let O=C.length,H=[];for(let X=0;X<p.length;X++){let J=p[X],K=P.categoryScale(X),U=2,j=Math.max(1,(P.barThickness-U*(O-1))/O);for(let V=0;V<J.values.length;V++){let Y=J.values[V],Z=C.indexOf(Y.category),Q=Z*(j+U),ae=P.valueScale(Y.value),ee=Mr(Z>=0?Z:V,Y.color);if(b){let te=c+K+Q,le=c+x-ae;H.push(o("rect",{key:`gbar-${X}-${V}`,x:String(te),y:String(le),width:String(j),height:String(ae),rx:String(l),ry:String(l),fill:ee,...f?{style:`animation: barGrow 0.6s ease-out ${(X*O+V)*.04}s both`}:{}})),d&&H.push(o("text",{key:`gval-${X}-${V}`,x:String(te+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}else{let te=c,le=c+K+Q;H.push(o("rect",{key:`gbar-${X}-${V}`,x:String(te),y:String(le),width:String(ae),height:String(j),rx:String(l),ry:String(l),fill:ee,...f?{style:`animation: barGrow 0.6s ease-out ${(X*O+V)*.04}s both`}:{}})),d&&H.push(o("text",{key:`gval-${X}-${V}`,x:String(te+ae+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(Y.value)))}}if(b){let V=c+K+P.barThickness/2,Y=c+x+16;H.push(o("text",{key:`gcat-${X}`,x:String(V),y:String(Y),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${V}, ${Y})`},J.label))}else H.push(o("text",{key:`gcat-${X}`,x:String(c-6),y:String(c+K+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},J.label))}return H},[p,C,P,l,d,f,b,c,x]),S=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),k=w(()=>f?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[f,b]),E=B(),F=I(),R=S(),W=k(),_;return T&&y?_=M():T?_=L():_=N(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...W,...R,...E,...F,..._)}function tt(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let a=0;a<i;a++){let l=t+a*r;if(l>n+r*.001)break;s.push(l)}return s}function Tt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function zt(e,t,n,r){let i=!1,s=0,a=[],l=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let g=t[u],h=e(g);isFinite(h)&&a.push({input:g,output:h})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),Rr(l)};return Rr(l),()=>{i=!0}}function Rr(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function gl(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function Pr(e,t){let n=t-e;if(n<=0)return[e];let r=gl(n,8),i=Math.ceil(e/r)*r,s=[];for(let a=i;a<=t+r*.001;a+=r)s.push(Math.round(a*1e10)/1e10);return s}function Ir(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var be=40,$r=1.1,Tr=.01,zr=1e6;function Dr(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:a,sync:l=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:g=!0,showAxes:h=!0,pointRadius:c=3,pointColor:f="#3b82f6",curveColor:p="#3b82f6",gridColor:y="#e2e8f0",axisColor:b="#94a3b8",onPointClick:m,onPointDoubleClick:x,onPointContextMenu:v,onPointHover:D}=e,[T,C]=G(d[0]),[$,A]=G(d[1]),[z,P]=G(u[0]),[B,I]=G(u[1]),N=ne(!1),L=ne(null),M=w(Y=>be+(Y-T)/($-T)*(t-2*be),[T,$,t]),S=w(Y=>n-be-(Y-z)/(B-z)*(n-2*be),[z,B,n]),k=w(Y=>T+(Y-be)/(t-2*be)*($-T),[T,$,t]),E=w(Y=>z+(n-be-Y)/(n-2*be)*(B-z),[z,B,n]),F=w(Y=>{let Z=Y;N.current=!0,L.current={mx:Z.clientX,my:Z.clientY,x0:T,x1:$,y0:z,y1:B}},[T,$,z,B]),R=w(Y=>{if(!N.current||!L.current)return;let Z=Y,Q=L.current,ae=Z.clientX-Q.mx,ee=Z.clientY-Q.my,te=ae/(t-2*be)*(Q.x1-Q.x0),le=ee/(n-2*be)*(Q.y1-Q.y0);C(Q.x0-te),A(Q.x1-te),P(Q.y0+le),I(Q.y1+le)},[t,n]),W=w(()=>{N.current=!1,L.current=null},[]),_=w(Y=>{let Z=Y;Z.preventDefault();let Q=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-Q.left,ee=Z.clientY-Q.top,te=k(ae),le=E(ee),ce=Z.deltaY>0?$r:1/$r,oe=($-T)*ce,ue=(B-z)*ce;if(oe<Tr||ue<Tr||oe>zr||ue>zr)return;let re=(te-T)/($-T),ie=(le-z)/(B-z);C(te-re*oe),A(te+(1-re)*oe),P(le-ie*ue),I(le+(1-ie)*ue)},[T,$,z,B,k,E]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),g){let Y=Pr(T,$),Z=Pr(z,B);for(let Q=0;Q<Y.length;Q++){let ae=M(Y[Q]);O.push(o("line",{x1:ae,y1:be,x2:ae,y2:n-be,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),O.push(o("text",{x:ae,y:n-be+14,"text-anchor":"end","font-size":10,fill:b,transform:`rotate(-45, ${ae}, ${n-be+14})`,key:`lx-${Q}`},Ir(Y[Q])))}for(let Q=0;Q<Z.length;Q++){let ae=S(Z[Q]);O.push(o("line",{x1:be,y1:ae,x2:t-be,y2:ae,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),O.push(o("text",{x:be-6,y:ae+3,"text-anchor":"end","font-size":10,fill:b,key:`ly-${Q}`},Ir(Z[Q])))}}if(h){let Y=Math.max(be,Math.min(t-be,M(0))),Z=Math.max(be,Math.min(n-be,S(0)));O.push(o("line",{x1:be,y1:Z,x2:t-be,y2:Z,stroke:b,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:Y,y1:be,x2:Y,y2:n-be,stroke:b,"stroke-width":1,key:"y-axis"}))}let H=q(()=>{if(!i||!l)return[];let Y=a??($-T)/s,Z=tt({start:T,end:$,step:Y});return Tt(i,Z)},[i,T,$,a,s,l]),[X,J]=G([]),K=ne(null);se(()=>{if(!i||l){J([]);return}let Y=a??($-T)/s,Z=tt({start:T,end:$,step:Y});return K.current&&K.current(),K.current=zt(i,Z,200,Q=>{J([...Q])}),()=>{K.current&&K.current()}},[i,T,$,a,s,l]);let U=l?H:X;if(U.length>0){let Y=[];for(let Z=0;Z<U.length;Z++){let Q=U[Z],ae=M(Q.input),ee=S(Q.output);Y.push(`${Y.length===0?"M":"L"}${ae},${ee}`)}O.push(o("path",{d:Y.join(" "),fill:"none",stroke:p,"stroke-width":1.5,key:"curve"}))}let j=(Y,Z,Q,ae)=>{if(Z)return ee=>Z({x:ae.x,y:ae.y,index:Q,event:ee})};for(let Y=0;Y<r.length;Y++){let Z=r[Y],Q=M(Z.x),ae=S(Z.y),ee={cx:Q,cy:ae,r:c,fill:f,cursor:"pointer",key:`pt-${Y}`};m&&(ee.onClick=j("click",m,Y,Z)),x&&(ee.onDblClick=j("dblclick",x,Y,Z)),v&&(ee.onContextMenu=j("contextmenu",v,Y,Z)),D&&(ee.onMouseOver=j("mouseover",D,Y,Z)),O.push(o("circle",ee))}let V=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:be,y:be,width:t-2*be,height:n-2*be})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:F,onMouseMove:R,onMouseUp:W,onMouseLeave:W,onWheel:_},V,...O)}function Lr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let a=r*r,l=i*i;if(a+l>4)return s;i=2*r*i+t,r=a-l+e}return n}function Ar(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,a=.5,l=(1-Math.abs(2*a-1))*s,d=l*(1-Math.abs(i/60%2-1)),u=a-l/2,g=0,h=0,c=0;return i<60?(g=l,h=d):i<120?(g=d,h=l):i<180?(h=l,c=d):i<240?(h=d,c=l):i<300?(g=d,c=l):(g=l,c=d),[Math.floor((g+u)*255),Math.floor((h+u)*255),Math.floor((c+u)*255)]}function Br(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=Lr){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let g=0;g<e;g++){let h=n[0]+g/e*(n[1]-n[0]);d.push(s(h,u,i))}a.push(d)}return a}function Fr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:a="classic",computeFunction:l=Lr,data:d,resolution:u=2,onPointClick:g,onPointHover:h,onPointDoubleClick:c,onPointContextMenu:f}=e;if(d){let E=d.length,F=E>0?d[0].length:0,R=F>0?t/F:1,W=E>0?n/E:1,_=[];for(let O=0;O<E;O++){let H=d[O];for(let X=0;X<F;X++){let J=H[X]??0,[K,U,j]=Ar(J,s,a);_.push(o("rect",{key:`${O}-${X}`,x:String(X*R),y:String(O*W),width:String(Math.ceil(R)),height:String(Math.ceil(W)),fill:`rgb(${K},${U},${j})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},..._)}let[p,y]=G(r[0]),[b,m]=G(r[1]),[x,v]=G(i[0]),[D,T]=G(i[1]),C=ne(null),$=ne(!1),A=ne(null),z=w((E,F)=>{let R=p+E/t*(b-p),W=D-F/n*(D-x);return{re:R,im:W}},[p,b,x,D,t,n]);se(()=>{let E=C.current;if(!E)return;let F=E.getContext("2d");if(!F)return;let R=F.createImageData(t,n),W=R.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:H,im:X}=z(O,_),J=l(H,X,s),[K,U,j]=Ar(J,s,a),V=(_*t+O)*4;W[V]=K,W[V+1]=U,W[V+2]=j,W[V+3]=255}F.putImageData(R,0,0)},[p,b,x,D,t,n,s,a,l,z]);let P=w(E=>{let F=E.target.getBoundingClientRect(),R=E.clientX-F.left,W=E.clientY-F.top,{re:_,im:O}=z(R,W),H=l(_,O,s);return{re:_,im:O,iterations:H,event:E}},[z,l,s]),B=w(E=>{$.current=!0,A.current={x:E.clientX,y:E.clientY,rMin:p,rMax:b,iMin:x,iMax:D}},[p,b,x,D]),I=w(E=>{if(h&&h(P(E)),!$.current||!A.current)return;let F=A.current,R=E.clientX-F.x,W=E.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-R*_),m(F.rMax-R*_),v(F.iMin+W*O),T(F.iMax+W*O)},[t,n,h,P]),N=w(()=>{$.current=!1},[]),L=w(E=>{E.preventDefault();let F=E.deltaY>0?1.15:1/1.15,R=E.target.getBoundingClientRect(),W=E.clientX-R.left,_=E.clientY-R.top,{re:O,im:H}=z(W,_);y(O+(p-O)*F),m(O+(b-O)*F),v(H+(x-H)*F),T(H+(D-H)*F)},[z,p,b,x,D]),M=w(E=>{g&&g(P(E))},[g,P]),S=w(E=>{c&&c(P(E))},[c,P]),k=w(E=>{E.preventDefault(),f&&f(P(E))},[f,P]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:I,onMouseUp:N,onMouseLeave:N,onWheel:L,onClick:M,onDblClick:S,onContextMenu:k})}function Nr(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let a=e+r*s;i.push(Math.round(a*1e10)/1e10)}return i}function hl(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,a=1/0,l=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<a&&(a=y.y),y.y>l&&(l=y.y);i===s&&(i-=1,s+=1),a===l&&(a-=1,l+=1);let d=t-r*2,u=n-r*2,g=y=>r+(y-i)/(s-i)*d,h=y=>n-r-(y-a)/(l-a)*u,c=6,f=Nr(i,s,c),p=Nr(a,l,c);return{xScale:g,yScale:h,xTicks:f,yTicks:p,xMin:i,xMax:s,yMin:a,yMax:l}}function dn(e,t,n,r){return q(()=>hl(e,t,n,r),[e,t,n,r])}function Wr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function _r(e,t,n,r,i,s,a){let l={fill:i,key:s,...a};switch(e){case"square":return o("rect",{...l,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...l,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...l,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...l,points:u})}case"cross":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...l,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...l,cx:t,cy:n,r})}}function Or(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:a=4,pointColor:l="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:g=!0,showArea:h=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:f,yLabel:p,title:y,padding:b=50,animate:m=!1,multiLine:x}=e,v=q(()=>{let B=[...t];if(x)for(let I of x)B.push(...I.data);return B},[t,x]),D=dn(v,n,r,b),{xScale:T,yScale:C,xTicks:$,yTicks:A}=D,z=[];if(z.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),g){for(let B=0;B<$.length;B++){let I=T($[B]);z.push(o("line",{x1:I,y1:b,x2:I,y2:r-b,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<A.length;B++){let I=C(A[B]);z.push(o("line",{x1:b,y1:I,x2:n-b,y2:I,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}z.push(o("line",{x1:b,y1:r-b,x2:n-b,y2:r-b,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(o("line",{x1:b,y1:b,x2:b,y2:r-b,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<$.length;B++){let I=T($[B]);z.push(o("line",{x1:I,y1:r-b,x2:I,y2:r-b+5,stroke:"#374151",key:`xtick-${B}`})),z.push(o("text",{x:I,y:r-b+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${I}, ${r-b+18})`,key:`xlabel-${B}`},Wr($[B])))}for(let B=0;B<A.length;B++){let I=C(A[B]);z.push(o("line",{x1:b-5,y1:I,x2:b,y2:I,stroke:"#374151",key:`ytick-${B}`})),z.push(o("text",{x:b-10,y:I+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},Wr(A[B])))}function P(B,I,N,L,M,S,k,E,F,R){if(B.length===0)return;let W=[...B].sort((H,X)=>H.x-X.x);if(L){let H=C(D.yMin),X=W.map(j=>`${T(j.x)},${C(j.y)}`).join(" "),J=T(W[0].x),K=T(W[W.length-1].x),U=`${J},${H} ${X} ${K},${H}`;z.push(o("polygon",{points:U,fill:M,key:`${R}-area`}))}let O={points:W.map(H=>`${T(H.x)},${C(H.y)}`).join(" "),fill:"none",stroke:I,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${R}-line`};if(m?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",z.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(o("polyline",O)),S)for(let H=0;H<W.length;H++){let X=T(W[H].x),J=C(W[H].y),K=W[H].shape??F,U=W[H].radius??E,j=`${R}-pt-${H}`;if(m){let V=_r(K,X,J,U,k,j,{opacity:0});z.push(o("g",{key:`${j}-g`},V,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(_r(K,X,J,U,k,j))}}if(P(t,i,s,h,c,u,l,a,d,"primary"),x)for(let B=0;B<x.length;B++){let I=x[B];P(I.data,I.color,s,!1,"transparent",u,I.color,I.pointRadius??a,I.pointShape??d,`series-${B}`)}if(x&&x.length>0){let B=[],I=[{color:i,label:"Primary"},...x.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=b+10,L=16,M=22,S=7.2,k=14,E=6,F=n-b*2-20,R=0,W=0;for(let _=0;_<I.length;_++){let O=I[_].label.length*S,H=k+E+O;R>0&&R+H>F&&(R=0,W+=M);let X=N+R,J=b-30-W;B.push(o("rect",{x:X,y:J,width:k,height:14,fill:I[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:X+k+E,y:J+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},I[_].label)),R+=H+L}z.push(o("g",{key:"legend"},...B))}return f&&z.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},f)),p&&z.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},p)),y&&z.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)}function bl(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function xl(e,t){let n=t??bl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function nt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function un(e,t,n,r,i,s){let a=i-Math.PI/2,l=s-Math.PI/2,d=nt(e,t,r,a),u=nt(e,t,r,l),g=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${g} 1 ${u.x} ${u.y}`,"Z"].join(" ");let h=nt(e,t,n,l),c=nt(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${g} 1 ${u.x} ${u.y}`,`L ${h.x} ${h.y}`,`A ${n} ${n} 0 ${g} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function pn(e,t){let n=t?.padAngle??0,r=xl(e,t?.colors),i=e.reduce((u,g)=>u+g.value,0);if(i<=0)return[];let s=n*e.length,a=Math.PI*2-s,l=[],d=0;for(let u=0;u<e.length;u++){let g=e[u],h=g.value/i*a,c=d+n/2,f=c+h;l.push({label:g.label,value:g.value,startAngle:c,endAngle:f,percentage:g.value/i*100,color:r[u]}),d=f+n/2}return l}function Hr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:a=!0,showValues:l=!0,showLegend:d=!0,legendPosition:u="right",title:g,centerLabel:h,colors:c,strokeColor:f="#fff",strokeWidth:p=2,textColor:y="currentColor"}=e,b=d&&u==="right"?140:0,m=g?30:0,x=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,v=n-b,D=r-m-x,T=v/2,C=m+D/2,$=Math.min(v,D)/2-10,A=e.outerRadius??$,z=q(()=>pn(t,{padAngle:s,colors:c}),[t,s,c]),P=[];g&&P.push(o("text",{key:"title",x:v/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},g));for(let B=0;B<z.length;B++){let I=z[B],N=un(T,C,i,A,I.startAngle,I.endAngle);if(P.push(o("path",{key:`slice-${B}`,d:N,fill:I.color,stroke:f,strokeWidth:p})),a||l){let L=(I.startAngle+I.endAngle)/2,M=I.percentage<5,S=M?A+14:i+(A-i)*.65,k=nt(T,C,S,L-Math.PI/2),E=M?y:"#fff",F=M?11:12,R=[];if(a&&R.push(I.label),l&&R.push(`${I.percentage.toFixed(1)}%`),M){let W=nt(T,C,A+2,L-Math.PI/2);P.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:k.x,y2:k.y,stroke:"#999",strokeWidth:1}))}a&&P.push(o("text",{key:`label-${B}`,x:k.x,y:k.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:E,pointerEvents:"none"},I.label)),l&&P.push(o("text",{key:`value-${B}`,x:k.x,y:k.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:E,pointerEvents:"none"},`${I.percentage.toFixed(1)}%`))}}if(h&&i>0&&P.push(o("text",{key:"center-label",x:T,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},h)),d){let B=[];if(u==="right"){let I=v+10,N=m+20;for(let L=0;L<z.length;L++){let M=z[L],S=N+L*22;B.push(o("circle",{key:`legend-dot-${L}`,cx:I+6,cy:S,r:6,fill:M.color})),B.push(o("text",{key:`legend-text-${L}`,x:I+18,y:S,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${M.label} (${M.percentage.toFixed(1)}%)`))}}else{let I=r-x+10;for(let N=0;N<z.length;N++){let L=z[N],M=N%2,S=Math.floor(N/2),k=M*(n/2)+10,E=I+S*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:k+6,cy:E,r:6,fill:L.color})),B.push(o("text",{key:`legend-text-${N}`,x:k+18,y:E,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${L.label} (${L.percentage.toFixed(1)}%)`))}}P.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function Yr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function Vr(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:a,sync:l=!1,points:d=[],showGrid:u=!0,pointRadius:g=3,pointColor:h="#3b82f6",curveColor:c="#3b82f6",onPointClick:f,onPointDoubleClick:p,onPointContextMenu:y,onPointHover:b}=e,[m,x]=G(r[1]),[v,D]=G(0),[T,C]=G(0),[$,A]=G(null),z=t/2+v,P=n/2+T,I=Math.min(t,n)/2-30,N=I/m,L=q(()=>{let U=Math.max(1,Math.ceil(m)),j=[],V=m/U;for(let Y=1;Y<=U;Y++)j.push(V*Y);return j},[m]),M=q(()=>{let U=[];for(let j=0;j<360;j+=30)U.push(j*Math.PI/180);return U},[]),S=q(()=>{if(!i||!l)return[];let U=a??2*Math.PI/s,j=tt({start:0,end:2*Math.PI,step:U});return Tt(i,j)},[i,s,a,l]),[k,E]=G([]),F=ne(null);se(()=>{if(!i||l){E([]);return}let U=a??2*Math.PI/s,j=tt({start:0,end:2*Math.PI,step:U});return F.current&&F.current(),F.current=zt(i,j,200,V=>{E([...V])}),()=>{F.current&&F.current()}},[i,s,a,l]);let R=l?S:k,W=q(()=>{if(R.length===0)return"";let U=[];for(let j=0;j<R.length;j++){let V=R[j],Y=V.output;if(Y<0||!isFinite(Y))continue;let{x:Z,y:Q}=Yr(Y,V.input,z,P,N);U.push(`${U.length===0?"M":"L"}${Z.toFixed(2)},${Q.toFixed(2)}`)}return U.join(" ")},[R,z,P,N]),_=w(U=>{A({x:U.clientX,y:U.clientY,px:v,py:T})},[v,T]),O=w(U=>{$&&(D($.px+(U.clientX-$.x)),C($.py+(U.clientY-$.y)))},[$]),H=w(()=>{A(null)},[]),X=w(U=>{U.preventDefault();let j=U.deltaY>0?1.15:1/1.15;x(Math.max(.1,m*j))},[m]),J=w((U,j,V)=>{if(U)return Y=>U({r:j.r,theta:j.theta,index:V,event:Y})},[]),K=[];if(K.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let U=0;U<L.length;U++){let j=L[U]*N;K.push(o("circle",{cx:z,cy:P,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${U}`})),K.push(o("text",{x:z+j+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${U}`},L[U].toFixed(1)))}for(let U=0;U<M.length;U++){let j=M[U],V=L[L.length-1]*N,Y=z+V*Math.cos(j),Z=P-V*Math.sin(j);K.push(o("line",{x1:z,y1:P,x2:Y,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${U}`}));let Q=Math.round(j*180/Math.PI),ae=z+(V+14)*Math.cos(j),ee=P-(V+14)*Math.sin(j);K.push(o("text",{x:ae,y:ee+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${U}`},`${Q}\xB0`))}}K.push(o("line",{x1:z-I,y1:P,x2:z+I,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),K.push(o("line",{x1:z,y1:P-I,x2:z,y2:P+I,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&K.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let U=0;U<d.length;U++){let j=d[U],{x:V,y:Y}=Yr(j.r,j.theta,z,P,N);K.push(o("circle",{cx:V,cy:Y,r:g,fill:h,key:`pt-${U}`,style:{cursor:"pointer"},onClick:J(f,j,U),onDblClick:J(p,j,U),onContextMenu:J(y,j,U),onMouseEnter:J(b,j,U)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:$?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:H,onMouseLeave:H,onWheel:X},...K)}function fn(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function mn(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function gn(e,t){let n=Ur(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let a=t[r];n=Sl(n,yl(e,i,s,a))}r++}return n}function Ur(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function yl(e,t,n,r){let i=Ur(e),s=Math.cos(r),a=Math.sin(r);return i[t][t]=s,i[t][n]=-a,i[n][t]=a,i[n][n]=s,i}function Sl(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=0;l<n;l++)s[a]+=e[i][l]*t[l][a];r.push(s)}return r}function hn(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function bn(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function dt(e,t=[],n=.3,r=1){let i=fn(e),s=mn(e),a=gn(e,t);return{vertices:i.map((d,u)=>{let g=hn(a,d),h=bn(g,n);return{id:u,position:d,x:h.x*r,y:h.y*r,depth:h.depth}}),edges:s,dimension:e}}function ut(e){return e*(e-1)/2}function Dt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function jr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,a=e.edgeColor??"#111",l=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,g=e.backgroundColor??"transparent",h=e.scale??Math.min(n,r)*.3,c=ut(t),f=1<<t,p=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Dt(f):e.vertexColors,[f,e.vertexColors]),[y,b]=G(()=>{let E=[];for(let F=0;F<c;F++)E.push(0);return E}),[m,x]=G(!1),v=ne({x:0,y:0}),D=ne([]),T=ne(0);se(()=>{if(d===0)return;let E=!0,F=()=>{E&&(b(R=>{let W=R.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),T.current=requestAnimationFrame(F))};return T.current=requestAnimationFrame(F),()=>{E=!1,cancelAnimationFrame(T.current)}},[d]);let C=q(()=>dt(t,y,l,h),[t,y,l,h]),$=n/2,A=r/2,z=q(()=>C.edges.map(E=>{let F=C.vertices[E.source],R=C.vertices[E.target],W=(F.depth+R.depth)/2;return{...E,avgDepth:W,sv:F,tv:R}}).sort((E,F)=>E.avgDepth-F.avgDepth),[C]),P=q(()=>C.vertices.slice().sort((E,F)=>E.depth-F.depth),[C]),B=w(E=>{let F=E;x(!0),v.current={x:F.clientX,y:F.clientY},D.current=y.slice()},[y]),I=w(E=>{if(!m)return;let F=E,R=(F.clientX-v.current.x)*.01,W=(F.clientY-v.current.y)*.01;b(()=>{let _=D.current.slice();return _.length>0&&(_[0]=(_[0]??0)+R),_.length>1&&(_[1]=(_[1]??0)+W),_})},[m]),N=w(()=>{x(!1)},[]),L=E=>{let F=(E+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},M=E=>{let F=(E+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},S=z.map((E,F)=>{let R=L(E.avgDepth);return o("line",{key:`e-${E.source}-${E.target}`,x1:String($+E.sv.x),y1:String(A+E.sv.y),x2:String($+E.tv.x),y2:String(A+E.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(R),"stroke-linecap":"round"})}),k=P.map(E=>{let F=i*M(E.depth),R=p[E.id%p.length]??"#3b82f6",W=[o("circle",{key:`v-${E.id}-circle`,cx:String($+E.x),cy:String(A+E.y),r:String(F),fill:R,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&W.push(o("text",{key:`v-${E.id}-label`,x:String($+E.x),y:String(A+E.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},E.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:g,cursor:m?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:I,onMouseUp:N,onMouseLeave:N},...S,...k.flat())}function Gr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=ut(t),[a,l]=G(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let u=!0,g=0,h=()=>{u&&(l(c=>c.map((f,p)=>f+n*(1+p*.3))),g=requestAnimationFrame(h))};return g=requestAnimationFrame(h),()=>{u=!1,cancelAnimationFrame(g)}},[n]),{data:q(()=>dt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Xr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",a=e.contain??"layout style paint",l={display:"flex",flexDirection:vl(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?kl(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,g=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),h=wl(d,g,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...h)}function vl(e,t){return"column"}function wl(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let a=[];i==="left"&&n&&a.push(n),r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),i==="right"&&n&&a.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let a=[];r==="left"&&e&&a.push(e),a.push(t),r==="right"&&e&&a.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function kl(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},Cl(n),o("span",null,n.label))))}function Cl(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function Ml(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function El(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function qr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;Ml(t),El();let a={...s};return i&&(a.anonymize_ip=!0),r&&(a.debug_mode=!0),window.gtag&&window.gtag("config",t,a),()=>{let l=document.getElementById("specifyjs-gtag");l&&l.remove()}},[t,n,r,i]),null}function Kr(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:l="13px",padding:d="24px",maxWidth:u="1200px",className:g,ariaLabel:h="Site footer"}=e;return o("footer",{className:g,role:"contentinfo","aria-label":h,style:{borderTop:i,background:s,color:a,fontSize:l,padding:d,marginTop:"48px"}},o("div",{className:"footer-inner",style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{className:"footer-section",style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{className:"footer-section",style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Qr=$e({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),Rl={width:600,height:400},Pl={x:30,y:30},Il={top:0,left:0,width:1920,height:1080},xn=1e3;function Zr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,a=n.left+n.width-r.width,l=n.top+n.height-r.height;return a>n.left&&i>a&&(i=n.left+(i-n.left)%Math.max(1,a-n.left)),l>n.top&&s>l&&(s=n.top+(s-n.top)%Math.max(1,l-n.top)),{x:i,y:s}}function yn(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function Jr(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function Sn(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function vn(e){let t=e.workspaceBounds??Il,n=e.defaultWindowSize??Rl,r=e.cascadeOffset??Pl,[i,s]=G([]),a=w(((...B)=>{let I=B[0];s(N=>{if(N.find(W=>W.id===I.id)){let _=Sn(N)+1,O=N.map(H=>H.id===I.id?{...H,focused:!0,zIndex:_,windowState:H.windowState==="minimized"?"normal":H.windowState}:{...H,focused:!1});return _>xn&&(O=yn(O)),O}let M=I.size??n,S=I.position??Zr(N.length,r,t,M),E=Sn(N)+1,F={id:I.id,title:I.title,icon:I.icon,position:S,size:M,windowState:"normal",zIndex:E,focused:!0,appProps:I.appProps},R=N.map(W=>({...W,focused:!1}));return R.push(F),E>xn&&(R=yn(R)),e.onWindowOpen&&e.onWindowOpen(I.id),e.onFocusChange&&e.onFocusChange(I.id),R})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=w(((...B)=>{let I=B[0];v(N=>{if(N[I]){let L={...N};return delete L[I],L}return N}),T(N=>{if(N.has(I)){let L=new Map(N);return L.delete(I),L}return N}),s(N=>{let L=N.find(S=>S.id===I);if(!L)return N;let M=N.filter(S=>S.id!==I);if(L.focused&&M.length>0){let S=Jr(M,I);if(S){let k=M.map(E=>({...E,focused:E.id===S.id}));return e.onWindowClose&&e.onWindowClose(I),e.onFocusChange&&e.onFocusChange(S.id),k}}return e.onWindowClose&&e.onWindowClose(I),M.length===0&&e.onFocusChange&&e.onFocusChange(null),M})}),[e.onWindowClose,e.onFocusChange]),d=w(((...B)=>{let I=B[0];s(N=>{if(!N.find(E=>E.id===I))return N;let S=Sn(N)+1,k=N.map(E=>E.id===I?{...E,focused:!0,zIndex:S}:{...E,focused:!1});return S>xn&&(k=yn(k)),e.onFocusChange&&e.onFocusChange(I),k})}),[e.onFocusChange]),u=w(((...B)=>{let I=B[0];s(N=>{let L=N.find(S=>S.id===I);if(!L)return N;let M=N.map(S=>S.id===I?{...S,windowState:"minimized",focused:!1}:S);if(L.focused){let S=Jr(M,I);S?(M=M.map(k=>({...k,focused:k.id===S.id})),e.onFocusChange&&e.onFocusChange(S.id)):e.onFocusChange&&e.onFocusChange(null)}return M})}),[e.onFocusChange]),g=w(((...B)=>{let I=B[0];s(N=>N.map(L=>L.id===I?{...L,windowState:"maximized"}:L))}),[]),h=w(((...B)=>{let I=B[0];s(N=>N.map(L=>L.id===I?{...L,windowState:"normal"}:L))}),[]),c=w(((...B)=>{let I=B[0],N=B[1];s(L=>L.map(M=>M.id===I?{...M,position:N}:M))}),[]),f=w(((...B)=>{let I=B[0],N=B[1];s(L=>L.map(M=>M.id===I?{...M,size:N}:M))}),[]),p=w(((...B)=>{s(I=>{let N=I.filter(S=>S.windowState!=="minimized");if(N.length===0)return I;let L=N.length,M=new Map;if(L===1)M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(L===2){let S=Math.floor(t.width/2);M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:S,height:t.height}}),M.set(N[1].id,{position:{x:t.left+S,y:t.top},size:{width:t.width-S,height:t.height}})}else if(L===3){let S=Math.floor(t.width/2),k=Math.floor(t.height/2);M.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:S,height:t.height}}),M.set(N[1].id,{position:{x:t.left+S,y:t.top},size:{width:t.width-S,height:k}}),M.set(N[2].id,{position:{x:t.left+S,y:t.top+k},size:{width:t.width-S,height:t.height-k}})}else{let S=Math.ceil(Math.sqrt(L)),k=Math.ceil(L/S),E=Math.floor(t.width/S),F=Math.floor(t.height/k);for(let R=0;R<N.length;R++){let W=Math.floor(R/S),_=R%S;M.set(N[R].id,{position:{x:t.left+_*E,y:t.top+W*F},size:{width:E,height:F}})}}return I.map(S=>{let k=M.get(S.id);return k?{...S,position:k.position,size:k.size,windowState:"normal"}:S})})}),[t]),y=w(((...B)=>{s(I=>{let N=I.filter(S=>S.windowState!=="minimized");if(N.length===0)return I;let L=[...N].sort((S,k)=>S.zIndex-k.zIndex),M=new Map;for(let S=0;S<L.length;S++){let k=Zr(S,r,t,L[S].size);M.set(L[S].id,{position:k,zIndex:S+1})}return I.map(S=>{let k=M.get(S.id);return k?{...S,position:k.position,zIndex:k.zIndex,windowState:"normal"}:S})})}),[r,t]),b=w(((...B)=>{s(I=>{let N=I.map(L=>({...L,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),m=q(()=>{let B=i.find(I=>I.focused);return B?B.id:null},[i]),[x,v]=G({}),[D,T]=G(new Map),C=w(((...B)=>{let I=B[0],N=B[1];v(L=>({...L,[I]:N}))}),[]),$=w(((...B)=>{let I=B[0];v(N=>{let L={...N};return delete L[I],L})}),[]),A=q(()=>m&&x[m]?x[m]:null,[m,x]),z=w(((...B)=>{let I=B[0],N=B[1];T(L=>{let M=new Map(L),S=M.get(I);return M.set(I,{...S,...N}),M})}),[]),P=q(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:g,restoreWindow:h,moveWindow:c,resizeWindow:f,tileWindows:p,cascadeWindows:y,minimizeAll:b,focusedWindowId:m,setMenuBar:C,clearMenuBar:$,activeMenuBar:A,signalDock:z,dockSignals:D}),[i,a,l,d,u,g,h,c,f,p,y,b,m,C,$,A,z,D]);return o(Qr.Provider,{value:P},e.children)}function pt(){return Re(Qr)}var ei=$e({appId:""});function _e(e){let t=q(()=>({appId:e.appId}),[e.appId]);return o(ei.Provider,{value:t},e.children)}function ot(){return Re(ei).appId}var ti=$e({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function ft(e){let t=ne([]),n=ne([]),r=w(((...l)=>{let d=l[0],u=l[1],g=l[2],h=l[3]||"",c={channel:d,from:h,to:g||null,payload:u,timestamp:Date.now()},f=t.current;for(let y=0;y<f.length;y++){let b=f[y];b.channel===d&&(c.to&&b.appId!==c.to||!c.to&&b.appId===h||b.handler(c))}let p=n.current;for(let y=0;y<p.length;y++)p[y].handler(c)}),[]),i=w(((...l)=>{let d=l[0],u=l[1],g=l[2]||"",h={channel:d,handler:u,appId:g};return t.current=[...t.current,h],()=>{t.current=t.current.filter(c=>c!==h)}}),[]),s=w(((...l)=>{let u={handler:l[0]};return n.current=[...n.current,u],()=>{n.current=n.current.filter(g=>g!==u)}}),[]),a=q(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(ti.Provider,{value:a},e.children)}function Oe(){let e=Re(ti),t=ot(),n=w(((...i)=>{let s=i[0],a=i[1],l=i[2];e.publish(s,a,l,t)}),[e.publish,t]),r=w(((...i)=>{let s=i[0],a=i[1];return e.subscribe(s,a,t)}),[e.subscribe,t]);return q(()=>({publish:n,subscribe:r,subscribeAll:e.subscribeAll}),[n,r,e.subscribeAll])}function mt(e,t){let n=Oe(),r=ne(t);r.current=t,se(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var ni=$e({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function gt(e){let[t,n]=G(null),[r,i]=G({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=w(((...f)=>{let p=f[0];n(p)}),[]),u=w(((...f)=>{if(a.current){let p=s.current.get(a.current);p&&p.onDragLeave&&p.onDragLeave(),a.current=null}n(null)}),[]),g=w(((...f)=>{let p=f[0],y=f[1];return s.current=new Map(s.current),s.current.set(p,y),()=>{s.current=new Map(s.current),s.current.delete(p),a.current===p&&(a.current=null)}}),[]);se(()=>{if(!l)return;let f=b=>{let m=b;i({x:m.clientX,y:m.clientY});let x=document.elementFromPoint(m.clientX,m.clientY);if(!x)return;let v=null,D=s.current;D.forEach((C,$)=>{let A=document.querySelector(`[data-dropzone-id="${$}"]`);A&&A.contains(x)&&(v=$)});let T=a.current;if(v!==T){if(T){let C=D.get(T);C&&C.onDragLeave&&C.onDragLeave()}if(v){let C=D.get(v);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=v}},p=b=>{let m=a.current;if(m&&t){let x=s.current.get(m);x&&x.acceptTypes.indexOf(t.type)!==-1&&x.onDrop(t)}a.current=null,n(null)},y=b=>{b.key==="Escape"&&u()};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",p),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",p),document.removeEventListener("keydown",y)}},[l,t,u]);let h=q(()=>({startDrag:d,cancelDrag:u,registerDropZone:g,currentDrag:t,isDragging:l}),[d,u,g,t,l]),c=l?o("div",{className:"drag-drop-preview",style:{position:"fixed",left:`${r.x+12}px`,top:`${r.y+12}px`,pointerEvents:"none",zIndex:"10000",opacity:"0.8",padding:"6px 10px",backgroundColor:"rgba(50, 50, 50, 0.9)",color:"#ffffff",borderRadius:"4px",fontSize:"12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",whiteSpace:"nowrap"}},t&&t.preview?String(t.preview):`Dragging ${t?t.type:""}`):null;return o(ni.Provider,{value:h},e.children,c)}function Xe(){return Re(ni)}function wn(e,t){let n=Xe(),r=ot(),i=ne(t);i.current=t;let s=w(l=>{l.preventDefault(),n.startDrag({type:e,data:i.current,sourceAppId:r||""})},[n,e,r]),a=n.isDragging&&n.currentDrag!==null&&n.currentDrag.type===e;return q(()=>({onMouseDown:s,isDragging:a}),[s,a])}function ht(e){let t=Xe(),[n,r]=G(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,se(()=>t.registerDropZone(i.current,{acceptTypes:s.current.acceptTypes,onDragEnter:d=>{r(!0),s.current.onDragEnter&&s.current.onDragEnter(d)},onDragLeave:()=>{r(!1),s.current.onDragLeave&&s.current.onDragLeave()},onDrop:d=>{r(!1),s.current.onDrop(d)}}),[t]);let a=t.isDragging&&t.currentDrag!==null&&e.acceptTypes.indexOf(t.currentDrag.type)!==-1;return q(()=>({isOver:n,canDrop:a,zoneId:i.current}),[n,a])}var $l=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Tl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function kn(e){return e<10?"0"+String(e):String(e)}function zl(e,t,n){let r=e.getHours(),i=kn(e.getMinutes()),s=kn(e.getSeconds());if(t==="12h"){let l=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${l}`}let a=kn(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function Dl(e){let t=$l[e.getDay()],n=Tl[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Al(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se(),a=w(()=>{n()},[n]),l=w(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Ll(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=G(new Date);se(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=q(()=>zl(i,t,n),[i,t,n]),l=q(()=>Dl(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},l):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},a))}function Bl(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Se(),s=w(()=>{t.onClick&&t.onClick()},[t]),a=w(l=>{let d=l;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Fl(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let a=w(()=>{t.onClick(),n()},[t,n]),l=w(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:a,onKeyDown:l,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function Nl(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Se(),[a,l]=G(!1),d=ne(null),u=w(()=>{l(b=>!b)},[]),g=w(()=>{l(!1)},[]),h=w(b=>{let m=b;(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(x=>!x)),m.key==="Escape"&&l(!1)},[]);se(()=>{if(!a)return;let b=m=>{let x=d.current;x&&!x.contains(m.target)&&l(!1)};return document.addEventListener("click",b,!0),()=>{document.removeEventListener("click",b,!0)}},[a]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},f=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),p=o("span",{style:c,"aria-hidden":"true"},f),y=a&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((b,m)=>o(Fl,{key:String(m),item:b,onClose:g}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(a),tabIndex:0,onClick:u,onKeyDown:h,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||a?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},p,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Wl(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Se(),[s,a]=G(!1),l=ne(null),d=w(()=>{a(c=>!c)},[]),u=w(()=>{a(!1)},[]),g=w(c=>{let f=c;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(p=>!p)),f.key==="Escape"&&a(!1)},[]);se(()=>{if(!s)return;let c=f=>{let p=l.current;p&&!p.contains(f.target)&&a(!1)};return document.addEventListener("click",c,!0),()=>{document.removeEventListener("click",c,!0)}},[s]);let h=s&&t.items.length>0?o("div",{role:"menu","aria-label":t.label+" menu",style:{position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...t.items.map((c,f)=>c.divider?o("div",{key:"div-"+String(f),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(f),type:"button",role:"menuitem",tabIndex:-1,disabled:c.disabled??!1,onClick:()=>{c.onClick&&c.onClick(),u()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:"transparent",color:c.disabled?"rgba(255,255,255,0.4)":"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:c.disabled?"default":"pointer",boxSizing:"border-box"}},o("span",null,c.checked?"\u2713 ":"",c.label||""),c.shortcut?o("span",{style:{fontSize:"11px",opacity:"0.6",marginLeft:"16px"}},c.shortcut):null))):null;return o("div",{ref:l,className:"system-tray__app-menu",style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(s),tabIndex:0,onClick:d,onKeyDown:g,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",padding:"0 10px",height:"100%",border:"none",outline:"none",backgroundColor:n||s?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"500",cursor:"pointer",transition:"background-color 0.15s"}},t.label),h)}function Cn(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:g=28,children:h}=e,c=String(g)+"px",f=[];if(n&&f.push(o(Al,{key:"activities",label:n.label,onClick:n.onClick})),t&&f.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t)),r&&r.menus.length>0)for(let v=0;v<r.menus.length;v++)f.push(o(Wl,{key:"appmenu-"+String(v),menu:r.menus[v]}));let p=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...f),y=[];y.push(o(Ll,{key:"clock",format:i,showSeconds:s,showDate:a})),h&&y.push(h);let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),m=[];if(l&&l.length>0){let v=l.map(D=>o(Bl,{key:D.id,indicator:D}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...v))}d&&m.push(o(Nl,{key:"user",user:d,menuItems:u}));let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:c,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},p,b,x)}function _l(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var oi=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Ol(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return oi[Math.abs(t)%oi.length]}function Hl(e){return e>99?"99+":String(e)}function Yl(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Vl(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function Ul(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function jl(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=G(!1),u=t.disabled??!1,g=w(()=>{u||d(!0)},[u]),h=w(()=>{d(!1)},[]),c=w(()=>{!u&&s&&s(t.id)},[u,s,t.id]),f=w(T=>{if(!u&&a){let C=T;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),p=`${n}px`,y=_l(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:p,height:p,objectFit:"contain",display:"block"}}):o("span",{style:{width:p,height:p,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Ol(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),b=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Hl(t.badge)):null,m=t.active?o("span",{style:{...Ul(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,x=t.progress!=null&&t.progress>0?o("div",{style:{position:"absolute",bottom:"2px",left:"6px",right:"6px",height:"3px",backgroundColor:"rgba(255,255,255,0.2)",borderRadius:"2px",overflow:"hidden",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},o("div",{style:{width:`${Math.min(1,Math.max(0,t.progress))*100}%`,height:"100%",backgroundColor:"var(--dock-progress-color, #3b82f6)",borderRadius:"2px",transition:"width 200ms ease"}})):null,v=l?o("div",{role:"tooltip",style:{position:"absolute",...Vl(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,D={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...l&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{},...t.urgent&&!u?{animation:"dock-urgent-pulse 0.6s ease-in-out infinite alternate"}:{}};return o("button",{type:"button",role:"button",style:D,"aria-label":Yl(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:f,onMouseEnter:g,onMouseLeave:h,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,b,m,x,v)}function Mn(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:a=!1,onItemClick:l,onItemContextMenu:d,children:u}=e,[g,h]=G(!s),c=ne(null),f=w(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),h(!0))},[s]),p=w(()=>{s&&(c.current=setTimeout(()=>{h(!1)},300))},[s]),y=w(D=>{let T=D,C=T.target,$=C.closest('[role="toolbar"]');if(!$)return;let A=Array.from($.querySelectorAll("button[data-dock-item-id]")),z=A.indexOf(C);if(z<0)return;let P=n==="vertical",B=P?"ArrowDown":"ArrowRight",I=P?"ArrowUp":"ArrowLeft";if(T.key===B){T.preventDefault();let N=A[z+1];N&&N.focus()}else if(T.key===I){T.preventDefault();let N=A[z-1];N&&N.focus()}else T.key==="Home"?(T.preventDefault(),A[0]?.focus()):T.key==="End"?(T.preventDefault(),A[A.length-1]?.focus()):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),C.click())},[n]),b=n==="vertical",m={display:"flex",flexDirection:b?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!g&&(r==="left"?(m.transform="translateX(-100%)",m.opacity="0"):r==="right"?(m.transform="translateX(100%)",m.opacity="0"):r==="top"?(m.transform="translateY(-100%)",m.opacity="0"):r==="bottom"&&(m.transform="translateY(100%)",m.opacity="0"));let x=[];for(let D=0;D<t.length;D++){if(a&&D===t.length-1&&t.length>1){let T=b?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};x.push(o("div",{key:`sep-${D}`,style:T,"aria-hidden":"true",role:"separator"}))}x.push(o(jl,{key:t[D].id,item:t[D],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let v=s&&!g?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:m,onMouseEnter:f,onMouseLeave:p,onKeyDown:y},v,...x,u??null)}var Gl="#2c001e";function En(e){let{backgroundColor:t=Gl,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,g=w(m=>{let x=m;x.target===x.currentTarget&&a&&a()},[a]),h=w(m=>{let x=m;x.target===x.currentTarget&&l&&l()},[l]),c=q(()=>{let m={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return m.backgroundColor=t,n&&(m.background=n),r&&i>=1&&(m.backgroundImage=`url(${r})`,m.backgroundSize="cover",m.backgroundPosition="center"),m},[t,n,r,i]),f=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),p={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];f&&y.push(o("div",{className:"desktop-background__image-overlay",style:f,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:p},u));let b=o("div",{className:"desktop-background",style:c,onClick:g,onDblClick:h,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o($t,{items:s},b):b}var Xl={width:200,height:150},ql={x:50,y:50},Kl={width:400,height:300},ve=8,Rn=20,Zl={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function bt(e){let{id:t,title:n,icon:r,defaultPosition:i=ql,defaultSize:s=Kl,minSize:a=Xl,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:g="normal",focused:h=!0,zIndex:c,onClose:f,onMinimize:p,onMaximize:y,onFocus:b,onMove:m,onResize:x,children:v}=e,[D,T]=G(i.x),[C,$]=G(i.y),[A,z]=G(s.width),[P,B]=G(s.height),[I,N]=G(!1),[L,M]=G(!1),[S,k]=G(null),E=ne(null),F=ne(null),R=ne(null),W=w((oe,ue)=>{let re=Math.max(oe,a.width),ie=Math.max(ue,a.height);return l&&(re=Math.min(re,l.width),ie=Math.min(ie,l.height)),{width:re,height:ie}},[a,l]),_=w(()=>{let oe=R.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=w((oe,ue,re,ie)=>{let de=_(),pe=Math.max(0,Math.min(oe,de.width-re)),me=Math.max(0,Math.min(ue,de.height-ie));return{x:pe,y:me}},[_]),H=w(oe=>{if(!u||g==="maximized")return;let ue=oe;ue.target.closest("button")||(ue.preventDefault(),E.current={startMouseX:ue.clientX,startMouseY:ue.clientY,startPosX:D,startPosY:C},N(!0))},[u,g,D,C]),X=w(oe=>{oe.target.closest("button")||y&&y()},[y]);se(()=>{if(!I)return;let oe=re=>{let ie=re,de=E.current;if(!de)return;let pe=ie.clientX-de.startMouseX,me=ie.clientY-de.startMouseY,he=de.startPosX+pe,fe=de.startPosY+me,ye=_();he=Math.max(0,Math.min(he,ye.width-A)),fe=Math.max(0,Math.min(fe,ye.height-P)),T(he),$(fe),ie.clientX<=Rn?k("left"):ie.clientX>=ye.width-Rn?k("right"):ie.clientY<=Rn?k("top"):k(null)},ue=re=>{let ie=re;N(!1);let de=_();if(S==="left"){T(0),$(0),z(Math.floor(de.width/2)),B(de.height),k(null),m&&m({x:0,y:0}),x&&x({width:Math.floor(de.width/2),height:de.height});return}if(S==="right"){let me=Math.floor(de.width/2);T(me),$(0),z(me),B(de.height),k(null),m&&m({x:me,y:0}),x&&x({width:me,height:de.height});return}if(S==="top"){k(null),y&&y();return}k(null);let pe=E.current;if(pe&&m){let me=ie.clientX-pe.startMouseX,he=ie.clientY-pe.startMouseY,fe=pe.startPosX+me,ye=pe.startPosY+he;fe=Math.max(0,Math.min(fe,de.width-A)),ye=Math.max(0,Math.min(ye,de.height-P)),m({x:fe,y:ye})}E.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ue)}},[I,S,A,P,_,m,x,y]);let J=w(oe=>ue=>{if(!d||g!=="normal")return;let re=ue;re.preventDefault(),re.stopPropagation(),F.current={direction:oe,startMouseX:re.clientX,startMouseY:re.clientY,startPosX:D,startPosY:C,startWidth:A,startHeight:P},M(!0)},[d,g,D,C,A,P]);se(()=>{if(!L)return;let oe=re=>{let ie=re,de=F.current;if(!de)return;let pe=ie.clientX-de.startMouseX,me=ie.clientY-de.startMouseY,he=de.direction,fe=de.startWidth,ye=de.startHeight,Pe=de.startPosX,ct=de.startPosY;he.includes("e")&&(fe=de.startWidth+pe),he.includes("w")&&(fe=de.startWidth-pe,Pe=de.startPosX+pe),he.includes("s")&&(ye=de.startHeight+me),he.includes("n")&&(ye=de.startHeight-me,ct=de.startPosY+me);let De=W(fe,ye);he.includes("w")&&(Pe=de.startPosX+(de.startWidth-De.width)),he.includes("n")&&(ct=de.startPosY+(de.startHeight-De.height)),z(De.width),B(De.height),T(Pe),$(ct)},ue=()=>{M(!1),x&&x({width:A,height:P}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ue),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ue)}},[L,A,P,W,x]),se(()=>{if(!h||!f)return;let oe=ue=>{ue.key==="Escape"&&f()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[h,f]);let K=w(oe=>{b&&b()},[b]);if(g==="minimized")return null;let U=g==="maximized",j=q(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:U?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:U?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return U?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${C}px`,oe.left=`${D}px`,oe.width=`${A}px`,oe.height=`${P}px`),c!==void 0&&(oe.zIndex=String(c)),I&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[U,D,C,A,P,c,h,I]),V=q(()=>{let oe={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!U?"grab":"default",opacity:h?"1":"0.6"};return I&&(oe.cursor="grabbing"),oe},[h,u,U,I]),Y={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},Z={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let ae=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...Z,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:oe=>{oe.stopPropagation(),p&&p()}}),o("button",{type:"button","aria-label":U?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...Z,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:oe=>{oe.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...Z,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:oe=>{oe.stopPropagation(),f&&f()}}));Q.push(ae);let ee=[];if(d&&!U){let oe=["n","s","e","w","ne","nw","se","sw"];for(let ue=0;ue<oe.length;ue++){let re=oe[ue],ie={position:"absolute",zIndex:"1"};re==="n"?(ie.top="0",ie.left=`${ve}px`,ie.right=`${ve}px`,ie.height=`${ve}px`):re==="s"?(ie.bottom="0",ie.left=`${ve}px`,ie.right=`${ve}px`,ie.height=`${ve}px`):re==="e"?(ie.top=`${ve}px`,ie.right="0",ie.bottom=`${ve}px`,ie.width=`${ve}px`):re==="w"?(ie.top=`${ve}px`,ie.left="0",ie.bottom=`${ve}px`,ie.width=`${ve}px`):re==="ne"?(ie.top="0",ie.right="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="nw"?(ie.top="0",ie.left="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="se"?(ie.bottom="0",ie.right="0",ie.width=`${ve}px`,ie.height=`${ve}px`):re==="sw"&&(ie.bottom="0",ie.left="0",ie.width=`${ve}px`,ie.height=`${ve}px`),ie.cursor=Zl[re],ee.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${re}`,style:ie,onMouseDown:J(re)}))}}let te=null;if(S){let oe={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};S==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):S==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):S==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),te=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<ee.length;oe++)le.push(ee[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:V,onMouseDown:H,onDblClick:X,role:"toolbar","aria-label":`${n} window controls`},...Q)),le.push(o("div",{className:"draggable-window__body",style:Y},v));let ce=[o("div",{ref:R,id:`draggable-window-${t}`,className:`draggable-window ${h?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${g}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:K},...le)];return te&&ce.push(te),ce.length===1?ce[0]:o("div",{style:{display:"contents"}},...ce)}var Jl=["File","Edit","View","Insert","Format","Tools","Help"],ri={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},Ql=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],ec=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],tc=["1","2","3","4","5","6","7"],nc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function oc(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function ii(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function At(e){let[t,n]=G(!1),[r,i]=G(!1),[s,a]=G(!1),[l,d]=G(-1),[u,g]=G(""),[h,c]=G(-1),[f,p]=G(0),[y,b]=G("3"),m=ne(null),x=w(()=>{document.execCommand("bold",!1),n(Y=>!Y),m.current&&m.current.focus()},[]),v=w(()=>{document.execCommand("italic",!1),i(Y=>!Y),m.current&&m.current.focus()},[]),D=w(()=>{document.execCommand("underline",!1),a(Y=>!Y),m.current&&m.current.focus()},[]),T={bold:x,italic:v,underline:D},C={bold:t,italic:r,underline:s},$=w(Y=>{document.execCommand(Y,!1),m.current&&m.current.focus()},[]),A=w(Y=>{document.execCommand("fontSize",!1,Y),b(Y),m.current&&m.current.focus()},[]),z=w(Y=>{c(Z=>Z===Y?-1:Y)},[]),P=w(Y=>{switch(Y){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":m.current&&(m.current.innerHTML="",p(0));break;default:break}c(-1),m.current&&m.current.focus()},[]),B=w(()=>{if(m.current){let Y=m.current.textContent??"";p(ii(Y))}},[]),I=w(()=>{c(-1)},[]),N=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),L={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},M={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},S={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},k={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},E={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},F={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},R=q(()=>oc(),[]),W=e.content??"Start typing...",_=ii(W),O=f>0?f:_;function H(Y){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:h===Y?"rgba(0,0,0,0.12)":l===Y?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let X={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},J={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function K(Y,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[Y]??!1?"rgba(0,0,0,0.12)":u===Y?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let U={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},j={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},V=Jl.map((Y,Z)=>{let Q=[Y];return h===Z&&ri[Y]&&Q.push(o("div",{key:"dropdown",style:X,className:"word-processor__menu-dropdown"},...ri[Y].map((ae,ee)=>o("button",{key:String(ee),style:J,onClick:te=>{te.stopPropagation(),P(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:H(Z),role:"menuitem","aria-label":Y,onClick:()=>z(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:L,role:"menubar"},...V),o("div",{className:"word-processor__toolbar",style:M,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:U,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ql.map(Y=>o("button",{key:Y.id,style:K(Y.id,Y.style),title:Y.shortcut?`${Y.label} (${Y.shortcut})`:Y.label,"aria-label":Y.label,"aria-pressed":String(C[Y.id]??!1),onClick:T[Y.id],onMouseEnter:()=>g(Y.id),onMouseLeave:()=>g("")},Y.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:j,"aria-label":"Font size",value:y,onChange:Y=>{let Z=Y.target;A(Z.value)}},...tc.map(Y=>o("option",{key:Y,value:Y},nc[Y])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...ec.map((Y,Z)=>o("button",{key:String(Z),style:K(`align-${Z}`),title:Y.label,"aria-label":Y.label,onClick:()=>$(Y.command),onMouseEnter:()=>g(`align-${Z}`),onMouseLeave:()=>g("")},Y.text)))),o("div",{className:"word-processor__ruler",style:S,"aria-hidden":"true"},...R),o("main",{className:"word-processor__document-area",style:k,onClick:I},o("div",{className:"word-processor__page",style:E,contentEditable:"true",ref:m,onInput:B,suppressContentEditableWarning:!0},W)),o("div",{className:"word-processor__status-bar",style:F},o("span",null,"Page 1 of 1"),o("span",null,`${O} words`),o("span",null,"100%")))}var rc=["File","Edit","Selection","View","Go","Run","Terminal","Help"],si={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},ai=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],In={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},li=In["App.ts"],ic=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),sc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),ci="#569cd6",ac="#ce9178",lc="#4ec9b0",cc="#6a9955",dc="#dcdcaa",Pn="#d4d4d4",uc="#d4d4d4",pc="#b5cea8";function fc(e){if(!e.trim())return[{text:"\xA0",color:Pn}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:cc});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:ac}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:pc}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let a=s<e.length&&e[s]==="(",l=Pn;ic.has(i)?l=ci:sc.has(i)?l=lc:a?l=dc:(i==="true"||i==="false")&&(l=ci),t.push({text:i,color:l}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:Pn}),n=r;continue}t.push({text:e[n],color:uc}),n++}return t}function Lt(e){let[t,n]=G("App.ts"),[r,i]=G({src:!0,components:!0,hooks:!0}),[s,a]=G(-1),[l,d]=G(li.length),u=ne(null),g=w(V=>{n(V);let Y=In[V];Y&&d(Y.length)},[]),h=w(V=>{i(Y=>{let Z={},Q=Object.keys(Y);for(let ae=0;ae<Q.length;ae++)Z[Q[ae]]=Y[Q[ae]];return Z[V]=!Y[V],Z})},[]),c=w(V=>{a(Y=>Y===V?-1:V)},[]),f=w(V=>{switch(V){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}a(-1),u.current&&u.current.focus()},[]),p=w(()=>{if(u.current){let Y=(u.current.textContent??"").split(`
|
|
8
|
+
`);d(Math.max(Y.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),b={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},m={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},x={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},v={...x,backgroundColor:"rgba(255,255,255,0.1)"},D={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},T={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},C={flex:"1",display:"flex",overflow:"hidden"},$={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},A={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},z={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(V,Y,Z)=>({padding:"3px 8px",paddingLeft:`${12+V*16}px`,fontSize:"13px",cursor:"pointer",color:Y?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:Z?"rgba(255,255,255,0.08)":"transparent"}),B={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},I={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},N={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},L={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},M={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},S={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},k={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},E={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},F={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},R=8,W=30,_=In[t]??li,O=_.map((V,Y)=>{let Z=fc(V),Q=[],ae=0;for(let ee of Z)Q.push(o("span",{key:String(ae++),style:{color:ee.color}},ee.text));return o("div",{key:String(Y),style:{minHeight:"20px"}},...Q)}),H=Math.max(l,_.length),X=[];for(let V=0;V<H;V++)X.push(o("div",{key:String(V)},String(V+1)));let J=V=>{if(!V.parent)return!0;if(!r[V.parent])return!1;let Y=ai.find(Z=>Z.name===V.parent&&Z.isFolder);return Y?J(Y):!0},K=rc.map((V,Y)=>{let Z=[V],Q=s===Y;return Q&&si[V]&&Z.push(o("div",{key:"dropdown",style:D,className:"ide__menu-dropdown"},...si[V].map((ae,ee)=>o("button",{key:String(ee),style:T,onClick:te=>{te.stopPropagation(),f(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Y),style:Q?v:x,role:"menuitem","aria-label":V,onClick:()=>c(Y)},...Z)}),j=ai.map((V,Y)=>{if(!J(V))return null;let Z=!V.isFolder&&V.name===t,Q=V.isFolder?r[V.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(Y),style:P(V.indent,V.isFolder,Z),onClick:V.isFolder?()=>h(V.name):()=>g(V.name)},Q,V.name)}).filter(V=>V!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:b},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:m,role:"menubar"},...K),o("div",{style:C},o("nav",{className:"ide__sidebar",style:$,"aria-label":"File explorer"},o("div",{style:z},"Explorer"),...j),o("div",{style:A}),o("div",{style:B},o("div",{style:I},o("button",{style:N,"aria-label":t},t)),o("div",{style:L},o("div",{style:M,"aria-hidden":"true"},...X),o("code",{style:S,contentEditable:"true",ref:u,onInput:p,suppressContentEditableWarning:!0},...O))),o("div",{className:"ide__minimap",style:k,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${R}px`,left:"0",right:"0",height:`${W}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),..._.map((V,Y)=>o("div",{key:String(Y),style:{height:"2px",backgroundColor:V.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,V.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:E},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"\u2387 main"),o("span",{style:F},"0 errors"),o("span",{style:F},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"Ln 1, Col 1"),o("span",{style:F},"UTF-8"),o("span",{style:F},"TypeScript"))))}var mc=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],di=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],ui=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],pi=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],gc=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],hc=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],fi=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],mi=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],gi=["09:30","10:00","10:30","11:00","11:30","12:00"];function bc(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function xt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function ze(e){return e.toFixed(2)}var rt={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},it={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Bt={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Ce={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Me={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Ft={cursor:"default",transition:"background-color 0.1s"};function xc(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,g)=>{let h=g/(e.length-1)*40,c=14-(u-i)/a*14;return`${h.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:l,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function yc(e,t){let u=Math.min(...e),g=Math.max(...e),h=g-u||1,c=310/(e.length-1),f=e.map((C,$)=>{let A=40+$*c,z=15+(1-(C-u)/h)*120;return{x:A,y:z}}),p=f.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+f.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${f[f.length-1].x.toFixed(1)},135 Z`,b=[];for(let C=1;C<e.length;C++){let $=e[C]>=e[C-1]?"#00c853":"#ff1744";b.push(o("line",{key:String(C),x1:String(f[C-1].x.toFixed(1)),y1:String(f[C-1].y.toFixed(1)),x2:String(f[C].x.toFixed(1)),y2:String(f[C].y.toFixed(1)),stroke:$,strokeWidth:"2",strokeLinecap:"round"}))}let m=[];for(let C=0;C<5;C++){let $=15+C/4*120,A=g-C/4*h;m.push(o("line",{key:`g${C}`,x1:String(40),y1:String($.toFixed(1)),x2:String(350),y2:String($.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),m.push(o("text",{key:`yl${C}`,x:String(36),y:String(($+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},ze(A)))}let x=[],v=Math.min(gi.length,e.length),D=(e.length-1)/(v-1);for(let C=0;C<v;C++){let A=40+Math.round(C*D)*c;x.push(o("text",{key:`tl${C}`,x:String(A.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},gi[C]))}let T="chartGrad";return o("div",{style:rt},o("div",{style:it},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${ze(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:T,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${T})`}),...m,...x,...b,o("line",{x1:String(40),y1:String((15+(1-(t-u)/h)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/h)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function Sc(){let e=Math.max(...di.map(t=>t.qty),...ui.map(t=>t.qty));return o("div",{style:rt},o("div",{style:it},"Order Book"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Bid Price"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Ask Price"),o("th",{style:Ce},"Qty"))),o("tbody",null,...di.map((t,n)=>{let r=ui[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Ft},o("td",{style:{...Me,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},ze(t.price)),o("td",{style:{...Me,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},xt(t.qty)),o("td",{style:{...Me,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?ze(r.price):""),o("td",{style:{...Me,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?xt(r.qty):""))}))))}function vc(e){return o("div",{style:rt},o("div",{style:it},"Watchlist"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Symbol"),o("th",{style:Ce},"Price"),o("th",{style:Ce},"Chg%"),o("th",{style:Ce},"Volume"))),o("tbody",null,...mc.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Ft},o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},t.symbol,xc(t.spark,i)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(r)),o("td",{style:{...Me,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${ze(t.change)}%`),o("td",{style:{...Me,fontFamily:"monospace",color:"#8888aa"}},bc(t.volume)))}))))}function wc(){let e=pi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:rt},o("div",{style:it},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${ze(e)}`)),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Symbol"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Avg"),o("th",{style:Ce},"P&L"))),o("tbody",null,...pi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...Ft,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...Me,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(n.avgPrice)),o("td",{style:{...Me,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${ze(n.pnl)}`))}))))}function kc(){return o("div",{style:rt},o("div",{style:it},"Recent Trades"),o("table",{style:Bt},o("thead",null,o("tr",null,o("th",{style:Ce},"Time"),o("th",{style:Ce},"Sym"),o("th",{style:Ce},"Side"),o("th",{style:Ce},"Qty"),o("th",{style:Ce},"Price"))),o("tbody",null,...gc.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:Ft},o("td",{style:{...Me,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Me,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Me,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Me,fontFamily:"monospace"}},xt(e.qty)),o("td",{style:{...Me,fontFamily:"monospace"}},ze(e.price)))}))))}function Cc(){let e=Math.max(...fi.map(n=>n.volume),...mi.map(n=>n.volume)),t="16px";return o("div",{style:rt},o("div",{style:it},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...fi.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},ze(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},xt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...mi.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},ze(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},xt(n.volume))))))}function Nt(e){let[t,n]=G(0),[r,i]=G("--:--:--"),[s,a]=G(!0);se(()=>{let f=setInterval(()=>{n(p=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(f)},[]),se(()=>{let f=()=>{let y=new Date,b=String(y.getHours()).padStart(2,"0"),m=String(y.getMinutes()).padStart(2,"0"),x=String(y.getSeconds()).padStart(2,"0");i(`${b}:${m}:${x}`)};f();let p=setInterval(f,1e3);return()=>clearInterval(p)},[]),se(()=>{let f=setInterval(()=>{a(p=>!p)},800);return()=>clearInterval(f)},[]);let l=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},g={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},h=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:l},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:g},yc(hc,h),Sc(),vc(t),wc(),kc(),Cc()))}function we(e){return e.type==="card"}function Ee(e){return e.type==="container"}function st(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function He(e){return we(e)?e.card_id:e.container_id}var bi={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},xi=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function hi(e){let t=e.content;return o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1"},"data-testid":`card-text-content-${e.card_id}`},t.text||"")}function Mc(e){let t=e.content,r=Object.entries(t).map(([i,s],a)=>o("div",{key:String(a),style:{display:"flex",gap:"4px",fontSize:"11px",lineHeight:"1.6",borderBottom:"1px solid rgba(0,0,0,0.05)",padding:"2px 0"}},o("span",{style:{fontWeight:"600",color:"#374151",minWidth:"60px"}},`${i}:`),o("span",{style:{color:"#555555"}},String(s??""))));return o("div",{style:{flex:"1",overflow:"auto"},"data-testid":`card-json-content-${e.card_id}`},...r)}function Ec(e){return o("div",{style:{fontSize:"12px",color:"#9ca3af",fontStyle:"italic",flex:"1",display:"flex",alignItems:"center",justifyContent:"center"},"data-testid":`card-task-content-${e.card_id}`},"Task card (coming soon)")}function Rc(e,t){let n=e.content;return o("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"4px 16px",borderRadius:"999px",backgroundColor:e.color||"#e0e7ff",fontSize:"13px",fontWeight:"600",color:"#1e3a5f",cursor:"pointer",flex:"1"},onDblClick:r=>{r.preventDefault(),r.stopPropagation(),t&&n.project_id&&t(n.project_id)},"data-testid":`card-project-content-${e.card_id}`},n.project_name||"Untitled Project")}function Wt(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d}=e,[u,g]=G(!1),[h,c]=G(null),[f,p]=G(!1),y=ne(null),b=ne(null),m=t.priority?bi[t.priority]||"#94a3b8":"transparent",x=w(R=>{let W=R;W.preventDefault(),W.stopPropagation(),c({x:W.clientX,y:W.clientY}),p(!1)},[]),v=w(()=>{c(null),p(!1)},[]),D=w(R=>{let W=R,_=W.target;if(_.dataset&&(_.dataset.role==="delete"||_.dataset.role==="resize"||_.dataset.role==="drag-handle"))return;W.preventDefault(),W.stopPropagation(),r&&r(t.card_id),y.current={x:W.clientX,y:W.clientY,cardX:t.position.x,cardY:t.position.y};let O=X=>{let J=X;if(!y.current)return;let K=J.clientX-y.current.x,U=J.clientY-y.current.y;i&&i(t.card_id,{x:y.current.cardX+K,y:y.current.cardY+U})},H=()=>{y.current=null,document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",H)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",H)},[t.card_id,t.position.x,t.position.y,r,i]),T=w(R=>{let W=R;W.preventDefault(),W.stopPropagation(),b.current={x:W.clientX,y:W.clientY,w:t.size.width,h:t.size.height};let _=H=>{let X=H;if(!b.current)return;let J=X.clientX-b.current.x,K=X.clientY-b.current.y,U=Math.max(120,b.current.w+J),j=Math.max(80,b.current.h+K);s&&s(t.card_id,{width:U,height:j})},O=()=>{b.current=null,document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",_),document.addEventListener("mouseup",O)},[t.card_id,t.size.width,t.size.height,s]),C=w(R=>{R.preventDefault(),R.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),$=w(R=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:R}),v()},[t.card_id,l,v]),A;switch(t.card_type){case"text":A=hi(t);break;case"json":A=Mc(t);break;case"task":A=Ec(t);break;case"project":A=Rc(t,d);break;default:A=hi(t)}let z=t.card_type==="project",P={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:t.color||"#fef9c3",borderRadius:z?"999px":"6px",borderLeft:`4px solid ${m}`,boxShadow:n?"0 0 0 2px #3b82f6, 0 4px 12px rgba(0,0,0,0.15)":"0 2px 8px rgba(0,0,0,0.1)",cursor:"grab",userSelect:"none",overflow:"hidden",display:"flex",flexDirection:"column",padding:"8px 10px",boxSizing:"border-box",transition:"box-shadow 150ms ease",zIndex:"1"},B={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},I={position:"absolute",top:"4px",right:"4px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.15)",color:"#333",fontSize:"12px",lineHeight:"18px",textAlign:"center",cursor:"pointer",display:u?"block":"none",border:"none",padding:"0"},N={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},L={position:"absolute",top:"4px",right:"24px",width:"18px",height:"18px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.1)",color:"#333",fontSize:"10px",lineHeight:"18px",textAlign:"center",cursor:"grab",display:u?"block":"none",border:"none",padding:"0"},M=t.assignee?o("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginTop:"4px",fontSize:"10px",color:"#555"},"data-testid":`card-assignee-${t.card_id}`},o("span",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:"#3b82f6",color:"#fff",fontSize:"9px",fontWeight:"700",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},t.assignee.charAt(0).toUpperCase()),o("span",{},t.assignee)):null,S=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((R,W)=>o("span",{key:String(W),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},R))):null,k={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},E={position:"absolute",left:"100%",top:"0",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"120px"},F=h?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${h.x}px`,top:`${h.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10000",minWidth:"160px",fontSize:"13px",color:"#1a1a1a"},"data-testid":`card-context-menu-${t.card_id}`,role:"menu","aria-label":"Card context menu",onClick:R=>R.stopPropagation()},o("div",{style:k,onClick:R=>{R.stopPropagation(),a&&a(t.card_id),v()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...k,position:"relative"},onMouseEnter:()=>p(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),f?o("div",{style:E,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...xi.map(R=>o("div",{key:R.value,style:{...k,fontWeight:t.card_type===R.value?"700":"400"},onClick:W=>{W.stopPropagation(),$(R.value)},role:"menuitem","data-testid":`ctx-type-${R.value}-${t.card_id}`},R.label,t.card_type===R.value?" \u2713":""))):null)):null;return z?o("div",{className:"board-card board-card--project",style:P,onMouseDown:D,onContextMenu:x,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),v()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},A,o("div",{style:L,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),F):o("div",{className:"board-card",style:P,onMouseDown:D,onContextMenu:x,onMouseEnter:()=>g(!0),onMouseLeave:()=>{g(!1),v()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},o("div",{style:B,"data-testid":`card-title-${t.card_id}`},t.card_title||"Untitled"),A,S,M,o("div",{style:L,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":`Export drag handle for ${t.card_title}`,title:"Drag to export card"},"\u2630"),o("button",{style:I,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:C,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:N,"data-role":"resize",onMouseDown:T,"aria-label":"Resize card"}),F)}function yi(e){let{container:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDrop:a,children:l}=e,[d,u]=G(!1),g=ne(null),h=ne(null),c=w(T=>{let C=T;C.preventDefault(),C.stopPropagation(),r&&r(t.container_id),g.current={x:C.clientX,y:C.clientY,posX:t.position.x,posY:t.position.y};let $=z=>{let P=z;if(!g.current)return;let B=P.clientX-g.current.x,I=P.clientY-g.current.y;i&&i(t.container_id,{x:g.current.posX+B,y:g.current.posY+I})},A=()=>{g.current=null,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",A)},[t.container_id,t.position.x,t.position.y,r,i]),f=w(T=>{let C=T;C.preventDefault(),C.stopPropagation(),h.current={x:C.clientX,y:C.clientY,w:t.size.width,h:t.size.height};let $=z=>{let P=z;if(!h.current)return;let B=P.clientX-h.current.x,I=P.clientY-h.current.y,N=Math.max(160,h.current.w+B),L=Math.max(120,h.current.h+I);s&&s(t.container_id,{width:N,height:L})},A=()=>{h.current=null,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",A)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",A)},[t.container_id,t.size.width,t.size.height,s]),p=w(T=>{T.preventDefault(),u(!0)},[]),y=w(()=>{u(!1)},[]),b=w(T=>{let C=T;if(C.preventDefault(),u(!1),a&&C.dataTransfer){let $=C.dataTransfer.getData("text/plain");$&&a($,t.container_id)}},[t.container_id,a]),m={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:"#ffffff",border:n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:d?"0 0 0 3px rgba(59,130,246,0.3), 0 4px 16px rgba(0,0,0,0.1)":"0 2px 8px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:"0",boxSizing:"border-box"},x={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},v={flex:"1",overflow:"auto",position:"relative",padding:"4px"},D={position:"absolute",bottom:"0",right:"0",width:"14px",height:"14px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"};return o("div",{className:"board-container",style:m,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:p,onDragLeave:y,onDrop:b},o("div",{className:"board-container__title",style:x,onMouseDown:c,"data-testid":`container-title-${t.container_id}`},t.name),o("div",{className:"board-container__contents",style:v,"data-testid":`container-contents-${t.container_id}`},l),o("div",{style:D,"data-role":"resize",onMouseDown:f,"aria-label":"Resize container"}))}function Si(e){return{x:e.position.x+e.size.width/2,y:e.position.y+e.size.height/2}}var vi="board-card-link-arrowhead";function _t(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,canvasWidth:s,canvasHeight:a}=e,l=new Map;for(let c=0;c<n.length;c++)l.set(n[c].card_id,n[c]);let d=w(c=>{i(c)},[i]),u=[];for(let c=0;c<t.length;c++){let{source:f,link:p}=t[c],y=l.get(p.target_card_id);if(!y)continue;let b=Si(f),m=Si(y),x=p.link_id===r,v=x?"#3b82f6":p.color||"#94a3b8",D=m.x-b.x,T=m.y-b.y,C=Math.sqrt(D*D+T*T),$=Math.min(40,C*.15),A=C>0?-T/C:0,z=C>0?D/C:0,P=(b.x+m.x)/2,B=(b.y+m.y)/2,I=P+A*$,N=B+z*$,L=`M ${b.x} ${b.y} Q ${I} ${N} ${m.x} ${m.y}`;u.push(o("path",{key:`hit-${p.link_id}`,d:L,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"},onClick:()=>d(p.link_id),"data-testid":`link-hit-${p.link_id}`})),u.push(o("path",{key:p.link_id,d:L,fill:"none",stroke:v,"stroke-width":x?"3":"2","pointer-events":"none","marker-end":`url(#${vi})`,"data-testid":`link-${p.link_id}`})),p.link_name&&u.push(o("text",{key:`label-${p.link_id}`,x:String(I),y:String(N-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${p.link_id}`},p.link_name))}let g={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},h=o("defs",{},o("marker",{id:vi,viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse"},o("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#94a3b8"})));return o("svg",{style:g,width:String(s),height:String(a),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},h,o("g",{style:{pointerEvents:"auto"}},...u))}var $n=20,Ot=5e3;function Tn(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Pc(e){let t=[],n=[],r=[...e];for(;r.length>0;){let i=r.pop();if(we(i)){t.push(i);for(let s=0;s<i.card_link.length;s++)n.push({source:i,link:i.card_link[s]})}else if(Ee(i))for(let s=i.contents.length-1;s>=0;s--)r.push(i.contents[s])}return{cards:t,links:n}}function Ht(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d}=e,{collection:u,viewport:g}=t,h=ne(null),c=ne(!1),f=ne(null),p=w(S=>{let k=S,E=k.target;if(E.closest(".board-card")||E.closest(".board-container"))return;let F=k.button===1,R=k.button===0&&k.shiftKey;F||R?(k.preventDefault(),c.current=!0,f.current={x:k.clientX,y:k.clientY,panX:g.panX,panY:g.panY}):k.button===0&&i&&i(null)},[g.panX,g.panY,i]);se(()=>{let S=E=>{if(!c.current||!f.current)return;let F=E,R=F.clientX-f.current.x,W=F.clientY-f.current.y;n({type:"PAN",panX:f.current.panX+R,panY:f.current.panY+W})},k=()=>{c.current=!1,f.current=null};return document.addEventListener("mousemove",S),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",k)}},[n]);let y=w(S=>{let k=S;if(!k.ctrlKey)return;k.preventDefault();let E=k.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:g.zoom+E})},[g.zoom,n]),b=ne(null);se(()=>{let S=h.current;if(!S)return;let k=_=>{let O=[];for(let H=0;H<_.touches.length;H++)O.push({x:_.touches[H].clientX,y:_.touches[H].clientY});return O},E=(_,O)=>Math.sqrt((_.x-O.x)**2+(_.y-O.y)**2),F=_=>{let O=_;if(O.touches.length===2){O.preventDefault();let H=k(O);b.current={touches:H,panX:g.panX,panY:g.panY,zoom:g.zoom,dist:E(H[0],H[1])}}},R=_=>{let O=_;if(O.touches.length!==2||!b.current)return;O.preventDefault();let H=k(O),X=b.current,J=(X.touches[0].x+X.touches[1].x)/2,K=(X.touches[0].y+X.touches[1].y)/2,U=(H[0].x+H[1].x)/2,j=(H[0].y+H[1].y)/2;n({type:"PAN",panX:X.panX+(U-J),panY:X.panY+(j-K)});let V=E(H[0],H[1]);X.dist>0&&n({type:"ZOOM",zoom:X.zoom*(V/X.dist)})},W=()=>{b.current=null};return S.addEventListener("touchstart",F,{passive:!1}),S.addEventListener("touchmove",R,{passive:!1}),S.addEventListener("touchend",W),()=>{S.removeEventListener("touchstart",F),S.removeEventListener("touchmove",R),S.removeEventListener("touchend",W)}},[g.panX,g.panY,g.zoom,n]);let m=w(S=>{i&&i(S)},[i]),x=w((S,k)=>{let E=k;s&&(E=Tn(k,$n)),n({type:"MOVE_ITEM",itemId:S,position:E})},[n,s]),v=w((S,k)=>{n({type:"RESIZE_ITEM",itemId:S,size:k})},[n]),D=w(S=>{n({type:"REMOVE_ITEM",itemId:S}),i&&r===S&&i(null)},[n,r,i]),T=w((S,k)=>{n({type:"NEST_ITEM",itemId:S,containerId:k})},[n]),C=a.toLowerCase(),$=new Set,A=[],z=[...u];for(;z.length>0;){let S=z.pop();if(A.push(S),Ee(S))for(let k=0;k<S.contents.length;k++)z.push(S.contents[k])}if(C)for(let S=0;S<A.length;S++){let k=A[S];(we(k)?k.card_title:k.name).toLowerCase().includes(C)||$.add(He(k))}if(l)for(let S=0;S<A.length;S++){let k=A[S];we(k)&&k.color!==l&&$.add(k.card_id)}let{cards:P,links:B}=Pc(u);function I(S){let k=He(S),E=$.has(k),F;if(we(S))F=o(Wt,{key:k,card:S,selected:k===r,onSelect:m,onMove:x,onResize:v,onDelete:D,dispatch:n,onOpenProject:d});else{let R=S.contents.map(W=>I(W));F=o(yi,{key:k,container:S,selected:k===r,onSelect:m,onMove:x,onResize:v,onDrop:T},...R)}return E?o("div",{key:`dim-${k}`,style:{opacity:"0.3"}},F):F}let N=u.map(S=>I(S)),L={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${$n}px ${$n}px`},M={transform:`translate(${g.panX}px, ${g.panY}px) scale(${g.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Ot}px`,height:`${Ot}px`};return o("div",{ref:h,className:"board-canvas",style:L,onMouseDown:p,onWheel:y,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:M,"data-testid":"board-canvas-inner"},o(_t,{links:B,cards:P,selectedLinkId:null,onSelectLink:()=>{},canvasWidth:Ot,canvasHeight:Ot}),...N))}function $c(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else if(Ee(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function zn(e,t,n,r){let i=r??40,s=$c(e);if(s.length===0)return{panX:0,panY:0,zoom:1};let a=1/0,l=1/0,d=-1/0,u=-1/0;for(let m=0;m<s.length;m++){let x=s[m];x.position.x<a&&(a=x.position.x),x.position.y<l&&(l=x.position.y);let v=x.position.x+x.size.width,D=x.position.y+x.size.height;v>d&&(d=v),D>u&&(u=D)}let g=d-a+i*2,h=u-l+i*2,c=t/g,f=n/h,p=Math.max(.25,Math.min(4,Math.min(c,f))),y=-a*p+(t-(d-a)*p)/2,b=-l*p+(n-(u-l)*p)/2;return{panX:y,panY:b,zoom:p}}var yt=["transparent","#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Dn(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:g,onGridToggle:h,onSearch:c}=e,[f,p]=G(""),y=w($=>{let A=$.target.value;p(A),c(A)},[c]),b={display:"flex",alignItems:"center",gap:"8px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.95)",borderBottom:"1px solid #e2e8f0",fontSize:"12px",flexShrink:"0",flexWrap:"wrap"},m={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},x={...m,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},v={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},D={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},T={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=yt.map($=>{let A=$===r,z=$===i,P=()=>{A&&g?g(z?null:$):u($)},B="1px solid rgba(0,0,0,0.15)";z?B="3px solid #ef4444":A&&(B="2px solid #3b82f6");let I=$==="transparent";return o("button",{key:$,title:I?"Transparent":$,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:I?"#ffffff":$,backgroundImage:I?"linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)":"none",backgroundSize:I?"6px 6px":"auto",backgroundPosition:I?"0 0, 3px 3px":"0 0",border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:z?"1":i?"0.5":"1"},onClick:P,"aria-label":z?`Clear color filter ${$}`:`Select color ${$}`,"data-testid":`color-swatch-${$}`})});return o("div",{className:"board-toolbar",style:b,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:m,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:D}),o("button",{style:m,onClick:l,"data-testid":"btn-zoom-out","aria-label":"Zoom out"},"-"),o("span",{style:v,onClick:d,"data-testid":"zoom-level",role:"status","aria-label":`Zoom ${Math.round(t*100)}%`},`${Math.round(t*100)}%`),o("button",{style:m,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:D}),...C,o("div",{style:D}),o("button",{style:n?x:m,onClick:h,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:D}),o("input",{type:"text",placeholder:"Search cards...",value:f,onInput:y,style:T,"data-testid":"search-input","aria-label":"Search cards"}))}var wi=50,Ye={id:st(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function ki(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(He(d)===t){n=d;continue}if(Ee(d)){let g=r(d.contents);a.push({...d,contents:g})}else a.push(d)}return a}return[r(e),n]}function qe(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];He(s)===t?r.push(n(s)):Ee(s)?r.push({...s,contents:qe(s.contents,t,n)}):r.push(s)}return r}function Yt(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Ee(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):Ee(s)?r.push({...s,contents:Yt(s.contents,t,n)}):r.push(s)}return r}function Tc(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if(Ee(u)&&u.container_id===t){let g=[];for(let h=0;h<u.contents.length;h++){let c=u.contents[h];He(c)===n?r=c:g.push(c)}l.push({...u,contents:g})}else Ee(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function zc(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function An(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:Yt(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=ki(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:qe(e.collection,t.itemId,n=>({...n,position:t.position,...we(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:qe(e.collection,t.itemId,n=>({...n,size:t.size,...we(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_type:t.newType,content:zc(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:Yt(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let[n,r]=ki(e.collection,t.itemId);return r?{...e,collection:Yt(n,t.containerId,r)}:e}case"UNNEST_ITEM":{let[n,r]=Tc(e.collection,t.containerId,t.itemId);return r?{...e,collection:[...n,r]}:e}case"ADD_LINK":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:qe(e.collection,t.cardId,n=>we(n)?{...n,card_link:n.card_link.filter(r=>r.link_id!==t.linkId),updatedAt:Date.now()}:n)};case"PAN":return{...e,viewport:{...e.viewport,panX:t.panX,panY:t.panY}};case"ZOOM":{let n=Math.max(.25,Math.min(4,t.zoom));return{...e,viewport:{...e.viewport,zoom:n}}}case"SET_BOARD":return t.state;case"RENAME_BOARD":return{...e,name:t.name};default:return e}}function Dc(e){return e.type==="PAN"||e.type==="ZOOM"}function Ln(e,t){switch(t.type){case"UNDO":{if(e.past.length===0)return e;let n=e.past[e.past.length-1];return{past:e.past.slice(0,e.past.length-1),present:n,future:[e.present,...e.future]}}case"REDO":{if(e.future.length===0)return e;let n=e.future[0],r=e.future.slice(1);return{past:[...e.past,e.present],present:n,future:r}}case"BOARD_ACTION":{let n=An(e.present,t.action);if(n===e.present)return e;if(Dc(t.action))return{...e,present:n};if(t.action.type==="SET_BOARD")return{past:[],present:n,future:[]};let r=[...e.past,e.present];return r.length>wi&&r.splice(0,r.length-wi),{past:r,present:n,future:[]}}default:return e}}function Bn(e){let t={past:[],present:e||Ye,future:[]},[n,r]=Qt(Ln,t),i=w(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=w(()=>{r({type:"UNDO"})},[r]),a=w(()=>{r({type:"REDO"})},[r]);return{state:n.present,dispatch:i,undo:s,redo:a,canUndo:n.past.length>0,canRedo:n.future.length>0}}function Fn(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Bn(),d=ne(!1);se(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(h=>{r({type:"SET_BOARD",state:h})}).catch(()=>{}))},[e,t,r]);let u=ne(null),g=ne(n);return g.current=n,se(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,g.current).catch(()=>{}),u.current=null},500),()=>{u.current!==null&&clearTimeout(u.current)}},[e,t,n]),{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}}var St=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...Ye}}catch{return{...Ye}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Ac(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function Nn(e){let{collection:t,onCardDropped:n,children:r}=e,i=Oe(),s=ne([]);se(()=>{let u=Ac(t),g=s.current,h=new Set(g.map(f=>f.card_id)),c=new Set(u.map(f=>f.card_id));for(let f of u)h.has(f.card_id)||i.publish("project-board",{event:"card-created",card:f});for(let f of g)c.has(f.card_id)||i.publish("project-board",{event:"card-deleted",cardId:f.card_id});for(let f of u)if(h.has(f.card_id)){let p=g.find(y=>y.card_id===f.card_id);p&&p.updatedAt!==f.updatedAt&&i.publish("project-board",{event:"card-updated",card:f})}s.current=u},[t,i]);let a=w(u=>{if(u.type==="text/plain"&&typeof u.data=="string")n(u.data,"");else if(u.type==="application/json"){let g=u.data;n(String(g.title||"Dropped Item"),String(g.description||""))}},[n]),{isOver:l}=ht({acceptTypes:["text/plain","application/json","application/project-card"],onDrop:a}),d={width:"100%",height:"100%",...l?{outline:"2px dashed #3b82f6",outlineOffset:"-2px"}:{}};return o("div",{style:d,"data-dropzone-id":"project-board-dropzone"},r)}var Lc=new St;function Ci(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(we(r))t.push(r);else if(Ee(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var Ve=Date.now(),Bc={id:"sample-board-001",name:"Sample Project",collection:[{type:"card",card_id:"sample-1",card_type:"text",card_title:"Auth API",card_link:[{link_id:"link-1",link_name:"blocks",target_card_id:"sample-2",color:"#94a3b8",attributes:{}}],content:{text:"Design the auth flow"},position:{x:50,y:50},size:{width:180,height:120},color:"#3b82f6",priority:"high",assignee:"Alice",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-2",card_type:"text",card_title:"Dashboard",card_link:[],content:{text:"Build the main dashboard"},position:{x:300,y:80},size:{width:180,height:120},color:"#22c55e",priority:"medium",assignee:"Bob",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-3",card_type:"text",card_title:"Deploy",card_link:[],content:{text:"Set up CI pipeline"},position:{x:150,y:250},size:{width:180,height:120},color:"#f59e0b",priority:"low",createdAt:Ve,updatedAt:Ve},{type:"card",card_id:"sample-4",card_type:"text",card_title:"Docs",card_link:[],content:{text:"Write API reference"},position:{x:400,y:280},size:{width:180,height:120},color:"#a855f7",priority:"medium",assignee:"Carol",createdAt:Ve,updatedAt:Ve}],viewport:{panX:0,panY:0,zoom:1}};function Fc(e){return e.collection.length===0}function Mi(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Fn(Lc,t),[d,u]=G(yt[0]),[g,h]=G(!1),[c,f]=G(""),[p,y]=G(null),[b,m]=G(null),[x,v]=G(n.name||"Untitled"),[D,T]=G(!1),[C,$]=G(""),A=ne(!1);se(()=>{!A.current&&Fc(n)?(A.current=!0,r({type:"SET_BOARD",state:Bc})):n.collection.length>0&&(A.current=!0)},[n,r]);let z=w(()=>{let te=(-n.viewport.panX+300)/n.viewport.zoom,le=(-n.viewport.panY+200)/n.viewport.zoom,ce=(Math.random()-.5)*300,oe=(Math.random()-.5)*200,ue={type:"card",card_id:st(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(te+ce),y:Math.round(le+oe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ue})},[n.viewport,d,r]),P=w(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),B=w(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),I=w(()=>{r({type:"ZOOM",zoom:1})},[r]),N=w(()=>{h(te=>!te)},[]),L=w(te=>{f(te)},[]),M=w(te=>{y(te)},[]),S=w(te=>{m(te)},[]),k=w(()=>{r({type:"SET_BOARD",state:Ye}),y(null)},[r]),E=w(()=>{let te=JSON.stringify(n,null,2),le=new Blob([te],{type:"application/json"}),ce=URL.createObjectURL(le),oe=document.createElement("a");oe.href=ce,oe.download=`board-${t}.json`,oe.style.display="none",document.body.appendChild(oe),oe.click(),document.body.removeChild(oe),URL.revokeObjectURL(ce)},[n,t]),F=w(()=>{let te=document.createElement("input");te.type="file",te.accept=".json,application/json",te.style.display="none",te.addEventListener("change",()=>{let le=te.files&&te.files[0];if(!le)return;let ce=new FileReader;ce.onload=()=>{try{let oe=JSON.parse(ce.result);oe&&oe.collection&&oe.viewport&&r({type:"SET_BOARD",state:oe})}catch{}},ce.readAsText(le)}),document.body.appendChild(te),te.click(),document.body.removeChild(te)},[r]),R=w(()=>{window.print()},[]),W=Ci(n.collection),_=w(()=>{let te=Ci(n.collection);te.length>0&&y(te[0].card_id)},[n.collection]),O=w(()=>{p&&(r({type:"REMOVE_ITEM",itemId:p}),y(null))},[p,r]),H=w(()=>{if(n.collection.length===0)return;let ce=zn(n.collection,800,600);r({type:"PAN",panX:ce.panX,panY:ce.panY}),r({type:"ZOOM",zoom:ce.zoom})},[n.collection,r]);se(()=>{let te={menus:[{label:"File",items:[{label:"New Board",onClick:k},{label:"Export JSON",onClick:E},{label:"Import JSON",onClick:F},{divider:!0},{label:"Print",onClick:R}]},{label:"Edit",items:[{label:"Undo",shortcut:"Ctrl+Z",onClick:i,disabled:!a},{label:"Redo",shortcut:"Ctrl+Y",onClick:s,disabled:!l},{divider:!0},{label:"Select All",shortcut:"Ctrl+A",onClick:_},{label:"Delete Selected",onClick:O}]},{label:"View",items:[{label:"Zoom In",onClick:P},{label:"Zoom Out",onClick:B},{label:"Fit All",onClick:H},{divider:!0},{label:"Toggle Grid",onClick:N}]}]}},[k,E,F,R,i,s,a,l,_,O,P,B,H,N]),se(()=>{let te=le=>{let ce=le;ce.ctrlKey&&ce.key==="z"?(ce.preventDefault(),i()):ce.ctrlKey&&ce.key==="y"&&(ce.preventDefault(),s())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[i,s]);let X=w(()=>{$(x),T(!0)},[x]),J=w(()=>{let te=C.trim();te&&(v(te),r({type:"RENAME_BOARD",name:te})),T(!1)},[C,r]),K=w(()=>{T(!1)},[]),U=w(te=>{$(te.target.value)},[]),j=w(te=>{let le=te;le.key==="Enter"&&(le.preventDefault(),J()),le.key==="Escape"&&(le.preventDefault(),K())},[J,K]),V={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},Y=w((te,le)=>{let ce=(-n.viewport.panX+300)/n.viewport.zoom,oe=(-n.viewport.panY+200)/n.viewport.zoom,ue=(Math.random()-.5)*300,re=(Math.random()-.5)*200,ie={type:"card",card_id:st(),card_type:"text",card_title:te,card_link:[],content:{text:le},color:d,position:{x:Math.round(ce+ue),y:Math.round(oe+re)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ie})},[n.viewport,d,r]),Z={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},Q={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},ae=o("div",{style:Z,"data-testid":"app-menu-bar"},o("button",{style:Q,onClick:X,title:"Project menu"},"Project"),o("button",{style:Q,title:"Settings"},"Settings"),o("button",{style:Q,title:"Help"},"Help"),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${x}`)),ee=D?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:K},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:te=>te.stopPropagation(),role:"dialog","aria-label":"Rename project"},o("div",{style:{fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"}},"Rename Project"),o("input",{type:"text",value:C,onInput:U,onKeyDown:j,autoFocus:!0,style:{width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},"data-testid":"rename-input"}),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{onClick:K,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:J,style:{padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},"data-testid":"rename-confirm"},"Rename")))):null;return o("div",{className:"project-manager-app",style:V,"data-testid":"project-manager-app"},ae,o(Dn,{zoom:n.viewport.zoom,gridEnabled:g,selectedColor:d,colorFilter:b,onNewCard:z,onZoomIn:P,onZoomOut:B,onZoomReset:I,onColorSelect:u,onColorFilter:S,onGridToggle:N,onSearch:L}),o(Nn,{collection:n.collection,onCardDropped:Y},o(Ht,{state:n,dispatch:r,searchQuery:c,gridEnabled:g,selectedId:p,onSelectItem:M,colorFilter:b})),ee)}var Nc=28,Wc=5e3;var Ei=0;function Ri(e){return Ei++,`${e}-${Ei}`}function Pi(e){return e.replace(/\s*\(\d+\)$/,"")}function _c(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let a="rgba(50, 50, 50, 0.95)",l="#555";return s.severity==="warning"?(a="rgba(60, 40, 10, 0.95)",l="#f39c12"):s.severity==="error"&&(a="rgba(60, 10, 10, 0.95)",l="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:a,border:`1px solid ${l}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Oc(){let e=Oe(),t=ne(!1);return se(()=>{t.current||(t.current=!0,e.publish("terminal-output",{text:"Terminal session started",pid:1}))},[e]),o("div",{style:{padding:"16px",fontSize:"12px",color:"#00ff41",height:"100%",overflow:"auto",backgroundColor:"#1a1a2e",fontFamily:"monospace"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",{style:{opacity:"0.6",marginTop:"8px",fontSize:"10px"}},"[Published terminal-output message]"),o("div",null,"$ _"))}function Hc(){let[e,t]=G([]),n=Xe();mt("terminal-output",s=>{t(a=>[...a,`[terminal] ${s.payload.text}`])});let r=w(s=>{s.preventDefault(),n.startDrag({type:"application/file",data:{name:"readme.txt",size:1024},sourceAppId:"files",preview:"readme.txt"})},[n]);return o("div",{style:{padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"}},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos"].map(s=>o("span",{style:{cursor:"pointer"}},s)),o("span",{style:{cursor:"grab",padding:"4px 8px",border:"1px dashed #94a3b8",borderRadius:"4px",backgroundColor:"rgba(148, 163, 184, 0.1)"},onMouseDown:r,"aria-label":"Drag readme.txt"},"\u{1F4C4} readme.txt (drag me)")),e.length>0?o("div",{style:{marginTop:"12px",padding:"8px",backgroundColor:"rgba(0,0,0,0.05)",borderRadius:"4px",fontSize:"11px",fontFamily:"monospace"}},o("div",{style:{fontWeight:"600",marginBottom:"4px"}},"Messages received:"),...e.map((s,a)=>o("div",{key:String(a),style:{color:"#64748b"}},s))):null)}function Yc(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(Pi(e)){case"Files":return o(_e,{appId:"files"},o(Hc,null));case"Terminal":return o(_e,{appId:"terminal"},o(Oc,null));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(r=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},r)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(r=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},r)));case"Word Processor":return o(At,null);case"IDE":return o(Lt,null);case"Trading":return o(Nt,null);case"Project Board":return o(Mi,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Vc(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=pt(),d=l.activeMenuBar,u=l.dockSignals,g=ne(l);g.current=l;let[h,c]=G([]),[f,p]=G([]),[y,b]=G(!1),[m,x]=G(!1),[v,D]=G(null),[T,C]=G({x:0,y:0}),[$,A]=G(null),z=w(()=>{b(re=>!re)},[]),P=w(re=>{p(ie=>ie.filter(de=>de.id!==re))},[]);se(()=>{if(f.length===0)return;let re=f[0],ie=Date.now()-re.timestamp,de=Math.max(0,Wc-ie),pe=setTimeout(()=>{p(me=>me.filter(he=>he.id!==re.id))},de);return()=>clearTimeout(pe)},[f]);let B=ne(t);B.current=t;let I=ne(r);I.current=r;let N=w(re=>{let de=B.current.find(pe=>pe.id===re);de&&(c(pe=>{let he=pe.filter(De=>De.appId===re).length+1,fe=he===1?de.label:`${de.label} (${he})`,ye=Ri(re),Pe=pe.length>0?Math.max(...pe.map(De=>De.zIndex))+1:1,ct={id:ye,appId:de.id,title:fe,icon:de.icon,x:60+pe.length*30,y:40+pe.length*30,width:600,height:400,zIndex:Pe,focused:!0,windowState:"normal"};return[...pe.map(De=>({...De,focused:!1})),ct]}),re==="files"&&g.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),re==="terminal"&&g.current.signalDock("terminal",{badge:3}),I.current&&I.current(re))},[]),L=w(re=>{c(ie=>{if(!ie.find(me=>me.id===re))return ie;let pe=Math.max(...ie.map(me=>me.zIndex))+1;return ie.map(me=>me.id===re?{...me,focused:!0,zIndex:pe,windowState:me.windowState==="minimized"?"normal":me.windowState}:{...me,focused:!1})})},[]),M=w(re=>{c(ie=>{let de=ie.filter(fe=>fe.appId===re);if(de.length===0)return ie;let me=[...de].sort((fe,ye)=>ye.zIndex-fe.zIndex)[0],he=Math.max(...ie.map(fe=>fe.zIndex))+1;return ie.map(fe=>fe.id===me.id?{...fe,focused:!0,zIndex:he,windowState:fe.windowState==="minimized"?"normal":fe.windowState}:{...fe,focused:!1})}),c(ie=>{if(ie.filter(pe=>pe.appId===re).length===0){let me=B.current.find(Pe=>Pe.id===re);if(!me)return ie;let he=Ri(re),fe=ie.length>0?Math.max(...ie.map(Pe=>Pe.zIndex))+1:1,ye={id:he,appId:me.id,title:me.label,icon:me.icon,x:60+ie.length*30,y:40+ie.length*30,width:600,height:400,zIndex:fe,focused:!0,windowState:"normal"};return re==="files"&&g.current.setMenuBar("files",{menus:[{label:"File",items:[{label:"New",shortcut:"Ctrl+N",onClick:()=>{}},{label:"Open",shortcut:"Ctrl+O",onClick:()=>{}},{label:"Save",shortcut:"Ctrl+S",onClick:()=>{}}]},{label:"Edit",items:[{label:"Cut",shortcut:"Ctrl+X",onClick:()=>{}},{label:"Copy",shortcut:"Ctrl+C",onClick:()=>{}},{label:"Paste",shortcut:"Ctrl+V",onClick:()=>{}}]}]}),re==="terminal"&&g.current.signalDock("terminal",{badge:3}),I.current&&I.current(re),[...ie.map(Pe=>({...Pe,focused:!1})),ye]}return ie})},[]),S=t.map(re=>{let ie=h.some(me=>me.appId===re.id),de=u.get(re.id),pe={id:re.id,icon:re.icon,label:de?.tooltip||re.label,active:ie};return de&&(de.badge!=null&&(pe.badge=de.badge>0?de.badge:void 0),de.progress!=null&&(pe.progress=de.progress>0?de.progress:void 0),de.urgent&&(pe.urgent=!0)),pe}),k=h.find(re=>re.focused),E=k?k.title:void 0,F=w(()=>{x(!0)},[]),R=w(()=>{x(!1)},[]),W=w((re,ie)=>{D(re),C(ie)},[]),_=w(()=>{D(null)},[]),O=w(()=>{},[]),H=w(()=>{i&&i()},[i]),X=[];n&&(X.push({label:n.name,icon:void 0,onClick:O,divider:!1}),X.push({label:"",icon:void 0,onClick:O,divider:!0})),X.push({label:"Lock",icon:void 0,onClick:F,divider:!1}),X.push({label:"Logout",icon:void 0,onClick:H,divider:!1});let J=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),K={display:"flex",flex:"1",overflow:"hidden"},U={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},j={width:"100%",height:"100%",position:"relative"},V=o(Cn,{activeAppName:E,activitiesButton:{label:"Activities",onClick:z},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:X.length>0?X:void 0,height:Nc}),Y=o(Mn,{items:S,orientation:"vertical",position:"left",iconSize:36,onItemClick:M,onItemContextMenu:W}),Z=o(_c,{toasts:f,onDismiss:P}),Q=h.filter(re=>re.windowState!=="minimized").map(re=>o(bt,{key:re.id,id:re.id,title:re.title,icon:re.icon,defaultPosition:{x:re.x,y:re.y},defaultSize:{width:re.width,height:re.height},zIndex:re.zIndex,focused:re.focused,windowState:re.windowState,onClose:()=>{c(ie=>ie.filter(de=>de.id!==re.id))},onFocus:()=>{c(ie=>{let de=Math.max(...ie.map(pe=>pe.zIndex))+1;return ie.map(pe=>pe.id===re.id?{...pe,focused:!0,zIndex:de}:{...pe,focused:!1})})},onMinimize:()=>{c(ie=>ie.map(de=>de.id===re.id?{...de,windowState:"minimized"}:de))},onMaximize:()=>{c(ie=>ie.map(de=>de.id===re.id?{...de,windowState:de.windowState==="maximized"?"normal":"maximized"}:de))}},Yc(re.title))),ae=[];a&&ae.push(a),ae.push(...Q),ae.push(Z);let ee=o(En,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:j},...ae)),te=y?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:z},...t.map(re=>o("button",{key:re.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:ie=>{ie.stopPropagation(),b(!1),M(re.id)}},o("span",{style:{fontSize:"32px",display:"block"}},re.icon),o("span",null,re.label)))):null,le=m?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:R},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,ce=(()=>{if(!v)return null;let re=t.find(fe=>fe.id===v),ie=h.filter(fe=>fe.appId===v),de={padding:"6px 14px",cursor:"pointer"},pe={onMouseEnter:fe=>{fe.currentTarget.style.backgroundColor="#444"},onMouseLeave:fe=>{fe.currentTarget.style.backgroundColor="transparent"}},me={borderBottom:"1px solid #444",margin:"4px 0"},he=[];return he.push(o("div",{key:"new",style:de,...pe,onClick:()=>{N(v),D(null)},role:"menuitem"},"\u25CF New")),ie.length>0&&(he.push(o("div",{key:"sep-1",style:me})),ie.forEach((fe,ye)=>{let Pe=ie.length===1?re?.label||fe.title:`${re?.label||Pi(fe.title)} (${ye+1})`;he.push(o("div",{key:`inst-${fe.id}`,style:de,...pe,onClick:()=>{L(fe.id),D(null)},role:"menuitem"},Pe))})),he.push(o("div",{key:"sep-2",style:me})),he.push(o("div",{key:"about",style:de,...pe,onClick:()=>{A(v),D(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:_},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${T.y}px`,left:`${T.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:fe=>fe.stopPropagation()},...he))})(),oe=$?t.find(re=>re.id===$):null,ue=oe?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>A(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:re=>re.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},oe.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>A(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:J,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},V),o("div",{style:K},o("div",{className:"unity-desktop__dock",style:U},Y),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},ee,te)),ce,ue,le)}function Ii(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(vn,{onWindowOpen:r},o(ft,null,o(gt,null,o(Vc,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function $i(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:g,onDeactivate:h,children:c}=e,f=pt(),p=q(()=>f.windows.find($=>$.id===t),[f.windows,t]);se(()=>(u?f.setMenuBar(t,u):f.clearMenuBar(t),()=>{f.clearMenuBar(t)}),[u,t,f]);let y=ne(!1),b=p?p.focused:!1;se(()=>{let $=y.current;y.current=b,b&&!$?g&&g():!b&&$&&h&&h()},[b,g,h]);let m=w(()=>{f.closeWindow(t),d&&d()},[f,t,d]),x=w(()=>{f.focusWindow(t)},[f,t]),v=w($=>{f.moveWindow(t,$)},[f,t]),D=w($=>{f.resizeWindow(t,$)},[f,t]),T=w(()=>{f.minimizeWindow(t)},[f,t]),C=w(()=>{p&&p.windowState==="maximized"?f.restoreWindow(t):f.maximizeWindow(t)},[f,t,p]);return p?o(_e,{appId:t},o(bt,{id:t,title:n,icon:r,defaultPosition:p.position,defaultSize:p.size,minSize:a,resizable:l,windowState:p.windowState,focused:p.focused,zIndex:p.zIndex,onClose:m,onFocus:x,onMove:v,onResize:D,onMinimize:T,onMaximize:C,children:c})):(f.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}var Ti={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},zi={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function Di(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:a=!1,type:l="button",className:d,style:u,ariaLabel:g,active:h=!1}=e,c=q(()=>{let f=Ti[i]??Ti.md,p=zi[r]??zi.secondary,y={padding:f.padding,fontSize:f.fontSize,borderRadius:f.borderRadius,border:`1px solid ${p.border}`,backgroundColor:h?"#3b82f6":p.bg,color:h?"white":p.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return a&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,a,h,u]);return o("button",{type:l,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":g,"aria-pressed":h?"true":void 0},t)}var Uc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],at=Math.PI/180;function jc(e,t,n,r,i,s,a,l,d,u){let g=Math.cos(r*at),h=Math.sin(r*at),c=Math.cos(i*at),f=Math.sin(i*at),p=Math.cos(s*at),y=Math.sin(s*at),b=e*p-t*y,m=e*y+t*p,x=b*c-m*f,v=b*f+m*c,D=n,T=x,C=v*g-D*h,$=v*h+D*g,A=1+a*.001*$,z=l+T*u*A,P=d-C*u*A;return{sx:z,sy:P,depth:$}}function Ai(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function Li(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let a=d=>Math.max(0,Math.min(255,Math.round(d*t))),l=d=>a(d).toString(16).padStart(2,"0");return"#"+l(r)+l(i)+l(s)}function Bi(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:a=45,rotateZ:l=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:g=2,colorScale:h=Uc,gridColor:c="#94a3b8",title:f}=e,p=q(()=>{let L=0,M=0,S=0;for(let k=0;k<t.length;k++){let E=t[k],F=E.data.length;F>L&&(L=F);for(let R=0;R<F;R++){let W=E.data[R].length;W>M&&(M=W);for(let _=0;_<W;_++){let O=Math.abs(E.data[R][_]??0);O>S&&(S=O)}}}return{maxRows:Math.max(L,1),maxCols:Math.max(M,1),maxHeight:S>0?S:1}},[t]),y=q(()=>{let L=p.maxHeight+(t.length-1)*g+p.maxHeight,M=Math.sqrt(p.maxCols*p.maxCols+p.maxRows*p.maxRows+L*L),S=Math.min(n,r)*.75;return M>0?S/M:1},[p,t.length,g,n,r]),b=n/2,m=r/2,x=w((L,M,S)=>jc(L,M,S,s,a,l,i,b,m,y),[s,a,l,i,b,m,y]),v=w(()=>{if(!u)return[];let L=[],M=Math.max(p.maxCols,p.maxRows),S=p.maxCols/2,k=p.maxRows/2,E=x(-S,-k,0),F=x(S,-k,0);L.push(o("line",{key:"axis-x",x1:String(E.sx),y1:String(E.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-x-label",x:String(F.sx+8),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let R=x(-S,k,0);L.push(o("line",{key:"axis-y",x1:String(E.sx),y1:String(E.sy),x2:String(R.sx),y2:String(R.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-y-label",x:String(R.sx-12),y:String(R.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=p.maxHeight+(t.length-1)*g,_=x(-S,-k,W);return L.push(o("line",{key:"axis-z",x1:String(E.sx),y1:String(E.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-z-label",x:String(_.sx-4),y:String(_.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),L},[u,p,t.length,g,x]),D=w(()=>{let L=[],M=p.maxCols/2,S=p.maxRows/2,k=[];for(let E=0;E<t.length;E++){let F=t[E],R=F.color??h[E%h.length],W=F.opacity??.7,_=E*g,O=F.data.length;for(let H=0;H<O-1;H++){let X=F.data[H],J=F.data[H+1],K=Math.min(X.length,J.length);for(let U=0;U<K-1;U++){let j=U-M,V=U+1-M,Y=H-S,Z=H+1-S,Q=(X[U]??0)+_,ae=(X[U+1]??0)+_,ee=(J[U]??0)+_,te=(J[U+1]??0)+_,le=x(j,Y,Q),ce=x(V,Y,ae),oe=x(j,Z,ee),ue=x(V,Z,te),re=(le.depth+ce.depth+oe.depth+ue.depth)/4,ie=`${le.sx},${le.sy} ${ce.sx},${ce.sy} ${ue.sx},${ue.sy} ${oe.sx},${oe.sy}`;k.push({points:ie,fill:Ai(R,W),stroke:Li(R,.7),strokeWidth:"0.5",depth:re,key:`quad-${E}-${H}-${U}`})}}if(O===1||O>0&&F.data[0].length===1)for(let H=0;H<O;H++){let X=F.data[H];for(let J=0;J<X.length;J++){let K=J-M,U=H-S,j=(X[J]??0)+_,V=x(K,U,j),Y=3,Z=`${V.sx},${V.sy-Y} ${V.sx+Y},${V.sy} ${V.sx},${V.sy+Y} ${V.sx-Y},${V.sy}`;k.push({points:Z,fill:Ai(R,W),stroke:Li(R,.7),strokeWidth:"0.5",depth:V.depth,key:`point-${E}-${H}-${J}`})}}}k.sort((E,F)=>E.depth-F.depth);for(let E=0;E<k.length;E++){let F=k[E];L.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return L},[t,p,g,h,x]),T=w(()=>{let L=[],M=p.maxCols/2,S=p.maxRows/2;for(let k=0;k<=p.maxRows;k++){let E=k-S,F=x(-M,E,0),R=x(M,E,0);L.push(o("line",{key:`base-h-${k}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let k=0;k<=p.maxCols;k++){let E=k-M,F=x(E,-S,0),R=x(E,S,0);L.push(o("line",{key:`base-v-${k}`,x1:String(F.sx),y1:String(F.sy),x2:String(R.sx),y2:String(R.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return L},[p,c,x]),C=w(()=>{if(!d)return[];let L=[],M=p.maxCols/2,S=p.maxRows/2;for(let k=0;k<t.length;k++){let E=t[k],F=k*g,R=0,W=0;for(let X=0;X<E.data.length;X++){let J=E.data[X];for(let K=0;K<J.length;K++)R+=J[K]??0,W++}let _=W>0?R/W:0,O=x(M+1,0,_+F),H=E.color??h[k%h.length];L.push(o("text",{key:`layer-label-${k}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:H},E.label))}return L},[d,t,p,g,h,x]),A=w(()=>f?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n])(),z=T(),P=v(),B=D(),I=C(),N=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...A,...N,...z,...P,...B,...I)}function Gc(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,a="";for(let l=0;l<s.length;l++)l>0&&(s.length-l)%3===0&&(a+=","),a+=s[l];return(i?"-":"")+a+r}function Xc(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Fi(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:g="currentColor",trendUpColor:h="#22c55e",trendDownColor:c="#ef4444",backgroundColor:f="#ffffff"}=e,p=q(()=>Gc(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),b=l!=null&&l.length>1,m=n!=null&&n.length>0,x=y&&s>=0?h:c,v=20,D=m?u*.38:u*.45,T=Math.min(d*.15,48),C=T*.55,$=D+T*.4+8,A=m?$+22:D+T*.4+22,z=b?Math.min(u*.22,36):0,P=u-v-z,B=d-v*2,I=w(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:f,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,f]),N=w(()=>{let O=[],H=r+p+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(D),"text-anchor":"middle","dominant-baseline":"central","font-size":String(T),"font-weight":"bold","font-family":"sans-serif",fill:g,"aria-label":`Value: ${H}`},r?o("tspan",{key:"prefix","font-size":String(C),"font-weight":"normal"},r):null,p,i?o("tspan",{key:"suffix","font-size":String(C),"font-weight":"normal"},i):null)),O},[d,D,T,C,p,r,i,g]),L=w(()=>m?[o("text",{key:"label",x:String(d/2),y:String($),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[m,d,$,n]),M=w(()=>{if(!y)return[];let O=[],H=s,X=H>=0,J=8,K=Xc(H),U=(X?"+":"-")+K+(a?" "+a:""),j=d/2-40,V=A;if(X){let Y=`${j},${V} ${j-J/2},${V+J} ${j+J/2},${V+J}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}else{let Y=`${j},${V+J} ${j-J/2},${V} ${j+J/2},${V}`;O.push(o("polygon",{key:"trend-arrow",points:Y,fill:x}))}return O.push(o("text",{key:"trend-text",x:String(j+J+4),y:String(V+J*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:x,"aria-label":`Trend: ${U}`},U)),O},[y,s,a,x,d,A]),S=w(()=>{if(!b)return[];let O=[],H=l,X=[];for(let Q of H)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&X.push(Q);if(X.length<2)return[];let J=1/0,K=-1/0;for(let Q of X)Q<J&&(J=Q),Q>K&&(K=Q);J===K&&(J-=1,K+=1);let U=K-J,j=B/(X.length-1),V="";for(let Q=0;Q<X.length;Q++){let ae=v+Q*j,ee=P+z-(X[Q]-J)/U*z;Q===0?V+=`M ${ae} ${ee}`:V+=` L ${ae} ${ee}`}let Y=v+(X.length-1)*j,Z=V+` L ${Y} ${P+z} L ${v} ${P+z} Z`;return O.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),O.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),O.push(o("path",{key:"spark-line",d:V,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[b,l,B,P,z,v]),k=I(),E=N(),F=L(),R=M(),W=S(),_=`${r}${p}${i}${m?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":_,style:{fontFamily:"sans-serif"}},...k,...W,...E,...F,...R)}var Vt=Math.PI/180;function qc(e,t,n,r,i,s,a,l){let d=Math.cos(r*Vt),u=Math.sin(r*Vt),g=Math.cos(i*Vt),h=Math.sin(i*Vt),c=e*g+n*h,f=-e*h+n*g,p=t*d-f*u,y=t*u+f*d;return{sx:s+c*l,sy:a-p*l,depth:y}}function lt(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function Ut(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,a=n/r,l=Math.acos(Math.max(-1,Math.min(1,a))),d=Math.atan2(s,i);return{theta:l,phi:d<0?d+2*Math.PI:d}}function Ue(e,t,n){let{x:r,y:i,z:s}=lt(e),a=Math.cos(n),l=Math.sin(n),d,u,g;return t==="x"?(d=r,u=i*a-s*l,g=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,g=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,g=s),Ut(d,u,g)}function Wn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ue(e,"x",Math.PI);case"Y":return Ue(e,"y",Math.PI);case"Z":return Ue(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=lt(e);return Ut(s,-i,r)}case"S":return Ue(e,"z",Math.PI/2);case"T":return Ue(e,"z",Math.PI/4);case"Rx":return Ue(e,"x",n);case"Ry":return Ue(e,"y",n);case"Rz":return Ue(e,"z",n)}}function Ni(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:a=15,zoom:l=1,interactive:d=!0,zoomable:u=!0,showVector:g=!0,showLabels:h=!0,showWireframe:c=!0,showTrail:f=!0,trailMaxPoints:p=200,trailColor:y="#ef4444",wireframeColor:b="#cbd5e1",vectorColor:m="#3b82f6",backgroundColor:x,sphereRadius:v=130,title:D,onStateChange:T}=e,[C,$]=G(t??{theta:0,phi:0}),[A,z]=G(s),[P,B]=G(a),[I,N]=G(l),L=ne([]),M=ne(!1),S=ne(null),k=ne(null);se(()=>{t&&$(t)},[t?.theta,t?.phi]);let E=ne(0);se(()=>{if(!n||n.length===0)return;E.current=0;let j=0,V=()=>{E.current>=n.length||($(Y=>{let Z=Wn(Y,n[E.current]);return E.current++,T&&T(Z),Z}),j=requestAnimationFrame(V))};return j=requestAnimationFrame(V),()=>cancelAnimationFrame(j)},[n]),se(()=>{let j=lt(C);L.current.push(j),L.current.length>p&&L.current.splice(0,L.current.length-p)},[C.theta,C.phi]);let F=v*I,R=r/2,W=i/2,_=w((j,V,Y)=>qc(j,V,Y,P,A,R,W,F),[P,A,R,W,F]),O=w(j=>{if(!d)return;let V=j;M.current=!0,S.current={mx:V.clientX,my:V.clientY,rx:P,ry:A}},[d,P,A]),H=w(j=>{if(!M.current||!S.current)return;let V=j,Y=S.current;z(Y.ry+(V.clientX-Y.mx)*.5),B(Y.rx-(V.clientY-Y.my)*.5)},[]),X=w(()=>{M.current=!1},[]),J=w(j=>{if(!u)return;let V=j;V.preventDefault(),N(Y=>Math.max(.5,Math.min(3,Y*(V.deltaY>0?.95:1.05))))},[u]),K=[];if(x&&K.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:x,rx:"6"})),D&&K.push(o("text",{key:"title",x:String(R),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D)),c){let V=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(Math.cos(ae),Math.sin(ae),0);V.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"eq",d:V.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.5"}));let Y=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(Math.cos(ae),0,Math.sin(ae));Y.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"xz",d:Y.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let Q=0;Q<=60;Q++){let ae=Q/60*2*Math.PI,ee=_(0,Math.cos(ae),Math.sin(ae));Z.push(`${Q===0?"M":"L"}${ee.sx.toFixed(1)},${ee.sy.toFixed(1)}`)}K.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:b,"stroke-width":"0.8",opacity:"0.4"}))}let U=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let j of U){let V=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),Y=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),Z=_(0,0,0);K.push(o("line",{key:`axis-${j.id}`,x1:String(Y.sx),y1:String(Y.sy),x2:String(V.sx),y2:String(V.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(h){let j=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let V of j){let Y=_(V.pos[0],V.pos[1],V.pos[2]);K.push(o("text",{key:`lbl-${V.text}`,x:String(Y.sx),y:String(Y.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},V.text))}}if(f&&L.current.length>1){let j=L.current,V=[];for(let Y=0;Y<j.length;Y++){let Z=j[Y],Q=_(Z.x,Z.y,Z.z);V.push(`${Y===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}K.push(o("path",{key:"trail",d:V.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){let j=lt(C),V=_(0,0,0),Y=_(j.x,j.y,j.z);K.push(o("line",{key:"vec-line",x1:String(V.sx),y1:String(V.sy),x2:String(Y.sx),y2:String(Y.sy),stroke:m,"stroke-width":"2.5","stroke-linecap":"round"})),K.push(o("circle",{key:"vec-point",cx:String(Y.sx),cy:String(Y.sy),r:"5",fill:m,stroke:"#fff","stroke-width":"1.5"}));let Z=(C.theta*180/Math.PI).toFixed(0),Q=(C.phi*180/Math.PI).toFixed(0);K.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${Z}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:k,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":D??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?M.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?H:void 0,onMouseUp:d?X:void 0,onMouseLeave:d?X:void 0,onWheel:u?J:void 0},...K)}function Kc(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function _n(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function On(e){let t=Kc(e);if(t.length===0)return null;let n=_n(t,25),r=_n(t,50),i=_n(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let f of t)if(f>=a){d=f;break}let u=t[t.length-1];for(let f=t.length-1;f>=0;f--)if(t[f]<=l){u=t[f];break}let g=0;for(let f of t)g+=f;let h=g/t.length,c=[];for(let f of t)(f<a||f>l)&&c.push(f);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:h,outliers:c,min:t[0],max:t[t.length-1]}}function Zc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Wi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:a=!1,whiskerColor:l="#374151",boxWidth:d=.6,showGrid:u=!0,title:g,padding:h=60}=e,c=i==="vertical",f=n-h*2,p=r-h*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=q(()=>{let S=[];for(let k of t)S.push(On(k.values));return S},[t]),m=q(()=>{let S=1/0,k=-1/0;for(let R of b){if(R===null)continue;let W=s&&R.outliers.length>0?Math.min(R.whiskerLow,R.outliers[0]):R.whiskerLow,_=s&&R.outliers.length>0?Math.max(R.whiskerHigh,R.outliers[R.outliers.length-1]):R.whiskerHigh;W<S&&(S=W),_>k&&(k=_)}isFinite(S)||(S=0,k=1);let E=k-S,F=E>0?E*.05:.5;return{min:S-F,max:k+F}},[b,s]),x=c?p:f,v=c?f:p,D=t.length>0?t.length:1,T=v/D,C=T*Math.min(Math.max(d,.1),.95),$=w(S=>{let k=m.max-m.min;return k===0?x/2:(S-m.min)/k*x},[m,x]),A=w(()=>{if(!u)return[];let S=[],k=m.max-m.min,E=Zc(k),F=Math.ceil(m.min/E)*E;for(let R=F;R<=m.max;R+=E){let W=$(R),_=String(Math.round(R*1e3)/1e3);if(c){let O=h+p-W;S.push(o("line",{key:`grid-${R}`,x1:String(h),y1:String(O),x2:String(h+f),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`glabel-${R}`,x:String(h-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=h+W;S.push(o("line",{key:`grid-${R}`,x1:String(O),y1:String(h),x2:String(O),y2:String(h+p),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`glabel-${R}`,x:String(O),y:String(h+p+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return S},[u,m,$,c,h,f,p]),z=w(()=>{let S=[];return S.push(o("line",{key:"axis-value",x1:String(h),y1:String(c?h:h+p),x2:String(h),y2:String(h+p),stroke:"#374151","stroke-width":"1.5"})),S.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+p),x2:String(h+f),y2:String(h+p),stroke:"#374151","stroke-width":"1.5"})),S},[h,f,p,c]),P=w(()=>{let S=[];for(let k=0;k<t.length;k++){let E=b[k];if(E===null)continue;let F=t[k],R=F.color??y[k%y.length],W=T*k+T/2,_=C/2;if(c){let O=h+p-$(E.q1),H=h+p-$(E.q3),X=h+p-$(E.median),J=h+p-$(E.whiskerLow),K=h+p-$(E.whiskerHigh),U=h+W;S.push(o("line",{key:`wl-${k}`,x1:String(U),y1:String(O),x2:String(U),y2:String(J),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wlc-${k}`,x1:String(U-_*.4),y1:String(J),x2:String(U+_*.4),y2:String(J),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wh-${k}`,x1:String(U),y1:String(H),x2:String(U),y2:String(K),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`whc-${k}`,x1:String(U-_*.4),y1:String(K),x2:String(U+_*.4),y2:String(K),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,H),V=Math.abs(O-H);if(S.push(o("rect",{key:`box-${k}`,x:String(U-_),y:String(j),width:String(C),height:String(Math.max(V,1)),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),S.push(o("line",{key:`med-${k}`,x1:String(U-_),y1:String(X),x2:String(U+_),y2:String(X),stroke:"#fff","stroke-width":"2.5"})),a){let Y=h+p-$(E.mean);S.push(o("circle",{key:`mean-${k}`,cx:String(U),cy:String(Y),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let Z=h+p-$(E.outliers[Y]);S.push(o("circle",{key:`out-${k}-${Y}`,cx:String(U),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}S.push(o("text",{key:`cat-${k}`,x:String(U),y:String(h+p+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=h+$(E.q1),H=h+$(E.q3),X=h+$(E.median),J=h+$(E.whiskerLow),K=h+$(E.whiskerHigh),U=h+W;S.push(o("line",{key:`wl-${k}`,x1:String(O),y1:String(U),x2:String(J),y2:String(U),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wlc-${k}`,x1:String(J),y1:String(U-_*.4),x2:String(J),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`wh-${k}`,x1:String(H),y1:String(U),x2:String(K),y2:String(U),stroke:l,"stroke-width":"1.5"})),S.push(o("line",{key:`whc-${k}`,x1:String(K),y1:String(U-_*.4),x2:String(K),y2:String(U+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,H),V=Math.abs(H-O);if(S.push(o("rect",{key:`box-${k}`,x:String(j),y:String(U-_),width:String(Math.max(V,1)),height:String(C),fill:R,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${E.q1.toFixed(1)}, median=${E.median.toFixed(1)}, Q3=${E.q3.toFixed(1)}`,role:"img"})),S.push(o("line",{key:`med-${k}`,x1:String(X),y1:String(U-_),x2:String(X),y2:String(U+_),stroke:"#fff","stroke-width":"2.5"})),a){let Y=h+$(E.mean);S.push(o("circle",{key:`mean-${k}`,cx:String(Y),cy:String(U),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${E.mean.toFixed(1)}`}))}if(s)for(let Y=0;Y<E.outliers.length;Y++){let Z=h+$(E.outliers[Y]);S.push(o("circle",{key:`out-${k}-${Y}`,cx:String(Z),cy:String(U),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${E.outliers[Y]}`}))}S.push(o("text",{key:`cat-${k}`,x:String(h-6),y:String(U+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return S},[t,b,$,c,h,f,p,T,C,l,s,a,y]),B=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n,h]),I=A(),N=z(),L=P(),M=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Box plot",style:{fontFamily:"sans-serif"}},...M,...I,...N,...L)}function _i(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Jc(e,t,n){return e<t?t:e>n?n:e}function Hn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Oi(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:a=!0,showAxes:l=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:g=4,defaultColor:h="#3b82f6",opacity:c=.7,title:f,padding:p=60}=e,y=q(()=>{let L=[];for(let M=0;M<t.length;M++){let S=t[M];Hn(S.x)&&Hn(S.y)&&Hn(S.r)&&L.push(S)}return L},[t]),b=n-p*2,m=r-p*2,x=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let L=1/0,M=-1/0,S=1/0,k=-1/0,E=1/0,F=-1/0;for(let R of y)R.x<L&&(L=R.x),R.x>M&&(M=R.x),R.y<S&&(S=R.y),R.y>k&&(k=R.y),R.r<E&&(E=R.r),R.r>F&&(F=R.r);return L===M&&(L-=1,M+=1),S===k&&(S-=1,k+=1),E===F&&(E=0,F=F>0?F:1),{xMin:L,xMax:M,yMin:S,yMax:k,rMin:E,rMax:F}},[y]),v=w(L=>{let M=x.xMax-x.xMin;return p+(L-x.xMin)/M*b},[x,p,b]),D=w(L=>{let M=x.yMax-x.yMin;return p+m-(L-x.yMin)/M*m},[x,p,m]),T=w(L=>{let M=x.rMax-x.rMin;if(M===0)return(g+u)/2;let S=(L-x.rMin)/M;return g+S*(u-g)},[x,g,u]),C=w(()=>{if(!a)return[];let L=[],M=_i(x.xMax-x.xMin),S=Math.ceil(x.xMin/M)*M;for(let F=S;F<=x.xMax;F+=M){let R=v(F);L.push(o("line",{key:`grid-x-${F}`,x1:String(R),y1:String(p),x2:String(R),y2:String(p+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-xlabel-${F}`,x:String(R),y:String(p+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let k=_i(x.yMax-x.yMin),E=Math.ceil(x.yMin/k)*k;for(let F=E;F<=x.yMax;F+=k){let R=D(F);L.push(o("line",{key:`grid-y-${F}`,x1:String(p),y1:String(R),x2:String(p+b),y2:String(R),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-ylabel-${F}`,x:String(p-6),y:String(R+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return L},[a,x,v,D,p,b,m]),$=w(()=>{if(!l)return[];let L=[];return L.push(o("line",{key:"axis-y",x1:String(p),y1:String(p),x2:String(p),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),L.push(o("line",{key:"axis-x",x1:String(p),y1:String(p+m),x2:String(p+b),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),i&&L.push(o("text",{key:"x-label",x:String(p+b/2),y:String(p+m+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&L.push(o("text",{key:"y-label",x:String(p-40),y:String(p+m/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${p-40}, ${p+m/2})`},s)),L},[l,p,b,m,i,s]),A=w(()=>{let L=[];for(let M=0;M<y.length;M++){let S=y[M],k=v(S.x),E=D(S.y),F=Jc(T(S.r),g,u),R=S.color??h;L.push(o("circle",{key:`bubble-${M}`,cx:String(k),cy:String(E),r:String(F),fill:R,opacity:String(c),stroke:R,"stroke-width":"1","stroke-opacity":"0.8","aria-label":S.label??`Bubble at (${S.x}, ${S.y}) size ${S.r}`,role:"img"})),d&&S.label&&L.push(o("text",{key:`label-${M}`,x:String(k),y:String(E-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},S.label))}return L},[y,v,D,T,h,c,d,g,u]),z=w(()=>f?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)]:[],[f,n,p]),P=C(),B=$(),I=A(),N=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...I)}var Qc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ed=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function td(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function Hi(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Yi(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function nd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function od(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yi(t[i]),l=Yi(t[i+1]);return nd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var rd=["#9be9a8","#40c463","#30a14e","#216e39"];function Vi(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=rd,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:g}=e,{dateMap:h,startDate:c,endDate:f,maxVal:p}=q(()=>{let I=new Map,N=0,L=null,M=null;for(let E of t){let F=td(E.date);if(isNaN(F.getTime()))continue;let R=Hi(F);I.set(R,(I.get(R)??0)+E.value);let W=I.get(R);W>N&&(N=W),(L===null||F<L)&&(L=F),(M===null||F>M)&&(M=F)}if(L===null||M===null){let E=new Date;L=new Date(E.getFullYear(),0,1),M=new Date(E.getFullYear(),11,31)}let S=new Date(L);S.setDate(S.getDate()-S.getDay());let k=new Date(M);return k.setDate(k.getDate()+(6-k.getDay())),{dateMap:I,startDate:S,endDate:k,maxVal:N>0?N:1}},[t]),y=d?30:0,b=l?16:0,m=g?28:0,x=y+10,v=m+b+4,D=w(()=>{let I=[],N=new Date(c),L=0;for(;N<=f;){let M=N.getDay();M===0&&N>c&&L++;let S=Hi(N),k=h.get(S),E=k!==void 0&&k>0?od(k/p,i):u,F=x+L*(s+a),R=v+M*(s+a);I.push(o("rect",{key:`day-${S}`,x:String(F),y:String(R),width:String(s),height:String(s),rx:"2",ry:"2",fill:E,"aria-label":`${S}: ${k??0}`})),N.setDate(N.getDate()+1)}return I},[c,f,h,p,i,u,s,a,x,v]),T=w(()=>{if(!l)return[];let I=[],N=new Date(c),L=0,M=-1;for(;N<=f;){let S=N.getDay();S===0&&N>c&&L++;let k=N.getMonth();if(k!==M&&S===0){M=k;let E=x+L*(s+a);I.push(o("text",{key:`month-${L}`,x:String(E),y:String(m+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Qc[k]))}N.setDate(N.getDate()+1)}return I},[l,c,f,s,a,x,m,b]),C=w(()=>{if(!d)return[];let I=[],N=[1,3,5];for(let L of N){let M=v+L*(s+a)+s/2;I.push(o("text",{key:`day-label-${L}`,x:String(y),y:String(M),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},ed[L]))}return I},[d,s,a,v,y]),$=w(()=>g?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let A=$(),z=T(),P=C(),B=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Calendar heat map",style:{fontFamily:"sans-serif"}},...A,...z,...P,...B)}var id=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Fe(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function sd(e,t,n,r,i,s){let a=Fe(e,t,n,i),l=Fe(e,t,n,s),d=Fe(e,t,r,i),u=Fe(e,t,r,s),h=s-i>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${h} 1 ${l.x} ${l.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${h} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function ad(e,t,n,r,i,s,a){let l=Fe(e,t,n,r),d=Fe(e,t,n,i),u=Fe(e,t,n,s),g=Fe(e,t,n,a),h=i-r,c=a-s,f=h>Math.PI?1:0,p=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${f} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${p} 1 ${g.x} ${g.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function ld(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],a=0;for(let c=0;c<i;c++){let f=0;for(let p=0;p<i;p++){let y=e[c]?.[p]??0;f+=Math.max(0,y)}s.push(f),a+=f}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),f=[],p=0;for(let y=0;y<i;y++)f.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:p,endAngle:p+c,value:0}),p+=c+r;return{groups:f,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let f=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+f,value:s[c]}),u+=f+r}let g=[];for(let c=0;c<i;c++)g.push(d[c].startAngle);let h=[];for(let c=0;c<i;c++)for(let f=c;f<i;f++){let p=Math.max(0,e[c]?.[f]??0),y=c===f?0:Math.max(0,e[f]?.[c]??0);if(p===0&&y===0)continue;let b=p+y,m=s[c]>0?p/a*l:0,x=g[c],v=x+m;g[c]=v;let D=s[f]>0?p/a*l:0,T=g[f],C=T+D;if(g[f]=C,c===f){p>0&&h.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:v,targetStartAngle:T,targetEndAngle:C,value:p,color:d[c].color});continue}let $=s[f]>0?y/a*l:0,z=g[f]+$;g[f]=z;let P=s[c]>0?y/a*l:0,I=g[c]+P;g[c]=I,(p>0||y>0)&&h.push({sourceIndex:c,targetIndex:f,sourceStartAngle:x,sourceEndAngle:Math.max(v,x+.001),targetStartAngle:T,targetEndAngle:Math.max(C,T+.001),value:b,color:d[c].color})}return{groups:d,chords:h}}function Ui(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=id,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:g=.9,title:h}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,f=i/2,p=Math.min(r,i)/2-40,y=p*Math.max(.5,Math.min(.99,g)),b=p+16,m=q(()=>ld(t,n,s,a),[t,n,s,a]),x=w(()=>{let A=[];for(let z=0;z<m.groups.length;z++){let P=m.groups[z];if(P.endAngle-P.startAngle<.001)continue;let I=sd(c,f,p,y,P.startAngle,P.endAngle);if(A.push(o("path",{key:`arc-${z}`,d:I,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),l){let N=(P.startAngle+P.endAngle)/2,L=Fe(c,f,b,N),k=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,E=k?"start":"end",F=N*180/Math.PI-90;k||(F+=180);let R=d?`${P.label} (${P.value})`:P.label;A.push(o("text",{key:`label-${z}`,x:String(L.x),y:String(L.y),"text-anchor":E,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${L.x}, ${L.y})`,"dominant-baseline":"central","pointer-events":"none"},R))}}return A},[m,c,f,p,y,b,l,d]),v=w(()=>{let A=[];for(let z=0;z<m.chords.length;z++){let P=m.chords[z],B=ad(c,f,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);A.push(o("path",{key:`ribbon-${z}`,d:B,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return A},[m,c,f,y,u]),D=w(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),T=v(),C=x(),$=D();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Chord diagram",style:{fontFamily:"sans-serif"}},...$,...T,...C)}var cd=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function dd(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,a,l]=r.shift(),d=n++;i=Math.max(i,a);let u=s.children??[],g=[];for(let h=0;h<u.length;h++)g.push(n+r.length+h);t.push({id:d,node:s,depth:a,parentId:l,childIndices:g});for(let h=0;h<u.length;h++)r.push([u[h],a+1,d])}return{flatNodes:t,maxDepth:i}}function ud(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let a of i.childIndices)a<t&&(s+=n[a]);n[r]=Math.max(s,1)}}return n}function pd(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=dd(e);if(d.length===0)return[];let g=ud(d),h=t-s*2,c=n-s*2,f=a==="horizontal",p=u+1,y=f?p>1?(h-r)/u:0:p>1?(c-i)/u:0,b=new Array(d.length),m=g[0],x=f?c:h,v=m>0?x/m:x,D=new Array(d.length);D[0]=[0,m];let T=[0],C=0;for(;C<T.length;){let $=T[C];C++;let A=d[$],[z,P]=D[$],B=(z+P)/2,I=s+A.depth*y,N=s+(B-.5)*v,L=f?I:N,M=f?N:I,S=A.node.color??l[A.depth%l.length];b[$]={id:A.id,label:A.node.label,value:A.node.value!==void 0?String(A.node.value):"",color:S,depth:A.depth,x:L,y:M,parentId:A.parentId,childCount:A.childIndices.length,subtreeLeafCount:g[$]};let k=z;for(let E of A.childIndices)if(E<d.length){let F=g[E],R=k+F;D[E]=[k,R],k=R,T.push(E)}}return b}function ji(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:a=40,showValues:l=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:g=cd,title:h,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=i==="horizontal",p=q(()=>pd(t,n,r,s,a,c,i,g),[t,n,r,s,a,c,i,g]),y=q(()=>{let C=new Map;for(let $=0;$<p.length;$++){let A=p[$];C.set(A.id,A)}return C},[p]),b=w(()=>{if(!d)return[];let C=[];for(let $=0;$<p.length;$++){let A=p[$];if(A.parentId===null)continue;let z=y.get(A.parentId);if(!z)continue;let P,B,I,N;f?(P=z.x+s,B=z.y+a/2,I=A.x,N=A.y+a/2):(P=z.x+s/2,B=z.y+a,I=A.x+s/2,N=A.y);let L=(P+I)/2,M=(B+N)/2,S;f?S=`M ${P} ${B} C ${L} ${B}, ${L} ${N}, ${I} ${N}`:S=`M ${P} ${B} C ${P} ${M}, ${I} ${M}, ${I} ${N}`,C.push(o("path",{key:`conn-${$}`,d:S,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[p,y,f,s,a,d,u]),m=w(()=>{let C=[];for(let $=0;$<p.length;$++){let A=p[$];C.push(o("rect",{key:`node-rect-${A.id}`,x:String(A.x),y:String(A.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:A.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":A.value?`${A.label}: ${A.value}`:A.label}));let z=l&&A.value?A.y+a/2-2:A.y+a/2+4;C.push(o("text",{key:`node-label-${A.id}`,x:String(A.x+s/2),y:String(z),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},A.label)),l&&A.value&&C.push(o("text",{key:`node-value-${A.id}`,x:String(A.x+s/2),y:String(A.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},A.value))}return C},[p,s,a,l]),x=w(()=>h?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),v=b(),D=m(),T=x();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Decomposition tree",style:{fontFamily:"sans-serif"}},...T,...v,...D)}var Gi=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function fd(e){return Gi[e%Gi.length]}function Xi(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,a=e.length,l=[];for(let d=0;d<a;d++){let u=e[d],g=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??fd(d),x:u.x??r+s*Math.cos(g),y:u.y??i+s*Math.sin(g),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function qi(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let a=e[s];if(!a.solid)continue;let l=a.x-i.x,d=a.y-i.y,u=l*l+d*d;if(u>=n*n||u<1e-4)continue;let g=Math.sqrt(u),h=l/g,c=d/g,f=n-g;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=h*f,a.y+=c*f):a.fixed?(i.x-=h*f,i.y-=c*f):(i.x-=h*f*.5,i.y-=c*f*.5,a.x+=h*f*.5,a.y+=c*f*.5);let p=i.vx-a.vx,y=i.vy-a.vy,b=p*h+y*c;b<=0||(i.fixed?(a.vx+=b*h,a.vy+=b*c):a.fixed?(i.vx-=b*h,i.vy-=b*c):(i.vx-=b*h,i.vy-=b*c,a.vx+=b*h,a.vy+=b*c))}}}function md(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let g=new Map;for(let x=0;x<u;x++)g.set(e[x].id,x);let h=new Float64Array(u),c=new Float64Array(u);for(let x=0;x<u;x++){let v=e[x];for(let D=x+1;D<u;D++){let T=e[D],C=v.x-T.x,$=v.y-T.y,A=C*C+$*$;A<1&&(A=1);let z=Math.sqrt(A),P=i/A,B=C/z*P,I=$/z*P;h[x]+=B,c[x]+=I,h[D]-=B,c[D]-=I}}for(let x=0;x<t.length;x++){let v=t[x],D=g.get(v.source),T=g.get(v.target);if(D===void 0||T===void 0)continue;let C=e[D],$=e[T],A=$.x-C.x,z=$.y-C.y,P=Math.sqrt(A*A+z*z);if(P<.1)continue;let B=v.weight??1,I=P-l,N=s*I*B,L=A/P*N,M=z/P*N;h[D]+=L,c[D]+=M,h[T]-=L,c[T]-=M}let f=n/2,p=r/2,y=.001;for(let x=0;x<u;x++){let v=e[x];h[x]+=(f-v.x)*y,c[x]+=(p-v.y)*y}let b=20,m=[];for(let x=0;x<u;x++){let v=e[x];if(v.fixed){m.push({...v,vx:0,vy:0});continue}let D=(v.vx+h[x])*a,T=(v.vy+c[x])*a,C=Math.sqrt(D*D+T*T),$=10;C>$&&(D=D/C*$,T=T/C*$);let A=v.x+D,z=v.y+T;A=Math.max(b,Math.min(n-b,A)),z=Math.max(b,Math.min(r-b,z)),m.push({...v,x:A,y:z,vx:D,vy:T})}return qi(m,d),m}function gd(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function Ki(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:a=2,solidNodes:l=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:g=300,attractionForce:h=.01,damping:c=.9,edgeLength:f=100,edgeColor:p="#94a3b8",edgeWidth:y=1.5,title:b,customForce:m,trails:x}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Empty force-directed graph"},b?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let v=ne(Xi(t,r,i)),[D,T]=G(0),C=ne(!0),$=ne(!1),A=ne(n);A.current=n;let z=ne(m);z.current=m;let P=ne(null),B=ne({repulsionForce:g,attractionForce:h,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:g,attractionForce:h,damping:c,edgeLength:f,width:r,height:i,nodeRadius:s,solidNodes:l};let I=ne(new Map);se(()=>{v.current=Xi(t,r,i),$.current=!1,C.current=!0,I.current=new Map,T(ae=>ae+1)},[t.length]),se(()=>{let ae=0,ee=()=>{if(!C.current)return;let te=B.current,le=z.current,ce;if(le?(ce=le(v.current,A.current,te.width,te.height,P.current),te.solidNodes&&qi(ce,te.nodeRadius)):ce=md(v.current,A.current,te.width,te.height,te.repulsionForce,te.attractionForce,te.damping,te.edgeLength,te.nodeRadius),v.current=ce,x)for(let oe=0;oe<x.length;oe++){let ue=x[oe],re=ce.find(pe=>pe.id===ue.nodeId);if(!re)continue;let ie=I.current.get(ue.nodeId);ie||(ie=[],I.current.set(ue.nodeId,ie)),ie.push({x:re.x,y:re.y});let de=ue.maxPoints??200;ie.length>de&&ie.splice(0,ie.length-de)}if(!le&&gd(ce)<.01){$.current=!0,T(oe=>oe+1);return}T(oe=>oe+1),ae=requestAnimationFrame(ee)};return ae=requestAnimationFrame(ee),()=>{C.current=!1,cancelAnimationFrame(ae)}},[]);let N=v.current,L=w(ae=>{v.current=v.current.map(ee=>ee.id===ae?{...ee,fixed:!ee.fixed,vx:0,vy:0}:ee),$.current&&($.current=!1,C.current=!0,T(ee=>ee+1))},[]),M=ne(null),S=ne(null),k=w(ae=>{let ee=ae,te=S.current;if(!te)return{x:ee.clientX,y:ee.clientY};let le=te.getBoundingClientRect(),ce=r/le.width,oe=i/le.height;return{x:(ee.clientX-le.left)*ce,y:(ee.clientY-le.top)*oe}},[r,i]),E=ne(!1),F=w((ae,ee)=>{ee.stopPropagation(),M.current=ae;let te=v.current.find(le=>le.id===ae);E.current=te?.fixed??!1,v.current=v.current.map(le=>le.id===ae?{...le,fixed:!0,vx:0,vy:0}:le)},[]),R=w(ae=>{let ee=k(ae);if(P.current={x:ee.x,y:ee.y},!M.current)return;let te=M.current,le=20;v.current=v.current.map(ce=>ce.id===te?{...ce,x:Math.max(le,Math.min(r-le,ee.x)),y:Math.max(le,Math.min(i-le,ee.y))}:ce),$.current&&($.current=!1,C.current=!0),T(ce=>ce+1)},[r,i,k]),W=w(()=>{let ae=M.current;ae&&(v.current=v.current.map(ee=>ee.id===ae?{...ee,fixed:E.current}:ee)),M.current=null},[]),_=w(()=>{M.current=null,P.current=null},[]),O=q(()=>{let ae=new Map;for(let ee=0;ee<N.length;ee++)ae.set(N[ee].id,N[ee]);return ae},[D]),H=w(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:p})))]:[],[u,s,p]),X=w(()=>{let ae=[];for(let ee=0;ee<n.length;ee++){let te=n[ee],le=O.get(te.source),ce=O.get(te.target);if(!le||!ce||te.weight!==void 0&&te.weight<=0)continue;let oe=te.weight?Math.max(.5,Math.min(6,y*te.weight)):y,ue={key:`edge-${ee}`,x1:String(le.x),y1:String(le.y),x2:String(ce.x),y2:String(ce.y),stroke:te.color??p,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(ue["marker-end"]="url(#arrowhead)"),ae.push(o("line",ue))}return ae},[D,p,y,u]),J=w(()=>{let ae=[];for(let ee=0;ee<N.length;ee++){let te=N[ee];ae.push(o("circle",{key:`node-${te.id}`,cx:String(te.x),cy:String(te.y),r:String(s),fill:te.color,stroke:te.fixed?"#0f172a":"#fff","stroke-width":te.fixed?"3":String(a),style:{cursor:M.current===te.id?"grabbing":"grab"},onMouseDown:le=>F(te.id,le),onDblClick:()=>L(te.id),role:"button",tabIndex:0,"aria-label":`Node: ${te.label}${te.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ae.push(o("text",{key:`label-${te.id}`,x:String(te.x),y:String(te.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},te.label))}return ae},[D,s,d,L]),K=w(()=>b?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r]),U=w(()=>{if(!x||x.length===0)return[];let ae=[];for(let ee=0;ee<x.length;ee++){let te=x[ee],le=I.current.get(te.nodeId);if(!le||le.length<2)continue;let ce=[];for(let oe=0;oe<le.length;oe++){let ue=le[oe];ce.push(`${oe===0?"M":"L"}${ue.x.toFixed(1)},${ue.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${te.nodeId}`,d:ce.join(" "),fill:"none",stroke:te.color??"#3b82f6","stroke-width":String(te.width??1),opacity:String(te.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ae},[D,x]),j=H(),V=U(),Y=X(),Z=J(),Q=K();return o("svg",{ref:S,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:M.current?"grabbing":"default"},onMouseMove:R,onMouseUp:W,onMouseLeave:_},...j,...Q,...V,...Y,...Z)}var Zi=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ji(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:a=!0,showPercentage:l=!0,gapSize:d=2,colors:u=Zi,title:g}=e,h=i==="vertical",c=g?30:0,f=120,p=q(()=>{let A=0;for(let z=0;z<t.length;z++)t[z].value>A&&(A=t[z].value);return A>0?A:1},[t]),y=w(A=>p===0?0:Math.max(.05,A/p),[p]),b=w((A,z)=>z||(u[A%u.length]??Zi[0]),[u]),m=w(()=>{if(t.length===0)return[];let A=[],z=40,P=n-z*2-f,B=r-c-z*2,I=d*(t.length-1),N=Math.max(1,(B-I)/t.length),L=z+P/2;for(let M=0;M<t.length;M++){let S=t[M],k=M<t.length-1?t[M+1]:null,E=b(M,S.color),F=y(S.value),R=k!==null?y(k.value):F*.6,W=P/2*F,_=P/2*R,O=c+z+M*(N+d),H=L-W,X=L+W,J=L+_,K=L-_,U=`${H},${O} ${X},${O} ${J},${O+N} ${K},${O+N}`;A.push(o("polygon",{key:`section-${M}`,points:U,fill:E,stroke:"#fff","stroke-width":"1"}));let j=z+P+12,V=O+N/2;if(s&&A.push(o("text",{key:`label-${M}`,x:String(j),y:String(V-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},S.label)),a||l){let Y="";if(a&&(Y=String(S.value)),l&&t.length>0){let Z=t[0].value,Q=Z>0?Math.round(S.value/Z*100):0;Y+=a?` (${Q}%)`:`${Q}%`}A.push(o("text",{key:`value-${M}`,x:String(j),y:String(V+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},Y))}}return A},[t,n,r,c,d,s,a,l,b,y,f]),x=w(()=>{if(t.length===0)return[];let A=[],z=40,P=n-z*2,I=r-c-z*2-40,N=d*(t.length-1),L=Math.max(1,(P-N)/t.length),M=c+z+I/2;for(let S=0;S<t.length;S++){let k=t[S],E=S<t.length-1?t[S+1]:null,F=b(S,k.color),R=y(k.value),W=E!==null?y(E.value):R*.6,_=I/2*R,O=I/2*W,H=z+S*(L+d),X=M-_,J=M-O,K=M+O,U=M+_,j=`${H},${X} ${H+L},${J} ${H+L},${K} ${H},${U}`;A.push(o("polygon",{key:`section-${S}`,points:j,fill:F,stroke:"#fff","stroke-width":"1"}));let V=H+L/2,Y=c+z+I+14;if(s&&A.push(o("text",{key:`label-${S}`,x:String(V),y:String(Y),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},k.label)),a||l){let Z="";if(a&&(Z=String(k.value)),l&&t.length>0){let Q=t[0].value,ae=Q>0?Math.round(k.value/Q*100):0;Z+=a?` (${ae}%)`:`${ae}%`}A.push(o("text",{key:`value-${S}`,x:String(V),y:String(Y+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return A},[t,n,r,c,d,s,a,l,b,y]),v=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,n]),D=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),T=v(),C=h?m():x(),$=D();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Funnel chart",style:{fontFamily:"sans-serif"}},...T,...C,...$)}var Qi=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function es(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function hd(e,t){return t||Qi[e%Qi.length]}function ts(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:a=!0,showLabels:l=!0,showProgress:d=!1,timeUnit:u="days",title:g,padding:h=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=l?120:0,f=q(()=>{let B=1/0,I=-1/0;for(let N of t){N.start<B&&(B=N.start);let L=N.start+N.duration;L>I&&(I=L)}return B===1/0&&(B=0,I=1),{min:B,max:I,range:I-B}},[t]),p=q(()=>{let B=t.slice();return B.sort((I,N)=>I.group!==N.group?(I.group??"").localeCompare(N.group??""):I.start-N.start),B},[t]),y=r??h*2+p.length*(i+s)+s+20,b=n-h-c-h,m=h+(g?20:0),x=w(B=>f.range===0?c+h:c+h+(B-f.min)/f.range*b,[f,b,c,h]),v=w(()=>{if(!a)return[];let B=[],I=es(f.range),N=Math.ceil(f.min/I)*I,L=m+p.length*(i+s)+s;for(let M=N;M<=f.max;M+=I){let S=x(M);B.push(o("line",{key:`grid-${M}`,x1:String(S),y1:String(m),x2:String(S),y2:String(L),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,f,m,p.length,i,s,x]),D=w(()=>{let B=[],I=es(f.range),N=Math.ceil(f.min/I)*I,L=m-8;for(let M=N;M<=f.max;M+=I){let S=x(M);B.push(o("text",{key:`taxis-${M}`,x:String(S),y:String(L),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(M)))}return B.push(o("text",{key:"time-unit",x:String(n-h),y:String(L),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[f,m,x,u,n,h]),T=w(()=>{let B=[],I="";for(let N=0;N<p.length;N++){let L=p[N],M=m+N*(i+s)+s,S=x(L.start),k=Math.max(2,x(L.start+L.duration)-S),E=hd(N,L.color);L.group&&L.group!==I&&(I=L.group,l&&B.push(o("text",{key:`group-${N}`,x:String(h),y:String(M+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},L.group))),B.push(o("rect",{key:`bar-${L.id}`,x:String(S),y:String(M),width:String(k),height:String(i),rx:"4",ry:"4",fill:E,role:"graphics-symbol","aria-label":`${L.label}: start ${L.start}, duration ${L.duration}`})),l&&B.push(o("text",{key:`label-${L.id}`,x:String(c+h-8),y:String(M+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},L.label.length>16?L.label.substring(0,14)+"..":L.label)),d&&k>30&&B.push(o("text",{key:`prog-${L.id}`,x:String(S+k/2),y:String(M+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${L.start}-${L.start+L.duration}`))}return B},[p,m,i,s,x,l,d,c,h]),C=w(()=>g?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,n,h]),$=v(),A=D(),z=T(),P=C();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...$,...A,...z)}var bd=Math.PI/180;function xd(e){return e*bd}function Le(e,t,n,r){let i=xd(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ns(e,t,n,r,i){let s=Le(e,t,n,i),a=Le(e,t,n,r),l=i-r,d=Math.abs(l)>180?1:0,u=l>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${a.x} ${a.y}`}function yd(e,t,n){return e<t?t:e>n?n:e}function Ke(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function os(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:a=-135,endAngle:l=135,arcWidth:d=20,showValue:u=!0,showMinMax:g=!0,showTicks:h=!0,tickCount:c=10,label:f,unit:p,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:b="#374151",backgroundColor:m="#e5e7eb"}=e,x=isFinite(n)&&!isNaN(n)?n:0,v=isFinite(r)&&!isNaN(r)&&r>x?r:x+100,D=isFinite(t)&&!isNaN(t)?yd(t,x,v):x,T=(u?24:0)+(f?18:0),C=i/2,$=(s-T)*.6,A=Math.min(i/2,(s-T)*.55)-d/2-10,z=A-d,P=A-d/2,B=l-a,I=w(U=>{let j=v-x;if(j===0)return a;let V=(U-x)/j;return a+V*B},[x,v,a,B]),N=w(()=>{let U=ns(C,$,P,a,l);return[o("path",{key:"bg-arc",d:U,fill:"none",stroke:m,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,$,P,a,l,m,d]),L=w(()=>{if(y.length===0)return[];let U=[],j=B/y.length;for(let V=0;V<y.length;V++){let Y=a+V*j,Z=Y+j,Q=ns(C,$,P,Y,Z);U.push(o("path",{key:`seg-${V}`,d:Q,fill:"none",stroke:y[V],"stroke-width":String(d),"stroke-linecap":V===0||V===y.length-1?"round":"butt",opacity:"0.85"}))}return U},[y,B,a,C,$,P,d]),M=w(()=>{if(!h||c<=0)return[];let U=[],j=Math.max(1,Math.min(c,100));for(let V=0;V<=j;V++){let Y=V/j,Z=a+Y*B,Q=V%2===0,ae=Q?10:6,ee=Le(C,$,A+4,Z),te=Le(C,$,A+4+ae,Z);if(U.push(o("line",{key:`tick-${V}`,x1:String(ee.x),y1:String(ee.y),x2:String(te.x),y2:String(te.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let le=x+Y*(v-x),ce=Le(C,$,A+4+ae+12,Z);U.push(o("text",{key:`tick-label-${V}`,x:String(ce.x),y:String(ce.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(le)))}}return U},[h,c,a,B,C,$,A,x,v]),S=w(()=>{let U=[],j=I(D),V=z-8,Y=Le(C,$,V,j),Z=6,Q=j+90,ae=j-90,ee=Le(C,$,Z,Q),te=Le(C,$,Z,ae);return U.push(o("polygon",{key:"needle",points:`${Y.x},${Y.y} ${ee.x},${ee.y} ${te.x},${te.y}`,fill:b,stroke:"none"})),U.push(o("circle",{key:"needle-cap",cx:String(C),cy:String($),r:"8",fill:b,stroke:"#fff","stroke-width":"2"})),U},[D,I,C,$,z,b]),k=w(()=>{if(!u)return[];let U=[],j=Ke(D),V=j+(p?" "+p:""),Y=$+P+20;return U.push(o("text",{key:"value-text",x:String(C),y:String(Y),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${V}`},j,p?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+p):null)),U},[u,D,p,C,$,P]),E=w(()=>{if(!f)return[];let U=$+P+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(U),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},f)]},[f,C,$,P,u]),F=w(()=>{if(!g)return[];let U=[],j=Le(C,$,P,a),V=Le(C,$,P,l);return U.push(o("text",{key:"min-label",x:String(j.x-4),y:String(j.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(x))),U.push(o("text",{key:"max-label",x:String(V.x+4),y:String(V.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Ke(v))),U},[g,C,$,P,a,l,x,v]),R=N(),W=L(),_=M(),O=S(),H=k(),X=E(),J=F(),K=`Gauge: ${Ke(D)}${p?" "+p:""}, range ${Ke(x)} to ${Ke(v)}${f?", "+f:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(D),"aria-valuemin":String(x),"aria-valuemax":String(v),"aria-label":K,style:{fontFamily:"sans-serif"}},...R,...W,..._,...O,...H,...X,...J)}var vt={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4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-.6,-3.3 -6.3,-3.1 -.2,-1.3 h -3.3 l -2.2,-2.6 -2,-1.3 .7,-5.1 -.9,-1.6 .5,-5.4 1,-1.8 -.3,-2.7 -1.2,-1.3 -1.8,-.3 v -1.7 l 2.8,-5.8 5.9,-3.9 -.4,-13 .9,.4 .6,-.5 .1,-1.1 .9,-.6 1.4,1.2 .7,-.1 h 2.6 l 6.8,-2.6 .3,-1 h 1.2 l .7,-1.2 .4,.8 1.8,-.9 1.8,-1.7 .3,.5 1,-1 2.2,1.6 -.8,1.6 -1.2,1.4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function rs(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:a=1,onStateClick:l,onStateHover:d,hoverColor:u="#FFD700",title:g="Map of the United States"}=e,h=q(()=>Object.keys(vt),[]),c=w(m=>{l&&l(m)},[l]),f=w((m,x)=>{let v=x.currentTarget;v&&v.setAttribute("fill",u),d&&d(m)},[d,u]),p=w((m,x)=>{let v=x.currentTarget;if(v){let D=r[m]??i;v.setAttribute("fill",D)}d&&d(null)},[d,r,i]),y=q(()=>{let m=[];for(let x=0;x<h.length;x++){let v=h[x],D=vt[v],T=r[v]??i,C={key:`state-${v}`,d:D.path,fill:T,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":v,role:"img","aria-label":D.name,style:{cursor:l?"pointer":"default"}};if(l){let A=v;C.onClick=()=>c(A),C.onKeyDown=z=>{(z.key==="Enter"||z.key===" ")&&c(A)},C.tabindex=0,C.role="button",C["aria-label"]=D.name}let $=v;C.onMouseOver=A=>f($,A),C.onMouseOut=A=>p($,A),m.push(o("path",C))}return m},[h,r,i,s,a,l,c,f,p]),b=o("title",{key:"map-title"},g);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g,style:{fontFamily:"sans-serif"}},b,...y)}function Yn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Sd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function vd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Yn(t[i]),l=Yn(t[i+1]);return Sd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function wd(e){let{r:t,g:n,b:r}=Yn(e);return(.299*t+.587*n+.114*r)/255}var kd=["#3b82f6","#fbbf24","#ef4444"];function is(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=kd,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:g="#fff",cellBorderWidth:h=1,title:c,padding:f=60}=e,p=t.length,y=q(()=>{let M=0;for(let S of t)S.length>M&&(M=S.length);return M},[t]),{minVal:b,maxVal:m}=q(()=>{let M=l??1/0,S=d??-1/0;for(let k of t)for(let E of k)l===void 0&&E<M&&(M=E),d===void 0&&E>S&&(S=E);return M===1/0&&(M=0),S===-1/0&&(S=1),M===S&&(S=M+1),{minVal:M,maxVal:S}},[t,l,d]),x=c?30:0,v=n?f:20,D=r?f:20,T=i-v-20,C=s-x-D-20,$=y>0?T/y:0,A=p>0?C/p:0,z=w(()=>{let M=[];for(let S=0;S<p;S++){let k=t[S];for(let E=0;E<y;E++){let F=E<k.length?k[E]:0,R=(F-b)/(m-b),W=vd(R,a),_=v+E*$,O=x+20+S*A;if(M.push(o("rect",{key:`cell-${S}-${E}`,x:String(_),y:String(O),width:String($),height:String(A),fill:W,stroke:g,"stroke-width":String(h)})),u){let H=wd(W)>.5?"#111827":"#ffffff";M.push(o("text",{key:`val-${S}-${E}`,x:String(_+$/2),y:String(O+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,$*.3,A*.4)),"font-family":"sans-serif",fill:H},String(Math.round(F*100)/100)))}}}return M},[t,p,y,b,m,a,$,A,v,x,u,g,h]),P=w(()=>{let M=[];if(n)for(let S=0;S<p;S++){let k=S<n.length?n[S]:"",E=x+20+S*A+A/2;M.push(o("text",{key:`row-label-${S}`,x:String(v-8),y:String(E),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},k))}if(r)for(let S=0;S<y;S++){let k=S<r.length?r[S]:"",E=v+S*$+$/2,F=x+20+p*A+16;M.push(o("text",{key:`col-label-${S}`,x:String(E),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},k))}return M},[n,r,p,y,$,A,v,x]),B=w(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(p===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let I=B(),N=z(),L=P();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...I,...N,...L)}function Cd(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let a=1;a<e.length;a++){let l=e[a];l<n&&(n=l),l>r&&(r=l)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let a=0;a<t;a++)s.push({min:n+a*i,max:n+(a+1)*i,count:0});for(let a=0;a<e.length;a++){let l=e[a],d=Math.floor((l-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function Md(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Vn(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ss(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:a=2,showGrid:l=!0,showValues:d=!0,title:u,xLabel:g,yLabel:h,padding:c=60}=e,f=Math.max(1,Math.round(n)),p=q(()=>Cd(t,f),[t,f]),y=q(()=>{let I=0;for(let N=0;N<p.length;N++)p[N].count>I&&(I=p[N].count);return I>0?I:1},[p]),b=r-c*2,m=i-c*2,x=w(()=>{if(!l)return[];let I=Md(y),N=[];for(let L=I;L<=y;L+=I){let M=c+m-L/y*m;N.push(o("line",{key:`grid-${L}`,x1:String(c),y1:String(M),x2:String(c+b),y2:String(M),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${L}`,x:String(c-8),y:String(M+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(L)))}return N},[l,y,c,b,m]),v=w(()=>{let I=[];return I.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),I.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+m),x2:String(c+b),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"})),I},[c,b,m]),D=w(()=>{if(p.length===0)return[];let I=[],N=a*(p.length-1),L=Math.max(1,(b-N)/p.length);for(let M=0;M<p.length;M++){let S=p[M],k=S.count/y*m,E=c+M*(L+a),F=c+m-k;if(I.push(o("rect",{key:`bar-${M}`,x:String(E),y:String(F),width:String(L),height:String(k),fill:s})),d&&S.count>0&&I.push(o("text",{key:`val-${M}`,x:String(E+L/2),y:String(F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(S.count))),p.length<=15||M%2===0||M===p.length-1){let W=(p.length===1,Vn(S.min));I.push(o("text",{key:`xlabel-${M}`,x:String(E+L/2),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(p.length>0){let M=p[p.length-1],S=c+b;I.push(o("text",{key:"xlabel-end",x:String(S),y:String(c+m+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Vn(M.max)))}return I},[p,y,a,s,d,c,b,m]),T=w(()=>{let I=[];return u&&I.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),g&&I.push(o("text",{key:"x-label",x:String(c+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},g)),h&&I.push(o("text",{key:"y-label",x:String(14),y:String(c+m/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+m/2})`},h)),I},[u,g,h,r,i,c,b,m]),C=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),$=x(),A=v(),z=D(),P=T(),B=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...P,...$,...A,...z,...B)}function Ed(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function as(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:a=2,dotRadius:l=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:g=!0,title:h,padding:c=60}=e,f=i==="vertical",p=f?30:0,y=n-c*2,b=r-c*2-p,m=f?b:y,x=f?y:b,v=q(()=>{let M=0;for(let S=0;S<t.length;S++)t[S].value>M&&(M=t[S].value);return M>0?M:1},[t]),D=q(()=>t.length===0?0:x/t.length,[t.length,x]),T=w(()=>{if(!u)return[];let M=Ed(v),S=[];for(let k=M;k<=v;k+=M){let E=k/v*m;if(f){let F=c+b-E;S.push(o("line",{key:`grid-${k}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`grid-label-${k}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(k)))}else{let F=c+E;S.push(o("line",{key:`grid-${k}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+b),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),S.push(o("text",{key:`grid-label-${k}`,x:String(F),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(k)))}}return S},[u,v,f,c,y,b,m]),C=w(()=>{let M=[];return f?M.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})):M.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),M.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+y),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),M},[f,c,y,b]),$=w(()=>{if(t.length===0)return[];let M=[];for(let S=0;S<t.length;S++){let k=t[S],E=k.value/v*m,F=D*S+D/2,R=k.color??d;if(f){let W=c+F,_=c+b,O=c+b-E;M.push(o("line",{key:`stem-${S}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),M.push(o("circle",{key:`dot-${S}`,cx:String(W),cy:String(O),r:String(l),fill:R})),g&&M.push(o("text",{key:`val-${S}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(k.value)));let H=W,X=c+b+16;M.push(o("text",{key:`cat-${S}`,x:String(H),y:String(X),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${X})`},k.label))}else{let W=c+F,_=c,O=c+E;M.push(o("line",{key:`stem-${S}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),M.push(o("circle",{key:`dot-${S}`,cx:String(O),cy:String(W),r:String(l),fill:R})),g&&M.push(o("text",{key:`val-${S}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(k.value))),M.push(o("text",{key:`cat-${S}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},k.label))}}return M},[t,v,D,d,l,s,a,g,f,c,y,b,m]),A=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),z=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),P=T(),B=C(),I=$(),N=A(),L=z();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Lollipop chart",style:{fontFamily:"sans-serif"}},...N,...P,...B,...I,...L)}function Un(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Rd(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Pd(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,a=Un(t[i]),l=Un(t[i+1]);return Rd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Id(e){let{r:t,g:n,b:r}=Un(e);return(.299*t+.587*n+.114*r)/255}var $d=["#f0f9ff","#3b82f6","#1e3a8a"];function ls(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=$d,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:g="#e5e7eb",title:h,padding:c=70,symmetric:f=!1}=e,p=r??n,y=i??n,b=t.length,m=q(()=>{let R=0;for(let W of t)W.length>R&&(R=W.length);return R},[t]),x=q(()=>{if(!f||b===0)return t;let R=[],W=Math.max(b,m);for(let _=0;_<W;_++){let O=[];for(let H=0;H<W;H++){let X=t[_],J=X&&H<X.length?X[H]:0,K=t[H],U=K&&_<K.length?K[_]:0;J!==0?O.push(J):O.push(U)}R.push(O)}return R},[t,f,b,m]),v=x.length,D=q(()=>{let R=0;for(let W of x)W.length>R&&(R=W.length);return R},[x]),{minVal:T,maxVal:C}=q(()=>{let R=1/0,W=-1/0;for(let _ of x)for(let O of _)O<R&&(R=O),O>W&&(W=O);return R===1/0&&(R=0),W===-1/0&&(W=1),R===W&&(W=R+1),{minVal:R,maxVal:W}},[x]),$=h?30:0,A=p?c:20,z=y?c:20,P=s-A-20,B=a-$-z-20,I=D>0?P/D:0,N=v>0?B/v:0,L=w(()=>{let R=[];for(let W=0;W<v;W++){let _=x[W];for(let O=0;O<D;O++){let H=O<_.length?_[O]:0,X=(H-T)/(C-T),J=Pd(X,l),K=A+O*I,U=$+20+W*N,j=W===O,V=j&&u?"currentColor":g,Y=j&&u?"2":"1";if(R.push(o("rect",{key:`cell-${W}-${O}`,x:String(K),y:String(U),width:String(I),height:String(N),fill:J,stroke:V,"stroke-width":Y})),d){let Z=Id(J)>.5?"#111827":"#ffffff",Q=Math.min(12,I*.3,N*.35);R.push(o("text",{key:`val-${W}-${O}`,x:String(K+I/2),y:String(U+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(H*100)/100)))}}}return R},[x,v,D,T,C,l,I,N,A,$,d,u,g]),M=w(()=>{let R=[];if(p)for(let W=0;W<v;W++){let _=W<p.length?p[W]:"",O=$+20+W*N+N/2;R.push(o("text",{key:`row-label-${W}`,x:String(A-8),y:String(O),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}if(y)for(let W=0;W<D;W++){let _=W<y.length?y[W]:"",O=A+W*I+I/2,H=$+20+v*N+12;R.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(H),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return R},[p,y,v,D,I,N,A,$]),S=w(()=>h?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,s]);if(v===0||D===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let k=S(),E=L(),F=M();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix visualization",style:{fontFamily:"sans-serif"}},...k,...E,...F)}var Td=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function jt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function zd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Dd(e,t,n,r,i,s,a){let l=[];if(jt(e)<=0)return l;let g=zd(e)+1,h=s==="horizontal",c=h?i/g:r/g,f=[];for(f.push({node:e,depth:0,spanStart:h?t:n,spanEnd:h?t+r:n+i,colorIndex:0});f.length>0;){let p=f.shift(),{node:y,depth:b,spanStart:m,spanEnd:x,colorIndex:v}=p,D=jt(y);if(D<=0)continue;let T=x-m,C,$,A,z;if(h?(C=m,$=n+b*c,A=T,z=c):(C=t+b*c,$=m,A=c,z=T),l.push({x:C,y:$,w:A,h:z,label:y.label,value:D,color:y.color??a[v%a.length],depth:b}),y.children&&y.children.length>0){let P=m;for(let B=0;B<y.children.length;B++){let I=y.children[B],N=jt(I);if(N<=0)continue;let L=N/D*T;f.push({node:I,depth:b+1,spanStart:P,spanEnd:P+L,colorIndex:b===0?B:v}),P+=L}}}return l}function cs(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Td,borderColor:d="#ffffff",borderWidth:u=1,title:g,padding:h=10}=e,c=g?30:0,f=h,p=h+c,y=n-h*2,b=r-h*2-c;if(q(()=>jt(t),[t])<=0||y<=0||b<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let x=q(()=>Dd(t,f,p,y,b,i,l),[t,f,p,y,b,i,l]),v=[];g&&v.push(o("text",{key:"title",x:String(n/2),y:String(h+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g));for(let D=0;D<x.length;D++){let T=x[D];if(v.push(o("rect",{key:`cell-${D}`,x:String(T.x),y:String(T.y),width:String(Math.max(0,T.w)),height:String(Math.max(0,T.h)),fill:T.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${T.label}: ${T.value}`})),s&&T.w>20&&T.h>14){let C=Math.floor(T.w/7),$=T.label.length>C?T.label.substring(0,Math.max(1,C-2))+"..":T.label;v.push(o("text",{key:`label-${D}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},$))}a&&T.w>30&&T.h>28&&v.push(o("text",{key:`value-${D}`,x:String(T.x+T.w/2),y:String(T.y+T.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(T.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)}function jn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function ds(e,t){let n=new Set;for(let i of e)n.add(jn(i,t));let r=Array.from(n);return r.sort(),r}function Gt(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function Xt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Ad(e,t,n,r,i){let s=ds(e,t),a=ds(e,n),l=new Map;for(let f of e){let p=jn(f,t),y=jn(f,n),b=`${p}::${y}`;l.has(b)||l.set(b,[]);let m=l.get(b),x=0;for(let v of r){let D=f[v];if(typeof D=="number")x+=D;else if(typeof D=="string"){let T=parseFloat(D);isNaN(T)||(x+=T)}}m.push(x)}let d=new Map;for(let[f,p]of l)d.set(f,Gt(p,i));let u=new Map;for(let f of s){let p=[];for(let y of a){let b=d.get(`${f}::${y}`);b!==void 0&&p.push(b)}u.set(f,Gt(p,i==="count"?"sum":i))}let g=new Map;for(let f of a){let p=[];for(let y of s){let b=d.get(`${y}::${f}`);b!==void 0&&p.push(b)}g.set(f,Gt(p,i==="count"?"sum":i))}let h=[];for(let f of u.values())h.push(f);let c=Gt(h,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:g,grandTotal:c}}function us(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:a=600,height:l=400,showTotals:d=!0,title:u,headerColor:g="#3b82f6",cellPadding:h=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>Ad(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:f,colKeys:p,cells:y,rowTotals:b,colTotals:m,grandTotal:x}=c,v=u?30:0,D=p.length+(d?1:0),T=f.length+(d?1:0),C=1+D,$=1+T,A=Math.max(40,(a-h*2)/C),z=Math.max(20,Math.min(36,(l-v-h*2)/$)),P=A*C,B=z*$,I=Math.max(0,(a-P)/2),N=v+Math.max(0,(l-v-B)/2),L=[];u&&L.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),L.push(o("rect",{key:"header-row-bg",x:String(I),y:String(N),width:String(P),height:String(z),fill:g})),L.push(o("rect",{key:"header-col-bg",x:String(I),y:String(N+z),width:String(A),height:String(z*T),fill:g,opacity:"0.85"})),L.push(o("text",{key:"corner",x:String(I+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let M=0;M<p.length;M++){let S=I+(M+1)*A,k=Math.floor(A/7),E=p[M],F=E.length>k?E.substring(0,Math.max(1,k-2))+"..":E;L.push(o("text",{key:`ch-${M}`,x:String(S+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&L.push(o("text",{key:"ch-total",x:String(I+(p.length+1)*A+A/2),y:String(N+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let M=0;M<f.length;M++){let S=f[M],k=N+(M+1)*z;M%2===0&&L.push(o("rect",{key:`row-bg-${M}`,x:String(I+A),y:String(k),width:String(A*D),height:String(z),fill:"#f9fafb"}));let E=Math.floor(A/7),F=S.length>E?S.substring(0,Math.max(1,E-2))+"..":S;L.push(o("text",{key:`rh-${M}`,x:String(I+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let R=0;R<p.length;R++){let W=p[R],_=`${S}::${W}`,O=y.get(_),H=I+(R+1)*A;L.push(o("rect",{key:`border-${M}-${R}`,x:String(H),y:String(k),width:String(A),height:String(z),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),L.push(o("text",{key:`cell-${M}-${R}`,x:String(H+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?Xt(O):"-"))}if(d){let R=I+(p.length+1)*A,W=b.get(S)??0;L.push(o("rect",{key:`rt-bg-${M}`,x:String(R),y:String(k),width:String(A),height:String(z),fill:"#eff6ff"})),L.push(o("text",{key:`rt-${M}`,x:String(R+A/2),y:String(k+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Xt(W)))}}if(d){let M=N+(f.length+1)*z;L.push(o("rect",{key:"total-row-bg",x:String(I),y:String(M),width:String(P),height:String(z),fill:"#eff6ff"})),L.push(o("text",{key:"total-label",x:String(I+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let k=0;k<p.length;k++){let E=p[k],F=m.get(E)??0,R=I+(k+1)*A;L.push(o("text",{key:`ct-${k}`,x:String(R+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Xt(F)))}let S=I+(p.length+1)*A;L.push(o("text",{key:"grand-total",x:String(S+A/2),y:String(M+z/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Xt(x)))}return L.push(o("rect",{key:"outer-border",x:String(I),y:String(N),width:String(P),height:String(B),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...L)}function qt(e,t){return Math.PI*2*e/t-Math.PI/2}function Kt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function ps(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:a=!0,showValues:l=!1,showLegend:d=!0,showDots:u=!0,gridColor:g="#d1d5db",title:h}=e,c=t.length,f=h?30:0,p=d&&n.length>0?30:0,y=60,b=Math.min((r-y*2)/2,(i-y*2-f-p)/2),m=r/2,x=y+f+b,v=q(()=>{let L=[];for(let M=0;M<c;M++){let S=t[M]?.max;if(S!==void 0&&S>0){L.push(S);continue}let k=0;for(let E of n){let F=E.values[M];F!==void 0&&F>k&&(k=F)}L.push(k>0?k:1)}return L},[t,n,c]),D=w(()=>{if(c<3)return[];let L=[];for(let M=1;M<=s;M++){let S=b*M/s,k=[];for(let E=0;E<c;E++){let F=qt(E,c),R=Kt(m,x,S,F);k.push(`${R.x},${R.y}`)}L.push(o("polygon",{key:`ring-${M}`,points:k.join(" "),fill:"none",stroke:g,"stroke-width":M===s?"1.5":"0.5","stroke-dasharray":M===s?"none":"3 2"}))}for(let M=0;M<c;M++){let S=qt(M,c),k=Kt(m,x,b,S);L.push(o("line",{key:`spoke-${M}`,x1:String(m),y1:String(x),x2:String(k.x),y2:String(k.y),stroke:g,"stroke-width":"0.75"}))}return L},[c,s,b,m,x,g]),T=w(()=>{if(!a||c<3)return[];let L=[],M=16;for(let S=0;S<c;S++){let k=qt(S,c),E=Kt(m,x,b+M,k),F="middle";E.x<m-5?F="end":E.x>m+5&&(F="start");let R=Math.abs(E.y-x)<5?"0.35em":E.y<x?"0em":"0.7em";L.push(o("text",{key:`label-${S}`,x:String(E.x),y:String(E.y),"text-anchor":F,dy:R,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[S]?.label??`Axis ${S}`))}return L},[a,c,t,b,m,x]),C=w(()=>{if(c<3||n.length===0)return[];let L=[];for(let M=0;M<n.length;M++){let S=n[M],k=[],E=[],F=[];for(let R=0;R<c;R++){let W=S.values[R]??0,_=v[R],O=Math.min(W/_,1),H=b*O,X=qt(R,c),J=Kt(m,x,H,X);k.push(`${J.x},${J.y}`),u&&E.push(o("circle",{key:`dot-${M}-${R}`,cx:String(J.x),cy:String(J.y),r:"3.5",fill:S.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${M}-${R}`,x:String(J.x),y:String(J.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:S.color},String(Math.round(W*100)/100)))}L.push(o("polygon",{key:`series-fill-${M}`,points:k.join(" "),fill:S.color,"fill-opacity":String(S.fillOpacity??.15),stroke:"none"})),L.push(o("polygon",{key:`series-line-${M}`,points:k.join(" "),fill:"none",stroke:S.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let R of E)L.push(R);for(let R of F)L.push(R)}return L},[c,n,v,b,m,x,u,l]),$=w(()=>{if(!d||n.length===0)return[];let L=[],M=x+b+40,S=100,k=n.length*S,E=m-k/2;for(let F=0;F<n.length;F++){let R=n[F],W=E+F*S;L.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(M),width:"12",height:"12",rx:"2",fill:R.color})),L.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(M+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},R.label))}return L},[d,n,m,x,b]),A=w(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let z=D(),P=T(),B=C(),I=$(),N=A();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...N,...z,...P,...B,...I)}var Ld=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Bd(e,t){let n=new Map,r=new Map,i=new Map;for(let l of e)r.set(l,new Set),i.set(l,[]);for(let l of t){if(l.value<=0)continue;let d=r.get(l.target);d&&d.add(l.source);let u=i.get(l.source);u&&u.push(l.target)}let s=[];for(let l of e)r.get(l).size===0&&(n.set(l,0),s.push(l));if(s.length===0){for(let l of e)n.set(l,0);return n}let a=0;for(;a<s.length;){let l=s[a];a++;let d=n.get(l),u=i.get(l)??[];for(let g of u){let h=n.get(g),c=d+1;(h===void 0||c>h)&&n.set(g,c),s.includes(g)||s.push(g)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Fd(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,g=t.filter(P=>P.value>0),h=e.map(P=>P.id),c=Bd(h,g),f=new Map,p=new Map;for(let P of h)f.set(P,0),p.set(P,0);for(let P of g)p.set(P.source,(p.get(P.source)??0)+P.value),f.set(P.target,(f.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let b=new Map;for(let P=0;P<=y;P++)b.set(P,[]);for(let[P,B]of c)b.get(B).push(P);let m=new Map,x=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)m.set(P,a+P*x);let v=new Map;for(let P=0;P<e.length;P++)v.set(e[P].id,e[P]);let D=[],T=new Map;for(let P=0;P<=y;P++){let B=b.get(P);if(B.length===0)continue;let I=0;for(let S of B){let k=f.get(S)??0,E=p.get(S)??0;I+=Math.max(k,E,1)}let N=u-s*(B.length-1),L=I>0?N/I:1,M=a;for(let S=0;S<B.length;S++){let k=B[S],E=v.get(k),F=f.get(k)??0,R=p.get(k)??0,W=Math.max(F,R,1),_=Math.max(4,W*L),O=e.findIndex(X=>X.id===k),H={id:k,label:E.label,color:E.color??l[O%l.length],column:P,x:m.get(P),y:M,height:_,totalIn:F,totalOut:R,totalValue:W};D.push(H),T.set(k,H),M+=_+s}}let C=new Map,$=new Map;for(let P of h)C.set(P,0),$.set(P,0);let A=[...g].sort((P,B)=>B.value-P.value),z=[];for(let P of A){let B=T.get(P.source),I=T.get(P.target);if(!B||!I)continue;let N=B.totalOut||1,L=I.totalIn||1,M=P.value/N*B.height,S=P.value/L*I.height,k=Math.max(1,(M+S)/2),E=C.get(P.source),F=$.get(P.target),R=B.y+E+M/2,W=I.y+F+S/2;C.set(P.source,E+M),$.set(P.target,F+S);let _=v.get(P.source);z.push({source:P.source,target:P.target,value:P.value,color:P.color??_?.color??B.color,sourceY:R,targetY:W,width:k})}return{layoutNodes:D,layoutLinks:z}}function fs(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:a=10,showLabels:l=!0,showValues:d=!1,linkOpacity:u=.4,colors:g=Ld,title:h,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let f=q(()=>Fd(t,n,r,i,s,a,c,g),[t,n,r,i,s,a,c,g]),p=w(()=>{let D=[];for(let T=0;T<f.layoutLinks.length;T++){let C=f.layoutLinks[T],$=f.layoutNodes.find(N=>N.id===C.source),A=f.layoutNodes.find(N=>N.id===C.target);if(!$||!A)continue;let z=$.x+s,P=A.x,B=(z+P)/2,I=`M ${z} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${P} ${C.targetY}`;D.push(o("path",{key:`link-${T}`,d:I,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&D.push(o("text",{key:`link-val-${T}`,x:String(B),y:String((C.sourceY+C.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(C.value)))}return D},[f,s,u,d]),y=w(()=>{let D=[];for(let T=0;T<f.layoutNodes.length;T++){let C=f.layoutNodes[T];if(D.push(o("rect",{key:`node-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(C.height),fill:C.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${C.label}: ${C.totalValue}`})),l){let $=f.layoutNodes.reduce((L,M)=>Math.max(L,M.column),0),A=C.column===$,z=A?C.x+s+6:C.x-6,P=A?"start":"end",B=C.column===0,I=B?C.x-6:z,N=B?"end":P;D.push(o("text",{key:`label-${C.id}`,x:String(I),y:String(C.y+C.height/2+4),"text-anchor":N,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},C.label))}}return D},[f,s,l]),b=w(()=>h?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r,c]),m=p(),x=y(),v=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...v,...m,...x)}var Nd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gn=2*Math.PI;function wt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Wd(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function _d(e,t,n,r,i,s){let a=s-i,l=a>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,g=e+r*Math.cos(d),h=t+r*Math.sin(d),c=e+r*Math.cos(u),f=t+r*Math.sin(u),p=e+n*Math.cos(u),y=t+n*Math.sin(u),b=e+n*Math.cos(d),m=t+n*Math.sin(d);if(a>=Gn-.001){let x=d+Math.PI,v=e+r*Math.cos(x),D=t+r*Math.sin(x),T=e+n*Math.cos(x),C=t+n*Math.sin(x);return[`M ${g} ${h}`,`A ${r} ${r} 0 1 1 ${v} ${D}`,`A ${r} ${r} 0 1 1 ${g} ${h}`,`L ${b} ${m}`,`A ${n} ${n} 0 1 0 ${T} ${C}`,`A ${n} ${n} 0 1 0 ${b} ${m}`,"Z"].join(" ")}return[`M ${g} ${h}`,`A ${r} ${r} 0 ${l} 1 ${c} ${f}`,`L ${p} ${y}`,`A ${n} ${n} 0 ${l} 0 ${b} ${m}`,"Z"].join(" ")}function Od(e,t,n,r){let i=[],s=wt(e);if(s<=0)return i;let a=Wd(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let g=0;g<e.children.length;g++){let h=e.children[g],c=wt(h);if(c<=0)continue;let f=c/s*Gn;d.push({node:h,startAngle:u,endAngle:u+f,depth:0,colorIndex:g}),u+=f}}else return i.push({startAngle:0,endAngle:Gn,innerR:t,outerR:t+l,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:g,startAngle:h,endAngle:c,depth:f,colorIndex:p}=u,y=wt(g);if(y<=0)continue;let b=t+f*l,m=b+l;if(i.push({startAngle:h,endAngle:c,innerR:b,outerR:m,label:g.label,value:y,color:g.color??r[p%r.length],depth:f}),g.children&&g.children.length>0){let x=h,v=c-h;for(let D=0;D<g.children.length;D++){let T=g.children[D],C=wt(T);if(C<=0)continue;let $=C/y*v;d.push({node:T,startAngle:x,endAngle:x+$,depth:f+1,colorIndex:p}),x+=$}}}return i}function ms(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Nd,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,g=n/2,h=r/2,c=u?20:0,f=Math.min(g,h-c)-10;if(q(()=>wt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(g),y:String(h),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>Od(t,i,f,a),[t,i,f,a]),b=[];u&&b.push(o("text",{key:"title",x:String(g),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let m=h+c/2;for(let x=0;x<y.length;x++){let v=y[x],D=_d(g,m,v.innerR,v.outerR,v.startAngle,v.endAngle);if(b.push(o("path",{key:`arc-${x}`,d:D,fill:v.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${v.label}: ${v.value}`})),s){let T=v.endAngle-v.startAngle,C=v.startAngle+T/2-Math.PI/2,$=(v.innerR+v.outerR)/2,A=v.outerR-v.innerR,z=T*$;if(z>20&&A>14){let P=g+$*Math.cos(C),B=m+$*Math.sin(C),I=Math.floor(Math.min(z,A)/7),N=v.label.length>I?v.label.substring(0,Math.max(1,I-1))+"..":v.label;b.push(o("text",{key:`label-${x}`,x:String(P),y:String(B+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},N))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...b)}var Hd=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function gs(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let a=s/r,l=Math.max(a/r,r/a);l>i&&(i=l)}return i}function Yd(e,t,n,r,i,s){let a=[],l=[],d=Zt(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],g=r*i,h=[];for(let c=0;c<u.length;c++){let f=u[c],p=Zt(f);p<=0||h.push({label:f.label,value:p,area:p/d*g,color:f.color??s[c%s.length],node:f})}for(h.sort((c,f)=>f.area-c.area),l.push({nodes:h,rect:{x:t,y:n,w:r,h:i},depth:0});l.length>0;){let c=l.shift(),{nodes:f,rect:p,depth:y}=c;if(f.length===0)continue;let b={...p},m=0;for(;m<f.length&&b.w>0&&b.h>0;){let x=b.w>=b.h,v=x?b.h:b.w,D=[],T=[];D.push(f[m]),T.push(f[m].area),m++;let C=gs(T,v);for(;m<f.length;){let P=[...T,f[m].area],B=gs(P,v);if(B>C)break;D.push(f[m]),T.push(f[m].area),C=B,m++}let $=0;for(let P of T)$+=P;let A=v>0?$/v:0,z=0;for(let P=0;P<D.length;P++){let B=D[P],I=A>0?B.area/A:0,N,L,M,S;if(x?(N=b.x,L=b.y+z,M=A,S=I):(N=b.x+z,L=b.y,M=I,S=A),a.push({x:N,y:L,w:M,h:S,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let E=N+2,F=L+2+14,R=M-4,W=S-4-14;if(R>4&&W>4){let _=[],O=B.value,H=R*W;for(let X=0;X<B.node.children.length;X++){let J=B.node.children[X],K=Zt(J);K<=0||_.push({label:J.label,value:K,area:K/O*H,color:J.color??s[(X+y+1)%s.length],node:J})}_.sort((X,J)=>J.area-X.area),l.push({nodes:_,rect:{x:E,y:F,w:R,h:W},depth:y+1})}}z+=I}x?b={x:b.x+A,y:b.y,w:b.w-A,h:b.h}:b={x:b.x,y:b.y+A,w:b.w,h:b.h-A}}}return a}function hs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Hd,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:g}=e,h=g?30:0,c=u,f=u+h,p=n-u*2,y=r-u*2-h;if(q(()=>Zt(t),[t])<=0||p<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let m=q(()=>Yd(t,c,f,p,y,a),[t,c,f,p,y,a]),x=[];g&&x.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g));for(let v=0;v<m.length;v++){let D=m[v];if(x.push(o("rect",{key:`cell-${v}`,x:String(D.x),y:String(D.y),width:String(Math.max(0,D.w)),height:String(Math.max(0,D.h)),fill:D.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${D.label}: ${D.value}`})),i&&D.w>20&&D.h>14){let T=Math.floor(D.w/7),C=D.label.length>T?D.label.substring(0,Math.max(1,T-2))+"..":D.label;x.push(o("text",{key:`label-${v}`,x:String(D.x+4),y:String(D.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&D.w>30&&D.h>28&&x.push(o("text",{key:`value-${v}`,x:String(D.x+4),y:String(D.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(D.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Treemap chart",style:{fontFamily:"sans-serif"}},...x)}function bs(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Vd(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function xs(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),a=Math.min(s+1,r),l=i-s,d=bs(t[s]),u=bs(t[a]);return Vd(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function Jt(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function Ud(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let g=Math.max(2,Math.min(50,r)),h=d/(g-1),c=u/(g-1);if(n){let p=[];for(let x=0;x<g;x++)for(let v=0;v<g;v++)p.push({x:i+v*h,y:a+x*c});let b=n(p,{gridSize:g,xMin:i,xMax:s,yMin:a,yMax:l}),m=[];for(let x=0;x<p.length;x++){let v=p[x],D=b[x]??{dx:0,dy:0},T=Math.sqrt(D.dx*D.dx+D.dy*D.dy);m.push({x:v.x,y:v.y,dx:D.dx,dy:D.dy,magnitude:T})}return m}if(!t)return[];let f=[];for(let p=0;p<g;p++)for(let y=0;y<g;y++){let b=i+y*h,m=a+p*c,x=t(b,m),v=Math.sqrt(x.dx*x.dx+x.dy*x.dy);f.push({x:b,y:m,dx:x.dx,dy:x.dy,magnitude:v})}return f}function jd(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:g,yMax:h,xSpan:c,ySpan:f,showGrid:p,showAxes:y,colorByMagnitude:b,colorScale:m,arrowColor:x,arrowWidth:v,effectiveArrowScale:D,maxMagnitude:T,title:C,tickFontSize:$}=i,A=B=>s+(B-d)/c*a,z=B=>s+(h-B)/f*l;if(e.clearRect(0,0,t,n),C&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(C,t/2,s/2+4),e.restore()),p){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${$}px sans-serif`,e.fillStyle="#6b7280";let B=Jt(c,10),I=Math.ceil(d/B)*B;for(let M=I;M<=u;M+=B){let S=A(M);e.beginPath(),e.moveTo(S,s),e.lineTo(S,s+l),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(M*100)/100),S,s+l+4)}let N=Jt(f,10),L=Math.ceil(g/N)*N;for(let M=L;M<=h;M+=N){let S=z(M);e.beginPath(),e.moveTo(s,S),e.lineTo(s+a,S),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(M*100)/100),s-6,S)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=v,g<=0&&h>=0){let B=z(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=A(0);e.beginPath(),e.moveTo(B,s),e.lineTo(B,s+l),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,a,l),e.restore()}let P=4;for(let B=0;B<r.length;B++){let I=r[B],N=I.magnitude??Math.sqrt(I.dx*I.dx+I.dy*I.dy);if(N<1e-10)continue;let L=A(I.x),M=z(I.y),S=I.dx*D,k=-I.dy*D,E=L+S,F=M+k,R;if(b){let _=N/T;R=xs(_,m)}else R=x;e.save(),e.strokeStyle=R,e.lineWidth=v,e.lineCap="round",e.beginPath(),e.moveTo(L,M),e.lineTo(E,F),e.stroke();let W=Math.sqrt(S*S+k*k);if(W>2){let _=S/W,O=k/W,H=-O,X=_,J=Math.min(P,W*.4),K=E-_*J+H*J*.5,U=F-O*J+X*J*.5,j=E-_*J-H*J*.5,V=F-O*J-X*J*.5;e.fillStyle=R,e.beginPath(),e.moveTo(E,F),e.lineTo(K,U),e.lineTo(j,V),e.closePath(),e.fill()}e.restore()}}function ys(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:a=[-5,5],yRange:l=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:g=!0,showAxes:h=!0,colorByMagnitude:c=!1,colorScale:f=["#3b82f6","#8b5cf6","#ef4444"],title:p,padding:y=50,tickFontSize:b=10,arrowWidth:m=1.5,renderer:x="svg",useGPU:v=!1,computeWorker:D}=e,T=Math.max(2,Math.min(50,s)),C=r-y*2,$=i-y*2,A=a[0],z=a[1],P=l[0],B=l[1],I=z-A,N=B-P,L=q(()=>K=>y+(K-A)/I*C,[y,A,I,C]),M=q(()=>K=>y+(B-K)/N*$,[y,B,N,$]),S=q(()=>Ud(t,n,D,T,A,z,P,B,I,N),[t,n,D,T,A,z,P,B,I,N]),k=q(()=>{let K=0;for(let U=0;U<S.length;U++){let j=S[U],V=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);V>K&&(K=V)}return K>0?K:1},[S]),E=q(()=>Math.min(C,$)/Math.max(T,2)/(2*k)*d,[C,$,T,k,d]);if(x==="canvas"){let K=ne(null),U=ne(0);return se(()=>{let j=K.current;if(!j)return;let V=j.getContext("2d");if(V)return U.current&&cancelAnimationFrame(U.current),U.current=requestAnimationFrame(()=>{jd(V,r,i,S,{padding:y,chartWidth:C,chartHeight:$,xMin:A,xMax:z,yMin:P,yMax:B,xSpan:I,ySpan:N,showGrid:g,showAxes:h,colorByMagnitude:c,colorScale:f,arrowColor:u,arrowWidth:m,effectiveArrowScale:E,maxMagnitude:k,title:p,tickFontSize:b})}),()=>{U.current&&cancelAnimationFrame(U.current)}},[S,r,i,y,C,$,A,z,P,B,I,N,g,h,c,f,u,m,E,k,p,b]),o("canvas",{ref:K,width:r,height:i,role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=w(()=>{if(!g)return[];let K=[],U=Jt(I,10),j=Math.ceil(A/U)*U;for(let Z=j;Z<=z;Z+=U){let Q=L(Z);K.push(o("line",{key:`gridv-${Z}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+$),stroke:"#e5e7eb","stroke-width":"0.5"})),K.push(o("text",{key:`xtick-${Z}`,x:String(Q),y:String(y+$+16),"text-anchor":"middle","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let V=Jt(N,10),Y=Math.ceil(P/V)*V;for(let Z=Y;Z<=B;Z+=V){let Q=M(Z);K.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(Q),x2:String(y+C),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),K.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(b),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return K},[g,A,z,P,B,I,N,L,M,y,C,$]),R=w(()=>{if(!h)return[];let K=[];if(P<=0&&B>=0){let U=M(0);K.push(o("line",{key:"axis-x",x1:String(y),y1:String(U),x2:String(y+C),y2:String(U),stroke:"#374151","stroke-width":String(m)}))}if(A<=0&&z>=0){let U=L(0);K.push(o("line",{key:"axis-y",x1:String(U),y1:String(y),x2:String(U),y2:String(y+$),stroke:"#374151","stroke-width":String(m)}))}return K.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String($),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),K},[h,A,z,P,B,L,M,y,C,$]),W=w(()=>{let K=[];for(let j=0;j<S.length;j++){let V=S[j],Y=V.magnitude??Math.sqrt(V.dx*V.dx+V.dy*V.dy);if(Y<1e-10)continue;let Z=L(V.x),Q=M(V.y),ae=V.dx*E,ee=-V.dy*E,te=Z+ae,le=Q+ee,ce;if(c){let ue=Y/k;ce=xs(ue,f)}else ce=u;K.push(o("line",{key:`arrow-line-${j}`,x1:String(Z),y1:String(Q),x2:String(te),y2:String(le),stroke:ce,"stroke-width":String(m),"stroke-linecap":"round"}));let oe=Math.sqrt(ae*ae+ee*ee);if(oe>2){let ue=ae/oe,re=ee/oe,ie=-re,de=ue,pe=Math.min(4,oe*.4),me=te-ue*pe+ie*pe*.5,he=le-re*pe+de*pe*.5,fe=te-ue*pe-ie*pe*.5,ye=le-re*pe-de*pe*.5;K.push(o("polygon",{key:`arrow-head-${j}`,points:`${te},${le} ${me},${he} ${fe},${ye}`,fill:ce}))}}return K},[S,L,M,E,c,k,f,u]),_=w(()=>p?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,r,y]),O=F(),H=R(),X=W(),J=_();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Vector field plot",style:{fontFamily:"sans-serif"}},...J,...O,...H,...X)}function Gd(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let a=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:a,end:n})}}return t}function Xd(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Ss(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:a="#3b82f6",connectorColor:l="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:g=!0,title:h,padding:c=60}=e,f=n-c*2,p=r-c*2,y=q(()=>Gd(t),[t]),{minVal:b,maxVal:m}=q(()=>{let k=0,E=0;for(let F=0;F<y.length;F++){let R=y[F];R.start<k&&(k=R.start),R.end<k&&(k=R.end),R.start>E&&(E=R.start),R.end>E&&(E=R.end)}return k===E&&(E=k+1),{minVal:k,maxVal:E}},[y]),x=m-b,v=w(k=>c+p-(k-b)/x*p,[c,p,b,x]),D=q(()=>y.length===0?0:f/y.length,[y.length,f]),T=6,C=Math.max(1,D-T),$=w(()=>{if(!u)return[];let k=Xd(x),E=[],F=Math.ceil(b/k)*k;for(let R=F;R<=m;R+=k){let W=v(R);E.push(o("line",{key:`grid-${R}`,x1:String(c),y1:String(W),x2:String(c+f),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),E.push(o("text",{key:`grid-label-${R}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(R)))}return E},[u,x,b,m,v,c,f]),A=w(()=>{let k=[];k.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+p),stroke:"#374151","stroke-width":"1.5"}));let E=b<=0&&m>=0?v(0):c+p;return k.push(o("line",{key:"axis-x",x1:String(c),y1:String(E),x2:String(c+f),y2:String(E),stroke:"#374151","stroke-width":"1.5"})),k},[c,f,p,b,m,v]),z=w(()=>{if(y.length===0)return[];let k=[];for(let E=0;E<y.length;E++){let F=y[E],R=c+E*D+T/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=v(W),H=v(_),X=Math.max(0,H-O),J;if(F.type==="total"?J=a:F.type==="decrease"?J=s:J=i,k.push(o("rect",{key:`bar-${E}`,x:String(R),y:String(O),width:String(C),height:String(X),fill:J,rx:"2",ry:"2"})),d){let K=F.type==="decrease"||F.value<0?H+14:O-4,U=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);k.push(o("text",{key:`val-${E}`,x:String(R+C/2),y:String(K),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},U))}if(k.push(o("text",{key:`cat-${E}`,x:String(R+C/2),y:String(c+p+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),g&&E<y.length-1){let K=y[E+1],U=v(F.end),j=c+(E+1)*D+T/2;K.type!=="total"&&k.push(o("line",{key:`conn-${E}`,x1:String(R+C),y1:String(U),x2:String(j),y2:String(U),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return k},[y,D,C,v,i,s,a,l,d,g,c,p]),P=w(()=>h?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,c]),B=w(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),I=$(),N=A(),L=z(),M=P(),S=B();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Waterfall chart",style:{fontFamily:"sans-serif"}},...M,...I,...N,...L,...S)}var qd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Kd=[0,-45,45,90];function Zd(e,t,n,r,i){let s=t*.6,a=e.length*s,l=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),g=Math.abs(Math.sin(d)),h=a*u+l*g,c=a*g+l*u;return{x:r-h/2,y:i-c/2,w:h,h:c}}function Jd(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function Qd(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function eu(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function vs(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=qd,rotations:d=Kd,padding:u=4,spiral:g="archimedean",title:h}=e,c=q(()=>{if(t.length===0)return[];let p=t.map((C,$)=>({...C,originalIndex:$})).filter(C=>C.text.length>0&&C.weight>0).sort((C,$)=>$.weight-C.weight);if(p.length===0)return[];let y=p[p.length-1].weight,m=p[0].weight-y;function x(C){if(m===0)return(i+s)/2;let $=(C-y)/m;return i+$*(s-i)}let v=[],D=n/2,T=r/2;for(let C=0;C<p.length;C++){let $=p[C],A=x($.weight),z=d[eu($.text)%d.length],P=$.color??l[C%l.length],B=!1,I=500,N=g==="archimedean"?4:5;for(let L=0;L<I;L++){let M,S;if(g==="archimedean"){let _=L*.1,O=N*_;M=O*Math.cos(_),S=O*Math.sin(_)}else{let _=Math.floor(L/4)+1,O=L%4,H=(L%4===0?0:L)*N;switch(O){case 0:M=_*N*4,S=H;break;case 1:M=-H,S=_*N*4;break;case 2:M=-_*N*4,S=-H;break;default:M=H,S=-_*N*4;break}}let k=D+M,E=T+S,F=Zd($.text,A,z,k,E),R={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!Qd(R,n,r))continue;let W=!1;for(let _ of v)if(Jd(R,_.bbox)){W=!0;break}if(!W){v.push({text:$.text,x:k,y:E,fontSize:A,rotation:z,color:P,bbox:R}),B=!0;break}}}return v},[t,n,r,i,s,l,d,u,g]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));let f=[];h&&f.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},h));for(let p=0;p<c.length;p++){let y=c[p],b=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;f.push(o("text",{key:`word-${p}`,transform:b,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":a,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Word cloud",style:{fontFamily:a}},...f)}var tu={0:"#1e293b",1:"#3b82f6"},nu="#666";function ws(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:a=0,showGrid:l=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:g="#0f172a",padding:h=10,onCellClick:c,onCellHover:f,title:p}=e,y=n??tu,b=t.length,m=q(()=>{let k=0;for(let E=0;E<t.length;E++){let F=t[E];F!==void 0&&F.length>k&&(k=F.length)}return k},[t]),x=u?20:0,v=p?24:0,D=q(()=>{let k=r-h*2-x,E=i-h*2-x-v;if(b===0||m===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(k-s*(m-1))/m),R=Math.max(0,(E-s*(b-1))/b);return{cellWidth:F,cellHeight:R}},[r,i,h,b,m,s,x,v]),T=w(k=>{let E=y[k];return E!==void 0?E:nu},[y]),C=w(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:g}),[r,i,g]),$=w(()=>p?[o("text",{key:"title",x:String(r/2),y:String(h+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},p)]:[],[p,r,h]),A=w(()=>{if(!l||b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=m*k+(m-1)*s,_=b*E+(b-1)*s,O=[];for(let H=0;H<=m;H++){let X=F+H*(k+s)-s/2;O.push(o("line",{key:`vgrid-${H}`,x1:String(X),y1:String(R-s/2),x2:String(X),y2:String(R+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let H=0;H<=b;H++){let X=R+H*(E+s)-s/2;O.push(o("line",{key:`hgrid-${H}`,x1:String(F-s/2),y1:String(X),x2:String(F+W+s/2),y2:String(X),stroke:d,"stroke-width":"0.5"}))}return O},[l,b,m,D,h,x,v,s,d]),z=w(()=>{if(!u||b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=[];for(let _=0;_<m;_++){let O=F+_*(k+s)+k/2,H=R-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(H),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<b;_++){let O=F-6,H=R+_*(E+s)+E/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(H),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,b,m,D,h,x,v,s]),P=w(()=>{if(b===0||m===0)return[];let{cellWidth:k,cellHeight:E}=D,F=h+x,R=h+x+v,W=[];for(let _=0;_<b;_++){let O=t[_];if(O!==void 0)for(let H=0;H<m;H++){let X=H<O.length?O[H]:0,J=F+H*(k+s),K=R+_*(E+s),U=T(X),j={key:`cell-${_}-${H}`,x:String(J),y:String(K),width:String(k),height:String(E),fill:U,rx:String(a),ry:String(a)};if(c){let V=_,Y=H,Z=X;j.onClick=()=>c(V,Y,Z),j.role="button",j.tabIndex=0}if(f){let V=_,Y=H,Z=X;j.onMouseEnter=()=>f(V,Y,Z)}W.push(o("rect",j))}}return W},[b,m,t,D,h,x,v,s,a,T,c,f]),B=C(),I=$(),N=A(),L=z(),M=P(),S=p?`${p} \u2014 ${b}x${m} discrete grid`:`${b}x${m} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":S},B,...I,...N,...L,...M)}
|