@asymmetric-effort/specifyjs 0.2.171 → 0.2.172
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
|
|
2
|
-
"use strict";var Ht=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var ia=Object.prototype.hasOwnProperty;var sa=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var aa=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},la=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=oa(t,i))||r.enumerable});return e};var ca=e=>la(Ht({},"__esModule",{value:!0}),e);var et=(e,t,n)=>sa(e,typeof t!="symbol"?t+"":t,n);var ep={};aa(ep,{Accordion:()=>Dr,Alert:()=>Go,AnalogClock:()=>zo,AppContextProvider:()=>it,Avatar:()=>Bo,Badge:()=>Fo,BarGraph:()=>oi,BigNumber:()=>bs,BlochSphere:()=>xs,Board:()=>Nt,BoxPlot:()=>ys,Breadcrumb:()=>zr,BubbleChart:()=>vs,Button:()=>fs,CARD_TYPE_OPTIONS:()=>Ft,COL_COMMENT:()=>so,COL_DEFAULT:()=>Lt,COL_FUNCTION:()=>ao,COL_KEYWORD:()=>cn,COL_NUMBER:()=>co,COL_PUNCTUATION:()=>lo,COL_STRING:()=>ro,COL_TYPE:()=>io,CalendarHeatMap:()=>Cs,Card:()=>br,CardComponent:()=>xn,CardLinkOverlay:()=>Sn,Carousel:()=>Rr,CartesianGraph2D:()=>di,Checkbox:()=>Qo,ChordDiagram:()=>Ms,CodeEditor:()=>un,ColorPicker:()=>tr,ColorWheel:()=>nr,ComplexGraph2D:()=>mi,ContainerComponent:()=>yn,ContextMenu:()=>Kt,DEFAULT_BOARD_STATE:()=>tt,DataGrid:()=>Oo,DatePicker:()=>ir,DecompositionTree:()=>Es,DesktopBackground:()=>nn,DigitalClock:()=>Ho,DiscreteCartesian2D:()=>na,Dock:()=>tn,DragDropProvider:()=>zt,DraggableWindow:()=>kt,Drawer:()=>Kr,Dropdown:()=>Lr,EmptyState:()=>Xo,FileExplorer:()=>an,FileUpload:()=>sr,FlexContainer:()=>xr,FlexItem:()=>yr,Footer:()=>Ii,ForceGraph:()=>Ts,FormFieldWrapper:()=>ze,FunnelChart:()=>Ds,GanttChart:()=>Ls,Gauge:()=>Fs,GoogleAnalytics:()=>Ei,Grid:()=>Sr,GridItem:()=>vr,HeatMap:()=>Ws,Histogram:()=>_s,HypercubeGraph:()=>ki,IDE:()=>mn,Image:()=>Pr,LineGraph:()=>xi,ListView:()=>Yo,LollipopChart:()=>Os,Matrix:()=>Hs,MenuBar:()=>sn,Menubar:()=>Fr,MessageBusProvider:()=>$t,Minimap:()=>pn,Modal:()=>qr,MultilineField:()=>ar,NavWrapper:()=>_e,NumberSpinner:()=>lr,PRIORITY_COLORS:()=>fo,Pagination:()=>Wr,Panel:()=>kr,Partition:()=>Ys,PieGraph:()=>yi,PivotTable:()=>Us,PolarGraph2D:()=>vi,Popover:()=>Jr,ProgressBar:()=>Ko,RadarChart:()=>js,RadioGroup:()=>cr,SankeyDiagram:()=>Gs,ScrollContainer:()=>Mr,Select:()=>dr,Sidebar:()=>Or,Skeleton:()=>qo,Slider:()=>ur,Spinner:()=>Jo,Splitter:()=>Er,StatusBar:()=>fn,Stepper:()=>Hr,Sunburst:()=>Xs,SystemTray:()=>en,TabBar:()=>ln,Tabs:()=>Ir,Tag:()=>Vo,TextEditor:()=>pr,TextField:()=>fr,ThreeDLayers:()=>hs,TimePicker:()=>mr,TitleBar:()=>rn,ToastContainer:()=>Hn,Toggle:()=>gr,Toolbar:()=>Vr,Tooltip:()=>ei,TradingDashboard:()=>bn,TreeMap:()=>qs,TreeNav:()=>Gr,TreeNode:()=>xt,USStateMap:()=>Ns,US_STATE_PATHS:()=>_t,UnityApp:()=>ls,UnityDesktop:()=>as,VectorField:()=>Qs,VideoPlayer:()=>$r,VirtualScroll:()=>Uo,VizWrapper:()=>Mi,WaterfallChart:()=>ea,WindowManagerProvider:()=>Qt,WordCloud:()=>ta,WordProcessor:()=>on,applyGate:()=>bo,blochToCartesian:()=>Rt,boardReducer:()=>wn,buildInputStyle:()=>je,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>Kn,cartesianToBloch:()=>En,computeBoxStats:()=>yo,computeMandelbrotGrid:()=>fi,computeSlices:()=>jn,createToaster:()=>On,describeArc:()=>Un,generateEdges:()=>Xn,generateHypercube:()=>Pt,generatePalette:()=>Jt,generateUUID:()=>qe,generateVertices:()=>Gn,getItemId:()=>Xe,getItemName:()=>po,historyReducer:()=>kn,isCard:()=>Le,isContainer:()=>$e,numRotationAngles:()=>Tt,projectTo2D:()=>Zn,tokenizeLine:()=>dn,transformVec:()=>qn,useAppId:()=>wt,useBarGraphScales:()=>Yn,useBoardReducer:()=>Wt,useChannel:()=>Dt,useDragDrop:()=>pt,useDraggable:()=>to,useDropZone:()=>At,useHover:()=>Fe,useHypercube:()=>Ci,useLineGraphScales:()=>Vn,useMessageBus:()=>st,useToast:()=>Qr,useWindowManager:()=>vt,validateNameForNesting:()=>ds,validateNameInBoard:()=>cs,validateNameInScope:()=>ho});module.exports=ca(ep);var Yt=Symbol.for("spec.element"),da=Symbol.for("spec.fragment"),np=Symbol.for("spec.portal"),Eo=Symbol.for("spec.provider"),Io=Symbol.for("spec.consumer"),ua=Symbol.for("spec.forward_ref"),pa=Symbol.for("spec.memo"),fa=Symbol.for("spec.lazy"),ma=Symbol.for("spec.suspense"),ga=Symbol.for("spec.strict_mode"),ha=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:Yt,type:e,props:s,key:r,ref:i}}function Ue(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Eo,_context:t},r={$$typeof:Io,_context:t};return t.Provider=n,t.Consumer=r,t}var gt=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){}};gt.prototype.isSpecComponent=!0;var Vt=class extends gt{shouldComponentUpdate(t,n){return!Po(this.props,t)||!Po(this.state,n)}};Vt.prototype.isPureSpecComponent=!0;function Po(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 To=null;function ot(){if(To===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return To}function U(e){return ot().useState(e)}function re(e,t){return ot().useEffect(e,t)}function Ye(e){return ot().useContext(e)}function An(e,t,n){return ot().useReducer(e,t,n)}function v(e,t){return ot().useCallback(e,t)}function X(e,t){return ot().useMemo(e,t)}function ne(e){return ot().useRef(e)}function Ce(){return ot().useId()}var ht=Ue({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function $o(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""},ya=new Set;function Sa(){xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""};for(let e of ya)e()}typeof window<"u"&&window.addEventListener("hashchange",Sa);var Wf=Ue({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function Do(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 $a(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 Ze={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function zo(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=U(Do(a));re(()=>{let R=setInterval(()=>{u(Do(a))},1e3);return()=>clearInterval(R)},[a]);let h=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),p=h%12*30+m*.5,f=m*6+c*.1,y=c*6,x=n/2,g=n/2,b=n/2-10,S=b-4,I=b-22,A=[];A.push(o("circle",{cx:String(x),cy:String(g),r:String(b),fill:Ze.face,stroke:Ze.border,"stroke-width":"3"}));for(let R=0;R<12;R++){let B=(R*30-90)*Math.PI/180,E=S-6;A.push(o("line",{x1:String(x+E*Math.cos(B)),y1:String(g+E*Math.sin(B)),x2:String(x+S*Math.cos(B)),y2:String(g+S*Math.sin(B)),stroke:Ze.border,"stroke-width":"2"}));let N=String(R===0?12:R);if(A.push(o("text",{x:String(x+I*Math.cos(B)),y:String(g+I*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let z=b-38,k=String(R===0?0:R+12);A.push(o("text",{x:String(x+z*Math.cos(B)),y:String(g+z*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(R,$,B,E)=>{let N=(R-90)*Math.PI/180;return o("line",{x1:String(x),y1:String(g),x2:String(x+$*Math.cos(N)),y2:String(g+$*Math.sin(N)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};A.push(C(p,b*.5,"4",Ze.hand)),A.push(C(f,b*.75,"3",Ze.hand)),s&&A.push(C(y,b*.85,"1.5",Ze.second)),A.push(o("circle",{cx:String(x),cy:String(g),r:"4",fill:Ze.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...A)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ze.numbers}},$a(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var Bn={xs:24,sm:32,md:40,lg:56,xl:80};function Da(e){return e==null?Bn.md:typeof e=="number"?e:Bn[e]??Bn.md}function za(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 Ao=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function Aa(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Ao[Math.abs(t)%Ao.length]}var Lo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function La(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 Bo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=U(!1),m=Da(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??Aa(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"},x;if(t&&!u)x=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let I=za(r);x=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"},I)}let g=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},x);if(!l)return g;let b=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Lo[l]??Lo.offline,border:"2px solid #fff",boxSizing:"border-box",...La(d,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:S,"aria-label":l}))}var Ba={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"}},Fa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Fo(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,h=r?{...Fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Ba[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:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...h,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 Na={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},No={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Fn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Wa="6px 8px",_a={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Oa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ha={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},dt={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ya={...dt,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Wo={...dt,opacity:"0.5",cursor:"default"},_o={cursor:"pointer",width:"16px",height:"16px"};function Va(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Oo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[x,g]=U(0),[b,S]=U(void 0),[I,A]=U("asc"),[C,T]=U([]),[L,R]=U({}),$=i??x,B=a??b,E=l??I,N=h??C,z=X(()=>{let J=Object.entries(L).filter(([,ie])=>ie.length>0);return J.length===0?n:n.filter(ie=>J.every(([le,fe])=>String(ie[le]??"").toLowerCase().includes(fe.toLowerCase())))},[n,L]),k=X(()=>{if(!B)return z;let J=[...z];return J.sort((ie,le)=>{let fe=ie[B],oe=le[B];if(fe==null&&oe==null)return 0;if(fe==null)return 1;if(oe==null)return-1;if(typeof fe=="number"&&typeof oe=="number")return E==="asc"?fe-oe:oe-fe;let ge=String(fe),he=String(oe),ee=ge.localeCompare(he);return E==="asc"?ee:-ee}),J},[z,B,E]),w=k.length,D=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice($*r,($+1)*r):k,F=v(J=>{s?s(J):g(J)},[s]),P=v(J=>{let ie=B===J&&E==="asc"?"desc":"asc";d?d(J,ie):(S(J),A(ie))},[B,E,d]),W=v(J=>{let ie=N.includes(J)?N.filter(le=>le!==J):[...N,J];m?m(ie):T(ie)},[N,m]),_=v(()=>{let J=M.map((fe,oe)=>r?$*r+oe:oe),le=J.every(fe=>N.includes(fe))?N.filter(fe=>!J.includes(fe)):[...new Set([...N,...J])];m?m(le):T(le)},[M,N,r,$,m]),O=v((J,ie)=>{R(le=>({...le,[J]:ie})),F(0)},[F]),Y=t.some(J=>J.filterable),K=f?Wa:Fn.padding,Q=[];if(u){let J=M.map((le,fe)=>r?$*r+fe:fe),ie=J.length>0&&J.every(le=>N.includes(le));Q.push(o("th",{key:"__select_all",style:{...No,padding:K,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ie,onChange:_,style:_o,"aria-label":"Select all rows"})))}for(let J of t){let ie={...No,padding:K,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[J.header];J.sortable&&le.push(o("span",{style:_a},Va(J.key,B,E))),Q.push(o("th",{key:J.key,style:ie,onClick:J.sortable?()=>P(J.key):void 0,onKeyDown:J.sortable?fe=>{let oe=fe.key;(oe==="Enter"||oe===" ")&&(fe.preventDefault(),P(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":B===J.key?E==="asc"?"ascending":"descending":void 0},...le))}let q=null;if(Y){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:K}}));for(let ie of t)J.push(o("th",{key:`filter_${ie.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ie.filterable?o("input",{type:"text",placeholder:`Filter ${ie.header}...`,style:Oa,value:L[ie.key]??"",onInput:le=>O(ie.key,le.target.value),"aria-label":`Filter by ${ie.header}`}):null));q=o("tr",{key:"__filter_row"},...J)}let H=[];for(let J=0;J<M.length;J++){let ie=M[J],le=r?$*r+J:J,fe=N.includes(le),oe={};c&&J%2===1&&(oe.backgroundColor="#f9fafb"),fe&&(oe.backgroundColor="#eff6ff");let ge=[];u&&ge.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...Fn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:fe,onChange:()=>W(le),style:_o,"aria-label":`Select row ${le+1}`})));for(let he of t){let ee=ie[he.key],de=he.render?he.render(ee,ie):String(ee??"");ge.push(o("td",{key:he.key,style:{...Fn,padding:K,...p?{border:"1px solid #e5e7eb"}:{}}},de))}H.push(o("tr",{key:String(le),style:oe},...ge))}let j=null;if(r){let J=w===0?0:$*r+1,ie=Math.min(($+1)*r,w),le=[];le.push(o("button",{key:"prev",style:$===0?Wo:dt,onClick:$>0?()=>F($-1):void 0,disabled:$===0,"aria-label":"Previous page"},"\u2190 Prev"));let fe=7,oe=Math.max(0,$-Math.floor(fe/2)),ge=Math.min(D,oe+fe);ge-oe<fe&&(oe=Math.max(0,ge-fe)),oe>0&&(le.push(o("button",{key:"p0",style:dt,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let he=oe;he<ge;he++)le.push(o("button",{key:`p${he}`,style:he===$?Ya:dt,onClick:he!==$?()=>F(he):void 0,"aria-current":he===$?"page":void 0},String(he+1)));ge<D&&(ge<D-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${D-1}`,style:dt,onClick:()=>F(D-1)},String(D)))),le.push(o("button",{key:"next",style:$>=D-1?Wo:dt,onClick:$<D-1?()=>F($+1):void 0,disabled:$>=D-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:Ha},o("span",null,`Showing ${J}\u2013${ie} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let G={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},V={...Na,...p?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...Q),q),te=o("tbody",null,...H),ae=o("table",{style:V,role:"grid","aria-rowcount":String(w)},Z,te);return o("div",{style:G},ae,j)}function ut(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 ja(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"?`${ut(e.getMonth()+1)}/${ut(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${ut(e.getMonth()+1)}-${ut(e.getDate())}`}var Ga={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"},Xa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ka={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},qa={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Ho(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=U(new Date);re(()=>{let g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:m}=Ua(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${ut(c)}:${ut(h)}`;i&&(f+=`:${ut(m)}`);let y=[f];p!=null&&y.push(o("span",{style:Ka},p));let x=[o("span",{style:Xa},...y)];return n&&x.push(o("span",{style:qa},ja(l,r,s))),o("div",{style:Ga,...a?{class:a}:{}},...x)}var Za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Ja={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Qa={borderBottom:"1px solid var(--color-border, #e5e7eb)"},el={cursor:"pointer",transition:"background-color 0.15s ease"},tl={backgroundColor:"var(--color-bg-muted, #eff6ff)"},nl={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ut={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 Yo(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:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ut},u):null,o("div",{style:nl},d),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,x=c===t.length-1,g={...Ja,...s?el:{},...y?tl:{},...i&&!x?Qa:{}};m.push(o("li",{key:f,style:g,onClick:l?()=>l(c):void 0,onKeyDown:l?b=>{let S=b.key;(S==="Enter"||S===" ")&&(b.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(p,c)))}return o("div",null,u?o("div",{style:Ut},u):null,o("ul",{style:Za,role:l?"listbox":"list"},...m),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function ol(e){return e??"#3b82f6"}function rl(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 il={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 sl(e,t,n,r,i){let s=il[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:rl(e,.12),color:e,border:"none"};default:return a}}var al={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 Vo(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,h=ol(n),m=sl(h,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:al,onClick:p=>{p.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?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ll={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function Uo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=U(0),d=ne(null),u=t.length*r,h=parseInt(s,10)||400,m=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=v(x=>{let g=x.target;l(g.scrollTop)},[]),y=[];for(let x=c;x<p;x++)y.push(o("div",{key:String(x),style:{position:"absolute",top:`${x*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[x],x)));return o("div",{ref:d,style:{...ll,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var jo={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 Go(e){let[t,n]=U(!0),r=e.type??"info",i=e.variant??"subtle",s=jo[r]??jo.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 Xo(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 Ko(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=Ce().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,x=2*Math.PI*y,g=e.indeterminate?x*.75:x-r/100*x,b=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"}},b?o("style",null,b):null,o("svg",{width:String(p),height:String(p),viewBox:`0 0 ${p} ${p}`,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(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(x),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/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}}`:"",h=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 p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${cl(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[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||h?o("style",null,u+h):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 cl(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 qo(e){let t=e.variant??"text",n=e.animated!==!1,r=Ce().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 h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:Nn({width:h?"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:Nn({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:Nn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Nn(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 dl={sm:16,md:24,lg:40},Zo={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Jo(e){let t=typeof e.size=="number"?e.size:dl[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Zo[e.speed??"normal"]??Zo.normal,s=e.label??"Loading",l=Ce().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=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,h),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 ze(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 je(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 ul={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function Qo(e){let t=Ce().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,h=ne(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let m=v(()=>{l||i(!r)},[l,r,i]),c=v(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),p=ul[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",x=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${p.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,I={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},A=o("input",{ref:h,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:g},S),T=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(ze,{error:d,htmlFor:n},o("div",{style:I,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},A,C,T))}var pl=["#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 er(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function jt(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 tr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=pl,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,m]=U(!1),[c,p]=U(r),f=ne(null);re(()=>{p(r)},[r]),re(()=>{let R=$=>{f.current&&!f.current.contains($.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let y=v(R=>{d||i(jt(R))},[d,i]),x=v(R=>{let $=R.target.value;p($);let B=$.startsWith("#")?$:`#${$}`;er(B)&&i(jt(B))},[i]),g=v(()=>{er(c.startsWith("#")?c:`#${c}`)||p(r)},[c,r]),b={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"},I={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"},A={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(R=>{let $=jt(R)===jt(r);return o("div",{key:R,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:R,cursor:d?"not-allowed":"pointer",border:$?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(R),onKeyDown:E=>{let N=E.key;(N==="Enter"||N===" ")&&(E.preventDefault(),y(R))},role:"button",tabIndex:d?-1:0,title:R,"aria-label":`Select color ${R}`})}),T=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:x,onBlur:g,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,L=h?o("div",{style:I},o("div",{style:A},...C),T):null;return o(ze,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>m(!h),onKeyDown:d?void 0:R=>{let $=R.key;($==="Enter"||$===" ")&&(R.preventDefault(),m(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:b}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function nr(e){let t=Ce().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,h]=U(r),m=ne(null),c=v(((...x)=>{let b=x[0].target.value;h(b),i?.(b)}),[i]),p={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(ze,{label:d,htmlFor:n},o("div",{style:p},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 or=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Su","Mo","Tu","We","Th","Fr","Sa"];function Wn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function ml(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 rr(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function gl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ir(e){let t=Ce().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:h,error:m}=e,c=X(()=>Wn(r),[r]),p=X(()=>Wn(a),[a]),f=X(()=>Wn(l),[l]),[y,x]=U(!1),[g,b]=U(()=>c?c.getFullYear():new Date().getFullYear()),[S,I]=U(()=>c?c.getMonth():new Date().getMonth()),A=ne(null),C=X(()=>new Date,[]);re(()=>{let P=W=>{A.current&&!A.current.contains(W.target)&&x(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let T=v(()=>{I(P=>P===0?(b(W=>W-1),11):P-1)},[]),L=v(()=>{I(P=>P===11?(b(W=>W+1),0):P+1)},[]),R=v(P=>{let W=new Date(g,S,P);p&&W<p||f&&W>f||(i(gl(W)),x(!1))},[g,S,i,p,f]),$=c?ml(c,s):"",B=X(()=>{let P=new Date(g,S,1).getDay(),W=new Date(g,S+1,0).getDate(),_=[],O=[];for(let Y=0;Y<P;Y++)O.push(null);for(let Y=1;Y<=W;Y++)O.push(Y),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[g,S]),E={...je({},{focused:y,error:!!m}),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"},z={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"},D=fl.map(P=>o("div",{key:P,style:{padding:"4px"}},P)),M=B.map((P,W)=>{let _=P.map((O,Y)=>{if(O===null)return o("div",{key:`empty-${W}-${Y}`,style:{padding:"4px"}});let K=new Date(g,S,O),Q=rr(K,C),q=c?rr(K,c):!1,H=p&&K<p||f&&K>f,j={padding:"4px",textAlign:"center",cursor:H?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:Q?"700":"400",backgroundColor:q?"#3b82f6":"transparent",color:q?"#ffffff":H?"#d1d5db":Q?"#3b82f6":"#1f2937",border:Q&&!q?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:j,onClick:H?void 0:()=>R(O),onKeyDown:H?void 0:G=>{let V=G.key;(V==="Enter"||V===" ")&&(G.preventDefault(),R(O))},role:H?void 0:"button",tabIndex:H?void 0:0,"aria-label":`${or[S]} ${O}, ${g}`,"aria-disabled":H?"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:z},o("button",{type:"button",style:k,onClick:T},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${or[S]} ${g}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...D),...M):null;return o(ze,{label:h,error:m,disabled:d,htmlFor:n},o("div",{ref:A,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>x(!y),onKeyDown:d?void 0:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),x(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:$?"#1f2937":"#9ca3af"}},$||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function _n(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 sr(e){let t=Ce().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,[h,m]=U([]),[c,p]=U(!1),[f,y]=U(""),x=ne(null),g=v(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${_n(a)}`);continue}w.push(M)}let D=s?[...h,...w]:w.slice(0,1);m(D),r(D)},[h,s,a,r]),b=v(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let D=Array.from(w.files);g(D)},[l,g]),S=v(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),I=v(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),A=v(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),C=v(k=>{let w=h.filter((D,M)=>M!==k);m(w),r(w)},[h,r]),T=v(()=>{l||x.current&&x.current.click()},[l]),L={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"},R={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},$={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:x,type:"file",accept:i,multiple:s,onChange:A,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:T,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),T())},onDrop:b,onDragOver:S,onDragLeave:I,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:R},"\u2191"),o("div",{style:$},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: ${_n(a)}`):null),z=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let D={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:D},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"}},_n(k.size))),o("button",{type:"button",style:M,onClick:F=>{F.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(ze,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,N,z))}function ar(e){let[t,n]=U(!1),[r,i]=U((e.value??e.defaultValue??"").length),s=Ce().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...je(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 p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=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(ze,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,m)}function lr(e){let t=Ce().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:h,label:m,error:c}=e,[p,f]=U(!1),y=v(w=>{let D=w;return s!==void 0&&D<s&&(D=s),a!==void 0&&D>a&&(D=a),D},[s,a]),x=v(()=>{d||i(y(r+l))},[d,r,l,y,i]),g=v(()=>{d||i(y(r-l))},[d,r,l,y,i]),b=v(w=>{let D=w.target.value;if(D===""||D==="-")return;let M=parseFloat(D);isNaN(M)||i(y(M))},[y,i]),S=v(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),x()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,x,g]),I=s===void 0||r>s,A=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},T=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"}),L={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"},R={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},$=o("button",{type:"button",style:T(I),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:R},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:L,"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}),N=h?o("span",{style:R},h):null,z=o("button",{type:"button",style:T(A),onClick:x,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[$];return B&&k.push(B),k.push(E),N&&k.push(N),k.push(z),o(ze,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function cr(e){let t=Ce().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:h}=e,m=v(y=>{d||s(y)},[d,s]),c=v(y=>{if(d)return;let x=r.filter(S=>!S.disabled);if(x.length===0)return;let g=x.findIndex(S=>S.value===i),b=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=g<x.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=g>0?g-1:x.length-1;else return;s(x[b].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,x)=>{let g=y.value===i,b=d||!!y.disabled,S=`${n}-opt-${x}`,I={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":g?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},A={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:b?"not-allowed":"pointer",opacity:b?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:C,onClick:b?void 0:T=>{T.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:g,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:I},o("div",{style:A})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(ze,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function dr(e){let t=Ce().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:h=!1,error:m,label:c,helpText:p}=e,[f,y]=U(!1),[x,g]=U(""),[b,S]=U(-1),I=ne(null),A=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!x)return r;let P=x.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(P))},[r,x,l]),T=X(()=>{let P={},W=[];for(let _ of C)_.group?(P[_.group]||(P[_.group]=[]),P[_.group].push(_)):W.push(_);return{groups:P,ungrouped:W}},[C]),L=X(()=>A.length===0?"":A.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[A,r]);re(()=>{let P=W=>{let _=W.target;I.current&&!I.current.contains(_)&&(y(!1),g(""))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let R=v(P=>{if(d){let W=A.includes(P)?A.filter(_=>_!==P):[...A,P];s(W)}else s(P),y(!1),g("")},[d,A,s]),$=v(P=>{P.stopPropagation(),s(d?[]:"")},[d,s]),B=v(P=>{if(h)return;let W=P.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){P.preventDefault(),y(!0),S(0);return}if(f){if(W==="Escape"){y(!1),g("");return}if(W==="ArrowDown")P.preventDefault(),S(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")P.preventDefault(),S(_=>Math.max(_-1,0));else if(W==="Enter"&&b>=0&&b<C.length){P.preventDefault();let _=C[b];_.disabled||R(_.value)}}},[h,f,b,C,R]),E={...je({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"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"},z=(P,W)=>{let _=A.includes(P.value),O=W===b,Y={padding:"8px 12px",cursor:P.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:P.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:P.value,style:Y,onClick:P.disabled?void 0:()=>R(P.value),onMouseEnter:()=>S(W),role:"option","aria-selected":_?"true":"false","aria-disabled":P.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,P.label)},k=()=>{let P=[],W=0,{groups:_,ungrouped:O}=T;for(let Y of O)P.push(z(Y,W++));for(let Y of Object.keys(_)){P.push(o("div",{key:`group-${Y}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},Y));for(let K of _[Y])P.push(z(K,W++))}return P.length===0&&P.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),P},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),D=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),S(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&A.length>0?o("span",{onClick:$,onKeyDown:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),P.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:x,onInput:P=>{g(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,F=f?o("div",{style:N,role:"listbox"},M,...k()):null;return o(ze,{label:c,error:m,helpText:p,disabled:h,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},D,F))}function ur(e){let t=Ce().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:h=!1,marks:m,range:c=!1,label:p,error:f}=e,y=ne(null),x=ne(i);x.current=i;let[g,b]=U(null),S=X(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),I=ne(S);I.current=S;let A=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,T=v(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return A(s+O*(a-s))},[s,a,l]),L=v(W=>_=>{h||(_.preventDefault(),b(W))},[h]),R=v(W=>{if(h)return;let _=T(W);if(c){let O=Math.abs(_-S[0]),Y=Math.abs(_-S[1]);O<=Y?i([A(_),S[1]]):i([S[0],A(_)])}else i(A(_))},[h,T,c,S,i,s,a,l]);re(()=>{if(!g)return;let W=O=>{let Y=T(O),K=I.current,Q=x.current;g==="single"?Q(A(Y)):g==="start"?Q([Math.min(A(Y),K[1]),K[1]]):g==="end"&&Q([K[0],Math.max(K[0],A(Y))])},_=()=>b(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[g,T,s,a,l]);let $=v(W=>{if(h)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(A((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?C(S[0]):0,N=C(c?S[1]:S[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${N-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,O)=>{let Y={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},K={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:Y,onMouseDown:L(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:$},d?o("div",{style:K},String(O)):null)},D=[];if(u)for(let W=s;W<=a;W+=l)D.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let W of m)M.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:m||u?"28px":"8px",opacity:h?"0.6":"1"},P=[];return c?(P.push(w(C(S[0]),"start",S[0])),P.push(w(C(S[1]),"end",S[1]))):P.push(w(C(S[0]),"single",S[0])),o(ze,{label:p,error:f,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:R},o("div",{style:z}),...P,...D,...M)))}var hl=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],bl={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 pr(e){let[t,n]=U(!1),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??hl,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{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 x=prompt("Enter URL:");if(!x)return;document.execCommand(f,!1,x)}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]),h=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=bl[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})),p=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:h});return o(ze,{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,p))}function fr(e){let[t,n]=U(!1),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=je(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 h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},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(ze,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var xl=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function rt(e){return String(e).padStart(2,"0")}function yl(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 mr(e){let t=Ce().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:h=!1,timezone:m,showTimezone:c=!1,timezones:p=xl,onTimezoneChange:f}=e,[y,x]=U(!1),g=X(()=>yl(r),[r]),b=s==="12h",S=g.hour>=12,I=b?g.hour%12||12:g.hour,A=v((j,G,V)=>{let Z=Math.max(0,Math.min(23,j)),te=Math.max(0,Math.min(59,G)),ae=Math.max(0,Math.min(59,V??0));i(h?`${rt(Z)}:${rt(te)}:${rt(ae)}`:`${rt(Z)}:${rt(te)}`)},[i,h]),C=v(j=>{let G=parseInt(j.target.value,10)||0;b&&(G=G%12,S&&(G+=12)),A(G,g.minute,g.second)},[b,S,g.minute,g.second,A]),T=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,G,g.second)},[g.hour,g.second,A]),L=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,g.minute,G)},[g.hour,g.minute,A]),R=v(()=>{if(l)return;let j=S?g.hour-12:g.hour+12;A(j,g.minute,g.second)},[l,S,g.hour,g.minute,g.second,A]),$=v(j=>{l||A(g.hour+j,g.minute,g.second)},[l,g.hour,g.minute,g.second,A]),B=v(j=>{l||A(g.hour,g.minute+j*a,g.second)},[l,g.hour,g.minute,g.second,a,A]),E=v(j=>{l||A(g.hour,g.minute,g.second+j)},[l,g.hour,g.minute,g.second,A]),N=v(j=>{let G=j.target.value;f&&f(G)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...je({},{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"},D={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"},F=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>$(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(I),onChange:C,style:D,disabled:l,"aria-label":"Hour",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>$(-1),disabled:l},"\u25BC")),P=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.minute),onChange:T,style:D,disabled:l,"aria-label":"Minute",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.second),onChange:L,style:D,disabled:l,"aria-label":"Second",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,Y=b?o("button",{type:"button",style:M,onClick:R,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,K={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Q=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,q=c?o("select",{style:K,value:m??p[0],onChange:N,disabled:l,"aria-label":"Timezone"},...p.map(j=>o("option",{key:j,value:j},j))):null,H=[F,P,W];return _&&H.push(_),O&&H.push(O),Y&&H.push(Y),Q&&H.push(Q),q&&H.push(q),o(ze,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...H))}var Sl={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 gr(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=Sl[a],h=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"},p=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:`${p}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"},x=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[x,g]:[g,x]).filter(Boolean))}var hr={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 br(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=hr[n]??hr.sm,e.hoverable&&(h.cursor="pointer"),{...h,...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 xr(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 yr(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 Sr(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 vr(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 wr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function kr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=U(!!e.defaultCollapsed),s=ne(null),[a,l]=U("auto");re(()=>{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 x=y.key;(x==="Enter"||x===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=wr[n]??wr.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"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},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?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function Cr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function vl(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 Mr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=U(!0),[l,d]=U(!1),[u,h]=U(!0),[m,c]=U(!1),p=v(()=>{let b=i.current;if(!b)return;let S=2;a(b.scrollTop<=S),d(b.scrollTop+b.clientHeight>=b.scrollHeight-S),h(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);re(()=>{p()},[p]);let f=v(()=>{r&&p()},[r,p]),y=X(()=>{let b={position:"relative",overflowX:Cr(t,"x"),overflowY:Cr(t,"y"),...vl(n)};return e.maxHeight&&(b.maxHeight=e.maxHeight),e.maxWidth&&(b.maxWidth=e.maxWidth),e.padding&&(b.padding=e.padding),{...b,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),x=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&x.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!l&&x.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&x.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!m&&x.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return x.length>0&&(g.boxShadow=x.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Er(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=U(e.initialSplit??50),l=ne(null),d=ne(!1),u=v(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=g=>{if(!d.current||!l.current)return;let b=l.current.getBoundingClientRect(),S=n?b.width:b.height,I=n?g.clientX-b.left:g.clientY-b.top;if(S<=0)return;let A=i/S*100,C=e.maxSize?e.maxSize/S*100:100-A,T=I/S*100;T=Math.max(A,Math.min(C,T)),a(T)},x=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x)}},[n,i,e.maxSize]);let h=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"},p={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:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let x=y.key,g=2;n&&(x==="ArrowLeft"||x==="ArrowRight")?(y.preventDefault(),a(b=>{let S=x==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,b+S))})):!n&&(x==="ArrowUp"||x==="ArrowDown")&&(y.preventDefault(),a(b=>{let S=x==="ArrowDown"?g:-g;return Math.max(5,Math.min(95,b+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 Ir(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=U(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=v(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=v(g=>{let b=e.tabs.filter(L=>!L.disabled),S=b.findIndex(L=>L.id===a);if(S===-1)return;let I=t==="left"||t==="right",A=I?"ArrowUp":"ArrowLeft",C=I?"ArrowDown":"ArrowRight",T=-1;if(g.key===A?T=S>0?S-1:b.length-1:g.key===C?T=S<b.length-1?S+1:0:g.key==="Home"?T=0:g.key==="End"&&(T=b.length-1),T>=0){g.preventDefault(),d(b[T].id);let L=l.current;if(L){let $=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[T])];$&&$.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:h?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[h,m,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{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(g=>g.id===a),x=e.tabs.map(g=>{let b=g.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.disabled?"0.5":"1",fontSize:"14px",fontWeight:b?"600":"400",color:b?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(S.borderRight=b?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=b?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=b?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=b?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",b&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=b?"#3b82f6":"transparent",S.color=b?"#ffffff":"#6b7280"),o("button",{key:g.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:b?"0":"-1",style:S,onClick:g.disabled?void 0:()=>d(g.id),onKeyDown:u},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.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":h?"vertical":"horizontal",style:p,ref:l},...x),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function Rr(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=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=U(0),m=ne(null),c=ne(null),p=v(C=>{let T=C;r?T=(C%n+n)%n:T=Math.max(0,Math.min(C,n-1)),h(T),e.onChange&&e.onChange(T)},[n,r,e.onChange]),f=v(()=>p(u+1),[u,p]),y=v(()=>p(u-1),[u,p]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},T=c.current;if(T)return T.addEventListener("keydown",C),()=>T.removeEventListener("keydown",C)},[f,y]);let x=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=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)"},I=t.map((C,T)=>{let L=a==="fade"?{position:T===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:T===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(T),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),A=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,T)=>o("button",{key:String(T),"aria-label":`Go to slide ${T+1}`,onclick:()=>p(T),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:T===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let T=C.clientX-m.current;T>50?y():T<-50&&f(),m.current=null}},x?o("style",null,x):null,o("div",{style:b},...I),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,A)}function Pr(e){let[t,n]=U("loading"),r=ne(null),i=Ce().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;re(()=>{n("loading")},[e.src]);let d=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),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"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=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},h,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 Tr(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 $r(e){let t=e.controls!==!1,n=ne(null),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=U(!1),[a,l]=U(0),[d,u]=U(0),[h,m]=U(e.muted?0:1),[c,p]=U(!!e.muted),[f,y]=U(!0),x=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let R=n.current;if(!R)return;let $=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(R.currentTime),u(R.duration),e.onTimeUpdate&&e.onTimeUpdate(R.currentTime,R.duration)},z=()=>{u(R.duration)};return R.addEventListener("play",$),R.addEventListener("pause",B),R.addEventListener("ended",E),R.addEventListener("timeupdate",N),R.addEventListener("loadedmetadata",z),()=>{R.removeEventListener("play",$),R.removeEventListener("pause",B),R.removeEventListener("ended",E),R.removeEventListener("timeupdate",N),R.removeEventListener("loadedmetadata",z)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=v(()=>{let R=n.current;R&&(R.paused?R.play():R.pause())},[]),S=v(R=>{let $=n.current;if(!$||!isFinite($.duration))return;let B=R.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(R.clientX-B.left)/B.width));$.currentTime=E*$.duration},[]),I=v(R=>{let $=n.current,B=parseFloat(R.target.value);$&&($.volume=B,$.muted=B===0,m(B),p(B===0))},[]),A=v(()=>{let R=n.current;R&&R.requestFullscreen&&R.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:x,height:g,display:"block"}});let C=d>0?a/d*100:0,T={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=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:b,style:T},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"}},`${Tr(a)} / ${Tr(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:I,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:A,style:T},"\u26F6"));return o("div",{style:{position:"relative",width:x,height:g,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:b,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function _e(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=v(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let m=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let x=m[c+1];x&&x.focus()}else if(u.key===y){u.preventDefault();let x=m[c-1];x&&x.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 bt(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 Fe(){let[e,t]=U(!1);return{hover:e,onMouseEnter:v(()=>t(!0),[]),onMouseLeave:v(()=>t(!1),[])}}function wl(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=Fe(),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 p=v(S=>{let I=S;m||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r())},[m,r]),f=v(()=>{m||r()},[m,r]),x=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),g=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b=l==="left"?[x,g]:[g,x];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:p,onMouseEnter:u,onMouseLeave:h},...b)}function kl(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 Dr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:m}=e,[c,p]=U(()=>n??[]),f=v(x=>{p(g=>{let b=g.includes(x),S;return b?S=g.filter(I=>I!==x):r?S=[...g,x]:S=[x],m&&m(S),S})},[r,m]),y=X(()=>t.map(x=>{let g=c.includes(x.id),b=o(wl,{key:`header-${x.id}`,section:x,expanded:g,onToggle:()=>f(x.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(kl,{key:`content-${x.id}`,section:x,expanded:g,contentStyle:s,animated:h});return o("div",{key:x.id,"data-accordion-section":x.id,style:{width:"100%"}},b,S)}),[t,c,i,s,l,d,u,h,f]);return o(_e,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var Cl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function zr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=U(!1),l=Cl[i],d=v(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!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,x)=>{let g=y===x.length-1,b=h&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),b?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"},"...")):g?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?I=>{I.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)},p=u.map((f,y)=>c(f,y,u));return o(_e,{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"}},...p))}function Ar(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Fe(),[d,u]=U(!1),h=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,p={...bt(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=v(()=>{if(!m){if(h){u(I=>!I);return}t.onClick&&t.onClick(),r&&i()}},[m,h,t,r,i]),y=v(()=>{a(),h&&u(!0)},[h,a]),x=v(()=>{l(),h&&u(!1)},[h,l]),g=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)),b=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(_e,{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(I=>o(Ar,{key:I.id,item:I,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,b),S)}function Lr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=U(!1),m=ne(null),c=v(()=>{h(I=>!I)},[]),p=v(()=>{h(!1)},[]);re(()=>{if(!u)return;let I=A=>{let C=m.current;C&&!C.contains(A.target)&&h(!1)};return document.addEventListener("click",I,!0),()=>{document.removeEventListener("click",I,!0)}},[u]),re(()=>{if(!u)return;let I=A=>{A.key==="Escape"&&h(!1)};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[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")),x=typeof d=="number"?`${d}px`:d,g={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},b={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:x,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:g},o(_e,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(I=>o(Ar,{key:I.id,item:I,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function Br(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),[l,d]=U(!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 h=t.disabled===!0,m=v(()=>{if(!h){if(u){d(b=>!b);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=v(()=>{s(),u&&d(!0)},[u,s]),p=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:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"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)),x=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,g=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((b,S)=>o(Br,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,x),g)}function Ml(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Fe(),h=ne(null),m=v(()=>{r?a():s(n)},[r,n,s,a]),c=v(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={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,x)=>o(Br,{key:String(x),item:y,onClose:a,index:x})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Fr(e){let{menus:t}=e,[n,r]=U(null),i=ne(null),s=v(d=>{r(d)},[]),a=v(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=h=>{let m=h;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 p=c.querySelector('[role="menuitem"]');p&&p.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(Ml,{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 Gt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function El(e,t,n){let r=n*2+5;if(e<=r)return Gt(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?[...Gt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Gt(e-n*2-2,e)]:[1,"ellipsis",...Gt(i,s),"ellipsis",e]}var Xt={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"},Il={...Xt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Nr={...Xt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Rl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Wr(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)),h=Math.min(Math.max(1,r),u),m=v(x=>{!d&&x>=1&&x<=u&&x!==h&&i(x)},[d,u,h,i]),c=(x,g,b)=>{let S=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>m(g),disabled:S||void 0,"aria-label":b,style:S?Nr:Xt},x)},p=El(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let x of p)if(x==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:Rl},"..."));else{let g=x===h;y.push(o("button",{key:String(x),type:"button",onClick:()=>m(x),disabled:d||void 0,"aria-label":`Page ${x}`,"aria-current":g?"page":void 0,style:d?Nr:g?Il:Xt},String(x)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function _r(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Fe(),[u,h]=U(!1),m=t.children&&t.children.length>0,c=t.id===r,p=v(()=>{m&&!n&&h(T=>!T),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"},x=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),b=!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,I=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,A=o("button",{type:"button",style:y,onClick:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},x,g,b,S,I),C=!n&&m&&u?t.children.map(T=>o(_r,{key:T.id,item:T,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},A,C?o("div",{role:"group"},...C):null)}function Or(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,h=t.map(m=>o(_r,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(_e,{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,...h)}var Ve={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 Hr(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,h=v(x=>{s&&i&&i(x)},[s,i]),m=x=>x<n?"completed":x===n?"active":"pending",c=(x,g,b)=>{let S=a==="dot"?u:d,I={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 b==="completed"?o("div",{style:{...I,backgroundColor:Ve.completedBg,color:Ve.completedText,border:`2px solid ${Ve.completed}`}},a==="circle"?g.icon||"\u2713":null):b==="active"?o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.activeText,border:`2px solid ${Ve.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(x+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ve.active}})):o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.pendingText,border:`2px solid ${Ve.pending}`}},a==="circle"?g.icon||String(x+1):null)},p=x=>{if(x>=t.length-1)return null;let b=x<n?Ve.lineCompleted:Ve.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:b,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:b,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},f=(x,g)=>{let b=m(g),S=b==="active",I=b==="completed",A=c(g,x,b),C={fontSize:"13px",fontWeight:S?"600":"400",color:S||I?Ve.labelActive:Ve.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},T={fontSize:"11px",color:Ve.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},x.label),x.description?o("span",{style:T},x.description):null),R=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},A,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},A,L);return o(s?"button":"div",{key:String(g),onClick:s?()=>h(g):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},R)},y=[];return t.forEach((x,g)=>{y.push(f(x,g));let b=p(g);b&&y.push(b)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var Yr={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 Pl(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),l=Yr[n],d=t.disabled===!0,u=t.type==="toggle",[h,m]=U(!1),c=u?t.active===!0:h,p=v(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=v(()=>{!d&&!u&&m(!0)},[d,u]),y=v(()=>{u||m(!1)},[u]),x=v(()=>{a(),u||m(!1)},[u,a]),g={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"},b=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,I=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:x,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,I)}function Vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Yr[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(Pl,{key:a.id,item:a,size:n,variant:r}));return o(_e,{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 xt=class e{constructor(t,n){et(this,"id");et(this,"label");et(this,"children");et(this,"expanded");et(this,"icon");et(this,"metadata");et(this,"parent");et(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 Ur(e){e.expanded=!0;for(let t of e.children)Ur(t)}function jr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)jr(n,t);return t}function Tl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function $l(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:m,focusedId:c}=e,p=Fe(),f=ne(null),y=c===t.id;re(()=>{y&&f.current&&f.current.focus()},[y]);let x=t.isLeaf(),g=t.depth,b=[];for(let T=0;T<g;T++){let L=t;for(let $=0;$<g-T;$++)L=L?L.parent:null;let R=L?!Tl(L):!1;b.push(o("span",{key:`connector-${T}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...R?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=g>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,I=x?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:T=>{T.stopPropagation(),h(t)}},t.expanded?a:l),A=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=bt(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":x?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onClick:()=>m(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},I,A))}function Gr(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:h="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,x]=U(()=>{let R=xt.fromData(t);return a&&Ur(R),R}),[g,b]=U(t.id),S=X(()=>jr(y),[y]),I=v(()=>{x(R=>{let $=Object.create(Object.getPrototypeOf(R));return Object.assign($,R),$})},[]),A=v(R=>{R.toggle(),R.expanded?r?.(R):i?.(R),I()},[r,i,I]),C=v(R=>{b(R.id),n?.(R)},[n]),T=v(R=>{let $=R;if(!g)return;let B=S.findIndex(N=>N.id===g);if(B===-1)return;let E=S[B];switch($.key){case"ArrowDown":{$.preventDefault();let N=S[B+1];N&&b(N.id);break}case"ArrowUp":{$.preventDefault();let N=S[B-1];N&&b(N.id);break}case"ArrowRight":{$.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&b(E.children[0].id):A(E));break}case"ArrowLeft":{$.preventDefault(),!E.isLeaf()&&E.expanded?A(E):E.parent&&b(E.parent.id);break}case"Enter":{$.preventDefault(),C(E);break}case" ":{$.preventDefault(),E.isLeaf()||A(E);break}case"Home":{$.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{$.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[g,S,A,C]),L=S.map(R=>o($l,{key:R.id,node:R,isSelected:R.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:A,onClick:C,focusedId:g}));return o(_e,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:T,style:{outline:"none"}},...L))}function Xr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=U(-1),[l,d]=U(null),u=ne(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,x=t.map((g,b)=>({item:g,i:b})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let S=(x.findIndex(({i:I})=>I===g)+1)%x.length;return x[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let b=x.findIndex(({i:I})=>I===g),S=b<=0?x.length-1:b-1;return x[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 g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={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,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,x=!!(c.children&&c.children.length>0),g={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"},b=()=>{a(p),d(x?p:null)},S=()=>{if(!y){if(x){d(p);return}c.onClick&&c.onClick(),r()}},I=[];c.icon&&I.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),I.push(o("span",{style:{flex:"1"}},c.label??"")),x&&I.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let A=[o("div",{key:`item-${p}`,style:g,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...I)];return x&&l===p&&A.push(o(Xr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...A)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...m)}function Kt(e){let{items:t,children:n}=e,[r,i]=U(null),s=v(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=v(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=h=>{h.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(Xr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Dl(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 zl(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 Kr(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,[h,m]=U(!1),[c,p]=U(!1),f=ne(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let R=setTimeout(()=>m(!1),300);return()=>clearTimeout(R)}},[t]),re(()=>{if(!t||!d)return;let R=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,d,n]),re(()=>{if(!t)return;let R=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=R}},[t]),re(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let x={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"},g={...zl(r,i),transform:Dl(r,c),transition:"transform 0.3s ease"},b={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"},I={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},A={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},T=[];s&&T.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:I,onClick:n,"aria-label":"Close drawer"},"\xD7"))),T.push(o("div",{style:A},u));let L=[];return a&&L.push(o("div",{style:x,onClick:C})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...T)),o("div",null,...L)}var Al={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qr(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,h=ne(null);if(re(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),re(()=>{if(!t||!a)return;let C=T=>{T.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&h.current&&h.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:Al[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={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"},x={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=C=>{s&&C.target===C.currentTarget&&n()},S=[],I=r?"modal-title":void 0;r?S.push(o("h2",{id:I,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 A=[o("div",{style:p},...S),o("div",{style:x},u)];return l&&A.push(o("div",{style:g},l)),o("div",{style:m,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":I},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...A))}var Zr=8;function Ll(e,t){let n=t+Zr;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 Bl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Zr}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 Jr(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,[h,m]=U(!1),c=u?r:h,p=ne(null),f=v(()=>{u?d&&d(!r):m(I=>!I)},[u,r,d]);re(()=>{if(!c||!l)return;let I=A=>{p.current&&!p.current.contains(A.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},x={...Ll(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"},g=[n];a&&g.push(o("div",{style:Bl(i)}));let b=v(I=>{let A=I.key;(A==="Enter"||A===" ")&&(I.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:x},...g)),o("div",{ref:p,style:y},...S)}var Fl=0;function Nl(){return`toast-${++Fl}-${Date.now()}`}function On(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 h=Nl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}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 Wl={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 _l(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 Ol(e){let{item:t,onDismiss:n}=e,r=Wl[t.type];re(()=>{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 Hn(e){let{toaster:t}=e,[,n]=U(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=_l(t.config.position);re(()=>{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 Ht=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var ia=Object.prototype.hasOwnProperty;var sa=(e,t,n)=>t in e?Ht(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var aa=(e,t)=>{for(var n in t)Ht(e,n,{get:t[n],enumerable:!0})},la=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==n&&Ht(e,i,{get:()=>t[i],enumerable:!(r=oa(t,i))||r.enumerable});return e};var ca=e=>la(Ht({},"__esModule",{value:!0}),e);var et=(e,t,n)=>sa(e,typeof t!="symbol"?t+"":t,n);var ep={};aa(ep,{Accordion:()=>Dr,Alert:()=>Go,AnalogClock:()=>zo,AppContextProvider:()=>it,Avatar:()=>Bo,Badge:()=>Fo,BarGraph:()=>oi,BigNumber:()=>bs,BlochSphere:()=>xs,Board:()=>Nt,BoxPlot:()=>ys,Breadcrumb:()=>zr,BubbleChart:()=>vs,Button:()=>fs,CARD_TYPE_OPTIONS:()=>Ft,COL_COMMENT:()=>so,COL_DEFAULT:()=>Lt,COL_FUNCTION:()=>ao,COL_KEYWORD:()=>cn,COL_NUMBER:()=>co,COL_PUNCTUATION:()=>lo,COL_STRING:()=>ro,COL_TYPE:()=>io,CalendarHeatMap:()=>Cs,Card:()=>br,CardComponent:()=>xn,CardLinkOverlay:()=>Sn,Carousel:()=>Rr,CartesianGraph2D:()=>di,Checkbox:()=>Qo,ChordDiagram:()=>Ms,CodeEditor:()=>un,ColorPicker:()=>tr,ColorWheel:()=>nr,ComplexGraph2D:()=>mi,ContainerComponent:()=>yn,ContextMenu:()=>Kt,DEFAULT_BOARD_STATE:()=>tt,DataGrid:()=>Oo,DatePicker:()=>ir,DecompositionTree:()=>Es,DesktopBackground:()=>nn,DigitalClock:()=>Ho,DiscreteCartesian2D:()=>na,Dock:()=>tn,DragDropProvider:()=>zt,DraggableWindow:()=>kt,Drawer:()=>Kr,Dropdown:()=>Lr,EmptyState:()=>Xo,FileExplorer:()=>an,FileUpload:()=>sr,FlexContainer:()=>xr,FlexItem:()=>yr,Footer:()=>Ii,ForceGraph:()=>Ts,FormFieldWrapper:()=>ze,FunnelChart:()=>Ds,GanttChart:()=>Ls,Gauge:()=>Fs,GoogleAnalytics:()=>Ei,Grid:()=>Sr,GridItem:()=>vr,HeatMap:()=>Ws,Histogram:()=>_s,HypercubeGraph:()=>ki,IDE:()=>mn,Image:()=>Pr,LineGraph:()=>xi,ListView:()=>Yo,LollipopChart:()=>Os,Matrix:()=>Hs,MenuBar:()=>sn,Menubar:()=>Fr,MessageBusProvider:()=>$t,Minimap:()=>pn,Modal:()=>qr,MultilineField:()=>ar,NavWrapper:()=>_e,NumberSpinner:()=>lr,PRIORITY_COLORS:()=>fo,Pagination:()=>Wr,Panel:()=>kr,Partition:()=>Ys,PieGraph:()=>yi,PivotTable:()=>Us,PolarGraph2D:()=>vi,Popover:()=>Jr,ProgressBar:()=>Ko,RadarChart:()=>js,RadioGroup:()=>cr,SankeyDiagram:()=>Gs,ScrollContainer:()=>Mr,Select:()=>dr,Sidebar:()=>Or,Skeleton:()=>qo,Slider:()=>ur,Spinner:()=>Jo,Splitter:()=>Er,StatusBar:()=>fn,Stepper:()=>Hr,Sunburst:()=>Xs,SystemTray:()=>en,TabBar:()=>ln,Tabs:()=>Ir,Tag:()=>Vo,TextEditor:()=>pr,TextField:()=>fr,ThreeDLayers:()=>hs,TimePicker:()=>mr,TitleBar:()=>rn,ToastContainer:()=>Hn,Toggle:()=>gr,Toolbar:()=>Vr,Tooltip:()=>ei,TradingDashboard:()=>bn,TreeMap:()=>qs,TreeNav:()=>Gr,TreeNode:()=>xt,USStateMap:()=>Ns,US_STATE_PATHS:()=>_t,UnityApp:()=>ls,UnityDesktop:()=>as,VectorField:()=>Qs,VideoPlayer:()=>$r,VirtualScroll:()=>Uo,VizWrapper:()=>Mi,WaterfallChart:()=>ea,WindowManagerProvider:()=>Qt,WordCloud:()=>ta,WordProcessor:()=>on,applyGate:()=>bo,blochToCartesian:()=>Rt,boardReducer:()=>wn,buildInputStyle:()=>je,buildNavItemStyle:()=>bt,buildRotationMatrix:()=>Kn,cartesianToBloch:()=>En,computeBoxStats:()=>yo,computeMandelbrotGrid:()=>fi,computeSlices:()=>jn,createToaster:()=>On,describeArc:()=>Un,generateEdges:()=>Xn,generateHypercube:()=>Pt,generatePalette:()=>Jt,generateUUID:()=>qe,generateVertices:()=>Gn,getItemId:()=>Xe,getItemName:()=>po,historyReducer:()=>kn,isCard:()=>Le,isContainer:()=>$e,numRotationAngles:()=>Tt,projectTo2D:()=>Zn,tokenizeLine:()=>dn,transformVec:()=>qn,useAppId:()=>wt,useBarGraphScales:()=>Yn,useBoardReducer:()=>Wt,useChannel:()=>Dt,useDragDrop:()=>pt,useDraggable:()=>to,useDropZone:()=>At,useHover:()=>Fe,useHypercube:()=>Ci,useLineGraphScales:()=>Vn,useMessageBus:()=>st,useToast:()=>Qr,useWindowManager:()=>vt,validateNameForNesting:()=>ds,validateNameInBoard:()=>cs,validateNameInScope:()=>ho});module.exports=ca(ep);var Yt=Symbol.for("spec.element"),da=Symbol.for("spec.fragment"),np=Symbol.for("spec.portal"),Eo=Symbol.for("spec.provider"),Io=Symbol.for("spec.consumer"),ua=Symbol.for("spec.forward_ref"),pa=Symbol.for("spec.memo"),fa=Symbol.for("spec.lazy"),ma=Symbol.for("spec.suspense"),ga=Symbol.for("spec.strict_mode"),ha=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:Yt,type:e,props:s,key:r,ref:i}}function Ue(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:Eo,_context:t},r={$$typeof:Io,_context:t};return t.Provider=n,t.Consumer=r,t}var gt=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){}};gt.prototype.isSpecComponent=!0;var Vt=class extends gt{shouldComponentUpdate(t,n){return!Po(this.props,t)||!Po(this.state,n)}};Vt.prototype.isPureSpecComponent=!0;function Po(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 To=null;function ot(){if(To===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return To}function U(e){return ot().useState(e)}function re(e,t){return ot().useEffect(e,t)}function Ye(e){return ot().useContext(e)}function An(e,t,n){return ot().useReducer(e,t,n)}function v(e,t){return ot().useCallback(e,t)}function X(e,t){return ot().useMemo(e,t)}function ne(e){return ot().useRef(e)}function Ce(){return ot().useId()}var ht=Ue({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function $o(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""},ya=new Set;function Sa(){xa={pathname:$o(),hash:typeof window<"u"?window.location.hash:""};for(let e of ya)e()}typeof window<"u"&&window.addEventListener("hashchange",Sa);var Wf=Ue({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function Do(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 $a(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 Ze={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function zo(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:a,className:l}=e,[d,u]=U(Do(a));re(()=>{let R=setInterval(()=>{u(Do(a))},1e3);return()=>clearInterval(R)},[a]);let h=d.getHours(),m=d.getMinutes(),c=d.getSeconds(),p=h%12*30+m*.5,f=m*6+c*.1,y=c*6,x=n/2,g=n/2,b=n/2-10,S=b-4,I=b-22,A=[];A.push(o("circle",{cx:String(x),cy:String(g),r:String(b),fill:Ze.face,stroke:Ze.border,"stroke-width":"3"}));for(let R=0;R<12;R++){let B=(R*30-90)*Math.PI/180,E=S-6;A.push(o("line",{x1:String(x+E*Math.cos(B)),y1:String(g+E*Math.sin(B)),x2:String(x+S*Math.cos(B)),y2:String(g+S*Math.sin(B)),stroke:Ze.border,"stroke-width":"2"}));let N=String(R===0?12:R);if(A.push(o("text",{x:String(x+I*Math.cos(B)),y:String(g+I*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},N)),t==="24h"){let z=b-38,k=String(R===0?0:R+12);A.push(o("text",{x:String(x+z*Math.cos(B)),y:String(g+z*Math.sin(B)),"text-anchor":"middle","dominant-baseline":"central",fill:Ze.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},k))}}let C=(R,$,B,E)=>{let N=(R-90)*Math.PI/180;return o("line",{x1:String(x),y1:String(g),x2:String(x+$*Math.cos(N)),y2:String(g+$*Math.sin(N)),stroke:E,"stroke-width":B,"stroke-linecap":"round"})};A.push(C(p,b*.5,"4",Ze.hand)),A.push(C(f,b*.75,"3",Ze.hand)),s&&A.push(C(y,b*.85,"1.5",Ze.second)),A.push(o("circle",{cx:String(x),cy:String(g),r:"4",fill:Ze.hand}));let L=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...A)];return r&&L.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:Ze.numbers}},$a(d,i))),o("div",{className:l,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...L)}var Bn={xs:24,sm:32,md:40,lg:56,xl:80};function Da(e){return e==null?Bn.md:typeof e=="number"?e:Bn[e]??Bn.md}function za(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 Ao=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function Aa(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return Ao[Math.abs(t)%Ao.length]}var Lo={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function La(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 Bo(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:a,status:l,statusPosition:d="bottom-right"}=e,[u,h]=U(!1),m=Da(i),c=s==="circle"?"50%":`${Math.round(m*.15)}px`,p=a??Aa(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"},x;if(t&&!u)x=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let I=za(r);x=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"},I)}let g=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":p},role:"img","aria-label":n??r??"avatar"},x);if(!l)return g;let b=Math.max(8,Math.round(m*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Lo[l]??Lo.offline,border:"2px solid #fff",boxSizing:"border-box",...La(d,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${m}px`,height:`${m}px`,flexShrink:"0"}},g,o("span",{style:S,"aria-label":l}))}var Ba={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"}},Fa={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Fo(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,h=r?{...Fa[s],borderRadius:"50%",...a==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...Ba[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:h,"aria-label":r?"notification":`count ${d}`},d):null;if(l==null)return m??o("span",null);let c={...h,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 Na={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},No={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},Fn={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},Wa="6px 8px",_a={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},Oa={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},Ha={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},dt={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},Ya={...dt,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},Wo={...dt,opacity:"0.5",cursor:"default"},_o={cursor:"pointer",width:"16px",height:"16px"};function Va(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function Oo(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:a,sortDir:l,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:m,striped:c=!1,bordered:p=!1,compact:f=!1,stickyHeader:y=!1}=e,[x,g]=U(0),[b,S]=U(void 0),[I,A]=U("asc"),[C,T]=U([]),[L,R]=U({}),$=i??x,B=a??b,E=l??I,N=h??C,z=X(()=>{let J=Object.entries(L).filter(([,ie])=>ie.length>0);return J.length===0?n:n.filter(ie=>J.every(([le,fe])=>String(ie[le]??"").toLowerCase().includes(fe.toLowerCase())))},[n,L]),k=X(()=>{if(!B)return z;let J=[...z];return J.sort((ie,le)=>{let fe=ie[B],oe=le[B];if(fe==null&&oe==null)return 0;if(fe==null)return 1;if(oe==null)return-1;if(typeof fe=="number"&&typeof oe=="number")return E==="asc"?fe-oe:oe-fe;let ge=String(fe),he=String(oe),ee=ge.localeCompare(he);return E==="asc"?ee:-ee}),J},[z,B,E]),w=k.length,D=r?Math.max(1,Math.ceil(w/r)):1,M=r?k.slice($*r,($+1)*r):k,F=v(J=>{s?s(J):g(J)},[s]),P=v(J=>{let ie=B===J&&E==="asc"?"desc":"asc";d?d(J,ie):(S(J),A(ie))},[B,E,d]),W=v(J=>{let ie=N.includes(J)?N.filter(le=>le!==J):[...N,J];m?m(ie):T(ie)},[N,m]),_=v(()=>{let J=M.map((fe,oe)=>r?$*r+oe:oe),le=J.every(fe=>N.includes(fe))?N.filter(fe=>!J.includes(fe)):[...new Set([...N,...J])];m?m(le):T(le)},[M,N,r,$,m]),O=v((J,ie)=>{R(le=>({...le,[J]:ie})),F(0)},[F]),Y=t.some(J=>J.filterable),K=f?Wa:Fn.padding,Q=[];if(u){let J=M.map((le,fe)=>r?$*r+fe:fe),ie=J.length>0&&J.every(le=>N.includes(le));Q.push(o("th",{key:"__select_all",style:{...No,padding:K,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:ie,onChange:_,style:_o,"aria-label":"Select all rows"})))}for(let J of t){let ie={...No,padding:K,...J.width?{width:J.width}:{},...J.sortable?{cursor:"pointer"}:{},...p?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},le=[J.header];J.sortable&&le.push(o("span",{style:_a},Va(J.key,B,E))),Q.push(o("th",{key:J.key,style:ie,onClick:J.sortable?()=>P(J.key):void 0,onKeyDown:J.sortable?fe=>{let oe=fe.key;(oe==="Enter"||oe===" ")&&(fe.preventDefault(),P(J.key))}:void 0,tabIndex:J.sortable?0:void 0,role:J.sortable?"columnheader":void 0,"aria-sort":B===J.key?E==="asc"?"ascending":"descending":void 0},...le))}let q=null;if(Y){let J=[];u&&J.push(o("th",{key:"__filter_spacer",style:{padding:K}}));for(let ie of t)J.push(o("th",{key:`filter_${ie.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},ie.filterable?o("input",{type:"text",placeholder:`Filter ${ie.header}...`,style:Oa,value:L[ie.key]??"",onInput:le=>O(ie.key,le.target.value),"aria-label":`Filter by ${ie.header}`}):null));q=o("tr",{key:"__filter_row"},...J)}let H=[];for(let J=0;J<M.length;J++){let ie=M[J],le=r?$*r+J:J,fe=N.includes(le),oe={};c&&J%2===1&&(oe.backgroundColor="#f9fafb"),fe&&(oe.backgroundColor="#eff6ff");let ge=[];u&&ge.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...Fn,...p?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:fe,onChange:()=>W(le),style:_o,"aria-label":`Select row ${le+1}`})));for(let he of t){let ee=ie[he.key],ce=he.render?he.render(ee,ie):String(ee??"");ge.push(o("td",{key:he.key,style:{...Fn,padding:K,...p?{border:"1px solid #e5e7eb"}:{}}},ce))}H.push(o("tr",{key:String(le),style:oe},...ge))}let j=null;if(r){let J=w===0?0:$*r+1,ie=Math.min(($+1)*r,w),le=[];le.push(o("button",{key:"prev",style:$===0?Wo:dt,onClick:$>0?()=>F($-1):void 0,disabled:$===0,"aria-label":"Previous page"},"\u2190 Prev"));let fe=7,oe=Math.max(0,$-Math.floor(fe/2)),ge=Math.min(D,oe+fe);ge-oe<fe&&(oe=Math.max(0,ge-fe)),oe>0&&(le.push(o("button",{key:"p0",style:dt,onClick:()=>F(0)},"1")),oe>1&&le.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let he=oe;he<ge;he++)le.push(o("button",{key:`p${he}`,style:he===$?Ya:dt,onClick:he!==$?()=>F(he):void 0,"aria-current":he===$?"page":void 0},String(he+1)));ge<D&&(ge<D-1&&le.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),le.push(o("button",{key:`p${D-1}`,style:dt,onClick:()=>F(D-1)},String(D)))),le.push(o("button",{key:"next",style:$>=D-1?Wo:dt,onClick:$<D-1?()=>F($+1):void 0,disabled:$>=D-1,"aria-label":"Next page"},"Next \u2192")),j=o("div",{style:Ha},o("span",null,`Showing ${J}\u2013${ie} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...le))}let G={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},V={...Na,...p?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...Q),q),te=o("tbody",null,...H),ae=o("table",{style:V,role:"grid","aria-rowcount":String(w)},Z,te);return o("div",{style:G},ae,j)}function ut(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 ja(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"?`${ut(e.getMonth()+1)}/${ut(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${ut(e.getMonth()+1)}-${ut(e.getDate())}`}var Ga={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"},Xa={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ka={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},qa={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Ho(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:a}=e,[l,d]=U(new Date);re(()=>{let g=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(g)},[]);let{hours:u,minutes:h,seconds:m}=Ua(l,s),c,p=null;t==="12h"?(p=u>=12?"PM":"AM",c=u%12||12):c=u;let f=`${ut(c)}:${ut(h)}`;i&&(f+=`:${ut(m)}`);let y=[f];p!=null&&y.push(o("span",{style:Ka},p));let x=[o("span",{style:Xa},...y)];return n&&x.push(o("span",{style:qa},ja(l,r,s))),o("div",{style:Ga,...a?{class:a}:{}},...x)}var Za={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},Ja={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Qa={borderBottom:"1px solid var(--color-border, #e5e7eb)"},el={cursor:"pointer",transition:"background-color 0.15s ease"},tl={backgroundColor:"var(--color-bg-muted, #eff6ff)"},nl={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},Ut={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 Yo(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:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:Ut},u):null,o("div",{style:nl},d),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let m=[];for(let c=0;c<t.length;c++){let p=t[c],f=r(p,c),y=a===c,x=c===t.length-1,g={...Ja,...s?el:{},...y?tl:{},...i&&!x?Qa:{}};m.push(o("li",{key:f,style:g,onClick:l?()=>l(c):void 0,onKeyDown:l?b=>{let S=b.key;(S==="Enter"||S===" ")&&(b.preventDefault(),l(c))}:void 0,role:l?"option":void 0,tabIndex:l?0:void 0,"aria-selected":l?String(y):void 0},n(p,c)))}return o("div",null,u?o("div",{style:Ut},u):null,o("ul",{style:Za,role:l?"listbox":"list"},...m),h?o("div",{style:{...Ut,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function ol(e){return e??"#3b82f6"}function rl(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 il={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 sl(e,t,n,r,i){let s=il[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:rl(e,.12),color:e,border:"none"};default:return a}}var al={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 Vo(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,h=ol(n),m=sl(h,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:al,onClick:p=>{p.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?p=>{let f=p.key;(f==="Enter"||f===" ")&&(p.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var ll={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function Uo(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[a,l]=U(0),d=ne(null),u=t.length*r,h=parseInt(s,10)||400,m=Math.ceil(h/r),c=Math.max(0,Math.floor(a/r)-i),p=Math.min(t.length,Math.floor(a/r)+m+i),f=v(x=>{let g=x.target;l(g.scrollTop)},[]),y=[];for(let x=c;x<p;x++)y.push(o("div",{key:String(x),style:{position:"absolute",top:`${x*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[x],x)));return o("div",{ref:d,style:{...ll,height:s},onScroll:f},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var jo={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 Go(e){let[t,n]=U(!0),r=e.type??"info",i=e.variant??"subtle",s=jo[r]??jo.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 Xo(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 Ko(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=Ce().replace(/[^a-zA-Z0-9_-]/g,"");if(l==="circular"){let p=typeof e.size=="number"?e.size:48,f=Math.max(2,Math.round(p/10)),y=(p-f)/2,x=2*Math.PI*y,g=e.indeterminate?x*.75:x-r/100*x,b=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"}},b?o("style",null,b):null,o("svg",{width:String(p),height:String(p),viewBox:`0 0 ${p} ${p}`,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(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(f)}),o("circle",{cx:String(p/2),cy:String(p/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(f),"stroke-dasharray":String(x),"stroke-dashoffset":String(g),"stroke-linecap":"round",transform:`rotate(-90 ${p/2} ${p/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}}`:"",h=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 p={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(p.position="absolute",p.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,p.backgroundColor=i):(p.width=`${r}%`,p.backgroundColor=i),e.animated&&!e.indeterminate&&(p.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${cl(i)} 50%, ${i} 100%)`,p.backgroundSize="200% 100%",p.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),p},[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||h?o("style",null,u+h):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 cl(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 qo(e){let t=e.variant??"text",n=e.animated!==!1,r=Ce().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 h=u===l-1&&l>1;d.push(o("div",{key:String(u),style:Nn({width:h?"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:Nn({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:Nn({width:s??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Nn(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 dl={sm:16,md:24,lg:40},Zo={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function Jo(e){let t=typeof e.size=="number"?e.size:dl[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Zo[e.speed??"normal"]??Zo.normal,s=e.label??"Loading",l=Ce().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=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,h),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 ze(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 je(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 ul={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function Qo(e){let t=Ce().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,h=ne(null);re(()=>{h.current&&(h.current.indeterminate=a)},[a]);let m=v(()=>{l||i(!r)},[l,r,i]),c=v(L=>{l||(L.key===" "||L.key==="Enter")&&(L.preventDefault(),i(!r))},[l,r,i]),p=ul[u],f=`${p.box}px`,y=d?"#ef4444":r||a?"#3b82f6":"#d1d5db",x=r||a?"#3b82f6":"#ffffff",g={width:f,height:f,minWidth:f,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",cursor:l?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${p.icon}px`,lineHeight:"1",fontWeight:"700"},S=a?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,I={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.6":"1",userSelect:"none"},A=o("input",{ref:h,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:g},S),T=s?o("span",{style:{fontSize:p.fontSize,color:"#374151"}},s):null;return o(ze,{error:d,htmlFor:n},o("div",{style:I,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},A,C,T))}var pl=["#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 er(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function jt(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 tr(e){let t=Ce().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=pl,showInput:a=!0,showAlpha:l=!1,disabled:d=!1,label:u}=e,[h,m]=U(!1),[c,p]=U(r),f=ne(null);re(()=>{p(r)},[r]),re(()=>{let R=$=>{f.current&&!f.current.contains($.target)&&m(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[]);let y=v(R=>{d||i(jt(R))},[d,i]),x=v(R=>{let $=R.target.value;p($);let B=$.startsWith("#")?$:`#${$}`;er(B)&&i(jt(B))},[i]),g=v(()=>{er(c.startsWith("#")?c:`#${c}`)||p(r)},[c,r]),b={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"},I={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"},A={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:a?"8px":"0"},C=s.map(R=>{let $=jt(R)===jt(r);return o("div",{key:R,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:R,cursor:d?"not-allowed":"pointer",border:$?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y(R),onKeyDown:E=>{let N=E.key;(N==="Enter"||N===" ")&&(E.preventDefault(),y(R))},role:"button",tabIndex:d?-1:0,title:R,"aria-label":`Select color ${R}`})}),T=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:x,onBlur:g,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,L=h?o("div",{style:I},o("div",{style:A},...C),T):null;return o(ze,{label:u,disabled:d,htmlFor:n},o("div",{ref:f,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>m(!h),onKeyDown:d?void 0:R=>{let $=R.key;($==="Enter"||$===" ")&&(R.preventDefault(),m(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:b}),a?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),L))}function nr(e){let t=Ce().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,h]=U(r),m=ne(null),c=v(((...x)=>{let b=x[0].target.value;h(b),i?.(b)}),[i]),p={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(ze,{label:d,htmlFor:n},o("div",{style:p},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 or=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Su","Mo","Tu","We","Th","Fr","Sa"];function Wn(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function ml(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 rr(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function gl(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ir(e){let t=Ce().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:h,error:m}=e,c=X(()=>Wn(r),[r]),p=X(()=>Wn(a),[a]),f=X(()=>Wn(l),[l]),[y,x]=U(!1),[g,b]=U(()=>c?c.getFullYear():new Date().getFullYear()),[S,I]=U(()=>c?c.getMonth():new Date().getMonth()),A=ne(null),C=X(()=>new Date,[]);re(()=>{let P=W=>{A.current&&!A.current.contains(W.target)&&x(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let T=v(()=>{I(P=>P===0?(b(W=>W-1),11):P-1)},[]),L=v(()=>{I(P=>P===11?(b(W=>W+1),0):P+1)},[]),R=v(P=>{let W=new Date(g,S,P);p&&W<p||f&&W>f||(i(gl(W)),x(!1))},[g,S,i,p,f]),$=c?ml(c,s):"",B=X(()=>{let P=new Date(g,S,1).getDay(),W=new Date(g,S+1,0).getDate(),_=[],O=[];for(let Y=0;Y<P;Y++)O.push(null);for(let Y=1;Y<=W;Y++)O.push(Y),O.length===7&&(_.push(O),O=[]);for(;O.length>0&&O.length<7;)O.push(null);return O.length&&_.push(O),_},[g,S]),E={...je({},{focused:y,error:!!m}),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"},z={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"},D=fl.map(P=>o("div",{key:P,style:{padding:"4px"}},P)),M=B.map((P,W)=>{let _=P.map((O,Y)=>{if(O===null)return o("div",{key:`empty-${W}-${Y}`,style:{padding:"4px"}});let K=new Date(g,S,O),Q=rr(K,C),q=c?rr(K,c):!1,H=p&&K<p||f&&K>f,j={padding:"4px",textAlign:"center",cursor:H?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:Q?"700":"400",backgroundColor:q?"#3b82f6":"transparent",color:q?"#ffffff":H?"#d1d5db":Q?"#3b82f6":"#1f2937",border:Q&&!q?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${O}`,style:j,onClick:H?void 0:()=>R(O),onKeyDown:H?void 0:G=>{let V=G.key;(V==="Enter"||V===" ")&&(G.preventDefault(),R(O))},role:H?void 0:"button",tabIndex:H?void 0:0,"aria-label":`${or[S]} ${O}, ${g}`,"aria-disabled":H?"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:z},o("button",{type:"button",style:k,onClick:T},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${or[S]} ${g}`),o("button",{type:"button",style:k,onClick:L},"\u25B6")),o("div",{style:w},...D),...M):null;return o(ze,{label:h,error:m,disabled:d,htmlFor:n},o("div",{ref:A,style:{position:"relative"}},o("div",{id:n,style:E,onClick:d?void 0:()=>x(!y),onKeyDown:d?void 0:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),x(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:$?"#1f2937":"#9ca3af"}},$||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function _n(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 sr(e){let t=Ce().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,[h,m]=U([]),[c,p]=U(!1),[f,y]=U(""),x=ne(null),g=v(k=>{y("");let w=[];for(let M of k){if(a&&M.size>a){y(`File "${M.name}" exceeds maximum size of ${_n(a)}`);continue}w.push(M)}let D=s?[...h,...w]:w.slice(0,1);m(D),r(D)},[h,s,a,r]),b=v(k=>{if(k.preventDefault(),k.stopPropagation(),p(!1),l)return;let w=k.dataTransfer;if(!w)return;let D=Array.from(w.files);g(D)},[l,g]),S=v(k=>{k.preventDefault(),k.stopPropagation(),l||p(!0)},[l]),I=v(k=>{k.preventDefault(),k.stopPropagation(),p(!1)},[]),A=v(k=>{let w=k.target;w.files&&(g(Array.from(w.files)),w.value="")},[g]),C=v(k=>{let w=h.filter((D,M)=>M!==k);m(w),r(w)},[h,r]),T=v(()=>{l||x.current&&x.current.click()},[l]),L={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"},R={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},$={fontSize:"14px",color:"#374151",marginBottom:"4px"},B={fontSize:"12px",color:"#9ca3af"},E=o("input",{id:n,ref:x,type:"file",accept:i,multiple:s,onChange:A,disabled:l,style:{display:"none"},tabIndex:-1}),N=o("div",{style:L,onClick:T,onKeyDown:k=>{let w=k.key;(w==="Enter"||w===" ")&&(k.preventDefault(),T())},onDrop:b,onDragOver:S,onDragLeave:I,role:"button",tabIndex:l?-1:0,"aria-label":"Upload files"},o("div",{style:R},"\u2191"),o("div",{style:$},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: ${_n(a)}`):null),z=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((k,w)=>{let D={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:D},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"}},_n(k.size))),o("button",{type:"button",style:M,onClick:F=>{F.stopPropagation(),C(w)},"aria-label":`Remove ${k.name}`},"\u2715"))})):null;return o(ze,{label:d,helpText:u,error:f||void 0,disabled:l,htmlFor:n},o("div",null,E,N,z))}function ar(e){let[t,n]=U(!1),[r,i]=U((e.value??e.defaultValue??"").length),s=Ce().replace(/[^a-zA-Z0-9_-]/g,""),a=e.id??`ml-${s}`,d={...je(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 p=c.target,f=p.value;i(f.length),e.onChange&&e.onChange(f),e.autoResize&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)},[e.onChange,e.autoResize]),h=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(ze,{label:e.label,htmlFor:a,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,m)}function lr(e){let t=Ce().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:h,label:m,error:c}=e,[p,f]=U(!1),y=v(w=>{let D=w;return s!==void 0&&D<s&&(D=s),a!==void 0&&D>a&&(D=a),D},[s,a]),x=v(()=>{d||i(y(r+l))},[d,r,l,y,i]),g=v(()=>{d||i(y(r-l))},[d,r,l,y,i]),b=v(w=>{let D=w.target.value;if(D===""||D==="-")return;let M=parseFloat(D);isNaN(M)||i(y(M))},[y,i]),S=v(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),x()):w.key==="ArrowDown"&&(w.preventDefault(),g()))},[d,x,g]),I=s===void 0||r>s,A=a===void 0||r<a,C={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":p?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...p&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},T=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"}),L={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"},R={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},$=o("button",{type:"button",style:T(I),onClick:g,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),B=u?o("span",{style:R},u):null,E=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>f(!0),onBlur:()=>f(!1),disabled:d,style:L,"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}),N=h?o("span",{style:R},h):null,z=o("button",{type:"button",style:T(A),onClick:x,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),k=[$];return B&&k.push(B),k.push(E),N&&k.push(N),k.push(z),o(ze,{label:m,error:c,disabled:d,htmlFor:n},o("div",{style:C},...k))}function cr(e){let t=Ce().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:h}=e,m=v(y=>{d||s(y)},[d,s]),c=v(y=>{if(d)return;let x=r.filter(S=>!S.disabled);if(x.length===0)return;let g=x.findIndex(S=>S.value===i),b=g;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=g<x.length-1?g+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=g>0?g-1:x.length-1;else return;s(x[b].value)},[d,r,i,s]),p={display:"flex",flexDirection:l==="horizontal"?"row":"column",gap:l==="horizontal"?"16px":"8px"},f=r.map((y,x)=>{let g=y.value===i,b=d||!!y.disabled,S=`${n}-opt-${x}`,I={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":g?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},A={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:g?"scale(1)":"scale(0)"},C={display:"inline-flex",alignItems:"center",gap:"8px",cursor:b?"not-allowed":"pointer",opacity:b?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:C,onClick:b?void 0:T=>{T.preventDefault(),m(y.value)}},o("input",{type:"radio",id:S,name:a,value:y.value,checked:g,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:I},o("div",{style:A})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(ze,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:p,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...f))}function dr(e){let t=Ce().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:h=!1,error:m,label:c,helpText:p}=e,[f,y]=U(!1),[x,g]=U(""),[b,S]=U(-1),I=ne(null),A=X(()=>Array.isArray(i)?i:i?[i]:[],[i]),C=X(()=>{if(!l||!x)return r;let P=x.toLowerCase();return r.filter(W=>W.label.toLowerCase().includes(P))},[r,x,l]),T=X(()=>{let P={},W=[];for(let _ of C)_.group?(P[_.group]||(P[_.group]=[]),P[_.group].push(_)):W.push(_);return{groups:P,ungrouped:W}},[C]),L=X(()=>A.length===0?"":A.map(W=>r.find(_=>_.value===W)).filter(Boolean).map(W=>W.label).join(", "),[A,r]);re(()=>{let P=W=>{let _=W.target;I.current&&!I.current.contains(_)&&(y(!1),g(""))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);let R=v(P=>{if(d){let W=A.includes(P)?A.filter(_=>_!==P):[...A,P];s(W)}else s(P),y(!1),g("")},[d,A,s]),$=v(P=>{P.stopPropagation(),s(d?[]:"")},[d,s]),B=v(P=>{if(h)return;let W=P.key;if(!f&&(W==="Enter"||W===" "||W==="ArrowDown")){P.preventDefault(),y(!0),S(0);return}if(f){if(W==="Escape"){y(!1),g("");return}if(W==="ArrowDown")P.preventDefault(),S(_=>Math.min(_+1,C.length-1));else if(W==="ArrowUp")P.preventDefault(),S(_=>Math.max(_-1,0));else if(W==="Enter"&&b>=0&&b<C.length){P.preventDefault();let _=C[b];_.disabled||R(_.value)}}},[h,f,b,C,R]),E={...je({},{focused:f,error:!!m}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"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"},z=(P,W)=>{let _=A.includes(P.value),O=W===b,Y={padding:"8px 12px",cursor:P.disabled?"not-allowed":"pointer",backgroundColor:O?"#f3f4f6":_?"#eff6ff":"transparent",color:P.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:P.value,style:Y,onClick:P.disabled?void 0:()=>R(P.value),onMouseEnter:()=>S(W),role:"option","aria-selected":_?"true":"false","aria-disabled":P.disabled?"true":void 0},d&&_?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,P.label)},k=()=>{let P=[],W=0,{groups:_,ungrouped:O}=T;for(let Y of O)P.push(z(Y,W++));for(let Y of Object.keys(_)){P.push(o("div",{key:`group-${Y}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},Y));for(let K of _[Y])P.push(z(K,W++))}return P.length===0&&P.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),P},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),D=o("div",{style:E,id:n,onClick:h?void 0:()=>{y(!f),S(-1)},onKeyDown:B,tabIndex:h?-1:0,role:"combobox","aria-expanded":f?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:L?"#1f2937":"#9ca3af"}},L||a),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&A.length>0?o("span",{onClick:$,onKeyDown:P=>{let W=P.key;(W==="Enter"||W===" ")&&(P.preventDefault(),P.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:x,onInput:P=>{g(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,F=f?o("div",{style:N,role:"listbox"},M,...k()):null;return o(ze,{label:c,error:m,helpText:p,disabled:h,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},D,F))}function ur(e){let t=Ce().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:h=!1,marks:m,range:c=!1,label:p,error:f}=e,y=ne(null),x=ne(i);x.current=i;let[g,b]=U(null),S=X(()=>{if(c&&Array.isArray(r))return r;let W=typeof r=="number"?r:0;return[W,W]},[r,c]),I=ne(S);I.current=S;let A=W=>{let _=Math.round((W-s)/l)*l+s;return Math.max(s,Math.min(a,_))},C=W=>(W-s)/(a-s)*100,T=v(W=>{if(!y.current)return s;let _=y.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(W.clientX-_.left)/_.width));return A(s+O*(a-s))},[s,a,l]),L=v(W=>_=>{h||(_.preventDefault(),b(W))},[h]),R=v(W=>{if(h)return;let _=T(W);if(c){let O=Math.abs(_-S[0]),Y=Math.abs(_-S[1]);O<=Y?i([A(_),S[1]]):i([S[0],A(_)])}else i(A(_))},[h,T,c,S,i,s,a,l]);re(()=>{if(!g)return;let W=O=>{let Y=T(O),K=I.current,Q=x.current;g==="single"?Q(A(Y)):g==="start"?Q([Math.min(A(Y),K[1]),K[1]]):g==="end"&&Q([K[0],Math.max(K[0],A(Y))])},_=()=>b(null);return document.addEventListener("mousemove",W),document.addEventListener("mouseup",_),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",_)}},[g,T,s,a,l]);let $=v(W=>{if(h)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(A((typeof r=="number"?r:0)+_))},[h,l,c,r,i,s,a]),B={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},E=c?C(S[0]):0,N=C(c?S[1]:S[0]),z={position:"absolute",top:"0",left:`${E}%`,width:`${N-E}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},k=W=>p?W==="start"?`${p} minimum`:W==="end"?`${p} maximum`:p:W==="start"?"Minimum value":W==="end"?"Maximum value":"Value",w=(W,_,O)=>{let Y={position:"absolute",top:"50%",left:`${W}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},K={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:Y,onMouseDown:L(_),role:"slider","aria-valuenow":String(O),"aria-valuemin":String(s),"aria-valuemax":String(a),"aria-label":k(_),tabIndex:h?-1:0,onKeyDown:$},d?o("div",{style:K},String(O)):null)},D=[];if(u)for(let W=s;W<=a;W+=l)D.push(o("div",{key:`tick-${W}`,style:{position:"absolute",top:"10px",left:`${C(W)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let M=[];if(m)for(let W of m)M.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:m||u?"28px":"8px",opacity:h?"0.6":"1"},P=[];return c?(P.push(w(C(S[0]),"start",S[0])),P.push(w(C(S[1]),"end",S[1]))):P.push(w(C(S[0]),"single",S[0])),o(ze,{label:p,error:f,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:B,role:"presentation",onClick:R},o("div",{style:z}),...P,...D,...M)))}var hl=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],bl={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 pr(e){let[t,n]=U(!1),r=ne(null),i=Ce().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,a=e.toolbar??hl,l=e.toolbarStyle??{},d=e.editorStyle??{};re(()=>{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 x=prompt("Enter URL:");if(!x)return;document.execCommand(f,!1,x)}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]),h=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=bl[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})),p=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:h});return o(ze,{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,p))}function fr(e){let[t,n]=U(!1),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=je(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 h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},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(ze,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var xl=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function rt(e){return String(e).padStart(2,"0")}function yl(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 mr(e){let t=Ce().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:h=!1,timezone:m,showTimezone:c=!1,timezones:p=xl,onTimezoneChange:f}=e,[y,x]=U(!1),g=X(()=>yl(r),[r]),b=s==="12h",S=g.hour>=12,I=b?g.hour%12||12:g.hour,A=v((j,G,V)=>{let Z=Math.max(0,Math.min(23,j)),te=Math.max(0,Math.min(59,G)),ae=Math.max(0,Math.min(59,V??0));i(h?`${rt(Z)}:${rt(te)}:${rt(ae)}`:`${rt(Z)}:${rt(te)}`)},[i,h]),C=v(j=>{let G=parseInt(j.target.value,10)||0;b&&(G=G%12,S&&(G+=12)),A(G,g.minute,g.second)},[b,S,g.minute,g.second,A]),T=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,G,g.second)},[g.hour,g.second,A]),L=v(j=>{let G=parseInt(j.target.value,10)||0;A(g.hour,g.minute,G)},[g.hour,g.minute,A]),R=v(()=>{if(l)return;let j=S?g.hour-12:g.hour+12;A(j,g.minute,g.second)},[l,S,g.hour,g.minute,g.second,A]),$=v(j=>{l||A(g.hour+j,g.minute,g.second)},[l,g.hour,g.minute,g.second,A]),B=v(j=>{l||A(g.hour,g.minute+j*a,g.second)},[l,g.hour,g.minute,g.second,a,A]),E=v(j=>{l||A(g.hour,g.minute,g.second+j)},[l,g.hour,g.minute,g.second,A]),N=v(j=>{let G=j.target.value;f&&f(G)},[f]),z={display:"inline-flex",alignItems:"center",gap:"4px",...je({},{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"},D={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"},F=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>$(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(I),onChange:C,style:D,disabled:l,"aria-label":"Hour",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>$(-1),disabled:l},"\u25BC")),P=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),W=o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>B(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.minute),onChange:T,style:D,disabled:l,"aria-label":"Minute",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>B(-1),disabled:l},"\u25BC")),_=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,O=h?o("div",{style:k},o("button",{type:"button",style:w,onClick:()=>E(1),disabled:l},"\u25B2"),o("input",{type:"text",value:rt(g.second),onChange:L,style:D,disabled:l,"aria-label":"Second",onFocus:()=>x(!0),onBlur:()=>x(!1)}),o("button",{type:"button",style:w,onClick:()=>E(-1),disabled:l},"\u25BC")):null,Y=b?o("button",{type:"button",style:M,onClick:R,disabled:l,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,K={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},Q=m&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},m):null,q=c?o("select",{style:K,value:m??p[0],onChange:N,disabled:l,"aria-label":"Timezone"},...p.map(j=>o("option",{key:j,value:j},j))):null,H=[F,P,W];return _&&H.push(_),O&&H.push(O),Y&&H.push(Y),Q&&H.push(Q),q&&H.push(q),o(ze,{label:d,error:u,disabled:l,htmlFor:n},o("div",{id:n,style:z},...H))}var Sl={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 gr(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=Sl[a],h=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"},p=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:`${p}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"},x=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,g=o("div",{style:c},o("div",{style:f}));return o("div",{style:y,onClick:h,onKeyDown:m,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[x,g]:[g,x]).filter(Boolean))}var hr={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 br(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=X(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=hr[n]??hr.sm,e.hoverable&&(h.cursor="pointer"),{...h,...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 xr(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 yr(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 Sr(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 vr(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 wr={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function kr(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=U(!!e.defaultCollapsed),s=ne(null),[a,l]=U("auto");re(()=>{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 x=y.key;(x==="Enter"||x===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=X(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=wr[n]??wr.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"},p={maxHeight:r?"0":a,overflow:"hidden",transition:"max-height 0.3s ease"},f={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},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?p:{},ref:s},o("div",{className:"panel__body",style:f},e.children)))}function Cr(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function vl(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 Mr(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ne(null),[s,a]=U(!0),[l,d]=U(!1),[u,h]=U(!0),[m,c]=U(!1),p=v(()=>{let b=i.current;if(!b)return;let S=2;a(b.scrollTop<=S),d(b.scrollTop+b.clientHeight>=b.scrollHeight-S),h(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);re(()=>{p()},[p]);let f=v(()=>{r&&p()},[r,p]),y=X(()=>{let b={position:"relative",overflowX:Cr(t,"x"),overflowY:Cr(t,"y"),...vl(n)};return e.maxHeight&&(b.maxHeight=e.maxHeight),e.maxWidth&&(b.maxWidth=e.maxWidth),e.padding&&(b.padding=e.padding),{...b,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),x=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&x.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!l&&x.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&x.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!m&&x.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let g={...y};return x.length>0&&(g.boxShadow=x.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:g,ref:i,onScroll:f},e.children)}function Er(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,a]=U(e.initialSplit??50),l=ne(null),d=ne(!1),u=v(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);re(()=>{let y=g=>{if(!d.current||!l.current)return;let b=l.current.getBoundingClientRect(),S=n?b.width:b.height,I=n?g.clientX-b.left:g.clientY-b.top;if(S<=0)return;let A=i/S*100,C=e.maxSize?e.maxSize/S*100:100-A,T=I/S*100;T=Math.max(A,Math.min(C,T)),a(T)},x=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",x)}},[n,i,e.maxSize]);let h=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"},p={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:h,ref:l},o("div",{className:"splitter__pane splitter__pane--first",style:m},f[0]??null),o("div",{className:"splitter__divider",style:p,onMouseDown:u,onKeyDown:y=>{let x=y.key,g=2;n&&(x==="ArrowLeft"||x==="ArrowRight")?(y.preventDefault(),a(b=>{let S=x==="ArrowRight"?g:-g;return Math.max(5,Math.min(95,b+S))})):!n&&(x==="ArrowUp"||x==="ArrowDown")&&(y.preventDefault(),a(b=>{let S=x==="ArrowDown"?g:-g;return Math.max(5,Math.min(95,b+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 Ir(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(g=>!g.disabled)?.id??"",[i,s]=U(e.activeTab??r),a=e.activeTab??i,l=ne(null),d=v(g=>{s(g),e.onChange&&e.onChange(g)},[e.onChange]),u=v(g=>{let b=e.tabs.filter(L=>!L.disabled),S=b.findIndex(L=>L.id===a);if(S===-1)return;let I=t==="left"||t==="right",A=I?"ArrowUp":"ArrowLeft",C=I?"ArrowDown":"ArrowRight",T=-1;if(g.key===A?T=S>0?S-1:b.length-1:g.key===C?T=S<b.length-1?S+1:0:g.key==="Home"?T=0:g.key==="End"&&(T=b.length-1),T>=0){g.preventDefault(),d(b[T].id);let L=l.current;if(L){let $=L.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[T])];$&&$.focus()}}},[e.tabs,a,t,d]),h=t==="left"||t==="right",m=t==="bottom"||t==="right",c=X(()=>({display:"flex",flexDirection:h?m?"row-reverse":"row":m?"column-reverse":"column",width:"100%",...e.style??{}}),[h,m,e.style]),p={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{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(g=>g.id===a),x=e.tabs.map(g=>{let b=g.id===a,S={padding:"8px 16px",border:"none",background:"none",cursor:g.disabled?"not-allowed":"pointer",opacity:g.disabled?"0.5":"1",fontSize:"14px",fontWeight:b?"600":"400",color:b?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(S.borderRight=b?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=b?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=b?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=b?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",b&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=b?"#3b82f6":"transparent",S.color=b?"#ffffff":"#6b7280"),o("button",{key:g.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${g.id}`,"aria-disabled":g.disabled?"true":void 0,id:`tab-${g.id}`,tabIndex:b?"0":"-1",style:S,onClick:g.disabled?void 0:()=>d(g.id),onKeyDown:u},g.icon?o("span",{className:"tabs__tab-icon"},g.icon):null,g.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":h?"vertical":"horizontal",style:p,ref:l},...x),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,style:f,tabIndex:"0"},y?y.content:null))}function Rr(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=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=U(0),m=ne(null),c=ne(null),p=v(C=>{let T=C;r?T=(C%n+n)%n:T=Math.max(0,Math.min(C,n-1)),h(T),e.onChange&&e.onChange(T)},[n,r,e.onChange]),f=v(()=>p(u+1),[u,p]),y=v(()=>p(u-1),[u,p]);re(()=>{if(!e.autoPlay||n<=1)return;let C=setInterval(f,l);return()=>clearInterval(C)},[e.autoPlay,l,f,n]),re(()=>{let C=L=>{L.key==="ArrowLeft"?y():L.key==="ArrowRight"&&f()},T=c.current;if(T)return T.addEventListener("keydown",C),()=>T.removeEventListener("keydown",C)},[f,y]);let x=a==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",g={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=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)"},I=t.map((C,T)=>{let L=a==="fade"?{position:T===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:T===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(T),style:L},C.content,C.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},C.caption):null)}),A=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((C,T)=>o("button",{key:String(T),"aria-label":`Go to slide ${T+1}`,onclick:()=>p(T),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:T===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:g,onpointerdown:C=>{m.current=C.clientX},onpointerup:C=>{if(m.current==null)return;let T=C.clientX-m.current;T>50?y():T<-50&&f(),m.current=null}},x?o("style",null,x):null,o("div",{style:b},...I),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,A)}function Pr(e){let[t,n]=U("loading"),r=ne(null),i=Ce().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;re(()=>{n("loading")},[e.src]);let d=X(()=>{let p={display:"inline-block",position:"relative",overflow:"hidden"};return a&&(p.width=a),l&&(p.height=l),e.borderRadius&&(p.borderRadius=e.borderRadius),p},[a,l,e.borderRadius]),u=X(()=>{let p={display:"block",width:"100%",height:"100%"};return e.objectFit&&(p.objectFit=e.objectFit),t==="loading"&&(p.opacity="0",p.position="absolute"),t==="error"&&(p.display="none"),p},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let p=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,p),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"?h=o("div",{style:{width:a??"100%",height:l??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=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},h,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 Tr(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 $r(e){let t=e.controls!==!1,n=ne(null),r=Ce().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=U(!1),[a,l]=U(0),[d,u]=U(0),[h,m]=U(e.muted?0:1),[c,p]=U(!!e.muted),[f,y]=U(!0),x=typeof e.width=="number"?`${e.width}px`:e.width??"100%",g=typeof e.height=="number"?`${e.height}px`:e.height??"auto";re(()=>{let R=n.current;if(!R)return;let $=()=>{s(!0),e.onPlay&&e.onPlay()},B=()=>{s(!1),e.onPause&&e.onPause()},E=()=>{s(!1),e.onEnded&&e.onEnded()},N=()=>{l(R.currentTime),u(R.duration),e.onTimeUpdate&&e.onTimeUpdate(R.currentTime,R.duration)},z=()=>{u(R.duration)};return R.addEventListener("play",$),R.addEventListener("pause",B),R.addEventListener("ended",E),R.addEventListener("timeupdate",N),R.addEventListener("loadedmetadata",z),()=>{R.removeEventListener("play",$),R.removeEventListener("pause",B),R.removeEventListener("ended",E),R.removeEventListener("timeupdate",N),R.removeEventListener("loadedmetadata",z)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=v(()=>{let R=n.current;R&&(R.paused?R.play():R.pause())},[]),S=v(R=>{let $=n.current;if(!$||!isFinite($.duration))return;let B=R.currentTarget.getBoundingClientRect(),E=Math.max(0,Math.min(1,(R.clientX-B.left)/B.width));$.currentTime=E*$.duration},[]),I=v(R=>{let $=n.current,B=parseFloat(R.target.value);$&&($.volume=B,$.muted=B===0,m(B),p(B===0))},[]),A=v(()=>{let R=n.current;R&&R.requestFullscreen&&R.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:x,height:g,display:"block"}});let C=d>0?a/d*100:0,T={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},L=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:b,style:T},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"}},`${Tr(a)} / ${Tr(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:I,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:A,style:T},"\u26F6"));return o("div",{style:{position:"relative",width:x,height:g,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:b,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),L)}function _e(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=v(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let m=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=m.indexOf(document.activeElement);if(c<0)return;let p=t==="vertical",f=p?"ArrowDown":"ArrowRight",y=p?"ArrowUp":"ArrowLeft";if(u.key===f){u.preventDefault();let x=m[c+1];x&&x.focus()}else if(u.key===y){u.preventDefault();let x=m[c-1];x&&x.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 bt(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 Fe(){let[e,t]=U(!1);return{hover:e,onMouseEnter:v(()=>t(!0),[]),onMouseLeave:v(()=>t(!1),[])}}function wl(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:a,iconPosition:l}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=Fe(),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 p=v(S=>{let I=S;m||(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r())},[m,r]),f=v(()=>{m||r()},[m,r]),x=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),g=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b=l==="left"?[x,g]:[g,x];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:p,onMouseEnter:u,onMouseLeave:h},...b)}function kl(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 Dr(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:a,expandIcon:l="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:m}=e,[c,p]=U(()=>n??[]),f=v(x=>{p(g=>{let b=g.includes(x),S;return b?S=g.filter(I=>I!==x):r?S=[...g,x]:S=[x],m&&m(S),S})},[r,m]),y=X(()=>t.map(x=>{let g=c.includes(x.id),b=o(wl,{key:`header-${x.id}`,section:x,expanded:g,onToggle:()=>f(x.id),headerStyle:i,expandIcon:l,collapseIcon:d,iconPosition:u}),S=o(kl,{key:`content-${x.id}`,section:x,expanded:g,contentStyle:s,animated:h});return o("div",{key:x.id,"data-accordion-section":x.id,style:{width:"100%"}},b,S)}),[t,c,i,s,l,d,u,h,f]);return o(_e,{role:"region",ariaLabel:"Accordion",styling:a,keyboardNav:!0},...y)}var Cl={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function zr(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,a]=U(!1),l=Cl[i],d=v(()=>{a(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!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,x)=>{let g=y===x.length-1,b=h&&f.label==="..."&&y===1,S=[];return y>0&&S.push(m(n)),b?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"},"...")):g?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?I=>{I.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)},p=u.map((f,y)=>c(f,y,u));return o(_e,{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"}},...p))}function Ar(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:a,onMouseLeave:l}=Fe(),[d,u]=U(!1),h=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,p={...bt(n,{hover:!m&&s,active:!1}),position:"relative",justifyContent:"space-between",...m?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},f=v(()=>{if(!m){if(h){u(I=>!I);return}t.onClick&&t.onClick(),r&&i()}},[m,h,t,r,i]),y=v(()=>{a(),h&&u(!0)},[h,a]),x=v(()=>{l(),h&&u(!1)},[h,l]),g=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)),b=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(_e,{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(I=>o(Ar,{key:I.id,item:I,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:p,onClick:f,disabled:m||void 0,tabIndex:m?-1:0,"aria-disabled":m?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},g,b),S)}function Lr(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:a="bottom-start",closeOnSelect:l=!0,width:d="220px"}=e,[u,h]=U(!1),m=ne(null),c=v(()=>{h(I=>!I)},[]),p=v(()=>{h(!1)},[]);re(()=>{if(!u)return;let I=A=>{let C=m.current;C&&!C.contains(A.target)&&h(!1)};return document.addEventListener("click",I,!0),()=>{document.removeEventListener("click",I,!0)}},[u]),re(()=>{if(!u)return;let I=A=>{A.key==="Escape"&&h(!1)};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I)}},[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")),x=typeof d=="number"?`${d}px`:d,g={position:"absolute",top:"100%",...a==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},b={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:x,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:g},o(_e,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(I=>o(Ar,{key:I.id,item:I,itemStyle:s,closeOnSelect:l,onClose:p})))):null;return o("div",{ref:m,style:{position:"relative",display:"inline-block"}},y,S)}function Br(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),[l,d]=U(!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 h=t.disabled===!0,m=v(()=>{if(!h){if(u){d(b=>!b);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=v(()=>{s(),u&&d(!0)},[u,s]),p=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:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"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)),x=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,g=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((b,S)=>o(Br,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:p},o("button",{type:"button",role:"menuitem",style:f,onClick:m,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?l:void 0},y,x),g)}function Ml(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:a}=e,{hover:l,onMouseEnter:d,onMouseLeave:u}=Fe(),h=ne(null),m=v(()=>{r?a():s(n)},[r,n,s,a]),c=v(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),p={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,x)=>o(Br,{key:String(x),item:y,onClose:a,index:x})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:p,onClick:m,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),f)}function Fr(e){let{menus:t}=e,[n,r]=U(null),i=ne(null),s=v(d=>{r(d)},[]),a=v(()=>{r(null)},[]);re(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),re(()=>{let d=i.current;if(!d)return;let u=h=>{let m=h;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 p=c.querySelector('[role="menuitem"]');p&&p.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(Ml,{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 Gt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function El(e,t,n){let r=n*2+5;if(e<=r)return Gt(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?[...Gt(1,n*2+3),"ellipsis",e]:a&&!l?[1,"ellipsis",...Gt(e-n*2-2,e)]:[1,"ellipsis",...Gt(i,s),"ellipsis",e]}var Xt={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"},Il={...Xt,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},Nr={...Xt,color:"#9ca3af",cursor:"default",opacity:"0.5"},Rl={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Wr(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)),h=Math.min(Math.max(1,r),u),m=v(x=>{!d&&x>=1&&x<=u&&x!==h&&i(x)},[d,u,h,i]),c=(x,g,b)=>{let S=d||g<1||g>u||g===h;return o("button",{type:"button",onClick:()=>m(g),disabled:S||void 0,"aria-label":b,style:S?Nr:Xt},x)},p=El(u,h,s),f=0,y=[];a&&y.push(c("\xAB",1,"Go to first page")),l&&y.push(c("\u2039",h-1,"Go to previous page"));for(let x of p)if(x==="ellipsis")y.push(o("span",{key:`ellipsis-${f++}`,style:Rl},"..."));else{let g=x===h;y.push(o("button",{key:String(x),type:"button",onClick:()=>m(x),disabled:d||void 0,"aria-label":`Page ${x}`,"aria-current":g?"page":void 0,style:d?Nr:g?Il:Xt},String(x)))}return l&&y.push(c("\u203A",h+1,"Go to next page")),a&&y.push(c("\xBB",u,"Go to last page")),o(_e,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function _r(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:a,onMouseEnter:l,onMouseLeave:d}=Fe(),[u,h]=U(!1),m=t.children&&t.children.length>0,c=t.id===r,p=v(()=>{m&&!n&&h(T=>!T),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"},x=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,g=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),b=!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,I=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,A=o("button",{type:"button",style:y,onClick:p,onMouseEnter:l,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},x,g,b,S,I),C=!n&&m&&u?t.children.map(T=>o(_r,{key:T.id,item:T,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},A,C?o("div",{role:"group"},...C):null)}function Or(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,h=t.map(m=>o(_r,{key:m.id,item:m,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(_e,{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,...h)}var Ve={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 Hr(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,h=v(x=>{s&&i&&i(x)},[s,i]),m=x=>x<n?"completed":x===n?"active":"pending",c=(x,g,b)=>{let S=a==="dot"?u:d,I={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 b==="completed"?o("div",{style:{...I,backgroundColor:Ve.completedBg,color:Ve.completedText,border:`2px solid ${Ve.completed}`}},a==="circle"?g.icon||"\u2713":null):b==="active"?o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.activeText,border:`2px solid ${Ve.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},a==="circle"?g.icon||String(x+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Ve.active}})):o("div",{style:{...I,backgroundColor:"#ffffff",color:Ve.pendingText,border:`2px solid ${Ve.pending}`}},a==="circle"?g.icon||String(x+1):null)},p=x=>{if(x>=t.length-1)return null;let b=x<n?Ve.lineCompleted:Ve.line;return l?o("div",{style:{flex:"1",height:"2px",backgroundColor:b,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:b,marginLeft:`${(a==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},f=(x,g)=>{let b=m(g),S=b==="active",I=b==="completed",A=c(g,x,b),C={fontSize:"13px",fontWeight:S?"600":"400",color:S||I?Ve.labelActive:Ve.labelPending,marginTop:l?"8px":"0",marginLeft:l?"0":"12px",textAlign:l?"center":"left",transition:"color 0.2s"},T={fontSize:"11px",color:Ve.descriptionColor,marginTop:"2px",textAlign:l?"center":"left"},L=o("div",{style:l?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:C},x.label),x.description?o("span",{style:T},x.description):null),R=l?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},A,L):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},A,L);return o(s?"button":"div",{key:String(g),onClick:s?()=>h(g):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},R)},y=[];return t.forEach((x,g)=>{y.push(f(x,g));let b=p(g);b&&y.push(b)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:l?"row":"column",alignItems:l?"flex-start":"stretch",width:"100%"}},...y)}var Yr={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 Pl(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:a}=Fe(),l=Yr[n],d=t.disabled===!0,u=t.type==="toggle",[h,m]=U(!1),c=u?t.active===!0:h,p=v(()=>{!d&&t.onClick&&t.onClick()},[d,t]),f=v(()=>{!d&&!u&&m(!0)},[d,u]),y=v(()=>{u||m(!1)},[u]),x=v(()=>{a(),u||m(!1)},[u,a]),g={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"},b=t.icon?o("span",{style:{fontSize:l.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,I=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:g,onClick:p,onMouseDown:f,onMouseUp:y,onMouseEnter:s,onMouseLeave:x,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,I)}function Vr(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Yr[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(Pl,{key:a.id,item:a,size:n,variant:r}));return o(_e,{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 xt=class e{constructor(t,n){et(this,"id");et(this,"label");et(this,"children");et(this,"expanded");et(this,"icon");et(this,"metadata");et(this,"parent");et(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 Ur(e){e.expanded=!0;for(let t of e.children)Ur(t)}function jr(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)jr(n,t);return t}function Tl(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function $l(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:a,iconCollapsed:l,nodeStyle:d,renderNode:u,onToggle:h,onClick:m,focusedId:c}=e,p=Fe(),f=ne(null),y=c===t.id;re(()=>{y&&f.current&&f.current.focus()},[y]);let x=t.isLeaf(),g=t.depth,b=[];for(let T=0;T<g;T++){let L=t;for(let $=0;$<g-T;$++)L=L?L.parent:null;let R=L?!Tl(L):!1;b.push(o("span",{key:`connector-${T}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...R?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=g>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,I=x?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:T=>{T.stopPropagation(),h(t)}},t.expanded?a:l),A=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=bt(d,{hover:p.hover,active:n});return o("div",{ref:f,role:"treeitem","aria-expanded":x?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":g+1,tabIndex:y?0:-1,style:{...C,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onClick:()=>m(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},I,A))}function Gr(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:h="\u2212",iconCollapsed:m="+",nodeStyle:c={},wrapperStyle:p,renderNode:f}=e,[y,x]=U(()=>{let R=xt.fromData(t);return a&&Ur(R),R}),[g,b]=U(t.id),S=X(()=>jr(y),[y]),I=v(()=>{x(R=>{let $=Object.create(Object.getPrototypeOf(R));return Object.assign($,R),$})},[]),A=v(R=>{R.toggle(),R.expanded?r?.(R):i?.(R),I()},[r,i,I]),C=v(R=>{b(R.id),n?.(R)},[n]),T=v(R=>{let $=R;if(!g)return;let B=S.findIndex(N=>N.id===g);if(B===-1)return;let E=S[B];switch($.key){case"ArrowDown":{$.preventDefault();let N=S[B+1];N&&b(N.id);break}case"ArrowUp":{$.preventDefault();let N=S[B-1];N&&b(N.id);break}case"ArrowRight":{$.preventDefault(),E.isLeaf()||(E.expanded?E.children.length>0&&b(E.children[0].id):A(E));break}case"ArrowLeft":{$.preventDefault(),!E.isLeaf()&&E.expanded?A(E):E.parent&&b(E.parent.id);break}case"Enter":{$.preventDefault(),C(E);break}case" ":{$.preventDefault(),E.isLeaf()||A(E);break}case"Home":{$.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{$.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[g,S,A,C]),L=S.map(R=>o($l,{key:R.id,node:R,isSelected:R.id===s,indentPx:u,lineColor:l,lineWidth:d,iconExpanded:h,iconCollapsed:m,nodeStyle:c,renderNode:f,onToggle:A,onClick:C,focusedId:g}));return o(_e,{role:"tree",ariaLabel:"Tree navigation",styling:p,keyboardNav:!1},o("div",{onKeyDown:T,style:{outline:"none"}},...L))}function Xr(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,a]=U(-1),[l,d]=U(null),u=ne(null);re(()=>{if(!u.current)return;u.current.focus();let c=f=>{let y=f,x=t.map((g,b)=>({item:g,i:b})).filter(({item:g})=>!g.divider);if(y.key==="ArrowDown")y.preventDefault(),a(g=>{let S=(x.findIndex(({i:I})=>I===g)+1)%x.length;return x[S].i});else if(y.key==="ArrowUp")y.preventDefault(),a(g=>{let b=x.findIndex(({i:I})=>I===g),S=b<=0?x.length-1:b-1;return x[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 g=t[s];g.children?d(s):!g.disabled&&g.onClick&&(g.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let p=u.current;return()=>p.removeEventListener("keydown",c)},[t,s,i,r]);let h={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,p)=>{if(c.divider)return o("div",{key:`divider-${p}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let f=s===p,y=!!c.disabled,x=!!(c.children&&c.children.length>0),g={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"},b=()=>{a(p),d(x?p:null)},S=()=>{if(!y){if(x){d(p);return}c.onClick&&c.onClick(),r()}},I=[];c.icon&&I.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),I.push(o("span",{style:{flex:"1"}},c.label??"")),x&&I.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let A=[o("div",{key:`item-${p}`,style:g,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...I)];return x&&l===p&&A.push(o(Xr,{key:`submenu-${p}`,items:c.children,position:{x:n.x+178,y:n.y+p*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${p}`,style:{position:"relative"}},...A)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...m)}function Kt(e){let{items:t,children:n}=e,[r,i]=U(null),s=v(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),a=v(()=>{i(null)},[]);re(()=>{if(!r)return;let u=m=>{a()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,a]),re(()=>{if(!r)return;let u=h=>{h.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(Xr,{items:t,position:r,onClose:a,depth:0})),o("div",null,...d)}function Dl(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 zl(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 Kr(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,[h,m]=U(!1),[c,p]=U(!1),f=ne(null),y=s?"drawer-title":void 0;if(re(()=>{if(t)m(!0),requestAnimationFrame(()=>p(!0));else{p(!1);let R=setTimeout(()=>m(!1),300);return()=>clearTimeout(R)}},[t]),re(()=>{if(!t||!d)return;let R=$=>{$.key==="Escape"&&n()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t,d,n]),re(()=>{if(!t)return;let R=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=R}},[t]),re(()=>{t&&f.current&&f.current.focus()},[t]),!h)return null;let x={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"},g={...zl(r,i),transform:Dl(r,c),transition:"transform 0.3s ease"},b={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"},I={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},A={padding:"20px",overflow:"auto",flex:"1"},C=()=>{l&&n()},T=[];s&&T.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:I,onClick:n,"aria-label":"Close drawer"},"\xD7"))),T.push(o("div",{style:A},u));let L=[];return a&&L.push(o("div",{style:x,onClick:C})),L.push(o("div",{ref:f,style:g,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...T)),o("div",null,...L)}var Al={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function qr(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,h=ne(null);if(re(()=>{if(!t)return;let C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[t]),re(()=>{if(!t||!a)return;let C=T=>{T.key==="Escape"&&n()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[t,a,n]),re(()=>{t&&h.current&&h.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:Al[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},p={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"},x={padding:"24px",overflow:"auto",flex:"1"},g={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=C=>{s&&C.target===C.currentTarget&&n()},S=[],I=r?"modal-title":void 0;r?S.push(o("h2",{id:I,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 A=[o("div",{style:p},...S),o("div",{style:x},u)];return l&&A.push(o("div",{style:g},l)),o("div",{style:m,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":I},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...A))}var Zr=8;function Ll(e,t){let n=t+Zr;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 Bl(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${Zr}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 Jr(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,[h,m]=U(!1),c=u?r:h,p=ne(null),f=v(()=>{u?d&&d(!r):m(I=>!I)},[u,r,d]);re(()=>{if(!c||!l)return;let I=A=>{p.current&&!p.current.contains(A.target)&&(u?d&&d(!1):m(!1))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[c,l,u,d]);let y={position:"relative",display:"inline-block"},x={...Ll(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"},g=[n];a&&g.push(o("div",{style:Bl(i)}));let b=v(I=>{let A=I.key;(A==="Enter"||A===" ")&&(I.preventDefault(),f())},[f]),S=[o("div",{onClick:f,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:x},...g)),o("div",{ref:p,style:y},...S)}var Fl=0;function Nl(){return`toast-${++Fl}-${Date.now()}`}function On(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 h=Nl();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}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 Wl={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 _l(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 Ol(e){let{item:t,onDismiss:n}=e,r=Wl[t.type];re(()=>{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 Hn(e){let{toaster:t}=e,[,n]=U(0);re(()=>t.subscribe(()=>n(l=>l+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=_l(t.config.position);re(()=>{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(Ol,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function Qr(e={}){let t=ne(null);t.current||(t.current=On(e));let n=t.current,r=v(()=>o(Hn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Hl=6,Yl=8;function Vl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Yl;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=`${Hl}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 ei(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=U(!1),[d,u]=U(null),h=ne(null),m=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=v(()=>{m.current=setTimeout(()=>{if(h.current){let b=h.current.getBoundingClientRect();u(Vl(b,n))}l(!0)},r)},[r,n]),f=v(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},x={...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"},g=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:x,role:"tooltip"},t,o("div",{style:Ul(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Yn(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 jl(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 Gl(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 Xl(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 ti=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ni(e,t){return t||ti[e%ti.length]}function oi(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:h="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,x=i==="vertical",g=n-c*2,b=r-c*2,S=x?b:g,I=x?g:b,A=f!==void 0&&f.length>0,C=X(()=>A?Xl(f):[],[A,f]),T=A?f.length:t.length,L=X(()=>jl(t,f,y),[t,f,y]),R=L>0?L:1,$=Yn(T,R,S,I,a),B=v(()=>{if(!u)return[];let O=Gl(R),Y=[];for(let K=O;K<=R;K+=O){let Q=$.valueScale(K);if(x){let q=c+b-Q;Y.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(q),x2:String(c+g),y2:String(q),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(q+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let q=c+Q;Y.push(o("line",{key:`grid-${K}`,x1:String(q),y1:String(c),x2:String(q),y2:String(c+b),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(q),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return Y},[u,R,$,x,c,g,b,h]),E=v(()=>{let O=[];return x?(O.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"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),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+b),stroke:"#374151","stroke-width":"1.5"}))),O},[x,c,g,b]),N=v(()=>{let O=[];for(let Y=0;Y<t.length;Y++){let K=t[Y],Q=$.valueScale(K.value),q=$.categoryScale(Y),H=K.color??s,j,G,V=String(K.value);if(x){let Z=c+q,te=c+b-Q;j={x:String(Z),y:String(te),width:String($.barThickness),height:String(Q),rx:String(l),ry:String(l),fill:H},G={x:String(Z+$.barThickness/2),y:String(te-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+q,te=c;j={x:String(te),y:String(Z),width:String(Q),height:String($.barThickness),rx:String(l),ry:String(l),fill:H},G={x:String(te+Q+6),y:String(Z+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(j.style=x?`animation: barGrow 0.6s ease-out ${Y*.05}s both`:`animation: barGrow 0.6s ease-out ${Y*.05}s both`),O.push(o("rect",{key:`bar-${Y}`,...j})),d&&O.push(o("text",{key:`val-${Y}`,...G},V)),x){let Z=c+q+$.barThickness/2,te=c+b+16;O.push(o("text",{key:`cat-${Y}`,x:String(Z),y:String(te),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${te})`},K.label))}else O.push(o("text",{key:`cat-${Y}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[t,$,s,l,d,p,x,c,b]),z=v(()=>{if(!f)return[];let O=[];for(let Y=0;Y<f.length;Y++){let K=f[Y],Q=$.categoryScale(Y),q=0;for(let H=0;H<K.values.length;H++){let j=K.values[H],G=$.valueScale(j.value),V=$.valueScale(q),Z=ni(H,j.color);if(x){let te=c+Q,ae=c+b-V-G;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String($.barThickness),height:String(G),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>14&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+$.barThickness/2),y:String(ae+G/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let te=c+V,ae=c+Q;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String(G),height:String($.barThickness),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>20&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+G/2),y:String(ae+$.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}q+=j.value}if(d){let H=$.valueScale(q);x?O.push(o("text",{key:`stotal-${Y}`,x:String(c+Q+$.barThickness/2),y:String(c+b-H-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q))):O.push(o("text",{key:`stotal-${Y}`,x:String(c+H+6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q)))}if(x){let H=c+Q+$.barThickness/2,j=c+b+16;O.push(o("text",{key:`scat-${Y}`,x:String(H),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${j})`},K.label))}else O.push(o("text",{key:`scat-${Y}`,x:String(c-6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[f,$,l,d,p,x,c,b]),k=v(()=>{if(!f)return[];let O=C.length,Y=[];for(let K=0;K<f.length;K++){let Q=f[K],q=$.categoryScale(K),H=2,j=Math.max(1,($.barThickness-H*(O-1))/O);for(let G=0;G<Q.values.length;G++){let V=Q.values[G],Z=C.indexOf(V.category),te=Z*(j+H),ae=$.valueScale(V.value),J=ni(Z>=0?Z:G,V.color);if(x){let ie=c+q+te,le=c+b-ae;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(j),height:String(ae),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}else{let ie=c,le=c+q+te;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(ae),height:String(j),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+ae+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}}if(x){let G=c+q+$.barThickness/2,V=c+b+16;Y.push(o("text",{key:`gcat-${K}`,x:String(G),y:String(V),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${V})`},Q.label))}else Y.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},Q.label))}return Y},[f,C,$,l,d,p,x,c,b]),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]),D=v(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},x?"@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; } }"))]:[],[p,x]),M=B(),F=E(),P=w(),W=D(),_;return A&&y?_=k():A?_=z():_=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,...P,...M,...F,..._)}function yt(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 qt(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 h=t[u],m=e(h);isFinite(m)&&a.push({input:h,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),ri(l)};return ri(l),()=>{i=!0}}function ri(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Kl(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 ii(e,t){let n=t-e;if(n<=0)return[e];let r=Kl(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 si(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Te=40,ai=1.1,li=.01,ci=1e6;function di(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:h=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:x="#94a3b8",onPointClick:g,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:I}=e,[A,C]=U(d[0]),[T,L]=U(d[1]),[R,$]=U(u[0]),[B,E]=U(u[1]),N=ne(!1),z=ne(null),k=v(V=>Te+(V-A)/(T-A)*(t-2*Te),[A,T,t]),w=v(V=>n-Te-(V-R)/(B-R)*(n-2*Te),[R,B,n]),D=v(V=>A+(V-Te)/(t-2*Te)*(T-A),[A,T,t]),M=v(V=>R+(n-Te-V)/(n-2*Te)*(B-R),[R,B,n]),F=v(V=>{let Z=V;N.current=!0,z.current={mx:Z.clientX,my:Z.clientY,x0:A,x1:T,y0:R,y1:B}},[A,T,R,B]),P=v(V=>{if(!N.current||!z.current)return;let Z=V,te=z.current,ae=Z.clientX-te.mx,J=Z.clientY-te.my,ie=ae/(t-2*Te)*(te.x1-te.x0),le=J/(n-2*Te)*(te.y1-te.y0);C(te.x0-ie),L(te.x1-ie),$(te.y0+le),E(te.y1+le)},[t,n]),W=v(()=>{N.current=!1,z.current=null},[]),_=v(V=>{let Z=V;Z.preventDefault();let te=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-te.left,J=Z.clientY-te.top,ie=D(ae),le=M(J),fe=Z.deltaY>0?ai:1/ai,oe=(T-A)*fe,ge=(B-R)*fe;if(oe<li||ge<li||oe>ci||ge>ci)return;let he=(ie-A)/(T-A),ee=(le-R)/(B-R);C(ie-he*oe),L(ie+(1-he)*oe),$(le-ee*ge),E(le+(1-ee)*ge)},[A,T,R,B,D,M]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let V=ii(A,T),Z=ii(R,B);for(let te=0;te<V.length;te++){let ae=k(V[te]);O.push(o("line",{x1:ae,y1:Te,x2:ae,y2:n-Te,stroke:y,"stroke-width":.5,key:`gx-${te}`})),O.push(o("text",{x:ae,y:n-Te+14,"text-anchor":"end","font-size":10,fill:x,transform:`rotate(-45, ${ae}, ${n-Te+14})`,key:`lx-${te}`},si(V[te])))}for(let te=0;te<Z.length;te++){let ae=w(Z[te]);O.push(o("line",{x1:Te,y1:ae,x2:t-Te,y2:ae,stroke:y,"stroke-width":.5,key:`gy-${te}`})),O.push(o("text",{x:Te-6,y:ae+3,"text-anchor":"end","font-size":10,fill:x,key:`ly-${te}`},si(Z[te])))}}if(m){let V=Math.max(Te,Math.min(t-Te,k(0))),Z=Math.max(Te,Math.min(n-Te,w(0)));O.push(o("line",{x1:Te,y1:Z,x2:t-Te,y2:Z,stroke:x,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:V,y1:Te,x2:V,y2:n-Te,stroke:x,"stroke-width":1,key:"y-axis"}))}let Y=X(()=>{if(!i||!l)return[];let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return qt(i,Z)},[i,A,T,a,s,l]),[K,Q]=U([]),q=ne(null);re(()=>{if(!i||l){Q([]);return}let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return q.current&&q.current(),q.current=Zt(i,Z,200,te=>{Q([...te])}),()=>{q.current&&q.current()}},[i,A,T,a,s,l]);let H=l?Y:K;if(H.length>0){let V=[];for(let Z=0;Z<H.length;Z++){let te=H[Z],ae=k(te.input),J=w(te.output);V.push(`${V.length===0?"M":"L"}${ae},${J}`)}O.push(o("path",{d:V.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let j=(V,Z,te,ae)=>{if(Z)return J=>Z({x:ae.x,y:ae.y,index:te,event:J})};for(let V=0;V<r.length;V++){let Z=r[V],te=k(Z.x),ae=w(Z.y),J={cx:te,cy:ae,r:c,fill:p,cursor:"pointer",key:`pt-${V}`};g&&(J.onClick=j("click",g,V,Z)),b&&(J.onDblClick=j("dblclick",b,V,Z)),S&&(J.onContextMenu=j("contextmenu",S,V,Z)),I&&(J.onMouseOver=j("mouseover",I,V,Z)),O.push(o("circle",J))}let G=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Te,y:Te,width:t-2*Te,height:n-2*Te})));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:P,onMouseUp:W,onMouseLeave:W,onWheel:_},G,...O)}function pi(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 ui(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,h=0,m=0,c=0;return i<60?(h=l,m=d):i<120?(h=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function fi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=pi){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let m=n[0]+h/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function mi(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=pi,data:d,resolution:u=2,onPointClick:h,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let M=d.length,F=M>0?d[0].length:0,P=F>0?t/F:1,W=M>0?n/M:1,_=[];for(let O=0;O<M;O++){let Y=d[O];for(let K=0;K<F;K++){let Q=Y[K]??0,[q,H,j]=ui(Q,s,a);_.push(o("rect",{key:`${O}-${K}`,x:String(K*P),y:String(O*W),width:String(Math.ceil(P)),height:String(Math.ceil(W)),fill:`rgb(${q},${H},${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[f,y]=U(r[0]),[x,g]=U(r[1]),[b,S]=U(i[0]),[I,A]=U(i[1]),C=ne(null),T=ne(!1),L=ne(null),R=v((M,F)=>{let P=f+M/t*(x-f),W=I-F/n*(I-b);return{re:P,im:W}},[f,x,b,I,t,n]);re(()=>{let M=C.current;if(!M)return;let F=M.getContext("2d");if(!F)return;let P=F.createImageData(t,n),W=P.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:Y,im:K}=R(O,_),Q=l(Y,K,s),[q,H,j]=ui(Q,s,a),G=(_*t+O)*4;W[G]=q,W[G+1]=H,W[G+2]=j,W[G+3]=255}F.putImageData(P,0,0)},[f,x,b,I,t,n,s,a,l,R]);let $=v(M=>{let F=M.target.getBoundingClientRect(),P=M.clientX-F.left,W=M.clientY-F.top,{re:_,im:O}=R(P,W),Y=l(_,O,s);return{re:_,im:O,iterations:Y,event:M}},[R,l,s]),B=v(M=>{T.current=!0,L.current={x:M.clientX,y:M.clientY,rMin:f,rMax:x,iMin:b,iMax:I}},[f,x,b,I]),E=v(M=>{if(m&&m($(M)),!T.current||!L.current)return;let F=L.current,P=M.clientX-F.x,W=M.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-P*_),g(F.rMax-P*_),S(F.iMin+W*O),A(F.iMax+W*O)},[t,n,m,$]),N=v(()=>{T.current=!1},[]),z=v(M=>{M.preventDefault();let F=M.deltaY>0?1.15:1/1.15,P=M.target.getBoundingClientRect(),W=M.clientX-P.left,_=M.clientY-P.top,{re:O,im:Y}=R(W,_);y(O+(f-O)*F),g(O+(x-O)*F),S(Y+(b-Y)*F),A(Y+(I-Y)*F)},[R,f,x,b,I]),k=v(M=>{h&&h($(M))},[h,$]),w=v(M=>{c&&c($(M))},[c,$]),D=v(M=>{M.preventDefault(),p&&p($(M))},[p,$]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N,onWheel:z,onClick:k,onDblClick:w,onContextMenu:D})}function gi(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 ql(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,h=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,p=gi(i,s,c),f=gi(a,l,c);return{xScale:h,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function Vn(e,t,n,r){return X(()=>ql(e,t,n,r),[e,t,n,r])}function hi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function bi(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 xi(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:h=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:x=50,animate:g=!1,multiLine:b}=e,S=X(()=>{let B=[...t];if(b)for(let E of b)B.push(...E.data);return B},[t,b]),I=Vn(S,n,r,x),{xScale:A,yScale:C,xTicks:T,yTicks:L}=I,R=[];if(R.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:x,x2:E,y2:r-x,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x,y1:E,x2:n-x,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}R.push(o("line",{x1:x,y1:r-x,x2:n-x,y2:r-x,stroke:"#374151","stroke-width":1,key:"x-axis"})),R.push(o("line",{x1:x,y1:x,x2:x,y2:r-x,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:r-x,x2:E,y2:r-x+5,stroke:"#374151",key:`xtick-${B}`})),R.push(o("text",{x:E,y:r-x+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-x+18})`,key:`xlabel-${B}`},hi(T[B])))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x-5,y1:E,x2:x,y2:E,stroke:"#374151",key:`ytick-${B}`})),R.push(o("text",{x:x-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},hi(L[B])))}function $(B,E,N,z,k,w,D,M,F,P){if(B.length===0)return;let W=[...B].sort((Y,K)=>Y.x-K.x);if(z){let Y=C(I.yMin),K=W.map(j=>`${A(j.x)},${C(j.y)}`).join(" "),Q=A(W[0].x),q=A(W[W.length-1].x),H=`${Q},${Y} ${K} ${q},${Y}`;R.push(o("polygon",{points:H,fill:k,key:`${P}-area`}))}let O={points:W.map(Y=>`${A(Y.x)},${C(Y.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${P}-line`};if(g?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",R.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):R.push(o("polyline",O)),w)for(let Y=0;Y<W.length;Y++){let K=A(W[Y].x),Q=C(W[Y].y),q=W[Y].shape??F,H=W[Y].radius??M,j=`${P}-pt-${Y}`;if(g){let G=bi(q,K,Q,H,D,j,{opacity:0});R.push(o("g",{key:`${j}-g`},G,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else R.push(bi(q,K,Q,H,D,j))}}if($(t,i,s,m,c,u,l,a,d,"primary"),b)for(let B=0;B<b.length;B++){let E=b[B];$(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(b&&b.length>0){let B=[],E=[{color:i,label:"Primary"},...b.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=x+10,z=16,k=22,w=7.2,D=14,M=6,F=n-x*2-20,P=0,W=0;for(let _=0;_<E.length;_++){let O=E[_].label.length*w,Y=D+M+O;P>0&&P+Y>F&&(P=0,W+=k);let K=N+P,Q=x-30-W;B.push(o("rect",{x:K,y:Q,width:D,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:K+D+M,y:Q+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),P+=Y+z}R.push(o("g",{key:"legend"},...B))}return p&&R.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&R.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&&R.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"},...R)}function Zl(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 Jl(e,t){let n=t??Zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function St(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=St(e,t,r,a),u=St(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=St(e,t,n,l),c=St(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function jn(e,t){let n=t?.padAngle??0,r=Jl(e,t?.colors),i=e.reduce((u,h)=>u+h.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 h=e[u],m=h.value/i*a,c=d+n/2,p=c+m;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function yi(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:h,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,x=d&&u==="right"?140:0,g=h?30:0,b=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-x,I=r-g-b,A=S/2,C=g+I/2,T=Math.min(S,I)/2-10,L=e.outerRadius??T,R=X(()=>jn(t,{padAngle:s,colors:c}),[t,s,c]),$=[];h&&$.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<R.length;B++){let E=R[B],N=Un(A,C,i,L,E.startAngle,E.endAngle);if($.push(o("path",{key:`slice-${B}`,d:N,fill:E.color,stroke:p,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,D=St(A,C,w,z-Math.PI/2),M=k?y:"#fff",F=k?11:12,P=[];if(a&&P.push(E.label),l&&P.push(`${E.percentage.toFixed(1)}%`),k){let W=St(A,C,L+2,z-Math.PI/2);$.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:D.x,y2:D.y,stroke:"#999",strokeWidth:1}))}a&&$.push(o("text",{key:`label-${B}`,x:D.x,y:D.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:M,pointerEvents:"none"},E.label)),l&&$.push(o("text",{key:`value-${B}`,x:D.x,y:D.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:M,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(m&&i>0&&$.push(o("text",{key:"center-label",x:A,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let B=[];if(u==="right"){let E=S+10,N=g+20;for(let z=0;z<R.length;z++){let k=R[z],w=N+z*22;B.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-b+10;for(let N=0;N<R.length;N++){let z=R[N],k=N%2,w=Math.floor(N/2),D=k*(n/2)+10,M=E+w*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:D+6,cy:M,r:6,fill:z.color})),B.push(o("text",{key:`legend-text-${N}`,x:D+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${z.label} (${z.percentage.toFixed(1)}%)`))}}$.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...$)}function Si(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function vi(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:h=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:x}=e,[g,b]=U(r[1]),[S,I]=U(0),[A,C]=U(0),[T,L]=U(null),R=t/2+S,$=n/2+A,E=Math.min(t,n)/2-30,N=E/g,z=X(()=>{let H=Math.max(1,Math.ceil(g)),j=[],G=g/H;for(let V=1;V<=H;V++)j.push(G*V);return j},[g]),k=X(()=>{let H=[];for(let j=0;j<360;j+=30)H.push(j*Math.PI/180);return H},[]),w=X(()=>{if(!i||!l)return[];let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return qt(i,j)},[i,s,a,l]),[D,M]=U([]),F=ne(null);re(()=>{if(!i||l){M([]);return}let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return F.current&&F.current(),F.current=Zt(i,j,200,G=>{M([...G])}),()=>{F.current&&F.current()}},[i,s,a,l]);let P=l?w:D,W=X(()=>{if(P.length===0)return"";let H=[];for(let j=0;j<P.length;j++){let G=P[j],V=G.output;if(V<0||!isFinite(V))continue;let{x:Z,y:te}=Si(V,G.input,R,$,N);H.push(`${H.length===0?"M":"L"}${Z.toFixed(2)},${te.toFixed(2)}`)}return H.join(" ")},[P,R,$,N]),_=v(H=>{L({x:H.clientX,y:H.clientY,px:S,py:A})},[S,A]),O=v(H=>{T&&(I(T.px+(H.clientX-T.x)),C(T.py+(H.clientY-T.y)))},[T]),Y=v(()=>{L(null)},[]),K=v(H=>{H.preventDefault();let j=H.deltaY>0?1.15:1/1.15;b(Math.max(.1,g*j))},[g]),Q=v((H,j,G)=>{if(H)return V=>H({r:j.r,theta:j.theta,index:G,event:V})},[]),q=[];if(q.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let H=0;H<z.length;H++){let j=z[H]*N;q.push(o("circle",{cx:R,cy:$,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${H}`})),q.push(o("text",{x:R+j+2,y:$-4,"font-size":10,fill:"#9ca3af",key:`gl-${H}`},z[H].toFixed(1)))}for(let H=0;H<k.length;H++){let j=k[H],G=z[z.length-1]*N,V=R+G*Math.cos(j),Z=$-G*Math.sin(j);q.push(o("line",{x1:R,y1:$,x2:V,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${H}`}));let te=Math.round(j*180/Math.PI),ae=R+(G+14)*Math.cos(j),J=$-(G+14)*Math.sin(j);q.push(o("text",{x:ae,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${H}`},`${te}\xB0`))}}q.push(o("line",{x1:R-E,y1:$,x2:R+E,y2:$,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),q.push(o("line",{x1:R,y1:$-E,x2:R,y2:$+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&q.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let H=0;H<d.length;H++){let j=d[H],{x:G,y:V}=Si(j.r,j.theta,R,$,N);q.push(o("circle",{cx:G,cy:V,r:h,fill:m,key:`pt-${H}`,style:{cursor:"pointer"},onClick:Q(p,j,H),onDblClick:Q(f,j,H),onContextMenu:Q(y,j,H),onMouseEnter:Q(x,j,H)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:T?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:Y,onMouseLeave:Y,onWheel:K},...q)}function Gn(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 Xn(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 Kn(e,t){let n=wi(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=ec(n,Ql(e,i,s,a))}r++}return n}function wi(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 Ql(e,t,n,r){let i=wi(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 ec(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 qn(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 Zn(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 Pt(e,t=[],n=.3,r=1){let i=Gn(e),s=Xn(e),a=Kn(e,t);return{vertices:i.map((d,u)=>{let h=qn(a,d),m=Zn(h,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function Tt(e){return e*(e-1)/2}function Jt(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 ki(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,h=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=Tt(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Jt(p):e.vertexColors,[p,e.vertexColors]),[y,x]=U(()=>{let M=[];for(let F=0;F<c;F++)M.push(0);return M}),[g,b]=U(!1),S=ne({x:0,y:0}),I=ne([]),A=ne(0);re(()=>{if(d===0)return;let M=!0,F=()=>{M&&(x(P=>{let W=P.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),A.current=requestAnimationFrame(F))};return A.current=requestAnimationFrame(F),()=>{M=!1,cancelAnimationFrame(A.current)}},[d]);let C=X(()=>Pt(t,y,l,m),[t,y,l,m]),T=n/2,L=r/2,R=X(()=>C.edges.map(M=>{let F=C.vertices[M.source],P=C.vertices[M.target],W=(F.depth+P.depth)/2;return{...M,avgDepth:W,sv:F,tv:P}}).sort((M,F)=>M.avgDepth-F.avgDepth),[C]),$=X(()=>C.vertices.slice().sort((M,F)=>M.depth-F.depth),[C]),B=v(M=>{let F=M;b(!0),S.current={x:F.clientX,y:F.clientY},I.current=y.slice()},[y]),E=v(M=>{if(!g)return;let F=M,P=(F.clientX-S.current.x)*.01,W=(F.clientY-S.current.y)*.01;x(()=>{let _=I.current.slice();return _.length>0&&(_[0]=(_[0]??0)+P),_.length>1&&(_[1]=(_[1]??0)+W),_})},[g]),N=v(()=>{b(!1)},[]),z=M=>{let F=(M+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},k=M=>{let F=(M+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},w=R.map((M,F)=>{let P=z(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String(T+M.sv.x),y1:String(L+M.sv.y),x2:String(T+M.tv.x),y2:String(L+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(P),"stroke-linecap":"round"})}),D=$.map(M=>{let F=i*k(M.depth),P=f[M.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${M.id}-circle`,cx:String(T+M.x),cy:String(L+M.y),r:String(F),fill:P,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-${M.id}-label`,x:String(T+M.x),y:String(L+M.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N},...w,...D.flat())}function Ci(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Tt(t),[a,l]=U(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,m=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(m))};return h=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:X(()=>Pt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Mi(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:tc(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?oc(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=nc(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function tc(e,t){return"column"}function nc(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 oc(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"}},rc(n),o("span",null,n.label))))}function rc(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 ic(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 sc(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Ei(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;ic(t),sc();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 Ii(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:h,ariaLabel:m="Site footer"}=e;return o("footer",{className:h,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 Ti=Ue({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),ac={width:600,height:400},lc={x:30,y:30},cc={top:0,left:0,width:1920,height:1080},Jn=1e3;function Ri(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 Qn(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 Pi(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 eo(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Qt(e){let t=e.workspaceBounds??cc,n=e.defaultWindowSize??ac,r=e.cascadeOffset??lc,[i,s]=U([]),a=v(((...B)=>{let E=B[0];s(N=>{if(N.find(W=>W.id===E.id)){let _=eo(N)+1,O=N.map(Y=>Y.id===E.id?{...Y,focused:!0,zIndex:_,windowState:Y.windowState==="minimized"?"normal":Y.windowState}:{...Y,focused:!1});return _>Jn&&(O=Qn(O)),O}let k=E.size??n,w=E.position??Ri(N.length,r,t,k),M=eo(N)+1,F={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:E.appProps},P=N.map(W=>({...W,focused:!1}));return P.push(F),M>Jn&&(P=Qn(P)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),P})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=v(((...B)=>{let E=B[0];S(N=>{if(N[E]){let z={...N};return delete z[E],z}return N}),A(N=>{if(N.has(E)){let z=new Map(N);return z.delete(E),z}return N}),s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=Pi(k,E);if(w){let D=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),D}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=v(((...B)=>{let E=B[0];s(N=>{if(!N.find(M=>M.id===E))return N;let w=eo(N)+1,D=N.map(M=>M.id===E?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>Jn&&(D=Qn(D)),e.onFocusChange&&e.onFocusChange(E),D})}),[e.onFocusChange]),u=v(((...B)=>{let E=B[0];s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=Pi(k,E);w?(k=k.map(D=>({...D,focused:D.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),m=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,position:N}:k))}),[]),p=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,size:N}:k))}),[]),f=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=N.length,k=new Map;if(z===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(z===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(z===3){let w=Math.floor(t.width/2),D=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:D}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+D},size:{width:t.width-w,height:t.height-D}})}else{let w=Math.ceil(Math.sqrt(z)),D=Math.ceil(z/w),M=Math.floor(t.width/w),F=Math.floor(t.height/D);for(let P=0;P<N.length;P++){let W=Math.floor(P/w),_=P%w;k.set(N[P].id,{position:{x:t.left+_*M,y:t.top+W*F},size:{width:M,height:F}})}}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,size:D.size,windowState:"normal"}:w})})}),[t]),y=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=[...N].sort((w,D)=>w.zIndex-D.zIndex),k=new Map;for(let w=0;w<z.length;w++){let D=Ri(w,r,t,z[w].size);k.set(z[w].id,{position:D,zIndex:w+1})}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,zIndex:D.zIndex,windowState:"normal"}:w})})}),[r,t]),x=v(((...B)=>{s(E=>{let N=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),g=X(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[b,S]=U({}),[I,A]=U(new Map),C=v(((...B)=>{let E=B[0],N=B[1];S(z=>({...z,[E]:N}))}),[]),T=v(((...B)=>{let E=B[0];S(N=>{let z={...N};return delete z[E],z})}),[]),L=X(()=>g&&b[g]?b[g]:null,[g,b]),R=v(((...B)=>{let E=B[0],N=B[1];A(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...N}),k})}),[]),$=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:x,focusedWindowId:g,setMenuBar:C,clearMenuBar:T,activeMenuBar:L,signalDock:R,dockSignals:I}),[i,a,l,d,u,h,m,c,p,f,y,x,g,C,T,L,R,I]);return o(Ti.Provider,{value:$},e.children)}function vt(){return Ye(Ti)}var $i=Ue({appId:""});function it(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o($i.Provider,{value:t},e.children)}function wt(){return Ye($i).appId}var Di=Ue({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function $t(e){let t=ne([]),n=ne([]),r=v(((...l)=>{let d=l[0],u=l[1],h=l[2],m=l[3]||"",c={channel:d,from:m,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let x=p[y];x.channel===d&&(c.to&&x.appId!==c.to||!c.to&&x.appId===m||x.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],h=l[2]||"",m={channel:d,handler:u,appId:h};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(h=>h!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(Di.Provider,{value:a},e.children)}function st(){let e=Ye(Di),t=wt(),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 Dt(e,t){let n=st(),r=ne(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var zi=Ue({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=U(null),[r,i]=U({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=v(((...p)=>{let f=p[0];n(f)}),[]),u=v(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=v(((...p)=>{let f=p[0],y=p[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)}}),[]);re(()=>{if(!l)return;let p=x=>{let g=x;i({x:g.clientX,y:g.clientY});let b=document.elementFromPoint(g.clientX,g.clientY);if(!b)return;let S=null,I=s.current;I.forEach((C,T)=>{let L=document.querySelector(`[data-dropzone-id="${T}"]`);L&&L.contains(b)&&(S=T)});let A=a.current;if(S!==A){if(A){let C=I.get(A);C&&C.onDragLeave&&C.onDragLeave()}if(S){let C=I.get(S);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=S}},f=x=>{let g=a.current;if(g&&t){let b=s.current.get(g);b&&b.acceptTypes.indexOf(t.type)!==-1&&b.onDrop(t)}a.current=null,n(null)},y=x=>{x.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,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(zi.Provider,{value:m},e.children,c)}function pt(){return Ye(zi)}function to(e,t){let n=pt(),r=wt(),i=ne(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 At(e){let t=pt(),[n,r]=U(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,re(()=>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 dc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],uc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function no(e){return e<10?"0"+String(e):String(e)}function pc(e,t,n){let r=e.getHours(),i=no(e.getMinutes()),s=no(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=no(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function fc(e){let t=dc[e.getDay()],n=uc[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function mc(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),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 gc(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=U(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>pc(i,t,n),[i,t,n]),l=X(()=>fc(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 hc(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),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 bc(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe();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 xc(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),[a,l]=U(!1),d=ne(null),u=v(()=>{l(x=>!x)},[]),h=v(()=>{l(!1)},[]),m=v(x=>{let g=x;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(b=>!b)),g.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let x=g=>{let b=d.current;b&&!b.contains(g.target)&&l(!1)};return document.addEventListener("click",x,!0),()=>{document.removeEventListener("click",x,!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"},p=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"},p),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((x,g)=>o(bc,{key:String(g),item:x,onClose:h}))):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 yc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),[s,a]=U(!1),l=ne(null),d=v(()=>{a(c=>!c)},[]),u=v(()=>{a(!1)},[]),h=v(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.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,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),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:h,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 en(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:m}=e,c=String(h)+"px",p=[];if(n&&p.push(o(mc,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.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++)p.push(o(yc,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(gc,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let S=l.map(I=>o(hc,{key:I.id,indicator:I}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}d&&g.push(o(xc,{key:"user",user:d,menuItems:u}));let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);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,x,b)}function Sc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Ai=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function vc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Ai[Math.abs(t)%Ai.length]}function wc(e){return e>99?"99+":String(e)}function kc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Cc(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 Mc(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 Ec(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=U(!1),u=t.disabled??!1,h=v(()=>{u||d(!0)},[u]),m=v(()=>{d(!1)},[]),c=v(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=v(A=>{if(!u&&a){let C=A;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=Sc(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:vc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),x=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"},wc(t.badge)):null,g=t.active?o("span",{style:{...Mc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=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",...Cc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,I={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:I,"aria-label":kc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,x,g,b,S)}function tn(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,[h,m]=U(!s),c=ne(null),p=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(I=>{let A=I,C=A.target,T=C.closest('[role="toolbar"]');if(!T)return;let L=Array.from(T.querySelectorAll("button[data-dock-item-id]")),R=L.indexOf(C);if(R<0)return;let $=n==="vertical",B=$?"ArrowDown":"ArrowRight",E=$?"ArrowUp":"ArrowLeft";if(A.key===B){A.preventDefault();let N=L[R+1];N&&N.focus()}else if(A.key===E){A.preventDefault();let N=L[R-1];N&&N.focus()}else A.key==="Home"?(A.preventDefault(),L[0]?.focus()):A.key==="End"?(A.preventDefault(),L[L.length-1]?.focus()):(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),C.click())},[n]),x=n==="vertical",g={display:"flex",flexDirection:x?"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&&!h&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let b=[];for(let I=0;I<t.length;I++){if(a&&I===t.length-1&&t.length>1){let A=x?{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"};b.push(o("div",{key:`sep-${I}`,style:A,"aria-hidden":"true",role:"separator"}))}b.push(o(Ec,{key:t[I].id,item:t[I],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=s&&!h?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:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},S,...b,u??null)}var Ic="#2c001e";function nn(e){let{backgroundColor:t=Ic,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=v(g=>{let b=g;b.target===b.currentTarget&&a&&a()},[a]),m=v(g=>{let b=g;b.target===b.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=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=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let x=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Kt,{items:s},x):x}var Rc={width:200,height:150},Pc={x:50,y:50},Tc={width:400,height:300},We=8,oo=20,$c={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 kt(e){let{id:t,title:n,icon:r,defaultPosition:i=Pc,defaultSize:s=Tc,minSize:a=Rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:x,onMove:g,onResize:b,children:S}=e,[I,A]=U(i.x),[C,T]=U(i.y),[L,R]=U(s.width),[$,B]=U(s.height),[E,N]=U(!1),[z,k]=U(!1),[w,D]=U(null),M=ne(null),F=ne(null),P=ne(null),W=v((oe,ge)=>{let he=Math.max(oe,a.width),ee=Math.max(ge,a.height);return l&&(he=Math.min(he,l.width),ee=Math.min(ee,l.height)),{width:he,height:ee}},[a,l]),_=v(()=>{let oe=P.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=v((oe,ge,he,ee)=>{let de=_(),me=Math.max(0,Math.min(oe,de.width-he)),xe=Math.max(0,Math.min(ge,de.height-ee));return{x:me,y:xe}},[_]),Y=v(oe=>{if(!u||h==="maximized")return;let ge=oe;ge.target.closest("button")||(ge.preventDefault(),M.current={startMouseX:ge.clientX,startMouseY:ge.clientY,startPosX:I,startPosY:C},N(!0))},[u,h,I,C]),K=v(oe=>{oe.target.closest("button")||y&&y()},[y]);re(()=>{if(!E)return;let oe=he=>{let ee=he,de=M.current;if(!de)return;let me=ee.clientX-de.startMouseX,xe=ee.clientY-de.startMouseY,ye=de.startPosX+me,Me=de.startPosY+xe,ce=_();ye=Math.max(0,Math.min(ye,ce.width-L)),Me=Math.max(0,Math.min(Me,ce.height-$)),A(ye),T(Me),ee.clientX<=oo?D("left"):ee.clientX>=ce.width-oo?D("right"):ee.clientY<=oo?D("top"):D(null)},ge=he=>{let ee=he;N(!1);let de=_();if(w==="left"){A(0),T(0),R(Math.floor(de.width/2)),B(de.height),D(null),g&&g({x:0,y:0}),b&&b({width:Math.floor(de.width/2),height:de.height});return}if(w==="right"){let xe=Math.floor(de.width/2);A(xe),T(0),R(xe),B(de.height),D(null),g&&g({x:xe,y:0}),b&&b({width:xe,height:de.height});return}if(w==="top"){D(null),y&&y();return}D(null);let me=M.current;if(me&&g){let xe=ee.clientX-me.startMouseX,ye=ee.clientY-me.startMouseY,Me=me.startPosX+xe,ce=me.startPosY+ye;Me=Math.max(0,Math.min(Me,de.width-L)),ce=Math.max(0,Math.min(ce,de.height-$)),g({x:Me,y:ce})}M.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[E,w,L,$,_,g,b,y]);let Q=v(oe=>ge=>{if(!d||h!=="normal")return;let he=ge;he.preventDefault(),he.stopPropagation(),F.current={direction:oe,startMouseX:he.clientX,startMouseY:he.clientY,startPosX:I,startPosY:C,startWidth:L,startHeight:$},k(!0)},[d,h,I,C,L,$]);re(()=>{if(!z)return;let oe=he=>{let ee=he,de=F.current;if(!de)return;let me=ee.clientX-de.startMouseX,xe=ee.clientY-de.startMouseY,ye=de.direction,Me=de.startWidth,ce=de.startHeight,be=de.startPosX,Ee=de.startPosY;ye.includes("e")&&(Me=de.startWidth+me),ye.includes("w")&&(Me=de.startWidth-me,be=de.startPosX+me),ye.includes("s")&&(ce=de.startHeight+xe),ye.includes("n")&&(ce=de.startHeight-xe,Ee=de.startPosY+xe);let Re=W(Me,ce);ye.includes("w")&&(be=de.startPosX+(de.startWidth-Re.width)),ye.includes("n")&&(Ee=de.startPosY+(de.startHeight-Re.height)),R(Re.width),B(Re.height),A(be),T(Ee)},ge=()=>{k(!1),b&&b({width:L,height:$}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[z,L,$,W,b]),re(()=>{if(!m||!p)return;let oe=ge=>{ge.key==="Escape"&&p()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[m,p]);let q=v(oe=>{x&&x()},[x]);if(h==="minimized")return null;let H=h==="maximized",j=X(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:H?"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:H?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return H?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${C}px`,oe.left=`${I}px`,oe.width=`${L}px`,oe.height=`${$}px`),c!==void 0&&(oe.zIndex=String(c)),E&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[H,I,C,L,$,c,m,E]),G=X(()=>{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&&!H?"grab":"default",opacity:m?"1":"0.6"};return E&&(oe.cursor="grabbing"),oe},[m,u,H,E]),V={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"},te=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?te.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):te.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),te.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(),f&&f()}}),o("button",{type:"button","aria-label":H?"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(),p&&p()}}));te.push(ae);let J=[];if(d&&!H){let oe=["n","s","e","w","ne","nw","se","sw"];for(let ge=0;ge<oe.length;ge++){let he=oe[ge],ee={position:"absolute",zIndex:"1"};he==="n"?(ee.top="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="s"?(ee.bottom="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="e"?(ee.top=`${We}px`,ee.right="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="w"?(ee.top=`${We}px`,ee.left="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="ne"?(ee.top="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="nw"?(ee.top="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="se"?(ee.bottom="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="sw"&&(ee.bottom="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`),ee.cursor=$c[he],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${he}`,style:ee,onMouseDown:Q(he)}))}}let ie=null;if(w){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"};w==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):w==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):w==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),ie=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<J.length;oe++)le.push(J[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:G,onMouseDown:Y,onDblClick:K,role:"toolbar","aria-label":`${n} window controls`},...te)),le.push(o("div",{className:"draggable-window__body",style:V},S));let fe=[o("div",{ref:P,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:q},...le)];return ie&&fe.push(ie),fe.length===1?fe[0]:o("div",{style:{display:"contents"}},...fe)}var Dc=["File","Edit","View","Insert","Format","Tools","Help"],Li={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"}]},zc=[{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"}}],Ac=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Lc=["1","2","3","4","5","6","7"],Bc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Fc(){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 Bi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function on(e){let[t,n]=U(!1),[r,i]=U(!1),[s,a]=U(!1),[l,d]=U(-1),[u,h]=U(""),[m,c]=U(-1),[p,f]=U(0),[y,x]=U("3"),g=ne(null),b=v(()=>{document.execCommand("bold",!1),n(V=>!V),g.current&&g.current.focus()},[]),S=v(()=>{document.execCommand("italic",!1),i(V=>!V),g.current&&g.current.focus()},[]),I=v(()=>{document.execCommand("underline",!1),a(V=>!V),g.current&&g.current.focus()},[]),A={bold:b,italic:S,underline:I},C={bold:t,italic:r,underline:s},T=v(V=>{document.execCommand(V,!1),g.current&&g.current.focus()},[]),L=v(V=>{document.execCommand("fontSize",!1,V),x(V),g.current&&g.current.focus()},[]),R=v(V=>{c(Z=>Z===V?-1:V)},[]),$=v(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"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":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),B=v(()=>{if(g.current){let V=g.current.textContent??"";f(Bi(V))}},[]),E=v(()=>{c(-1)},[]),N=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"}),[]),z={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"},D={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"},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"},P=X(()=>Fc(),[]),W=e.content??"Start typing...",_=Bi(W),O=p>0?p:_;function Y(V){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===V?"rgba(0,0,0,0.12)":l===V?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let K={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"},Q={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function q(V,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[V]??!1?"rgba(0,0,0,0.12)":u===V?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let H={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"},G=Dc.map((V,Z)=>{let te=[V];return m===Z&&Li[V]&&te.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...Li[V].map((ae,J)=>o("button",{key:String(J),style:Q,onClick:ie=>{ie.stopPropagation(),$(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:Y(Z),role:"menuitem","aria-label":V,onClick:()=>R(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...te)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...G),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:H,"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"}},...zc.map(V=>o("button",{key:V.id,style:q(V.id,V.style),title:V.shortcut?`${V.label} (${V.shortcut})`:V.label,"aria-label":V.label,"aria-pressed":String(C[V.id]??!1),onClick:A[V.id],onMouseEnter:()=>h(V.id),onMouseLeave:()=>h("")},V.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:V=>{let Z=V.target;L(Z.value)}},...Lc.map(V=>o("option",{key:V,value:V},Bc[V])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ac.map((V,Z)=>o("button",{key:String(Z),style:q(`align-${Z}`),title:V.label,"aria-label":V.label,onClick:()=>T(V.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},V.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...P),o("main",{className:"word-processor__document-area",style:D,onClick:E},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:g,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%")))}function rn(e){let t=X(()=>({height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}),[]),n=e.style?{...t,...e.style}:t;return o("div",{className:"ide__title-bar",style:n},e.title)}var Nc={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},Fi={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},Wc={...Fi,backgroundColor:"rgba(255,255,255,0.1)"},_c={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"},Oc={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function sn(e){let[t,n]=U(-1),r=v(a=>{n(l=>l===a?-1:a)},[]),i=v(a=>{e.onAction(a),n(-1)},[e.onAction]),s=e.menus.map((a,l)=>{let d=[a],u=t===l;return u&&e.menuItems[a]&&d.push(o("div",{key:"dropdown",style:_c,className:"ide__menu-dropdown"},...e.menuItems[a].map((h,m)=>o("button",{key:String(m),style:Oc,onClick:c=>{c.stopPropagation(),i(h.action)},role:"menuitem"},h.label)))),o("button",{key:String(l),style:u?Wc:Fi,role:"menuitem","aria-label":a,onClick:()=>r(l)},...d)});return o("div",{className:"ide__menu-bar",style:Nc,role:"menubar"},...s)}var Hc={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},Yc={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"};function Vc(e,t,n){return{padding:"3px 8px",paddingLeft:`${12+e*16}px`,fontSize:"13px",cursor:"pointer",color:t?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:n?"rgba(255,255,255,0.08)":"transparent"}}function an(e){let t=i=>{if(!i.parent)return!0;if(!e.expandedFolders[i.parent])return!1;let s=e.files.find(a=>a.name===i.parent&&a.isFolder);return s?t(s):!0},r=e.files.map((i,s)=>{if(!t(i))return null;let a=!i.isFolder&&i.name===e.activeFile,l=i.isFolder?e.expandedFolders[i.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(s),style:Vc(i.indent,i.isFolder,a),onClick:i.isFolder?()=>e.onFolderToggle(i.name):()=>e.onFileClick(i.name)},l,i.name)}).filter(i=>i!==null);return o("nav",{className:"ide__sidebar",style:Hc,"aria-label":"File explorer"},o("div",{style:Yc},"Explorer"),...r)}var Uc={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},jc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},Gc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#2d2d2d",color:"#999999",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid transparent",boxSizing:"border-box"};function ln(e){let t=e.tabs.map((n,r)=>{let i=n===e.activeTab;return o("button",{key:String(r),style:i?jc:Gc,"aria-label":n,onClick:()=>e.onTabClick(n)},n)});return o("div",{style:Uc},...t)}var cn="#569cd6",ro="#ce9178",io="#4ec9b0",so="#6a9955",ao="#dcdcaa",Lt="#d4d4d4",lo="#d4d4d4",co="#b5cea8",Xc=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"]),Kc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]);function dn(e){if(!e.trim())return[{text:"\xA0",color:Lt}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:so});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:ro}),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:co}),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=Lt;Xc.has(i)?l=cn:Kc.has(i)?l=io:a?l=ao:(i==="true"||i==="false")&&(l=cn),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:Lt}),n=r;continue}t.push({text:e[n],color:lo}),n++}return t}var qc={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},Zc={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},Jc={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"};function un(e){let t=e.content.map((r,i)=>{let s=dn(r),a=[],l=0;for(let d of s)a.push(o("span",{key:String(l++),style:{color:d.color}},d.text));return o("div",{key:String(i),style:{minHeight:"20px"}},...a)}),n=[];for(let r=0;r<e.content.length;r++)n.push(o("div",{key:String(r)},String(r+1)));return o("div",{style:qc},o("div",{style:Zc,"aria-hidden":"true"},...n),o("code",{style:Jc,contentEditable:"true",ref:e.editorRef,onInput:e.onInput,suppressContentEditableWarning:!0},...t))}var Qc={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"};function pn(e){return o("div",{className:"ide__minimap",style:Qc,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${e.visibleStart}px`,left:"0",right:"0",height:`${e.visibleEnd}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...e.lines.map((t,n)=>o("div",{key:String(n),style:{height:"2px",backgroundColor:t.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,t.length*2)}%`}})))}var ed={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},td={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"};function fn(e){let t=n=>n.map((r,i)=>o("span",{key:String(i),style:td,onClick:r.onClick},r.label));return o("div",{className:"ide__status-bar",style:ed},o("div",{style:{display:"flex",gap:"16px"}},...t(e.items)),o("div",{style:{display:"flex",gap:"16px"}},...t(e.rightItems)))}var nd=["File","Edit","Selection","View","Go","Run","Terminal","Help"],od={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"}]},rd=[{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}],uo={"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"]',"}"]},Ni=uo["App.ts"];function mn(e){let[t,n]=U("App.ts"),[r,i]=U({src:!0,components:!0,hooks:!0}),[s,a]=U(Ni.length),l=ne(null),d=v(S=>{n(S);let I=uo[S];I&&a(I.length)},[]),u=v(S=>{i(I=>{let A={},C=Object.keys(I);for(let T=0;T<C.length;T++)A[C[T]]=I[C[T]];return A[S]=!I[S],A})},[]),h=v(S=>{switch(S){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":l.current&&(l.current.textContent="",a(1));break;default:break}l.current&&l.current.focus()},[]),m=v(()=>{if(l.current){let I=(l.current.textContent??"").split(`
|
|
8
|
-
`);a(Math.max(I.length,1))}},[]),c=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"}),[]),p={flex:"1",display:"flex",overflow:"hidden"},f={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},y={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},x=8,g=30,b=uo[t]??Ni;return o("div",{className:`ide ${e.className??""}`.trim(),style:c},o(rn,{title:"SpecifyJS IDE"}),o(sn,{menus:nd,menuItems:od,onAction:h}),o("div",{style:p},o(an,{files:rd,activeFile:t,expandedFolders:r,onFileClick:d,onFolderToggle:u}),o("div",{style:f}),o("div",{style:y},o(ln,{tabs:[t],activeTab:t,onTabClick:d}),o(un,{content:b,onInput:m,editorRef:l})),o(pn,{lines:b,visibleStart:x,visibleEnd:g,totalLines:b.length})),o(fn,{items:[{label:"\u2387 main"},{label:"0 errors"},{label:"0 warnings"}],rightItems:[{label:"Ln 1, Col 1"},{label:"UTF-8"},{label:"TypeScript"}]}))}var id=[{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]}],Wi=[{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}],_i=[{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}],Oi=[{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}],sd=[{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}],ad=[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],Hi=[{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}],Yi=[{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}],Vi=["09:30","10:00","10:30","11:00","11:30","12:00"];function ld(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Bt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ge(e){return e.toFixed(2)}var Ct={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},Mt={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},gn={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Oe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},He={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},hn={cursor:"default",transition:"background-color 0.1s"};function cd(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let m=h/(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 dd(e,t){let u=Math.min(...e),h=Math.max(...e),m=h-u||1,c=310/(e.length-1),p=e.map((C,T)=>{let L=40+T*c,R=15+(1-(C-u)/m)*120;return{x:L,y:R}}),f=p.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,x=[];for(let C=1;C<e.length;C++){let T=e[C]>=e[C-1]?"#00c853":"#ff1744";x.push(o("line",{key:String(C),x1:String(p[C-1].x.toFixed(1)),y1:String(p[C-1].y.toFixed(1)),x2:String(p[C].x.toFixed(1)),y2:String(p[C].y.toFixed(1)),stroke:T,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let C=0;C<5;C++){let T=15+C/4*120,L=h-C/4*m;g.push(o("line",{key:`g${C}`,x1:String(40),y1:String(T.toFixed(1)),x2:String(350),y2:String(T.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${C}`,x:String(36),y:String((T+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(L)))}let b=[],S=Math.min(Vi.length,e.length),I=(e.length-1)/(S-1);for(let C=0;C<S;C++){let L=40+Math.round(C*I)*c;b.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Vi[C]))}let A="chartGrad";return o("div",{style:Ct},o("div",{style:Mt},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ge(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:A,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(#${A})`}),...g,...b,...x,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 ud(){let e=Math.max(...Wi.map(t=>t.qty),..._i.map(t=>t.qty));return o("div",{style:Ct},o("div",{style:Mt},"Order Book"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Bid Price"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Ask Price"),o("th",{style:Oe},"Qty"))),o("tbody",null,...Wi.map((t,n)=>{let r=_i[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ge(t.price)),o("td",{style:{...He,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Bt(t.qty)),o("td",{style:{...He,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ge(r.price):""),o("td",{style:{...He,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Bt(r.qty):""))}))))}function pd(e){return o("div",{style:Ct},o("div",{style:Mt},"Watchlist"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Price"),o("th",{style:Oe},"Chg%"),o("th",{style:Oe},"Volume"))),o("tbody",null,...id.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,cd(t.spark,i)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(r)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ge(t.change)}%`),o("td",{style:{...He,fontFamily:"monospace",color:"#8888aa"}},ld(t.volume)))}))))}function fd(){let e=Oi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ct},o("div",{style:Mt},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ge(e)}`)),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Avg"),o("th",{style:Oe},"P&L"))),o("tbody",null,...Oi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...hn,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...He,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(n.avgPrice)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ge(n.pnl)}`))}))))}function md(){return o("div",{style:Ct},o("div",{style:Mt},"Recent Trades"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Time"),o("th",{style:Oe},"Sym"),o("th",{style:Oe},"Side"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Price"))),o("tbody",null,...sd.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:hn},o("td",{style:{...He,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...He,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...He,fontFamily:"monospace"}},Bt(e.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(e.price)))}))))}function gd(){let e=Math.max(...Hi.map(n=>n.volume),...Yi.map(n=>n.volume)),t="16px";return o("div",{style:Ct},o("div",{style:Mt},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Hi.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"}},Ge(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"}},Bt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Yi.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"}},Ge(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"}},Bt(n.volume))))))}function bn(e){let[t,n]=U(0),[r,i]=U("--:--:--"),[s,a]=U(!0);re(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),re(()=>{let p=()=>{let y=new Date,x=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${x}:${g}:${b}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),re(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);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"},h={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:h},dd(ad,m),ud(),pd(t),fd(),md(),gd()))}function Le(e){return e.type==="card"}function $e(e){return e.type==="container"}function qe(){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 Xe(e){return Le(e)?e.card_id:e.container_id}function po(e){return Le(e)?e.card_title:e.name}var fo={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Ft=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function hd(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 bd(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 xd(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 yd(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 xn(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:m,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=U(!1),[x,g]=U(!1),[b,S]=U(null),[I,A]=U(!1),[C,T]=U(!1),[L,R]=U(!1),[$,B]=U(t.card_title||""),[E,N]=U(""),z=ne(null),k=ne(null),w=t.priority?fo[t.priority]||"#94a3b8":"transparent",D=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),S({x:be.clientX,y:be.clientY}),A(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),M=v(()=>{S(null),A(!1)},[]),F=v(ce=>{let be=ce,Ee=be.target;if(Ee.dataset&&(Ee.dataset.role==="delete"||Ee.dataset.role==="resize"||Ee.dataset.role==="drag-handle"||Ee.dataset.role==="inline-edit"||Ee.dataset.role==="anchor"))return;be.preventDefault(),be.stopPropagation(),r&&r(t.card_id),z.current={x:be.clientX,y:be.clientY,cardX:t.position.x,cardY:t.position.y},m&&m(t.card_id),g(!0);let Re=se=>{let pe=se;if(!z.current)return;let Se=pe.clientX-z.current.x,we=pe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Ne=()=>{z.current=null,g(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ne)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ne)},[t.card_id,t.position.x,t.position.y,r,i,m,c]),P=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let Ee=Ne=>{let se=Ne;if(!k.current)return;let pe=se.clientX-k.current.x,Se=se.clientY-k.current.y,we=Math.max(120,k.current.w+pe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),W=v(ce=>{ce.preventDefault(),ce.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),_=v(ce=>{let be=ce;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!p)return;let Ne=t.position.x,se=t.position.y,pe=t.size.width,Se=t.size.height,we=Ne+pe/2,Ie=se+Se/2;Re==="top"?(we=Ne+pe/2,Ie=se):Re==="right"?(we=Ne+pe,Ie=se+Se/2):Re==="bottom"?(we=Ne+pe/2,Ie=se+Se):Re==="left"&&(we=Ne,Ie=se+Se/2),p(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),O=v(ce=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:ce}),M()},[t.card_id,l,M]),Y=v(ce=>{ce.preventDefault(),ce.stopPropagation(),B(t.card_title||""),T(!0)},[t.card_title]),K=v(()=>{T(!1),h&&$!==t.card_title&&h(t.card_id,{card_title:$})},[h,t.card_id,t.card_title,$]),Q=v(ce=>{let be=ce;be.key==="Enter"?(be.preventDefault(),K()):be.key==="Escape"&&(be.preventDefault(),T(!1),B(t.card_title||""))},[K,t.card_title]),q=v(ce=>{let be=ce.target;B(be.value)},[]),H=v(ce=>{ce.stopPropagation();let be=t.content;N(be.text||""),R(!0)},[t.content]),j=v(()=>{R(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),G=v(ce=>{let be=ce;if(be.key==="Escape"){be.preventDefault(),R(!1);let Ee=t.content;N(Ee.text||"")}},[t.content]),V=v(ce=>{let be=ce.target;N(be.value)},[]),Z;switch(t.card_type){case"text":L?Z=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:V,onBlur:j,onKeyDown:G,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):Z=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:H},t.content.text||"");break;case"json":Z=bd(t);break;case"task":Z=xd(t);break;case"project":Z=yd(t,d);break;default:Z=hd(t)}let te=t.card_type==="project",ae={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:te?"999px":"6px",borderLeft:`4px solid ${w}`,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:x?"9999":"1"},J={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ie={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:f?"block":"none",border:"none",padding:"0"},le={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},fe={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:f?"block":"none",border:"none",padding:"0"},oe=8,ge={position:"absolute",width:`${oe}px`,height:`${oe}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},ee=[{anchor:"top",style:{...ge,top:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"right",style:{...ge,top:"50%",right:`${-oe/2}px`,marginTop:`${-oe/2}px`}},{anchor:"bottom",style:{...ge,bottom:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"left",style:{...ge,top:"50%",left:`${-oe/2}px`,marginTop:`${-oe/2}px`}}].map((ce,be)=>o("div",{key:`anchor-${ce.anchor}`,style:ce.style,"data-role":"anchor","data-anchor":ce.anchor,"data-testid":`card-anchor-${ce.anchor}-${t.card_id}`,onMouseDown:_})),de=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,me=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((ce,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},ce))):null,xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={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"},Me=b?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${b.x}px`,top:`${b.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:ce=>ce.stopPropagation()},o("div",{style:xe,onClick:ce=>{ce.stopPropagation(),a&&a(t.card_id),M()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>A(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),I?o("div",{style:ye,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Ft.map(ce=>o("div",{key:ce.value,style:{...xe,fontWeight:t.card_type===ce.value?"700":"400"},onClick:be=>{be.stopPropagation(),O(ce.value)},role:"menuitem","data-testid":`ctx-type-${ce.value}-${t.card_id}`},ce.label,t.card_type===ce.value?" \u2713":""))):null)):null;return te?o("div",{className:"board-card board-card--project",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},Z,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...ee,Me):o("div",{className:"board-card",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},C?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:$,onInput:q,onBlur:K,onKeyDown:Q,onFocus:ce=>{let be=ce.target;be.setSelectionRange(be.value.length,be.value.length)},style:{...J,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:J,"data-testid":`card-title-${t.card_id}`,onDblClick:Y},t.card_title||"Untitled"),Z,me,de,o("div",{style:fe,"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:ie,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:W,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:le,"data-role":"resize",onMouseDown:P,"aria-label":"Resize card"}),...ee,Me)}function yn(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,onDragStart:u,onDragEnd:h,onContainerContextMenu:m,children:c}=e,[p,f]=U(!1),[y,x]=U(!1),[g,b]=U(!1),S=ne(null),I=ne(null),A=v(M=>{M.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),C=v(M=>{M.stopPropagation(),x(F=>!F)},[]),T=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),m&&m(t.container_id,{x:F.clientX,y:F.clientY})},[t.container_id,m]),L=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),b(!0),S.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let P=_=>{let O=_;if(!S.current)return;let Y=O.clientX-S.current.x,K=O.clientY-S.current.y;s&&s(t.container_id,{x:S.current.posX+Y,y:S.current.posY+K})},W=()=>{S.current=null,b(!1),h&&h(t.container_id),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),R=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),I.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let P=_=>{let O=_;if(!I.current)return;let Y=O.clientX-I.current.x,K=O.clientY-I.current.y,Q=Math.max(160,I.current.w+Y),q=Math.max(120,I.current.h+K);a&&a(t.container_id,{width:Q,height:q})},W=()=>{I.current=null,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.size.width,t.size.height,a]),$=v(M=>{M.preventDefault(),f(!0)},[]),B=v(()=>{f(!1)},[]),E=v(M=>{let F=M;if(F.preventDefault(),f(!1),d&&F.dataTransfer){let P=F.dataTransfer.getData("text/plain");P&&d(P,t.container_id)}},[t.container_id,d]),N=r||p,z={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:N?"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:g?"9999":"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},k={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},w={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:z,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:$,onDragLeave:B,onDrop:E,onContextMenu:T},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:L,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:C,"aria-label":y?"Expand container":"Minimize container",title:y?"Expand":"Minimize"},y?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:A,"aria-label":"Delete container",title:"Delete"},"\xD7"))),y?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),y?null:o("div",{style:D,"data-role":"resize",onMouseDown:R,"aria-label":"Resize container"}))}function Ui(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function Sd(e,t){let n=Ui(e),r=Ui(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let m=s[h].x-i[u].x,c=s[h].y-i[u].y,p=m*m+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var ji="board-card-link-arrowhead";function Sn(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=v(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],x=d.get(y.target_card_id);if(!x)continue;let{from:g,to:b}=Sd(f,x),S=y.link_id===r,I=S?"#3b82f6":y.color||"#94a3b8",A=b.x-g.x,C=b.y-g.y,T=Math.sqrt(A*A+C*C),L=Math.min(40,T*.15),R=T>0?-C/T:0,$=T>0?A/T:0,B=(g.x+b.x)/2,E=(g.y+b.y)/2,N=B+R*L,z=E+$*L,k=`M ${g.x} ${g.y} Q ${N} ${z} ${b.x} ${b.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:D=>{let M=D;M.preventDefault(),M.stopPropagation(),s&&s(y.link_id,w,{x:M.clientX,y:M.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:I,"stroke-width":S?"3":"2","pointer-events":"none","marker-end":`url(#${ji})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(N),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let m={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:ji,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:m,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var vd=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],mo=20,Et=5e3;function wd(e,t){let n=new Set,r=[...e],i=null;for(;r.length>0;){let a=r.pop();if($e(a)&&a.container_id===t){i=a;break}if($e(a))for(let l=0;l<a.contents.length;l++)r.push(a.contents[l])}if(!i||!$e(i))return n;let s=[...i.contents];for(;s.length>0;){let a=s.pop();if($e(a)){n.add(a.container_id);for(let l=0;l<a.contents.length;l++)s.push(a.contents[l])}}return n}function kd(e,t,n,r){let i=new Set;if(r){i.add(r);let d=wd(e,r);for(let u of d)i.add(u)}let s=null,a=-1,l=[[e,0,0,0]];for(;l.length>0;){let[d,u,h,m]=l.pop();for(let c=0;c<d.length;c++){let p=d[c];if(!$e(p)||i.has(p.container_id))continue;let f=p.position.x+u,y=p.position.y+h;t>=f&&t<=f+p.size.width&&n>=y&&n<=y+p.size.height&&(m>a&&(s=p.container_id,a=m),p.contents.length>0&&l.push([p.contents,f,y+30,m+1]))}}return s}function Xi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Gi(e,t){let n=[[e,null]];for(;n.length>0;){let[r,i]=n.pop();for(let s=0;s<r.length;s++){let a=r[s];if(Xe(a)===t)return i;$e(a)&&n.push([a.contents,a.container_id])}}return null}function Ki(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Cd(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Le(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if($e(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Nt(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:m,viewport:c}=t,p=ne(null),f=ne(!1),y=ne(null),[x,g]=U(null),[b,S]=U(null),[I,A]=U(null),[C,T]=U(null),[L,R]=U(!1),[$,B]=U(!1),[E,N]=U(null),[z,k]=U(null),w=v(se=>{let pe=se,Se=pe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=pe.button===1,Ie=pe.button===0&&pe.shiftKey;we||Ie?(pe.preventDefault(),f.current=!0,y.current={x:pe.clientX,y:pe.clientY,panX:c.panX,panY:c.panY}):pe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let se=Se=>{if(!f.current||!y.current)return;let we=Se,Ie=we.clientX-y.current.x,Be=we.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+Ie,panY:y.current.panY+Be})},pe=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[n]);let D=v(se=>{let pe=se;if(!pe.ctrlKey)return;pe.preventDefault();let Se=pe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),M=ne(null);re(()=>{let se=p.current;if(!se)return;let pe=Ae=>{let De=[];for(let ue=0;ue<Ae.touches.length;ue++)De.push({x:Ae.touches[ue].clientX,y:Ae.touches[ue].clientY});return De},Se=(Ae,De)=>Math.sqrt((Ae.x-De.x)**2+(Ae.y-De.y)**2),we=Ae=>{let De=Ae;if(De.touches.length===2){De.preventDefault();let ue=pe(De);M.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=Ae=>{let De=Ae;if(De.touches.length!==2||!M.current)return;De.preventDefault();let ue=pe(De),ve=M.current,ke=(ve.touches[0].x+ve.touches[1].x)/2,Pe=(ve.touches[0].y+ve.touches[1].y)/2,Ke=(ue[0].x+ue[1].x)/2,Qe=(ue[0].y+ue[1].y)/2;n({type:"PAN",panX:ve.panX+(Ke-ke),panY:ve.panY+(Qe-Pe)});let ct=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(ct/ve.dist)})},Be=()=>{M.current=null};return se.addEventListener("touchstart",we,{passive:!1}),se.addEventListener("touchmove",Ie,{passive:!1}),se.addEventListener("touchend",Be),()=>{se.removeEventListener("touchstart",we),se.removeEventListener("touchmove",Ie),se.removeEventListener("touchend",Be)}},[c.panX,c.panY,c.zoom,n]);let F=v((se,pe)=>{T({cardId:se,x:pe.x,y:pe.y}),R(!1),B(!1),u&&u(se,pe)},[u]),P=v(()=>{T(null),R(!1),B(!1)},[]);re(()=>{if(!C)return;let se=()=>{P()};return document.addEventListener("click",se),()=>{document.removeEventListener("click",se)}},[C,P]);let W=v((se,pe,Se)=>{k({linkId:se,cardId:pe,x:Se.x,y:Se.y}),P()},[P]),_=v(()=>{k(null)},[]);re(()=>{if(!z)return;let se=()=>_();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[z,_]);let O=v((se,pe)=>{N({containerId:se,x:pe.x,y:pe.y}),P(),_()},[P,_]),Y=v(()=>{N(null)},[]);re(()=>{if(!E)return;let se=()=>Y();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[E,Y]);let K=v(se=>{i&&i(se)},[i]),Q=v((se,pe)=>{let Se=pe;if(s&&(Se=Xi(pe,mo)),n({type:"MOVE_ITEM",itemId:se,position:Se}),V.current===se){let Ie=0,Be=0,Ae=[...m];for(;Ae.length>0;){let ke=Ae.pop();if(Xe(ke)===se){Ie=ke.size.width,Be=ke.size.height;break}if($e(ke))for(let Pe=0;Pe<ke.contents.length;Pe++)Ae.push(ke.contents[Pe])}let De=Se.x+Ie/2,ue=Se.y+Be/2,ve=kd(m,De,ue,se);g(ve)}},[n,s,m]),q=v((se,pe)=>{n({type:"RESIZE_ITEM",itemId:se,size:pe})},[n]),H=v(se=>{n({type:"REMOVE_ITEM",itemId:se}),i&&r===se&&i(null)},[n,r,i]),j=v((se,pe)=>{n({type:"NEST_ITEM",itemId:se,containerId:pe})},[n]),G=v(se=>{S(se),V.current=se,g(null)},[]),V=ne(null);V.current=b;let Z=ne(null);Z.current=x;let te=v(se=>{let pe=Z.current;pe&&n({type:"NEST_ITEM",itemId:se,containerId:pe}),S(null),V.current=null,g(null)},[n]),ae=v((se,pe,Se)=>{A({fromCardId:se,fromAnchor:pe,fromPos:Se,currentPos:Se})},[]),J=ne(null);J.current=I,re(()=>{if(!I)return;let se=Se=>{let we=Se,Ie=0,Be=0;if(p.current){let De=p.current.getBoundingClientRect();Ie=De.left,Be=De.top}let Ae=Ki(we.clientX-Ie,we.clientY-Be,c);A(De=>De?{...De,currentPos:Ae}:null)},pe=Se=>{let we=Se,Ie=J.current;if(!Ie){A(null);return}let Be=document.elementFromPoint(we.clientX,we.clientY);if(Be&&Be.dataset&&Be.dataset.role==="anchor"&&Be.dataset.anchor){let Ae=Be.closest("[data-card-id]");if(Ae&&Ae.dataset.cardId&&Ae.dataset.cardId!==Ie.fromCardId){let De=Ae.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:De,color:"#94a3b8",attributes:{}}})}}A(null)};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[I!==null,c.panX,c.panY,c.zoom,n]);let ie=a.toLowerCase(),le=new Set,fe=[],oe=[...m];for(;oe.length>0;){let se=oe.pop();if(fe.push(se),$e(se))for(let pe=0;pe<se.contents.length;pe++)oe.push(se.contents[pe])}if(ie)for(let se=0;se<fe.length;se++){let pe=fe[se];(Le(pe)?pe.card_title:pe.name).toLowerCase().includes(ie)||le.add(Xe(pe))}if(l)for(let se=0;se<fe.length;se++){let pe=fe[se];Le(pe)&&pe.color!==l&&le.add(pe.card_id)}let{cards:ge,links:he}=Cd(m);function ee(se){let pe=Xe(se),Se=le.has(pe),we;if(Le(se))we=o(xn,{key:pe,card:se,selected:pe===r,onSelect:K,onMove:Q,onResize:q,onDelete:H,dispatch:n,onOpenProject:d,onCardContextMenu:F,onUpdate:h,onDragStart:G,onDragEnd:te,onAnchorDragStart:ae});else{let Ie=se.contents.map(Be=>ee(Be));we=o(yn,{key:pe,container:se,selected:pe===r,highlighted:x===se.container_id,onSelect:K,onMove:Q,onResize:q,onDelete:H,onDrop:j,onDragStart:G,onDragEnd:te,onContainerContextMenu:O},...Ie)}return Se?o("div",{key:`dim-${pe}`,style:{opacity:"0.3"}},we):we}let de=m.map(se=>ee(se)),me={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${mo}px ${mo}px`},xe={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Et}px`,height:`${Et}px`},ye={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Me={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"},ce={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},be=C?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${C.x}px`,top:`${C.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":`board-context-menu-${C.cardId}`,role:"menu","aria-label":"Card context menu",onClick:se=>se.stopPropagation()},o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{R(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${C.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:Me,role:"menu","data-testid":`board-ctx-color-submenu-${C.cardId}`},...vd.map(se=>o("div",{key:se.value,style:{...ye,gap:"8px"},onClick:pe=>{pe.stopPropagation(),n({type:"UPDATE_CARD",cardId:C.cardId,updates:{color:se.value}}),P()},role:"menuitem","data-testid":`board-ctx-color-${se.label.toLowerCase()}-${C.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:se.value,border:"1px solid #d1d5db",flexShrink:"0"}}),se.label))):null),o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{B(!0),R(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${C.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),$?o("div",{style:Me,role:"menu","data-testid":`board-ctx-type-submenu-${C.cardId}`},...Ft.map(se=>o("div",{key:se.value,style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:C.cardId,newType:se.value}),P()},role:"menuitem","data-testid":`board-ctx-type-${se.value}-${C.cardId}`},se.label))):null),(()=>{let se=Gi(m,C.cardId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:C.cardId,containerId:se}),P()},role:"menuitem","data-testid":`board-ctx-detach-${C.cardId}`},"Detach Card"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:C.cardId}),i&&r===C.cardId&&i(null),P()},role:"menuitem","data-testid":`board-ctx-delete-${C.cardId}`},"Delete")):null,Ee=E?o("div",{className:"board-container-context-menu",role:"menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10001",minWidth:"160px"},"data-testid":`board-container-ctx-menu-${E.containerId}`},(()=>{let se=Gi(m,E.containerId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:se}),Y()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:ce,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:E.containerId}),i&&r===E.containerId&&i(null),Y()},role:"menuitem","data-testid":`board-ctx-delete-container-${E.containerId}`},"Delete")):null,Re=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],Ne=z?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${z.x}px`,top:`${z.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:se=>se.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(se=>o("button",{key:se,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:z.cardId,updates:{card_link:(()=>{let pe=null,Se=[...m];for(;Se.length>0;){let we=Se.pop();if(Le(we)&&we.card_id===z.cardId){pe=we;break}if($e(we))for(let Ie of we.contents)Se.push(Ie)}return pe?pe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:se}:we):[]})()}}),_()},role:"menuitem"},se)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:z.cardId,linkId:z.linkId}),_()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:me,onMouseDown:w,onWheel:D,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:xe,"data-testid":"board-canvas-inner"},o(Sn,{links:he,cards:ge,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:W,canvasWidth:Et,canvasHeight:Et}),I?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(Et),height:String(Et),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(I.fromPos.x),y1:String(I.fromPos.y),x2:String(I.currentPos.x),y2:String(I.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...de),be,Ee,Ne)}function Md(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function qi(e,t,n,r){let i=r??40,s=Md(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 g=0;g<s.length;g++){let b=s[g];b.position.x<a&&(a=b.position.x),b.position.y<l&&(l=b.position.y);let S=b.position.x+b.size.width,I=b.position.y+b.size.height;S>d&&(d=S),I>u&&(u=I)}let h=d-a+i*2,m=u-l+i*2,c=t/h,p=n/m,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,x=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:x,zoom:f}}var go=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:m,onSearch:c}=e,[p,f]=U(""),y=v(T=>{let L=T.target.value;f(L),c(L)},[c]),x={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"},g={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},b={...g,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},S={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},I={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},A={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=go.map(T=>{let L=T===r,R=T===i,$=()=>{L&&h?h(R?null:T):u(T)},B="1px solid rgba(0,0,0,0.15)";return R?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:T,title:T,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:T,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:R?"1":i?"0.5":"1"},onClick:$,"aria-label":R?`Clear color filter ${T}`:`Select color ${T}`,"data-testid":`color-swatch-${T}`})});return o("div",{className:"board-toolbar",style:x,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:g,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:I}),o("button",{style:g,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:g,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:I}),...C,o("div",{style:I}),o("button",{style:n?b:g,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:I}),o("input",{type:"text",placeholder:"Search cards...",value:p,onInput:y,style:A,"data-testid":"search-input","aria-label":"Search cards"}))}var Ji=50,tt={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Qi(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(Xe(d)===t){n=d;continue}if($e(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function ft(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Xe(s)===t?r.push(n(s)):$e(s)?r.push({...s,contents:ft(s.contents,t,n)}):r.push(s)}return r}function vn(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];$e(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):$e(s)?r.push({...s,contents:vn(s.contents,t,n)}):r.push(s)}return r}function es(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if($e(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Ed(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if($e(u)&&u.container_id===t){let h=[];for(let m=0;m<u.contents.length;m++){let c=u.contents[m];Xe(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else $e(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Id(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function wn(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:vn(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Qi(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,position:t.position,...Le(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,size:t.size,...Le(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_type:t.newType,content:Id(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:vn(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=es(e.collection,t.containerId);if(!n)return e;let[r,i]=Qi(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:vn(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=es(e.collection,t.containerId),[r,i]=Ed(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(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 Rd(e){return e.type==="PAN"||e.type==="ZOOM"}function kn(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=wn(e.present,t.action);if(n===e.present)return e;if(Rd(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>Ji&&r.splice(0,r.length-Ji),{past:r,present:n,future:[]}}default:return e}}function Wt(e){let t={past:[],present:e||tt,future:[]},[n,r]=An(kn,t),i=v(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=v(()=>{r({type:"UNDO"})},[r]),a=v(()=>{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 ts(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Wt(),d=ne(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{r({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,r]);let u=ne(null),h=ne(n);return h.current=n,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.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 Cn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...tt}}catch{return{...tt}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Pd(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function ns(e){let{collection:t,onCardDropped:n,children:r}=e,i=st(),s=ne([]);re(()=>{let u=Pd(t),h=s.current,m=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)m.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(m.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[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 h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=At({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 Td=new Cn;function os(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var at=Date.now(),$d={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:at,updatedAt:at},{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:at,updatedAt:at},{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:at,updatedAt:at},{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:at,updatedAt:at}],viewport:{panX:0,panY:0,zoom:1}};function Dd(e){return e.collection.length===0}function rs(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=ts(Td,t),[d,u]=U(go[0]),[h,m]=U(!1),[c,p]=U(""),[f,y]=U(null),[x,g]=U(null),[b,S]=U(n.name||"Untitled"),[I,A]=U(!1),[C,T]=U(""),[L,R]=U(null),[$,B]=U(!0),[E,N]=U([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[z,k]=U(null),[w,D]=U(""),[M,F]=U("1"),[P,W]=U([]),_=ne(!1);re(()=>{!_.current&&Dd(n)?(_.current=!0,r({type:"SET_BOARD",state:$d})):n.collection.length>0&&(_.current=!0)},[n,r]);let O=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200,Ke={type:"card",card_id:qe(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ke})},[n.viewport,d,r]),Y=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),K=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),Q=v(()=>{r({type:"ZOOM",zoom:1})},[r]),q=v(()=>{m(ue=>!ue)},[]),H=v(ue=>{p(ue)},[]),j=v(ue=>{y(ue)},[]),G=v(ue=>{g(ue)},[]),V=v(()=>{B(ue=>!ue)},[]),Z=v(()=>{r({type:"SET_BOARD",state:tt}),y(null)},[r]),te=v(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),ke=URL.createObjectURL(ve),Pe=document.createElement("a");Pe.href=ke,Pe.download=`board-${t}.json`,Pe.style.display="none",document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(ke)},[n,t]),ae=v(()=>{let ue=document.createElement("input");ue.type="file",ue.accept=".json,application/json",ue.style.display="none",ue.addEventListener("change",()=>{let ve=ue.files&&ue.files[0];if(!ve)return;let ke=new FileReader;ke.onload=()=>{try{let Pe=JSON.parse(ke.result);Pe&&Pe.collection&&Pe.viewport&&r({type:"SET_BOARD",state:Pe})}catch{}},ke.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=v(()=>{window.print()},[]),ie=os(n.collection),le=v(()=>{let ue=os(n.collection);ue.length>0&&y(ue[0].card_id)},[n.collection]),fe=v(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),oe=v(()=>{if(n.collection.length===0)return;let ke=qi(n.collection,800,600);r({type:"PAN",panX:ke.panX,panY:ke.panY}),r({type:"ZOOM",zoom:ke.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:Z},{label:"Export JSON",onClick:te},{label:"Import JSON",onClick:ae},{divider:!0},{label:"Print",onClick:J}]},{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:le},{label:"Delete Selected",onClick:fe}]},{label:"View",items:[{label:"Zoom In",onClick:Y},{label:"Zoom Out",onClick:K},{label:"Fit All",onClick:oe},{divider:!0},{label:"Toggle Grid",onClick:q}]}]}},[Z,te,ae,J,i,s,a,l,le,fe,Y,K,oe,q]),re(()=>{let ue=ve=>{let ke=ve;ke.ctrlKey&&ke.key==="z"?(ke.preventDefault(),i()):ke.ctrlKey&&ke.key==="y"&&(ke.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!L)return;let ue=()=>R(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[L]);let ge=v(()=>{T(b),A(!0)},[b]),he=v(()=>{let ue=C.trim();ue&&(S(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),A(!1)},[C,r,e.onTitleChange]),ee=v(()=>{A(!1)},[]),de=v(ue=>{T(ue.target.value)},[]),me=v(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),he()),ve.key==="Escape"&&(ve.preventDefault(),ee())},[he,ee]),xe={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},ye=v((ue,ve)=>{let ke=(-n.viewport.panX+300)/n.viewport.zoom,Pe=(-n.viewport.panY+200)/n.viewport.zoom,Ke=(Math.random()-.5)*300,Qe=(Math.random()-.5)*200,ct={type:"card",card_id:qe(),card_type:"text",card_title:ue,card_link:[],content:{text:ve},color:d,position:{x:Math.round(ke+Ke),y:Math.round(Pe+Qe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ct})},[n.viewport,d,r]),Me={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},ce={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},be=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:300,height:250},contents:[]}}),R(null)},[n.viewport,r]),Ee={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},Re={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},Ne=o("div",{style:Me,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{ge(),R(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:Re,onClick:()=>{be()}},"New Container"),o("button",{style:Re,onClick:()=>{O(),R(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{D(""),F("1"),k("add"),R(null)}},"Add Attribute..."),o("button",{style:Re,onClick:()=>{k("delete"),R(null)}},"Delete Attribute..."),o("button",{style:Re,onClick:()=>{W(E.map(ue=>({...ue}))),k("edit"),R(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{q(),R(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{V(),R(null)}},$?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:ce,onClick:()=>R(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>R(null)},"About Project Board"),o("button",{style:Re,onClick:()=>R(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${b}`)),se=I?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ee},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:ue=>ue.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:de,onKeyDown:me,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:ee,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:he,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,pe={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Se={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},we={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},Ie={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},Be={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},Ae={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},De=null;return z==="add"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:we},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:Ie,placeholder:"e.g. depends on",onInput:ue=>D(ue.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:M,style:Ie,min:"0",step:"1",onInput:ue=>F(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{let ue=w.trim(),ve=parseFloat(M)||1;ue&&N(ke=>[...ke,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:we},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${ue.name} (weight: ${ue.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>N(ke=>ke.filter((Pe,Ke)=>Ke!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Done"))))),z==="edit"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:{...Se,minWidth:"400px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:we},"Edit Edge Attributes"),P.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...P.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:ue.name,style:{...Ie,flex:"1"},onInput:ke=>{let Pe=ke.target.value;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,name:Pe}:Qe))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:ke=>{let Pe=parseFloat(ke.target.value)||0;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,weight:Pe}:Qe))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{N(P.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:xe,"data-testid":"project-manager-app"},Ne,o(Zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:x,onNewCard:O,onZoomIn:Y,onZoomOut:K,onZoomReset:Q,onColorSelect:u,onColorFilter:G,onGridToggle:q,onSearch:H}),o(ns,{collection:n.collection,onCardDropped:ye},o(Nt,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:j,colorFilter:x,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),se,De)}var zd=28,Ad=5e3;var is=0;function ss(e){return is++,`${e}-${is}`}function Ld(e){return e.replace(/\s*\(\d+\)$/,"")}function Bd(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 Fd(){let e=st(),t=ne(!1);return re(()=>{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 Nd(){let[e,t]=U([]),n=pt();Dt("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 Wd(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(Ld(e)){case"Files":return o(it,{appId:"files"},o(Nd,null));case"Terminal":return o(it,{appId:"terminal"},o(Fd,null));case"Browser":return o("div",{style:r},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:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(on,null);case"IDE":return o(mn,null);case"Trading":return o(bn,null);case"Project Board":return o(rs,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function _d(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=vt(),d=l.activeMenuBar,u=l.dockSignals,h=ne(l);h.current=l;let[m,c]=U([]),[p,f]=U([]),[y,x]=U(!1),[g,b]=U(!1),[S,I]=U(null),[A,C]=U({x:0,y:0}),[T,L]=U(null),R=v(()=>{x(ee=>!ee)},[]),$=v(ee=>{f(de=>de.filter(me=>me.id!==ee))},[]);re(()=>{if(p.length===0)return;let ee=p[0],de=Date.now()-ee.timestamp,me=Math.max(0,Ad-de),xe=setTimeout(()=>{f(ye=>ye.filter(Me=>Me.id!==ee.id))},me);return()=>clearTimeout(xe)},[p]);let B=ne(t);B.current=t;let E=ne(r);E.current=r;let N=ne({});for(let ee of m)if(!N.current[ee.id]){let de=ee.id;N.current[de]=me=>{c(xe=>xe.map(ye=>ye.id===de?{...ye,title:me}:ye))}}let z=v(ee=>{let me=B.current.find(xe=>xe.id===ee);me&&(c(xe=>{let Me=xe.filter(Ne=>Ne.appId===ee).length+1,ce=Me===1?me.label:`${me.label} (${Me})`,be=ss(ee),Ee=xe.length>0?Math.max(...xe.map(Ne=>Ne.zIndex))+1:1,Re={id:be,appId:me.id,title:ce,icon:me.icon,x:60+xe.length*30,y:40+xe.length*30,width:600,height:400,zIndex:Ee,focused:!0,windowState:"normal"};return[...xe.map(Ne=>({...Ne,focused:!1})),Re]}),ee==="files"&&h.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:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee))},[]),k=v(ee=>{c(de=>{if(!de.find(ye=>ye.id===ee))return de;let xe=Math.max(...de.map(ye=>ye.zIndex))+1;return de.map(ye=>ye.id===ee?{...ye,focused:!0,zIndex:xe,windowState:ye.windowState==="minimized"?"normal":ye.windowState}:{...ye,focused:!1})})},[]),w=v(ee=>{c(de=>{let me=de.filter(ce=>ce.appId===ee);if(me.length===0)return de;let ye=[...me].sort((ce,be)=>be.zIndex-ce.zIndex)[0],Me=Math.max(...de.map(ce=>ce.zIndex))+1;return de.map(ce=>ce.id===ye.id?{...ce,focused:!0,zIndex:Me,windowState:ce.windowState==="minimized"?"normal":ce.windowState}:{...ce,focused:!1})}),c(de=>{if(de.filter(xe=>xe.appId===ee).length===0){let ye=B.current.find(Ee=>Ee.id===ee);if(!ye)return de;let Me=ss(ee),ce=de.length>0?Math.max(...de.map(Ee=>Ee.zIndex))+1:1,be={id:Me,appId:ye.id,title:ye.label,icon:ye.icon,x:60+de.length*30,y:40+de.length*30,width:600,height:400,zIndex:ce,focused:!0,windowState:"normal"};return ee==="files"&&h.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:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee),[...de.map(Ee=>({...Ee,focused:!1})),be]}return de})},[]),D=t.map(ee=>{let de=m.some(ye=>ye.appId===ee.id),me=u.get(ee.id),xe={id:ee.id,icon:ee.icon,label:me?.tooltip||ee.label,active:de};return me&&(me.badge!=null&&(xe.badge=me.badge>0?me.badge:void 0),me.progress!=null&&(xe.progress=me.progress>0?me.progress:void 0),me.urgent&&(xe.urgent=!0)),xe}),M=m.find(ee=>ee.focused),F=M?M.title:void 0,P=v(()=>{b(!0)},[]),W=v(()=>{b(!1)},[]),_=v((ee,de)=>{I(ee),C(de)},[]),O=v(()=>{I(null)},[]),Y=v(()=>{},[]),K=v(()=>{i&&i()},[i]),Q=[];n&&(Q.push({label:n.name,icon:void 0,onClick:Y,divider:!1}),Q.push({label:"",icon:void 0,onClick:Y,divider:!0})),Q.push({label:"Lock",icon:void 0,onClick:P,divider:!1}),Q.push({label:"Logout",icon:void 0,onClick:K,divider:!1});let q=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]),H={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"},G={width:"100%",height:"100%",position:"relative"},V=o(en,{activeAppName:F,activitiesButton:{label:"Activities",onClick:R},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:Q.length>0?Q:void 0,height:zd}),Z=o(tn,{items:D,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),te=o(Bd,{toasts:p,onDismiss:$}),ae=m.filter(ee=>ee.windowState!=="minimized").map(ee=>o(kt,{key:ee.id,id:ee.id,title:ee.title,icon:ee.icon,defaultPosition:{x:ee.x,y:ee.y},defaultSize:{width:ee.width,height:ee.height},zIndex:ee.zIndex,focused:ee.focused,windowState:ee.windowState,onClose:()=>{c(de=>de.filter(me=>me.id!==ee.id))},onFocus:()=>{c(de=>{let me=Math.max(...de.map(xe=>xe.zIndex))+1;return de.map(xe=>xe.id===ee.id?{...xe,focused:!0,zIndex:me}:{...xe,focused:!1})})},onMinimize:()=>{c(de=>de.map(me=>me.id===ee.id?{...me,windowState:"minimized"}:me))},onMaximize:()=>{c(de=>de.map(me=>me.id===ee.id?{...me,windowState:me.windowState==="maximized"?"normal":"maximized"}:me))}},Wd(t.find(de=>de.id===ee.appId)?.label||ee.title,ee.id,N.current[ee.id]))),J=[];a&&J.push(a),J.push(...ae),J.push(te);let ie=o(nn,{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:G},...J)),le=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:R},...t.map(ee=>o("button",{key:ee.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:de=>{de.stopPropagation(),x(!1),w(ee.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ee.icon),o("span",null,ee.label)))):null,fe=g?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:W},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,oe=(()=>{if(!S)return null;let ee=t.find(ce=>ce.id===S),de=m.filter(ce=>ce.appId===S),me={padding:"6px 14px",cursor:"pointer"},xe={onMouseEnter:ce=>{ce.currentTarget.style.backgroundColor="#444"},onMouseLeave:ce=>{ce.currentTarget.style.backgroundColor="transparent"}},ye={borderBottom:"1px solid #444",margin:"4px 0"},Me=[];return Me.push(o("div",{key:"new",style:me,...xe,onClick:()=>{z(S),I(null)},role:"menuitem"},"\u25CF New")),de.length>0&&(Me.push(o("div",{key:"sep-1",style:ye})),de.forEach((ce,be)=>{let Ee=ce.title;Me.push(o("div",{key:`inst-${ce.id}`,style:me,...xe,onClick:()=>{k(ce.id),I(null)},role:"menuitem"},Ee))})),Me.push(o("div",{key:"sep-2",style:ye})),Me.push(o("div",{key:"about",style:me,...xe,onClick:()=>{L(S),I(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${A.y}px`,left:`${A.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:ce=>ce.stopPropagation()},...Me))})(),ge=T?t.find(ee=>ee.id===T):null,he=ge?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:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ee=>ee.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ge.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:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:q,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},V),o("div",{style:H},o("div",{className:"unity-desktop__dock",style:j},Z),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},ie,le)),oe,he,fe)}function as(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Qt,{onWindowOpen:r},o($t,null,o(zt,null,o(_d,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function ls(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:m,children:c}=e,p=vt(),f=X(()=>p.windows.find(T=>T.id===t),[p.windows,t]);re(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=ne(!1),x=f?f.focused:!1;re(()=>{let T=y.current;y.current=x,x&&!T?h&&h():!x&&T&&m&&m()},[x,h,m]);let g=v(()=>{p.closeWindow(t),d&&d()},[p,t,d]),b=v(()=>{p.focusWindow(t)},[p,t]),S=v(T=>{p.moveWindow(t,T)},[p,t]),I=v(T=>{p.resizeWindow(t,T)},[p,t]),A=v(()=>{p.minimizeWindow(t)},[p,t]),C=v(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(it,{appId:t},o(kt,{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:g,onFocus:b,onMove:S,onResize:I,onMinimize:A,onMaximize:C,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}function Od(e,t){let n=new Set,r=[];for(let i=e.length-1;i>=0;i--)r.push(e[i]);for(;r.length>0;){let i=r.pop();if($e(i)){if(t&&i.container_id===t)continue;i.name&&n.add(i.name);for(let s=i.contents.length-1;s>=0;s--)r.push(i.contents[s])}}return n}function ho(e,t,n){return!e||(!n||t.container_id!==n)&&t.name===e?!1:!Od(t.contents,n).has(e)}function cs(e,t,n){if(!e)return!1;for(let r=0;r<t.length;r++){let i=t[r];if($e(i)&&!(n&&i.container_id===n)&&i.name===e)return!1}return!0}function ds(e,t,n){return ho(e,t,n)}var us={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},ps={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 fs(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:h,active:m=!1}=e,c=X(()=>{let p=us[i]??us.md,f=ps[r]??ps.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.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":h,"aria-pressed":m?"true":void 0},t)}var Hd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],It=Math.PI/180;function Yd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*It),m=Math.sin(r*It),c=Math.cos(i*It),p=Math.sin(i*It),f=Math.cos(s*It),y=Math.sin(s*It),x=e*f-t*y,g=e*y+t*f,b=x*c-g*p,S=x*p+g*c,I=n,A=b,C=S*h-I*m,T=S*m+I*h,L=1+a*.001*T,R=l+A*u*L,$=d-C*u*L;return{sx:R,sy:$,depth:T}}function ms(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 gs(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 hs(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:h=2,colorScale:m=Hd,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let z=0,k=0,w=0;for(let D=0;D<t.length;D++){let M=t[D],F=M.data.length;F>z&&(z=F);for(let P=0;P<F;P++){let W=M.data[P].length;W>k&&(k=W);for(let _=0;_<W;_++){let O=Math.abs(M.data[P][_]??0);O>w&&(w=O)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=X(()=>{let z=f.maxHeight+(t.length-1)*h+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+z*z),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,h,n,r]),x=n/2,g=r/2,b=v((z,k,w)=>Yd(z,k,w,s,a,l,i,x,g,y),[s,a,l,i,x,g,y]),S=v(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,D=f.maxRows/2,M=b(-w,-D,0),F=b(w,-D,0);z.push(o("line",{key:"axis-x",x1:String(M.sx),y1:String(M.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),z.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 P=b(-w,D,0);z.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.sy),x2:String(P.sx),y2:String(P.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-y-label",x:String(P.sx-12),y:String(P.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=f.maxHeight+(t.length-1)*h,_=b(-w,-D,W);return z.push(o("line",{key:"axis-z",x1:String(M.sx),y1:String(M.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),z.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")),z},[u,f,t.length,h,b]),I=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,D=[];for(let M=0;M<t.length;M++){let F=t[M],P=F.color??m[M%m.length],W=F.opacity??.7,_=M*h,O=F.data.length;for(let Y=0;Y<O-1;Y++){let K=F.data[Y],Q=F.data[Y+1],q=Math.min(K.length,Q.length);for(let H=0;H<q-1;H++){let j=H-k,G=H+1-k,V=Y-w,Z=Y+1-w,te=(K[H]??0)+_,ae=(K[H+1]??0)+_,J=(Q[H]??0)+_,ie=(Q[H+1]??0)+_,le=b(j,V,te),fe=b(G,V,ae),oe=b(j,Z,J),ge=b(G,Z,ie),he=(le.depth+fe.depth+oe.depth+ge.depth)/4,ee=`${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ge.sx},${ge.sy} ${oe.sx},${oe.sy}`;D.push({points:ee,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:he,key:`quad-${M}-${Y}-${H}`})}}if(O===1||O>0&&F.data[0].length===1)for(let Y=0;Y<O;Y++){let K=F.data[Y];for(let Q=0;Q<K.length;Q++){let q=Q-k,H=Y-w,j=(K[Q]??0)+_,G=b(q,H,j),V=3,Z=`${G.sx},${G.sy-V} ${G.sx+V},${G.sy} ${G.sx},${G.sy+V} ${G.sx-V},${G.sy}`;D.push({points:Z,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:G.depth,key:`point-${M}-${Y}-${Q}`})}}}D.sort((M,F)=>M.depth-F.depth);for(let M=0;M<D.length;M++){let F=D[M];z.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,m,b]),A=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<=f.maxRows;D++){let M=D-w,F=b(-k,M,0),P=b(k,M,0);z.push(o("line",{key:`base-h-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let D=0;D<=f.maxCols;D++){let M=D-k,F=b(M,-w,0),P=b(M,w,0);z.push(o("line",{key:`base-v-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return z},[f,c,b]),C=v(()=>{if(!d)return[];let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<t.length;D++){let M=t[D],F=D*h,P=0,W=0;for(let K=0;K<M.data.length;K++){let Q=M.data[K];for(let q=0;q<Q.length;q++)P+=Q[q]??0,W++}let _=W>0?P/W:0,O=b(k+1,0,_+F),Y=M.color??m[D%m.length];z.push(o("text",{key:`layer-label-${D}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:Y},M.label))}return z},[d,t,f,h,m,b]),L=v(()=>p?[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"},p)]:[],[p,n])(),R=A(),$=S(),B=I(),E=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":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...R,...$,...B,...E)}function Vd(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 Ud(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 bs(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>Vd(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),x=l!=null&&l.length>1,g=n!=null&&n.length>0,b=y&&s>=0?m:c,S=20,I=g?u*.38:u*.45,A=Math.min(d*.15,48),C=A*.55,T=I+A*.4+8,L=g?T+22:I+A*.4+22,R=x?Math.min(u*.22,36):0,$=u-S-R,B=d-S*2,E=v(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),N=v(()=>{let O=[],Y=r+f+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(I),"text-anchor":"middle","dominant-baseline":"central","font-size":String(A),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${Y}`},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)),O},[d,I,A,C,f,r,i,h]),z=v(()=>g?[o("text",{key:"label",x:String(d/2),y:String(T),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,T,n]),k=v(()=>{if(!y)return[];let O=[],Y=s,K=Y>=0,Q=8,q=Ud(Y),H=(K?"+":"-")+q+(a?" "+a:""),j=d/2-40,G=L;if(K){let V=`${j},${G} ${j-Q/2},${G+Q} ${j+Q/2},${G+Q}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}else{let V=`${j},${G+Q} ${j-Q/2},${G} ${j+Q/2},${G}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}return O.push(o("text",{key:"trend-text",x:String(j+Q+4),y:String(G+Q*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${H}`},H)),O},[y,s,a,b,d,L]),w=v(()=>{if(!x)return[];let O=[],Y=l,K=[];for(let te of Y)typeof te=="number"&&isFinite(te)&&!isNaN(te)&&K.push(te);if(K.length<2)return[];let Q=1/0,q=-1/0;for(let te of K)te<Q&&(Q=te),te>q&&(q=te);Q===q&&(Q-=1,q+=1);let H=q-Q,j=B/(K.length-1),G="";for(let te=0;te<K.length;te++){let ae=S+te*j,J=$+R-(K[te]-Q)/H*R;te===0?G+=`M ${ae} ${J}`:G+=` L ${ae} ${J}`}let V=S+(K.length-1)*j,Z=G+` L ${V} ${$+R} L ${S} ${$+R} 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:G,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[x,l,B,$,R,S]),D=E(),M=N(),F=z(),P=k(),W=w(),_=`${r}${f}${i}${g?`, ${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"}},...D,...W,...M,...F,...P)}var Mn=Math.PI/180;function jd(e,t,n,r,i,s,a,l){let d=Math.cos(r*Mn),u=Math.sin(r*Mn),h=Math.cos(i*Mn),m=Math.sin(i*Mn),c=e*h+n*m,p=-e*m+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function Rt(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 En(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 lt(e,t,n){let{x:r,y:i,z:s}=Rt(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),En(d,u,h)}function bo(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return lt(e,"x",Math.PI);case"Y":return lt(e,"y",Math.PI);case"Z":return lt(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Rt(e);return En(s,-i,r)}case"S":return lt(e,"z",Math.PI/2);case"T":return lt(e,"z",Math.PI/4);case"Rx":return lt(e,"x",n);case"Ry":return lt(e,"y",n);case"Rz":return lt(e,"z",n)}}function xs(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:h=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:x="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:I,onStateChange:A}=e,[C,T]=U(t??{theta:0,phi:0}),[L,R]=U(s),[$,B]=U(a),[E,N]=U(l),z=ne([]),k=ne(!1),w=ne(null),D=ne(null);re(()=>{t&&T(t)},[t?.theta,t?.phi]);let M=ne(0);re(()=>{if(!n||n.length===0)return;M.current=0;let j=0,G=()=>{M.current>=n.length||(T(V=>{let Z=bo(V,n[M.current]);return M.current++,A&&A(Z),Z}),j=requestAnimationFrame(G))};return j=requestAnimationFrame(G),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=Rt(C);z.current.push(j),z.current.length>f&&z.current.splice(0,z.current.length-f)},[C.theta,C.phi]);let F=S*E,P=r/2,W=i/2,_=v((j,G,V)=>jd(j,G,V,$,L,P,W,F),[$,L,P,W,F]),O=v(j=>{if(!d)return;let G=j;k.current=!0,w.current={mx:G.clientX,my:G.clientY,rx:$,ry:L}},[d,$,L]),Y=v(j=>{if(!k.current||!w.current)return;let G=j,V=w.current;R(V.ry+(G.clientX-V.mx)*.5),B(V.rx-(G.clientY-V.my)*.5)},[]),K=v(()=>{k.current=!1},[]),Q=v(j=>{if(!u)return;let G=j;G.preventDefault(),N(V=>Math.max(.5,Math.min(3,V*(G.deltaY>0?.95:1.05))))},[u]),q=[];if(b&&q.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),I&&q.push(o("text",{key:"title",x:String(P),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},I)),c){let G=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),Math.sin(ae),0);G.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"eq",d:G.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.5"}));let V=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),0,Math.sin(ae));V.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"xz",d:V.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(0,Math.cos(ae),Math.sin(ae));Z.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}))}let H=[{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 H){let G=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),V=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),Z=_(0,0,0);q.push(o("line",{key:`axis-${j.id}`,x1:String(V.sx),y1:String(V.sy),x2:String(G.sx),y2:String(G.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){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 G of j){let V=_(G.pos[0],G.pos[1],G.pos[2]);q.push(o("text",{key:`lbl-${G.text}`,x:String(V.sx),y:String(V.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},G.text))}}if(p&&z.current.length>1){let j=z.current,G=[];for(let V=0;V<j.length;V++){let Z=j[V],te=_(Z.x,Z.y,Z.z);G.push(`${V===0?"M":"L"}${te.sx.toFixed(1)},${te.sy.toFixed(1)}`)}q.push(o("path",{key:"trail",d:G.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let j=Rt(C),G=_(0,0,0),V=_(j.x,j.y,j.z);q.push(o("line",{key:"vec-line",x1:String(G.sx),y1:String(G.sy),x2:String(V.sx),y2:String(V.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),q.push(o("circle",{key:"vec-point",cx:String(V.sx),cy:String(V.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let Z=(C.theta*180/Math.PI).toFixed(0),te=(C.phi*180/Math.PI).toFixed(0);q.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=${te}\xB0`))}return o("svg",{ref:D,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":I??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?Y:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?Q:void 0},...q)}function Gd(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 xo(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 yo(e){let t=Gd(e);if(t.length===0)return null;let n=xo(t,25),r=xo(t,50),i=xo(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let m=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);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 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 ys(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:h,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],x=X(()=>{let w=[];for(let D of t)w.push(yo(D.values));return w},[t]),g=X(()=>{let w=1/0,D=-1/0;for(let P of x){if(P===null)continue;let W=s&&P.outliers.length>0?Math.min(P.whiskerLow,P.outliers[0]):P.whiskerLow,_=s&&P.outliers.length>0?Math.max(P.whiskerHigh,P.outliers[P.outliers.length-1]):P.whiskerHigh;W<w&&(w=W),_>D&&(D=_)}isFinite(w)||(w=0,D=1);let M=D-w,F=M>0?M*.05:.5;return{min:w-F,max:D+F}},[x,s]),b=c?f:p,S=c?p:f,I=t.length>0?t.length:1,A=S/I,C=A*Math.min(Math.max(d,.1),.95),T=v(w=>{let D=g.max-g.min;return D===0?b/2:(w-g.min)/D*b},[g,b]),L=v(()=>{if(!u)return[];let w=[],D=g.max-g.min,M=Xd(D),F=Math.ceil(g.min/M)*M;for(let P=F;P<=g.max;P+=M){let W=T(P),_=String(Math.round(P*1e3)/1e3);if(c){let O=m+f-W;w.push(o("line",{key:`grid-${P}`,x1:String(m),y1:String(O),x2:String(m+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(m-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=m+W;w.push(o("line",{key:`grid-${P}`,x1:String(O),y1:String(m),x2:String(O),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(O),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,g,T,c,m,p,f]),R=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+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,p,f,c]),$=v(()=>{let w=[];for(let D=0;D<t.length;D++){let M=x[D];if(M===null)continue;let F=t[D],P=F.color??y[D%y.length],W=A*D+A/2,_=C/2;if(c){let O=m+f-T(M.q1),Y=m+f-T(M.q3),K=m+f-T(M.median),Q=m+f-T(M.whiskerLow),q=m+f-T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(H),y1:String(O),x2:String(H),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(H-_*.4),y1:String(Q),x2:String(H+_*.4),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(H),y1:String(Y),x2:String(H),y2:String(q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(H-_*.4),y1:String(q),x2:String(H+_*.4),y2:String(q),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(O-Y);if(w.push(o("rect",{key:`box-${D}`,x:String(H-_),y:String(j),width:String(C),height:String(Math.max(G,1)),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(H-_),y1:String(K),x2:String(H+_),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+f-T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(H),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+f-T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(H),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(H),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=m+T(M.q1),Y=m+T(M.q3),K=m+T(M.median),Q=m+T(M.whiskerLow),q=m+T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(O),y1:String(H),x2:String(Q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(Q),y1:String(H-_*.4),x2:String(Q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(Y),y1:String(H),x2:String(q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(q),y1:String(H-_*.4),x2:String(q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(Y-O);if(w.push(o("rect",{key:`box-${D}`,x:String(j),y:String(H-_),width:String(Math.max(G,1)),height:String(C),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(K),y1:String(H-_),x2:String(K),y2:String(H+_),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(V),cy:String(H),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(Z),cy:String(H),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(m-6),y:String(H+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return w},[t,x,T,c,m,p,f,A,C,l,s,a,y]),B=v(()=>h?[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"},h)]:[],[h,n,m]),E=L(),N=R(),z=$(),k=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??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z)}function Ss(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 Kd(e,t,n){return e<t?t:e>n?n:e}function So(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function vs(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:h=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];So(w.x)&&So(w.y)&&So(w.r)&&z.push(w)}return z},[t]),x=n-f*2,g=r-f*2,b=X(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let z=1/0,k=-1/0,w=1/0,D=-1/0,M=1/0,F=-1/0;for(let P of y)P.x<z&&(z=P.x),P.x>k&&(k=P.x),P.y<w&&(w=P.y),P.y>D&&(D=P.y),P.r<M&&(M=P.r),P.r>F&&(F=P.r);return z===k&&(z-=1,k+=1),w===D&&(w-=1,D+=1),M===F&&(M=0,F=F>0?F:1),{xMin:z,xMax:k,yMin:w,yMax:D,rMin:M,rMax:F}},[y]),S=v(z=>{let k=b.xMax-b.xMin;return f+(z-b.xMin)/k*x},[b,f,x]),I=v(z=>{let k=b.yMax-b.yMin;return f+g-(z-b.yMin)/k*g},[b,f,g]),A=v(z=>{let k=b.rMax-b.rMin;if(k===0)return(h+u)/2;let w=(z-b.rMin)/k;return h+w*(u-h)},[b,h,u]),C=v(()=>{if(!a)return[];let z=[],k=Ss(b.xMax-b.xMin),w=Math.ceil(b.xMin/k)*k;for(let F=w;F<=b.xMax;F+=k){let P=S(F);z.push(o("line",{key:`grid-x-${F}`,x1:String(P),y1:String(f),x2:String(P),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${F}`,x:String(P),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let D=Ss(b.yMax-b.yMin),M=Math.ceil(b.yMin/D)*D;for(let F=M;F<=b.yMax;F+=D){let P=I(F);z.push(o("line",{key:`grid-y-${F}`,x1:String(f),y1:String(P),x2:String(f+x),y2:String(P),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${F}`,x:String(f-6),y:String(P+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return z},[a,b,S,I,f,x,g]),T=v(()=>{if(!l)return[];let z=[];return z.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+x),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+x/2),y:String(f+g+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&z.push(o("text",{key:"y-label",x:String(f-40),y:String(f+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),z},[l,f,x,g,i,s]),L=v(()=>{let z=[];for(let k=0;k<y.length;k++){let w=y[k],D=S(w.x),M=I(w.y),F=Kd(A(w.r),h,u),P=w.color??m;z.push(o("circle",{key:`bubble-${k}`,cx:String(D),cy:String(M),r:String(F),fill:P,opacity:String(c),stroke:P,"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&&z.push(o("text",{key:`label-${k}`,x:String(D),y:String(M-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[y,S,I,A,m,c,d,h,u]),R=v(()=>p?[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"},p)]:[],[p,n,f]),$=C(),B=T(),E=L(),N=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...$,...B,...E)}var qd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Jd(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 ws(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 ks(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 Qd(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 eu(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=ks(t[i]),l=ks(t[i+1]);return Qd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var tu=["#9be9a8","#40c463","#30a14e","#216e39"];function Cs(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=tu,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let E=new Map,N=0,z=null,k=null;for(let M of t){let F=Jd(M.date);if(isNaN(F.getTime()))continue;let P=ws(F);E.set(P,(E.get(P)??0)+M.value);let W=E.get(P);W>N&&(N=W),(z===null||F<z)&&(z=F),(k===null||F>k)&&(k=F)}if(z===null||k===null){let M=new Date;z=new Date(M.getFullYear(),0,1),k=new Date(M.getFullYear(),11,31)}let w=new Date(z);w.setDate(w.getDate()-w.getDay());let D=new Date(k);return D.setDate(D.getDate()+(6-D.getDay())),{dateMap:E,startDate:w,endDate:D,maxVal:N>0?N:1}},[t]),y=d?30:0,x=l?16:0,g=h?28:0,b=y+10,S=g+x+4,I=v(()=>{let E=[],N=new Date(c),z=0;for(;N<=p;){let k=N.getDay();k===0&&N>c&&z++;let w=ws(N),D=m.get(w),M=D!==void 0&&D>0?eu(D/f,i):u,F=b+z*(s+a),P=S+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(F),y:String(P),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${D??0}`})),N.setDate(N.getDate()+1)}return E},[c,p,m,f,i,u,s,a,b,S]),A=v(()=>{if(!l)return[];let E=[],N=new Date(c),z=0,k=-1;for(;N<=p;){let w=N.getDay();w===0&&N>c&&z++;let D=N.getMonth();if(D!==k&&w===0){k=D;let M=b+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(M),y:String(g+x-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},qd[D]))}N.setDate(N.getDate()+1)}return E},[l,c,p,s,a,b,g,x]),C=v(()=>{if(!d)return[];let E=[],N=[1,3,5];for(let z of N){let k=S+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Zd[z]))}return E},[d,s,a,S,y]),T=v(()=>h?[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"},h)]:[],[h,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":h??"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 L=T(),R=A(),$=C(),B=I();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??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...R,...$,...B)}var nu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nt(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ou(e,t,n,r,i,s){let a=nt(e,t,n,i),l=nt(e,t,n,s),d=nt(e,t,r,i),u=nt(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 ru(e,t,n,r,i,s,a){let l=nt(e,t,n,r),d=nt(e,t,n,i),u=nt(e,t,n,s),h=nt(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function iu(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 p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.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:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let x=f+y,g=s[c]>0?f/a*l:0,b=h[c],S=b+g;h[c]=S;let I=s[p]>0?f/a*l:0,A=h[p],C=A+I;if(h[p]=C,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:A,targetEndAngle:C,value:f,color:d[c].color});continue}let T=s[p]>0?y/a*l:0,R=h[p]+T;h[p]=R;let $=s[c]>0?y/a*l:0,E=h[c]+$;h[c]=E,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:A,targetEndAngle:Math.max(C,A+.001),value:x,color:d[c].color})}return{groups:d,chords:m}}function Ms(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=nu,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.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,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),x=f+16,g=X(()=>iu(t,n,s,a),[t,n,s,a]),b=v(()=>{let L=[];for(let R=0;R<g.groups.length;R++){let $=g.groups[R];if($.endAngle-$.startAngle<.001)continue;let E=ou(c,p,f,y,$.startAngle,$.endAngle);if(L.push(o("path",{key:`arc-${R}`,d:E,fill:$.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${$.label}: ${$.value}`})),l){let N=($.startAngle+$.endAngle)/2,z=nt(c,p,x,N),D=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=D?"start":"end",F=N*180/Math.PI-90;D||(F+=180);let P=d?`${$.label} (${$.value})`:$.label;L.push(o("text",{key:`label-${R}`,x:String(z.x),y:String(z.y),"text-anchor":M,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},P))}}return L},[g,c,p,f,y,x,l,d]),S=v(()=>{let L=[];for(let R=0;R<g.chords.length;R++){let $=g.chords[R],B=ru(c,p,y,$.sourceStartAngle,$.sourceEndAngle,$.targetStartAngle,$.targetEndAngle);L.push(o("path",{key:`ribbon-${R}`,d:B,fill:$.color,"fill-opacity":String(u),stroke:$.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,y,u]),I=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]),A=S(),C=b(),T=I();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"}},...T,...A,...C)}var su=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function au(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??[],h=[];for(let m=0;m<u.length;m++)h.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function lu(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 cu(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=au(e);if(d.length===0)return[];let h=lu(d),m=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(m-r)/u:0:f>1?(c-i)/u:0,x=new Array(d.length),g=h[0],b=p?c:m,S=g>0?b/g:b,I=new Array(d.length);I[0]=[0,g];let A=[0],C=0;for(;C<A.length;){let T=A[C];C++;let L=d[T],[R,$]=I[T],B=(R+$)/2,E=s+L.depth*y,N=s+(B-.5)*S,z=p?E:N,k=p?N:E,w=L.node.color??l[L.depth%l.length];x[T]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:z,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:h[T]};let D=R;for(let M of L.childIndices)if(M<d.length){let F=h[M],P=D+F;I[M]=[D,P],D=P,A.push(M)}}return x}function Es(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:h=su,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 p=i==="horizontal",f=X(()=>cu(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=X(()=>{let C=new Map;for(let T=0;T<f.length;T++){let L=f[T];C.set(L.id,L)}return C},[f]),x=v(()=>{if(!d)return[];let C=[];for(let T=0;T<f.length;T++){let L=f[T];if(L.parentId===null)continue;let R=y.get(L.parentId);if(!R)continue;let $,B,E,N;p?($=R.x+s,B=R.y+a/2,E=L.x,N=L.y+a/2):($=R.x+s/2,B=R.y+a,E=L.x+s/2,N=L.y);let z=($+E)/2,k=(B+N)/2,w;p?w=`M ${$} ${B} C ${z} ${B}, ${z} ${N}, ${E} ${N}`:w=`M ${$} ${B} C ${$} ${k}, ${E} ${k}, ${E} ${N}`,C.push(o("path",{key:`conn-${T}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,p,s,a,d,u]),g=v(()=>{let C=[];for(let T=0;T<f.length;T++){let L=f[T];C.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let R=l&&L.value?L.y+a/2-2:L.y+a/2+4;C.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(R),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&C.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return C},[f,s,a,l]),b=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=x(),I=g(),A=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":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...A,...S,...I)}var Is=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function du(e){return Is[e%Is.length]}function Rs(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],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??du(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Ps(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 h=Math.sqrt(u),m=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,x=f*m+y*c;x<=0||(i.fixed?(a.vx+=x*m,a.vy+=x*c):a.fixed?(i.vx-=x*m,i.vy-=x*c):(i.vx-=x*m,i.vy-=x*c,a.vx+=x*m,a.vy+=x*c))}}}function uu(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let b=0;b<u;b++)h.set(e[b].id,b);let m=new Float64Array(u),c=new Float64Array(u);for(let b=0;b<u;b++){let S=e[b];for(let I=b+1;I<u;I++){let A=e[I],C=S.x-A.x,T=S.y-A.y,L=C*C+T*T;L<1&&(L=1);let R=Math.sqrt(L),$=i/L,B=C/R*$,E=T/R*$;m[b]+=B,c[b]+=E,m[I]-=B,c[I]-=E}}for(let b=0;b<t.length;b++){let S=t[b],I=h.get(S.source),A=h.get(S.target);if(I===void 0||A===void 0)continue;let C=e[I],T=e[A],L=T.x-C.x,R=T.y-C.y,$=Math.sqrt(L*L+R*R);if($<.1)continue;let B=S.weight??1,E=$-l,N=s*E*B,z=L/$*N,k=R/$*N;m[I]+=z,c[I]+=k,m[A]-=z,c[A]-=k}let p=n/2,f=r/2,y=.001;for(let b=0;b<u;b++){let S=e[b];m[b]+=(p-S.x)*y,c[b]+=(f-S.y)*y}let x=20,g=[];for(let b=0;b<u;b++){let S=e[b];if(S.fixed){g.push({...S,vx:0,vy:0});continue}let I=(S.vx+m[b])*a,A=(S.vy+c[b])*a,C=Math.sqrt(I*I+A*A),T=10;C>T&&(I=I/C*T,A=A/C*T);let L=S.x+I,R=S.y+A;L=Math.max(x,Math.min(n-x,L)),R=Math.max(x,Math.min(r-x,R)),g.push({...S,x:L,y:R,vx:I,vy:A})}return Ps(g,d),g}function pu(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 Ts(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:h=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:x,customForce:g,trails:b}=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":x??"Empty force-directed graph"},x?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"},x):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=ne(Rs(t,r,i)),[I,A]=U(0),C=ne(!0),T=ne(!1),L=ne(n);L.current=n;let R=ne(g);R.current=g;let $=ne(null),B=ne({repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=ne(new Map);re(()=>{S.current=Rs(t,r,i),T.current=!1,C.current=!0,E.current=new Map,A(ae=>ae+1)},[t.length]),re(()=>{let ae=0,J=()=>{if(!C.current)return;let ie=B.current,le=R.current,fe;if(le?(fe=le(S.current,L.current,ie.width,ie.height,$.current),ie.solidNodes&&Ps(fe,ie.nodeRadius)):fe=uu(S.current,L.current,ie.width,ie.height,ie.repulsionForce,ie.attractionForce,ie.damping,ie.edgeLength,ie.nodeRadius),S.current=fe,b)for(let oe=0;oe<b.length;oe++){let ge=b[oe],he=fe.find(me=>me.id===ge.nodeId);if(!he)continue;let ee=E.current.get(ge.nodeId);ee||(ee=[],E.current.set(ge.nodeId,ee)),ee.push({x:he.x,y:he.y});let de=ge.maxPoints??200;ee.length>de&&ee.splice(0,ee.length-de)}if(!le&&pu(fe)<.01){T.current=!0,A(oe=>oe+1);return}A(oe=>oe+1),ae=requestAnimationFrame(J)};return ae=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(ae)}},[]);let N=S.current,z=v(ae=>{S.current=S.current.map(J=>J.id===ae?{...J,fixed:!J.fixed,vx:0,vy:0}:J),T.current&&(T.current=!1,C.current=!0,A(J=>J+1))},[]),k=ne(null),w=ne(null),D=v(ae=>{let J=ae,ie=w.current;if(!ie)return{x:J.clientX,y:J.clientY};let le=ie.getBoundingClientRect(),fe=r/le.width,oe=i/le.height;return{x:(J.clientX-le.left)*fe,y:(J.clientY-le.top)*oe}},[r,i]),M=ne(!1),F=v((ae,J)=>{J.stopPropagation(),k.current=ae;let ie=S.current.find(le=>le.id===ae);M.current=ie?.fixed??!1,S.current=S.current.map(le=>le.id===ae?{...le,fixed:!0,vx:0,vy:0}:le)},[]),P=v(ae=>{let J=D(ae);if($.current={x:J.x,y:J.y},!k.current)return;let ie=k.current,le=20;S.current=S.current.map(fe=>fe.id===ie?{...fe,x:Math.max(le,Math.min(r-le,J.x)),y:Math.max(le,Math.min(i-le,J.y))}:fe),T.current&&(T.current=!1,C.current=!0),A(fe=>fe+1)},[r,i,D]),W=v(()=>{let ae=k.current;ae&&(S.current=S.current.map(J=>J.id===ae?{...J,fixed:M.current}:J)),k.current=null},[]),_=v(()=>{k.current=null,$.current=null},[]),O=X(()=>{let ae=new Map;for(let J=0;J<N.length;J++)ae.set(N[J].id,N[J]);return ae},[I]),Y=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]),K=v(()=>{let ae=[];for(let J=0;J<n.length;J++){let ie=n[J],le=O.get(ie.source),fe=O.get(ie.target);if(!le||!fe||ie.weight!==void 0&&ie.weight<=0)continue;let oe=ie.weight?Math.max(.5,Math.min(6,y*ie.weight)):y,ge={key:`edge-${J}`,x1:String(le.x),y1:String(le.y),x2:String(fe.x),y2:String(fe.y),stroke:ie.color??f,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(ge["marker-end"]="url(#arrowhead)"),ae.push(o("line",ge))}return ae},[I,f,y,u]),Q=v(()=>{let ae=[];for(let J=0;J<N.length;J++){let ie=N[J];ae.push(o("circle",{key:`node-${ie.id}`,cx:String(ie.x),cy:String(ie.y),r:String(s),fill:ie.color,stroke:ie.fixed?"#0f172a":"#fff","stroke-width":ie.fixed?"3":String(a),style:{cursor:k.current===ie.id?"grabbing":"grab"},onMouseDown:le=>F(ie.id,le),onDblClick:()=>z(ie.id),role:"button",tabIndex:0,"aria-label":`Node: ${ie.label}${ie.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ae.push(o("text",{key:`label-${ie.id}`,x:String(ie.x),y:String(ie.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ie.label))}return ae},[I,s,d,z]),q=v(()=>x?[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"},x)]:[],[x,r]),H=v(()=>{if(!b||b.length===0)return[];let ae=[];for(let J=0;J<b.length;J++){let ie=b[J],le=E.current.get(ie.nodeId);if(!le||le.length<2)continue;let fe=[];for(let oe=0;oe<le.length;oe++){let ge=le[oe];fe.push(`${oe===0?"M":"L"}${ge.x.toFixed(1)},${ge.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${ie.nodeId}`,d:fe.join(" "),fill:"none",stroke:ie.color??"#3b82f6","stroke-width":String(ie.width??1),opacity:String(ie.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ae},[I,b]),j=Y(),G=H(),V=K(),Z=Q(),te=q();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":x??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:P,onMouseUp:W,onMouseLeave:_},...j,...te,...G,...V,...Z)}var $s=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ds(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=$s,title:h}=e,m=i==="vertical",c=h?30:0,p=120,f=X(()=>{let L=0;for(let R=0;R<t.length;R++)t[R].value>L&&(L=t[R].value);return L>0?L:1},[t]),y=v(L=>f===0?0:Math.max(.05,L/f),[f]),x=v((L,R)=>R||(u[L%u.length]??$s[0]),[u]),g=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2-p,B=r-c-R*2,E=d*(t.length-1),N=Math.max(1,(B-E)/t.length),z=R+$/2;for(let k=0;k<t.length;k++){let w=t[k],D=k<t.length-1?t[k+1]:null,M=x(k,w.color),F=y(w.value),P=D!==null?y(D.value):F*.6,W=$/2*F,_=$/2*P,O=c+R+k*(N+d),Y=z-W,K=z+W,Q=z+_,q=z-_,H=`${Y},${O} ${K},${O} ${Q},${O+N} ${q},${O+N}`;L.push(o("polygon",{key:`section-${k}`,points:H,fill:M,stroke:"#fff","stroke-width":"1"}));let j=R+$+12,G=O+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(G-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let V="";if(a&&(V=String(w.value)),l&&t.length>0){let Z=t[0].value,te=Z>0?Math.round(w.value/Z*100):0;V+=a?` (${te}%)`:`${te}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(G+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},V))}}return L},[t,n,r,c,d,s,a,l,x,y,p]),b=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2,E=r-c-R*2-40,N=d*(t.length-1),z=Math.max(1,($-N)/t.length),k=c+R+E/2;for(let w=0;w<t.length;w++){let D=t[w],M=w<t.length-1?t[w+1]:null,F=x(w,D.color),P=y(D.value),W=M!==null?y(M.value):P*.6,_=E/2*P,O=E/2*W,Y=R+w*(z+d),K=k-_,Q=k-O,q=k+O,H=k+_,j=`${Y},${K} ${Y+z},${Q} ${Y+z},${q} ${Y},${H}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:F,stroke:"#fff","stroke-width":"1"}));let G=Y+z/2,V=c+R+E+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(G),y:String(V),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D.label)),a||l){let Z="";if(a&&(Z=String(D.value)),l&&t.length>0){let te=t[0].value,ae=te>0?Math.round(D.value/te*100):0;Z+=a?` (${ae}%)`:`${ae}%`}L.push(o("text",{key:`value-${w}`,x:String(G),y:String(V+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return L},[t,n,r,c,d,s,a,l,x,y]),S=v(()=>h?[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"},h)]:[],[h,n]),I=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]),A=S(),C=m?g():b(),T=I();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...A,...C,...T)}var zs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function As(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 fu(e,t){return t||zs[e%zs.length]}function Ls(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:h,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":h??"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,p=X(()=>{let B=1/0,E=-1/0;for(let N of t){N.start<B&&(B=N.start);let z=N.start+N.duration;z>E&&(E=z)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=X(()=>{let B=t.slice();return B.sort((E,N)=>E.group!==N.group?(E.group??"").localeCompare(N.group??""):E.start-N.start),B},[t]),y=r??m*2+f.length*(i+s)+s+20,x=n-m-c-m,g=m+(h?20:0),b=v(B=>p.range===0?c+m:c+m+(B-p.min)/p.range*x,[p,x,c,m]),S=v(()=>{if(!a)return[];let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g+f.length*(i+s)+s;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(g),x2:String(w),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,g,f.length,i,s,b]),I=v(()=>{let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g-8;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return B.push(o("text",{key:"time-unit",x:String(n-m),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[p,g,b,u,n,m]),A=v(()=>{let B=[],E="";for(let N=0;N<f.length;N++){let z=f[N],k=g+N*(i+s)+s,w=b(z.start),D=Math.max(2,b(z.start+z.duration)-w),M=fu(N,z.color);z.group&&z.group!==E&&(E=z.group,l&&B.push(o("text",{key:`group-${N}`,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"},z.group))),B.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String(D),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&B.push(o("text",{key:`label-${z.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},z.label.length>16?z.label.substring(0,14)+"..":z.label)),d&&D>30&&B.push(o("text",{key:`prog-${z.id}`,x:String(w+D/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${z.start}-${z.start+z.duration}`))}return B},[f,g,i,s,b,l,d,c,m]),C=v(()=>h?[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"},h)]:[],[h,n,m]),T=S(),L=I(),R=A(),$=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":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...$,...T,...L,...R)}var mu=Math.PI/180;function gu(e){return e*mu}function Je(e,t,n,r){let i=gu(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Bs(e,t,n,r,i){let s=Je(e,t,n,i),a=Je(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 hu(e,t,n){return e<t?t:e>n?n:e}function mt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function Fs(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:h=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:x="#374151",backgroundColor:g="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,I=isFinite(t)&&!isNaN(t)?hu(t,b,S):b,A=(u?24:0)+(p?18:0),C=i/2,T=(s-A)*.6,L=Math.min(i/2,(s-A)*.55)-d/2-10,R=L-d,$=L-d/2,B=l-a,E=v(H=>{let j=S-b;if(j===0)return a;let G=(H-b)/j;return a+G*B},[b,S,a,B]),N=v(()=>{let H=Bs(C,T,$,a,l);return[o("path",{key:"bg-arc",d:H,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,T,$,a,l,g,d]),z=v(()=>{if(y.length===0)return[];let H=[],j=B/y.length;for(let G=0;G<y.length;G++){let V=a+G*j,Z=V+j,te=Bs(C,T,$,V,Z);H.push(o("path",{key:`seg-${G}`,d:te,fill:"none",stroke:y[G],"stroke-width":String(d),"stroke-linecap":G===0||G===y.length-1?"round":"butt",opacity:"0.85"}))}return H},[y,B,a,C,T,$,d]),k=v(()=>{if(!m||c<=0)return[];let H=[],j=Math.max(1,Math.min(c,100));for(let G=0;G<=j;G++){let V=G/j,Z=a+V*B,te=G%2===0,ae=te?10:6,J=Je(C,T,L+4,Z),ie=Je(C,T,L+4+ae,Z);if(H.push(o("line",{key:`tick-${G}`,x1:String(J.x),y1:String(J.y),x2:String(ie.x),y2:String(ie.y),stroke:"currentColor",opacity:"0.4","stroke-width":te?"2":"1"})),te){let le=b+V*(S-b),fe=Je(C,T,L+4+ae+12,Z);H.push(o("text",{key:`tick-label-${G}`,x:String(fe.x),y:String(fe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(le)))}}return H},[m,c,a,B,C,T,L,b,S]),w=v(()=>{let H=[],j=E(I),G=R-8,V=Je(C,T,G,j),Z=6,te=j+90,ae=j-90,J=Je(C,T,Z,te),ie=Je(C,T,Z,ae);return H.push(o("polygon",{key:"needle",points:`${V.x},${V.y} ${J.x},${J.y} ${ie.x},${ie.y}`,fill:x,stroke:"none"})),H.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(T),r:"8",fill:x,stroke:"#fff","stroke-width":"2"})),H},[I,E,C,T,R,x]),D=v(()=>{if(!u)return[];let H=[],j=mt(I),G=j+(f?" "+f:""),V=T+$+20;return H.push(o("text",{key:"value-text",x:String(C),y:String(V),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${G}`},j,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),H},[u,I,f,C,T,$]),M=v(()=>{if(!p)return[];let H=T+$+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(H),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},p)]},[p,C,T,$,u]),F=v(()=>{if(!h)return[];let H=[],j=Je(C,T,$,a),G=Je(C,T,$,l);return H.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"},mt(b))),H.push(o("text",{key:"max-label",x:String(G.x+4),y:String(G.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(S))),H},[h,C,T,$,a,l,b,S]),P=N(),W=z(),_=k(),O=w(),Y=D(),K=M(),Q=F(),q=`Gauge: ${mt(I)}${f?" "+f:""}, range ${mt(b)} to ${mt(S)}${p?", "+p:""}`;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(I),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":q,style:{fontFamily:"sans-serif"}},...P,...W,..._,...O,...Y,...K,...Q)}var _t={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.1,.1 -1,1.9 -1.1,-.1 -.4,-.8 .5,-1.3 m -1.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 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 Ns(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:h="Map of the United States"}=e,m=X(()=>Object.keys(_t),[]),c=v(g=>{l&&l(g)},[l]),p=v((g,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",u),d&&d(g)},[d,u]),f=v((g,b)=>{let S=b.currentTarget;if(S){let I=r[g]??i;S.setAttribute("fill",I)}d&&d(null)},[d,r,i]),y=X(()=>{let g=[];for(let b=0;b<m.length;b++){let S=m[b],I=_t[S],A=r[S]??i,C={key:`state-${S}`,d:I.path,fill:A,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":I.name,style:{cursor:l?"pointer":"default"}};if(l){let L=S;C.onClick=()=>c(L),C.onKeyDown=R=>{(R.key==="Enter"||R.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=I.name}let T=S;C.onMouseOver=L=>p(T,L),C.onMouseOut=L=>f(T,L),g.push(o("path",C))}return g},[m,r,i,s,a,l,c,p,f]),x=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},x,...y)}function vo(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 bu(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 xu(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=vo(t[i]),l=vo(t[i+1]);return bu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function yu(e){let{r:t,g:n,b:r}=vo(e);return(.299*t+.587*n+.114*r)/255}var Su=["#3b82f6","#fbbf24","#ef4444"];function Ws(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Su,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:m=1,title:c,padding:p=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:x,maxVal:g}=X(()=>{let k=l??1/0,w=d??-1/0;for(let D of t)for(let M of D)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]),b=c?30:0,S=n?p:20,I=r?p:20,A=i-S-20,C=s-b-I-20,T=y>0?A/y:0,L=f>0?C/f:0,R=v(()=>{let k=[];for(let w=0;w<f;w++){let D=t[w];for(let M=0;M<y;M++){let F=M<D.length?D[M]:0,P=(F-x)/(g-x),W=xu(P,a),_=S+M*T,O=b+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(_),y:String(O),width:String(T),height:String(L),fill:W,stroke:h,"stroke-width":String(m)})),u){let Y=yu(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(_+T/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,T*.3,L*.4)),"font-family":"sans-serif",fill:Y},String(Math.round(F*100)/100)))}}}return k},[t,f,y,x,g,a,T,L,S,b,u,h,m]),$=v(()=>{let k=[];if(n)for(let w=0;w<f;w++){let D=w<n.length?n[w]:"",M=b+20+w*L+L/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"},D))}if(r)for(let w=0;w<y;w++){let D=w<r.length?r[w]:"",M=S+w*T+T/2,F=b+20+f*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(M),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}return k},[n,r,f,y,T,L,S,b]),B=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 E=B(),N=R(),z=$();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"}},...E,...N,...z)}function vu(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 wu(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 wo(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function _s(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:h,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>vu(t,p),[t,p]),y=X(()=>{let E=0;for(let N=0;N<f.length;N++)f[N].count>E&&(E=f[N].count);return E>0?E:1},[f]),x=r-c*2,g=i-c*2,b=v(()=>{if(!l)return[];let E=wu(y),N=[];for(let z=E;z<=y;z+=E){let k=c+g-z/y*g;N.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+x),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return N},[l,y,c,x,g]),S=v(()=>{let E=[];return E.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+x),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,x,g]),I=v(()=>{if(f.length===0)return[];let E=[],N=a*(f.length-1),z=Math.max(1,(x-N)/f.length);for(let k=0;k<f.length;k++){let w=f[k],D=w.count/y*g,M=c+k*(z+a),F=c+g-D;if(E.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(F),width:String(z),height:String(D),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(M+z/2),y:String(F-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 W=(f.length===1,wo(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(M+z/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+x;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},wo(k.max)))}return E},[f,y,a,s,d,c,x,g]),A=v(()=>{let E=[];return u&&E.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)),h&&E.push(o("text",{key:"x-label",x:String(c+x/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),m&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),E},[u,h,m,r,i,c,x,g]),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]),T=b(),L=S(),R=I(),$=A(),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"}},...$,...T,...L,...R,...B)}function ku(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 Os(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:h=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,x=r-c*2-f,g=p?x:y,b=p?y:x,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]),I=X(()=>t.length===0?0:b/t.length,[t.length,b]),A=v(()=>{if(!u)return[];let k=ku(S),w=[];for(let D=k;D<=S;D+=k){let M=D/S*g;if(p){let F=c+x-M;w.push(o("line",{key:`grid-${D}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}else{let F=c+M;w.push(o("line",{key:`grid-${D}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+x),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(F),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}}return w},[u,S,p,c,y,x,g]),C=v(()=>{let k=[];return p?k.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"})):k.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"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+y),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,x]),T=v(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let D=t[w],M=D.value/S*g,F=I*w+I/2,P=D.color??d;if(p){let W=c+F,_=c+x,O=c+x-M;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(O),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value)));let Y=W,K=c+x+16;k.push(o("text",{key:`cat-${w}`,x:String(Y),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${K})`},D.label))}else{let W=c+F,_=c,O=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(O),cy:String(W),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},D.label))}}return k},[t,S,I,d,l,s,a,h,p,c,y,x,g]),L=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]),R=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]),$=A(),B=C(),E=T(),N=L(),z=R();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"}},...N,...$,...B,...E,...z)}function ko(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 Cu(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 Mu(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=ko(t[i]),l=ko(t[i+1]);return Cu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Eu(e){let{r:t,g:n,b:r}=ko(e);return(.299*t+.587*n+.114*r)/255}var Iu=["#f0f9ff","#3b82f6","#1e3a8a"];function Hs(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Iu,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,x=t.length,g=X(()=>{let P=0;for(let W of t)W.length>P&&(P=W.length);return P},[t]),b=X(()=>{if(!p||x===0)return t;let P=[],W=Math.max(x,g);for(let _=0;_<W;_++){let O=[];for(let Y=0;Y<W;Y++){let K=t[_],Q=K&&Y<K.length?K[Y]:0,q=t[Y],H=q&&_<q.length?q[_]:0;Q!==0?O.push(Q):O.push(H)}P.push(O)}return P},[t,p,x,g]),S=b.length,I=X(()=>{let P=0;for(let W of b)W.length>P&&(P=W.length);return P},[b]),{minVal:A,maxVal:C}=X(()=>{let P=1/0,W=-1/0;for(let _ of b)for(let O of _)O<P&&(P=O),O>W&&(W=O);return P===1/0&&(P=0),W===-1/0&&(W=1),P===W&&(W=P+1),{minVal:P,maxVal:W}},[b]),T=m?30:0,L=f?c:20,R=y?c:20,$=s-L-20,B=a-T-R-20,E=I>0?$/I:0,N=S>0?B/S:0,z=v(()=>{let P=[];for(let W=0;W<S;W++){let _=b[W];for(let O=0;O<I;O++){let Y=O<_.length?_[O]:0,K=(Y-A)/(C-A),Q=Mu(K,l),q=L+O*E,H=T+20+W*N,j=W===O,G=j&&u?"currentColor":h,V=j&&u?"2":"1";if(P.push(o("rect",{key:`cell-${W}-${O}`,x:String(q),y:String(H),width:String(E),height:String(N),fill:Q,stroke:G,"stroke-width":V})),d){let Z=Eu(Q)>.5?"#111827":"#ffffff",te=Math.min(12,E*.3,N*.35);P.push(o("text",{key:`val-${W}-${O}`,x:String(q+E/2),y:String(H+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,te)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(Y*100)/100)))}}}return P},[b,S,I,A,C,l,E,N,L,T,d,u,h]),k=v(()=>{let P=[];if(f)for(let W=0;W<S;W++){let _=W<f.length?f[W]:"",O=T+20+W*N+N/2;P.push(o("text",{key:`row-label-${W}`,x:String(L-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<I;W++){let _=W<y.length?y[W]:"",O=L+W*E+E/2,Y=T+20+S*N+12;P.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return P},[f,y,S,I,E,N,L,T]),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||I===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 D=w(),M=z(),F=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"}},...D,...M,...F)}var Ru=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function In(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 Pu(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 Tu(e,t,n,r,i,s,a){let l=[];if(In(e)<=0)return l;let h=Pu(e)+1,m=s==="horizontal",c=m?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:x,spanStart:g,spanEnd:b,colorIndex:S}=f,I=In(y);if(I<=0)continue;let A=b-g,C,T,L,R;if(m?(C=g,T=n+x*c,L=A,R=c):(C=t+x*c,T=g,L=c,R=A),l.push({x:C,y:T,w:L,h:R,label:y.label,value:I,color:y.color??a[S%a.length],depth:x}),y.children&&y.children.length>0){let $=g;for(let B=0;B<y.children.length;B++){let E=y.children[B],N=In(E);if(N<=0)continue;let z=N/I*A;p.push({node:E,depth:x+1,spanStart:$,spanEnd:$+z,colorIndex:x===0?B:S}),$+=z}}}return l}function Ys(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ru,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:m=10}=e,c=h?30:0,p=m,f=m+c,y=n-m*2,x=r-m*2-c;if(X(()=>In(t),[t])<=0||y<=0||x<=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??"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 b=X(()=>Tu(t,p,f,y,x,i,l),[t,p,f,y,x,i,l]),S=[];h&&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"},h));for(let I=0;I<b.length;I++){let A=b[I];if(S.push(o("rect",{key:`cell-${I}`,x:String(A.x),y:String(A.y),width:String(Math.max(0,A.w)),height:String(Math.max(0,A.h)),fill:A.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${A.label}: ${A.value}`})),s&&A.w>20&&A.h>14){let C=Math.floor(A.w/7),T=A.label.length>C?A.label.substring(0,Math.max(1,C-2))+"..":A.label;S.push(o("text",{key:`label-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},T))}a&&A.w>30&&A.h>28&&S.push(o("text",{key:`value-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(A.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":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function Co(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Vs(e,t){let n=new Set;for(let i of e)n.add(Co(i,t));let r=Array.from(n);return r.sort(),r}function Rn(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 Pn(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function $u(e,t,n,r,i){let s=Vs(e,t),a=Vs(e,n),l=new Map;for(let p of e){let f=Co(p,t),y=Co(p,n),x=`${f}::${y}`;l.has(x)||l.set(x,[]);let g=l.get(x),b=0;for(let S of r){let I=p[S];if(typeof I=="number")b+=I;else if(typeof I=="string"){let A=parseFloat(I);isNaN(A)||(b+=A)}}g.push(b)}let d=new Map;for(let[p,f]of l)d.set(p,Rn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let x=d.get(`${p}::${y}`);x!==void 0&&f.push(x)}u.set(p,Rn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let x=d.get(`${y}::${p}`);x!==void 0&&f.push(x)}h.set(p,Rn(f,i==="count"?"sum":i))}let m=[];for(let p of u.values())m.push(p);let c=Rn(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,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:h="#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(()=>$u(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:x,colTotals:g,grandTotal:b}=c,S=u?30:0,I=f.length+(d?1:0),A=p.length+(d?1:0),C=1+I,T=1+A,L=Math.max(40,(a-m*2)/C),R=Math.max(20,Math.min(36,(l-S-m*2)/T)),$=L*C,B=R*T,E=Math.max(0,(a-$)/2),N=S+Math.max(0,(l-S-B)/2),z=[];u&&z.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)),z.push(o("rect",{key:"header-row-bg",x:String(E),y:String(N),width:String($),height:String(R),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(N+R),width:String(L),height:String(R*A),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+L/2),y:String(N+R/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=E+(k+1)*L,D=Math.floor(L/7),M=f[k],F=M.length>D?M.substring(0,Math.max(1,D-2))+"..":M;z.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*L+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],D=N+(k+1)*R;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String(D),width:String(L*I),height:String(R),fill:"#f9fafb"}));let M=Math.floor(L/7),F=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let P=0;P<f.length;P++){let W=f[P],_=`${w}::${W}`,O=y.get(_),Y=E+(P+1)*L;z.push(o("rect",{key:`border-${k}-${P}`,x:String(Y),y:String(D),width:String(L),height:String(R),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${P}`,x:String(Y+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?Pn(O):"-"))}if(d){let P=E+(f.length+1)*L,W=x.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(P),y:String(D),width:String(L),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(P+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(W)))}}if(d){let k=N+(p.length+1)*R;z.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String($),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:"total-label",x:String(E+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let D=0;D<f.length;D++){let M=f[D],F=g.get(M)??0,P=E+(D+1)*L;z.push(o("text",{key:`ct-${D}`,x:String(P+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(F)))}let w=E+(f.length+1)*L;z.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Pn(b)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(N),width:String($),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"}},...z)}function Tn(e,t){return Math.PI*2*e/t-Math.PI/2}function $n(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function js(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:h="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=d&&n.length>0?30:0,y=60,x=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,b=y+p+x,S=X(()=>{let z=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){z.push(w);continue}let D=0;for(let M of n){let F=M.values[k];F!==void 0&&F>D&&(D=F)}z.push(D>0?D:1)}return z},[t,n,c]),I=v(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=x*k/s,D=[];for(let M=0;M<c;M++){let F=Tn(M,c),P=$n(g,b,w,F);D.push(`${P.x},${P.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:D.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Tn(k,c),D=$n(g,b,x,w);z.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(b),x2:String(D.x),y2:String(D.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,x,g,b,h]),A=v(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let D=Tn(w,c),M=$n(g,b,x+k,D),F="middle";M.x<g-5?F="end":M.x>g+5&&(F="start");let P=Math.abs(M.y-b)<5?"0.35em":M.y<b?"0em":"0.7em";z.push(o("text",{key:`label-${w}`,x:String(M.x),y:String(M.y),"text-anchor":F,dy:P,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,x,g,b]),C=v(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],D=[],M=[],F=[];for(let P=0;P<c;P++){let W=w.values[P]??0,_=S[P],O=Math.min(W/_,1),Y=x*O,K=Tn(P,c),Q=$n(g,b,Y,K);D.push(`${Q.x},${Q.y}`),u&&M.push(o("circle",{key:`dot-${k}-${P}`,cx:String(Q.x),cy:String(Q.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${k}-${P}`,x:String(Q.x),y:String(Q.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(W*100)/100)))}z.push(o("polygon",{key:`series-fill-${k}`,points:D.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:D.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let P of M)z.push(P);for(let P of F)z.push(P)}return z},[c,n,S,x,g,b,u,l]),T=v(()=>{if(!d||n.length===0)return[];let z=[],k=b+x+40,w=100,D=n.length*w,M=g-D/2;for(let F=0;F<n.length;F++){let P=n[F],W=M+F*w;z.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:P.color})),z.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},P.label))}return z},[d,n,g,b,x]),L=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 R=I(),$=A(),B=C(),E=T(),N=L();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"}},...N,...R,...$,...B,...E)}var Du=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function zu(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 h of u){let m=n.get(h),c=d+1;(m===void 0||c>m)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Au(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter($=>$.value>0),m=e.map($=>$.id),c=zu(m,h),p=new Map,f=new Map;for(let $ of m)p.set($,0),f.set($,0);for(let $ of h)f.set($.source,(f.get($.source)??0)+$.value),p.set($.target,(p.get($.target)??0)+$.value);let y=0;for(let $ of c.values())$>y&&(y=$);let x=new Map;for(let $=0;$<=y;$++)x.set($,[]);for(let[$,B]of c)x.get(B).push($);let g=new Map,b=y>0?(d-i)/y:0;for(let $=0;$<=y;$++)g.set($,a+$*b);let S=new Map;for(let $=0;$<e.length;$++)S.set(e[$].id,e[$]);let I=[],A=new Map;for(let $=0;$<=y;$++){let B=x.get($);if(B.length===0)continue;let E=0;for(let w of B){let D=p.get(w)??0,M=f.get(w)??0;E+=Math.max(D,M,1)}let N=u-s*(B.length-1),z=E>0?N/E:1,k=a;for(let w=0;w<B.length;w++){let D=B[w],M=S.get(D),F=p.get(D)??0,P=f.get(D)??0,W=Math.max(F,P,1),_=Math.max(4,W*z),O=e.findIndex(K=>K.id===D),Y={id:D,label:M.label,color:M.color??l[O%l.length],column:$,x:g.get($),y:k,height:_,totalIn:F,totalOut:P,totalValue:W};I.push(Y),A.set(D,Y),k+=_+s}}let C=new Map,T=new Map;for(let $ of m)C.set($,0),T.set($,0);let L=[...h].sort(($,B)=>B.value-$.value),R=[];for(let $ of L){let B=A.get($.source),E=A.get($.target);if(!B||!E)continue;let N=B.totalOut||1,z=E.totalIn||1,k=$.value/N*B.height,w=$.value/z*E.height,D=Math.max(1,(k+w)/2),M=C.get($.source),F=T.get($.target),P=B.y+M+k/2,W=E.y+F+w/2;C.set($.source,M+k),T.set($.target,F+w);let _=S.get($.source);R.push({source:$.source,target:$.target,value:$.value,color:$.color??_?.color??B.color,sourceY:P,targetY:W,width:D})}return{layoutNodes:I,layoutLinks:R}}function Gs(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:h=Du,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 p=X(()=>Au(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=v(()=>{let I=[];for(let A=0;A<p.layoutLinks.length;A++){let C=p.layoutLinks[A],T=p.layoutNodes.find(N=>N.id===C.source),L=p.layoutNodes.find(N=>N.id===C.target);if(!T||!L)continue;let R=T.x+s,$=L.x,B=(R+$)/2,E=`M ${R} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${$} ${C.targetY}`;I.push(o("path",{key:`link-${A}`,d:E,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&I.push(o("text",{key:`link-val-${A}`,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 I},[p,s,u,d]),y=v(()=>{let I=[];for(let A=0;A<p.layoutNodes.length;A++){let C=p.layoutNodes[A];if(I.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 T=p.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),L=C.column===T,R=L?C.x+s+6:C.x-6,$=L?"start":"end",B=C.column===0,E=B?C.x-6:R,N=B?"end":$;I.push(o("text",{key:`label-${C.id}`,x:String(E),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 I},[p,s,l]),x=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]),g=f(),b=y(),S=x();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,...g,...b)}var Lu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Mo=2*Math.PI;function Ot(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 Bu(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 Fu(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,h=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),x=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=Mo-.001){let b=d+Math.PI,S=e+r*Math.cos(b),I=t+r*Math.sin(b),A=e+n*Math.cos(b),C=t+n*Math.sin(b);return[`M ${h} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${I}`,`A ${r} ${r} 0 1 1 ${h} ${m}`,`L ${x} ${g}`,`A ${n} ${n} 0 1 0 ${A} ${C}`,`A ${n} ${n} 0 1 0 ${x} ${g}`,"Z"].join(" ")}return[`M ${h} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${x} ${g}`,"Z"].join(" ")}function Nu(e,t,n,r){let i=[],s=Ot(e);if(s<=0)return i;let a=Bu(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let m=e.children[h],c=Ot(m);if(c<=0)continue;let p=c/s*Mo;d.push({node:m,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:Mo,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:h,startAngle:m,endAngle:c,depth:p,colorIndex:f}=u,y=Ot(h);if(y<=0)continue;let x=t+p*l,g=x+l;if(i.push({startAngle:m,endAngle:c,innerR:x,outerR:g,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let b=m,S=c-m;for(let I=0;I<h.children.length;I++){let A=h.children[I],C=Ot(A);if(C<=0)continue;let T=C/y*S;d.push({node:A,startAngle:b,endAngle:b+T,depth:p+1,colorIndex:f}),b+=T}}}return i}function Xs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Lu,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,m=r/2,c=u?20:0,p=Math.min(h,m-c)-10;if(X(()=>Ot(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(h),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>Nu(t,i,p,a),[t,i,p,a]),x=[];u&&x.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let g=m+c/2;for(let b=0;b<y.length;b++){let S=y[b],I=Fu(h,g,S.innerR,S.outerR,S.startAngle,S.endAngle);if(x.push(o("path",{key:`arc-${b}`,d:I,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let A=S.endAngle-S.startAngle,C=S.startAngle+A/2-Math.PI/2,T=(S.innerR+S.outerR)/2,L=S.outerR-S.innerR,R=A*T;if(R>20&&L>14){let $=h+T*Math.cos(C),B=g+T*Math.sin(C),E=Math.floor(Math.min(R,L)/7),N=S.label.length>E?S.label.substring(0,Math.max(1,E-1))+"..":S.label;x.push(o("text",{key:`label-${b}`,x:String($),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"}},...x)}var Wu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dn(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 Ks(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 _u(e,t,n,r,i,s){let a=[],l=[],d=Dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,m=[];for(let c=0;c<u.length;c++){let p=u[c],f=Dn(p);f<=0||m.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.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:p,rect:f,depth:y}=c;if(p.length===0)continue;let x={...f},g=0;for(;g<p.length&&x.w>0&&x.h>0;){let b=x.w>=x.h,S=b?x.h:x.w,I=[],A=[];I.push(p[g]),A.push(p[g].area),g++;let C=Ks(A,S);for(;g<p.length;){let $=[...A,p[g].area],B=Ks($,S);if(B>C)break;I.push(p[g]),A.push(p[g].area),C=B,g++}let T=0;for(let $ of A)T+=$;let L=S>0?T/S:0,R=0;for(let $=0;$<I.length;$++){let B=I[$],E=L>0?B.area/L:0,N,z,k,w;if(b?(N=x.x,z=x.y+R,k=L,w=E):(N=x.x+R,z=x.y,k=E,w=L),a.push({x:N,y:z,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let M=N+2,F=z+2+14,P=k-4,W=w-4-14;if(P>4&&W>4){let _=[],O=B.value,Y=P*W;for(let K=0;K<B.node.children.length;K++){let Q=B.node.children[K],q=Dn(Q);q<=0||_.push({label:Q.label,value:q,area:q/O*Y,color:Q.color??s[(K+y+1)%s.length],node:Q})}_.sort((K,Q)=>Q.area-K.area),l.push({nodes:_,rect:{x:M,y:F,w:P,h:W},depth:y+1})}}R+=E}b?x={x:x.x+L,y:x.y,w:x.w-L,h:x.h}:x={x:x.x,y:x.y+L,w:x.w,h:x.h-L}}}return a}function qs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Wu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,m=h?30:0,c=u,p=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>Dn(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":h??"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 g=X(()=>_u(t,c,p,f,y,a),[t,c,p,f,y,a]),b=[];h&&b.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"},h));for(let S=0;S<g.length;S++){let I=g[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(I.x),y:String(I.y),width:String(Math.max(0,I.w)),height:String(Math.max(0,I.h)),fill:I.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${I.label}: ${I.value}`})),i&&I.w>20&&I.h>14){let A=Math.floor(I.w/7),C=I.label.length>A?I.label.substring(0,Math.max(1,A-2))+"..":I.label;b.push(o("text",{key:`label-${S}`,x:String(I.x+4),y:String(I.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&I.w>30&&I.h>28&&b.push(o("text",{key:`value-${S}`,x:String(I.x+4),y:String(I.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(I.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":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Zs(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 Ou(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 Js(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=Zs(t[s]),u=Zs(t[a]);return Ou(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function zn(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 Hu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),m=d/(h-1),c=u/(h-1);if(n){let f=[];for(let b=0;b<h;b++)for(let S=0;S<h;S++)f.push({x:i+S*m,y:a+b*c});let x=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let b=0;b<f.length;b++){let S=f[b],I=x[b]??{dx:0,dy:0},A=Math.sqrt(I.dx*I.dx+I.dy*I.dy);g.push({x:S.x,y:S.y,dx:I.dx,dy:I.dy,magnitude:A})}return g}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let x=i+y*m,g=a+f*c,b=t(x,g),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);p.push({x,y:g,dx:b.dx,dy:b.dy,magnitude:S})}return p}function Yu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:x,colorScale:g,arrowColor:b,arrowWidth:S,effectiveArrowScale:I,maxMagnitude:A,title:C,tickFontSize:T}=i,L=B=>s+(B-d)/c*a,R=B=>s+(m-B)/p*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=`${T}px sans-serif`,e.fillStyle="#6b7280";let B=zn(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){let w=L(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 N=zn(p,10),z=Math.ceil(h/N)*N;for(let k=z;k<=m;k+=N){let w=R(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,h<=0&&m>=0){let B=R(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(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 $=4;for(let B=0;B<r.length;B++){let E=r[B],N=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(N<1e-10)continue;let z=L(E.x),k=R(E.y),w=E.dx*I,D=-E.dy*I,M=z+w,F=k+D,P;if(x){let _=N/A;P=Js(_,g)}else P=b;e.save(),e.strokeStyle=P,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(M,F),e.stroke();let W=Math.sqrt(w*w+D*D);if(W>2){let _=w/W,O=D/W,Y=-O,K=_,Q=Math.min($,W*.4),q=M-_*Q+Y*Q*.5,H=F-O*Q+K*Q*.5,j=M-_*Q-Y*Q*.5,G=F-O*Q-K*Q*.5;e.fillStyle=P,e.beginPath(),e.moveTo(M,F),e.lineTo(q,H),e.lineTo(j,G),e.closePath(),e.fill()}e.restore()}}function Qs(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:h=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:x=10,arrowWidth:g=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:I}=e,A=Math.max(2,Math.min(50,s)),C=r-y*2,T=i-y*2,L=a[0],R=a[1],$=l[0],B=l[1],E=R-L,N=B-$,z=X(()=>q=>y+(q-L)/E*C,[y,L,E,C]),k=X(()=>q=>y+(B-q)/N*T,[y,B,N,T]),w=X(()=>Hu(t,n,I,A,L,R,$,B,E,N),[t,n,I,A,L,R,$,B,E,N]),D=X(()=>{let q=0;for(let H=0;H<w.length;H++){let j=w[H],G=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);G>q&&(q=G)}return q>0?q:1},[w]),M=X(()=>Math.min(C,T)/Math.max(A,2)/(2*D)*d,[C,T,A,D,d]);if(b==="canvas"){let q=ne(null),H=ne(0);return re(()=>{let j=q.current;if(!j)return;let G=j.getContext("2d");if(G)return H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame(()=>{Yu(G,r,i,w,{padding:y,chartWidth:C,chartHeight:T,xMin:L,xMax:R,yMin:$,yMax:B,xSpan:E,ySpan:N,showGrid:h,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:g,effectiveArrowScale:M,maxMagnitude:D,title:f,tickFontSize:x})}),()=>{H.current&&cancelAnimationFrame(H.current)}},[w,r,i,y,C,T,L,R,$,B,E,N,h,m,c,p,u,g,M,D,f,x]),o("canvas",{ref:q,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=v(()=>{if(!h)return[];let q=[],H=zn(E,10),j=Math.ceil(L/H)*H;for(let Z=j;Z<=R;Z+=H){let te=z(Z);q.push(o("line",{key:`gridv-${Z}`,x1:String(te),y1:String(y),x2:String(te),y2:String(y+T),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`xtick-${Z}`,x:String(te),y:String(y+T+16),"text-anchor":"middle","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let G=zn(N,10),V=Math.ceil($/G)*G;for(let Z=V;Z<=B;Z+=G){let te=k(Z);q.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(te),x2:String(y+C),y2:String(te),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(te+4),"text-anchor":"end","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return q},[h,L,R,$,B,E,N,z,k,y,C,T]),P=v(()=>{if(!m)return[];let q=[];if($<=0&&B>=0){let H=k(0);q.push(o("line",{key:"axis-x",x1:String(y),y1:String(H),x2:String(y+C),y2:String(H),stroke:"#374151","stroke-width":String(g)}))}if(L<=0&&R>=0){let H=z(0);q.push(o("line",{key:"axis-y",x1:String(H),y1:String(y),x2:String(H),y2:String(y+T),stroke:"#374151","stroke-width":String(g)}))}return q.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(T),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),q},[m,L,R,$,B,z,k,y,C,T]),W=v(()=>{let q=[];for(let j=0;j<w.length;j++){let G=w[j],V=G.magnitude??Math.sqrt(G.dx*G.dx+G.dy*G.dy);if(V<1e-10)continue;let Z=z(G.x),te=k(G.y),ae=G.dx*M,J=-G.dy*M,ie=Z+ae,le=te+J,fe;if(c){let ge=V/D;fe=Js(ge,p)}else fe=u;q.push(o("line",{key:`arrow-line-${j}`,x1:String(Z),y1:String(te),x2:String(ie),y2:String(le),stroke:fe,"stroke-width":String(g),"stroke-linecap":"round"}));let oe=Math.sqrt(ae*ae+J*J);if(oe>2){let ge=ae/oe,he=J/oe,ee=-he,de=ge,me=Math.min(4,oe*.4),xe=ie-ge*me+ee*me*.5,ye=le-he*me+de*me*.5,Me=ie-ge*me-ee*me*.5,ce=le-he*me-de*me*.5;q.push(o("polygon",{key:`arrow-head-${j}`,points:`${ie},${le} ${xe},${ye} ${Me},${ce}`,fill:fe}))}}return q},[w,z,k,M,c,D,p,u]),_=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]),O=F(),Y=P(),K=W(),Q=_();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"}},...Q,...O,...Y,...K)}function Vu(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 Uu(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 ea(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:h=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>Vu(t),[t]),{minVal:x,maxVal:g}=X(()=>{let D=0,M=0;for(let F=0;F<y.length;F++){let P=y[F];P.start<D&&(D=P.start),P.end<D&&(D=P.end),P.start>M&&(M=P.start),P.end>M&&(M=P.end)}return D===M&&(M=D+1),{minVal:D,maxVal:M}},[y]),b=g-x,S=v(D=>c+f-(D-x)/b*f,[c,f,x,b]),I=X(()=>y.length===0?0:p/y.length,[y.length,p]),A=6,C=Math.max(1,I-A),T=v(()=>{if(!u)return[];let D=Uu(b),M=[],F=Math.ceil(x/D)*D;for(let P=F;P<=g;P+=D){let W=S(P);M.push(o("line",{key:`grid-${P}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${P}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(P)))}return M},[u,b,x,g,S,c,p]),L=v(()=>{let D=[];D.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=x<=0&&g>=0?S(0):c+f;return D.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+p),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),D},[c,p,f,x,g,S]),R=v(()=>{if(y.length===0)return[];let D=[];for(let M=0;M<y.length;M++){let F=y[M],P=c+M*I+A/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=S(W),Y=S(_),K=Math.max(0,Y-O),Q;if(F.type==="total"?Q=a:F.type==="decrease"?Q=s:Q=i,D.push(o("rect",{key:`bar-${M}`,x:String(P),y:String(O),width:String(C),height:String(K),fill:Q,rx:"2",ry:"2"})),d){let q=F.type==="decrease"||F.value<0?Y+14:O-4,H=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);D.push(o("text",{key:`val-${M}`,x:String(P+C/2),y:String(q),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},H))}if(D.push(o("text",{key:`cat-${M}`,x:String(P+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),h&&M<y.length-1){let q=y[M+1],H=S(F.end),j=c+(M+1)*I+A/2;q.type!=="total"&&D.push(o("line",{key:`conn-${M}`,x1:String(P+C),y1:String(H),x2:String(j),y2:String(H),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return D},[y,I,C,S,i,s,a,l,d,h,c,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]),B=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]),E=T(),N=L(),z=R(),k=$(),w=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":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z,...w)}var ju=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gu=[0,-45,45,90];function Xu(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)),h=Math.abs(Math.sin(d)),m=a*u+l*h,c=a*h+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function Ku(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 qu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Zu(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 ta(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=ju,rotations:d=Gu,padding:u=4,spiral:h="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,T)=>({...C,originalIndex:T})).filter(C=>C.text.length>0&&C.weight>0).sort((C,T)=>T.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function b(C){if(g===0)return(i+s)/2;let T=(C-y)/g;return i+T*(s-i)}let S=[],I=n/2,A=r/2;for(let C=0;C<f.length;C++){let T=f[C],L=b(T.weight),R=d[Zu(T.text)%d.length],$=T.color??l[C%l.length],B=!1,E=500,N=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let _=z*.1,O=N*_;k=O*Math.cos(_),w=O*Math.sin(_)}else{let _=Math.floor(z/4)+1,O=z%4,Y=(z%4===0?0:z)*N;switch(O){case 0:k=_*N*4,w=Y;break;case 1:k=-Y,w=_*N*4;break;case 2:k=-_*N*4,w=-Y;break;default:k=Y,w=-_*N*4;break}}let D=I+k,M=A+w,F=Xu(T.text,L,R,D,M),P={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!qu(P,n,r))continue;let W=!1;for(let _ of S)if(Ku(P,_.bbox)){W=!0;break}if(!W){S.push({text:T.text,x:D,y:M,fontSize:L,rotation:R,color:$,bbox:P}),B=!0;break}}}return S},[t,n,r,i,s,l,d,u,h]);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 p=[];m&&p.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],x=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:x,"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}},...p)}var Ju={0:"#1e293b",1:"#3b82f6"},Qu="#666";function na(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:h="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??Ju,x=t.length,g=X(()=>{let D=0;for(let M=0;M<t.length;M++){let F=t[M];F!==void 0&&F.length>D&&(D=F.length)}return D},[t]),b=u?20:0,S=f?24:0,I=X(()=>{let D=r-m*2-b,M=i-m*2-b-S;if(x===0||g===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(D-s*(g-1))/g),P=Math.max(0,(M-s*(x-1))/x);return{cellWidth:F,cellHeight:P}},[r,i,m,x,g,s,b,S]),A=v(D=>{let M=y[D];return M!==void 0?M:Qu},[y]),C=v(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),T=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]),L=v(()=>{if(!l||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=g*D+(g-1)*s,_=x*M+(x-1)*s,O=[];for(let Y=0;Y<=g;Y++){let K=F+Y*(D+s)-s/2;O.push(o("line",{key:`vgrid-${Y}`,x1:String(K),y1:String(P-s/2),x2:String(K),y2:String(P+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let Y=0;Y<=x;Y++){let K=P+Y*(M+s)-s/2;O.push(o("line",{key:`hgrid-${Y}`,x1:String(F-s/2),y1:String(K),x2:String(F+W+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return O},[l,x,g,I,m,b,S,s,d]),R=v(()=>{if(!u||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<g;_++){let O=F+_*(D+s)+D/2,Y=P-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<x;_++){let O=F-6,Y=P+_*(M+s)+M/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,x,g,I,m,b,S,s]),$=v(()=>{if(x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<x;_++){let O=t[_];if(O!==void 0)for(let Y=0;Y<g;Y++){let K=Y<O.length?O[Y]:0,Q=F+Y*(D+s),q=P+_*(M+s),H=A(K),j={key:`cell-${_}-${Y}`,x:String(Q),y:String(q),width:String(D),height:String(M),fill:H,rx:String(a),ry:String(a)};if(c){let G=_,V=Y,Z=K;j.onClick=()=>c(G,V,Z),j.role="button",j.tabIndex=0}if(p){let G=_,V=Y,Z=K;j.onMouseEnter=()=>p(G,V,Z)}W.push(o("rect",j))}}return W},[x,g,t,I,m,b,S,s,a,A,c,p]),B=C(),E=T(),N=L(),z=R(),k=$(),w=f?`${f} \u2014 ${x}x${g} discrete grid`:`${x}x${g} 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},B,...E,...N,...z,...k)}
|
|
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(Ol,{key:l.id,item:l,onDismiss:s}));return o("div",{style:i},...a)}function Qr(e={}){let t=ne(null);t.current||(t.current=On(e));let n=t.current,r=v(()=>o(Hn,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var Hl=6,Yl=8;function Vl(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=Yl;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=`${Hl}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 ei(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[a,l]=U(!1),[d,u]=U(null),h=ne(null),m=ne(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,p=v(()=>{m.current=setTimeout(()=>{if(h.current){let b=h.current.getBoundingClientRect();u(Vl(b,n))}l(!0)},r)},[r,n]),f=v(()=>{m.current&&(clearTimeout(m.current),m.current=null),l(!1)},[]);re(()=>()=>{m.current&&clearTimeout(m.current)},[]);let y={display:"inline-block"},x={...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"},g=[o("div",{ref:h,style:y,onMouseEnter:p,onMouseLeave:f,onFocus:p,onBlur:f,"aria-describedby":a?c:void 0},s)];return a&&d&&g.push(o("div",{id:c,style:x,role:"tooltip"},t,o("div",{style:Ul(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...g)}function Yn(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 jl(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 Gl(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 Xl(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 ti=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ni(e,t){return t||ti[e%ti.length]}function oi(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:h="#e5e7eb",title:m,padding:c=50,animate:p=!1,stacked:f,grouped:y=!1}=e,x=i==="vertical",g=n-c*2,b=r-c*2,S=x?b:g,I=x?g:b,A=f!==void 0&&f.length>0,C=X(()=>A?Xl(f):[],[A,f]),T=A?f.length:t.length,L=X(()=>jl(t,f,y),[t,f,y]),R=L>0?L:1,$=Yn(T,R,S,I,a),B=v(()=>{if(!u)return[];let O=Gl(R),Y=[];for(let K=O;K<=R;K+=O){let Q=$.valueScale(K);if(x){let q=c+b-Q;Y.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(q),x2:String(c+g),y2:String(q),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(q+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let q=c+Q;Y.push(o("line",{key:`grid-${K}`,x1:String(q),y1:String(c),x2:String(q),y2:String(c+b),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),Y.push(o("text",{key:`grid-label-${K}`,x:String(q),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return Y},[u,R,$,x,c,g,b,h]),E=v(()=>{let O=[];return x?(O.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"})),O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(O.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+g),y2:String(c+b),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+b),stroke:"#374151","stroke-width":"1.5"}))),O},[x,c,g,b]),N=v(()=>{let O=[];for(let Y=0;Y<t.length;Y++){let K=t[Y],Q=$.valueScale(K.value),q=$.categoryScale(Y),H=K.color??s,j,G,V=String(K.value);if(x){let Z=c+q,te=c+b-Q;j={x:String(Z),y:String(te),width:String($.barThickness),height:String(Q),rx:String(l),ry:String(l),fill:H},G={x:String(Z+$.barThickness/2),y:String(te-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+q,te=c;j={x:String(te),y:String(Z),width:String(Q),height:String($.barThickness),rx:String(l),ry:String(l),fill:H},G={x:String(te+Q+6),y:String(Z+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(p&&(j.style=x?`animation: barGrow 0.6s ease-out ${Y*.05}s both`:`animation: barGrow 0.6s ease-out ${Y*.05}s both`),O.push(o("rect",{key:`bar-${Y}`,...j})),d&&O.push(o("text",{key:`val-${Y}`,...G},V)),x){let Z=c+q+$.barThickness/2,te=c+b+16;O.push(o("text",{key:`cat-${Y}`,x:String(Z),y:String(te),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${te})`},K.label))}else O.push(o("text",{key:`cat-${Y}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[t,$,s,l,d,p,x,c,b]),z=v(()=>{if(!f)return[];let O=[];for(let Y=0;Y<f.length;Y++){let K=f[Y],Q=$.categoryScale(Y),q=0;for(let H=0;H<K.values.length;H++){let j=K.values[H],G=$.valueScale(j.value),V=$.valueScale(q),Z=ni(H,j.color);if(x){let te=c+Q,ae=c+b-V-G;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String($.barThickness),height:String(G),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>14&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+$.barThickness/2),y:String(ae+G/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}else{let te=c+V,ae=c+Q;O.push(o("rect",{key:`sbar-${Y}-${H}`,x:String(te),y:String(ae),width:String(G),height:String($.barThickness),rx:H===K.values.length-1?String(l):"0",ry:H===K.values.length-1?String(l):"0",fill:Z,...p?{style:`animation: barGrow 0.6s ease-out ${(Y*K.values.length+H)*.03}s both`}:{}})),d&&G>20&&O.push(o("text",{key:`sval-${Y}-${H}`,x:String(te+G/2),y:String(ae+$.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(j.value)))}q+=j.value}if(d){let H=$.valueScale(q);x?O.push(o("text",{key:`stotal-${Y}`,x:String(c+Q+$.barThickness/2),y:String(c+b-H-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q))):O.push(o("text",{key:`stotal-${Y}`,x:String(c+H+6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(q)))}if(x){let H=c+Q+$.barThickness/2,j=c+b+16;O.push(o("text",{key:`scat-${Y}`,x:String(H),y:String(j),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${H}, ${j})`},K.label))}else O.push(o("text",{key:`scat-${Y}`,x:String(c-6),y:String(c+Q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return O},[f,$,l,d,p,x,c,b]),k=v(()=>{if(!f)return[];let O=C.length,Y=[];for(let K=0;K<f.length;K++){let Q=f[K],q=$.categoryScale(K),H=2,j=Math.max(1,($.barThickness-H*(O-1))/O);for(let G=0;G<Q.values.length;G++){let V=Q.values[G],Z=C.indexOf(V.category),te=Z*(j+H),ae=$.valueScale(V.value),J=ni(Z>=0?Z:G,V.color);if(x){let ie=c+q+te,le=c+b-ae;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(j),height:String(ae),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+j/2),y:String(le-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}else{let ie=c,le=c+q+te;Y.push(o("rect",{key:`gbar-${K}-${G}`,x:String(ie),y:String(le),width:String(ae),height:String(j),rx:String(l),ry:String(l),fill:J,...p?{style:`animation: barGrow 0.6s ease-out ${(K*O+G)*.04}s both`}:{}})),d&&Y.push(o("text",{key:`gval-${K}-${G}`,x:String(ie+ae+4),y:String(le+j/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(V.value)))}}if(x){let G=c+q+$.barThickness/2,V=c+b+16;Y.push(o("text",{key:`gcat-${K}`,x:String(G),y:String(V),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${V})`},Q.label))}else Y.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+q+$.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},Q.label))}return Y},[f,C,$,l,d,p,x,c,b]),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]),D=v(()=>p?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},x?"@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; } }"))]:[],[p,x]),M=B(),F=E(),P=w(),W=D(),_;return A&&y?_=k():A?_=z():_=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,...P,...M,...F,..._)}function yt(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 qt(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 h=t[u],m=e(h);isFinite(m)&&a.push({input:h,output:m})}if(s=d,s>=t.length){r(a,!0);return}r(a,!1),ri(l)};return ri(l),()=>{i=!0}}function ri(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Kl(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 ii(e,t){let n=t-e;if(n<=0)return[e];let r=Kl(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 si(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var Te=40,ai=1.1,li=.01,ci=1e6;function di(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:h=!0,showAxes:m=!0,pointRadius:c=3,pointColor:p="#3b82f6",curveColor:f="#3b82f6",gridColor:y="#e2e8f0",axisColor:x="#94a3b8",onPointClick:g,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:I}=e,[A,C]=U(d[0]),[T,L]=U(d[1]),[R,$]=U(u[0]),[B,E]=U(u[1]),N=ne(!1),z=ne(null),k=v(V=>Te+(V-A)/(T-A)*(t-2*Te),[A,T,t]),w=v(V=>n-Te-(V-R)/(B-R)*(n-2*Te),[R,B,n]),D=v(V=>A+(V-Te)/(t-2*Te)*(T-A),[A,T,t]),M=v(V=>R+(n-Te-V)/(n-2*Te)*(B-R),[R,B,n]),F=v(V=>{let Z=V;N.current=!0,z.current={mx:Z.clientX,my:Z.clientY,x0:A,x1:T,y0:R,y1:B}},[A,T,R,B]),P=v(V=>{if(!N.current||!z.current)return;let Z=V,te=z.current,ae=Z.clientX-te.mx,J=Z.clientY-te.my,ie=ae/(t-2*Te)*(te.x1-te.x0),le=J/(n-2*Te)*(te.y1-te.y0);C(te.x0-ie),L(te.x1-ie),$(te.y0+le),E(te.y1+le)},[t,n]),W=v(()=>{N.current=!1,z.current=null},[]),_=v(V=>{let Z=V;Z.preventDefault();let te=Z.currentTarget.getBoundingClientRect(),ae=Z.clientX-te.left,J=Z.clientY-te.top,ie=D(ae),le=M(J),fe=Z.deltaY>0?ai:1/ai,oe=(T-A)*fe,ge=(B-R)*fe;if(oe<li||ge<li||oe>ci||ge>ci)return;let he=(ie-A)/(T-A),ee=(le-R)/(B-R);C(ie-he*oe),L(ie+(1-he)*oe),$(le-ee*ge),E(le+(1-ee)*ge)},[A,T,R,B,D,M]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let V=ii(A,T),Z=ii(R,B);for(let te=0;te<V.length;te++){let ae=k(V[te]);O.push(o("line",{x1:ae,y1:Te,x2:ae,y2:n-Te,stroke:y,"stroke-width":.5,key:`gx-${te}`})),O.push(o("text",{x:ae,y:n-Te+14,"text-anchor":"end","font-size":10,fill:x,transform:`rotate(-45, ${ae}, ${n-Te+14})`,key:`lx-${te}`},si(V[te])))}for(let te=0;te<Z.length;te++){let ae=w(Z[te]);O.push(o("line",{x1:Te,y1:ae,x2:t-Te,y2:ae,stroke:y,"stroke-width":.5,key:`gy-${te}`})),O.push(o("text",{x:Te-6,y:ae+3,"text-anchor":"end","font-size":10,fill:x,key:`ly-${te}`},si(Z[te])))}}if(m){let V=Math.max(Te,Math.min(t-Te,k(0))),Z=Math.max(Te,Math.min(n-Te,w(0)));O.push(o("line",{x1:Te,y1:Z,x2:t-Te,y2:Z,stroke:x,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:V,y1:Te,x2:V,y2:n-Te,stroke:x,"stroke-width":1,key:"y-axis"}))}let Y=X(()=>{if(!i||!l)return[];let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return qt(i,Z)},[i,A,T,a,s,l]),[K,Q]=U([]),q=ne(null);re(()=>{if(!i||l){Q([]);return}let V=a??(T-A)/s,Z=yt({start:A,end:T,step:V});return q.current&&q.current(),q.current=Zt(i,Z,200,te=>{Q([...te])}),()=>{q.current&&q.current()}},[i,A,T,a,s,l]);let H=l?Y:K;if(H.length>0){let V=[];for(let Z=0;Z<H.length;Z++){let te=H[Z],ae=k(te.input),J=w(te.output);V.push(`${V.length===0?"M":"L"}${ae},${J}`)}O.push(o("path",{d:V.join(" "),fill:"none",stroke:f,"stroke-width":1.5,key:"curve"}))}let j=(V,Z,te,ae)=>{if(Z)return J=>Z({x:ae.x,y:ae.y,index:te,event:J})};for(let V=0;V<r.length;V++){let Z=r[V],te=k(Z.x),ae=w(Z.y),J={cx:te,cy:ae,r:c,fill:p,cursor:"pointer",key:`pt-${V}`};g&&(J.onClick=j("click",g,V,Z)),b&&(J.onDblClick=j("dblclick",b,V,Z)),S&&(J.onContextMenu=j("contextmenu",S,V,Z)),I&&(J.onMouseOver=j("mouseover",I,V,Z)),O.push(o("circle",J))}let G=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:Te,y:Te,width:t-2*Te,height:n-2*Te})));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:P,onMouseUp:W,onMouseLeave:W,onWheel:_},G,...O)}function pi(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 ui(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,h=0,m=0,c=0;return i<60?(h=l,m=d):i<120?(h=d,m=l):i<180?(m=l,c=d):i<240?(m=d,c=l):i<300?(h=d,c=l):(h=l,c=d),[Math.floor((h+u)*255),Math.floor((m+u)*255),Math.floor((c+u)*255)]}function fi(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=pi){let a=[];for(let l=0;l<t;l++){let d=[],u=r[1]-l/t*(r[1]-r[0]);for(let h=0;h<e;h++){let m=n[0]+h/e*(n[1]-n[0]);d.push(s(m,u,i))}a.push(d)}return a}function mi(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=pi,data:d,resolution:u=2,onPointClick:h,onPointHover:m,onPointDoubleClick:c,onPointContextMenu:p}=e;if(d){let M=d.length,F=M>0?d[0].length:0,P=F>0?t/F:1,W=M>0?n/M:1,_=[];for(let O=0;O<M;O++){let Y=d[O];for(let K=0;K<F;K++){let Q=Y[K]??0,[q,H,j]=ui(Q,s,a);_.push(o("rect",{key:`${O}-${K}`,x:String(K*P),y:String(O*W),width:String(Math.ceil(P)),height:String(Math.ceil(W)),fill:`rgb(${q},${H},${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[f,y]=U(r[0]),[x,g]=U(r[1]),[b,S]=U(i[0]),[I,A]=U(i[1]),C=ne(null),T=ne(!1),L=ne(null),R=v((M,F)=>{let P=f+M/t*(x-f),W=I-F/n*(I-b);return{re:P,im:W}},[f,x,b,I,t,n]);re(()=>{let M=C.current;if(!M)return;let F=M.getContext("2d");if(!F)return;let P=F.createImageData(t,n),W=P.data;for(let _=0;_<n;_++)for(let O=0;O<t;O++){let{re:Y,im:K}=R(O,_),Q=l(Y,K,s),[q,H,j]=ui(Q,s,a),G=(_*t+O)*4;W[G]=q,W[G+1]=H,W[G+2]=j,W[G+3]=255}F.putImageData(P,0,0)},[f,x,b,I,t,n,s,a,l,R]);let $=v(M=>{let F=M.target.getBoundingClientRect(),P=M.clientX-F.left,W=M.clientY-F.top,{re:_,im:O}=R(P,W),Y=l(_,O,s);return{re:_,im:O,iterations:Y,event:M}},[R,l,s]),B=v(M=>{T.current=!0,L.current={x:M.clientX,y:M.clientY,rMin:f,rMax:x,iMin:b,iMax:I}},[f,x,b,I]),E=v(M=>{if(m&&m($(M)),!T.current||!L.current)return;let F=L.current,P=M.clientX-F.x,W=M.clientY-F.y,_=(F.rMax-F.rMin)/t,O=(F.iMax-F.iMin)/n;y(F.rMin-P*_),g(F.rMax-P*_),S(F.iMin+W*O),A(F.iMax+W*O)},[t,n,m,$]),N=v(()=>{T.current=!1},[]),z=v(M=>{M.preventDefault();let F=M.deltaY>0?1.15:1/1.15,P=M.target.getBoundingClientRect(),W=M.clientX-P.left,_=M.clientY-P.top,{re:O,im:Y}=R(W,_);y(O+(f-O)*F),g(O+(x-O)*F),S(Y+(b-Y)*F),A(Y+(I-Y)*F)},[R,f,x,b,I]),k=v(M=>{h&&h($(M))},[h,$]),w=v(M=>{c&&c($(M))},[c,$]),D=v(M=>{M.preventDefault(),p&&p($(M))},[p,$]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N,onWheel:z,onClick:k,onDblClick:w,onContextMenu:D})}function gi(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 ql(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,h=y=>r+(y-i)/(s-i)*d,m=y=>n-r-(y-a)/(l-a)*u,c=6,p=gi(i,s,c),f=gi(a,l,c);return{xScale:h,yScale:m,xTicks:p,yTicks:f,xMin:i,xMax:s,yMin:a,yMax:l}}function Vn(e,t,n,r){return X(()=>ql(e,t,n,r),[e,t,n,r])}function hi(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function bi(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 xi(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:h=!0,showArea:m=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:p,yLabel:f,title:y,padding:x=50,animate:g=!1,multiLine:b}=e,S=X(()=>{let B=[...t];if(b)for(let E of b)B.push(...E.data);return B},[t,b]),I=Vn(S,n,r,x),{xScale:A,yScale:C,xTicks:T,yTicks:L}=I,R=[];if(R.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:x,x2:E,y2:r-x,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${B}`}))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x,y1:E,x2:n-x,y2:E,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${B}`}))}}R.push(o("line",{x1:x,y1:r-x,x2:n-x,y2:r-x,stroke:"#374151","stroke-width":1,key:"x-axis"})),R.push(o("line",{x1:x,y1:x,x2:x,y2:r-x,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let B=0;B<T.length;B++){let E=A(T[B]);R.push(o("line",{x1:E,y1:r-x,x2:E,y2:r-x+5,stroke:"#374151",key:`xtick-${B}`})),R.push(o("text",{x:E,y:r-x+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${E}, ${r-x+18})`,key:`xlabel-${B}`},hi(T[B])))}for(let B=0;B<L.length;B++){let E=C(L[B]);R.push(o("line",{x1:x-5,y1:E,x2:x,y2:E,stroke:"#374151",key:`ytick-${B}`})),R.push(o("text",{x:x-10,y:E+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${B}`},hi(L[B])))}function $(B,E,N,z,k,w,D,M,F,P){if(B.length===0)return;let W=[...B].sort((Y,K)=>Y.x-K.x);if(z){let Y=C(I.yMin),K=W.map(j=>`${A(j.x)},${C(j.y)}`).join(" "),Q=A(W[0].x),q=A(W[W.length-1].x),H=`${Q},${Y} ${K} ${q},${Y}`;R.push(o("polygon",{points:H,fill:k,key:`${P}-area`}))}let O={points:W.map(Y=>`${A(Y.x)},${C(Y.y)}`).join(" "),fill:"none",stroke:E,"stroke-width":N,"stroke-linejoin":"round","stroke-linecap":"round",key:`${P}-line`};if(g?(O["stroke-dasharray"]="1000",O["stroke-dashoffset"]="1000",R.push(o("polyline",O,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):R.push(o("polyline",O)),w)for(let Y=0;Y<W.length;Y++){let K=A(W[Y].x),Q=C(W[Y].y),q=W[Y].shape??F,H=W[Y].radius??M,j=`${P}-pt-${Y}`;if(g){let G=bi(q,K,Q,H,D,j,{opacity:0});R.push(o("g",{key:`${j}-g`},G,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else R.push(bi(q,K,Q,H,D,j))}}if($(t,i,s,m,c,u,l,a,d,"primary"),b)for(let B=0;B<b.length;B++){let E=b[B];$(E.data,E.color,s,!1,"transparent",u,E.color,E.pointRadius??a,E.pointShape??d,`series-${B}`)}if(b&&b.length>0){let B=[],E=[{color:i,label:"Primary"},...b.map((_,O)=>({color:_.color,label:_.label??`Series ${O+1}`}))],N=x+10,z=16,k=22,w=7.2,D=14,M=6,F=n-x*2-20,P=0,W=0;for(let _=0;_<E.length;_++){let O=E[_].label.length*w,Y=D+M+O;P>0&&P+Y>F&&(P=0,W+=k);let K=N+P,Q=x-30-W;B.push(o("rect",{x:K,y:Q,width:D,height:14,fill:E[_].color,rx:2,key:`legend-rect-${_}`})),B.push(o("text",{x:K+D+M,y:Q+12,"font-size":12,fill:"#374151",key:`legend-text-${_}`},E[_].label)),P+=Y+z}R.push(o("g",{key:"legend"},...B))}return p&&R.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},p)),f&&R.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&&R.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"},...R)}function Zl(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 Jl(e,t){let n=t??Zl(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function St(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=St(e,t,r,a),u=St(e,t,r,l),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let m=St(e,t,n,l),c=St(e,t,n,a);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${m.x} ${m.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function jn(e,t){let n=t?.padAngle??0,r=Jl(e,t?.colors),i=e.reduce((u,h)=>u+h.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 h=e[u],m=h.value/i*a,c=d+n/2,p=c+m;l.push({label:h.label,value:h.value,startAngle:c,endAngle:p,percentage:h.value/i*100,color:r[u]}),d=p+n/2}return l}function yi(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:h,centerLabel:m,colors:c,strokeColor:p="#fff",strokeWidth:f=2,textColor:y="currentColor"}=e,x=d&&u==="right"?140:0,g=h?30:0,b=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-x,I=r-g-b,A=S/2,C=g+I/2,T=Math.min(S,I)/2-10,L=e.outerRadius??T,R=X(()=>jn(t,{padAngle:s,colors:c}),[t,s,c]),$=[];h&&$.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let B=0;B<R.length;B++){let E=R[B],N=Un(A,C,i,L,E.startAngle,E.endAngle);if($.push(o("path",{key:`slice-${B}`,d:N,fill:E.color,stroke:p,strokeWidth:f})),a||l){let z=(E.startAngle+E.endAngle)/2,k=E.percentage<5,w=k?L+14:i+(L-i)*.65,D=St(A,C,w,z-Math.PI/2),M=k?y:"#fff",F=k?11:12,P=[];if(a&&P.push(E.label),l&&P.push(`${E.percentage.toFixed(1)}%`),k){let W=St(A,C,L+2,z-Math.PI/2);$.push(o("line",{key:`connector-${B}`,x1:W.x,y1:W.y,x2:D.x,y2:D.y,stroke:"#999",strokeWidth:1}))}a&&$.push(o("text",{key:`label-${B}`,x:D.x,y:D.y-(l?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:M,pointerEvents:"none"},E.label)),l&&$.push(o("text",{key:`value-${B}`,x:D.x,y:D.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:M,pointerEvents:"none"},`${E.percentage.toFixed(1)}%`))}}if(m&&i>0&&$.push(o("text",{key:"center-label",x:A,y:C,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},m)),d){let B=[];if(u==="right"){let E=S+10,N=g+20;for(let z=0;z<R.length;z++){let k=R[z],w=N+z*22;B.push(o("circle",{key:`legend-dot-${z}`,cx:E+6,cy:w,r:6,fill:k.color})),B.push(o("text",{key:`legend-text-${z}`,x:E+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${k.label} (${k.percentage.toFixed(1)}%)`))}}else{let E=r-b+10;for(let N=0;N<R.length;N++){let z=R[N],k=N%2,w=Math.floor(N/2),D=k*(n/2)+10,M=E+w*22;B.push(o("circle",{key:`legend-dot-${N}`,cx:D+6,cy:M,r:6,fill:z.color})),B.push(o("text",{key:`legend-text-${N}`,x:D+18,y:M,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${z.label} (${z.percentage.toFixed(1)}%)`))}}$.push(...B)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...$)}function Si(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function vi(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:h=3,pointColor:m="#3b82f6",curveColor:c="#3b82f6",onPointClick:p,onPointDoubleClick:f,onPointContextMenu:y,onPointHover:x}=e,[g,b]=U(r[1]),[S,I]=U(0),[A,C]=U(0),[T,L]=U(null),R=t/2+S,$=n/2+A,E=Math.min(t,n)/2-30,N=E/g,z=X(()=>{let H=Math.max(1,Math.ceil(g)),j=[],G=g/H;for(let V=1;V<=H;V++)j.push(G*V);return j},[g]),k=X(()=>{let H=[];for(let j=0;j<360;j+=30)H.push(j*Math.PI/180);return H},[]),w=X(()=>{if(!i||!l)return[];let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return qt(i,j)},[i,s,a,l]),[D,M]=U([]),F=ne(null);re(()=>{if(!i||l){M([]);return}let H=a??2*Math.PI/s,j=yt({start:0,end:2*Math.PI,step:H});return F.current&&F.current(),F.current=Zt(i,j,200,G=>{M([...G])}),()=>{F.current&&F.current()}},[i,s,a,l]);let P=l?w:D,W=X(()=>{if(P.length===0)return"";let H=[];for(let j=0;j<P.length;j++){let G=P[j],V=G.output;if(V<0||!isFinite(V))continue;let{x:Z,y:te}=Si(V,G.input,R,$,N);H.push(`${H.length===0?"M":"L"}${Z.toFixed(2)},${te.toFixed(2)}`)}return H.join(" ")},[P,R,$,N]),_=v(H=>{L({x:H.clientX,y:H.clientY,px:S,py:A})},[S,A]),O=v(H=>{T&&(I(T.px+(H.clientX-T.x)),C(T.py+(H.clientY-T.y)))},[T]),Y=v(()=>{L(null)},[]),K=v(H=>{H.preventDefault();let j=H.deltaY>0?1.15:1/1.15;b(Math.max(.1,g*j))},[g]),Q=v((H,j,G)=>{if(H)return V=>H({r:j.r,theta:j.theta,index:G,event:V})},[]),q=[];if(q.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let H=0;H<z.length;H++){let j=z[H]*N;q.push(o("circle",{cx:R,cy:$,r:j,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${H}`})),q.push(o("text",{x:R+j+2,y:$-4,"font-size":10,fill:"#9ca3af",key:`gl-${H}`},z[H].toFixed(1)))}for(let H=0;H<k.length;H++){let j=k[H],G=z[z.length-1]*N,V=R+G*Math.cos(j),Z=$-G*Math.sin(j);q.push(o("line",{x1:R,y1:$,x2:V,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${H}`}));let te=Math.round(j*180/Math.PI),ae=R+(G+14)*Math.cos(j),J=$-(G+14)*Math.sin(j);q.push(o("text",{x:ae,y:J+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${H}`},`${te}\xB0`))}}q.push(o("line",{x1:R-E,y1:$,x2:R+E,y2:$,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),q.push(o("line",{x1:R,y1:$-E,x2:R,y2:$+E,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),W&&q.push(o("path",{d:W,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let H=0;H<d.length;H++){let j=d[H],{x:G,y:V}=Si(j.r,j.theta,R,$,N);q.push(o("circle",{cx:G,cy:V,r:h,fill:m,key:`pt-${H}`,style:{cursor:"pointer"},onClick:Q(p,j,H),onDblClick:Q(f,j,H),onContextMenu:Q(y,j,H),onMouseEnter:Q(x,j,H)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:T?"grabbing":"grab"},onMouseDown:_,onMouseMove:O,onMouseUp:Y,onMouseLeave:Y,onWheel:K},...q)}function Gn(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 Xn(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 Kn(e,t){let n=wi(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=ec(n,Ql(e,i,s,a))}r++}return n}function wi(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 Ql(e,t,n,r){let i=wi(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 ec(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 qn(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 Zn(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 Pt(e,t=[],n=.3,r=1){let i=Gn(e),s=Xn(e),a=Kn(e,t);return{vertices:i.map((d,u)=>{let h=qn(a,d),m=Zn(h,n);return{id:u,position:d,x:m.x*r,y:m.y*r,depth:m.depth}}),edges:s,dimension:e}}function Tt(e){return e*(e-1)/2}function Jt(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 ki(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,h=e.backgroundColor??"transparent",m=e.scale??Math.min(n,r)*.3,c=Tt(t),p=1<<t,f=X(()=>e.vertexColors==="auto"||e.vertexColors===void 0?Jt(p):e.vertexColors,[p,e.vertexColors]),[y,x]=U(()=>{let M=[];for(let F=0;F<c;F++)M.push(0);return M}),[g,b]=U(!1),S=ne({x:0,y:0}),I=ne([]),A=ne(0);re(()=>{if(d===0)return;let M=!0,F=()=>{M&&(x(P=>{let W=P.slice();for(let _=0;_<W.length;_++)W[_]=(W[_]??0)+d*(1+_*.3);return W}),A.current=requestAnimationFrame(F))};return A.current=requestAnimationFrame(F),()=>{M=!1,cancelAnimationFrame(A.current)}},[d]);let C=X(()=>Pt(t,y,l,m),[t,y,l,m]),T=n/2,L=r/2,R=X(()=>C.edges.map(M=>{let F=C.vertices[M.source],P=C.vertices[M.target],W=(F.depth+P.depth)/2;return{...M,avgDepth:W,sv:F,tv:P}}).sort((M,F)=>M.avgDepth-F.avgDepth),[C]),$=X(()=>C.vertices.slice().sort((M,F)=>M.depth-F.depth),[C]),B=v(M=>{let F=M;b(!0),S.current={x:F.clientX,y:F.clientY},I.current=y.slice()},[y]),E=v(M=>{if(!g)return;let F=M,P=(F.clientX-S.current.x)*.01,W=(F.clientY-S.current.y)*.01;x(()=>{let _=I.current.slice();return _.length>0&&(_[0]=(_[0]??0)+P),_.length>1&&(_[1]=(_[1]??0)+W),_})},[g]),N=v(()=>{b(!1)},[]),z=M=>{let F=(M+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},k=M=>{let F=(M+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},w=R.map((M,F)=>{let P=z(M.avgDepth);return o("line",{key:`e-${M.source}-${M.target}`,x1:String(T+M.sv.x),y1:String(L+M.sv.y),x2:String(T+M.tv.x),y2:String(L+M.tv.y),stroke:a,"stroke-width":String(s),"stroke-opacity":String(P),"stroke-linecap":"round"})}),D=$.map(M=>{let F=i*k(M.depth),P=f[M.id%f.length]??"#3b82f6",W=[o("circle",{key:`v-${M.id}-circle`,cx:String(T+M.x),cy:String(L+M.y),r:String(F),fill:P,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-${M.id}-label`,x:String(T+M.x),y:String(L+M.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},M.id.toString(2).padStart(t,"0"))),W});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:g?"grabbing":"grab",userSelect:"none"},onMouseDown:B,onMouseMove:E,onMouseUp:N,onMouseLeave:N},...w,...D.flat())}function Ci(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Tt(t),[a,l]=U(()=>new Array(s).fill(0));return re(()=>{if(n===0)return;let u=!0,h=0,m=()=>{u&&(l(c=>c.map((p,f)=>p+n*(1+f*.3))),h=requestAnimationFrame(m))};return h=requestAnimationFrame(m),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:X(()=>Pt(t,a,r,i),[t,a,r,i]),angles:a,setAngles:l}}function Mi(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:tc(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?oc(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),m=nc(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:l},...m)}function tc(e,t){return"column"}function nc(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 oc(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"}},rc(n),o("span",null,n.label))))}function rc(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 ic(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 sc(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function Ei(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return re(()=>{if(n||typeof window>"u")return;ic(t),sc();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 Ii(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:h,ariaLabel:m="Site footer"}=e;return o("footer",{className:h,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 Ti=Ue({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null,setMenuBar:()=>{},clearMenuBar:()=>{},activeMenuBar:null,signalDock:()=>{},dockSignals:new Map}),ac={width:600,height:400},lc={x:30,y:30},cc={top:0,left:0,width:1920,height:1080},Jn=1e3;function Ri(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 Qn(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 Pi(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 eo(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Qt(e){let t=e.workspaceBounds??cc,n=e.defaultWindowSize??ac,r=e.cascadeOffset??lc,[i,s]=U([]),a=v(((...B)=>{let E=B[0];s(N=>{if(N.find(W=>W.id===E.id)){let _=eo(N)+1,O=N.map(Y=>Y.id===E.id?{...Y,focused:!0,zIndex:_,windowState:Y.windowState==="minimized"?"normal":Y.windowState}:{...Y,focused:!1});return _>Jn&&(O=Qn(O)),O}let k=E.size??n,w=E.position??Ri(N.length,r,t,k),M=eo(N)+1,F={id:E.id,title:E.title,icon:E.icon,position:w,size:k,windowState:"normal",zIndex:M,focused:!0,appProps:E.appProps},P=N.map(W=>({...W,focused:!1}));return P.push(F),M>Jn&&(P=Qn(P)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),P})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),l=v(((...B)=>{let E=B[0];S(N=>{if(N[E]){let z={...N};return delete z[E],z}return N}),A(N=>{if(N.has(E)){let z=new Map(N);return z.delete(E),z}return N}),s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.filter(w=>w.id!==E);if(z.focused&&k.length>0){let w=Pi(k,E);if(w){let D=k.map(M=>({...M,focused:M.id===w.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(w.id),D}}return e.onWindowClose&&e.onWindowClose(E),k.length===0&&e.onFocusChange&&e.onFocusChange(null),k})}),[e.onWindowClose,e.onFocusChange]),d=v(((...B)=>{let E=B[0];s(N=>{if(!N.find(M=>M.id===E))return N;let w=eo(N)+1,D=N.map(M=>M.id===E?{...M,focused:!0,zIndex:w}:{...M,focused:!1});return w>Jn&&(D=Qn(D)),e.onFocusChange&&e.onFocusChange(E),D})}),[e.onFocusChange]),u=v(((...B)=>{let E=B[0];s(N=>{let z=N.find(w=>w.id===E);if(!z)return N;let k=N.map(w=>w.id===E?{...w,windowState:"minimized",focused:!1}:w);if(z.focused){let w=Pi(k,E);w?(k=k.map(D=>({...D,focused:D.id===w.id})),e.onFocusChange&&e.onFocusChange(w.id)):e.onFocusChange&&e.onFocusChange(null)}return k})}),[e.onFocusChange]),h=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"maximized"}:z))}),[]),m=v(((...B)=>{let E=B[0];s(N=>N.map(z=>z.id===E?{...z,windowState:"normal"}:z))}),[]),c=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,position:N}:k))}),[]),p=v(((...B)=>{let E=B[0],N=B[1];s(z=>z.map(k=>k.id===E?{...k,size:N}:k))}),[]),f=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=N.length,k=new Map;if(z===1)k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(z===2){let w=Math.floor(t.width/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:t.height}})}else if(z===3){let w=Math.floor(t.width/2),D=Math.floor(t.height/2);k.set(N[0].id,{position:{x:t.left,y:t.top},size:{width:w,height:t.height}}),k.set(N[1].id,{position:{x:t.left+w,y:t.top},size:{width:t.width-w,height:D}}),k.set(N[2].id,{position:{x:t.left+w,y:t.top+D},size:{width:t.width-w,height:t.height-D}})}else{let w=Math.ceil(Math.sqrt(z)),D=Math.ceil(z/w),M=Math.floor(t.width/w),F=Math.floor(t.height/D);for(let P=0;P<N.length;P++){let W=Math.floor(P/w),_=P%w;k.set(N[P].id,{position:{x:t.left+_*M,y:t.top+W*F},size:{width:M,height:F}})}}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,size:D.size,windowState:"normal"}:w})})}),[t]),y=v(((...B)=>{s(E=>{let N=E.filter(w=>w.windowState!=="minimized");if(N.length===0)return E;let z=[...N].sort((w,D)=>w.zIndex-D.zIndex),k=new Map;for(let w=0;w<z.length;w++){let D=Ri(w,r,t,z[w].size);k.set(z[w].id,{position:D,zIndex:w+1})}return E.map(w=>{let D=k.get(w.id);return D?{...w,position:D.position,zIndex:D.zIndex,windowState:"normal"}:w})})}),[r,t]),x=v(((...B)=>{s(E=>{let N=E.map(z=>({...z,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),N})}),[e.onFocusChange]),g=X(()=>{let B=i.find(E=>E.focused);return B?B.id:null},[i]),[b,S]=U({}),[I,A]=U(new Map),C=v(((...B)=>{let E=B[0],N=B[1];S(z=>({...z,[E]:N}))}),[]),T=v(((...B)=>{let E=B[0];S(N=>{let z={...N};return delete z[E],z})}),[]),L=X(()=>g&&b[g]?b[g]:null,[g,b]),R=v(((...B)=>{let E=B[0],N=B[1];A(z=>{let k=new Map(z),w=k.get(E);return k.set(E,{...w,...N}),k})}),[]),$=X(()=>({windows:i,openWindow:a,closeWindow:l,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:m,moveWindow:c,resizeWindow:p,tileWindows:f,cascadeWindows:y,minimizeAll:x,focusedWindowId:g,setMenuBar:C,clearMenuBar:T,activeMenuBar:L,signalDock:R,dockSignals:I}),[i,a,l,d,u,h,m,c,p,f,y,x,g,C,T,L,R,I]);return o(Ti.Provider,{value:$},e.children)}function vt(){return Ye(Ti)}var $i=Ue({appId:""});function it(e){let t=X(()=>({appId:e.appId}),[e.appId]);return o($i.Provider,{value:t},e.children)}function wt(){return Ye($i).appId}var Di=Ue({publish:()=>{},subscribe:()=>()=>{},subscribeAll:()=>()=>{}});function $t(e){let t=ne([]),n=ne([]),r=v(((...l)=>{let d=l[0],u=l[1],h=l[2],m=l[3]||"",c={channel:d,from:m,to:h||null,payload:u,timestamp:Date.now()},p=t.current;for(let y=0;y<p.length;y++){let x=p[y];x.channel===d&&(c.to&&x.appId!==c.to||!c.to&&x.appId===m||x.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],h=l[2]||"",m={channel:d,handler:u,appId:h};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(h=>h!==u)}}),[]),a=X(()=>({publish:r,subscribe:i,subscribeAll:s}),[r,i,s]);return o(Di.Provider,{value:a},e.children)}function st(){let e=Ye(Di),t=wt(),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 Dt(e,t){let n=st(),r=ne(t);r.current=t,re(()=>n.subscribe(e,s=>{r.current(s)}),[n,e])}var zi=Ue({startDrag:()=>{},cancelDrag:()=>{},registerDropZone:()=>()=>{},currentDrag:null,isDragging:!1});function zt(e){let[t,n]=U(null),[r,i]=U({x:0,y:0}),s=ne(new Map),a=ne(null),l=t!==null,d=v(((...p)=>{let f=p[0];n(f)}),[]),u=v(((...p)=>{if(a.current){let f=s.current.get(a.current);f&&f.onDragLeave&&f.onDragLeave(),a.current=null}n(null)}),[]),h=v(((...p)=>{let f=p[0],y=p[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)}}),[]);re(()=>{if(!l)return;let p=x=>{let g=x;i({x:g.clientX,y:g.clientY});let b=document.elementFromPoint(g.clientX,g.clientY);if(!b)return;let S=null,I=s.current;I.forEach((C,T)=>{let L=document.querySelector(`[data-dropzone-id="${T}"]`);L&&L.contains(b)&&(S=T)});let A=a.current;if(S!==A){if(A){let C=I.get(A);C&&C.onDragLeave&&C.onDragLeave()}if(S){let C=I.get(S);C&&C.onDragEnter&&t&&C.acceptTypes.indexOf(t.type)!==-1&&C.onDragEnter(t)}a.current=S}},f=x=>{let g=a.current;if(g&&t){let b=s.current.get(g);b&&b.acceptTypes.indexOf(t.type)!==-1&&b.onDrop(t)}a.current=null,n(null)},y=x=>{x.key==="Escape"&&u()};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("keydown",y)}},[l,t,u]);let m=X(()=>({startDrag:d,cancelDrag:u,registerDropZone:h,currentDrag:t,isDragging:l}),[d,u,h,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(zi.Provider,{value:m},e.children,c)}function pt(){return Ye(zi)}function to(e,t){let n=pt(),r=wt(),i=ne(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 At(e){let t=pt(),[n,r]=U(!1),i=ne(e.zoneId||`zone-${Math.random().toString(36).slice(2,10)}`),s=ne(e);s.current=e,re(()=>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 dc=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],uc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function no(e){return e<10?"0"+String(e):String(e)}function pc(e,t,n){let r=e.getHours(),i=no(e.getMinutes()),s=no(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=no(r);return n?`${a}:${i}:${s}`:`${a}:${i}`}function fc(e){let t=dc[e.getDay()],n=uc[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function mc(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),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 gc(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=U(new Date);re(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let a=X(()=>pc(i,t,n),[i,t,n]),l=X(()=>fc(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 hc(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),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 bc(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe();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 xc(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=Fe(),[a,l]=U(!1),d=ne(null),u=v(()=>{l(x=>!x)},[]),h=v(()=>{l(!1)},[]),m=v(x=>{let g=x;(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l(b=>!b)),g.key==="Escape"&&l(!1)},[]);re(()=>{if(!a)return;let x=g=>{let b=d.current;b&&!b.contains(g.target)&&l(!1)};return document.addEventListener("click",x,!0),()=>{document.removeEventListener("click",x,!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"},p=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"},p),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((x,g)=>o(bc,{key:String(g),item:x,onClose:h}))):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 yc(e){let{menu:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=Fe(),[s,a]=U(!1),l=ne(null),d=v(()=>{a(c=>!c)},[]),u=v(()=>{a(!1)},[]),h=v(c=>{let p=c;(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a(f=>!f)),p.key==="Escape"&&a(!1)},[]);re(()=>{if(!s)return;let c=p=>{let f=l.current;f&&!f.contains(p.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,p)=>c.divider?o("div",{key:"div-"+String(p),role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{key:String(p),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:h,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 en(e){let{activeAppName:t,activitiesButton:n,appMenuBar:r,clockFormat:i="24h",showSeconds:s=!0,showDate:a=!0,indicators:l,user:d,userMenuItems:u,height:h=28,children:m}=e,c=String(h)+"px",p=[];if(n&&p.push(o(mc,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.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++)p.push(o(yc,{key:"appmenu-"+String(S),menu:r.menus[S]}));let f=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),y=[];y.push(o(gc,{key:"clock",format:i,showSeconds:s,showDate:a})),m&&y.push(m);let x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...y),g=[];if(l&&l.length>0){let S=l.map(I=>o(hc,{key:I.id,indicator:I}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...S))}d&&g.push(o(xc,{key:"user",user:d,menuItems:u}));let b=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);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,x,b)}function Sc(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var Ai=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function vc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Ai[Math.abs(t)%Ai.length]}function wc(e){return e>99?"99+":String(e)}function kc(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Cc(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 Mc(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 Ec(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:a}=e,[l,d]=U(!1),u=t.disabled??!1,h=v(()=>{u||d(!0)},[u]),m=v(()=>{d(!1)},[]),c=v(()=>{!u&&s&&s(t.id)},[u,s,t.id]),p=v(A=>{if(!u&&a){let C=A;C.preventDefault(),a(t.id,{x:C.clientX,y:C.clientY})}},[u,a,t.id]),f=`${n}px`,y=Sc(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:vc(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),x=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"},wc(t.badge)):null,g=t.active?o("span",{style:{...Mc(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=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",...Cc(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,I={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:I,"aria-label":kc(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:p,onMouseEnter:h,onMouseLeave:m,"data-dock-item-id":t.id,"data-urgent":t.urgent?"true":void 0},y,x,g,b,S)}function tn(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,[h,m]=U(!s),c=ne(null),p=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(I=>{let A=I,C=A.target,T=C.closest('[role="toolbar"]');if(!T)return;let L=Array.from(T.querySelectorAll("button[data-dock-item-id]")),R=L.indexOf(C);if(R<0)return;let $=n==="vertical",B=$?"ArrowDown":"ArrowRight",E=$?"ArrowUp":"ArrowLeft";if(A.key===B){A.preventDefault();let N=L[R+1];N&&N.focus()}else if(A.key===E){A.preventDefault();let N=L[R-1];N&&N.focus()}else A.key==="Home"?(A.preventDefault(),L[0]?.focus()):A.key==="End"?(A.preventDefault(),L[L.length-1]?.focus()):(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),C.click())},[n]),x=n==="vertical",g={display:"flex",flexDirection:x?"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&&!h&&(r==="left"?(g.transform="translateX(-100%)",g.opacity="0"):r==="right"?(g.transform="translateX(100%)",g.opacity="0"):r==="top"?(g.transform="translateY(-100%)",g.opacity="0"):r==="bottom"&&(g.transform="translateY(100%)",g.opacity="0"));let b=[];for(let I=0;I<t.length;I++){if(a&&I===t.length-1&&t.length>1){let A=x?{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"};b.push(o("div",{key:`sep-${I}`,style:A,"aria-hidden":"true",role:"separator"}))}b.push(o(Ec,{key:t[I].id,item:t[I],iconSize:i,position:r,orientation:n,onItemClick:l,onItemContextMenu:d}))}let S=s&&!h?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:g,onMouseEnter:p,onMouseLeave:f,onKeyDown:y},S,...b,u??null)}var Ic="#2c001e";function nn(e){let{backgroundColor:t=Ic,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:a,onDoubleClick:l,overflow:d="visible",children:u}=e,h=v(g=>{let b=g;b.target===b.currentTarget&&a&&a()},[a]),m=v(g=>{let b=g;b.target===b.currentTarget&&l&&l()},[l]),c=X(()=>{let g={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return g.backgroundColor=t,n&&(g.background=n),r&&i>=1&&(g.backgroundImage=`url(${r})`,g.backgroundSize="cover",g.backgroundPosition="center"),g},[t,n,r,i]),p=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=[];p&&y.push(o("div",{className:"desktop-background__image-overlay",style:p,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:f},u));let x=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:m,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(Kt,{items:s},x):x}var Rc={width:200,height:150},Pc={x:50,y:50},Tc={width:400,height:300},We=8,oo=20,$c={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 kt(e){let{id:t,title:n,icon:r,defaultPosition:i=Pc,defaultSize:s=Tc,minSize:a=Rc,maxSize:l,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:m=!0,zIndex:c,onClose:p,onMinimize:f,onMaximize:y,onFocus:x,onMove:g,onResize:b,children:S}=e,[I,A]=U(i.x),[C,T]=U(i.y),[L,R]=U(s.width),[$,B]=U(s.height),[E,N]=U(!1),[z,k]=U(!1),[w,D]=U(null),M=ne(null),F=ne(null),P=ne(null),W=v((oe,ge)=>{let he=Math.max(oe,a.width),ee=Math.max(ge,a.height);return l&&(he=Math.min(he,l.width),ee=Math.min(ee,l.height)),{width:he,height:ee}},[a,l]),_=v(()=>{let oe=P.current;return oe&&oe.parentElement?{width:oe.parentElement.clientWidth,height:oe.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),O=v((oe,ge,he,ee)=>{let ce=_(),me=Math.max(0,Math.min(oe,ce.width-he)),xe=Math.max(0,Math.min(ge,ce.height-ee));return{x:me,y:xe}},[_]),Y=v(oe=>{if(!u||h==="maximized")return;let ge=oe;ge.target.closest("button")||(ge.preventDefault(),M.current={startMouseX:ge.clientX,startMouseY:ge.clientY,startPosX:I,startPosY:C},N(!0))},[u,h,I,C]),K=v(oe=>{oe.target.closest("button")||y&&y()},[y]);re(()=>{if(!E)return;let oe=he=>{let ee=he,ce=M.current;if(!ce)return;let me=ee.clientX-ce.startMouseX,xe=ee.clientY-ce.startMouseY,ye=ce.startPosX+me,Me=ce.startPosY+xe,de=_();ye=Math.max(0,Math.min(ye,de.width-L)),Me=Math.max(0,Math.min(Me,de.height-$)),A(ye),T(Me),ee.clientX<=oo?D("left"):ee.clientX>=de.width-oo?D("right"):ee.clientY<=oo?D("top"):D(null)},ge=he=>{let ee=he;N(!1);let ce=_();if(w==="left"){A(0),T(0),R(Math.floor(ce.width/2)),B(ce.height),D(null),g&&g({x:0,y:0}),b&&b({width:Math.floor(ce.width/2),height:ce.height});return}if(w==="right"){let xe=Math.floor(ce.width/2);A(xe),T(0),R(xe),B(ce.height),D(null),g&&g({x:xe,y:0}),b&&b({width:xe,height:ce.height});return}if(w==="top"){D(null),y&&y();return}D(null);let me=M.current;if(me&&g){let xe=ee.clientX-me.startMouseX,ye=ee.clientY-me.startMouseY,Me=me.startPosX+xe,de=me.startPosY+ye;Me=Math.max(0,Math.min(Me,ce.width-L)),de=Math.max(0,Math.min(de,ce.height-$)),g({x:Me,y:de})}M.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[E,w,L,$,_,g,b,y]);let Q=v(oe=>ge=>{if(!d||h!=="normal")return;let he=ge;he.preventDefault(),he.stopPropagation(),F.current={direction:oe,startMouseX:he.clientX,startMouseY:he.clientY,startPosX:I,startPosY:C,startWidth:L,startHeight:$},k(!0)},[d,h,I,C,L,$]);re(()=>{if(!z)return;let oe=he=>{let ee=he,ce=F.current;if(!ce)return;let me=ee.clientX-ce.startMouseX,xe=ee.clientY-ce.startMouseY,ye=ce.direction,Me=ce.startWidth,de=ce.startHeight,be=ce.startPosX,Ee=ce.startPosY;ye.includes("e")&&(Me=ce.startWidth+me),ye.includes("w")&&(Me=ce.startWidth-me,be=ce.startPosX+me),ye.includes("s")&&(de=ce.startHeight+xe),ye.includes("n")&&(de=ce.startHeight-xe,Ee=ce.startPosY+xe);let Re=W(Me,de);ye.includes("w")&&(be=ce.startPosX+(ce.startWidth-Re.width)),ye.includes("n")&&(Ee=ce.startPosY+(ce.startHeight-Re.height)),R(Re.width),B(Re.height),A(be),T(Ee)},ge=()=>{k(!1),b&&b({width:L,height:$}),F.current=null};return document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ge),()=>{document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ge)}},[z,L,$,W,b]),re(()=>{if(!m||!p)return;let oe=ge=>{ge.key==="Escape"&&p()};return document.addEventListener("keydown",oe),()=>document.removeEventListener("keydown",oe)},[m,p]);let q=v(oe=>{x&&x()},[x]);if(h==="minimized")return null;let H=h==="maximized",j=X(()=>{let oe={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:H?"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:H?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return H?(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"):(oe.top=`${C}px`,oe.left=`${I}px`,oe.width=`${L}px`,oe.height=`${$}px`),c!==void 0&&(oe.zIndex=String(c)),E&&(oe.cursor="grabbing",oe.userSelect="none"),oe},[H,I,C,L,$,c,m,E]),G=X(()=>{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&&!H?"grab":"default",opacity:m?"1":"0.6"};return E&&(oe.cursor="grabbing"),oe},[m,u,H,E]),V={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"},te=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?te.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):te.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),te.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(),f&&f()}}),o("button",{type:"button","aria-label":H?"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(),p&&p()}}));te.push(ae);let J=[];if(d&&!H){let oe=["n","s","e","w","ne","nw","se","sw"];for(let ge=0;ge<oe.length;ge++){let he=oe[ge],ee={position:"absolute",zIndex:"1"};he==="n"?(ee.top="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="s"?(ee.bottom="0",ee.left=`${We}px`,ee.right=`${We}px`,ee.height=`${We}px`):he==="e"?(ee.top=`${We}px`,ee.right="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="w"?(ee.top=`${We}px`,ee.left="0",ee.bottom=`${We}px`,ee.width=`${We}px`):he==="ne"?(ee.top="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="nw"?(ee.top="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="se"?(ee.bottom="0",ee.right="0",ee.width=`${We}px`,ee.height=`${We}px`):he==="sw"&&(ee.bottom="0",ee.left="0",ee.width=`${We}px`,ee.height=`${We}px`),ee.cursor=$c[he],J.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${he}`,style:ee,onMouseDown:Q(he)}))}}let ie=null;if(w){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"};w==="left"?(oe.top="0",oe.left="0",oe.width="50%",oe.height="100%"):w==="right"?(oe.top="0",oe.right="0",oe.width="50%",oe.height="100%"):w==="top"&&(oe.top="0",oe.left="0",oe.width="100%",oe.height="100%"),ie=o("div",{className:"draggable-window__snap-preview",style:oe})}let le=[];for(let oe=0;oe<J.length;oe++)le.push(J[oe]);le.push(o("div",{className:"draggable-window__title-bar",style:G,onMouseDown:Y,onDblClick:K,role:"toolbar","aria-label":`${n} window controls`},...te)),le.push(o("div",{className:"draggable-window__body",style:V},S));let fe=[o("div",{ref:P,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:j,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:q},...le)];return ie&&fe.push(ie),fe.length===1?fe[0]:o("div",{style:{display:"contents"}},...fe)}var Dc=["File","Edit","View","Insert","Format","Tools","Help"],Li={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"}]},zc=[{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"}}],Ac=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],Lc=["1","2","3","4","5","6","7"],Bc={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function Fc(){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 Bi(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function on(e){let[t,n]=U(!1),[r,i]=U(!1),[s,a]=U(!1),[l,d]=U(-1),[u,h]=U(""),[m,c]=U(-1),[p,f]=U(0),[y,x]=U("3"),g=ne(null),b=v(()=>{document.execCommand("bold",!1),n(V=>!V),g.current&&g.current.focus()},[]),S=v(()=>{document.execCommand("italic",!1),i(V=>!V),g.current&&g.current.focus()},[]),I=v(()=>{document.execCommand("underline",!1),a(V=>!V),g.current&&g.current.focus()},[]),A={bold:b,italic:S,underline:I},C={bold:t,italic:r,underline:s},T=v(V=>{document.execCommand(V,!1),g.current&&g.current.focus()},[]),L=v(V=>{document.execCommand("fontSize",!1,V),x(V),g.current&&g.current.focus()},[]),R=v(V=>{c(Z=>Z===V?-1:V)},[]),$=v(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"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":g.current&&(g.current.innerHTML="",f(0));break;default:break}c(-1),g.current&&g.current.focus()},[]),B=v(()=>{if(g.current){let V=g.current.textContent??"";f(Bi(V))}},[]),E=v(()=>{c(-1)},[]),N=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"}),[]),z={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"},D={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"},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"},P=X(()=>Fc(),[]),W=e.content??"Start typing...",_=Bi(W),O=p>0?p:_;function Y(V){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:m===V?"rgba(0,0,0,0.12)":l===V?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let K={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"},Q={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function q(V,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:C[V]??!1?"rgba(0,0,0,0.12)":u===V?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let H={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"},G=Dc.map((V,Z)=>{let te=[V];return m===Z&&Li[V]&&te.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...Li[V].map((ae,J)=>o("button",{key:String(J),style:Q,onClick:ie=>{ie.stopPropagation(),$(ae.action)},role:"menuitem"},ae.label)))),o("button",{key:String(Z),style:Y(Z),role:"menuitem","aria-label":V,onClick:()=>R(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...te)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:N},o("div",{className:"word-processor__menu-bar",style:z,role:"menubar"},...G),o("div",{className:"word-processor__toolbar",style:k,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:H,"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"}},...zc.map(V=>o("button",{key:V.id,style:q(V.id,V.style),title:V.shortcut?`${V.label} (${V.shortcut})`:V.label,"aria-label":V.label,"aria-pressed":String(C[V.id]??!1),onClick:A[V.id],onMouseEnter:()=>h(V.id),onMouseLeave:()=>h("")},V.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:V=>{let Z=V.target;L(Z.value)}},...Lc.map(V=>o("option",{key:V,value:V},Bc[V])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...Ac.map((V,Z)=>o("button",{key:String(Z),style:q(`align-${Z}`),title:V.label,"aria-label":V.label,onClick:()=>T(V.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},V.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...P),o("main",{className:"word-processor__document-area",style:D,onClick:E},o("div",{className:"word-processor__page",style:M,contentEditable:"true",ref:g,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%")))}function rn(e){let t=X(()=>({height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}),[]),n=e.style?{...t,...e.style}:t;return o("div",{className:"ide__title-bar",style:n},e.title)}var Nc={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},Fi={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},Wc={...Fi,backgroundColor:"rgba(255,255,255,0.1)"},_c={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"},Oc={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function sn(e){let[t,n]=U(-1),r=v(a=>{n(l=>l===a?-1:a)},[]),i=v(a=>{e.onAction(a),n(-1)},[e.onAction]),s=e.menus.map((a,l)=>{let d=[a],u=t===l;return u&&e.menuItems[a]&&d.push(o("div",{key:"dropdown",style:_c,className:"ide__menu-dropdown"},...e.menuItems[a].map((h,m)=>o("button",{key:String(m),style:Oc,onClick:c=>{c.stopPropagation(),i(h.action)},role:"menuitem"},h.label)))),o("button",{key:String(l),style:u?Wc:Fi,role:"menuitem","aria-label":a,onClick:()=>r(l)},...d)});return o("div",{className:"ide__menu-bar",style:Nc,role:"menubar"},...s)}var Hc={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},Yc={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"};function Vc(e,t,n){return{padding:"3px 8px",paddingLeft:`${12+e*16}px`,fontSize:"13px",cursor:"pointer",color:t?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:n?"rgba(255,255,255,0.08)":"transparent"}}function an(e){let t=i=>{if(!i.parent)return!0;if(!e.expandedFolders[i.parent])return!1;let s=e.files.find(a=>a.name===i.parent&&a.isFolder);return s?t(s):!0},r=e.files.map((i,s)=>{if(!t(i))return null;let a=!i.isFolder&&i.name===e.activeFile,l=i.isFolder?e.expandedFolders[i.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(s),style:Vc(i.indent,i.isFolder,a),onClick:i.isFolder?()=>e.onFolderToggle(i.name):()=>e.onFileClick(i.name)},l,i.name)}).filter(i=>i!==null);return o("nav",{className:"ide__sidebar",style:Hc,"aria-label":"File explorer"},o("div",{style:Yc},"Explorer"),...r)}var Uc={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},jc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},Gc={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#2d2d2d",color:"#999999",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid transparent",boxSizing:"border-box"};function ln(e){let t=e.tabs.map((n,r)=>{let i=n===e.activeTab;return o("button",{key:String(r),style:i?jc:Gc,"aria-label":n,onClick:()=>e.onTabClick(n)},n)});return o("div",{style:Uc},...t)}var cn="#569cd6",ro="#ce9178",io="#4ec9b0",so="#6a9955",ao="#dcdcaa",Lt="#d4d4d4",lo="#d4d4d4",co="#b5cea8",Xc=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"]),Kc=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]);function dn(e){if(!e.trim())return[{text:"\xA0",color:Lt}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:so});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:ro}),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:co}),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=Lt;Xc.has(i)?l=cn:Kc.has(i)?l=io:a?l=ao:(i==="true"||i==="false")&&(l=cn),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:Lt}),n=r;continue}t.push({text:e[n],color:lo}),n++}return t}var qc={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},Zc={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},Jc={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"};function un(e){let t=e.content.map((r,i)=>{let s=dn(r),a=[],l=0;for(let d of s)a.push(o("span",{key:String(l++),style:{color:d.color}},d.text));return o("div",{key:String(i),style:{minHeight:"20px"}},...a)}),n=[];for(let r=0;r<e.content.length;r++)n.push(o("div",{key:String(r)},String(r+1)));return o("div",{style:qc},o("div",{style:Zc,"aria-hidden":"true"},...n),o("code",{style:Jc,contentEditable:"true",ref:e.editorRef,onInput:e.onInput,suppressContentEditableWarning:!0},...t))}var Qc={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"};function pn(e){return o("div",{className:"ide__minimap",style:Qc,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${e.visibleStart}px`,left:"0",right:"0",height:`${e.visibleEnd}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...e.lines.map((t,n)=>o("div",{key:String(n),style:{height:"2px",backgroundColor:t.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,t.length*2)}%`}})))}var ed={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},td={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"};function fn(e){let t=n=>n.map((r,i)=>o("span",{key:String(i),style:td,onClick:r.onClick},r.label));return o("div",{className:"ide__status-bar",style:ed},o("div",{style:{display:"flex",gap:"16px"}},...t(e.items)),o("div",{style:{display:"flex",gap:"16px"}},...t(e.rightItems)))}var nd=["File","Edit","Selection","View","Go","Run","Terminal","Help"],od={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"}]},rd=[{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}],uo={"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"]',"}"]},Ni=uo["App.ts"];function mn(e){let[t,n]=U("App.ts"),[r,i]=U({src:!0,components:!0,hooks:!0}),[s,a]=U(Ni.length),l=ne(null),d=v(S=>{n(S);let I=uo[S];I&&a(I.length)},[]),u=v(S=>{i(I=>{let A={},C=Object.keys(I);for(let T=0;T<C.length;T++)A[C[T]]=I[C[T]];return A[S]=!I[S],A})},[]),h=v(S=>{switch(S){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":l.current&&(l.current.textContent="",a(1));break;default:break}l.current&&l.current.focus()},[]),m=v(()=>{if(l.current){let I=(l.current.textContent??"").split(`
|
|
8
|
+
`);a(Math.max(I.length,1))}},[]),c=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"}),[]),p={flex:"1",display:"flex",overflow:"hidden"},f={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},y={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},x=8,g=30,b=uo[t]??Ni;return o("div",{className:`ide ${e.className??""}`.trim(),style:c},o(rn,{title:"SpecifyJS IDE"}),o(sn,{menus:nd,menuItems:od,onAction:h}),o("div",{style:p},o(an,{files:rd,activeFile:t,expandedFolders:r,onFileClick:d,onFolderToggle:u}),o("div",{style:f}),o("div",{style:y},o(ln,{tabs:[t],activeTab:t,onTabClick:d}),o(un,{content:b,onInput:m,editorRef:l})),o(pn,{lines:b,visibleStart:x,visibleEnd:g,totalLines:b.length})),o(fn,{items:[{label:"\u2387 main"},{label:"0 errors"},{label:"0 warnings"}],rightItems:[{label:"Ln 1, Col 1"},{label:"UTF-8"},{label:"TypeScript"}]}))}var id=[{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]}],Wi=[{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}],_i=[{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}],Oi=[{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}],sd=[{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}],ad=[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],Hi=[{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}],Yi=[{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}],Vi=["09:30","10:00","10:30","11:00","11:30","12:00"];function ld(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Bt(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ge(e){return e.toFixed(2)}var Ct={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},Mt={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},gn={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Oe={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},He={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},hn={cursor:"default",transition:"background-color 0.1s"};function cd(e,t){let i=Math.min(...e),a=Math.max(...e)-i||1,l=e.map((u,h)=>{let m=h/(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 dd(e,t){let u=Math.min(...e),h=Math.max(...e),m=h-u||1,c=310/(e.length-1),p=e.map((C,T)=>{let L=40+T*c,R=15+(1-(C-u)/m)*120;return{x:L,y:R}}),f=p.map(C=>`${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" "),y="M40,135 "+p.map(C=>`L${C.x.toFixed(1)},${C.y.toFixed(1)}`).join(" ")+` L${p[p.length-1].x.toFixed(1)},135 Z`,x=[];for(let C=1;C<e.length;C++){let T=e[C]>=e[C-1]?"#00c853":"#ff1744";x.push(o("line",{key:String(C),x1:String(p[C-1].x.toFixed(1)),y1:String(p[C-1].y.toFixed(1)),x2:String(p[C].x.toFixed(1)),y2:String(p[C].y.toFixed(1)),stroke:T,strokeWidth:"2",strokeLinecap:"round"}))}let g=[];for(let C=0;C<5;C++){let T=15+C/4*120,L=h-C/4*m;g.push(o("line",{key:`g${C}`,x1:String(40),y1:String(T.toFixed(1)),x2:String(350),y2:String(T.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),g.push(o("text",{key:`yl${C}`,x:String(36),y:String((T+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ge(L)))}let b=[],S=Math.min(Vi.length,e.length),I=(e.length-1)/(S-1);for(let C=0;C<S;C++){let L=40+Math.round(C*I)*c;b.push(o("text",{key:`tl${C}`,x:String(L.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Vi[C]))}let A="chartGrad";return o("div",{style:Ct},o("div",{style:Mt},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ge(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:A,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(#${A})`}),...g,...b,...x,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 ud(){let e=Math.max(...Wi.map(t=>t.qty),..._i.map(t=>t.qty));return o("div",{style:Ct},o("div",{style:Mt},"Order Book"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Bid Price"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Ask Price"),o("th",{style:Oe},"Qty"))),o("tbody",null,...Wi.map((t,n)=>{let r=_i[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ge(t.price)),o("td",{style:{...He,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Bt(t.qty)),o("td",{style:{...He,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ge(r.price):""),o("td",{style:{...He,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Bt(r.qty):""))}))))}function pd(e){return o("div",{style:Ct},o("div",{style:Mt},"Watchlist"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Price"),o("th",{style:Oe},"Chg%"),o("th",{style:Oe},"Volume"))),o("tbody",null,...id.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:hn},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},t.symbol,cd(t.spark,i)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(r)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ge(t.change)}%`),o("td",{style:{...He,fontFamily:"monospace",color:"#8888aa"}},ld(t.volume)))}))))}function fd(){let e=Oi.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ct},o("div",{style:Mt},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ge(e)}`)),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Symbol"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Avg"),o("th",{style:Oe},"P&L"))),o("tbody",null,...Oi.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...hn,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...He,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(n.avgPrice)),o("td",{style:{...He,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ge(n.pnl)}`))}))))}function md(){return o("div",{style:Ct},o("div",{style:Mt},"Recent Trades"),o("table",{style:gn},o("thead",null,o("tr",null,o("th",{style:Oe},"Time"),o("th",{style:Oe},"Sym"),o("th",{style:Oe},"Side"),o("th",{style:Oe},"Qty"),o("th",{style:Oe},"Price"))),o("tbody",null,...sd.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:hn},o("td",{style:{...He,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...He,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...He,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...He,fontFamily:"monospace"}},Bt(e.qty)),o("td",{style:{...He,fontFamily:"monospace"}},Ge(e.price)))}))))}function gd(){let e=Math.max(...Hi.map(n=>n.volume),...Yi.map(n=>n.volume)),t="16px";return o("div",{style:Ct},o("div",{style:Mt},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Hi.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"}},Ge(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"}},Bt(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Yi.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"}},Ge(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"}},Bt(n.volume))))))}function bn(e){let[t,n]=U(0),[r,i]=U("--:--:--"),[s,a]=U(!0);re(()=>{let p=setInterval(()=>{n(f=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(p)},[]),re(()=>{let p=()=>{let y=new Date,x=String(y.getHours()).padStart(2,"0"),g=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${x}:${g}:${b}`)};p();let f=setInterval(p,1e3);return()=>clearInterval(f)},[]),re(()=>{let p=setInterval(()=>{a(f=>!f)},800);return()=>clearInterval(p)},[]);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"},h={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:h},dd(ad,m),ud(),pd(t),fd(),md(),gd()))}function Le(e){return e.type==="card"}function $e(e){return e.type==="container"}function qe(){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 Xe(e){return Le(e)?e.card_id:e.container_id}function po(e){return Le(e)?e.card_title:e.name}var fo={low:"#22c55e",medium:"#f59e0b",high:"#f97316",critical:"#ef4444"},Ft=[{label:"Text",value:"text"},{label:"JSON",value:"json"},{label:"Task",value:"task"},{label:"Project",value:"project"}];function hd(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 bd(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 xd(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 yd(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 xn(e){let{card:t,selected:n=!1,onSelect:r,onMove:i,onResize:s,onDelete:a,dispatch:l,onOpenProject:d,onCardContextMenu:u,onUpdate:h,onDragStart:m,onDragEnd:c,onAnchorDragStart:p}=e,[f,y]=U(!1),[x,g]=U(!1),[b,S]=U(null),[I,A]=U(!1),[C,T]=U(!1),[L,R]=U(!1),[$,B]=U(t.card_title||""),[E,N]=U(""),z=ne(null),k=ne(null),w=t.priority?fo[t.priority]||"#94a3b8":"transparent",D=v(de=>{let be=de;be.preventDefault(),be.stopPropagation(),S({x:be.clientX,y:be.clientY}),A(!1),u&&u(t.card_id,{x:be.clientX,y:be.clientY})},[u,t.card_id]),M=v(()=>{S(null),A(!1)},[]),F=v(de=>{let be=de,Ee=be.target;if(Ee.dataset&&(Ee.dataset.role==="delete"||Ee.dataset.role==="resize"||Ee.dataset.role==="drag-handle"||Ee.dataset.role==="inline-edit"||Ee.dataset.role==="anchor"))return;be.preventDefault(),be.stopPropagation(),r&&r(t.card_id),z.current={x:be.clientX,y:be.clientY,cardX:t.position.x,cardY:t.position.y},m&&m(t.card_id),g(!0);let Re=se=>{let pe=se;if(!z.current)return;let Se=pe.clientX-z.current.x,we=pe.clientY-z.current.y;i&&i(t.card_id,{x:z.current.cardX+Se,y:z.current.cardY+we})},Ne=()=>{z.current=null,g(!1),c&&c(t.card_id),document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ne)};document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ne)},[t.card_id,t.position.x,t.position.y,r,i,m,c]),P=v(de=>{let be=de;be.preventDefault(),be.stopPropagation(),k.current={x:be.clientX,y:be.clientY,w:t.size.width,h:t.size.height};let Ee=Ne=>{let se=Ne;if(!k.current)return;let pe=se.clientX-k.current.x,Se=se.clientY-k.current.y,we=Math.max(120,k.current.w+pe),Ie=Math.max(80,k.current.h+Se);s&&s(t.card_id,{width:we,height:Ie})},Re=()=>{k.current=null,document.removeEventListener("mousemove",Ee),document.removeEventListener("mouseup",Re)};document.addEventListener("mousemove",Ee),document.addEventListener("mouseup",Re)},[t.card_id,t.size.width,t.size.height,s]),W=v(de=>{de.preventDefault(),de.stopPropagation(),a&&a(t.card_id)},[t.card_id,a]),_=v(de=>{let be=de;be.preventDefault(),be.stopPropagation();let Re=be.target.dataset.anchor;if(!Re||!p)return;let Ne=t.position.x,se=t.position.y,pe=t.size.width,Se=t.size.height,we=Ne+pe/2,Ie=se+Se/2;Re==="top"?(we=Ne+pe/2,Ie=se):Re==="right"?(we=Ne+pe,Ie=se+Se/2):Re==="bottom"?(we=Ne+pe/2,Ie=se+Se):Re==="left"&&(we=Ne,Ie=se+Se/2),p(t.card_id,Re,{x:we,y:Ie})},[t.card_id,t.position.x,t.position.y,t.size.width,t.size.height,p]),O=v(de=>{l&&l({type:"CHANGE_CARD_TYPE",cardId:t.card_id,newType:de}),M()},[t.card_id,l,M]),Y=v(de=>{de.preventDefault(),de.stopPropagation(),B(t.card_title||""),T(!0)},[t.card_title]),K=v(()=>{T(!1),h&&$!==t.card_title&&h(t.card_id,{card_title:$})},[h,t.card_id,t.card_title,$]),Q=v(de=>{let be=de;be.key==="Enter"?(be.preventDefault(),K()):be.key==="Escape"&&(be.preventDefault(),T(!1),B(t.card_title||""))},[K,t.card_title]),q=v(de=>{let be=de.target;B(be.value)},[]),H=v(de=>{de.stopPropagation();let be=t.content;N(be.text||""),R(!0)},[t.content]),j=v(()=>{R(!1),h&&h(t.card_id,{content:{text:E}})},[h,t.card_id,E]),G=v(de=>{let be=de;if(be.key==="Escape"){be.preventDefault(),R(!1);let Ee=t.content;N(Ee.text||"")}},[t.content]),V=v(de=>{let be=de.target;N(be.value)},[]),Z;switch(t.card_type){case"text":L?Z=o("textarea",{"data-role":"inline-edit","data-testid":`card-desc-edit-${t.card_id}`,value:E,onInput:V,onBlur:j,onKeyDown:G,onFocus:de=>{let be=de.target;be.setSelectionRange(be.value.length,be.value.length)},style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",flex:"1",border:"1px solid #3b82f6",borderRadius:"3px",padding:"2px 4px",resize:"none",outline:"none",fontFamily:"inherit",backgroundColor:"#fff",width:"100%",boxSizing:"border-box"}}):Z=o("div",{style:{fontSize:"12px",color:"#555555",lineHeight:"1.4",overflow:"hidden",flex:"1",cursor:"text"},"data-testid":`card-text-content-${t.card_id}`,onClick:H},t.content.text||"");break;case"json":Z=bd(t);break;case"task":Z=xd(t);break;case"project":Z=yd(t,d);break;default:Z=hd(t)}let te=t.card_type==="project",ae={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:te?"999px":"6px",borderLeft:`4px solid ${w}`,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:x?"9999":"1"},J={fontWeight:"600",fontSize:"14px",color:"#1a1a1a",marginBottom:"4px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},ie={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:f?"block":"none",border:"none",padding:"0"},le={position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",cursor:"nwse-resize",opacity:"0.4",background:"linear-gradient(135deg, transparent 50%, #666 50%)"},fe={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:f?"block":"none",border:"none",padding:"0"},oe=8,ge={position:"absolute",width:`${oe}px`,height:`${oe}px`,borderRadius:"50%",backgroundColor:"#3b82f6",border:"2px solid #fff",boxSizing:"border-box",cursor:"crosshair",display:f?"block":"none",zIndex:"10"},ee=[{anchor:"top",style:{...ge,top:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"right",style:{...ge,top:"50%",right:`${-oe/2}px`,marginTop:`${-oe/2}px`}},{anchor:"bottom",style:{...ge,bottom:`${-oe/2}px`,left:"50%",marginLeft:`${-oe/2}px`}},{anchor:"left",style:{...ge,top:"50%",left:`${-oe/2}px`,marginTop:`${-oe/2}px`}}].map((de,be)=>o("div",{key:`anchor-${de.anchor}`,style:de.style,"data-role":"anchor","data-anchor":de.anchor,"data-testid":`card-anchor-${de.anchor}-${t.card_id}`,onMouseDown:_})),ce=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,me=t.tags&&t.tags.length>0?o("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"}},...t.tags.map((de,be)=>o("span",{key:String(be),style:{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(0,0,0,0.08)",color:"#444"}},de))):null,xe={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap"},ye={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"},Me=b?o("div",{className:"card-context-menu",style:{position:"fixed",left:`${b.x}px`,top:`${b.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:de=>de.stopPropagation()},o("div",{style:xe,onClick:de=>{de.stopPropagation(),a&&a(t.card_id),M()},role:"menuitem","data-testid":`ctx-delete-${t.card_id}`},"Delete"),o("div",{style:{...xe,position:"relative"},onMouseEnter:()=>A(!0),role:"menuitem","aria-haspopup":"true","data-testid":`ctx-change-type-${t.card_id}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),I?o("div",{style:ye,role:"menu","data-testid":`ctx-type-submenu-${t.card_id}`},...Ft.map(de=>o("div",{key:de.value,style:{...xe,fontWeight:t.card_type===de.value?"700":"400"},onClick:be=>{be.stopPropagation(),O(de.value)},role:"menuitem","data-testid":`ctx-type-${de.value}-${t.card_id}`},de.label,t.card_type===de.value?" \u2713":""))):null)):null;return te?o("div",{className:"board-card board-card--project",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Project card: ${t.card_title}`,tabIndex:0},Z,o("div",{style:fe,"data-role":"drag-handle","data-testid":`card-drag-handle-${t.card_id}`,"aria-label":"Export drag handle",title:"Drag to export card"},"\u2630"),...ee,Me):o("div",{className:"board-card",style:ae,onMouseDown:F,onContextMenu:D,onMouseEnter:()=>y(!0),onMouseLeave:()=>{y(!1),M()},"data-card-id":t.card_id,"data-testid":`card-${t.card_id}`,role:"button","aria-label":`Card: ${t.card_title}`,tabIndex:0},C?o("input",{"data-role":"inline-edit","data-testid":`card-title-edit-${t.card_id}`,value:$,onInput:q,onBlur:K,onKeyDown:Q,onFocus:de=>{let be=de.target;be.setSelectionRange(be.value.length,be.value.length)},style:{...J,border:"1px solid #3b82f6",borderRadius:"3px",padding:"1px 4px",outline:"none",width:"100%",boxSizing:"border-box",backgroundColor:"#fff"}}):o("div",{style:J,"data-testid":`card-title-${t.card_id}`,onDblClick:Y},t.card_title||"Untitled"),Z,me,ce,o("div",{style:fe,"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:ie,"data-role":"delete","data-testid":`card-delete-${t.card_id}`,onClick:W,"aria-label":`Delete ${t.card_title}`,tabIndex:-1},"\xD7"),o("div",{style:le,"data-role":"resize",onMouseDown:P,"aria-label":"Resize card"}),...ee,Me)}function yn(e){let{container:t,selected:n=!1,highlighted:r=!1,onSelect:i,onMove:s,onResize:a,onDelete:l,onDrop:d,onDragStart:u,onDragEnd:h,onContainerContextMenu:m,children:c}=e,[p,f]=U(!1),[y,x]=U(!1),[g,b]=U(!1),S=ne(null),I=ne(null),A=v(M=>{M.stopPropagation(),l&&l(t.container_id)},[t.container_id,l]),C=v(M=>{M.stopPropagation(),x(F=>!F)},[]),T=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),m&&m(t.container_id,{x:F.clientX,y:F.clientY})},[t.container_id,m]),L=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),i&&i(t.container_id),u&&u(t.container_id),b(!0),S.current={x:F.clientX,y:F.clientY,posX:t.position.x,posY:t.position.y};let P=_=>{let O=_;if(!S.current)return;let Y=O.clientX-S.current.x,K=O.clientY-S.current.y;s&&s(t.container_id,{x:S.current.posX+Y,y:S.current.posY+K})},W=()=>{S.current=null,b(!1),h&&h(t.container_id),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.position.x,t.position.y,i,s,u,h]),R=v(M=>{let F=M;F.preventDefault(),F.stopPropagation(),I.current={x:F.clientX,y:F.clientY,w:t.size.width,h:t.size.height};let P=_=>{let O=_;if(!I.current)return;let Y=O.clientX-I.current.x,K=O.clientY-I.current.y,Q=Math.max(160,I.current.w+Y),q=Math.max(120,I.current.h+K);a&&a(t.container_id,{width:Q,height:q})},W=()=>{I.current=null,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",W)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",W)},[t.container_id,t.size.width,t.size.height,a]),$=v(M=>{M.preventDefault(),f(!0)},[]),B=v(()=>{f(!1)},[]),E=v(M=>{let F=M;if(F.preventDefault(),f(!1),d&&F.dataTransfer){let P=F.dataTransfer.getData("text/plain");P&&d(P,t.container_id)}},[t.container_id,d]),N=r||p,z={position:"absolute",left:`${t.position.x}px`,top:`${t.position.y}px`,width:`${t.size.width}px`,height:`${t.size.height}px`,backgroundColor:r?"#eff6ff":"#ffffff",border:r?"2px dashed #3b82f6":n?"2px solid #3b82f6":"2px solid #d1d5db",borderRadius:"8px",boxShadow:N?"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:g?"9999":"0",boxSizing:"border-box",transition:"border 150ms ease, background-color 150ms ease, box-shadow 150ms ease"},k={padding:"6px 12px",borderBottom:"1px solid #e5e7eb",backgroundColor:"#f9fafb",cursor:"grab",userSelect:"none",textAlign:"center",fontWeight:"700",fontSize:"15px",color:"#1f2937",flexShrink:"0"},w={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:z,"data-container-id":t.container_id,"data-testid":`container-${t.container_id}`,role:"group","aria-label":`Container: ${t.name}`,onDragOver:$,onDragLeave:B,onDrop:E,onContextMenu:T},o("div",{className:"board-container__title",style:{...k,display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseDown:L,"data-testid":`container-title-${t.container_id}`},o("span",null,t.name),o("span",{style:{display:"flex",gap:"4px"}},o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"12px",padding:"0 2px",lineHeight:"1"},onClick:C,"aria-label":y?"Expand container":"Minimize container",title:y?"Expand":"Minimize"},y?"\u25B2":"\u2014"),o("button",{style:{border:"none",backgroundColor:"transparent",cursor:"pointer",color:"#94a3b8",fontSize:"14px",padding:"0 2px",lineHeight:"1"},onClick:A,"aria-label":"Delete container",title:"Delete"},"\xD7"))),y?null:o("div",{className:"board-container__contents",style:w,"data-testid":`container-contents-${t.container_id}`},c),y?null:o("div",{style:D,"data-role":"resize",onMouseDown:R,"aria-label":"Resize container"}))}function Ui(e){let t=e.position.x+e.size.width/2,n=e.position.y+e.size.height/2;return{top:{x:t,y:e.position.y},right:{x:e.position.x+e.size.width,y:n},bottom:{x:t,y:e.position.y+e.size.height},left:{x:e.position.x,y:n}}}function Sd(e,t){let n=Ui(e),r=Ui(t),i=[n.top,n.right,n.bottom,n.left],s=[r.top,r.right,r.bottom,r.left],a=1/0,l=n.right,d=r.left;for(let u=0;u<i.length;u++)for(let h=0;h<s.length;h++){let m=s[h].x-i[u].x,c=s[h].y-i[u].y,p=m*m+c*c;p<a&&(a=p,l=i[u],d=s[h])}return{from:l,to:d}}var ji="board-card-link-arrowhead";function Sn(e){let{links:t,cards:n,selectedLinkId:r,onSelectLink:i,onLinkContextMenu:s,canvasWidth:a,canvasHeight:l}=e,d=new Map;for(let p=0;p<n.length;p++)d.set(n[p].card_id,n[p]);let u=v(p=>{i(p)},[i]),h=[];for(let p=0;p<t.length;p++){let{source:f,link:y}=t[p],x=d.get(y.target_card_id);if(!x)continue;let{from:g,to:b}=Sd(f,x),S=y.link_id===r,I=S?"#3b82f6":y.color||"#94a3b8",A=b.x-g.x,C=b.y-g.y,T=Math.sqrt(A*A+C*C),L=Math.min(40,T*.15),R=T>0?-C/T:0,$=T>0?A/T:0,B=(g.x+b.x)/2,E=(g.y+b.y)/2,N=B+R*L,z=E+$*L,k=`M ${g.x} ${g.y} Q ${N} ${z} ${b.x} ${b.y}`,w=f.card_id;h.push(o("path",{key:`hit-${y.link_id}`,d:k,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer",pointerEvents:"stroke"},onClick:()=>u(y.link_id),onContextMenu:D=>{let M=D;M.preventDefault(),M.stopPropagation(),s&&s(y.link_id,w,{x:M.clientX,y:M.clientY})},"data-testid":`link-hit-${y.link_id}`})),h.push(o("path",{key:y.link_id,d:k,fill:"none",stroke:I,"stroke-width":S?"3":"2","pointer-events":"none","marker-end":`url(#${ji})`,"data-testid":`link-${y.link_id}`})),y.link_name&&h.push(o("text",{key:`label-${y.link_id}`,x:String(N),y:String(z-6),"text-anchor":"middle",fill:"#64748b","font-size":"11","pointer-events":"none","data-testid":`link-label-${y.link_id}`},y.link_name))}let m={position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible",zIndex:"9999"},c=o("defs",{},o("marker",{id:ji,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:m,width:String(a),height:String(l),className:"card-link-overlay","data-testid":"card-link-overlay",role:"img","aria-label":"Card links"},c,o("g",{style:{pointerEvents:"auto"}},...h))}var vd=[{value:"#fef9c3",label:"Yellow"},{value:"#fecaca",label:"Red"},{value:"#fed7aa",label:"Orange"},{value:"#bbf7d0",label:"Green"},{value:"#bfdbfe",label:"Blue"},{value:"#ddd6fe",label:"Purple"},{value:"#fbcfe8",label:"Pink"},{value:"#e5e7eb",label:"Gray"}],mo=20,Et=5e3;function wd(e,t){let n=new Set,r=[...e],i=null;for(;r.length>0;){let a=r.pop();if($e(a)&&a.container_id===t){i=a;break}if($e(a))for(let l=0;l<a.contents.length;l++)r.push(a.contents[l])}if(!i||!$e(i))return n;let s=[...i.contents];for(;s.length>0;){let a=s.pop();if($e(a)){n.add(a.container_id);for(let l=0;l<a.contents.length;l++)s.push(a.contents[l])}}return n}function kd(e,t,n,r){let i=new Set;if(r){i.add(r);let d=wd(e,r);for(let u of d)i.add(u)}let s=null,a=-1,l=[[e,0,0,0]];for(;l.length>0;){let[d,u,h,m]=l.pop();for(let c=0;c<d.length;c++){let p=d[c];if(!$e(p)||i.has(p.container_id))continue;let f=p.position.x+u,y=p.position.y+h;t>=f&&t<=f+p.size.width&&n>=y&&n<=y+p.size.height&&(m>a&&(s=p.container_id,a=m),p.contents.length>0&&l.push([p.contents,f,y+30,m+1]))}}return s}function Xi(e,t){return{x:Math.round(e.x/t)*t,y:Math.round(e.y/t)*t}}function Gi(e,t){let n=[[e,null]];for(;n.length>0;){let[r,i]=n.pop();for(let s=0;s<r.length;s++){let a=r[s];if(Xe(a)===t)return i;$e(a)&&n.push([a.contents,a.container_id])}}return null}function Ki(e,t,n){return{x:(e-n.panX)/n.zoom,y:(t-n.panY)/n.zoom}}function Cd(e){let t=[],n=[],r=[];for(let i=e.length-1;i>=0;i--)r.push([e[i],0,0]);for(;r.length>0;){let[i,s,a]=r.pop();if(Le(i)){let l={...i,position:{x:i.position.x+s,y:i.position.y+a}};t.push(l);for(let d=0;d<i.card_link.length;d++)n.push({source:l,link:i.card_link[d]})}else if($e(i)){let l=s+i.position.x,d=a+i.position.y+30;for(let u=i.contents.length-1;u>=0;u--)r.push([i.contents[u],l,d])}}return{cards:t,links:n}}function Nt(e){let{state:t,dispatch:n,selectedId:r=null,onSelectItem:i,gridEnabled:s=!1,searchQuery:a="",colorFilter:l=null,onOpenProject:d,onCardContextMenu:u,onUpdateItem:h}=e,{collection:m,viewport:c}=t,p=ne(null),f=ne(!1),y=ne(null),[x,g]=U(null),[b,S]=U(null),[I,A]=U(null),[C,T]=U(null),[L,R]=U(!1),[$,B]=U(!1),[E,N]=U(null),[z,k]=U(null),w=v(se=>{let pe=se,Se=pe.target;if(Se.closest(".board-card")||Se.closest(".board-container"))return;let we=pe.button===1,Ie=pe.button===0&&pe.shiftKey;we||Ie?(pe.preventDefault(),f.current=!0,y.current={x:pe.clientX,y:pe.clientY,panX:c.panX,panY:c.panY}):pe.button===0&&i&&i(null)},[c.panX,c.panY,i]);re(()=>{let se=Se=>{if(!f.current||!y.current)return;let we=Se,Ie=we.clientX-y.current.x,Be=we.clientY-y.current.y;n({type:"PAN",panX:y.current.panX+Ie,panY:y.current.panY+Be})},pe=()=>{f.current=!1,y.current=null};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[n]);let D=v(se=>{let pe=se;if(!pe.ctrlKey)return;pe.preventDefault();let Se=pe.deltaY>0?-.1:.1;n({type:"ZOOM",zoom:c.zoom+Se})},[c.zoom,n]),M=ne(null);re(()=>{let se=p.current;if(!se)return;let pe=Ae=>{let De=[];for(let ue=0;ue<Ae.touches.length;ue++)De.push({x:Ae.touches[ue].clientX,y:Ae.touches[ue].clientY});return De},Se=(Ae,De)=>Math.sqrt((Ae.x-De.x)**2+(Ae.y-De.y)**2),we=Ae=>{let De=Ae;if(De.touches.length===2){De.preventDefault();let ue=pe(De);M.current={touches:ue,panX:c.panX,panY:c.panY,zoom:c.zoom,dist:Se(ue[0],ue[1])}}},Ie=Ae=>{let De=Ae;if(De.touches.length!==2||!M.current)return;De.preventDefault();let ue=pe(De),ve=M.current,ke=(ve.touches[0].x+ve.touches[1].x)/2,Pe=(ve.touches[0].y+ve.touches[1].y)/2,Ke=(ue[0].x+ue[1].x)/2,Qe=(ue[0].y+ue[1].y)/2;n({type:"PAN",panX:ve.panX+(Ke-ke),panY:ve.panY+(Qe-Pe)});let ct=Se(ue[0],ue[1]);ve.dist>0&&n({type:"ZOOM",zoom:ve.zoom*(ct/ve.dist)})},Be=()=>{M.current=null};return se.addEventListener("touchstart",we,{passive:!1}),se.addEventListener("touchmove",Ie,{passive:!1}),se.addEventListener("touchend",Be),()=>{se.removeEventListener("touchstart",we),se.removeEventListener("touchmove",Ie),se.removeEventListener("touchend",Be)}},[c.panX,c.panY,c.zoom,n]);let F=v((se,pe)=>{T({cardId:se,x:pe.x,y:pe.y}),R(!1),B(!1),u&&u(se,pe)},[u]),P=v(()=>{T(null),R(!1),B(!1)},[]);re(()=>{if(!C)return;let se=()=>{P()};return document.addEventListener("click",se),()=>{document.removeEventListener("click",se)}},[C,P]);let W=v((se,pe,Se)=>{k({linkId:se,cardId:pe,x:Se.x,y:Se.y}),P()},[P]),_=v(()=>{k(null)},[]);re(()=>{if(!z)return;let se=()=>_();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[z,_]);let O=v((se,pe)=>{N({containerId:se,x:pe.x,y:pe.y}),P(),_()},[P,_]),Y=v(()=>{N(null)},[]);re(()=>{if(!E)return;let se=()=>Y();return document.addEventListener("click",se),()=>document.removeEventListener("click",se)},[E,Y]);let K=v(se=>{i&&i(se)},[i]),Q=v((se,pe)=>{let Se=pe;if(s&&(Se=Xi(pe,mo)),n({type:"MOVE_ITEM",itemId:se,position:Se}),V.current===se){let Ie=0,Be=0,Ae=[...m];for(;Ae.length>0;){let ke=Ae.pop();if(Xe(ke)===se){Ie=ke.size.width,Be=ke.size.height;break}if($e(ke))for(let Pe=0;Pe<ke.contents.length;Pe++)Ae.push(ke.contents[Pe])}let De=Se.x+Ie/2,ue=Se.y+Be/2,ve=kd(m,De,ue,se);g(ve)}},[n,s,m]),q=v((se,pe)=>{n({type:"RESIZE_ITEM",itemId:se,size:pe})},[n]),H=v(se=>{n({type:"REMOVE_ITEM",itemId:se}),i&&r===se&&i(null)},[n,r,i]),j=v((se,pe)=>{n({type:"NEST_ITEM",itemId:se,containerId:pe})},[n]),G=v(se=>{S(se),V.current=se,g(null)},[]),V=ne(null);V.current=b;let Z=ne(null);Z.current=x;let te=v(se=>{let pe=Z.current;pe&&n({type:"NEST_ITEM",itemId:se,containerId:pe}),S(null),V.current=null,g(null)},[n]),ae=v((se,pe,Se)=>{A({fromCardId:se,fromAnchor:pe,fromPos:Se,currentPos:Se})},[]),J=ne(null);J.current=I,re(()=>{if(!I)return;let se=Se=>{let we=Se,Ie=0,Be=0;if(p.current){let De=p.current.getBoundingClientRect();Ie=De.left,Be=De.top}let Ae=Ki(we.clientX-Ie,we.clientY-Be,c);A(De=>De?{...De,currentPos:Ae}:null)},pe=Se=>{let we=Se,Ie=J.current;if(!Ie){A(null);return}let Be=document.elementFromPoint(we.clientX,we.clientY);if(Be&&Be.dataset&&Be.dataset.role==="anchor"&&Be.dataset.anchor){let Ae=Be.closest("[data-card-id]");if(Ae&&Ae.dataset.cardId&&Ae.dataset.cardId!==Ie.fromCardId){let De=Ae.dataset.cardId;n({type:"ADD_LINK",cardId:Ie.fromCardId,link:{link_id:qe(),link_name:"relates to",target_card_id:De,color:"#94a3b8",attributes:{}}})}}A(null)};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",pe),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",pe)}},[I!==null,c.panX,c.panY,c.zoom,n]);let ie=a.toLowerCase(),le=new Set,fe=[],oe=[...m];for(;oe.length>0;){let se=oe.pop();if(fe.push(se),$e(se))for(let pe=0;pe<se.contents.length;pe++)oe.push(se.contents[pe])}if(ie)for(let se=0;se<fe.length;se++){let pe=fe[se];(Le(pe)?pe.card_title:pe.name).toLowerCase().includes(ie)||le.add(Xe(pe))}if(l)for(let se=0;se<fe.length;se++){let pe=fe[se];Le(pe)&&pe.color!==l&&le.add(pe.card_id)}let{cards:ge,links:he}=Cd(m);function ee(se){let pe=Xe(se),Se=le.has(pe),we;if(Le(se))we=o(xn,{key:pe,card:se,selected:pe===r,onSelect:K,onMove:Q,onResize:q,onDelete:H,dispatch:n,onOpenProject:d,onCardContextMenu:F,onUpdate:h,onDragStart:G,onDragEnd:te,onAnchorDragStart:ae});else{let Ie=se.contents.map(Be=>ee(Be));we=o(yn,{key:pe,container:se,selected:pe===r,highlighted:x===se.container_id,onSelect:K,onMove:Q,onResize:q,onDelete:H,onDrop:j,onDragStart:G,onDragEnd:te,onContainerContextMenu:O},...Ie)}return Se?o("div",{key:`dim-${pe}`,style:{opacity:"0.3"}},we):we}let ce=m.map(se=>ee(se)),me={flex:"1",overflow:"hidden",position:"relative",backgroundColor:"#f8fafc",cursor:"default",backgroundImage:s?"radial-gradient(circle, #d1d5db 1px, transparent 1px)":"none",backgroundSize:`${mo}px ${mo}px`},xe={transform:`translate(${c.panX}px, ${c.panY}px) scale(${c.zoom})`,transformOrigin:"0 0",position:"relative",width:`${Et}px`,height:`${Et}px`},ye={padding:"6px 12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",whiteSpace:"nowrap",fontSize:"13px",color:"#1a1a1a"},Me={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"},de={height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"},be=C?o("div",{className:"board-context-menu",style:{position:"fixed",left:`${C.x}px`,top:`${C.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":`board-context-menu-${C.cardId}`,role:"menu","aria-label":"Card context menu",onClick:se=>se.stopPropagation()},o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{R(!0),B(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-color-${C.cardId}`},"Change Color",o("span",{style:{marginLeft:"8px"}},"\u25B6"),L?o("div",{style:Me,role:"menu","data-testid":`board-ctx-color-submenu-${C.cardId}`},...vd.map(se=>o("div",{key:se.value,style:{...ye,gap:"8px"},onClick:pe=>{pe.stopPropagation(),n({type:"UPDATE_CARD",cardId:C.cardId,updates:{color:se.value}}),P()},role:"menuitem","data-testid":`board-ctx-color-${se.label.toLowerCase()}-${C.cardId}`},o("span",{style:{display:"inline-block",width:"14px",height:"14px",borderRadius:"3px",backgroundColor:se.value,border:"1px solid #d1d5db",flexShrink:"0"}}),se.label))):null),o("div",{style:{...ye,position:"relative"},onMouseEnter:()=>{B(!0),R(!1)},role:"menuitem","aria-haspopup":"true","data-testid":`board-ctx-change-type-${C.cardId}`},"Change Type",o("span",{style:{marginLeft:"8px"}},"\u25B6"),$?o("div",{style:Me,role:"menu","data-testid":`board-ctx-type-submenu-${C.cardId}`},...Ft.map(se=>o("div",{key:se.value,style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"CHANGE_CARD_TYPE",cardId:C.cardId,newType:se.value}),P()},role:"menuitem","data-testid":`board-ctx-type-${se.value}-${C.cardId}`},se.label))):null),(()=>{let se=Gi(m,C.cardId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:C.cardId,containerId:se}),P()},role:"menuitem","data-testid":`board-ctx-detach-${C.cardId}`},"Detach Card"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:C.cardId}),i&&r===C.cardId&&i(null),P()},role:"menuitem","data-testid":`board-ctx-delete-${C.cardId}`},"Delete")):null,Ee=E?o("div",{className:"board-container-context-menu",role:"menu",style:{position:"fixed",left:`${E.x}px`,top:`${E.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"10001",minWidth:"160px"},"data-testid":`board-container-ctx-menu-${E.containerId}`},(()=>{let se=Gi(m,E.containerId);return se?o("div",{style:ye,onClick:pe=>{pe.stopPropagation(),n({type:"UNNEST_ITEM",itemId:E.containerId,containerId:se}),Y()},role:"menuitem","data-testid":`board-ctx-detach-container-${E.containerId}`},"Detach Container"):null})(),o("div",{style:de,role:"separator"}),o("div",{style:{...ye,color:"#dc2626"},onClick:se=>{se.stopPropagation(),n({type:"REMOVE_ITEM",itemId:E.containerId}),i&&r===E.containerId&&i(null),Y()},role:"menuitem","data-testid":`board-ctx-delete-container-${E.containerId}`},"Delete")):null,Re=["relates to","depends on","blocks","is blocked by","implements","is implemented by","extends","includes","references","duplicates","parent of","child of"],Ne=z?o("div",{className:"board-link-context-menu",style:{position:"fixed",left:`${z.x}px`,top:`${z.y}px`,backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",maxHeight:"240px",overflowY:"auto",zIndex:"10001",fontSize:"13px"},onClick:se=>se.stopPropagation()},o("div",{style:{padding:"4px 14px",fontSize:"11px",color:"#94a3b8",fontWeight:"600"}},"Edge Type"),...Re.map(se=>o("button",{key:se,style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},onClick:()=>{n({type:"UPDATE_CARD",cardId:z.cardId,updates:{card_link:(()=>{let pe=null,Se=[...m];for(;Se.length>0;){let we=Se.pop();if(Le(we)&&we.card_id===z.cardId){pe=we;break}if($e(we))for(let Ie of we.contents)Se.push(Ie)}return pe?pe.card_link.map(we=>we.link_id===z.linkId?{...we,link_name:se}:we):[]})()}}),_()},role:"menuitem"},se)),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:{display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#ef4444",fontFamily:"inherit"},onClick:()=>{n({type:"REMOVE_LINK",cardId:z.cardId,linkId:z.linkId}),_()},role:"menuitem"},"Delete Link")):null;return o("div",{ref:p,className:"board-canvas",style:me,onMouseDown:w,onWheel:D,"data-testid":"board-canvas",role:"application","aria-label":`Board: ${t.name}`,tabIndex:0},o("div",{className:"board-canvas__inner",style:xe,"data-testid":"board-canvas-inner"},o(Sn,{links:he,cards:ge,selectedLinkId:null,onSelectLink:()=>{},onLinkContextMenu:W,canvasWidth:Et,canvasHeight:Et}),I?o("svg",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},width:String(Et),height:String(Et),className:"link-drag-overlay","data-testid":"link-drag-overlay"},o("line",{x1:String(I.fromPos.x),y1:String(I.fromPos.y),x2:String(I.currentPos.x),y2:String(I.currentPos.y),stroke:"#3b82f6","stroke-width":"2","stroke-dasharray":"6 4","pointer-events":"none","data-testid":"link-drag-line"})):null,...ce),be,Ee,Ne)}function Md(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function qi(e,t,n,r){let i=r??40,s=Md(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 g=0;g<s.length;g++){let b=s[g];b.position.x<a&&(a=b.position.x),b.position.y<l&&(l=b.position.y);let S=b.position.x+b.size.width,I=b.position.y+b.size.height;S>d&&(d=S),I>u&&(u=I)}let h=d-a+i*2,m=u-l+i*2,c=t/h,p=n/m,f=Math.max(.25,Math.min(4,Math.min(c,p))),y=-a*f+(t-(d-a)*f)/2,x=-l*f+(n-(u-l)*f)/2;return{panX:y,panY:x,zoom:f}}var go=["#fef9c3","#fecaca","#fed7aa","#bbf7d0","#bfdbfe","#ddd6fe","#fbcfe8","#e5e7eb"];function Zi(e){let{zoom:t,gridEnabled:n,selectedColor:r,colorFilter:i,onNewCard:s,onZoomIn:a,onZoomOut:l,onZoomReset:d,onColorSelect:u,onColorFilter:h,onGridToggle:m,onSearch:c}=e,[p,f]=U(""),y=v(T=>{let L=T.target.value;f(L),c(L)},[c]),x={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"},g={padding:"4px 10px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"12px",color:"#374151",lineHeight:"1.4"},b={...g,backgroundColor:"#3b82f6",color:"#ffffff",borderColor:"#3b82f6"},S={fontSize:"12px",color:"#64748b",minWidth:"40px",textAlign:"center",cursor:"pointer"},I={width:"1px",height:"20px",backgroundColor:"#e2e8f0",margin:"0 4px"},A={padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",width:"120px",outline:"none"},C=go.map(T=>{let L=T===r,R=T===i,$=()=>{L&&h?h(R?null:T):u(T)},B="1px solid rgba(0,0,0,0.15)";return R?B="3px solid #ef4444":L&&(B="2px solid #3b82f6"),o("button",{key:T,title:T,style:{width:"18px",height:"18px",borderRadius:"50%",backgroundColor:T,border:B,cursor:"pointer",padding:"0",flexShrink:"0",opacity:R?"1":i?"0.5":"1"},onClick:$,"aria-label":R?`Clear color filter ${T}`:`Select color ${T}`,"data-testid":`color-swatch-${T}`})});return o("div",{className:"board-toolbar",style:x,role:"toolbar","aria-label":"Board toolbar","data-testid":"board-toolbar"},o("button",{style:g,onClick:s,"data-testid":"btn-new-card","aria-label":"New card"},"+ New Card"),o("div",{style:I}),o("button",{style:g,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:g,onClick:a,"data-testid":"btn-zoom-in","aria-label":"Zoom in"},"+"),o("div",{style:I}),...C,o("div",{style:I}),o("button",{style:n?b:g,onClick:m,"data-testid":"btn-grid-toggle","aria-label":n?"Disable grid snapping":"Enable grid snapping","aria-pressed":String(n)},"Grid"),o("div",{style:I}),o("input",{type:"text",placeholder:"Search cards...",value:p,onInput:y,style:A,"data-testid":"search-input","aria-label":"Search cards"}))}var Ji=50,tt={id:qe(),name:"Untitled",collection:[],viewport:{panX:0,panY:0,zoom:1}};function Qi(e,t){let n=null;function r(s){let a=[];for(let l=0;l<s.length;l++){let d=s[l];if(Xe(d)===t){n=d;continue}if($e(d)){let h=r(d.contents);a.push({...d,contents:h})}else a.push(d)}return a}return[r(e),n]}function ft(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];Xe(s)===t?r.push(n(s)):$e(s)?r.push({...s,contents:ft(s.contents,t,n)}):r.push(s)}return r}function vn(e,t,n){let r=[];for(let i=0;i<e.length;i++){let s=e[i];$e(s)&&s.container_id===t?r.push({...s,contents:[...s.contents,n]}):$e(s)?r.push({...s,contents:vn(s.contents,t,n)}):r.push(s)}return r}function es(e,t){let n=[...e];for(;n.length>0;){let r=n.pop();if($e(r)){if(r.container_id===t)return r;for(let i=0;i<r.contents.length;i++)n.push(r.contents[i])}}return null}function Ed(e,t,n){let r=null;function i(a){let l=[];for(let d=0;d<a.length;d++){let u=a[d];if($e(u)&&u.container_id===t){let h=[];for(let m=0;m<u.contents.length;m++){let c=u.contents[m];Xe(c)===n?r=c:h.push(c)}l.push({...u,contents:h})}else $e(u)?l.push({...u,contents:i(u.contents)}):l.push(u)}return l}return[i(e),r]}function Id(e){switch(e){case"text":return{text:""};case"json":return{};case"task":return{};case"project":return{project_id:"",project_name:""}}}function wn(e,t){switch(t.type){case"ADD_ITEM":return t.containerId?{...e,collection:vn(e.collection,t.containerId,t.item)}:{...e,collection:[...e.collection,t.item]};case"REMOVE_ITEM":{let[n]=Qi(e.collection,t.itemId);return{...e,collection:n}}case"MOVE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,position:t.position,...Le(n)?{updatedAt:Date.now()}:{}}))};case"RESIZE_ITEM":return{...e,collection:ft(e.collection,t.itemId,n=>({...n,size:t.size,...Le(n)?{updatedAt:Date.now()}:{}}))};case"UPDATE_CARD":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,...t.updates,updatedAt:Date.now()}:n)};case"CHANGE_CARD_TYPE":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_type:t.newType,content:Id(t.newType),updatedAt:Date.now()}:n)};case"ADD_CONTAINER":return t.parentContainerId?{...e,collection:vn(e.collection,t.parentContainerId,t.container)}:{...e,collection:[...e.collection,t.container]};case"NEST_ITEM":{let n=es(e.collection,t.containerId);if(!n)return e;let[r,i]=Qi(e.collection,t.itemId);if(!i)return e;let s={...i,position:{x:i.position.x-n.position.x,y:i.position.y-n.position.y-30}};return{...e,collection:vn(r,t.containerId,s)}}case"UNNEST_ITEM":{let n=es(e.collection,t.containerId),[r,i]=Ed(e.collection,t.containerId,t.itemId);if(!i)return e;let s=n?{...i,position:{x:i.position.x+n.position.x,y:i.position.y+n.position.y+30}}:i;return{...e,collection:[...r,s]}}case"ADD_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(n)?{...n,card_link:[...n.card_link,t.link],updatedAt:Date.now()}:n)};case"REMOVE_LINK":return{...e,collection:ft(e.collection,t.cardId,n=>Le(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 Rd(e){return e.type==="PAN"||e.type==="ZOOM"}function kn(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=wn(e.present,t.action);if(n===e.present)return e;if(Rd(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>Ji&&r.splice(0,r.length-Ji),{past:r,present:n,future:[]}}default:return e}}function Wt(e){let t={past:[],present:e||tt,future:[]},[n,r]=An(kn,t),i=v(l=>{r({type:"BOARD_ACTION",action:l})},[r]),s=v(()=>{r({type:"UNDO"})},[r]),a=v(()=>{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 ts(e,t){let{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=Wt(),d=ne(!1);re(()=>{e&&t&&!d.current&&(d.current=!0,e.load(t).then(m=>{r({type:"SET_BOARD",state:m})}).catch(()=>{}))},[e,t,r]);let u=ne(null),h=ne(n);return h.current=n,re(()=>{if(!(!e||!t))return u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{e.save(t,h.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 Cn=class{async load(t){try{let n=localStorage.getItem("board:"+t);return n?JSON.parse(n):{...tt}}catch{return{...tt}}}async save(t,n){try{localStorage.setItem("board:"+t,JSON.stringify(n))}catch{}}};function Pd(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}function ns(e){let{collection:t,onCardDropped:n,children:r}=e,i=st(),s=ne([]);re(()=>{let u=Pd(t),h=s.current,m=new Set(h.map(p=>p.card_id)),c=new Set(u.map(p=>p.card_id));for(let p of u)m.has(p.card_id)||i.publish("project-board",{event:"card-created",card:p});for(let p of h)c.has(p.card_id)||i.publish("project-board",{event:"card-deleted",cardId:p.card_id});for(let p of u)if(m.has(p.card_id)){let f=h.find(y=>y.card_id===p.card_id);f&&f.updatedAt!==p.updatedAt&&i.publish("project-board",{event:"card-updated",card:p})}s.current=u},[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 h=u.data;n(String(h.title||"Dropped Item"),String(h.description||""))}},[n]),{isOver:l}=At({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 Td=new Cn;function os(e){let t=[],n=[...e];for(;n.length>0;){let r=n.pop();if(Le(r))t.push(r);else if($e(r))for(let i=r.contents.length-1;i>=0;i--)n.push(r.contents[i])}return t}var at=Date.now(),$d={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:at,updatedAt:at},{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:at,updatedAt:at},{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:at,updatedAt:at},{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:at,updatedAt:at}],viewport:{panX:0,panY:0,zoom:1}};function Dd(e){return e.collection.length===0}function rs(e){let t=e.boardId||"default",{state:n,dispatch:r,undo:i,redo:s,canUndo:a,canRedo:l}=ts(Td,t),[d,u]=U(go[0]),[h,m]=U(!1),[c,p]=U(""),[f,y]=U(null),[x,g]=U(null),[b,S]=U(n.name||"Untitled"),[I,A]=U(!1),[C,T]=U(""),[L,R]=U(null),[$,B]=U(!0),[E,N]=U([{name:"relates to",weight:1},{name:"depends on",weight:2},{name:"blocks",weight:3},{name:"is blocked by",weight:3},{name:"implements",weight:2},{name:"references",weight:1}]),[z,k]=U(null),[w,D]=U(""),[M,F]=U("1"),[P,W]=U([]),_=ne(!1);re(()=>{!_.current&&Dd(n)?(_.current=!0,r({type:"SET_BOARD",state:$d})):n.collection.length>0&&(_.current=!0)},[n,r]);let O=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200,Ke={type:"card",card_id:qe(),card_type:"text",card_title:"New Card",card_link:[],content:{text:""},color:d,position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:Ke})},[n.viewport,d,r]),Y=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom+.1})},[n.viewport.zoom,r]),K=v(()=>{r({type:"ZOOM",zoom:n.viewport.zoom-.1})},[n.viewport.zoom,r]),Q=v(()=>{r({type:"ZOOM",zoom:1})},[r]),q=v(()=>{m(ue=>!ue)},[]),H=v(ue=>{p(ue)},[]),j=v(ue=>{y(ue)},[]),G=v(ue=>{g(ue)},[]),V=v(()=>{B(ue=>!ue)},[]),Z=v(()=>{r({type:"SET_BOARD",state:tt}),y(null)},[r]),te=v(()=>{let ue=JSON.stringify(n,null,2),ve=new Blob([ue],{type:"application/json"}),ke=URL.createObjectURL(ve),Pe=document.createElement("a");Pe.href=ke,Pe.download=`board-${t}.json`,Pe.style.display="none",document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(ke)},[n,t]),ae=v(()=>{let ue=document.createElement("input");ue.type="file",ue.accept=".json,application/json",ue.style.display="none",ue.addEventListener("change",()=>{let ve=ue.files&&ue.files[0];if(!ve)return;let ke=new FileReader;ke.onload=()=>{try{let Pe=JSON.parse(ke.result);Pe&&Pe.collection&&Pe.viewport&&r({type:"SET_BOARD",state:Pe})}catch{}},ke.readAsText(ve)}),document.body.appendChild(ue),ue.click(),document.body.removeChild(ue)},[r]),J=v(()=>{window.print()},[]),ie=os(n.collection),le=v(()=>{let ue=os(n.collection);ue.length>0&&y(ue[0].card_id)},[n.collection]),fe=v(()=>{f&&(r({type:"REMOVE_ITEM",itemId:f}),y(null))},[f,r]),oe=v(()=>{if(n.collection.length===0)return;let ke=qi(n.collection,800,600);r({type:"PAN",panX:ke.panX,panY:ke.panY}),r({type:"ZOOM",zoom:ke.zoom})},[n.collection,r]);re(()=>{let ue={menus:[{label:"File",items:[{label:"New Board",onClick:Z},{label:"Export JSON",onClick:te},{label:"Import JSON",onClick:ae},{divider:!0},{label:"Print",onClick:J}]},{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:le},{label:"Delete Selected",onClick:fe}]},{label:"View",items:[{label:"Zoom In",onClick:Y},{label:"Zoom Out",onClick:K},{label:"Fit All",onClick:oe},{divider:!0},{label:"Toggle Grid",onClick:q}]}]}},[Z,te,ae,J,i,s,a,l,le,fe,Y,K,oe,q]),re(()=>{let ue=ve=>{let ke=ve;ke.ctrlKey&&ke.key==="z"?(ke.preventDefault(),i()):ke.ctrlKey&&ke.key==="y"&&(ke.preventDefault(),s())};return document.addEventListener("keydown",ue),()=>document.removeEventListener("keydown",ue)},[i,s]),re(()=>{if(!L)return;let ue=()=>R(null),ve=setTimeout(()=>document.addEventListener("click",ue),0);return()=>{clearTimeout(ve),document.removeEventListener("click",ue)}},[L]);let ge=v(()=>{T(b),A(!0)},[b]),he=v(()=>{let ue=C.trim();ue&&(S(ue),r({type:"RENAME_BOARD",name:ue}),e.onTitleChange&&e.onTitleChange(`Project Board: ${ue}`)),A(!1)},[C,r,e.onTitleChange]),ee=v(()=>{A(!1)},[]),ce=v(ue=>{T(ue.target.value)},[]),me=v(ue=>{let ve=ue;ve.key==="Enter"&&(ve.preventDefault(),he()),ve.key==="Escape"&&(ve.preventDefault(),ee())},[he,ee]),xe={display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#f8fafc",overflow:"hidden"},ye=v((ue,ve)=>{let ke=(-n.viewport.panX+300)/n.viewport.zoom,Pe=(-n.viewport.panY+200)/n.viewport.zoom,Ke=(Math.random()-.5)*300,Qe=(Math.random()-.5)*200,ct={type:"card",card_id:qe(),card_type:"text",card_title:ue,card_link:[],content:{text:ve},color:d,position:{x:Math.round(ke+Ke),y:Math.round(Pe+Qe)},size:{width:180,height:120},priority:"medium",createdAt:Date.now(),updatedAt:Date.now()};r({type:"ADD_ITEM",item:ct})},[n.viewport,d,r]),Me={display:"flex",alignItems:"center",height:"28px",backgroundColor:"#f1f5f9",borderBottom:"1px solid #e2e8f0",padding:"0 8px",fontSize:"13px",flexShrink:"0"},de={padding:"2px 10px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"13px",color:"#334155",borderRadius:"4px",fontFamily:"inherit"},be=v(()=>{let ue=(-n.viewport.panX+300)/n.viewport.zoom,ve=(-n.viewport.panY+200)/n.viewport.zoom,ke=(Math.random()-.5)*300,Pe=(Math.random()-.5)*200;r({type:"ADD_CONTAINER",container:{type:"container",container_id:qe(),name:"New Container",position:{x:Math.round(ue+ke),y:Math.round(ve+Pe)},size:{width:300,height:250},contents:[]}}),R(null)},[n.viewport,r]),Ee={position:"absolute",top:"100%",left:"0",marginTop:"2px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px",zIndex:"1000"},Re={display:"block",width:"100%",padding:"6px 14px",border:"none",backgroundColor:"transparent",textAlign:"left",cursor:"pointer",fontSize:"13px",color:"#334155",fontFamily:"inherit",boxSizing:"border-box"},Ne=o("div",{style:Me,"data-testid":"app-menu-bar"},o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>R(L==="project"?null:"project")},"Project"),L==="project"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{ge(),R(null)}},"Rename Project..."),o("div",{style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}}),o("button",{style:Re,onClick:()=>{be()}},"New Container"),o("button",{style:Re,onClick:()=>{O(),R(null)}},"New Card")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>R(L==="graphs"?null:"graphs")},"Graphs"),L==="graphs"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{D(""),F("1"),k("add"),R(null)}},"Add Attribute..."),o("button",{style:Re,onClick:()=>{k("delete"),R(null)}},"Delete Attribute..."),o("button",{style:Re,onClick:()=>{W(E.map(ue=>({...ue}))),k("edit"),R(null)}},"Edit Attributes...")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>R(L==="settings"?null:"settings")},"Settings"),L==="settings"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>{q(),R(null)}},h?"Disable Grid Snap":"Enable Grid Snap"),o("button",{style:Re,onClick:()=>{V(),R(null)}},$?"Hide Links":"Show Links")):null),o("div",{style:{position:"relative",display:"inline-flex"}},o("button",{style:de,onClick:()=>R(L==="help"?null:"help")},"Help"),L==="help"?o("div",{style:Ee},o("button",{style:Re,onClick:()=>R(null)},"About Project Board"),o("button",{style:Re,onClick:()=>R(null)},"Keyboard Shortcuts")):null),o("span",{style:{marginLeft:"auto",fontSize:"12px",color:"#94a3b8"}},`Project Board: ${b}`)),se=I?o("div",{style:{position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},onClick:ee},o("div",{style:{backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"300px"},onClick:ue=>ue.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:ce,onKeyDown:me,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:ee,style:{padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"}},"Cancel"),o("button",{onClick:he,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,pe={position:"absolute",inset:"0",backgroundColor:"rgba(0,0,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"200"},Se={backgroundColor:"#ffffff",borderRadius:"8px",padding:"20px",boxShadow:"0 8px 24px rgba(0,0,0,0.2)",minWidth:"320px",maxHeight:"400px",overflow:"auto"},we={fontWeight:"600",fontSize:"14px",marginBottom:"12px",color:"#1a1a1a"},Ie={width:"100%",padding:"8px 10px",border:"1px solid #d1d5db",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box",outline:"none",fontFamily:"inherit"},Be={padding:"6px 14px",border:"none",borderRadius:"6px",backgroundColor:"#3b82f6",color:"#ffffff",cursor:"pointer",fontSize:"13px",fontWeight:"600",fontFamily:"inherit"},Ae={padding:"6px 14px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px",fontFamily:"inherit"},De=null;return z==="add"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Add edge attribute"},o("div",{style:we},"Add Edge Attribute"),o("div",{style:{marginBottom:"8px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Name"),o("input",{type:"text",value:w,style:Ie,placeholder:"e.g. depends on",onInput:ue=>D(ue.target.value)})),o("div",{style:{marginBottom:"12px"}},o("label",{style:{fontSize:"12px",color:"#64748b",display:"block",marginBottom:"4px"}},"Weight"),o("input",{type:"number",value:M,style:Ie,min:"0",step:"1",onInput:ue=>F(ue.target.value)})),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{let ue=w.trim(),ve=parseFloat(M)||1;ue&&N(ke=>[...ke,{name:ue,weight:ve}]),k(null)}},"Add"))))),z==="delete"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:Se,onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Delete edge attribute"},o("div",{style:we},"Delete Edge Attribute"),E.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"4px"}},...E.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},o("span",{style:{fontSize:"13px"}},`${ue.name} (weight: ${ue.weight})`),o("button",{style:{border:"none",backgroundColor:"transparent",color:"#ef4444",cursor:"pointer",fontSize:"16px"},onClick:()=>N(ke=>ke.filter((Pe,Ke)=>Ke!==ve))},"\xD7")))),o("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Done"))))),z==="edit"&&(De=o("div",{style:pe,onClick:()=>k(null)},o("div",{style:{...Se,minWidth:"400px"},onClick:ue=>ue.stopPropagation(),role:"dialog","aria-label":"Edit edge attributes"},o("div",{style:we},"Edit Edge Attributes"),P.length===0?o("div",{style:{color:"#94a3b8",padding:"8px 0"}},"No attributes defined."):o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...P.map((ue,ve)=>o("div",{key:String(ve),style:{display:"flex",alignItems:"center",gap:"8px"}},o("input",{type:"text",value:ue.name,style:{...Ie,flex:"1"},onInput:ke=>{let Pe=ke.target.value;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,name:Pe}:Qe))}}),o("input",{type:"number",value:String(ue.weight),min:"0",step:"1",style:{...Ie,width:"80px"},onInput:ke=>{let Pe=parseFloat(ke.target.value)||0;W(Ke=>Ke.map((Qe,ct)=>ct===ve?{...Qe,weight:Pe}:Qe))}})))),o("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"12px"}},o("button",{style:Ae,onClick:()=>k(null)},"Cancel"),o("button",{style:Be,onClick:()=>{N(P.filter(ue=>ue.name.trim())),k(null)}},"Save"))))),o("div",{className:"project-manager-app",style:xe,"data-testid":"project-manager-app"},Ne,o(Zi,{zoom:n.viewport.zoom,gridEnabled:h,selectedColor:d,colorFilter:x,onNewCard:O,onZoomIn:Y,onZoomOut:K,onZoomReset:Q,onColorSelect:u,onColorFilter:G,onGridToggle:q,onSearch:H}),o(ns,{collection:n.collection,onCardDropped:ye},o(Nt,{state:n,dispatch:r,searchQuery:c,gridEnabled:h,selectedId:f,onSelectItem:j,colorFilter:x,onUpdateItem:(ue,ve)=>{r({type:"UPDATE_CARD",cardId:ue,updates:ve})},onCardContextMenu:(ue,ve)=>{}})),se,De)}var zd=28,Ad=5e3;var is=0;function ss(e){return is++,`${e}-${is}`}function Ld(e){return e.replace(/\s*\(\d+\)$/,"")}function Bd(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 Fd(){let e=st(),t=ne(!1);return re(()=>{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 Nd(){let[e,t]=U([]),n=pt();Dt("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 Wd(e,t,n){let r={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(Ld(e)){case"Files":return o(it,{appId:"files"},o(Nd,null));case"Terminal":return o(it,{appId:"terminal"},o(Fd,null));case"Browser":return o("div",{style:r},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:r},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(s=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},s)));case"Settings":return o("div",{style:r},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(s=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},s)));case"Word Processor":return o(on,null);case"IDE":return o(mn,null);case"Trading":return o(bn,null);case"Project Board":return o(rs,{boardId:t||"default",onTitleChange:n||void 0});default:return o("div",{style:r},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function _d(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e,l=vt(),d=l.activeMenuBar,u=l.dockSignals,h=ne(l);h.current=l;let[m,c]=U([]),[p,f]=U([]),[y,x]=U(!1),[g,b]=U(!1),[S,I]=U(null),[A,C]=U({x:0,y:0}),[T,L]=U(null),R=v(()=>{x(ee=>!ee)},[]),$=v(ee=>{f(ce=>ce.filter(me=>me.id!==ee))},[]);re(()=>{if(p.length===0)return;let ee=p[0],ce=Date.now()-ee.timestamp,me=Math.max(0,Ad-ce),xe=setTimeout(()=>{f(ye=>ye.filter(Me=>Me.id!==ee.id))},me);return()=>clearTimeout(xe)},[p]);let B=ne(t);B.current=t;let E=ne(r);E.current=r;let N=ne({});for(let ee of m)if(!N.current[ee.id]){let ce=ee.id;N.current[ce]=me=>{c(xe=>xe.map(ye=>ye.id===ce?{...ye,title:me}:ye))}}let z=v(ee=>{let me=B.current.find(xe=>xe.id===ee);me&&(c(xe=>{let Me=xe.filter(Ne=>Ne.appId===ee).length+1,de=Me===1?me.label:`${me.label} (${Me})`,be=ss(ee),Ee=xe.length>0?Math.max(...xe.map(Ne=>Ne.zIndex))+1:1,Re={id:be,appId:me.id,title:de,icon:me.icon,x:60+xe.length*30,y:40+xe.length*30,width:600,height:400,zIndex:Ee,focused:!0,windowState:"normal"};return[...xe.map(Ne=>({...Ne,focused:!1})),Re]}),ee==="files"&&h.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:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee))},[]),k=v(ee=>{c(ce=>{if(!ce.find(ye=>ye.id===ee))return ce;let xe=Math.max(...ce.map(ye=>ye.zIndex))+1;return ce.map(ye=>ye.id===ee?{...ye,focused:!0,zIndex:xe,windowState:ye.windowState==="minimized"?"normal":ye.windowState}:{...ye,focused:!1})})},[]),w=v(ee=>{c(ce=>{let me=ce.filter(de=>de.appId===ee);if(me.length===0)return ce;let ye=[...me].sort((de,be)=>be.zIndex-de.zIndex)[0],Me=Math.max(...ce.map(de=>de.zIndex))+1;return ce.map(de=>de.id===ye.id?{...de,focused:!0,zIndex:Me,windowState:de.windowState==="minimized"?"normal":de.windowState}:{...de,focused:!1})}),c(ce=>{if(ce.filter(xe=>xe.appId===ee).length===0){let ye=B.current.find(Ee=>Ee.id===ee);if(!ye)return ce;let Me=ss(ee),de=ce.length>0?Math.max(...ce.map(Ee=>Ee.zIndex))+1:1,be={id:Me,appId:ye.id,title:ye.label,icon:ye.icon,x:60+ce.length*30,y:40+ce.length*30,width:600,height:400,zIndex:de,focused:!0,windowState:"normal"};return ee==="files"&&h.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:()=>{}}]}]}),ee==="terminal"&&h.current.signalDock("terminal",{badge:3}),E.current&&E.current(ee),[...ce.map(Ee=>({...Ee,focused:!1})),be]}return ce})},[]),D=t.map(ee=>{let ce=m.some(ye=>ye.appId===ee.id),me=u.get(ee.id),xe={id:ee.id,icon:ee.icon,label:me?.tooltip||ee.label,active:ce};return me&&(me.badge!=null&&(xe.badge=me.badge>0?me.badge:void 0),me.progress!=null&&(xe.progress=me.progress>0?me.progress:void 0),me.urgent&&(xe.urgent=!0)),xe}),M=m.find(ee=>ee.focused),F=M?M.title:void 0,P=v(()=>{b(!0)},[]),W=v(()=>{b(!1)},[]),_=v((ee,ce)=>{I(ee),C(ce)},[]),O=v(()=>{I(null)},[]),Y=v(()=>{},[]),K=v(()=>{i&&i()},[i]),Q=[];n&&(Q.push({label:n.name,icon:void 0,onClick:Y,divider:!1}),Q.push({label:"",icon:void 0,onClick:Y,divider:!0})),Q.push({label:"Lock",icon:void 0,onClick:P,divider:!1}),Q.push({label:"Logout",icon:void 0,onClick:K,divider:!1});let q=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]),H={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"},G={width:"100%",height:"100%",position:"relative"},V=o(en,{activeAppName:F,activitiesButton:{label:"Activities",onClick:R},appMenuBar:d||void 0,clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:Q.length>0?Q:void 0,height:zd}),Z=o(tn,{items:D,orientation:"vertical",position:"left",iconSize:36,onItemClick:w,onItemContextMenu:_}),te=o(Bd,{toasts:p,onDismiss:$}),ae=m.filter(ee=>ee.windowState!=="minimized").map(ee=>o(kt,{key:ee.id,id:ee.id,title:ee.title,icon:ee.icon,defaultPosition:{x:ee.x,y:ee.y},defaultSize:{width:ee.width,height:ee.height},zIndex:ee.zIndex,focused:ee.focused,windowState:ee.windowState,onClose:()=>{c(ce=>ce.filter(me=>me.id!==ee.id))},onFocus:()=>{c(ce=>{let me=Math.max(...ce.map(xe=>xe.zIndex))+1;return ce.map(xe=>xe.id===ee.id?{...xe,focused:!0,zIndex:me}:{...xe,focused:!1})})},onMinimize:()=>{c(ce=>ce.map(me=>me.id===ee.id?{...me,windowState:"minimized"}:me))},onMaximize:()=>{c(ce=>ce.map(me=>me.id===ee.id?{...me,windowState:me.windowState==="maximized"?"normal":"maximized"}:me))}},(()=>{let ce=t.find(me=>me.id===ee.appId);return ce?.render?ce.render(ee.id):Wd(ce?.label||ee.title,ee.id,N.current[ee.id])})())),J=[];a&&J.push(a),J.push(...ae),J.push(te);let ie=o(nn,{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:G},...J)),le=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:R},...t.map(ee=>o("button",{key:ee.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:ce=>{ce.stopPropagation(),x(!1),w(ee.id)}},o("span",{style:{fontSize:"32px",display:"block"}},ee.icon),o("span",null,ee.label)))):null,fe=g?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:W},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,oe=(()=>{if(!S)return null;let ee=t.find(de=>de.id===S),ce=m.filter(de=>de.appId===S),me={padding:"6px 14px",cursor:"pointer"},xe={onMouseEnter:de=>{de.currentTarget.style.backgroundColor="#444"},onMouseLeave:de=>{de.currentTarget.style.backgroundColor="transparent"}},ye={borderBottom:"1px solid #444",margin:"4px 0"},Me=[];return Me.push(o("div",{key:"new",style:me,...xe,onClick:()=>{z(S),I(null)},role:"menuitem"},"\u25CF New")),ce.length>0&&(Me.push(o("div",{key:"sep-1",style:ye})),ce.forEach((de,be)=>{let Ee=de.title;Me.push(o("div",{key:`inst-${de.id}`,style:me,...xe,onClick:()=>{k(de.id),I(null)},role:"menuitem"},Ee))})),Me.push(o("div",{key:"sep-2",style:ye})),Me.push(o("div",{key:"about",style:me,...xe,onClick:()=>{L(S),I(null)},role:"menuitem"},"About")),o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:O},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${A.y}px`,left:`${A.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:de=>de.stopPropagation()},...Me))})(),ge=T?t.find(ee=>ee.id===T):null,he=ge?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:()=>L(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:ee=>ee.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},ge.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:()=>L(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:q,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},V),o("div",{style:H},o("div",{className:"unity-desktop__dock",style:j},Z),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative",overflow:"hidden",minHeight:"0"}},ie,le)),oe,he,fe)}function as(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:a}=e;return o(Qt,{onWindowOpen:r},o($t,null,o(zt,null,o(_d,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:a}))))}function ls(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:a,resizable:l=!0,onClose:d,menuBar:u,onActivate:h,onDeactivate:m,children:c}=e,p=vt(),f=X(()=>p.windows.find(T=>T.id===t),[p.windows,t]);re(()=>(u?p.setMenuBar(t,u):p.clearMenuBar(t),()=>{p.clearMenuBar(t)}),[u,t,p]);let y=ne(!1),x=f?f.focused:!1;re(()=>{let T=y.current;y.current=x,x&&!T?h&&h():!x&&T&&m&&m()},[x,h,m]);let g=v(()=>{p.closeWindow(t),d&&d()},[p,t,d]),b=v(()=>{p.focusWindow(t)},[p,t]),S=v(T=>{p.moveWindow(t,T)},[p,t]),I=v(T=>{p.resizeWindow(t,T)},[p,t]),A=v(()=>{p.minimizeWindow(t)},[p,t]),C=v(()=>{f&&f.windowState==="maximized"?p.restoreWindow(t):p.maximizeWindow(t)},[p,t,f]);return f?o(it,{appId:t},o(kt,{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:g,onFocus:b,onMove:S,onResize:I,onMinimize:A,onMaximize:C,children:c})):(p.openWindow({id:t,title:n,icon:r,position:i,size:s}),null)}function Od(e,t){let n=new Set,r=[];for(let i=e.length-1;i>=0;i--)r.push(e[i]);for(;r.length>0;){let i=r.pop();if($e(i)){if(t&&i.container_id===t)continue;i.name&&n.add(i.name);for(let s=i.contents.length-1;s>=0;s--)r.push(i.contents[s])}}return n}function ho(e,t,n){return!e||(!n||t.container_id!==n)&&t.name===e?!1:!Od(t.contents,n).has(e)}function cs(e,t,n){if(!e)return!1;for(let r=0;r<t.length;r++){let i=t[r];if($e(i)&&!(n&&i.container_id===n)&&i.name===e)return!1}return!0}function ds(e,t,n){return ho(e,t,n)}var us={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},ps={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 fs(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:h,active:m=!1}=e,c=X(()=>{let p=us[i]??us.md,f=ps[r]??ps.secondary,y={padding:p.padding,fontSize:p.fontSize,borderRadius:p.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":h,"aria-pressed":m?"true":void 0},t)}var Hd=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],It=Math.PI/180;function Yd(e,t,n,r,i,s,a,l,d,u){let h=Math.cos(r*It),m=Math.sin(r*It),c=Math.cos(i*It),p=Math.sin(i*It),f=Math.cos(s*It),y=Math.sin(s*It),x=e*f-t*y,g=e*y+t*f,b=x*c-g*p,S=x*p+g*c,I=n,A=b,C=S*h-I*m,T=S*m+I*h,L=1+a*.001*T,R=l+A*u*L,$=d-C*u*L;return{sx:R,sy:$,depth:T}}function ms(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 gs(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 hs(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:h=2,colorScale:m=Hd,gridColor:c="#94a3b8",title:p}=e,f=X(()=>{let z=0,k=0,w=0;for(let D=0;D<t.length;D++){let M=t[D],F=M.data.length;F>z&&(z=F);for(let P=0;P<F;P++){let W=M.data[P].length;W>k&&(k=W);for(let _=0;_<W;_++){let O=Math.abs(M.data[P][_]??0);O>w&&(w=O)}}}return{maxRows:Math.max(z,1),maxCols:Math.max(k,1),maxHeight:w>0?w:1}},[t]),y=X(()=>{let z=f.maxHeight+(t.length-1)*h+f.maxHeight,k=Math.sqrt(f.maxCols*f.maxCols+f.maxRows*f.maxRows+z*z),w=Math.min(n,r)*.75;return k>0?w/k:1},[f,t.length,h,n,r]),x=n/2,g=r/2,b=v((z,k,w)=>Yd(z,k,w,s,a,l,i,x,g,y),[s,a,l,i,x,g,y]),S=v(()=>{if(!u)return[];let z=[],k=Math.max(f.maxCols,f.maxRows),w=f.maxCols/2,D=f.maxRows/2,M=b(-w,-D,0),F=b(w,-D,0);z.push(o("line",{key:"axis-x",x1:String(M.sx),y1:String(M.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),z.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 P=b(-w,D,0);z.push(o("line",{key:"axis-y",x1:String(M.sx),y1:String(M.sy),x2:String(P.sx),y2:String(P.sy),stroke:"#374151","stroke-width":"1.5"})),z.push(o("text",{key:"axis-y-label",x:String(P.sx-12),y:String(P.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let W=f.maxHeight+(t.length-1)*h,_=b(-w,-D,W);return z.push(o("line",{key:"axis-z",x1:String(M.sx),y1:String(M.sy),x2:String(_.sx),y2:String(_.sy),stroke:"#374151","stroke-width":"1.5"})),z.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")),z},[u,f,t.length,h,b]),I=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2,D=[];for(let M=0;M<t.length;M++){let F=t[M],P=F.color??m[M%m.length],W=F.opacity??.7,_=M*h,O=F.data.length;for(let Y=0;Y<O-1;Y++){let K=F.data[Y],Q=F.data[Y+1],q=Math.min(K.length,Q.length);for(let H=0;H<q-1;H++){let j=H-k,G=H+1-k,V=Y-w,Z=Y+1-w,te=(K[H]??0)+_,ae=(K[H+1]??0)+_,J=(Q[H]??0)+_,ie=(Q[H+1]??0)+_,le=b(j,V,te),fe=b(G,V,ae),oe=b(j,Z,J),ge=b(G,Z,ie),he=(le.depth+fe.depth+oe.depth+ge.depth)/4,ee=`${le.sx},${le.sy} ${fe.sx},${fe.sy} ${ge.sx},${ge.sy} ${oe.sx},${oe.sy}`;D.push({points:ee,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:he,key:`quad-${M}-${Y}-${H}`})}}if(O===1||O>0&&F.data[0].length===1)for(let Y=0;Y<O;Y++){let K=F.data[Y];for(let Q=0;Q<K.length;Q++){let q=Q-k,H=Y-w,j=(K[Q]??0)+_,G=b(q,H,j),V=3,Z=`${G.sx},${G.sy-V} ${G.sx+V},${G.sy} ${G.sx},${G.sy+V} ${G.sx-V},${G.sy}`;D.push({points:Z,fill:ms(P,W),stroke:gs(P,.7),strokeWidth:"0.5",depth:G.depth,key:`point-${M}-${Y}-${Q}`})}}}D.sort((M,F)=>M.depth-F.depth);for(let M=0;M<D.length;M++){let F=D[M];z.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return z},[t,f,h,m,b]),A=v(()=>{let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<=f.maxRows;D++){let M=D-w,F=b(-k,M,0),P=b(k,M,0);z.push(o("line",{key:`base-h-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let D=0;D<=f.maxCols;D++){let M=D-k,F=b(M,-w,0),P=b(M,w,0);z.push(o("line",{key:`base-v-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(P.sx),y2:String(P.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return z},[f,c,b]),C=v(()=>{if(!d)return[];let z=[],k=f.maxCols/2,w=f.maxRows/2;for(let D=0;D<t.length;D++){let M=t[D],F=D*h,P=0,W=0;for(let K=0;K<M.data.length;K++){let Q=M.data[K];for(let q=0;q<Q.length;q++)P+=Q[q]??0,W++}let _=W>0?P/W:0,O=b(k+1,0,_+F),Y=M.color??m[D%m.length];z.push(o("text",{key:`layer-label-${D}`,x:String(O.sx+8),y:String(O.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:Y},M.label))}return z},[d,t,f,h,m,b]),L=v(()=>p?[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"},p)]:[],[p,n])(),R=A(),$=S(),B=I(),E=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":p??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...L,...N,...R,...$,...B,...E)}function Vd(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 Ud(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 bs(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:a,sparkline:l,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:m="#22c55e",trendDownColor:c="#ef4444",backgroundColor:p="#ffffff"}=e,f=X(()=>Vd(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),x=l!=null&&l.length>1,g=n!=null&&n.length>0,b=y&&s>=0?m:c,S=20,I=g?u*.38:u*.45,A=Math.min(d*.15,48),C=A*.55,T=I+A*.4+8,L=g?T+22:I+A*.4+22,R=x?Math.min(u*.22,36):0,$=u-S-R,B=d-S*2,E=v(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:p,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,p]),N=v(()=>{let O=[],Y=r+f+i;return O.push(o("text",{key:"value",x:String(d/2),y:String(I),"text-anchor":"middle","dominant-baseline":"central","font-size":String(A),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${Y}`},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)),O},[d,I,A,C,f,r,i,h]),z=v(()=>g?[o("text",{key:"label",x:String(d/2),y:String(T),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[g,d,T,n]),k=v(()=>{if(!y)return[];let O=[],Y=s,K=Y>=0,Q=8,q=Ud(Y),H=(K?"+":"-")+q+(a?" "+a:""),j=d/2-40,G=L;if(K){let V=`${j},${G} ${j-Q/2},${G+Q} ${j+Q/2},${G+Q}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}else{let V=`${j},${G+Q} ${j-Q/2},${G} ${j+Q/2},${G}`;O.push(o("polygon",{key:"trend-arrow",points:V,fill:b}))}return O.push(o("text",{key:"trend-text",x:String(j+Q+4),y:String(G+Q*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${H}`},H)),O},[y,s,a,b,d,L]),w=v(()=>{if(!x)return[];let O=[],Y=l,K=[];for(let te of Y)typeof te=="number"&&isFinite(te)&&!isNaN(te)&&K.push(te);if(K.length<2)return[];let Q=1/0,q=-1/0;for(let te of K)te<Q&&(Q=te),te>q&&(q=te);Q===q&&(Q-=1,q+=1);let H=q-Q,j=B/(K.length-1),G="";for(let te=0;te<K.length;te++){let ae=S+te*j,J=$+R-(K[te]-Q)/H*R;te===0?G+=`M ${ae} ${J}`:G+=` L ${ae} ${J}`}let V=S+(K.length-1)*j,Z=G+` L ${V} ${$+R} L ${S} ${$+R} 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:G,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),O},[x,l,B,$,R,S]),D=E(),M=N(),F=z(),P=k(),W=w(),_=`${r}${f}${i}${g?`, ${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"}},...D,...W,...M,...F,...P)}var Mn=Math.PI/180;function jd(e,t,n,r,i,s,a,l){let d=Math.cos(r*Mn),u=Math.sin(r*Mn),h=Math.cos(i*Mn),m=Math.sin(i*Mn),c=e*h+n*m,p=-e*m+n*h,f=t*d-p*u,y=t*u+p*d;return{sx:s+c*l,sy:a-f*l,depth:y}}function Rt(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 En(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 lt(e,t,n){let{x:r,y:i,z:s}=Rt(e),a=Math.cos(n),l=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*a-s*l,h=i*l+s*a):t==="y"?(d=r*a+s*l,u=i,h=-r*l+s*a):(d=r*a-i*l,u=r*l+i*a,h=s),En(d,u,h)}function bo(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return lt(e,"x",Math.PI);case"Y":return lt(e,"y",Math.PI);case"Z":return lt(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=Rt(e);return En(s,-i,r)}case"S":return lt(e,"z",Math.PI/2);case"T":return lt(e,"z",Math.PI/4);case"Rx":return lt(e,"x",n);case"Ry":return lt(e,"y",n);case"Rz":return lt(e,"z",n)}}function xs(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:h=!0,showLabels:m=!0,showWireframe:c=!0,showTrail:p=!0,trailMaxPoints:f=200,trailColor:y="#ef4444",wireframeColor:x="#cbd5e1",vectorColor:g="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:I,onStateChange:A}=e,[C,T]=U(t??{theta:0,phi:0}),[L,R]=U(s),[$,B]=U(a),[E,N]=U(l),z=ne([]),k=ne(!1),w=ne(null),D=ne(null);re(()=>{t&&T(t)},[t?.theta,t?.phi]);let M=ne(0);re(()=>{if(!n||n.length===0)return;M.current=0;let j=0,G=()=>{M.current>=n.length||(T(V=>{let Z=bo(V,n[M.current]);return M.current++,A&&A(Z),Z}),j=requestAnimationFrame(G))};return j=requestAnimationFrame(G),()=>cancelAnimationFrame(j)},[n]),re(()=>{let j=Rt(C);z.current.push(j),z.current.length>f&&z.current.splice(0,z.current.length-f)},[C.theta,C.phi]);let F=S*E,P=r/2,W=i/2,_=v((j,G,V)=>jd(j,G,V,$,L,P,W,F),[$,L,P,W,F]),O=v(j=>{if(!d)return;let G=j;k.current=!0,w.current={mx:G.clientX,my:G.clientY,rx:$,ry:L}},[d,$,L]),Y=v(j=>{if(!k.current||!w.current)return;let G=j,V=w.current;R(V.ry+(G.clientX-V.mx)*.5),B(V.rx-(G.clientY-V.my)*.5)},[]),K=v(()=>{k.current=!1},[]),Q=v(j=>{if(!u)return;let G=j;G.preventDefault(),N(V=>Math.max(.5,Math.min(3,V*(G.deltaY>0?.95:1.05))))},[u]),q=[];if(b&&q.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),I&&q.push(o("text",{key:"title",x:String(P),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},I)),c){let G=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),Math.sin(ae),0);G.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"eq",d:G.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.5"}));let V=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(Math.cos(ae),0,Math.sin(ae));V.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"xz",d:V.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let te=0;te<=60;te++){let ae=te/60*2*Math.PI,J=_(0,Math.cos(ae),Math.sin(ae));Z.push(`${te===0?"M":"L"}${J.sx.toFixed(1)},${J.sy.toFixed(1)}`)}q.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:x,"stroke-width":"0.8",opacity:"0.4"}))}let H=[{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 H){let G=_(j.dir[0]*1.15,j.dir[1]*1.15,j.dir[2]*1.15),V=_(-j.dir[0]*1.15,-j.dir[1]*1.15,-j.dir[2]*1.15),Z=_(0,0,0);q.push(o("line",{key:`axis-${j.id}`,x1:String(V.sx),y1:String(V.sy),x2:String(G.sx),y2:String(G.sy),stroke:j.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(m){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 G of j){let V=_(G.pos[0],G.pos[1],G.pos[2]);q.push(o("text",{key:`lbl-${G.text}`,x:String(V.sx),y:String(V.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},G.text))}}if(p&&z.current.length>1){let j=z.current,G=[];for(let V=0;V<j.length;V++){let Z=j[V],te=_(Z.x,Z.y,Z.z);G.push(`${V===0?"M":"L"}${te.sx.toFixed(1)},${te.sy.toFixed(1)}`)}q.push(o("path",{key:"trail",d:G.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let j=Rt(C),G=_(0,0,0),V=_(j.x,j.y,j.z);q.push(o("line",{key:"vec-line",x1:String(G.sx),y1:String(G.sy),x2:String(V.sx),y2:String(V.sy),stroke:g,"stroke-width":"2.5","stroke-linecap":"round"})),q.push(o("circle",{key:"vec-point",cx:String(V.sx),cy:String(V.sy),r:"5",fill:g,stroke:"#fff","stroke-width":"1.5"}));let Z=(C.theta*180/Math.PI).toFixed(0),te=(C.phi*180/Math.PI).toFixed(0);q.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=${te}\xB0`))}return o("svg",{ref:D,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":I??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?k.current?"grabbing":"grab":"default"},onMouseDown:d?O:void 0,onMouseMove:d?Y:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?Q:void 0},...q)}function Gd(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 xo(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 yo(e){let t=Gd(e);if(t.length===0)return null;let n=xo(t,25),r=xo(t,50),i=xo(t,75),s=i-n,a=n-1.5*s,l=i+1.5*s,d=t[0];for(let p of t)if(p>=a){d=p;break}let u=t[t.length-1];for(let p=t.length-1;p>=0;p--)if(t[p]<=l){u=t[p];break}let h=0;for(let p of t)h+=p;let m=h/t.length,c=[];for(let p of t)(p<a||p>l)&&c.push(p);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 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 ys(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:h,padding:m=60}=e,c=i==="vertical",p=n-m*2,f=r-m*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],x=X(()=>{let w=[];for(let D of t)w.push(yo(D.values));return w},[t]),g=X(()=>{let w=1/0,D=-1/0;for(let P of x){if(P===null)continue;let W=s&&P.outliers.length>0?Math.min(P.whiskerLow,P.outliers[0]):P.whiskerLow,_=s&&P.outliers.length>0?Math.max(P.whiskerHigh,P.outliers[P.outliers.length-1]):P.whiskerHigh;W<w&&(w=W),_>D&&(D=_)}isFinite(w)||(w=0,D=1);let M=D-w,F=M>0?M*.05:.5;return{min:w-F,max:D+F}},[x,s]),b=c?f:p,S=c?p:f,I=t.length>0?t.length:1,A=S/I,C=A*Math.min(Math.max(d,.1),.95),T=v(w=>{let D=g.max-g.min;return D===0?b/2:(w-g.min)/D*b},[g,b]),L=v(()=>{if(!u)return[];let w=[],D=g.max-g.min,M=Xd(D),F=Math.ceil(g.min/M)*M;for(let P=F;P<=g.max;P+=M){let W=T(P),_=String(Math.round(P*1e3)/1e3);if(c){let O=m+f-W;w.push(o("line",{key:`grid-${P}`,x1:String(m),y1:String(O),x2:String(m+p),y2:String(O),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(m-6),y:String(O+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}else{let O=m+W;w.push(o("line",{key:`grid-${P}`,x1:String(O),y1:String(m),x2:String(O),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${P}`,x:String(O),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return w},[u,g,T,c,m,p,f]),R=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+p),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),w},[m,p,f,c]),$=v(()=>{let w=[];for(let D=0;D<t.length;D++){let M=x[D];if(M===null)continue;let F=t[D],P=F.color??y[D%y.length],W=A*D+A/2,_=C/2;if(c){let O=m+f-T(M.q1),Y=m+f-T(M.q3),K=m+f-T(M.median),Q=m+f-T(M.whiskerLow),q=m+f-T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(H),y1:String(O),x2:String(H),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(H-_*.4),y1:String(Q),x2:String(H+_*.4),y2:String(Q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(H),y1:String(Y),x2:String(H),y2:String(q),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(H-_*.4),y1:String(q),x2:String(H+_*.4),y2:String(q),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(O-Y);if(w.push(o("rect",{key:`box-${D}`,x:String(H-_),y:String(j),width:String(C),height:String(Math.max(G,1)),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(H-_),y1:String(K),x2:String(H+_),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+f-T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(H),cy:String(V),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+f-T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(H),cy:String(Z),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(H),y:String(m+f+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let O=m+T(M.q1),Y=m+T(M.q3),K=m+T(M.median),Q=m+T(M.whiskerLow),q=m+T(M.whiskerHigh),H=m+W;w.push(o("line",{key:`wl-${D}`,x1:String(O),y1:String(H),x2:String(Q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(Q),y1:String(H-_*.4),x2:String(Q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(Y),y1:String(H),x2:String(q),y2:String(H),stroke:l,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(q),y1:String(H-_*.4),x2:String(q),y2:String(H+_*.4),stroke:l,"stroke-width":"1.5"}));let j=Math.min(O,Y),G=Math.abs(Y-O);if(w.push(o("rect",{key:`box-${D}`,x:String(j),y:String(H-_),width:String(Math.max(G,1)),height:String(C),fill:P,stroke:l,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${M.q1.toFixed(1)}, median=${M.median.toFixed(1)}, Q3=${M.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(K),y1:String(H-_),x2:String(K),y2:String(H+_),stroke:"#fff","stroke-width":"2.5"})),a){let V=m+T(M.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(V),cy:String(H),r:"3.5",fill:"#fff",stroke:l,"stroke-width":"1.5","aria-label":`Mean: ${M.mean.toFixed(1)}`}))}if(s)for(let V=0;V<M.outliers.length;V++){let Z=m+T(M.outliers[V]);w.push(o("circle",{key:`out-${D}-${V}`,cx:String(Z),cy:String(H),r:"3",fill:"none",stroke:l,"stroke-width":"1.5","aria-label":`Outlier: ${M.outliers[V]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(m-6),y:String(H+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return w},[t,x,T,c,m,p,f,A,C,l,s,a,y]),B=v(()=>h?[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"},h)]:[],[h,n,m]),E=L(),N=R(),z=$(),k=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??"Box plot",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z)}function Ss(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 Kd(e,t,n){return e<t?t:e>n?n:e}function So(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function vs(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:h=4,defaultColor:m="#3b82f6",opacity:c=.7,title:p,padding:f=60}=e,y=X(()=>{let z=[];for(let k=0;k<t.length;k++){let w=t[k];So(w.x)&&So(w.y)&&So(w.r)&&z.push(w)}return z},[t]),x=n-f*2,g=r-f*2,b=X(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let z=1/0,k=-1/0,w=1/0,D=-1/0,M=1/0,F=-1/0;for(let P of y)P.x<z&&(z=P.x),P.x>k&&(k=P.x),P.y<w&&(w=P.y),P.y>D&&(D=P.y),P.r<M&&(M=P.r),P.r>F&&(F=P.r);return z===k&&(z-=1,k+=1),w===D&&(w-=1,D+=1),M===F&&(M=0,F=F>0?F:1),{xMin:z,xMax:k,yMin:w,yMax:D,rMin:M,rMax:F}},[y]),S=v(z=>{let k=b.xMax-b.xMin;return f+(z-b.xMin)/k*x},[b,f,x]),I=v(z=>{let k=b.yMax-b.yMin;return f+g-(z-b.yMin)/k*g},[b,f,g]),A=v(z=>{let k=b.rMax-b.rMin;if(k===0)return(h+u)/2;let w=(z-b.rMin)/k;return h+w*(u-h)},[b,h,u]),C=v(()=>{if(!a)return[];let z=[],k=Ss(b.xMax-b.xMin),w=Math.ceil(b.xMin/k)*k;for(let F=w;F<=b.xMax;F+=k){let P=S(F);z.push(o("line",{key:`grid-x-${F}`,x1:String(P),y1:String(f),x2:String(P),y2:String(f+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-xlabel-${F}`,x:String(P),y:String(f+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let D=Ss(b.yMax-b.yMin),M=Math.ceil(b.yMin/D)*D;for(let F=M;F<=b.yMax;F+=D){let P=I(F);z.push(o("line",{key:`grid-y-${F}`,x1:String(f),y1:String(P),x2:String(f+x),y2:String(P),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),z.push(o("text",{key:`grid-ylabel-${F}`,x:String(f-6),y:String(P+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return z},[a,b,S,I,f,x,g]),T=v(()=>{if(!l)return[];let z=[];return z.push(o("line",{key:"axis-y",x1:String(f),y1:String(f),x2:String(f),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),z.push(o("line",{key:"axis-x",x1:String(f),y1:String(f+g),x2:String(f+x),y2:String(f+g),stroke:"#374151","stroke-width":"1.5"})),i&&z.push(o("text",{key:"x-label",x:String(f+x/2),y:String(f+g+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&z.push(o("text",{key:"y-label",x:String(f-40),y:String(f+g/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${f-40}, ${f+g/2})`},s)),z},[l,f,x,g,i,s]),L=v(()=>{let z=[];for(let k=0;k<y.length;k++){let w=y[k],D=S(w.x),M=I(w.y),F=Kd(A(w.r),h,u),P=w.color??m;z.push(o("circle",{key:`bubble-${k}`,cx:String(D),cy:String(M),r:String(F),fill:P,opacity:String(c),stroke:P,"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&&z.push(o("text",{key:`label-${k}`,x:String(D),y:String(M-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return z},[y,S,I,A,m,c,d,h,u]),R=v(()=>p?[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"},p)]:[],[p,n,f]),$=C(),B=T(),E=L(),N=R();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Bubble chart",style:{fontFamily:"sans-serif"}},...N,...$,...B,...E)}var qd=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Zd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Jd(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 ws(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 ks(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 Qd(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 eu(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=ks(t[i]),l=ks(t[i+1]);return Qd(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}var tu=["#9be9a8","#40c463","#30a14e","#216e39"];function Cs(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=tu,cellSize:s=12,cellGap:a=2,showMonthLabels:l=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:m,startDate:c,endDate:p,maxVal:f}=X(()=>{let E=new Map,N=0,z=null,k=null;for(let M of t){let F=Jd(M.date);if(isNaN(F.getTime()))continue;let P=ws(F);E.set(P,(E.get(P)??0)+M.value);let W=E.get(P);W>N&&(N=W),(z===null||F<z)&&(z=F),(k===null||F>k)&&(k=F)}if(z===null||k===null){let M=new Date;z=new Date(M.getFullYear(),0,1),k=new Date(M.getFullYear(),11,31)}let w=new Date(z);w.setDate(w.getDate()-w.getDay());let D=new Date(k);return D.setDate(D.getDate()+(6-D.getDay())),{dateMap:E,startDate:w,endDate:D,maxVal:N>0?N:1}},[t]),y=d?30:0,x=l?16:0,g=h?28:0,b=y+10,S=g+x+4,I=v(()=>{let E=[],N=new Date(c),z=0;for(;N<=p;){let k=N.getDay();k===0&&N>c&&z++;let w=ws(N),D=m.get(w),M=D!==void 0&&D>0?eu(D/f,i):u,F=b+z*(s+a),P=S+k*(s+a);E.push(o("rect",{key:`day-${w}`,x:String(F),y:String(P),width:String(s),height:String(s),rx:"2",ry:"2",fill:M,"aria-label":`${w}: ${D??0}`})),N.setDate(N.getDate()+1)}return E},[c,p,m,f,i,u,s,a,b,S]),A=v(()=>{if(!l)return[];let E=[],N=new Date(c),z=0,k=-1;for(;N<=p;){let w=N.getDay();w===0&&N>c&&z++;let D=N.getMonth();if(D!==k&&w===0){k=D;let M=b+z*(s+a);E.push(o("text",{key:`month-${z}`,x:String(M),y:String(g+x-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},qd[D]))}N.setDate(N.getDate()+1)}return E},[l,c,p,s,a,b,g,x]),C=v(()=>{if(!d)return[];let E=[],N=[1,3,5];for(let z of N){let k=S+z*(s+a)+s/2;E.push(o("text",{key:`day-label-${z}`,x:String(y),y:String(k),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Zd[z]))}return E},[d,s,a,S,y]),T=v(()=>h?[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"},h)]:[],[h,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":h??"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 L=T(),R=A(),$=C(),B=I();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??"Calendar heat map",style:{fontFamily:"sans-serif"}},...L,...R,...$,...B)}var nu=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nt(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ou(e,t,n,r,i,s){let a=nt(e,t,n,i),l=nt(e,t,n,s),d=nt(e,t,r,i),u=nt(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 ru(e,t,n,r,i,s,a){let l=nt(e,t,n,r),d=nt(e,t,n,i),u=nt(e,t,n,s),h=nt(e,t,n,a),m=i-r,c=a-s,p=m>Math.PI?1:0,f=c>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${f} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${l.x} ${l.y}`,"Z"].join(" ")}function iu(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 p=0;for(let f=0;f<i;f++){let y=e[c]?.[f]??0;p+=Math.max(0,y)}s.push(p),a+=p}if(a===0){let c=(2*Math.PI-i*r)/Math.max(i,1),p=[],f=0;for(let y=0;y<i;y++)p.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:p,chords:[]}}let l=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let p=s[c]/a*l;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+p,value:s[c]}),u+=p+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let m=[];for(let c=0;c<i;c++)for(let p=c;p<i;p++){let f=Math.max(0,e[c]?.[p]??0),y=c===p?0:Math.max(0,e[p]?.[c]??0);if(f===0&&y===0)continue;let x=f+y,g=s[c]>0?f/a*l:0,b=h[c],S=b+g;h[c]=S;let I=s[p]>0?f/a*l:0,A=h[p],C=A+I;if(h[p]=C,c===p){f>0&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:A,targetEndAngle:C,value:f,color:d[c].color});continue}let T=s[p]>0?y/a*l:0,R=h[p]+T;h[p]=R;let $=s[c]>0?y/a*l:0,E=h[c]+$;h[c]=E,(f>0||y>0)&&m.push({sourceIndex:c,targetIndex:p,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:A,targetEndAngle:Math.max(C,A+.001),value:x,color:d[c].color})}return{groups:d,chords:m}}function Ms(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=nu,padAngle:a=.05,showLabels:l=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.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,p=i/2,f=Math.min(r,i)/2-40,y=f*Math.max(.5,Math.min(.99,h)),x=f+16,g=X(()=>iu(t,n,s,a),[t,n,s,a]),b=v(()=>{let L=[];for(let R=0;R<g.groups.length;R++){let $=g.groups[R];if($.endAngle-$.startAngle<.001)continue;let E=ou(c,p,f,y,$.startAngle,$.endAngle);if(L.push(o("path",{key:`arc-${R}`,d:E,fill:$.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${$.label}: ${$.value}`})),l){let N=($.startAngle+$.endAngle)/2,z=nt(c,p,x,N),D=((N-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,M=D?"start":"end",F=N*180/Math.PI-90;D||(F+=180);let P=d?`${$.label} (${$.value})`:$.label;L.push(o("text",{key:`label-${R}`,x:String(z.x),y:String(z.y),"text-anchor":M,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${z.x}, ${z.y})`,"dominant-baseline":"central","pointer-events":"none"},P))}}return L},[g,c,p,f,y,x,l,d]),S=v(()=>{let L=[];for(let R=0;R<g.chords.length;R++){let $=g.chords[R],B=ru(c,p,y,$.sourceStartAngle,$.sourceEndAngle,$.targetStartAngle,$.targetEndAngle);L.push(o("path",{key:`ribbon-${R}`,d:B,fill:$.color,"fill-opacity":String(u),stroke:$.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return L},[g,c,p,y,u]),I=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]),A=S(),C=b(),T=I();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"}},...T,...A,...C)}var su=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function au(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??[],h=[];for(let m=0;m<u.length;m++)h.push(n+r.length+m);t.push({id:d,node:s,depth:a,parentId:l,childIndices:h});for(let m=0;m<u.length;m++)r.push([u[m],a+1,d])}return{flatNodes:t,maxDepth:i}}function lu(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 cu(e,t,n,r,i,s,a,l){let{flatNodes:d,maxDepth:u}=au(e);if(d.length===0)return[];let h=lu(d),m=t-s*2,c=n-s*2,p=a==="horizontal",f=u+1,y=p?f>1?(m-r)/u:0:f>1?(c-i)/u:0,x=new Array(d.length),g=h[0],b=p?c:m,S=g>0?b/g:b,I=new Array(d.length);I[0]=[0,g];let A=[0],C=0;for(;C<A.length;){let T=A[C];C++;let L=d[T],[R,$]=I[T],B=(R+$)/2,E=s+L.depth*y,N=s+(B-.5)*S,z=p?E:N,k=p?N:E,w=L.node.color??l[L.depth%l.length];x[T]={id:L.id,label:L.node.label,value:L.node.value!==void 0?String(L.node.value):"",color:w,depth:L.depth,x:z,y:k,parentId:L.parentId,childCount:L.childIndices.length,subtreeLeafCount:h[T]};let D=R;for(let M of L.childIndices)if(M<d.length){let F=h[M],P=D+F;I[M]=[D,P],D=P,A.push(M)}}return x}function Es(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:h=su,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 p=i==="horizontal",f=X(()=>cu(t,n,r,s,a,c,i,h),[t,n,r,s,a,c,i,h]),y=X(()=>{let C=new Map;for(let T=0;T<f.length;T++){let L=f[T];C.set(L.id,L)}return C},[f]),x=v(()=>{if(!d)return[];let C=[];for(let T=0;T<f.length;T++){let L=f[T];if(L.parentId===null)continue;let R=y.get(L.parentId);if(!R)continue;let $,B,E,N;p?($=R.x+s,B=R.y+a/2,E=L.x,N=L.y+a/2):($=R.x+s/2,B=R.y+a,E=L.x+s/2,N=L.y);let z=($+E)/2,k=(B+N)/2,w;p?w=`M ${$} ${B} C ${z} ${B}, ${z} ${N}, ${E} ${N}`:w=`M ${$} ${B} C ${$} ${k}, ${E} ${k}, ${E} ${N}`,C.push(o("path",{key:`conn-${T}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return C},[f,y,p,s,a,d,u]),g=v(()=>{let C=[];for(let T=0;T<f.length;T++){let L=f[T];C.push(o("rect",{key:`node-rect-${L.id}`,x:String(L.x),y:String(L.y),width:String(s),height:String(a),rx:"4",ry:"4",fill:L.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":L.value?`${L.label}: ${L.value}`:L.label}));let R=l&&L.value?L.y+a/2-2:L.y+a/2+4;C.push(o("text",{key:`node-label-${L.id}`,x:String(L.x+s/2),y:String(R),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},L.label)),l&&L.value&&C.push(o("text",{key:`node-value-${L.id}`,x:String(L.x+s/2),y:String(L.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},L.value))}return C},[f,s,a,l]),b=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=x(),I=g(),A=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":m??"Decomposition tree",style:{fontFamily:"sans-serif"}},...A,...S,...I)}var Is=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function du(e){return Is[e%Is.length]}function Rs(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],h=2*Math.PI*d/Math.max(a,1);l.push({id:u.id,label:u.label??u.id,color:u.color??du(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return l}function Ps(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 h=Math.sqrt(u),m=l/h,c=d/h,p=n-h;if(i.fixed&&a.fixed)continue;i.fixed?(a.x+=m*p,a.y+=c*p):a.fixed?(i.x-=m*p,i.y-=c*p):(i.x-=m*p*.5,i.y-=c*p*.5,a.x+=m*p*.5,a.y+=c*p*.5);let f=i.vx-a.vx,y=i.vy-a.vy,x=f*m+y*c;x<=0||(i.fixed?(a.vx+=x*m,a.vy+=x*c):a.fixed?(i.vx-=x*m,i.vy-=x*c):(i.vx-=x*m,i.vy-=x*c,a.vx+=x*m,a.vy+=x*c))}}}function uu(e,t,n,r,i,s,a,l,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let b=0;b<u;b++)h.set(e[b].id,b);let m=new Float64Array(u),c=new Float64Array(u);for(let b=0;b<u;b++){let S=e[b];for(let I=b+1;I<u;I++){let A=e[I],C=S.x-A.x,T=S.y-A.y,L=C*C+T*T;L<1&&(L=1);let R=Math.sqrt(L),$=i/L,B=C/R*$,E=T/R*$;m[b]+=B,c[b]+=E,m[I]-=B,c[I]-=E}}for(let b=0;b<t.length;b++){let S=t[b],I=h.get(S.source),A=h.get(S.target);if(I===void 0||A===void 0)continue;let C=e[I],T=e[A],L=T.x-C.x,R=T.y-C.y,$=Math.sqrt(L*L+R*R);if($<.1)continue;let B=S.weight??1,E=$-l,N=s*E*B,z=L/$*N,k=R/$*N;m[I]+=z,c[I]+=k,m[A]-=z,c[A]-=k}let p=n/2,f=r/2,y=.001;for(let b=0;b<u;b++){let S=e[b];m[b]+=(p-S.x)*y,c[b]+=(f-S.y)*y}let x=20,g=[];for(let b=0;b<u;b++){let S=e[b];if(S.fixed){g.push({...S,vx:0,vy:0});continue}let I=(S.vx+m[b])*a,A=(S.vy+c[b])*a,C=Math.sqrt(I*I+A*A),T=10;C>T&&(I=I/C*T,A=A/C*T);let L=S.x+I,R=S.y+A;L=Math.max(x,Math.min(n-x,L)),R=Math.max(x,Math.min(r-x,R)),g.push({...S,x:L,y:R,vx:I,vy:A})}return Ps(g,d),g}function pu(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 Ts(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:h=300,attractionForce:m=.01,damping:c=.9,edgeLength:p=100,edgeColor:f="#94a3b8",edgeWidth:y=1.5,title:x,customForce:g,trails:b}=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":x??"Empty force-directed graph"},x?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"},x):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=ne(Rs(t,r,i)),[I,A]=U(0),C=ne(!0),T=ne(!1),L=ne(n);L.current=n;let R=ne(g);R.current=g;let $=ne(null),B=ne({repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l});B.current={repulsionForce:h,attractionForce:m,damping:c,edgeLength:p,width:r,height:i,nodeRadius:s,solidNodes:l};let E=ne(new Map);re(()=>{S.current=Rs(t,r,i),T.current=!1,C.current=!0,E.current=new Map,A(ae=>ae+1)},[t.length]),re(()=>{let ae=0,J=()=>{if(!C.current)return;let ie=B.current,le=R.current,fe;if(le?(fe=le(S.current,L.current,ie.width,ie.height,$.current),ie.solidNodes&&Ps(fe,ie.nodeRadius)):fe=uu(S.current,L.current,ie.width,ie.height,ie.repulsionForce,ie.attractionForce,ie.damping,ie.edgeLength,ie.nodeRadius),S.current=fe,b)for(let oe=0;oe<b.length;oe++){let ge=b[oe],he=fe.find(me=>me.id===ge.nodeId);if(!he)continue;let ee=E.current.get(ge.nodeId);ee||(ee=[],E.current.set(ge.nodeId,ee)),ee.push({x:he.x,y:he.y});let ce=ge.maxPoints??200;ee.length>ce&&ee.splice(0,ee.length-ce)}if(!le&&pu(fe)<.01){T.current=!0,A(oe=>oe+1);return}A(oe=>oe+1),ae=requestAnimationFrame(J)};return ae=requestAnimationFrame(J),()=>{C.current=!1,cancelAnimationFrame(ae)}},[]);let N=S.current,z=v(ae=>{S.current=S.current.map(J=>J.id===ae?{...J,fixed:!J.fixed,vx:0,vy:0}:J),T.current&&(T.current=!1,C.current=!0,A(J=>J+1))},[]),k=ne(null),w=ne(null),D=v(ae=>{let J=ae,ie=w.current;if(!ie)return{x:J.clientX,y:J.clientY};let le=ie.getBoundingClientRect(),fe=r/le.width,oe=i/le.height;return{x:(J.clientX-le.left)*fe,y:(J.clientY-le.top)*oe}},[r,i]),M=ne(!1),F=v((ae,J)=>{J.stopPropagation(),k.current=ae;let ie=S.current.find(le=>le.id===ae);M.current=ie?.fixed??!1,S.current=S.current.map(le=>le.id===ae?{...le,fixed:!0,vx:0,vy:0}:le)},[]),P=v(ae=>{let J=D(ae);if($.current={x:J.x,y:J.y},!k.current)return;let ie=k.current,le=20;S.current=S.current.map(fe=>fe.id===ie?{...fe,x:Math.max(le,Math.min(r-le,J.x)),y:Math.max(le,Math.min(i-le,J.y))}:fe),T.current&&(T.current=!1,C.current=!0),A(fe=>fe+1)},[r,i,D]),W=v(()=>{let ae=k.current;ae&&(S.current=S.current.map(J=>J.id===ae?{...J,fixed:M.current}:J)),k.current=null},[]),_=v(()=>{k.current=null,$.current=null},[]),O=X(()=>{let ae=new Map;for(let J=0;J<N.length;J++)ae.set(N[J].id,N[J]);return ae},[I]),Y=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]),K=v(()=>{let ae=[];for(let J=0;J<n.length;J++){let ie=n[J],le=O.get(ie.source),fe=O.get(ie.target);if(!le||!fe||ie.weight!==void 0&&ie.weight<=0)continue;let oe=ie.weight?Math.max(.5,Math.min(6,y*ie.weight)):y,ge={key:`edge-${J}`,x1:String(le.x),y1:String(le.y),x2:String(fe.x),y2:String(fe.y),stroke:ie.color??f,"stroke-width":String(oe),"stroke-opacity":"0.6"};u&&(ge["marker-end"]="url(#arrowhead)"),ae.push(o("line",ge))}return ae},[I,f,y,u]),Q=v(()=>{let ae=[];for(let J=0;J<N.length;J++){let ie=N[J];ae.push(o("circle",{key:`node-${ie.id}`,cx:String(ie.x),cy:String(ie.y),r:String(s),fill:ie.color,stroke:ie.fixed?"#0f172a":"#fff","stroke-width":ie.fixed?"3":String(a),style:{cursor:k.current===ie.id?"grabbing":"grab"},onMouseDown:le=>F(ie.id,le),onDblClick:()=>z(ie.id),role:"button",tabIndex:0,"aria-label":`Node: ${ie.label}${ie.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&ae.push(o("text",{key:`label-${ie.id}`,x:String(ie.x),y:String(ie.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},ie.label))}return ae},[I,s,d,z]),q=v(()=>x?[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"},x)]:[],[x,r]),H=v(()=>{if(!b||b.length===0)return[];let ae=[];for(let J=0;J<b.length;J++){let ie=b[J],le=E.current.get(ie.nodeId);if(!le||le.length<2)continue;let fe=[];for(let oe=0;oe<le.length;oe++){let ge=le[oe];fe.push(`${oe===0?"M":"L"}${ge.x.toFixed(1)},${ge.y.toFixed(1)}`)}ae.push(o("path",{key:`trail-${ie.nodeId}`,d:fe.join(" "),fill:"none",stroke:ie.color??"#3b82f6","stroke-width":String(ie.width??1),opacity:String(ie.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return ae},[I,b]),j=Y(),G=H(),V=K(),Z=Q(),te=q();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":x??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:k.current?"grabbing":"default"},onMouseMove:P,onMouseUp:W,onMouseLeave:_},...j,...te,...G,...V,...Z)}var $s=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function Ds(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=$s,title:h}=e,m=i==="vertical",c=h?30:0,p=120,f=X(()=>{let L=0;for(let R=0;R<t.length;R++)t[R].value>L&&(L=t[R].value);return L>0?L:1},[t]),y=v(L=>f===0?0:Math.max(.05,L/f),[f]),x=v((L,R)=>R||(u[L%u.length]??$s[0]),[u]),g=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2-p,B=r-c-R*2,E=d*(t.length-1),N=Math.max(1,(B-E)/t.length),z=R+$/2;for(let k=0;k<t.length;k++){let w=t[k],D=k<t.length-1?t[k+1]:null,M=x(k,w.color),F=y(w.value),P=D!==null?y(D.value):F*.6,W=$/2*F,_=$/2*P,O=c+R+k*(N+d),Y=z-W,K=z+W,Q=z+_,q=z-_,H=`${Y},${O} ${K},${O} ${Q},${O+N} ${q},${O+N}`;L.push(o("polygon",{key:`section-${k}`,points:H,fill:M,stroke:"#fff","stroke-width":"1"}));let j=R+$+12,G=O+N/2;if(s&&L.push(o("text",{key:`label-${k}`,x:String(j),y:String(G-(a||l?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),a||l){let V="";if(a&&(V=String(w.value)),l&&t.length>0){let Z=t[0].value,te=Z>0?Math.round(w.value/Z*100):0;V+=a?` (${te}%)`:`${te}%`}L.push(o("text",{key:`value-${k}`,x:String(j),y:String(G+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},V))}}return L},[t,n,r,c,d,s,a,l,x,y,p]),b=v(()=>{if(t.length===0)return[];let L=[],R=40,$=n-R*2,E=r-c-R*2-40,N=d*(t.length-1),z=Math.max(1,($-N)/t.length),k=c+R+E/2;for(let w=0;w<t.length;w++){let D=t[w],M=w<t.length-1?t[w+1]:null,F=x(w,D.color),P=y(D.value),W=M!==null?y(M.value):P*.6,_=E/2*P,O=E/2*W,Y=R+w*(z+d),K=k-_,Q=k-O,q=k+O,H=k+_,j=`${Y},${K} ${Y+z},${Q} ${Y+z},${q} ${Y},${H}`;L.push(o("polygon",{key:`section-${w}`,points:j,fill:F,stroke:"#fff","stroke-width":"1"}));let G=Y+z/2,V=c+R+E+14;if(s&&L.push(o("text",{key:`label-${w}`,x:String(G),y:String(V),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D.label)),a||l){let Z="";if(a&&(Z=String(D.value)),l&&t.length>0){let te=t[0].value,ae=te>0?Math.round(D.value/te*100):0;Z+=a?` (${ae}%)`:`${ae}%`}L.push(o("text",{key:`value-${w}`,x:String(G),y:String(V+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return L},[t,n,r,c,d,s,a,l,x,y]),S=v(()=>h?[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"},h)]:[],[h,n]),I=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]),A=S(),C=m?g():b(),T=I();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??"Funnel chart",style:{fontFamily:"sans-serif"}},...A,...C,...T)}var zs=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function As(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 fu(e,t){return t||zs[e%zs.length]}function Ls(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:h,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":h??"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,p=X(()=>{let B=1/0,E=-1/0;for(let N of t){N.start<B&&(B=N.start);let z=N.start+N.duration;z>E&&(E=z)}return B===1/0&&(B=0,E=1),{min:B,max:E,range:E-B}},[t]),f=X(()=>{let B=t.slice();return B.sort((E,N)=>E.group!==N.group?(E.group??"").localeCompare(N.group??""):E.start-N.start),B},[t]),y=r??m*2+f.length*(i+s)+s+20,x=n-m-c-m,g=m+(h?20:0),b=v(B=>p.range===0?c+m:c+m+(B-p.min)/p.range*x,[p,x,c,m]),S=v(()=>{if(!a)return[];let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g+f.length*(i+s)+s;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("line",{key:`grid-${k}`,x1:String(w),y1:String(g),x2:String(w),y2:String(z),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return B},[a,p,g,f.length,i,s,b]),I=v(()=>{let B=[],E=As(p.range),N=Math.ceil(p.min/E)*E,z=g-8;for(let k=N;k<=p.max;k+=E){let w=b(k);B.push(o("text",{key:`taxis-${k}`,x:String(w),y:String(z),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(k)))}return B.push(o("text",{key:"time-unit",x:String(n-m),y:String(z),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),B},[p,g,b,u,n,m]),A=v(()=>{let B=[],E="";for(let N=0;N<f.length;N++){let z=f[N],k=g+N*(i+s)+s,w=b(z.start),D=Math.max(2,b(z.start+z.duration)-w),M=fu(N,z.color);z.group&&z.group!==E&&(E=z.group,l&&B.push(o("text",{key:`group-${N}`,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"},z.group))),B.push(o("rect",{key:`bar-${z.id}`,x:String(w),y:String(k),width:String(D),height:String(i),rx:"4",ry:"4",fill:M,role:"graphics-symbol","aria-label":`${z.label}: start ${z.start}, duration ${z.duration}`})),l&&B.push(o("text",{key:`label-${z.id}`,x:String(c+m-8),y:String(k+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},z.label.length>16?z.label.substring(0,14)+"..":z.label)),d&&D>30&&B.push(o("text",{key:`prog-${z.id}`,x:String(w+D/2),y:String(k+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${z.start}-${z.start+z.duration}`))}return B},[f,g,i,s,b,l,d,c,m]),C=v(()=>h?[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"},h)]:[],[h,n,m]),T=S(),L=I(),R=A(),$=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":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...$,...T,...L,...R)}var mu=Math.PI/180;function gu(e){return e*mu}function Je(e,t,n,r){let i=gu(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Bs(e,t,n,r,i){let s=Je(e,t,n,i),a=Je(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 hu(e,t,n){return e<t?t:e>n?n:e}function mt(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function Fs(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:h=!0,showTicks:m=!0,tickCount:c=10,label:p,unit:f,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:x="#374151",backgroundColor:g="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,I=isFinite(t)&&!isNaN(t)?hu(t,b,S):b,A=(u?24:0)+(p?18:0),C=i/2,T=(s-A)*.6,L=Math.min(i/2,(s-A)*.55)-d/2-10,R=L-d,$=L-d/2,B=l-a,E=v(H=>{let j=S-b;if(j===0)return a;let G=(H-b)/j;return a+G*B},[b,S,a,B]),N=v(()=>{let H=Bs(C,T,$,a,l);return[o("path",{key:"bg-arc",d:H,fill:"none",stroke:g,"stroke-width":String(d),"stroke-linecap":"round"})]},[C,T,$,a,l,g,d]),z=v(()=>{if(y.length===0)return[];let H=[],j=B/y.length;for(let G=0;G<y.length;G++){let V=a+G*j,Z=V+j,te=Bs(C,T,$,V,Z);H.push(o("path",{key:`seg-${G}`,d:te,fill:"none",stroke:y[G],"stroke-width":String(d),"stroke-linecap":G===0||G===y.length-1?"round":"butt",opacity:"0.85"}))}return H},[y,B,a,C,T,$,d]),k=v(()=>{if(!m||c<=0)return[];let H=[],j=Math.max(1,Math.min(c,100));for(let G=0;G<=j;G++){let V=G/j,Z=a+V*B,te=G%2===0,ae=te?10:6,J=Je(C,T,L+4,Z),ie=Je(C,T,L+4+ae,Z);if(H.push(o("line",{key:`tick-${G}`,x1:String(J.x),y1:String(J.y),x2:String(ie.x),y2:String(ie.y),stroke:"currentColor",opacity:"0.4","stroke-width":te?"2":"1"})),te){let le=b+V*(S-b),fe=Je(C,T,L+4+ae+12,Z);H.push(o("text",{key:`tick-label-${G}`,x:String(fe.x),y:String(fe.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(le)))}}return H},[m,c,a,B,C,T,L,b,S]),w=v(()=>{let H=[],j=E(I),G=R-8,V=Je(C,T,G,j),Z=6,te=j+90,ae=j-90,J=Je(C,T,Z,te),ie=Je(C,T,Z,ae);return H.push(o("polygon",{key:"needle",points:`${V.x},${V.y} ${J.x},${J.y} ${ie.x},${ie.y}`,fill:x,stroke:"none"})),H.push(o("circle",{key:"needle-cap",cx:String(C),cy:String(T),r:"8",fill:x,stroke:"#fff","stroke-width":"2"})),H},[I,E,C,T,R,x]),D=v(()=>{if(!u)return[];let H=[],j=mt(I),G=j+(f?" "+f:""),V=T+$+20;return H.push(o("text",{key:"value-text",x:String(C),y:String(V),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${G}`},j,f?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+f):null)),H},[u,I,f,C,T,$]),M=v(()=>{if(!p)return[];let H=T+$+(u?40:20);return[o("text",{key:"label",x:String(C),y:String(H),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},p)]},[p,C,T,$,u]),F=v(()=>{if(!h)return[];let H=[],j=Je(C,T,$,a),G=Je(C,T,$,l);return H.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"},mt(b))),H.push(o("text",{key:"max-label",x:String(G.x+4),y:String(G.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},mt(S))),H},[h,C,T,$,a,l,b,S]),P=N(),W=z(),_=k(),O=w(),Y=D(),K=M(),Q=F(),q=`Gauge: ${mt(I)}${f?" "+f:""}, range ${mt(b)} to ${mt(S)}${p?", "+p:""}`;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(I),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":q,style:{fontFamily:"sans-serif"}},...P,...W,..._,...O,...Y,...K,...Q)}var _t={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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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 Ns(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:h="Map of the United States"}=e,m=X(()=>Object.keys(_t),[]),c=v(g=>{l&&l(g)},[l]),p=v((g,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",u),d&&d(g)},[d,u]),f=v((g,b)=>{let S=b.currentTarget;if(S){let I=r[g]??i;S.setAttribute("fill",I)}d&&d(null)},[d,r,i]),y=X(()=>{let g=[];for(let b=0;b<m.length;b++){let S=m[b],I=_t[S],A=r[S]??i,C={key:`state-${S}`,d:I.path,fill:A,stroke:s,"stroke-width":String(a),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":I.name,style:{cursor:l?"pointer":"default"}};if(l){let L=S;C.onClick=()=>c(L),C.onKeyDown=R=>{(R.key==="Enter"||R.key===" ")&&c(L)},C.tabindex=0,C.role="button",C["aria-label"]=I.name}let T=S;C.onMouseOver=L=>p(T,L),C.onMouseOut=L=>f(T,L),g.push(o("path",C))}return g},[m,r,i,s,a,l,c,p,f]),x=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},x,...y)}function vo(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 bu(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 xu(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=vo(t[i]),l=vo(t[i+1]);return bu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function yu(e){let{r:t,g:n,b:r}=vo(e);return(.299*t+.587*n+.114*r)/255}var Su=["#3b82f6","#fbbf24","#ef4444"];function Ws(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:a=Su,minValue:l,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:m=1,title:c,padding:p=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:x,maxVal:g}=X(()=>{let k=l??1/0,w=d??-1/0;for(let D of t)for(let M of D)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]),b=c?30:0,S=n?p:20,I=r?p:20,A=i-S-20,C=s-b-I-20,T=y>0?A/y:0,L=f>0?C/f:0,R=v(()=>{let k=[];for(let w=0;w<f;w++){let D=t[w];for(let M=0;M<y;M++){let F=M<D.length?D[M]:0,P=(F-x)/(g-x),W=xu(P,a),_=S+M*T,O=b+20+w*L;if(k.push(o("rect",{key:`cell-${w}-${M}`,x:String(_),y:String(O),width:String(T),height:String(L),fill:W,stroke:h,"stroke-width":String(m)})),u){let Y=yu(W)>.5?"#111827":"#ffffff";k.push(o("text",{key:`val-${w}-${M}`,x:String(_+T/2),y:String(O+L/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,T*.3,L*.4)),"font-family":"sans-serif",fill:Y},String(Math.round(F*100)/100)))}}}return k},[t,f,y,x,g,a,T,L,S,b,u,h,m]),$=v(()=>{let k=[];if(n)for(let w=0;w<f;w++){let D=w<n.length?n[w]:"",M=b+20+w*L+L/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"},D))}if(r)for(let w=0;w<y;w++){let D=w<r.length?r[w]:"",M=S+w*T+T/2,F=b+20+f*L+16;k.push(o("text",{key:`col-label-${w}`,x:String(M),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}return k},[n,r,f,y,T,L,S,b]),B=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 E=B(),N=R(),z=$();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"}},...E,...N,...z)}function vu(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 wu(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 wo(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function _s(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:h,yLabel:m,padding:c=60}=e,p=Math.max(1,Math.round(n)),f=X(()=>vu(t,p),[t,p]),y=X(()=>{let E=0;for(let N=0;N<f.length;N++)f[N].count>E&&(E=f[N].count);return E>0?E:1},[f]),x=r-c*2,g=i-c*2,b=v(()=>{if(!l)return[];let E=wu(y),N=[];for(let z=E;z<=y;z+=E){let k=c+g-z/y*g;N.push(o("line",{key:`grid-${z}`,x1:String(c),y1:String(k),x2:String(c+x),y2:String(k),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),N.push(o("text",{key:`grid-label-${z}`,x:String(c-8),y:String(k+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(z)))}return N},[l,y,c,x,g]),S=v(()=>{let E=[];return E.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+x),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),E},[c,x,g]),I=v(()=>{if(f.length===0)return[];let E=[],N=a*(f.length-1),z=Math.max(1,(x-N)/f.length);for(let k=0;k<f.length;k++){let w=f[k],D=w.count/y*g,M=c+k*(z+a),F=c+g-D;if(E.push(o("rect",{key:`bar-${k}`,x:String(M),y:String(F),width:String(z),height:String(D),fill:s})),d&&w.count>0&&E.push(o("text",{key:`val-${k}`,x:String(M+z/2),y:String(F-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 W=(f.length===1,wo(w.min));E.push(o("text",{key:`xlabel-${k}`,x:String(M+z/2),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},W))}}if(f.length>0){let k=f[f.length-1],w=c+x;E.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+g+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},wo(k.max)))}return E},[f,y,a,s,d,c,x,g]),A=v(()=>{let E=[];return u&&E.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)),h&&E.push(o("text",{key:"x-label",x:String(c+x/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),m&&E.push(o("text",{key:"y-label",x:String(14),y:String(c+g/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+g/2})`},m)),E},[u,h,m,r,i,c,x,g]),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]),T=b(),L=S(),R=I(),$=A(),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"}},...$,...T,...L,...R,...B)}function ku(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 Os(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:h=!0,title:m,padding:c=60}=e,p=i==="vertical",f=p?30:0,y=n-c*2,x=r-c*2-f,g=p?x:y,b=p?y:x,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]),I=X(()=>t.length===0?0:b/t.length,[t.length,b]),A=v(()=>{if(!u)return[];let k=ku(S),w=[];for(let D=k;D<=S;D+=k){let M=D/S*g;if(p){let F=c+x-M;w.push(o("line",{key:`grid-${D}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}else{let F=c+M;w.push(o("line",{key:`grid-${D}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+x),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(F),y:String(c+x+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}}return w},[u,S,p,c,y,x,g]),C=v(()=>{let k=[];return p?k.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"})):k.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"})),k.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+x),x2:String(c+y),y2:String(c+x),stroke:"#374151","stroke-width":"1.5"})),k},[p,c,y,x]),T=v(()=>{if(t.length===0)return[];let k=[];for(let w=0;w<t.length;w++){let D=t[w],M=D.value/S*g,F=I*w+I/2,P=D.color??d;if(p){let W=c+F,_=c+x,O=c+x-M;k.push(o("line",{key:`stem-${w}`,x1:String(W),y1:String(_),x2:String(W),y2:String(O),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(W),cy:String(O),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(W),y:String(O-l-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value)));let Y=W,K=c+x+16;k.push(o("text",{key:`cat-${w}`,x:String(Y),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${K})`},D.label))}else{let W=c+F,_=c,O=c+M;k.push(o("line",{key:`stem-${w}`,x1:String(_),y1:String(W),x2:String(O),y2:String(W),stroke:s,"stroke-width":String(a)})),k.push(o("circle",{key:`dot-${w}`,cx:String(O),cy:String(W),r:String(l),fill:P})),h&&k.push(o("text",{key:`val-${w}`,x:String(O+l+4),y:String(W+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value))),k.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},D.label))}}return k},[t,S,I,d,l,s,a,h,p,c,y,x,g]),L=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]),R=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]),$=A(),B=C(),E=T(),N=L(),z=R();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"}},...N,...$,...B,...E,...z)}function ko(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 Cu(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 Mu(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=ko(t[i]),l=ko(t[i+1]);return Cu(a.r+(l.r-a.r)*s,a.g+(l.g-a.g)*s,a.b+(l.b-a.b)*s)}function Eu(e){let{r:t,g:n,b:r}=ko(e);return(.299*t+.587*n+.114*r)/255}var Iu=["#f0f9ff","#3b82f6","#1e3a8a"];function Hs(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:a=500,colorScale:l=Iu,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:m,padding:c=70,symmetric:p=!1}=e,f=r??n,y=i??n,x=t.length,g=X(()=>{let P=0;for(let W of t)W.length>P&&(P=W.length);return P},[t]),b=X(()=>{if(!p||x===0)return t;let P=[],W=Math.max(x,g);for(let _=0;_<W;_++){let O=[];for(let Y=0;Y<W;Y++){let K=t[_],Q=K&&Y<K.length?K[Y]:0,q=t[Y],H=q&&_<q.length?q[_]:0;Q!==0?O.push(Q):O.push(H)}P.push(O)}return P},[t,p,x,g]),S=b.length,I=X(()=>{let P=0;for(let W of b)W.length>P&&(P=W.length);return P},[b]),{minVal:A,maxVal:C}=X(()=>{let P=1/0,W=-1/0;for(let _ of b)for(let O of _)O<P&&(P=O),O>W&&(W=O);return P===1/0&&(P=0),W===-1/0&&(W=1),P===W&&(W=P+1),{minVal:P,maxVal:W}},[b]),T=m?30:0,L=f?c:20,R=y?c:20,$=s-L-20,B=a-T-R-20,E=I>0?$/I:0,N=S>0?B/S:0,z=v(()=>{let P=[];for(let W=0;W<S;W++){let _=b[W];for(let O=0;O<I;O++){let Y=O<_.length?_[O]:0,K=(Y-A)/(C-A),Q=Mu(K,l),q=L+O*E,H=T+20+W*N,j=W===O,G=j&&u?"currentColor":h,V=j&&u?"2":"1";if(P.push(o("rect",{key:`cell-${W}-${O}`,x:String(q),y:String(H),width:String(E),height:String(N),fill:Q,stroke:G,"stroke-width":V})),d){let Z=Eu(Q)>.5?"#111827":"#ffffff",te=Math.min(12,E*.3,N*.35);P.push(o("text",{key:`val-${W}-${O}`,x:String(q+E/2),y:String(H+N/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,te)),"font-weight":j&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(Y*100)/100)))}}}return P},[b,S,I,A,C,l,E,N,L,T,d,u,h]),k=v(()=>{let P=[];if(f)for(let W=0;W<S;W++){let _=W<f.length?f[W]:"",O=T+20+W*N+N/2;P.push(o("text",{key:`row-label-${W}`,x:String(L-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<I;W++){let _=W<y.length?y[W]:"",O=L+W*E+E/2,Y=T+20+S*N+12;P.push(o("text",{key:`col-label-${W}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},_))}return P},[f,y,S,I,E,N,L,T]),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||I===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 D=w(),M=z(),F=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"}},...D,...M,...F)}var Ru=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function In(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 Pu(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 Tu(e,t,n,r,i,s,a){let l=[];if(In(e)<=0)return l;let h=Pu(e)+1,m=s==="horizontal",c=m?i/h:r/h,p=[];for(p.push({node:e,depth:0,spanStart:m?t:n,spanEnd:m?t+r:n+i,colorIndex:0});p.length>0;){let f=p.shift(),{node:y,depth:x,spanStart:g,spanEnd:b,colorIndex:S}=f,I=In(y);if(I<=0)continue;let A=b-g,C,T,L,R;if(m?(C=g,T=n+x*c,L=A,R=c):(C=t+x*c,T=g,L=c,R=A),l.push({x:C,y:T,w:L,h:R,label:y.label,value:I,color:y.color??a[S%a.length],depth:x}),y.children&&y.children.length>0){let $=g;for(let B=0;B<y.children.length;B++){let E=y.children[B],N=In(E);if(N<=0)continue;let z=N/I*A;p.push({node:E,depth:x+1,spanStart:$,spanEnd:$+z,colorIndex:x===0?B:S}),$+=z}}}return l}function Ys(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:a=!0,colors:l=Ru,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:m=10}=e,c=h?30:0,p=m,f=m+c,y=n-m*2,x=r-m*2-c;if(X(()=>In(t),[t])<=0||y<=0||x<=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??"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 b=X(()=>Tu(t,p,f,y,x,i,l),[t,p,f,y,x,i,l]),S=[];h&&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"},h));for(let I=0;I<b.length;I++){let A=b[I];if(S.push(o("rect",{key:`cell-${I}`,x:String(A.x),y:String(A.y),width:String(Math.max(0,A.w)),height:String(Math.max(0,A.h)),fill:A.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${A.label}: ${A.value}`})),s&&A.w>20&&A.h>14){let C=Math.floor(A.w/7),T=A.label.length>C?A.label.substring(0,Math.max(1,C-2))+"..":A.label;S.push(o("text",{key:`label-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},T))}a&&A.w>30&&A.h>28&&S.push(o("text",{key:`value-${I}`,x:String(A.x+A.w/2),y:String(A.y+A.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(A.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":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function Co(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function Vs(e,t){let n=new Set;for(let i of e)n.add(Co(i,t));let r=Array.from(n);return r.sort(),r}function Rn(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 Pn(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function $u(e,t,n,r,i){let s=Vs(e,t),a=Vs(e,n),l=new Map;for(let p of e){let f=Co(p,t),y=Co(p,n),x=`${f}::${y}`;l.has(x)||l.set(x,[]);let g=l.get(x),b=0;for(let S of r){let I=p[S];if(typeof I=="number")b+=I;else if(typeof I=="string"){let A=parseFloat(I);isNaN(A)||(b+=A)}}g.push(b)}let d=new Map;for(let[p,f]of l)d.set(p,Rn(f,i));let u=new Map;for(let p of s){let f=[];for(let y of a){let x=d.get(`${p}::${y}`);x!==void 0&&f.push(x)}u.set(p,Rn(f,i==="count"?"sum":i))}let h=new Map;for(let p of a){let f=[];for(let y of s){let x=d.get(`${y}::${p}`);x!==void 0&&f.push(x)}h.set(p,Rn(f,i==="count"?"sum":i))}let m=[];for(let p of u.values())m.push(p);let c=Rn(m,i==="count"?"sum":i);return{rowKeys:s,colKeys:a,cells:d,rowTotals:u,colTotals:h,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:h="#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(()=>$u(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:p,colKeys:f,cells:y,rowTotals:x,colTotals:g,grandTotal:b}=c,S=u?30:0,I=f.length+(d?1:0),A=p.length+(d?1:0),C=1+I,T=1+A,L=Math.max(40,(a-m*2)/C),R=Math.max(20,Math.min(36,(l-S-m*2)/T)),$=L*C,B=R*T,E=Math.max(0,(a-$)/2),N=S+Math.max(0,(l-S-B)/2),z=[];u&&z.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)),z.push(o("rect",{key:"header-row-bg",x:String(E),y:String(N),width:String($),height:String(R),fill:h})),z.push(o("rect",{key:"header-col-bg",x:String(E),y:String(N+R),width:String(L),height:String(R*A),fill:h,opacity:"0.85"})),z.push(o("text",{key:"corner",x:String(E+L/2),y:String(N+R/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=E+(k+1)*L,D=Math.floor(L/7),M=f[k],F=M.length>D?M.substring(0,Math.max(1,D-2))+"..":M;z.push(o("text",{key:`ch-${k}`,x:String(w+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&z.push(o("text",{key:"ch-total",x:String(E+(f.length+1)*L+L/2),y:String(N+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let k=0;k<p.length;k++){let w=p[k],D=N+(k+1)*R;k%2===0&&z.push(o("rect",{key:`row-bg-${k}`,x:String(E+L),y:String(D),width:String(L*I),height:String(R),fill:"#f9fafb"}));let M=Math.floor(L/7),F=w.length>M?w.substring(0,Math.max(1,M-2))+"..":w;z.push(o("text",{key:`rh-${k}`,x:String(E+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let P=0;P<f.length;P++){let W=f[P],_=`${w}::${W}`,O=y.get(_),Y=E+(P+1)*L;z.push(o("rect",{key:`border-${k}-${P}`,x:String(Y),y:String(D),width:String(L),height:String(R),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),z.push(o("text",{key:`cell-${k}-${P}`,x:String(Y+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},O!==void 0?Pn(O):"-"))}if(d){let P=E+(f.length+1)*L,W=x.get(w)??0;z.push(o("rect",{key:`rt-bg-${k}`,x:String(P),y:String(D),width:String(L),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:`rt-${k}`,x:String(P+L/2),y:String(D+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(W)))}}if(d){let k=N+(p.length+1)*R;z.push(o("rect",{key:"total-row-bg",x:String(E),y:String(k),width:String($),height:String(R),fill:"#eff6ff"})),z.push(o("text",{key:"total-label",x:String(E+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let D=0;D<f.length;D++){let M=f[D],F=g.get(M)??0,P=E+(D+1)*L;z.push(o("text",{key:`ct-${D}`,x:String(P+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},Pn(F)))}let w=E+(f.length+1)*L;z.push(o("text",{key:"grand-total",x:String(w+L/2),y:String(k+R/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},Pn(b)))}return z.push(o("rect",{key:"outer-border",x:String(E),y:String(N),width:String($),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"}},...z)}function Tn(e,t){return Math.PI*2*e/t-Math.PI/2}function $n(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function js(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:h="#d1d5db",title:m}=e,c=t.length,p=m?30:0,f=d&&n.length>0?30:0,y=60,x=Math.min((r-y*2)/2,(i-y*2-p-f)/2),g=r/2,b=y+p+x,S=X(()=>{let z=[];for(let k=0;k<c;k++){let w=t[k]?.max;if(w!==void 0&&w>0){z.push(w);continue}let D=0;for(let M of n){let F=M.values[k];F!==void 0&&F>D&&(D=F)}z.push(D>0?D:1)}return z},[t,n,c]),I=v(()=>{if(c<3)return[];let z=[];for(let k=1;k<=s;k++){let w=x*k/s,D=[];for(let M=0;M<c;M++){let F=Tn(M,c),P=$n(g,b,w,F);D.push(`${P.x},${P.y}`)}z.push(o("polygon",{key:`ring-${k}`,points:D.join(" "),fill:"none",stroke:h,"stroke-width":k===s?"1.5":"0.5","stroke-dasharray":k===s?"none":"3 2"}))}for(let k=0;k<c;k++){let w=Tn(k,c),D=$n(g,b,x,w);z.push(o("line",{key:`spoke-${k}`,x1:String(g),y1:String(b),x2:String(D.x),y2:String(D.y),stroke:h,"stroke-width":"0.75"}))}return z},[c,s,x,g,b,h]),A=v(()=>{if(!a||c<3)return[];let z=[],k=16;for(let w=0;w<c;w++){let D=Tn(w,c),M=$n(g,b,x+k,D),F="middle";M.x<g-5?F="end":M.x>g+5&&(F="start");let P=Math.abs(M.y-b)<5?"0.35em":M.y<b?"0em":"0.7em";z.push(o("text",{key:`label-${w}`,x:String(M.x),y:String(M.y),"text-anchor":F,dy:P,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return z},[a,c,t,x,g,b]),C=v(()=>{if(c<3||n.length===0)return[];let z=[];for(let k=0;k<n.length;k++){let w=n[k],D=[],M=[],F=[];for(let P=0;P<c;P++){let W=w.values[P]??0,_=S[P],O=Math.min(W/_,1),Y=x*O,K=Tn(P,c),Q=$n(g,b,Y,K);D.push(`${Q.x},${Q.y}`),u&&M.push(o("circle",{key:`dot-${k}-${P}`,cx:String(Q.x),cy:String(Q.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),l&&F.push(o("text",{key:`val-${k}-${P}`,x:String(Q.x),y:String(Q.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(W*100)/100)))}z.push(o("polygon",{key:`series-fill-${k}`,points:D.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),z.push(o("polygon",{key:`series-line-${k}`,points:D.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let P of M)z.push(P);for(let P of F)z.push(P)}return z},[c,n,S,x,g,b,u,l]),T=v(()=>{if(!d||n.length===0)return[];let z=[],k=b+x+40,w=100,D=n.length*w,M=g-D/2;for(let F=0;F<n.length;F++){let P=n[F],W=M+F*w;z.push(o("rect",{key:`legend-swatch-${F}`,x:String(W),y:String(k),width:"12",height:"12",rx:"2",fill:P.color})),z.push(o("text",{key:`legend-text-${F}`,x:String(W+16),y:String(k+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},P.label))}return z},[d,n,g,b,x]),L=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 R=I(),$=A(),B=C(),E=T(),N=L();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"}},...N,...R,...$,...B,...E)}var Du=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function zu(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 h of u){let m=n.get(h),c=d+1;(m===void 0||c>m)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let l of e)n.has(l)||n.set(l,0);return n}function Au(e,t,n,r,i,s,a,l){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-a*2,u=r-a*2,h=t.filter($=>$.value>0),m=e.map($=>$.id),c=zu(m,h),p=new Map,f=new Map;for(let $ of m)p.set($,0),f.set($,0);for(let $ of h)f.set($.source,(f.get($.source)??0)+$.value),p.set($.target,(p.get($.target)??0)+$.value);let y=0;for(let $ of c.values())$>y&&(y=$);let x=new Map;for(let $=0;$<=y;$++)x.set($,[]);for(let[$,B]of c)x.get(B).push($);let g=new Map,b=y>0?(d-i)/y:0;for(let $=0;$<=y;$++)g.set($,a+$*b);let S=new Map;for(let $=0;$<e.length;$++)S.set(e[$].id,e[$]);let I=[],A=new Map;for(let $=0;$<=y;$++){let B=x.get($);if(B.length===0)continue;let E=0;for(let w of B){let D=p.get(w)??0,M=f.get(w)??0;E+=Math.max(D,M,1)}let N=u-s*(B.length-1),z=E>0?N/E:1,k=a;for(let w=0;w<B.length;w++){let D=B[w],M=S.get(D),F=p.get(D)??0,P=f.get(D)??0,W=Math.max(F,P,1),_=Math.max(4,W*z),O=e.findIndex(K=>K.id===D),Y={id:D,label:M.label,color:M.color??l[O%l.length],column:$,x:g.get($),y:k,height:_,totalIn:F,totalOut:P,totalValue:W};I.push(Y),A.set(D,Y),k+=_+s}}let C=new Map,T=new Map;for(let $ of m)C.set($,0),T.set($,0);let L=[...h].sort(($,B)=>B.value-$.value),R=[];for(let $ of L){let B=A.get($.source),E=A.get($.target);if(!B||!E)continue;let N=B.totalOut||1,z=E.totalIn||1,k=$.value/N*B.height,w=$.value/z*E.height,D=Math.max(1,(k+w)/2),M=C.get($.source),F=T.get($.target),P=B.y+M+k/2,W=E.y+F+w/2;C.set($.source,M+k),T.set($.target,F+w);let _=S.get($.source);R.push({source:$.source,target:$.target,value:$.value,color:$.color??_?.color??B.color,sourceY:P,targetY:W,width:D})}return{layoutNodes:I,layoutLinks:R}}function Gs(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:h=Du,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 p=X(()=>Au(t,n,r,i,s,a,c,h),[t,n,r,i,s,a,c,h]),f=v(()=>{let I=[];for(let A=0;A<p.layoutLinks.length;A++){let C=p.layoutLinks[A],T=p.layoutNodes.find(N=>N.id===C.source),L=p.layoutNodes.find(N=>N.id===C.target);if(!T||!L)continue;let R=T.x+s,$=L.x,B=(R+$)/2,E=`M ${R} ${C.sourceY} C ${B} ${C.sourceY}, ${B} ${C.targetY}, ${$} ${C.targetY}`;I.push(o("path",{key:`link-${A}`,d:E,fill:"none",stroke:C.color,"stroke-width":String(Math.max(1,C.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&C.value>0&&I.push(o("text",{key:`link-val-${A}`,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 I},[p,s,u,d]),y=v(()=>{let I=[];for(let A=0;A<p.layoutNodes.length;A++){let C=p.layoutNodes[A];if(I.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 T=p.layoutNodes.reduce((z,k)=>Math.max(z,k.column),0),L=C.column===T,R=L?C.x+s+6:C.x-6,$=L?"start":"end",B=C.column===0,E=B?C.x-6:R,N=B?"end":$;I.push(o("text",{key:`label-${C.id}`,x:String(E),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 I},[p,s,l]),x=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]),g=f(),b=y(),S=x();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,...g,...b)}var Lu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Mo=2*Math.PI;function Ot(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 Bu(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 Fu(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,h=e+r*Math.cos(d),m=t+r*Math.sin(d),c=e+r*Math.cos(u),p=t+r*Math.sin(u),f=e+n*Math.cos(u),y=t+n*Math.sin(u),x=e+n*Math.cos(d),g=t+n*Math.sin(d);if(a>=Mo-.001){let b=d+Math.PI,S=e+r*Math.cos(b),I=t+r*Math.sin(b),A=e+n*Math.cos(b),C=t+n*Math.sin(b);return[`M ${h} ${m}`,`A ${r} ${r} 0 1 1 ${S} ${I}`,`A ${r} ${r} 0 1 1 ${h} ${m}`,`L ${x} ${g}`,`A ${n} ${n} 0 1 0 ${A} ${C}`,`A ${n} ${n} 0 1 0 ${x} ${g}`,"Z"].join(" ")}return[`M ${h} ${m}`,`A ${r} ${r} 0 ${l} 1 ${c} ${p}`,`L ${f} ${y}`,`A ${n} ${n} 0 ${l} 0 ${x} ${g}`,"Z"].join(" ")}function Nu(e,t,n,r){let i=[],s=Ot(e);if(s<=0)return i;let a=Bu(e),l=a>0?(n-t)/(a+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let m=e.children[h],c=Ot(m);if(c<=0)continue;let p=c/s*Mo;d.push({node:m,startAngle:u,endAngle:u+p,depth:0,colorIndex:h}),u+=p}}else return i.push({startAngle:0,endAngle:Mo,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:h,startAngle:m,endAngle:c,depth:p,colorIndex:f}=u,y=Ot(h);if(y<=0)continue;let x=t+p*l,g=x+l;if(i.push({startAngle:m,endAngle:c,innerR:x,outerR:g,label:h.label,value:y,color:h.color??r[f%r.length],depth:p}),h.children&&h.children.length>0){let b=m,S=c-m;for(let I=0;I<h.children.length;I++){let A=h.children[I],C=Ot(A);if(C<=0)continue;let T=C/y*S;d.push({node:A,startAngle:b,endAngle:b+T,depth:p+1,colorIndex:f}),b+=T}}}return i}function Xs(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:a=Lu,strokeColor:l="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,m=r/2,c=u?20:0,p=Math.min(h,m-c)-10;if(X(()=>Ot(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(h),y:String(m),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=X(()=>Nu(t,i,p,a),[t,i,p,a]),x=[];u&&x.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let g=m+c/2;for(let b=0;b<y.length;b++){let S=y[b],I=Fu(h,g,S.innerR,S.outerR,S.startAngle,S.endAngle);if(x.push(o("path",{key:`arc-${b}`,d:I,fill:S.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let A=S.endAngle-S.startAngle,C=S.startAngle+A/2-Math.PI/2,T=(S.innerR+S.outerR)/2,L=S.outerR-S.innerR,R=A*T;if(R>20&&L>14){let $=h+T*Math.cos(C),B=g+T*Math.sin(C),E=Math.floor(Math.min(R,L)/7),N=S.label.length>E?S.label.substring(0,Math.max(1,E-1))+"..":S.label;x.push(o("text",{key:`label-${b}`,x:String($),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"}},...x)}var Wu=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Dn(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 Ks(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 _u(e,t,n,r,i,s){let a=[],l=[],d=Dn(e);if(d<=0||r<=0||i<=0)return a;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,m=[];for(let c=0;c<u.length;c++){let p=u[c],f=Dn(p);f<=0||m.push({label:p.label,value:f,area:f/d*h,color:p.color??s[c%s.length],node:p})}for(m.sort((c,p)=>p.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:p,rect:f,depth:y}=c;if(p.length===0)continue;let x={...f},g=0;for(;g<p.length&&x.w>0&&x.h>0;){let b=x.w>=x.h,S=b?x.h:x.w,I=[],A=[];I.push(p[g]),A.push(p[g].area),g++;let C=Ks(A,S);for(;g<p.length;){let $=[...A,p[g].area],B=Ks($,S);if(B>C)break;I.push(p[g]),A.push(p[g].area),C=B,g++}let T=0;for(let $ of A)T+=$;let L=S>0?T/S:0,R=0;for(let $=0;$<I.length;$++){let B=I[$],E=L>0?B.area/L:0,N,z,k,w;if(b?(N=x.x,z=x.y+R,k=L,w=E):(N=x.x+R,z=x.y,k=E,w=L),a.push({x:N,y:z,w:k,h:w,label:B.label,value:B.value,color:B.color,depth:y}),B.node.children&&B.node.children.length>0){let M=N+2,F=z+2+14,P=k-4,W=w-4-14;if(P>4&&W>4){let _=[],O=B.value,Y=P*W;for(let K=0;K<B.node.children.length;K++){let Q=B.node.children[K],q=Dn(Q);q<=0||_.push({label:Q.label,value:q,area:q/O*Y,color:Q.color??s[(K+y+1)%s.length],node:Q})}_.sort((K,Q)=>Q.area-K.area),l.push({nodes:_,rect:{x:M,y:F,w:P,h:W},depth:y+1})}}R+=E}b?x={x:x.x+L,y:x.y,w:x.w-L,h:x.h}:x={x:x.x,y:x.y+L,w:x.w,h:x.h-L}}}return a}function qs(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:a=Wu,borderColor:l="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,m=h?30:0,c=u,p=u+m,f=n-u*2,y=r-u*2-m;if(X(()=>Dn(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":h??"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 g=X(()=>_u(t,c,p,f,y,a),[t,c,p,f,y,a]),b=[];h&&b.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"},h));for(let S=0;S<g.length;S++){let I=g[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(I.x),y:String(I.y),width:String(Math.max(0,I.w)),height:String(Math.max(0,I.h)),fill:I.color,stroke:l,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${I.label}: ${I.value}`})),i&&I.w>20&&I.h>14){let A=Math.floor(I.w/7),C=I.label.length>A?I.label.substring(0,Math.max(1,A-2))+"..":I.label;b.push(o("text",{key:`label-${S}`,x:String(I.x+4),y:String(I.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},C))}s&&I.w>30&&I.h>28&&b.push(o("text",{key:`value-${S}`,x:String(I.x+4),y:String(I.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(I.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":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function Zs(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 Ou(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 Js(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=Zs(t[s]),u=Zs(t[a]);return Ou(d.r+(u.r-d.r)*l,d.g+(u.g-d.g)*l,d.b+(u.b-d.b)*l)}function zn(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 Hu(e,t,n,r,i,s,a,l,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),m=d/(h-1),c=u/(h-1);if(n){let f=[];for(let b=0;b<h;b++)for(let S=0;S<h;S++)f.push({x:i+S*m,y:a+b*c});let x=n(f,{gridSize:h,xMin:i,xMax:s,yMin:a,yMax:l}),g=[];for(let b=0;b<f.length;b++){let S=f[b],I=x[b]??{dx:0,dy:0},A=Math.sqrt(I.dx*I.dx+I.dy*I.dy);g.push({x:S.x,y:S.y,dx:I.dx,dy:I.dy,magnitude:A})}return g}if(!t)return[];let p=[];for(let f=0;f<h;f++)for(let y=0;y<h;y++){let x=i+y*m,g=a+f*c,b=t(x,g),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);p.push({x,y:g,dx:b.dx,dy:b.dy,magnitude:S})}return p}function Yu(e,t,n,r,i){let{padding:s,chartWidth:a,chartHeight:l,xMin:d,xMax:u,yMin:h,yMax:m,xSpan:c,ySpan:p,showGrid:f,showAxes:y,colorByMagnitude:x,colorScale:g,arrowColor:b,arrowWidth:S,effectiveArrowScale:I,maxMagnitude:A,title:C,tickFontSize:T}=i,L=B=>s+(B-d)/c*a,R=B=>s+(m-B)/p*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=`${T}px sans-serif`,e.fillStyle="#6b7280";let B=zn(c,10),E=Math.ceil(d/B)*B;for(let k=E;k<=u;k+=B){let w=L(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 N=zn(p,10),z=Math.ceil(h/N)*N;for(let k=z;k<=m;k+=N){let w=R(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,h<=0&&m>=0){let B=R(0);e.beginPath(),e.moveTo(s,B),e.lineTo(s+a,B),e.stroke()}if(d<=0&&u>=0){let B=L(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 $=4;for(let B=0;B<r.length;B++){let E=r[B],N=E.magnitude??Math.sqrt(E.dx*E.dx+E.dy*E.dy);if(N<1e-10)continue;let z=L(E.x),k=R(E.y),w=E.dx*I,D=-E.dy*I,M=z+w,F=k+D,P;if(x){let _=N/A;P=Js(_,g)}else P=b;e.save(),e.strokeStyle=P,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(z,k),e.lineTo(M,F),e.stroke();let W=Math.sqrt(w*w+D*D);if(W>2){let _=w/W,O=D/W,Y=-O,K=_,Q=Math.min($,W*.4),q=M-_*Q+Y*Q*.5,H=F-O*Q+K*Q*.5,j=M-_*Q-Y*Q*.5,G=F-O*Q-K*Q*.5;e.fillStyle=P,e.beginPath(),e.moveTo(M,F),e.lineTo(q,H),e.lineTo(j,G),e.closePath(),e.fill()}e.restore()}}function Qs(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:h=!0,showAxes:m=!0,colorByMagnitude:c=!1,colorScale:p=["#3b82f6","#8b5cf6","#ef4444"],title:f,padding:y=50,tickFontSize:x=10,arrowWidth:g=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:I}=e,A=Math.max(2,Math.min(50,s)),C=r-y*2,T=i-y*2,L=a[0],R=a[1],$=l[0],B=l[1],E=R-L,N=B-$,z=X(()=>q=>y+(q-L)/E*C,[y,L,E,C]),k=X(()=>q=>y+(B-q)/N*T,[y,B,N,T]),w=X(()=>Hu(t,n,I,A,L,R,$,B,E,N),[t,n,I,A,L,R,$,B,E,N]),D=X(()=>{let q=0;for(let H=0;H<w.length;H++){let j=w[H],G=j.magnitude??Math.sqrt(j.dx*j.dx+j.dy*j.dy);G>q&&(q=G)}return q>0?q:1},[w]),M=X(()=>Math.min(C,T)/Math.max(A,2)/(2*D)*d,[C,T,A,D,d]);if(b==="canvas"){let q=ne(null),H=ne(0);return re(()=>{let j=q.current;if(!j)return;let G=j.getContext("2d");if(G)return H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame(()=>{Yu(G,r,i,w,{padding:y,chartWidth:C,chartHeight:T,xMin:L,xMax:R,yMin:$,yMax:B,xSpan:E,ySpan:N,showGrid:h,showAxes:m,colorByMagnitude:c,colorScale:p,arrowColor:u,arrowWidth:g,effectiveArrowScale:M,maxMagnitude:D,title:f,tickFontSize:x})}),()=>{H.current&&cancelAnimationFrame(H.current)}},[w,r,i,y,C,T,L,R,$,B,E,N,h,m,c,p,u,g,M,D,f,x]),o("canvas",{ref:q,width:r,height:i,role:"img","aria-label":f??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=v(()=>{if(!h)return[];let q=[],H=zn(E,10),j=Math.ceil(L/H)*H;for(let Z=j;Z<=R;Z+=H){let te=z(Z);q.push(o("line",{key:`gridv-${Z}`,x1:String(te),y1:String(y),x2:String(te),y2:String(y+T),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`xtick-${Z}`,x:String(te),y:String(y+T+16),"text-anchor":"middle","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let G=zn(N,10),V=Math.ceil($/G)*G;for(let Z=V;Z<=B;Z+=G){let te=k(Z);q.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(te),x2:String(y+C),y2:String(te),stroke:"#e5e7eb","stroke-width":"0.5"})),q.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(te+4),"text-anchor":"end","font-size":String(x),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return q},[h,L,R,$,B,E,N,z,k,y,C,T]),P=v(()=>{if(!m)return[];let q=[];if($<=0&&B>=0){let H=k(0);q.push(o("line",{key:"axis-x",x1:String(y),y1:String(H),x2:String(y+C),y2:String(H),stroke:"#374151","stroke-width":String(g)}))}if(L<=0&&R>=0){let H=z(0);q.push(o("line",{key:"axis-y",x1:String(H),y1:String(y),x2:String(H),y2:String(y+T),stroke:"#374151","stroke-width":String(g)}))}return q.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(C),height:String(T),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),q},[m,L,R,$,B,z,k,y,C,T]),W=v(()=>{let q=[];for(let j=0;j<w.length;j++){let G=w[j],V=G.magnitude??Math.sqrt(G.dx*G.dx+G.dy*G.dy);if(V<1e-10)continue;let Z=z(G.x),te=k(G.y),ae=G.dx*M,J=-G.dy*M,ie=Z+ae,le=te+J,fe;if(c){let ge=V/D;fe=Js(ge,p)}else fe=u;q.push(o("line",{key:`arrow-line-${j}`,x1:String(Z),y1:String(te),x2:String(ie),y2:String(le),stroke:fe,"stroke-width":String(g),"stroke-linecap":"round"}));let oe=Math.sqrt(ae*ae+J*J);if(oe>2){let ge=ae/oe,he=J/oe,ee=-he,ce=ge,me=Math.min(4,oe*.4),xe=ie-ge*me+ee*me*.5,ye=le-he*me+ce*me*.5,Me=ie-ge*me-ee*me*.5,de=le-he*me-ce*me*.5;q.push(o("polygon",{key:`arrow-head-${j}`,points:`${ie},${le} ${xe},${ye} ${Me},${de}`,fill:fe}))}}return q},[w,z,k,M,c,D,p,u]),_=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]),O=F(),Y=P(),K=W(),Q=_();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"}},...Q,...O,...Y,...K)}function Vu(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 Uu(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 ea(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:h=!0,title:m,padding:c=60}=e,p=n-c*2,f=r-c*2,y=X(()=>Vu(t),[t]),{minVal:x,maxVal:g}=X(()=>{let D=0,M=0;for(let F=0;F<y.length;F++){let P=y[F];P.start<D&&(D=P.start),P.end<D&&(D=P.end),P.start>M&&(M=P.start),P.end>M&&(M=P.end)}return D===M&&(M=D+1),{minVal:D,maxVal:M}},[y]),b=g-x,S=v(D=>c+f-(D-x)/b*f,[c,f,x,b]),I=X(()=>y.length===0?0:p/y.length,[y.length,p]),A=6,C=Math.max(1,I-A),T=v(()=>{if(!u)return[];let D=Uu(b),M=[],F=Math.ceil(x/D)*D;for(let P=F;P<=g;P+=D){let W=S(P);M.push(o("line",{key:`grid-${P}`,x1:String(c),y1:String(W),x2:String(c+p),y2:String(W),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),M.push(o("text",{key:`grid-label-${P}`,x:String(c-8),y:String(W+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(P)))}return M},[u,b,x,g,S,c,p]),L=v(()=>{let D=[];D.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=x<=0&&g>=0?S(0):c+f;return D.push(o("line",{key:"axis-x",x1:String(c),y1:String(M),x2:String(c+p),y2:String(M),stroke:"#374151","stroke-width":"1.5"})),D},[c,p,f,x,g,S]),R=v(()=>{if(y.length===0)return[];let D=[];for(let M=0;M<y.length;M++){let F=y[M],P=c+M*I+A/2,W=Math.max(F.start,F.end),_=Math.min(F.start,F.end),O=S(W),Y=S(_),K=Math.max(0,Y-O),Q;if(F.type==="total"?Q=a:F.type==="decrease"?Q=s:Q=i,D.push(o("rect",{key:`bar-${M}`,x:String(P),y:String(O),width:String(C),height:String(K),fill:Q,rx:"2",ry:"2"})),d){let q=F.type==="decrease"||F.value<0?Y+14:O-4,H=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);D.push(o("text",{key:`val-${M}`,x:String(P+C/2),y:String(q),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},H))}if(D.push(o("text",{key:`cat-${M}`,x:String(P+C/2),y:String(c+f+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),h&&M<y.length-1){let q=y[M+1],H=S(F.end),j=c+(M+1)*I+A/2;q.type!=="total"&&D.push(o("line",{key:`conn-${M}`,x1:String(P+C),y1:String(H),x2:String(j),y2:String(H),stroke:l,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return D},[y,I,C,S,i,s,a,l,d,h,c,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]),B=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]),E=T(),N=L(),z=R(),k=$(),w=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":m??"Waterfall chart",style:{fontFamily:"sans-serif"}},...k,...E,...N,...z,...w)}var ju=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Gu=[0,-45,45,90];function Xu(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)),h=Math.abs(Math.sin(d)),m=a*u+l*h,c=a*h+l*u;return{x:r-m/2,y:i-c/2,w:m,h:c}}function Ku(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 qu(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Zu(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 ta(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:a="sans-serif",colors:l=ju,rotations:d=Gu,padding:u=4,spiral:h="archimedean",title:m}=e,c=X(()=>{if(t.length===0)return[];let f=t.map((C,T)=>({...C,originalIndex:T})).filter(C=>C.text.length>0&&C.weight>0).sort((C,T)=>T.weight-C.weight);if(f.length===0)return[];let y=f[f.length-1].weight,g=f[0].weight-y;function b(C){if(g===0)return(i+s)/2;let T=(C-y)/g;return i+T*(s-i)}let S=[],I=n/2,A=r/2;for(let C=0;C<f.length;C++){let T=f[C],L=b(T.weight),R=d[Zu(T.text)%d.length],$=T.color??l[C%l.length],B=!1,E=500,N=h==="archimedean"?4:5;for(let z=0;z<E;z++){let k,w;if(h==="archimedean"){let _=z*.1,O=N*_;k=O*Math.cos(_),w=O*Math.sin(_)}else{let _=Math.floor(z/4)+1,O=z%4,Y=(z%4===0?0:z)*N;switch(O){case 0:k=_*N*4,w=Y;break;case 1:k=-Y,w=_*N*4;break;case 2:k=-_*N*4,w=-Y;break;default:k=Y,w=-_*N*4;break}}let D=I+k,M=A+w,F=Xu(T.text,L,R,D,M),P={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!qu(P,n,r))continue;let W=!1;for(let _ of S)if(Ku(P,_.bbox)){W=!0;break}if(!W){S.push({text:T.text,x:D,y:M,fontSize:L,rotation:R,color:$,bbox:P}),B=!0;break}}}return S},[t,n,r,i,s,l,d,u,h]);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 p=[];m&&p.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],x=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;p.push(o("text",{key:`word-${f}`,transform:x,"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}},...p)}var Ju={0:"#1e293b",1:"#3b82f6"},Qu="#666";function na(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:h="#0f172a",padding:m=10,onCellClick:c,onCellHover:p,title:f}=e,y=n??Ju,x=t.length,g=X(()=>{let D=0;for(let M=0;M<t.length;M++){let F=t[M];F!==void 0&&F.length>D&&(D=F.length)}return D},[t]),b=u?20:0,S=f?24:0,I=X(()=>{let D=r-m*2-b,M=i-m*2-b-S;if(x===0||g===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(D-s*(g-1))/g),P=Math.max(0,(M-s*(x-1))/x);return{cellWidth:F,cellHeight:P}},[r,i,m,x,g,s,b,S]),A=v(D=>{let M=y[D];return M!==void 0?M:Qu},[y]),C=v(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),T=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]),L=v(()=>{if(!l||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=g*D+(g-1)*s,_=x*M+(x-1)*s,O=[];for(let Y=0;Y<=g;Y++){let K=F+Y*(D+s)-s/2;O.push(o("line",{key:`vgrid-${Y}`,x1:String(K),y1:String(P-s/2),x2:String(K),y2:String(P+_+s/2),stroke:d,"stroke-width":"0.5"}))}for(let Y=0;Y<=x;Y++){let K=P+Y*(M+s)-s/2;O.push(o("line",{key:`hgrid-${Y}`,x1:String(F-s/2),y1:String(K),x2:String(F+W+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return O},[l,x,g,I,m,b,S,s,d]),R=v(()=>{if(!u||x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<g;_++){let O=F+_*(D+s)+D/2,Y=P-6;W.push(o("text",{key:`col-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}for(let _=0;_<x;_++){let O=F-6,Y=P+_*(M+s)+M/2+3;W.push(o("text",{key:`row-idx-${_}`,x:String(O),y:String(Y),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(_)))}return W},[u,x,g,I,m,b,S,s]),$=v(()=>{if(x===0||g===0)return[];let{cellWidth:D,cellHeight:M}=I,F=m+b,P=m+b+S,W=[];for(let _=0;_<x;_++){let O=t[_];if(O!==void 0)for(let Y=0;Y<g;Y++){let K=Y<O.length?O[Y]:0,Q=F+Y*(D+s),q=P+_*(M+s),H=A(K),j={key:`cell-${_}-${Y}`,x:String(Q),y:String(q),width:String(D),height:String(M),fill:H,rx:String(a),ry:String(a)};if(c){let G=_,V=Y,Z=K;j.onClick=()=>c(G,V,Z),j.role="button",j.tabIndex=0}if(p){let G=_,V=Y,Z=K;j.onMouseEnter=()=>p(G,V,Z)}W.push(o("rect",j))}}return W},[x,g,t,I,m,b,S,s,a,A,c,p]),B=C(),E=T(),N=L(),z=R(),k=$(),w=f?`${f} \u2014 ${x}x${g} discrete grid`:`${x}x${g} 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},B,...E,...N,...z,...k)}
|